No regular expressions were active.
1 |
|
<?
|
|
|
2 |
|
|
|
|
3 |
|
/*********
**********
**********
**********
**********
**********
**********
******
|
|
|
4 |
|
*
D
olphin Sma
rt Communi
ty Builder
|
|
|
5 |
|
*
---------
--------
|
|
|
6 |
|
* begi
n
: M
on Mar 23
2006
|
|
|
7 |
|
* copy
right
: (
C) 2006 Bo
onEx Group
|
|
|
8 |
|
* webs
ite
: h
ttp://www.
boonex.com
/
|
|
|
9 |
|
* This fil
e is part
of Dolphin
- Smart C
ommunity B
uilder
|
|
|
10 |
|
*
|
|
|
11 |
|
* Dolphin
is free so
ftware. Th
is work is
licensed
under a Cr
eative Com
mons Attri
bution 3.0
License.
|
|
|
12 |
|
* http://c
reativecom
mons.org/l
icenses/by
/3.0/
|
|
|
13 |
|
*
|
|
|
14 |
|
* Dolphin
is distrib
uted in th
e hope tha
t it will
be useful,
but WITHO
UT ANY WAR
RANTY;
|
|
|
15 |
|
* without
even the i
mplied war
ranty of
MERCHANTAB
ILITY or F
ITNESS FOR
A PARTICU
LAR PURPOS
E.
|
|
|
16 |
|
* See the
Creative C
ommons Att
ribution 3
.0 License
for more
details.
|
|
|
17 |
|
* You shou
ld have re
ceived a c
opy of the
Creative
Commons At
tribution
3.0 Licens
e along wi
th Dolphin
,
|
|
|
18 |
|
* see lice
nse.txt fi
le; if not
, write to
marketing
@boonex.co
m
|
|
|
19 |
|
**********
**********
**********
**********
**********
**********
**********
*****/
|
|
|
20 |
|
|
|
|
21 |
|
require_on
ce( 'inc/h
eader.inc.
php' );
|
|
|
22 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'd
esign.inc.
php' );
|
|
|
23 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'g
roups.inc.
php' );
|
|
|
24 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'p
rof.inc.ph
p' );
|
|
|
25 |
|
|
|
|
26 |
|
// -------
-------- p
age variab
les and lo
gin
|
|
|
27 |
|
|
|
|
28 |
|
|
|
|
29 |
|
$_page['na
me_index']
= 78;
|
|
|
30 |
|
$_page['cs
s_name']
= 'gro
ups.css';
|
|
|
31 |
|
|
|
|
32 |
|
|
|
|
33 |
|
if ( !( $l
ogged['adm
in'] = mem
ber_auth(
1, false )
) )
|
|
|
34 |
|
if ( !
( $logged[
'member']
= member_a
uth( 0, fa
lse ) ) )
|
|
|
35 |
|
if
( !( $log
ged['aff']
= member_
auth( 2, f
alse )) )
|
|
|
36 |
|
$logged[
'moderator
'] = membe
r_auth( 3,
false );
|
|
|
37 |
|
|
|
|
38 |
|
$_page['he
ader'] = _
t( "_Searc
h Groups"
);
|
|
|
39 |
|
$_page['he
ader_text'
] = _t( "_
Search Gro
ups" );
|
|
|
40 |
|
|
|
|
41 |
|
// -------
-------- p
age compon
ents
|
|
|
42 |
|
|
|
|
43 |
|
$_ni = $_p
age['name_
index'];
|
|
|
44 |
|
$_page_con
t[$_ni]['p
age_main_c
ode'] = ''
;
|
|
|
45 |
|
|
|
|
46 |
|
|
|
|
47 |
|
//begin ma
in code
|
|
|
48 |
|
|
|
|
49 |
|
// get sea
rch params
|
|
|
50 |
|
$keyword
= $_REQUES
T['keyword
'];
|
|
|
51 |
|
$searchby
= $_REQUES
T['searchb
y'];
|
|
|
52 |
|
$categID
= $_REQUES
T['categID
'];
|
|
|
53 |
|
$Country
= $_REQUES
T['Country
'];
|
|
|
54 |
|
$City
= $_REQUES
T['City'];
|
|
|
55 |
|
$sortby
= $_REQUES
T['sortby'
];
|
|
|
56 |
|
// [END] g
et search
params
|
|
|
57 |
|
|
|
|
58 |
|
// check s
earch para
ms
|
|
|
59 |
|
unset( $ke
yword_db )
;
|
|
|
60 |
|
unset( $se
archby_db
);
|
|
|
61 |
|
unset( $ca
tegID_db )
;
|
|
|
62 |
|
unset( $Co
untry_db )
;
|
|
|
63 |
|
unset( $Ci
ty_db );
|
|
|
64 |
|
unset( $so
rtby_db );
|
|
|
65 |
|
|
|
|
66 |
|
if( isset(
$keyword)
and strlen
($keyword)
)
|
|
|
67 |
|
{
|
|
|
68 |
|
$keywo
rd = trim(
$keyword
);
|
|
|
69 |
|
if( st
rlen( $key
word ) )
|
|
|
70 |
|
$k
eyword_db
= strtoupp
er( proces
s_db_input
( $keyword
) );
|
|
|
71 |
|
$keywo
rd = proce
ss_pass_da
ta( $keywo
rd );
|
|
|
72 |
|
}
|
|
|
73 |
|
|
|
|
74 |
|
if( $searc
hby == 'na
me' or $se
archby ==
'keyword'
)
|
|
|
75 |
|
$searc
hby_db = $
searchby;
|
|
|
76 |
|
else
|
|
|
77 |
|
$searc
hby_db = $
searchby =
'keyword'
;
|
|
|
78 |
|
|
|
|
79 |
|
$categID_d
b = $categ
ID = (int)
$categID;
|
|
|
80 |
|
|
|
|
81 |
|
if( isset(
$Country
) and isse
t( $prof['
countries'
][$Country
] ) )
|
|
|
82 |
|
$Count
ry_db = $C
ountry;
|
|
|
83 |
|
else
|
|
|
84 |
|
$Count
ry = '';
|
|
|
85 |
|
|
|
|
86 |
|
if( isset(
$City) and
strlen($C
ity) )
|
|
|
87 |
|
{
|
|
|
88 |
|
$City
= trim( $C
ity );
|
|
|
89 |
|
if( st
rlen( $Cit
y ) )
|
|
|
90 |
|
$C
ity_db = s
trtoupper(
process_d
b_input( $
City ) );
|
|
|
91 |
|
$City
= process_
pass_data(
$City );
|
|
|
92 |
|
}
|
|
|
93 |
|
|
|
|
94 |
|
if( $sortb
y == 'Name
' or $sort
by == 'mem
bersCount'
or $sortb
y == 'crea
ted' )
|
|
|
95 |
|
$sortb
y_db = $so
rtby;
|
|
|
96 |
|
else
|
|
|
97 |
|
$sortb
y_db = $so
rtby = 'me
mbersCount
';
|
|
|
98 |
|
// [END] c
heck searc
h params
|
|
|
99 |
|
|
|
|
100 |
|
$_page_con
t[$_ni]['g
roups_sear
ch_form']
= PageComp
GroupsSear
chForm( $k
eyword, $s
earchby, $
categID, $
Country, $
City, $sor
tby );
|
|
|
101 |
|
|
|
|
102 |
|
if( $keywo
rd_db or $
categID_db
or $Count
ry_db or $
City )
|
|
|
103 |
|
$_page
_cont[$_ni
]['groups_
search_res
ults'] = P
ageCompGro
upsSearchR
esults( $k
eyword_db,
$searchby
_db, $cate
gID_db, $C
ountry_db,
$City_db,
$sortby_d
b );
|
|
|
104 |
|
else
|
|
|
105 |
|
$_page
_cont[$_ni
]['groups_
search_res
ults'] = '
';
|
|
|
106 |
|
|
|
|
107 |
|
// -------
-------- [
END] page
components
|
|
|
108 |
|
|
|
|
109 |
|
PageCode()
;
|
|
|
110 |
|
|
|
|
111 |
|
// -------
-------- p
age compon
ents funct
ions
|
|
|
112 |
|
|
|
|
113 |
|
function P
ageCompGro
upsSearchF
orm( $keyw
ord, $sear
chby, $cat
egID, $Cou
ntry, $Cit
y, $sortby
)
|
|
|
114 |
|
{
|
|
|
115 |
|
ob_sta
rt();
|
|
|
116 |
|
?>
|
|
|
117 |
|
<s
cript type
="text/jav
ascript">
|
|
|
118 |
|
var keyw
ord = '<?
=unbreak_j
s( str_rep
lace( '\''
,'\\\'', s
tr_replace
( '\\','\\
\\',$keywo
rd ) ) )?>
';
|
|
|
119 |
|
var sear
chby = '<?
=$searchby
?>';
|
|
|
120 |
|
var cate
gID = '<?
=$categID?
>';
|
|
|
121 |
|
var Coun
try = '<?
=$Country?
>';
|
|
|
122 |
|
var City
= '<?
=unbreak_j
s( str_rep
lace( '\''
,'\\\'', s
tr_replace
( '\\','\\
\\',$City
) ) )?>';
|
|
|
123 |
|
var sort
by = '<?
=$sortby?>
';
|
|
|
124 |
|
|
|
|
125 |
|
function
checkSear
chForm( )
|
|
|
126 |
|
{
|
|
|
127 |
|
_for
m = docume
nt.forms.g
roups_sear
ch_form;
|
|
|
128 |
|
if(
!_form )
|
|
|
129 |
|
return fal
se;
|
|
|
130 |
|
|
|
|
131 |
|
if(
!_form.key
word.value
&& !_form
.categID.v
alue && !_
form.Count
ry.value &
& !_form.C
ity.value
)
|
|
|
132 |
|
{
|
|
|
133 |
|
alert( '<?
=_t('_Plea
se select
at least o
ne search
parameter'
)?>' );
|
|
|
134 |
|
return fal
se;
|
|
|
135 |
|
}
|
|
|
136 |
|
}
|
|
|
137 |
|
|
|
|
138 |
|
function
switchGro
upsSearchP
age(page)
|
|
|
139 |
|
{
|
|
|
140 |
|
_for
m = docume
nt.forms.g
roups_sear
ch_form;
|
|
|
141 |
|
if(
!_form )
|
|
|
142 |
|
return fal
se;
|
|
|
143 |
|
|
|
|
144 |
|
_for
m.keyword.
value = ke
yword;
|
|
|
145 |
|
_for
m.categID.
value = ca
tegID;
|
|
|
146 |
|
_for
m.Country.
value = Co
untry;
|
|
|
147 |
|
_for
m.City.val
ue = Ci
ty;
|
|
|
148 |
|
|
|
|
149 |
|
for(
i = 0; i
< _form.se
archby.len
gth; i ++
)
|
|
|
150 |
|
if( _form.
searchby[i
].value ==
searchby
)
|
|
|
151 |
|
_form.
searchby[i
].checked
= true;
|
|
|
152 |
|
|
|
|
153 |
|
for(
i = 0; i
< _form.so
rtby.lengt
h; i ++ )
|
|
|
154 |
|
if( _form.
sortby[i].
value == s
ortby )
|
|
|
155 |
|
_form.
sortby[i].
checked =
true;
|
|
|
156 |
|
|
|
|
157 |
|
_for
m.page.val
ue = page;
|
|
|
158 |
|
|
|
|
159 |
|
_for
m.submit()
;
|
|
|
160 |
|
retu
rn true;
|
|
|
161 |
|
}
|
|
|
162 |
|
</
script>
|
|
|
163 |
|
<?php
|
|
|
164 |
|
$sRetJ
S = ob_get
_clean();
|
|
|
165 |
|
|
|
|
166 |
|
//if (
isset($_RE
QUEST['cat
egID']) &&
isset($_R
EQUEST['se
archby'])=
=FALSE) re
turn $sRet
JS;
|
|
|
167 |
|
$bNoFi
lter = fal
se;
|
|
|
168 |
|
if (is
set($_REQU
EST['categ
ID']) && i
sset($_REQ
UEST['nf']
) && (int)
$_REQUEST[
'nf'] == 1
) $bNoFilt
er = true;
|
|
|
169 |
|
if ($b
NoFilter =
= true) $s
DisplaySty
le='style=
"display:n
one"';
|
|
|
170 |
|
if ($b
NoFilter =
= true) $s
NFelement
= '<input
type="hidd
en" name="
nf" value=
"1" />';
|
|
|
171 |
|
|
|
|
172 |
|
global
$prof;
|
|
|
173 |
|
ob_sta
rt();
|
|
|
174 |
|
|
|
|
175 |
|
$ch =
'checked="
checked"';
|
|
|
176 |
|
?>
|
|
|
177 |
|
<d
iv class="
groups_sea
rch_adv" <
?=$sDispla
yStyle?> >
|
|
|
178 |
|
<div cla
ss="clear_
both"></di
v>
|
|
|
179 |
|
<form ac
tion="<?=$
site['url'
]?>groups_
browse.php
" method="
GET" name=
"groups_se
arch_form"
onsubmit=
"return ch
eckSearchF
orm();">
|
|
|
180 |
|
|
|
|
181 |
|
<div
class="gr
oups_searc
h_row">
|
|
|
182 |
|
<div class
="groups_s
earch_labe
l"><?=_t('
_Keyword')
?>:</div>
|
|
|
183 |
|
<div class
="groups_s
earch_valu
e">
|
|
|
184 |
|
<input
type="tex
t" id="key
word" name
="keyword"
class="gr
oups_searc
h_text" va
lue="<?=ht
mlspecialc
hars_adv($
keyword)?>
" />
|
|
|
185 |
|
</div>
|
|
|
186 |
|
<div class
="clear_bo
th"></div>
|
|
|
187 |
|
</di
v>
|
|
|
188 |
|
|
|
|
189 |
|
<div
class="gr
oups_searc
h_row">
|
|
|
190 |
|
<div class
="groups_s
earch_labe
l"><?=_t('
_Search by
')?>:</div
>
|
|
|
191 |
|
<div class
="groups_s
earch_valu
e">
|
|
|
192 |
|
<input
type="rad
io" name="
searchby"
class="gro
ups_search
_radio" va
lue="name"
id="searc
hby_name"
<?=($searc
hby == 'na
me' ? $ch
: '')?> />
|
|
|
193 |
|
<label
for="sear
chby_name"
class="gr
oups_searc
h_labelfor
"><?=_t('_
by group n
ame')?></l
abel>
|
|
|
194 |
|
|
|
|
195 |
|
<input
type="rad
io" name="
searchby"
class="gro
ups_search
_radio" va
lue="keywo
rd" id="se
archby_key
word" <?=(
$searchby
== 'keywor
d' ? $ch :
'')?> />
|
|
|
196 |
|
<label
for="sear
chby_keywo
rd" class=
"groups_se
arch_label
for"><?=_t
('_by keyw
ord')?></l
abel>
|
|
|
197 |
|
</div>
|
|
|
198 |
|
<div class
="clear_bo
th"></div>
|
|
|
199 |
|
</di
v>
|
|
|
200 |
|
|
|
|
201 |
|
<div
class="gr
oups_searc
h_row">
|
|
|
202 |
|
<div class
="groups_s
earch_labe
l"><?=_t('
_Category'
)?>:</div>
|
|
|
203 |
|
<div class
="groups_s
earch_valu
e">
|
|
|
204 |
|
<selec
t id="cate
gID" name=
"categID"
class="gro
ups_search
_select" /
>
|
|
|
205 |
|
<o
ption valu
e=""><?=_t
('_Any')?>
</option>
|
|
|
206 |
|
<?php
|
|
|
207 |
|
$resVa
ls = db_re
s( "SELECT
* FROM `G
roupsCateg
` ORDER BY
`Name`" )
;
|
|
|
208 |
|
while
( $arr = m
ysql_fetch
_assoc( $r
esVals ) )
|
|
|
209 |
|
ec
ho "<optio
n value=\"
{$arr['ID'
]}\"".($ca
tegID == $
arr['ID']
? ' select
ed="select
ed"' : '')
.">".
|
|
|
210 |
|
htmlspecia
lchars_adv
( $arr['Na
me'] )."</
option>\n"
;
|
|
|
211 |
|
?>
|
|
|
212 |
|
</sele
ct>
|
|
|
213 |
|
</div>
|
|
|
214 |
|
<div class
="clear_bo
th"></div>
|
|
|
215 |
|
</di
v>
|
|
|
216 |
|
|
|
|
217 |
|
<div
class="gr
oups_searc
h_row">
|
|
|
218 |
|
<div class
="groups_s
earch_labe
l"><?=_t('
_Country')
?>:</div>
|
|
|
219 |
|
<div class
="groups_s
earch_valu
e">
|
|
|
220 |
|
<selec
t id="Coun
try" name=
"Country"
class="gro
ups_search
_select" /
>
|
|
|
221 |
|
<o
ption valu
e=""><?=_t
('_Any')?>
</option>
|
|
|
222 |
|
<?php
|
|
|
223 |
|
foreac
h( $prof['
countries'
] as $key
=> $val )
|
|
|
224 |
|
ec
ho "<optio
n value=\"
$key\"".(s
trcmp($Cou
ntry, $key
) ? '' : '
selected=
"selected"
').">".
|
|
|
225 |
|
_t("__$val
")."</opti
on>\n";
|
|
|
226 |
|
?>
|
|
|
227 |
|
</sele
ct>
|
|
|
228 |
|
</div>
|
|
|
229 |
|
<div class
="clear_bo
th"></div>
|
|
|
230 |
|
</di
v>
|
|
|
231 |
|
|
|
|
232 |
|
<div
class="gr
oups_searc
h_row">
|
|
|
233 |
|
<div class
="groups_s
earch_labe
l"><?=_t('
_City')?>:
</div>
|
|
|
234 |
|
<div class
="groups_s
earch_valu
e">
|
|
|
235 |
|
<input
type="tex
t" id="Cit
y" name="C
ity" class
="groups_s
earch_text
" value="<
?=htmlspec
ialchars_a
dv($City)?
>" />
|
|
|
236 |
|
</div>
|
|
|
237 |
|
<div class
="clear_bo
th"></div>
|
|
|
238 |
|
</di
v>
|
|
|
239 |
|
|
|
|
240 |
|
<div
class="gr
oups_searc
h_row">
|
|
|
241 |
|
<div class
="groups_s
earch_labe
l"><?=_t('
_Sort by')
?>:</div>
|
|
|
242 |
|
<div class
="groups_s
earch_valu
e">
|
|
|
243 |
|
<input
type="rad
io" name="
sortby" cl
ass="group
s_search_r
adio" valu
e="Name" i
d="sortby_
Name" <?=(
$sortby ==
'Name' ?
$ch : '')?
> />
|
|
|
244 |
|
<label
for="sort
by_Name" c
lass="grou
ps_search_
labelfor">
<?=_t('_by
group nam
e')?></lab
el>
|
|
|
245 |
|
|
|
|
246 |
|
<input
type="rad
io" name="
sortby" cl
ass="group
s_search_r
adio" valu
e="members
Count" id=
"sortby_me
mbersCount
" <?=($sor
tby == 'me
mbersCount
' ? $ch :
'')?> />
|
|
|
247 |
|
<label
for="sort
by_members
Count" cla
ss="groups
_search_la
belfor"><?
=_t('_by p
opular')?>
</label>
|
|
|
248 |
|
|
|
|
249 |
|
<input
type="rad
io" name="
sortby" cl
ass="group
s_search_r
adio" valu
e="created
" id="sort
by_created
" <?=($sor
tby == 'cr
eated' ? $
ch : '')?>
/>
|
|
|
250 |
|
<label
for="sort
by_created
" class="g
roups_sear
ch_labelfo
r"><?=_t('
_by newest
')?></labe
l>
|
|
|
251 |
|
</div>
|
|
|
252 |
|
<div class
="clear_bo
th"></div>
|
|
|
253 |
|
</di
v>
|
|
|
254 |
|
|
|
|
255 |
|
<inp
ut type="h
idden" nam
e="page" v
alue="1" /
>
|
|
|
256 |
|
<?=$
sNFelement
?>
|
|
|
257 |
|
<div
class="gr
oups_searc
h_row_cent
er">
|
|
|
258 |
|
<input typ
e="submit"
value="<?
=_t('_Sear
ch')?>" cl
ass="group
s_search_l
abelfor" /
>
|
|
|
259 |
|
<div class
="clear_bo
th"></div>
|
|
|
260 |
|
</di
v>
|
|
|
261 |
|
</form>
|
|
|
262 |
|
<div cla
ss="clear_
both"></di
v>
|
|
|
263 |
|
</
div>
|
|
|
264 |
|
<?php
|
|
|
265 |
|
$sRetH
tml = ob_g
et_clean()
;
|
|
|
266 |
|
|
|
|
267 |
|
return
($bNoFilt
er == true
) ? $sRetJ
S . $sRetH
tml : Desi
gnBoxConte
nt ( _t('_
Search Gro
ups'), $sR
etJS . $sR
etHtml, 1)
;
|
|
|
268 |
|
//retu
rn DesignB
oxContent
( _t('_Sea
rch Groups
'), $sRetJ
S . $sRetH
tml, 1);
|
|
|
269 |
|
}
|
|
|
270 |
|
|
|
|
271 |
|
// Ma-an i
t is crazy
. I don't
know what
they'll en
ter in sea
rch form =
)
|
|
|
272 |
|
// Our tes
ters enter
ed <script
>alert(1)<
/script> i
t has brok
en everyth
ing
|
|
|
273 |
|
function u
nbreak_js(
$text )
|
|
|
274 |
|
{
|
|
|
275 |
|
return
str_repla
ce( '</scr
ipt>', "</
scr'+'ipt>
", $text )
;
|
|
|
276 |
|
}
|
|
|
277 |
|
|
|
|
278 |
|
?>
|
|
|