224. File Comparison Report

Produced on Mon May 12 13:05:15 2008 UTC. This report uses XHTML and CSS2, and is best viewed with a reasonably standards compliant browser such as the latest version of Firefox or Internet Explorer. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

224.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.0.5\inc admin.inc.php Fri Jan 4 08:25:26 2008 UTC
2 Dolphin-v.6.1.0\inc admin.inc.php Sat Apr 26 08:19:14 2008 UTC

224.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 54 2354
Changed 38 97
Inserted 9 48
Removed 6 20

224.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

224.4 Active regular expressions

No regular expressions were active.

224.5 Comparison detail

1   <?   1   <?
2     2  
3   /********* ********** ********** ********** ********** ********** ********** ******   3   /********* ********** ********** ********** ********** ********** ********** ******
4   *                              D olphin Sma rt Communi ty Builder   4   *                              D olphin Sma rt Communi ty Builder
5   *                                 --------- --------   5   *                                 --------- --------
6   *     begi n                 : M on Mar 23  2006   6   *     begi n                 : M on Mar 23  2006
7   *     copy right             : ( C) 2006 Bo onEx Group   7   *     copy right             : ( C) 2006 Bo onEx Group
8   *     webs ite               : h ttp://www. boonex.com /   8   *     webs ite               : h ttp://www. boonex.com /
9   * This fil e is part  of Dolphin  - Smart C ommunity B uilder   9   * This fil e is part  of Dolphin  - Smart C ommunity B uilder
10   *   10   *
11   * Dolphin  is free so ftware. Th is work is  licensed  under a Cr eative Com mons Attri bution 3.0  License.    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/   12   * http://c reativecom mons.org/l icenses/by /3.0/
13   *   13   *
14   * Dolphin  is distrib uted in th e hope tha t it will  be useful,  but WITHO UT ANY WAR RANTY;   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.   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.    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   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   18   * see lice nse.txt fi le; if not , write to  marketing @boonex.co m
19   ********** ********** ********** ********** ********** ********** ********** *****/   19   ********** ********** ********** ********** ********** ********** ********** *****/
20     20  
21   require_on ce( 'heade r.inc.php'  );   21   require_on ce( 'heade r.inc.php'  );
22   require_on ce( BX_DIR ECTORY_PAT H_INC . 'm atch.inc.p hp' );    
23   require_on ce( BX_DIR ECTORY_PAT H_INC . 'u tils.inc.p hp' );   22   require_on ce( BX_DIR ECTORY_PAT H_INC . 'u tils.inc.p hp' );
24   require_on ce( BX_DIR ECTORY_PAT H_INC . 'm odules.inc .php' );   23   require_on ce( BX_DIR ECTORY_PAT H_INC . 'm odules.inc .php' );
25   require_on ce( BX_DIR ECTORY_PAT H_INC . 's haring.inc .php' );    
26   require_on ce( BX_DIR ECTORY_PAT H_INC . 'd esign.inc. php' );   24   require_on ce( BX_DIR ECTORY_PAT H_INC . 'd esign.inc. php' );
    25   require_on ce( BX_DIR ECTORY_PAT H_INC . 's haring.inc .php' );
27   require_on ce( BX_DIR ECTORY_PAT H_INC . 'a dmin_desig n.inc.php'  );   26   require_on ce( BX_DIR ECTORY_PAT H_INC . 'a dmin_desig n.inc.php'  );
28     27  
29   require_on ce( BX_DIR ECTORY_PAT H_CLASSES  . 'BxDolBl ogs.php' ) ;   28   require_on ce( BX_DIR ECTORY_PAT H_CLASSES  . 'BxDolBl ogs.php' ) ;
30   require_on ce( BX_DIR ECTORY_PAT H_CLASSES  . 'BxDolCl assifieds. php' );   29   require_on ce( BX_DIR ECTORY_PAT H_CLASSES  . 'BxDolCl assifieds. php' );
31   require_on ce( BX_DIR ECTORY_PAT H_CLASSES  . 'BxDolEv ents.php'  );   30   require_on ce( BX_DIR ECTORY_PAT H_CLASSES  . 'BxDolEv ents.php'  );
    31   require_on ce( BX_DIR ECTORY_PAT H_CLASSES  . 'BxDolSh aredMedia. php' );
32     32  
33   $menu_colo r_0 = "#dd dddd";   33   $menu_colo r_0 = "#dd dddd";
34     34  
35   function   login_form (   $text   =   "",   $member   =   0  
)
  35   function   login_form (   $text   =   "",   $member   =   0 ,   $bbAjaxMod e   =   false   )
36   {   36   {
37       global  $site;   37       global  $site;
38       global  $_page_co nt;   38       global  $_page_co nt;
39       global  $_page;   39       global  $_page;
40       global  $admin_di r;   40       global  $admin_di r;
41       global  $logged;   41       global  $logged;
42       global  $dir_dir;   42       global  $dir_dir;
43       global  $dir;   43       global  $dir;
44       global  $tmpl;   44       global  $tmpl;
45       global  $l,$d;   45       global  $l,$d;
46     46  
47       switch ( $member  )   47       switch ( $member  )
48       {   48       {
49           ca se 0:   49           ca se 0:
50                $mem          = _t( "_Member") ;   50                $mem          = _t( "_Member") ;
51                $table        = "Pr ofiles";   51                $table        = "Pr ofiles";
52                $login_p age  = "{$ site['url' ]}member.p hp";   52                $login_p age  = "{$ site['url' ]}member.p hp";
53                 $join_page     =   "{$site['u rl']}join _form .php";   53                 $join_page     =   "{$site['u rl']}join
.php";
54                $forgot_ page = "{$ site['url' ]}forgot.p hp";   54                $forgot_ page = "{$ site['url' ]}forgot.p hp";
55                $templat e    = "{$ dir['root' ]}template s/tmpl_{$t mpl}/login _form.html ";   55                $templat e    = "{$ dir['root' ]}template s/tmpl_{$t mpl}/login _form.html ";
56           br eak;   56           br eak;
57           ca se 1:   57           ca se 1:
58                $mem          = 'Ad min';   58                $mem          = 'Ad min';
59                $table        = 'Ad mins';   59                $table        = 'Ad mins';
60                $login_p age  = "{$ site['url_ admin']}in dex.php";   60                $login_p age  = "{$ site['url_ admin']}in dex.php";
61                $join_pa ge   = '';   61                $join_pa ge   = '';
62                $forgot_ page = '';   62                $forgot_ page = '';
63                 $template      =   "{$dir['ro ot']}
admin
/login_for m.html";
  63                 $template      =   "{$dir['ro ot']} {$ admin _dir} /login_for m.html";
64           br eak;   64           br eak;
65           ca se 2:   65           ca se 2:
66                $mem          = "Af filiate";   66                $mem          = "Af filiate";
67                $table        = 'af f';   67                $table        = 'af f';
68                $login_p age  = "{$ site['url_ aff']}inde x.php";   68                $login_p age  = "{$ site['url_ aff']}inde x.php";
69                $join_pa ge   = '';   69                $join_pa ge   = '';
70                $forgot_ page = '';   70                $forgot_ page = '';
71                 $template      =   "{$dir['ro ot']}
admin
/login_for m.html";
  71                 $template      =   "{$dir['ro ot']} {$ admin _dir} /login_for m.html";
72           br eak;   72           br eak;
73           ca se 3:   73           ca se 3:
74                $mem          = "Mo derator";   74                $mem          = "Mo derator";
75                $table        = 'mo derators';   75                $table        = 'mo derators';
76                $login_p age  = "{$ site['url' ]}moderato rs/index.p hp";   76                $login_p age  = "{$ site['url' ]}moderato rs/index.p hp";
77                $join_pa ge   = '';   77                $join_pa ge   = '';
78                $forgot_ page = '';   78                $forgot_ page = '';
79                 $template      =   "{$dir['ro ot']}
admin
/login_for m.html";
  79                 $template      =   "{$dir['ro ot']} {$ admin _dir} /login_for m.html";
80           br eak;   80           br eak;
81       }   81       }
82     82  
83       $_page ['header']  = "{$site ['title']}  "._t("_Me mber Login ");   83       $_page ['header']  = "{$site ['title']}  "._t("_Me mber Login ");
84       $_page ['header_t ext'] = _t ("_Member  Login");   84       $_page ['header_t ext'] = _t ("_Member  Login");
85     85  
86       // If  path is di vided with  \\ (Windo ws) then u se \\ inst ead of /   86       // If  path is di vided with  \\ (Windo ws) then u se \\ inst ead of /
87        $script_fi lename   =   strlen($_S ERVER[' SCRI P
T
_ FILE N
A M E
'])   ?   $_SERVER[' SCRI P
T
_ FILE N
A M E
']   :   $_SERVER[' SCRIPT_NAM E'];
  87        $script_fi lename   =   strlen($_S ERVER['
P A T H _ TRA N SL A T E D '])   ?   $_SERVER['
P A T H _ TRA N SL A T E D ']   :   $_SERVER[' SCRIPT_NAM E'];
88       if ( s trstr($scr ipt_filena me, '/') )   88       if ( s trstr($scr ipt_filena me, '/') )
89       {   89       {
90           $a rr1 = spli t("/", $sc ript_filen ame);   90           $a rr1 = spli t("/", $sc ript_filen ame);
91           $s 1 = $arr1[ count($arr 1)-2];   91           $s 1 = $arr1[ count($arr 1)-2];
92       }   92       }
93       elseif  ( strstr( $script_fi lename, '\ \\\') )   93       elseif  ( strstr( $script_fi lename, '\ \\\') )
94       {   94       {
95           $a rr1 = spli t("\\\\",  $script_fi lename);   95           $a rr1 = spli t("\\\\",  $script_fi lename);
96           $s 1 = $arr1[ count($arr 1)-3];   96           $s 1 = $arr1[ count($arr 1)-3];
97       }   97       }
98     98  
    99       if ($b bAjaxMode  && $member ==0) {
    100           $t emplate =  "{$dir['ro ot']}templ ates/tmpl_ {$tmpl}/lo gin_form_a jax.html";
    101       } else if ($bbAja xMode && $ member==1)  {
    102           $t emplate =  "{$dir['ro ot']}templ ates/base/ login_form _ajax_a.ht ml";
    103       }
99       $_page _cont[0][' page_main_ code'] = P ageCompLog inForm($te xt,$member ,$mem,$tab le,$login_ page,$join _page,$for got_page,$ template);   104       $_page _cont[0][' page_main_ code'] = P ageCompLog inForm($te xt,$member ,$mem,$tab le,$login_ page,$join _page,$for got_page,$ template);
100     105  
    106       if ($b bAjaxMode  == true &&  $member = = 1) {
    107           pr int TopCod eAdmin();
    108           pr int '<link  href="'.$ site['url_ admin'].'s tyles/logi n_form_aja x.css" rel ="styleshe et" type=" text/css"  />';
    109           pr int '<div  style="bor der:0px so lid #666;w idth:350px ;margin:25 0px auto 0 px;">';
    110           pr int $_page _cont[0][' page_main_ code'];
    111           pr int '</div >';
    112           pr int Bottom Code();
    113           ex it;
    114       }
    115  
    116       if ($b bAjaxMode)  {
    117           //  if ($memb er == 1) {
    118                // print  TopCodeAd min();
    119                // print  '<link hr ef="'.$sit e['url_adm in'].'styl es/login_f orm_ajax.c ss" rel="s tylesheet"  type="tex t/css" />' ;
    120           //  }
    121           pr int '<div  style="bor der:0px so lid #666;w idth:350px ;margin:25 0px auto 0 px;">';
    122           pr int $_page _cont[0][' page_main_ code'];
    123           pr int '</div >';
    124           //  if ($memb er == 1) {
    125                // print  BottomCod e();
    126           //  }
    127           ex it;
    128       }
    129  
101       if ( $ s1 != $adm in_dir &&  $s1 != "af f" && $s1  != $dir_di r && $s1 ! = "events"  && $s1 !=  "moderato rs")   130       if ( $ s1 != $adm in_dir &&  $s1 != "af f" && $s1  != $dir_di r && $s1 ! = "events"  && $s1 !=  "moderato rs")
102       {   131       {
103           $_ page['name _index'] =  0;   132           $_ page['name _index'] =  0;
104           Pa geCode();   133           Pa geCode();
105           ex it;   134           ex it;
106       }   135       }
107       else   136       else
108       {   137       {
109           re quire_once ( BX_DIREC TORY_PATH_ INC . 'adm in_design. inc.php' ) ;   138           re quire_once ( BX_DIREC TORY_PATH_ INC . 'adm in_design. inc.php' ) ;
110              139           
111           $_ page['head er'] = "{$ site['titl e']} $mem  Login";   140           $_ page['head er'] = "{$ site['titl e']} $mem  Login";
112              141           
113           To pCodeAdmin ();   142           To pCodeAdmin ();
114           ec ho $_page_ cont[0]['p age_main_c ode'];   143           ec ho $_page_ cont[0]['p age_main_c ode'];
115              144           
116           if ( strlen(  $text ) )   145           if ( strlen(  $text ) )
117           {   146           {
118                ?>   147                ?>
119                <script  type="text /javascrip t">   148                <script  type="text /javascrip t">
120                    addE vent( wind ow, 'load' , function (){ alert(  '<?= $tex t ?>' ); }  );   149                    addE vent( wind ow, 'load' , function (){ alert(  '<?= $tex t ?>' ); }  );
121                </script >   150                </script >
122                <?   151                <?
123           }   152           }
124           Bo ttomCode() ;   153           Bo ttomCode() ;
125       }   154       }
126   }   155   }
127     156  
128   function P ageCompLog inForm( $t ext, $memb er, $mem,  $table, $l ogin_page,  $join_pag e, $forgot _page, $te mplate = ' ' )   157   function P ageCompLog inForm( $t ext, $memb er, $mem,  $table, $l ogin_page,  $join_pag e, $forgot _page, $te mplate = ' ' )
129   {   158   {
130       global  $site;   159       global  $site;
131       global  $dir;   160       global  $dir;
132       global  $tmpl;   161       global  $tmpl;
133     162  
134       $aForm Replace =  array();   163       $aForm Replace =  array();
135          164       
136       if ( $ member ==  1 )   165       if ( $ member ==  1 )
137           $n ame_label  = _t("_Log  In");   166           $n ame_label  = _t("_Log  In");
138       else   167       else
139           if  ( $member  == 2 )   168           if  ( $member  == 2 )
140                $name_la bel = _t(" _ID");   169                $name_la bel = _t(" _ID");
141           el se   170           el se
142                $name_la bel = _t(" _E-mail or  ID");   171                $name_la bel = _t(" _E-mail or  ID");
143          172       
144       $aForm Replace['h eader_text ']    = $s ite['title '] . ' ' .  $mem . '  Login';   173       $aForm Replace['h eader_text ']    = $s ite['title '] . ' ' .  $mem . '  Login';
145       $aForm Replace['w arning_tex t']   = $t ext;   174       $aForm Replace['w arning_tex t']   = $t ext;
146       $aForm Replace['a ction_url' ]     = $l ogin_page;   175       $aForm Replace['a ction_url' ]     = $l ogin_page;
147        $aFormRepl ace[' reloc a t e _url ']     =   $ _SERVER [' PHP_SELF '];   176  
    177       if( !$ sUrlReloca te = $_REQ UEST['relo cate'] or  basename(  $_REQUEST[ 'relocate' ] ) == 'in dex.php' o r basename ( $_REQUES T['relocat e'] ) == ' join.php'  )
    178           $s UrlRelocat e = $_SERV ER['PHP_SE LF'];
    179  
    180       $aForm Replace['s ite_a_url' ]   = $sit e['url'];  //$_SERVER ['PHP_SELF '];
    181       $aForm Replace['r elocate_ur l']   = ht mlspecialc hars( $sUr lRelocate  ); //$_SER VER['PHP_S ELF'];
    182        $aFormRepl ace[' im a g e s ']           =   $ site [' images '];
148       $aForm Replace['n ame_label' ]     = $n ame_label;   183       $aForm Replace['n ame_label' ]     = $n ame_label;
149       $aForm Replace['p assword_la bel'] = _t ("_Passwor d");   184       $aForm Replace['p assword_la bel'] = _t ("_Passwor d");
150       $aForm Replace['s ubmit_labe l']   = _t ("_Log In" );   185       $aForm Replace['s ubmit_labe l']   = _t ("_Log In" );
    186       $aForm Replace['r emeber_lab el']  = _t ("_Remembe r password ");
    187       $sLogi nC = _t('_ PROFILE_ER R');
    188       $aForm Replace['f orm_onsubm it']   = < <<EOF
    189   EcecuteAja x('check_l ogin', '',  '{$sLogin C}');
    190   return fal se;
    191   EOF;
151          192       
152       if( $f orgot_page  )   193       if( $f orgot_page  )
153       {   194       {
154           $a FormReplac e['forgot_ page_url']  = $forgot _page;   195           $a FormReplac e['forgot_ page_url']  = $forgot _page;
155           $a FormReplac e['forgot_ label']     = _t("_fo rgot_your_ password")  . '?';   196           $a FormReplac e['forgot_ label']     = _t("_fo rgot_your_ password")  . '?';
156       }   197       }
157       else   198       else
158       {   199       {
159           $a FormReplac e['forgot_ page_url']  = '';   200           $a FormReplac e['forgot_ page_url']  = '';
160           $a FormReplac e['forgot_ label']     = '';   201           $a FormReplac e['forgot_ label']     = '';
161       }   202       }
162          203       
163       if( $j oin_page )   204       if( $j oin_page )
164       {   205       {
165           $a FormReplac e['not_a_m ember']  =  _t('_not_ a_member') ;   206           $a FormReplac e['not_a_m ember']  =  _t('_not_ a_member') ;
166              207           
167           $a FormReplac e['or']             =  _t( '_or'  );   208           $a FormReplac e['or']             =  _t( '_or'  );
168           $a FormReplac e['join_la bel']    =  _t( '_Joi n now' );   209           $a FormReplac e['join_la bel']    =  _t( '_Joi n now' );
169           $a FormReplac e['join_pa ge_url'] =  $join_pag e;   210           $a FormReplac e['join_pa ge_url'] =  $join_pag e;
170       }   211       }
171       else   212       else
172       {   213       {
173           $a FormReplac e['not_a_m ember']  =  '';   214           $a FormReplac e['not_a_m ember']  =  '';
174           $a FormReplac e['join_la bel']    =  '';   215           $a FormReplac e['join_la bel']    =  '';
175           $a FormReplac e['join_pa ge_url'] =  '';   216           $a FormReplac e['join_pa ge_url'] =  '';
176       }   217       }
177          218       
178          219       
179       if( !s trlen( $te mplate ) )   220       if( !s trlen( $te mplate ) )
180           $t emplate =  "{$dir['ro ot']}templ ates/tmpl_ {$tmpl}/lo gin_form.h tml";   221           $t emplate =  "{$dir['ro ot']}templ ates/tmpl_ {$tmpl}/lo gin_form.h tml";
181          222       
182       $ret =  file_get_ contents(  $template  );   223       $ret =  file_get_ contents(  $template  );
183          224       
184       foreac h( $aFormR eplace as  $key => $v al )   225       foreac h( $aFormR eplace as  $key => $v al )
185           $r et = str_r eplace( "_ _{$key}__" , $val, $r et );   226           $r et = str_r eplace( "_ _{$key}__" , $val, $r et );
186          227       
187       return  $ret;   228       return  $ret;
188   }   229   }
189     230  
190   function a ctivation_ mail( $ID,  $text = 1  )   231   function a ctivation_ mail( $ID,  $text = 1  )
191   {   232   {
192       global  $site;   233       global  $site;
193       global  $ret;   234       global  $ret;
194     235  
195       $ID =  (int)$ID;   236       $ID =  (int)$ID;
196       $p_arr  = db_arr(  "SELECT ` Email` FRO M `Profile s` WHERE ` ID` = '$ID '" );   237       $p_arr  = db_arr(  "SELECT ` Email` FRO M `Profile s` WHERE ` ID` = '$ID '" );
197       if ( ! $p_arr )   238       if ( ! $p_arr )
198       {   239       {
199           $r et['ErrorC ode'] = 7;   240           $r et['ErrorC ode'] = 7;
200           re turn false ;   241           re turn false ;
201       }   242       }
202     243  
203     244  
204     245  
205       $messa ge    = ge tParam( 't _Confirmat ion' );   246       $messa ge    = ge tParam( 't _Confirmat ion' );
206       $subje ct    = ge tParam( 't _Confirmat ion_subjec t' );   247       $subje ct    = ge tParam( 't _Confirmat ion_subjec t' );
207       $recip ient  = $p _arr['Emai l'];   248       $recip ient  = $p _arr['Emai l'];
208     249  
209       $sConf irmationCo de  = base 64_encode(  base64_en code( cryp t( $recipi ent, "secr et_confirm ation_stri ng" ) ) );   250       $sConf irmationCo de  = base 64_encode(  base64_en code( cryp t( $recipi ent, "secr et_confirm ation_stri ng" ) ) );
210       $sConf irmationLi nk  = "{$s ite['url'] }profile_a ctivate.ph p?ConfID={ $ID}&ConfC ode=" . ur lencode( $ sConfirmat ionCode );   251       $sConf irmationLi nk  = "{$s ite['url'] }profile_a ctivate.ph p?ConfID={ $ID}&ConfC ode=" . ur lencode( $ sConfirmat ionCode );
211     252  
212       $aPlus  = array() ;   253       $aPlus  = array() ;
213       $aPlus ['ConfCode '] = $sCon firmationC ode;   254       $aPlus ['ConfCode '] = $sCon firmationC ode;
214       $aPlus ['Confirma tionLink']  = $sConfi rmationLin k;   255       $aPlus ['Confirma tionLink']  = $sConfi rmationLin k;
215     256  
216       $mail_ ret = send Mail( $rec ipient, $s ubject, $m essage, $I D, $aPlus  );   257       $mail_ ret = send Mail( $rec ipient, $s ubject, $m essage, $I D, $aPlus  );
217     258  
218       if ( $ mail_ret )   259       if ( $ mail_ret )
219       {   260       {
220           if  ( $text )   261           if  ( $text )
221           {   262           {
222                $page_te xt .= '<di v class="N otice">' .  _t("_EMAI L_CONF_SEN T") . "</d iv>";   263                $page_te xt .= '<di v class="N otice">' .  _t("_EMAI L_CONF_SEN T") . "</d iv>";
223                   264                
224                $page_te xt .= "<ce nter><form  method=ge t action=\ "{$site['u rl']}profi le_activat e.php\">";   265                $page_te xt .= "<ce nter><form  method=ge t action=\ "{$site['u rl']}profi le_activat e.php\">";
225                $page_te xt .= "<ta ble class= text2 cell spacing=0  cellpaddin g=0><td><b >"._t("_EN TER_CONF_C ODE").":</ b>&nbsp;</ td><td><in put type=h idden name =\"ConfID\ " value=\" {$ID}\">";   266                $page_te xt .= "<ta ble class= text2 cell spacing=0  cellpaddin g=0><td><b >"._t("_EN TER_CONF_C ODE").":</ b>&nbsp;</ td><td><in put type=h idden name =\"ConfID\ " value=\" {$ID}\">";
226                $page_te xt .= '<in put class= no type="t ext" name= "ConfCode"  size=30>< /td><td>&n bsp;</td>' ;   267                $page_te xt .= '<in put class= no type="t ext" name= "ConfCode"  size=30>< /td><td>&n bsp;</td>' ;
227                $page_te xt .= '<td ><input cl ass=no typ e="submit"  value="'. _t("_Submi t").'"></t d></table> ';   268                $page_te xt .= '<td ><input cl ass=no typ e="submit"  value="'. _t("_Submi t").'"></t d></table> ';
228                $page_te xt .= '</f orm></cent er><br />' ;   269                $page_te xt .= '</f orm></cent er><br />' ;
229           }   270           }
230           el se   271           el se
231                return t rue;   272                return t rue;
232       }   273       }
233       else   274       else
234       {   275       {
235           if  ( $text )   276           if  ( $text )
236                $page_te xt .= "<br  /><br />" ._t("_EMAI L_CONF_NOT _SENT");   277                $page_te xt .= "<br  /><br />" ._t("_EMAI L_CONF_NOT _SENT");
237           el se   278           el se
238           {   279           {
239                $ret['Er rorCode']  = 10;   280                $ret['Er rorCode']  = 10;
240                return f alse;   281                return f alse;
241           }   282           }
242       }   283       }
243     284  
244       if ( $ text )   285       if ( $ text )
245           re turn $page _text;   286           re turn $page _text;
246       else   287       else
247           re turn true;   288           re turn true;
248   }   289   }
249     290  
250     291  
251   function m em_expirat ion_letter ( $ID, $me mbership_n ame, $expi re_days )   292   function m em_expirat ion_letter ( $ID, $me mbership_n ame, $expi re_days )
252   {   293   {
253       global  $site;   294       global  $site;
254     295  
255       $ID =  (int)$ID;   296       $ID =  (int)$ID;
256     297  
257       if ( ! $ID )   298       if ( ! $ID )
258           re turn false ;   299           re turn false ;
259     300  
260       $p_arr  = db_arr(  "SELECT ` Email` FRO M `Profile s` WHERE ` ID` = $ID" , 0 );   301       $p_arr  = db_arr(  "SELECT ` Email` FRO M `Profile s` WHERE ` ID` = $ID" , 0 );
261       if ( ! $p_arr )   302       if ( ! $p_arr )
262           re turn false ;   303           re turn false ;
263     304  
264       // Get  notificat ion messag e body and  subject f rom global  settings.   305       // Get  notificat ion messag e body and  subject f rom global  settings.
265       $messa ge    = ge tParam('t_ MemExpirat ion');   306       $messa ge    = ge tParam('t_ MemExpirat ion');
266       $subje ct    = ge tParam('t_ MemExpirat ion_subjec t');   307       $subje ct    = ge tParam('t_ MemExpirat ion_subjec t');
267     308  
268       $recip ient  = $p _arr['Emai l'];   309       $recip ient  = $p _arr['Emai l'];
269     310  
270       $aPlus  = array() ;   311       $aPlus  = array() ;
271       $aPlus ['Membersh ipName'] =  $membersh ip_name;   312       $aPlus ['Membersh ipName'] =  $membersh ip_name;
272       $aPlus ['ExpireDa ys'] = $ex pire_days;   313       $aPlus ['ExpireDa ys'] = $ex pire_days;
273     314  
274       $mail_ ret = send Mail( $rec ipient, $s ubject, $m essage, $I D, $aPlus   );   315       $mail_ ret = send Mail( $rec ipient, $s ubject, $m essage, $I D, $aPlus   );
275     316  
276       if ($m ail_ret)   317       if ($m ail_ret)
277           re turn true;   318           re turn true;
278       else   319       else
279           re turn false ;   320           re turn false ;
280   }   321   }
281     322  
282   function g et_vars($w ith_page =  1, $with_ per_page =  1, $with_ sort_by =  1, $with_s ort_order  = 1, $with _gallery_v iew = 1)   323   function g et_vars($w ith_page =  1, $with_ per_page =  1, $with_ sort_by =  1, $with_s ort_order  = 1, $with _gallery_v iew = 1)
283   {   324   {
284       global  $affID;   325       global  $affID;
285     326  
286       $get_p arameters  = "?";   327       $get_p arameters  = "?";
287     328  
288       // com mon parame ters   329       // com mon parame ters
289       if ( i sset($_REQ UEST['ID'] ) && (int) $_REQUEST[ 'ID'] > 0  )   330       if ( i sset($_REQ UEST['ID'] ) && (int) $_REQUEST[ 'ID'] > 0  )
290           $g et_paramet ers .= 'ID ='. (int)$ _REQUEST[' ID'] .'&am p;';   331           $g et_paramet ers .= 'ID ='. (int)$ _REQUEST[' ID'] .'&am p;';
291       if ( i sset($_REQ UEST['Nick Name']) &&  strlen($_ REQUEST['N ickName'])  > 0 )   332       if ( i sset($_REQ UEST['Nick Name']) &&  strlen($_ REQUEST['N ickName'])  > 0 )
292           $g et_paramet ers .= 'Ni ckName='.  process_pa ss_data($_ REQUEST['N ickName'])  .'&amp;';   333           $g et_paramet ers .= 'Ni ckName='.  process_pa ss_data($_ REQUEST['N ickName'])  .'&amp;';
293       if ( i sset($_REQ UEST['gall ery_view'] ) && (int) $_REQUEST[ 'gallery_v iew'] > 0  && $with_g allery_vie w )   334       if ( i sset($_REQ UEST['gall ery_view'] ) && (int) $_REQUEST[ 'gallery_v iew'] > 0  && $with_g allery_vie w )
294           $g et_paramet ers .= 'ga llery_view ='. (int)$ _REQUEST[' gallery_vi ew'] .'&am p;';   335           $g et_paramet ers .= 'ga llery_view ='. (int)$ _REQUEST[' gallery_vi ew'] .'&am p;';
295       if ( i sset($_REQ UEST['phot os_only'])  && strlen ($_REQUEST ['photos_o nly']) > 0  )   336       if ( i sset($_REQ UEST['phot os_only'])  && strlen ($_REQUEST ['photos_o nly']) > 0  )
296           $g et_paramet ers .= ($_ REQUEST['p hotos_only '] == 'on'  ? 'photos _only=on&a mp;' : '') ;   337           $g et_paramet ers .= ($_ REQUEST['p hotos_only '] == 'on'  ? 'photos _only=on&a mp;' : '') ;
297       if ( i sset($_REQ UEST['onli ne_only'])  && strlen ($_REQUEST ['online_o nly']) > 0  )   338       if ( i sset($_REQ UEST['onli ne_only'])  && strlen ($_REQUEST ['online_o nly']) > 0  )
298       {   339       {
299           $g et_paramet ers .= 'on line_only= on&amp;';   340           $g et_paramet ers .= 'on line_only= on&amp;';
300       }   341       }
301       // nav igation pa rameters   342       // nav igation pa rameters
302       if ( i sset($_REQ UEST['page ']) && (in t)$_REQUES T['page']  > 0 && $wi th_page )   343       if ( i sset($_REQ UEST['page ']) && (in t)$_REQUES T['page']  > 0 && $wi th_page )
303           $g et_paramet ers .= 'pa ge='. (int )$_REQUEST ['page'] . '&amp;';   344           $g et_paramet ers .= 'pa ge='. (int )$_REQUEST ['page'] . '&amp;';
304       if ( i sset($_REQ UEST['p_pe r_page'])  && (int)$_ REQUEST['p _per_page' ] > 0 && $ with_per_p age )   345       if ( i sset($_REQ UEST['p_pe r_page'])  && (int)$_ REQUEST['p _per_page' ] > 0 && $ with_per_p age )
305           $g et_paramet ers .= 'p_ per_page=' . (int)$_R EQUEST['p_ per_page']  .'&amp;';   346           $g et_paramet ers .= 'p_ per_page=' . (int)$_R EQUEST['p_ per_page']  .'&amp;';
306       if ( i sset($_REQ UEST['sort by']) && s trlen($_RE QUEST['sor tby']) > 0  && $with_ sort_by )   347       if ( i sset($_REQ UEST['sort by']) && s trlen($_RE QUEST['sor tby']) > 0  && $with_ sort_by )
307           $g et_paramet ers .= 'so rtby='. pr ocess_pass _data($_RE QUEST['sor tby']) .'& amp;';   348           $g et_paramet ers .= 'so rtby='. pr ocess_pass _data($_RE QUEST['sor tby']) .'& amp;';
308       if ( i sset($_REQ UEST['sort order']) & & strlen($ _REQUEST[' sortorder' ]) > 0 &&  $with_sort _order )   349       if ( i sset($_REQ UEST['sort order']) & & strlen($ _REQUEST[' sortorder' ]) > 0 &&  $with_sort _order )
309           $g et_paramet ers .= ($_ REQUEST['s ortorder']  == 'ASC'  ? 'sortord er=ASC&amp ;' : 'sort order=DESC &amp;');   350           $g et_paramet ers .= ($_ REQUEST['s ortorder']  == 'ASC'  ? 'sortord er=ASC&amp ;' : 'sort order=DESC &amp;');
310     351  
311       // ZIP  search pa rameters   352       // ZIP  search pa rameters
312       if ( i sset($_REQ UEST['zip' ]) && strl en($_REQUE ST['zip'])  > 0 )   353       if ( i sset($_REQ UEST['zip' ]) && strl en($_REQUE ST['zip'])  > 0 )
313           $g et_paramet ers .= 'zi p='. proce ss_pass_da ta($_REQUE ST['zip'])  .'&amp;';   354           $g et_paramet ers .= 'zi p='. proce ss_pass_da ta($_REQUE ST['zip'])  .'&amp;';
314       if ( i sset($_REQ UEST['metr ic']) && s trlen($_RE QUEST['met ric']) > 0  )   355       if ( i sset($_REQ UEST['metr ic']) && s trlen($_RE QUEST['met ric']) > 0  )
315           $g et_paramet ers .= ($_ REQUEST['m etric'] ==  'miles' ?  'metric=m iles&amp;'  : 'metric =km&amp;') ;   356           $g et_paramet ers .= ($_ REQUEST['m etric'] ==  'miles' ?  'metric=m iles&amp;'  : 'metric =km&amp;') ;
316       if ( i sset($_REQ UEST['dist ance']) )   357       if ( i sset($_REQ UEST['dist ance']) )
317           $g et_paramet ers .= 'di stance='.  (int)$_REQ UEST['dist ance'] .'& amp;';   358           $g et_paramet ers .= 'di stance='.  (int)$_REQ UEST['dist ance'] .'& amp;';
318     359  
319       // ext ra paramet ers   360       // ext ra paramet ers
320       if ( i sset($_REQ UEST['prof iles']) &&  strlen($_ REQUEST['p rofiles'])  > 0 )   361       if ( i sset($_REQ UEST['prof iles']) &&  strlen($_ REQUEST['p rofiles'])  > 0 )
321           $g et_paramet ers .= 'pr ofiles='.  process_pa ss_data($_ REQUEST['p rofiles'])  .'&amp;';   362           $g et_paramet ers .= 'pr ofiles='.  process_pa ss_data($_ REQUEST['p rofiles'])  .'&amp;';
322       if ( i sset($_REQ UEST['stat us']) && s trlen($_RE QUEST['sta tus']) > 0  )   363       if ( i sset($_REQ UEST['stat us']) && s trlen($_RE QUEST['sta tus']) > 0  )
323           $g et_paramet ers .= 'st atus='. pr ocess_pass _data($_RE QUEST['sta tus']) .'& amp;';   364           $g et_paramet ers .= 'st atus='. pr ocess_pass _data($_RE QUEST['sta tus']) .'& amp;';
324     365  
325       // adm in paramet ers   366       // adm in paramet ers
326       if ( i sset($_REQ UEST['sear ch']) && s trlen($_RE QUEST['sea rch']) > 0  )   367       if ( i sset($_REQ UEST['sear ch']) && s trlen($_RE QUEST['sea rch']) > 0  )
327           $g et_paramet ers .= 'se arch='. pr ocess_pass _data($_RE QUEST['sea rch']) .'& amp;';   368           $g et_paramet ers .= 'se arch='. pr ocess_pass _data($_RE QUEST['sea rch']) .'& amp;';
328       if ( i sset($_REQ UEST['s_ni ckname'])  && strlen( $_REQUEST[ 's_nicknam e']) > 0 )   369       if ( i sset($_REQ UEST['s_ni ckname'])  && strlen( $_REQUEST[ 's_nicknam e']) > 0 )
329           $g et_paramet ers .= 's_ nickname=' . process_ pass_data( $_REQUEST[ 's_nicknam e']) .'&am p;';   370           $g et_paramet ers .= 's_ nickname=' . process_ pass_data( $_REQUEST[ 's_nicknam e']) .'&am p;';
330     371  
331       // aff iliate par ameters   372       // aff iliate par ameters
332       if ( i sset($affI D) && (int )$affID >  0 )   373       if ( i sset($affI D) && (int )$affID >  0 )
333           $g et_paramet ers .= 'af fID='. (in t)$affID . '&amp;';   374           $g et_paramet ers .= 'af fID='. (in t)$affID . '&amp;';
334     375  
335        $respd   =   db_res("SE LECT   *   FROM   `Profile sD e
s c `   WHERE   ` search_t ype`   <>   'none'   ORDER   BY   ` search_ord e r `   ASC");
  376        $respd   =   db_res("SE LECT   *   FROM   `Profile Fi e ld s
`   WHERE   ` T ype`   <>   'none'   ORDER   BY   ` Typ e
`   ASC");
336       while  ( $arrpd =  mysql_fet ch_array($ respd) )   377       while  ( $arrpd =  mysql_fet ch_array($ respd) )
337       {   378       {
338           
$fname   =   get_field_ name   (   $arrpd   );
  379            // $fname   =   get_field_ name   (   $arrpd   );
    380           $f name = $ar rpd['Name' ];
339           sw itch ($arr pd['search _type'])   381           sw itch ($arr pd['search _type'])
340           {   382           {
341                 case   ' radi o
':
  383                 case   ' select_ o ne ':
342                case 'te xt':   384                case 'te xt':
    385                case 'ar ea':
343                    $fva l = proces s_pass_dat a($_REQUES T[$fname]) ;   386                    $fva l = proces s_pass_dat a($_REQUES T[$fname]) ;
344                    if (  isset($_R EQUEST[$fn ame]) && s trlen($fva l) )   387                    if (  isset($_R EQUEST[$fn ame]) && s trlen($fva l) )
345                    {   388                    {
346                         $get_param eters .= " {$fname}={ $fval}&amp ;";   389                         $get_param eters .= " {$fname}={ $fval}&amp ;";
347                    }   390                    }
348                    brea k;   391                    brea k;
349     392  
350                
case   'list':
  393                 /* case   'list':
351                    $fva l = $_REQU EST[$fname ];   394                    $fva l = $_REQU EST[$fname ];
352                    if (  is_array( $fval) &&  count($fva l) > 0 )   395                    if (  is_array( $fval) &&  count($fva l) > 0 )
353                    {   396                    {
354                         while ( li st( $key,  $val ) = e ach( $fval  ) )   397                         while ( li st( $key,  $val ) = e ach( $fval  ) )
355                             $get_p arameters  .= "{$fnam e}[]=". pr ocess_pass _data($val ) ."&amp;" ;   398                             $get_p arameters  .= "{$fnam e}[]=". pr ocess_pass _data($val ) ."&amp;" ;
356                    }   399                    }
357                     break;
  400                     break; */
358     401  
359                
case   'check':
  402                 /* case   'check':
360                    if (   $arrpd[' type'] ==  'r' )   403                    if (   $arrpd[' type'] ==  'r' )
361                    {   404                    {
362                         $findok =  0;   405                         $findok =  0;
363                         $funcbody  = $arrpd[' extra'];   406                         $funcbody  = $arrpd[' extra'];
364                         $func = cr eate_funct ion("", $f uncbody);   407                         $func = cr eate_funct ion("", $f uncbody);
365                         $ar = $fun c();   408                         $ar = $fun c();
366     409  
367                         foreach (  $ar as $ke y => $valu e )   410                         foreach (  $ar as $ke y => $valu e )
368                         {   411                         {
369                             if ( $ _REQUEST[" {$fname}_{ $key}"] ==  "on" )   412                             if ( $ _REQUEST[" {$fname}_{ $key}"] ==  "on" )
370                             {   413                             {
371                                 $f indok = 1;   414                                 $f indok = 1;
372                                 br eak;   415                                 br eak;
373                             }   416                             }
374                         }   417                         }
375     418  
376                         if ( is_ar ray($ar) & & $findok  )   419                         if ( is_ar ray($ar) & & $findok  )
377                         {   420                         {
378                             foreac h ( $ar as  $key => $ value )   421                             foreac h ( $ar as  $key => $ value )
379                             {   422                             {
380                                 if  ( $_REQUE ST["{$fnam e}_{$key}" ] == "on"  )   423                                 if  ( $_REQUE ST["{$fnam e}_{$key}" ] == "on"  )
381                                      $get_par ameters .=  "{$fname} _{$key}=on &amp;";   424                                      $get_par ameters .=  "{$fname} _{$key}=on &amp;";
382                             }   425                             }
383                         }   426                         }
384                    }   427                    }
385                    else if ( $arrp d['type']  == 'e' )   428                    else if ( $arrp d['type']  == 'e' )
386                    {   429                    {
387                         $findok =  0;   430                         $findok =  0;
388     431  
389                         $vals = pr eg_split ( "/[,\']+/" , $arr['ex tra'], -1,  PREG_SPLI T_NO_EMPTY );   432                         $vals = pr eg_split ( "/[,\']+/" , $arr['ex tra'], -1,  PREG_SPLI T_NO_EMPTY );
390     433  
391                         foreach (  $vals as $ key )   434                         foreach (  $vals as $ key )
392                         {   435                         {
393                             if ( $ _REQUEST[" {$fname}_{ $key}"] ==  "on" )   436                             if ( $ _REQUEST[" {$fname}_{ $key}"] ==  "on" )
394                             {   437                             {
395                                 $f indok = 1;   438                                 $f indok = 1;
396                                 br eak;   439                                 br eak;
397                             }   440                             }
398                         }   441                         }
399     442  
400                         if ( $find ok )   443                         if ( $find ok )
401                         {   444                         {
402                             foreac h ( $vals  as $key )   445                             foreac h ( $vals  as $key )
403                             {   446                             {
404                                 if  ( $_REQUE ST["{$fnam e}_{$key}" ] == "on"  )   447                                 if  ( $_REQUE ST["{$fnam e}_{$key}" ] == "on"  )
405                                      $get_par ameters .=  "{$fname} _{$key}=on &amp;";   448                                      $get_par ameters .=  "{$fname} _{$key}=on &amp;";
406                             }   449                             }
407                         }   450                         }
408                    }   451                    }
409                     break;
  452                     break; */
410     453  
411                
case   'check_set ':
  454                 /* case   'check_set ':
412                    $val s = preg_s plit ("/[, \']+/", $a rrpd['extr a'], -1, P REG_SPLIT_ NO_EMPTY);   455                    $val s = preg_s plit ("/[, \']+/", $a rrpd['extr a'], -1, P REG_SPLIT_ NO_EMPTY);
413                    $off set = 0;   456                    $off set = 0;
414     457  
415                    fore ach ( $val s as $v )   458                    fore ach ( $val s as $v )
416                    {   459                    {
417                         if ( $_REQ UEST["{$fn ame}_{$off set}"] ==  "on" )   460                         if ( $_REQ UEST["{$fn ame}_{$off set}"] ==  "on" )
418                             $get_p arameters  .= "{$fnam e}_{$offse t}=on&amp; ";   461                             $get_p arameters  .= "{$fnam e}_{$offse t}=on&amp; ";
419                         $offset++;   462                         $offset++;
420                    }   463                    }
421     464  
422                     break;
  465                     break; */
423     466  
424                 case   'date range ':   467                 case   'date
':
425                    $fva l_s = proc ess_pass_d ata($_REQU EST["{$fna me}_start" ]);   468                    $fva l_s = proc ess_pass_d ata($_REQU EST["{$fna me}_start" ]);
426                    $fva l_e = proc ess_pass_d ata($_REQU EST["{$fna me}_end"]) ;   469                    $fva l_e = proc ess_pass_d ata($_REQU EST["{$fna me}_end"]) ;
427     470  
428                    if (  strlen($f val_s) )   471                    if (  strlen($f val_s) )
429                    {   472                    {
430                         $get_param eters .= " {$fname}_s tart={$fva l_s}&amp;" ;   473                         $get_param eters .= " {$fname}_s tart={$fva l_s}&amp;" ;
431                    }   474                    }
432                    if (  strlen($f val_e) )   475                    if (  strlen($f val_e) )
433                    {   476                    {
434                         $get_param eters .= " {$fname}_e nd={$fval_ e}&amp;";   477                         $get_param eters .= " {$fname}_e nd={$fval_ e}&amp;";
435                    }   478                    }
436                    brea k;   479                    brea k;
437           }   480           }
438       }   481       }
439     482  
440       // exc lude last  character  from the s tring   483       // exc lude last  character  from the s tring
441       return  $get_para meters;   484       return  $get_para meters;
442   }   485   }
443     486  
444   function g et_vars_co ntrols($wi th_page =  1, $with_p er_page =  1, $with_s ort_by = 1 , $with_so rt_order =  1, $with_ gallery_vi ew = 1)   487   function g et_vars_co ntrols($wi th_page =  1, $with_p er_page =  1, $with_s ort_by = 1 , $with_so rt_order =  1, $with_ gallery_vi ew = 1)
445   {   488   {
446       global  $affID;   489       global  $affID;
447     490  
448       $get_i nputs = "" ;   491       $get_i nputs = "" ;
449     492  
450       // com mon parame ters   493       // com mon parame ters
451       if ( i sset($_REQ UEST['ID'] ) && (int) $_REQUEST[ 'ID'] > 0  )   494       if ( i sset($_REQ UEST['ID'] ) && (int) $_REQUEST[ 'ID'] > 0  )
452           $g et_inputs  .= '<input  type="hid den" name= "ID" value ="'. (int) $_REQUEST[ 'ID'] .'"  />';   495           $g et_inputs  .= '<input  type="hid den" name= "ID" value ="'. (int) $_REQUEST[ 'ID'] .'"  />';
453       if ( i sset($_REQ UEST['Nick Name']) &&  strlen($_ REQUEST['N ickName'])  > 0 )   496       if ( i sset($_REQ UEST['Nick Name']) &&  strlen($_ REQUEST['N ickName'])  > 0 )
454           $g et_inputs  .= '<input  type="hid den" name= "NickName"  value="'.  process_p ass_data($ _REQUEST[' NickName'] ) .'" />';   497           $g et_inputs  .= '<input  type="hid den" name= "NickName"  value="'.  process_p ass_data($ _REQUEST[' NickName'] ) .'" />';
455       if ( i sset($_REQ UEST['gall ery_view'] ) && (int) $_REQUEST[ 'gallery_v iew'] > 0  && $with_g allery_vie w )   498       if ( i sset($_REQ UEST['gall ery_view'] ) && (int) $_REQUEST[ 'gallery_v iew'] > 0  && $with_g allery_vie w )
456           $g et_inputs  .= '<input  type="hid den" name= "gallery_v iew" value ="'. (int) $_REQUEST[ 'gallery_v iew'] .'"  />';   499           $g et_inputs  .= '<input  type="hid den" name= "gallery_v iew" value ="'. (int) $_REQUEST[ 'gallery_v iew'] .'"  />';
457       if ( i sset($_REQ UEST['phot os_only'])  && strlen ($_REQUEST ['photos_o nly']) > 0  )   500       if ( i sset($_REQ UEST['phot os_only'])  && strlen ($_REQUEST ['photos_o nly']) > 0  )
458           $g et_inputs  .= ($_REQU EST['photo s_only'] = = 'on' ? ' <input typ e="hidden"  name="pho tos_only"  value="on"  />' : '') ;   501           $g et_inputs  .= ($_REQU EST['photo s_only'] = = 'on' ? ' <input typ e="hidden"  name="pho tos_only"  value="on"  />' : '') ;
459       if ( i sset($_REQ UEST['onli ne_only'])  && strlen ($_REQUEST ['online_o nly']) > 0  )   502       if ( i sset($_REQ UEST['onli ne_only'])  && strlen ($_REQUEST ['online_o nly']) > 0  )
460       {   503       {
461           $g et_inputs  .= '<input  type="hid den" name= "online_on ly" value= "on" />';   504           $g et_inputs  .= '<input  type="hid den" name= "online_on ly" value= "on" />';
462       }   505       }
463       // nav igation pa rameters   506       // nav igation pa rameters
464       if ( i sset($_REQ UEST['page ']) && (in t)$_REQUES T['page']  > 0 && $wi th_page )   507       if ( i sset($_REQ UEST['page ']) && (in t)$_REQUES T['page']  > 0 && $wi th_page )
465           $g et_inputs  .= '<input  type="hid den" name= "page" val ue="'. (in t)$_REQUES T['page']  .'" />';   508           $g et_inputs  .= '<input  type="hid den" name= "page" val ue="'. (in t)$_REQUES T['page']  .'" />';
466       if ( i sset($_REQ UEST['p_pe r_page'])  && (int)$_ REQUEST['p _per_page' ] > 0 && $ with_per_p age )   509       if ( i sset($_REQ UEST['p_pe r_page'])  && (int)$_ REQUEST['p _per_page' ] > 0 && $ with_per_p age )
467           $g et_inputs  .= '<input  type="hid den" name= "p_per_pag e" value=" '. (int)$_ REQUEST['p _per_page' ] .'" />';   510           $g et_inputs  .= '<input  type="hid den" name= "p_per_pag e" value=" '. (int)$_ REQUEST['p _per_page' ] .'" />';
468       if ( i sset($_REQ UEST['sort by']) && s trlen($_RE QUEST['sor tby']) > 0  && $with_ sort_by )   511       if ( i sset($_REQ UEST['sort by']) && s trlen($_RE QUEST['sor tby']) > 0  && $with_ sort_by )
469           $g et_inputs  .= '<input  type="hid den" name= "sortby" v alue="'. p rocess_pas s_data($_R EQUEST['so rtby']) .' " />';   512           $g et_inputs  .= '<input  type="hid den" name= "sortby" v alue="'. p rocess_pas s_data($_R EQUEST['so rtby']) .' " />';
470       if ( i sset($_REQ UEST['sort order']) & & strlen($ _REQUEST[' sortorder' ]) > 0 &&  $with_sort _order )   513       if ( i sset($_REQ UEST['sort order']) & & strlen($ _REQUEST[' sortorder' ]) > 0 &&  $with_sort _order )
471           $g et_inputs  .= ($_REQU EST['sorto rder'] ==  'ASC' ? '< input type ="hidden"  name="sort order" val ue="ASC" / >' : '<inp ut type="h idden" nam e="sortord er" value= "DESC" />' );   514           $g et_inputs  .= ($_REQU EST['sorto rder'] ==  'ASC' ? '< input type ="hidden"  name="sort order" val ue="ASC" / >' : '<inp ut type="h idden" nam e="sortord er" value= "DESC" />' );
472     515  
473       // ZIP  search pa rameters   516       // ZIP  search pa rameters
474       if ( i sset($_REQ UEST['zip' ]) && strl en($_REQUE ST['zip'])  > 0 )   517       if ( i sset($_REQ UEST['zip' ]) && strl en($_REQUE ST['zip'])  > 0 )
475           $g et_inputs  .= '<input  type="hid den" name= "zip" valu e="'. proc ess_pass_d ata($_REQU EST['zip'] ) .'" />';   518           $g et_inputs  .= '<input  type="hid den" name= "zip" valu e="'. proc ess_pass_d ata($_REQU EST['zip'] ) .'" />';
476       if ( i sset($_REQ UEST['metr ic']) && s trlen($_RE QUEST['met ric']) > 0  )   519       if ( i sset($_REQ UEST['metr ic']) && s trlen($_RE QUEST['met ric']) > 0  )
477           $g et_inputs  .= ($_REQU EST['metri c'] == 'mi les' ? '<i nput type= "hidden" n ame="metri c" value=" miles" />'  : '<input  type="hid den" name= "metric" v alue="km"  />');   520           $g et_inputs  .= ($_REQU EST['metri c'] == 'mi les' ? '<i nput type= "hidden" n ame="metri c" value=" miles" />'  : '<input  type="hid den" name= "metric" v alue="km"  />');
478       if ( i sset($_REQ UEST['dist ance']) )   521       if ( i sset($_REQ UEST['dist ance']) )
479           $g et_inputs  .= '<input  type="hid den" name= "distance"  value="'.  (int)$_RE QUEST['dis tance'] .' " />';   522           $g et_inputs  .= '<input  type="hid den" name= "distance"  value="'.  (int)$_RE QUEST['dis tance'] .' " />';
480     523  
481       // ext ra paramet ers   524       // ext ra paramet ers
482       if ( i sset($_REQ UEST['prof iles']) &&  strlen($_ REQUEST['p rofiles'])  > 0 )   525       if ( i sset($_REQ UEST['prof iles']) &&  strlen($_ REQUEST['p rofiles'])  > 0 )
483           $g et_inputs  .= '<input  type="hid den" name= "profiles"  value="'.  process_p ass_data($ _REQUEST[' profiles'] ) .'" />';   526           $g et_inputs  .= '<input  type="hid den" name= "profiles"  value="'.  process_p ass_data($ _REQUEST[' profiles'] ) .'" />';
484       if ( i sset($_REQ UEST['stat us']) && s trlen($_RE QUEST['sta tus']) > 0  )   527       if ( i sset($_REQ UEST['stat us']) && s trlen($_RE QUEST['sta tus']) > 0  )
485           $g et_inputs  .= '<input  type="hid den" name= "status" v alue="'. p rocess_pas s_data($_R EQUEST['st atus']) .' " />';   528           $g et_inputs  .= '<input  type="hid den" name= "status" v alue="'. p rocess_pas s_data($_R EQUEST['st atus']) .' " />';
486     529  
487       // adm in paramet ers   530       // adm in paramet ers
488       if ( i sset($_REQ UEST['sear ch']) && s trlen($_RE QUEST['sea rch']) > 0  )   531       if ( i sset($_REQ UEST['sear ch']) && s trlen($_RE QUEST['sea rch']) > 0  )
489           $g et_inputs  .= '<input  type="hid den" name= "search" v alue="'. p rocess_pas s_data($_R EQUEST['se arch']) .' " />';   532           $g et_inputs  .= '<input  type="hid den" name= "search" v alue="'. p rocess_pas s_data($_R EQUEST['se arch']) .' " />';
490       if ( i sset($_REQ UEST['s_ni ckname'])  && strlen( $_REQUEST[ 's_nicknam e']) > 0 )   533       if ( i sset($_REQ UEST['s_ni ckname'])  && strlen( $_REQUEST[ 's_nicknam e']) > 0 )
491           $g et_inputs  .= '<input  type="hid den" name= "s_nicknam e" value=" '. process _pass_data ($_REQUEST ['s_nickna me']) .'"  />';   534           $g et_inputs  .= '<input  type="hid den" name= "s_nicknam e" value=" '. process _pass_data ($_REQUEST ['s_nickna me']) .'"  />';
492     535  
493       // aff iliate par ameters   536       // aff iliate par ameters
494       if ( i sset($affI D) && (int )$affID >  0 )   537       if ( i sset($affI D) && (int )$affID >  0 )
495           $g et_inputs  .= '<input  type="hid den" name= "affID" va lue="'. (i nt)$affID  .'" />';   538           $g et_inputs  .= '<input  type="hid den" name= "affID" va lue="'. (i nt)$affID  .'" />';
496     539  
497        $respd   =   db_res("SE LECT   *   FROM   `Profile sD e
s c `   WHERE   ` search_t ype`   <>   'none'   ORDER   BY   ` search_ord e r `   ASC");
  540        $respd   =   db_res("SE LECT   *   FROM   `Profile Fi e ld s
`   WHERE   ` T ype`   <>   'none'   ORDER   BY   ` Typ e
`   ASC");
498       while  ( $arrpd =  mysql_fet ch_array($ respd) )   541       while  ( $arrpd =  mysql_fet ch_array($ respd) )
499       {   542       {
500           
$fname   =   get_field_ name(   $arrpd   );
  543            // $fname   =   get_field_ name(   $arrpd   );
501            switch   ($arrpd[' search_t ype'])   544           $f name = $ar rpd['Name' ];
    545            switch   ($arrpd[' T ype'])
502           {   546           {
503                 case   ' radi o
':
  547                 case   ' select_ o ne ':
504                case 'te xt':   548                case 'te xt':
    549                case 'ar ea':
505                    $fva l = proces s_pass_dat a($_REQUES T[$fname]) ;   550                    $fva l = proces s_pass_dat a($_REQUES T[$fname]) ;
506                    if (  isset($_R EQUEST[$fn ame]) && s trlen($fva l) )   551                    if (  isset($_R EQUEST[$fn ame]) && s trlen($fva l) )
507                    {   552                    {
508                         $get_input s .= "<inp ut type=\" hidden\" n ame=\"$fna me\" value =\"$fval\"  />";   553                         $get_input s .= "<inp ut type=\" hidden\" n ame=\"$fna me\" value =\"$fval\"  />";
509                    }   554                    }
510                    brea k;   555                    brea k;
511     556  
512                
case   'list':
  557                 /* case   'list':
513                    $fva l = $_REQU EST[$fname ];   558                    $fva l = $_REQU EST[$fname ];
514                    if (  is_array( $fval) &&  count($fva l) > 0 )   559                    if (  is_array( $fval) &&  count($fva l) > 0 )
515                    {   560                    {
516                         while ( li st( $key,  $val ) = e ach( $fval  ) )   561                         while ( li st( $key,  $val ) = e ach( $fval  ) )
517                             $get_i nputs .= " <input typ e=\"hidden \" name=\" {$fname}[] \" value=\ "". proces s_pass_dat a($val) ." \" />";   562                             $get_i nputs .= " <input typ e=\"hidden \" name=\" {$fname}[] \" value=\ "". proces s_pass_dat a($val) ." \" />";
518                    }   563                    }
519                     break;
  564                     break; */
520     565  
521                
case   'check':
  566                 /* case   'check':
522                    if ( $arrpd['ty pe'] == 'r ')   567                    if ( $arrpd['ty pe'] == 'r ')
523                    {   568                    {
524                         $findok =  0;   569                         $findok =  0;
525                         $funcbody  = $arrpd[' extra'];   570                         $funcbody  = $arrpd[' extra'];
526                         $func = cr eate_funct ion("", $f uncbody);   571                         $func = cr eate_funct ion("", $f uncbody);
527                         $ar = $fun c();   572                         $ar = $fun c();
528     573  
529                         foreach (  $ar as $ke y => $valu e )   574                         foreach (  $ar as $ke y => $valu e )
530                         {   575                         {
531                             if ( $ _REQUEST[" {$fname}_{ $key}"] ==  "on" )   576                             if ( $ _REQUEST[" {$fname}_{ $key}"] ==  "on" )
532                             {   577                             {
533                                 $f indok = 1;   578                                 $f indok = 1;
534                                 br eak;   579                                 br eak;
535                             }   580                             }
536                         }   581                         }
537     582  
538                         if ( $find ok )   583                         if ( $find ok )
539                         {   584                         {
540                             foreac h ( $ar as  $key => $ value )   585                             foreac h ( $ar as  $key => $ value )
541                             {   586                             {
542                                 if  ( $_REQUE ST["{$fnam e}_{$key}" ] == "on"  )   587                                 if  ( $_REQUE ST["{$fnam e}_{$key}" ] == "on"  )
543                                      $get_inp uts .= "<i nput type= \"hidden\"  name=\"{$ fname}_{$k ey}\" valu e=\"on\" / >";   588                                      $get_inp uts .= "<i nput type= \"hidden\"  name=\"{$ fname}_{$k ey}\" valu e=\"on\" / >";
544                             }   589                             }
545                         }   590                         }
546                    }   591                    }
547                    else if ($arrpd ['type'] = = 'e')   592                    else if ($arrpd ['type'] = = 'e')
548                    {   593                    {
549                         $findok =  0;   594                         $findok =  0;
550     595  
551                         $vals = pr eg_split ( "/[,\']+/" , $arr['ex tra'], -1,  PREG_SPLI T_NO_EMPTY );   596                         $vals = pr eg_split ( "/[,\']+/" , $arr['ex tra'], -1,  PREG_SPLI T_NO_EMPTY );
552     597  
553                         foreach (  $vals as $ key )   598                         foreach (  $vals as $ key )
554                         {   599                         {
555                             if ( $ _REQUEST[" {$fname}_{ $key}"] ==  "on" )   600                             if ( $ _REQUEST[" {$fname}_{ $key}"] ==  "on" )
556                             {   601                             {
557                                 $f indok = 1;   602                                 $f indok = 1;
558                                 br eak;   603                                 br eak;
559                             }   604                             }
560                         }   605                         }
561     606  
562                         if ( $find ok )   607                         if ( $find ok )
563                         {   608                         {
564                             foreac h ( $vals  as $key )   609                             foreac h ( $vals  as $key )
565                             {   610                             {
566                                 if  ( $_REQUE ST["{$fnam e}_{$key}" ] == "on"  )   611                                 if  ( $_REQUE ST["{$fnam e}_{$key}" ] == "on"  )
567                                      $get_inp uts .= "<i nput type= \"hidden\"  name=\"{$ fname}_{$k ey}\" valu e=\"on\" / >";   612                                      $get_inp uts .= "<i nput type= \"hidden\"  name=\"{$ fname}_{$k ey}\" valu e=\"on\" / >";
568                             }   613                             }
569                         }   614                         }
570                    }   615                    }
571                     break;
  616                     break; */
572     617  
573                
case   'check_set ':
  618                 /* case   'check_set ':
574                    $val s = preg_s plit ("/[, \']+/", $a rrpd['extr a'], -1, P REG_SPLIT_ NO_EMPTY);   619                    $val s = preg_s plit ("/[, \']+/", $a rrpd['extr a'], -1, P REG_SPLIT_ NO_EMPTY);
575                    $off set = 0;   620                    $off set = 0;
576     621  
577                    fore ach ( $val s as $v )   622                    fore ach ( $val s as $v )
578                    {   623                    {
579                         if ( $_REQ UEST["{$fn ame}_{$off set}"] ==  "on" )   624                         if ( $_REQ UEST["{$fn ame}_{$off set}"] ==  "on" )
580                             $get_i nputs .= " <input typ e=\"hidden \" name=\" {$fname}_{ $offset}\"  value=\"o n\" />";   625                             $get_i nputs .= " <input typ e=\"hidden \" name=\" {$fname}_{ $offset}\"  value=\"o n\" />";
581                         $offset++;   626                         $offset++;
582                    }   627                    }
583                     break;
  628                     break; */
584     629  
585                 case   'date range ':   630                 case   'date
':
586                    $fva l_s = proc ess_pass_d ata($_REQU EST["{$fna me}_start" ]);   631                    $fva l_s = proc ess_pass_d ata($_REQU EST["{$fna me}_start" ]);
587                    $fva l_e = proc ess_pass_d ata($_REQU EST["{$fna me}_end"]) ;   632                    $fva l_e = proc ess_pass_d ata($_REQU EST["{$fna me}_end"]) ;
588     633  
589                    if (  isset($_R EQUEST["{$ fname}_sta rt"]) && s trlen($fva l_s) )   634                    if (  isset($_R EQUEST["{$ fname}_sta rt"]) && s trlen($fva l_s) )
590                    {   635                    {
591                         $get_input s .= "<inp ut type=\" hidden\" n ame=\"{$fn ame}_start \" value=\ "$fval_s\"  />";   636                         $get_input s .= "<inp ut type=\" hidden\" n ame=\"{$fn ame}_start \" value=\ "$fval_s\"  />";
592                    }   637                    }
593                    if (  isset($_R EQUEST["{$ fname}_end "]) && str len($fval_ e) )   638                    if (  isset($_R EQUEST["{$ fname}_end "]) && str len($fval_ e) )
594                    {   639                    {
595                         $get_input s .= "<inp ut type=\" hidden\" n ame=\"{$fn ame}_end\"  value=\"$ fval_e\" / >";   640                         $get_input s .= "<inp ut type=\" hidden\" n ame=\"{$fn ame}_end\"  value=\"$ fval_e\" / >";
596                    }   641                    }
597                    brea k;   642                    brea k;
598           }   643           }
599       }   644       }
600     645  
601       return  $get_inpu ts;   646       return  $get_inpu ts;
602   }   647   }
603     648  
604   function R esNavigati onRet( $fo rm_name, $ short = 0,  $function ='', $aVar  = '' )   649   function R esNavigati onRet( $fo rm_name, $ short = 0,  $function ='', $aVar  = '' )
605   {   650   {
606       global  $p_num;   651       global  $p_num;
607       global  $page;   652       global  $page;
608       global  $_page;   653       global  $_page;
609       global  $p_per_pa ge;   654       global  $p_per_pa ge;
610       global  $page_fir st_p;   655       global  $page_fir st_p;
611       global  $pages_nu m;   656       global  $pages_nu m;
612       global  $logged;   657       global  $logged;
613       global  $oTemplCo nfig;   658       global  $oTemplCo nfig;
614       global  $gallery_ view;   659       global  $gallery_ view;
615     660  
616       $pages _around =  5;   661       $pages _around =  5;
617           
618       if ( ! is_array($ aVar) )   662       if ( ! is_array($ aVar) )
619       {   663       {
620           $p er_page_ar ray = arra y(10, 15,  20, 30, 50 );   664           $p er_page_ar ray = arra y(10, 15,  20, 30, 50 );
621       }   665       }
622       else   666       else
623       {   667       {
624           $p er_page_ar ray = $aVa r;   668           $p er_page_ar ray = $aVa r;
625       }   669       }
626          670       
627       if ( $ logged['ad min'] )   671       if ( $ logged['ad min'] )
628           ar ray_push($ per_page_a rray, 100) ;   672           ar ray_push($ per_page_a rray, 100) ;
629     673  
630       if ( ! $function  )   674       if ( ! $function  )
631       {   675       {
632           $g et_vars_co ntrols = g et_vars_co ntrols(1,  0, 1, 1, 1 );   676           $g et_vars_co ntrols = g et_vars_co ntrols(1,  0, 1, 1, 1 );
633           $g et_vars =  get_vars(0 , 1, 1, 1,  0);   677           $g et_vars =  get_vars(0 , 1, 1, 1,  0);
634       }   678       }
635       else   679       else
636       {   680       {
637           $f unc = crea te_functio n( '', $fu nction );   681           $f unc = crea te_functio n( '', $fu nction );
638           $g et_vars =  $func();   682           $g et_vars =  $func();
639       }   683       }
640     684  
641       $galle ry_view =  (int)$gall ery_view;   685       $galle ry_view =  (int)$gall ery_view;
642     686  
643       ob_sta rt();   687       ob_sta rt();
644     688  
645       if ( $ p_num )   689       if ( $ p_num )
646       {   690       {
647   ?>   691   ?>
648           <f orm name=" <?= 'NavFo rm' . $for m_name ?>"  id="<?= ' NavForm' .  $form_nam e ?>" meth od="get" a ction="<?=  $_SERVER[ 'PHP_SELF' ] ?>" styl e="margin:  0px;">   692           <f orm name=" <?= 'NavFo rm' . $for m_name ?>"  id="<?= ' NavForm' .  $form_nam e ?>" meth od="get" a ction="<?=  $_SERVER[ 'PHP_SELF' ] ?>" styl e="margin:  0px;">
649                <?= $get _vars_cont rols ?>   693                <?= $get _vars_cont rols ?>
650                <table c lass="text 2" cellpad ding="0" c ellspacing ="0" borde r="0">   694                <table c lass="text 2" cellpad ding="0" c ellspacing ="0" borde r="0">
651   <?   695   <?
652           if  ( !$short  )   696           if  ( !$short  )
653           {   697           {
654   ?>   698   ?>
655                    <tr>   699                    <tr>
656                         <td><?= _t ("_Results ") ?>:&nbs p;<b><?= ( int)$page_ first_p ?> </b>-<b><? = min((int )($page_fi rst_p + $p _per_page  - 1), (int )$p_num) ? ></b>&nbsp ;|&nbsp;<? = _t("Tota l") ?>:&nb sp;<b><?=  (int)$p_nu m ?></b></ td>   700                         <td><?= _t ("_Results ") ?>:&nbs p;<b><?= ( int)$page_ first_p ?> </b>-<b><? = min((int )($page_fi rst_p + $p _per_page  - 1), (int )$p_num) ? ></b>&nbsp ;|&nbsp;<? = _t("Tota l") ?>:&nb sp;<b><?=  (int)$p_nu m ?></b></ td>
657                         <td>&nbsp; |&nbsp;<?=  _t("_Resu lts per pa ge") ?>:&n bsp;</td>   701                         <td>&nbsp; |&nbsp;<?=  _t("_Resu lts per pa ge") ?>:&n bsp;</td>
658                         <td>   702                         <td>
659                             <selec t name="p_ per_page"  onchange=" javascript : document .forms['<? = 'NavForm ' . $form_ name ?>']. submit();" >   703                             <selec t name="p_ per_page"  onchange=" javascript : document .forms['<? = 'NavForm ' . $form_ name ?>']. submit();" >
660   <?   704   <?
661                foreach  ( $per_pag e_array as  $per_page _elem )   705                foreach  ( $per_pag e_array as  $per_page _elem )
662                {   706                {
663                    echo  "<option  value=\"{$ per_page_e lem}\" ".  ($p_per_pa ge == $per _page_elem  ? 'select ed="select ed"' : '')  .">{$per_ page_elem} </option>" ;   707                    echo  "<option  value=\"{$ per_page_e lem}\" ".  ($p_per_pa ge == $per _page_elem  ? 'select ed="select ed"' : '')  .">{$per_ page_elem} </option>" ;
664                }   708                }
665   ?>   709   ?>
666                             </sele ct>   710                             </sele ct>
667                         </td>   711                         </td>
668                         <td>&nbsp; </td>   712                         <td>&nbsp; </td>
669                    </tr >   713                    </tr >
670   <?   714   <?
671           }   715           }
672   ?>   716   ?>
673                    <tr>   717                    <tr>
674                         <td align= "center" c olspan="3" >   718                         <td align= "center" c olspan="3" >
675                             <?= _t ('_Pages')  ?>:&nbsp;   719                             <?= _t ('_Pages')  ?>:&nbsp;
676   <?   720   <?
677           if  ( $page >  1 )   721           if  ( $page >  1 )
678           {   722           {
679                echo "   723                echo "
680                             <a hre f=\"{$_SER VER['PHP_S ELF']}{$ge t_vars}pag e=1&amp;ga llery_view ={$gallery _view}\">" . _t("_Fir st") ."</a >&nbsp;|&n bsp;   724                             <a hre f=\"{$_SER VER['PHP_S ELF']}{$ge t_vars}pag e=1&amp;ga llery_view ={$gallery _view}\">" . _t("_Fir st") ."</a >&nbsp;|&n bsp;
681                             <a hre f=\"{$_SER VER['PHP_S ELF']}{$ge t_vars}pag e=". (int) ($page - 1 ) ."&amp;g allery_vie w={$galler y_view}\"> ". _t("_Pr ev") ."</a >&nbsp;|&n bsp;";   725                             <a hre f=\"{$_SER VER['PHP_S ELF']}{$ge t_vars}pag e=". (int) ($page - 1 ) ."&amp;g allery_vie w={$galler y_view}\"> ". _t("_Pr ev") ."</a >&nbsp;|&n bsp;";
682           }   726           }
683     727  
684           //  print all  previous  pages   728           //  print all  previous  pages
685           fo r ( $i = m ax($page -  $pages_ar ound, 1);  $i < $page  ; $i++ )   729           fo r ( $i = m ax($page -  $pages_ar ound, 1);  $i < $page  ; $i++ )
686           {   730           {
687                echo "   731                echo "
688                             <a hre f=\"{$_SER VER['PHP_S ELF']}{$ge t_vars}pag e={$i}&amp ;gallery_v iew={$gall ery_view}\ ">{$i}</a> &nbsp;";   732                             <a hre f=\"{$_SER VER['PHP_S ELF']}{$ge t_vars}pag e={$i}&amp ;gallery_v iew={$gall ery_view}\ ">{$i}</a> &nbsp;";
689           }   733           }
690           //  print cur rent page   734           //  print cur rent page
691           ec ho "   735           ec ho "
692                             [{$pag e}]&nbsp;" ;   736                             [{$pag e}]&nbsp;" ;
693           //  print all  next page s   737           //  print all  next page s
694           fo r ( $i = $ page + 1;  $i <= min( $page + $p ages_aroun d, $pages_ num); $i++  )   738           fo r ( $i = $ page + 1;  $i <= min( $page + $p ages_aroun d, $pages_ num); $i++  )
695           {   739           {
696                echo "   740                echo "
697                             <a hre f=\"{$_SER VER['PHP_S ELF']}{$ge t_vars}pag e={$i}&amp ;gallery_v iew={$gall ery_view}\ ">{$i}</a> &nbsp;";   741                             <a hre f=\"{$_SER VER['PHP_S ELF']}{$ge t_vars}pag e={$i}&amp ;gallery_v iew={$gall ery_view}\ ">{$i}</a> &nbsp;";
698           }   742           }
699     743  
700           if  ( $page <  $pages_nu m )   744           if  ( $page <  $pages_nu m )
701           {   745           {
702                echo "   746                echo "
703                             <a hre f=\"{$_SER VER['PHP_S ELF']}{$ge t_vars}pag e=". (int) ($page + 1 ) ."&amp;g allery_vie w={$galler y_view}\"> ". _t("_Ne xt") ."</a >&nbsp;|&n bsp;   747                             <a hre f=\"{$_SER VER['PHP_S ELF']}{$ge t_vars}pag e=". (int) ($page + 1 ) ."&amp;g allery_vie w={$galler y_view}\"> ". _t("_Ne xt") ."</a >&nbsp;|&n bsp;
704                             <a hre f=\"{$_SER VER['PHP_S ELF']}{$ge t_vars}pag e={$pages_ num}&amp;g allery_vie w={$galler y_view}\"> ". _t("_La st") ."</a >";   748                             <a hre f=\"{$_SER VER['PHP_S ELF']}{$ge t_vars}pag e={$pages_ num}&amp;g allery_vie w={$galler y_view}\"> ". _t("_La st") ."</a >";
705           }   749           }
706   ?>   750   ?>
707                         </td>   751                         </td>
708   <?   752   <?
709           //  print gal lery optio n for sear ch page   753           //  print gal lery optio n for sear ch page
710           if  ( $_page[ 'name_inde x'] == 32  && $oTempl Config ->  show_galle ry_link_in _page_navi gation )   754           if  ( $_page[ 'name_inde x'] == 32  && $oTempl Config ->  show_galle ry_link_in _page_navi gation )
711           {   755           {
712                if ( $ga llery_view  )   756                if ( $ga llery_view  )
713                {   757                {
714                    echo  "   758                    echo  "
715                         <td style= \"padding- left: 10px ;\"><a hre f=\"{$_SER VER['PHP_S ELF']}{$ge t_vars}pag e={$page}& amp;galler y_view=0\" >". _t("_v iew as pro file detai ls") ."</a ></td>";   759                         <td style= \"padding- left: 10px ;\"><a hre f=\"{$_SER VER['PHP_S ELF']}{$ge t_vars}pag e={$page}& amp;galler y_view=0\" >". _t("_v iew as pro file detai ls") ."</a ></td>";
716                }   760                }
717                else   761                else
718                {   762                {
719                    echo  "   763                    echo  "
720                         <td style= \"padding- left: 10px ;\"><a hre f=\"{$_SER VER['PHP_S ELF']}{$ge t_vars}pag e={$page}& amp;galler y_view=1\" >". _t("_v iew as pho to gallery ") ."</a>< /td>";   764                         <td style= \"padding- left: 10px ;\"><a hre f=\"{$_SER VER['PHP_S ELF']}{$ge t_vars}pag e={$page}& amp;galler y_view=1\" >". _t("_v iew as pho to gallery ") ."</a>< /td>";
721                }   765                }
722           }   766           }
723           el se   767           el se
724           {   768           {
725                echo "   769                echo "
726                         <td>&nbsp; </td>";   770                         <td>&nbsp; </td>";
727           }   771           }
728   ?>   772   ?>
729                    </tr >   773                    </tr >
730                </table>   774                </table>
731           </ form>   775           </ form>
732   <?   776   <?
733       }   777       }
734     778  
735       $ret =  ob_get_co ntents();   779       $ret =  ob_get_co ntents();
736       ob_end _clean();   780       ob_end _clean();
737     781  
738       return  $ret;   782       return  $ret;
739   }   783   }
740     784  
741   function g etID( $str , $with_em ail = 1 )   785   function g etID( $str , $with_em ail = 1 )
742   {   786   {
743       if ( $ with_email  )   787       if ( $ with_email  )
744       {   788       {
745           if  ( eregi(" ^[_.0-9a-z -]+@([0-9a -z][0-9a-z -]+.)+[a-z ]{2,4}$",  $str) )   789           if  ( eregi(" ^[_.0-9a-z -]+@([0-9a -z][0-9a-z -]+.)+[a-z ]{2,4}$",  $str) )
746           {   790           {
747                $str = p rocess_db_ input($str );   791                $str = p rocess_db_ input($str );
748                $mail_ar r = db_arr ( "SELECT  `ID` FROM  `Profiles`  WHERE `Em ail` = '$s tr'" );   792                $mail_ar r = db_arr ( "SELECT  `ID` FROM  `Profiles`  WHERE `Em ail` = '$s tr'" );
749                if ( (in t)$mail_ar r['ID'] )   793                if ( (in t)$mail_ar r['ID'] )
750                {   794                {
751                    retu rn (int)$m ail_arr['I D'];   795                    retu rn (int)$m ail_arr['I D'];
752                }   796                }
753           }   797           }
754       }   798       }
755     799  
756       $ID =  (int)$str;   800       $ID =  (int)$str;
757       if ( s trcmp("$st r", "$ID")  == 0 )   801       if ( s trcmp("$st r", "$ID")  == 0 )
758           re turn $ID;   802           re turn $ID;
759       else   803       else
760       {   804       {
761           $s tr = proce ss_db_inpu t($str);   805           $s tr = proce ss_db_inpu t($str);
762           $n ick_arr =  db_arr( "S ELECT `ID`  FROM `Pro files` WHE RE `NickNa me` = '$st r'" );   806           $n ick_arr =  db_arr( "S ELECT `ID`  FROM `Pro files` WHE RE `NickNa me` = '$st r'" );
763           if  ( (int)$n ick_arr['I D'] )   807           if  ( (int)$n ick_arr['I D'] )
764           {   808           {
765                return ( int)$nick_ arr['ID'];   809                return ( int)$nick_ arr['ID'];
766           }   810           }
767       }   811       }
768     812  
769       return  0;   813       return  0;
770   }   814   }
771     815  
772   function c heck_login ( $ID, $pa sswd, $db  = 'Profile s', $error _handle =  true )   816   function c heck_login ( $ID, $pa sswd, $db  = 'Profile s', $error _handle =  true )
773   {   817   {
774       global  $site;   818       global  $site;
775       global  $logged;   819       global  $logged;
776       global  $_page;   820       global  $_page;
777     821  
778       switch ( $db )   822       switch ( $db )
779       {   823       {
780           ca se 'Profil es': $memb er = 0; br eak;   824           ca se 'Profil es': $memb er = 0; br eak;
781           ca se 'Admins ': $member  = 1; brea k;   825           ca se 'Admins ': $member  = 1; brea k;
782           ca se 'aff':  $member =  2; break;   826           ca se 'aff':  $member =  2; break;
783           ca se 'modera tors': $me mber = 3;  break;   827           ca se 'modera tors': $me mber = 3;  break;
784       }   828       }
785     829  
786       if ( 0  == strcmp ( $db, 'Pr ofiles' )  && !(int)$ ID )   830       if ( 0  == strcmp ( $db, 'Pr ofiles' )  && !(int)$ ID )
787       {   831       {
788           if  ( $error_ handle )   832           if  ( $error_ handle )
789                login_fo rm( _t("_P ROFILE_ERR "), $membe r );   833                login_fo rm( _t("_P ROFILE_ERR "), $membe r );
790           re turn false ;   834           re turn false ;
791       }   835       }
792     836  
793       if ( s trcmp( $db , 'Admins'  ) == 0 )   837       if ( s trcmp( $db , 'Admins'  ) == 0 )
794       {   838       {
795           $I D = proces s_db_input ( $ID );   839           $I D = proces s_db_input ( $ID );
796           $c ond = "`Na me` = '$ID '";   840           $c ond = "`Na me` = '$ID '";
797       }   841       }
798       elseif  ( strcmp(  $db, 'Pro files' ) = = 0 )   842       elseif  ( strcmp(  $db, 'Pro files' ) = = 0 )
799       {   843       {
800           $I D = (int)$ ID;   844           $I D = (int)$ ID;
801           $c ond = "`ID ` = $ID";   845           $c ond = "`ID ` = $ID";
802       }   846       }
803       elseif  ( strcmp(  $db, 'mod erators')  == 0 )   847       elseif  ( strcmp(  $db, 'mod erators')  == 0 )
804       {   848       {
805           $I D = proces s_db_input ( $ID );   849           $I D = proces s_db_input ( $ID );
806           $c ond = "`na me` = '$ID '";   850           $c ond = "`na me` = '$ID '";
807       }   851       }
808       else   852       else
809       {   853       {
810           if  ( is_nume ric($ID) )   854           if  ( is_nume ric($ID) )
811           {   855           {
812                $ID = (i nt)$ID;   856                $ID = (i nt)$ID;
813                $cond =  "`ID` = "  . (int)$ID ;   857                $cond =  "`ID` = "  . (int)$ID ;
814           }   858           }
815           el seif ( str str($ID, " @") )   859           el seif ( str str($ID, " @") )
816           {   860           {
817                $ID = pr ocess_db_i nput( $ID  );   861                $ID = pr ocess_db_i nput( $ID  );
818                $cond =  "`email` =  '$ID'";   862                $cond =  "`email` =  '$ID'";
819           }   863           }
820           el se   864           el se
821           {   865           {
822                $ID = pr ocess_db_i nput( $ID  );   866                $ID = pr ocess_db_i nput( $ID  );
823                $cond =  "`NickName ` = '$ID'" ;   867                $cond =  "`NickName ` = '$ID'" ;
824           }   868           }
825       }   869       }
826     870  
827       $query  = "SELECT  `Password ` FROM $db  WHERE $co nd";   871       $query  = "SELECT  `Password ` FROM $db  WHERE $co nd";
828       $pwd_a rr = db_ar r( $query  );   872       $pwd_a rr = db_ar r( $query  );
829     873  
830       // If  no such me mbers   874       // If  no such me mbers
831       if ( ! $pwd_arr )   875       if ( ! $pwd_arr )
832       {   876       {
833           if  ( $error_ handle )   877           if  ( $error_ handle )
834                login_fo rm( _t("_P ROFILE_ERR "), $membe r );   878                login_fo rm( _t("_P ROFILE_ERR "), $membe r );
835           re turn false ;   879           re turn false ;
836       }   880       }
837     881  
838       // If  password i s incorrec t   882       // If  password i s incorrec t
839       $real_ pwd = $pwd _arr['Pass word'];   883       $real_ pwd = $pwd _arr['Pass word'];
840          884       
841       if ( s trcmp( $re al_pwd, $p asswd ) !=  0 )   885       if ( s trcmp( $re al_pwd, $p asswd ) !=  0 )
842       {   886       {
843           if  ( $error_ handle )   887           if  ( $error_ handle )
844                login_fo rm( _t("_I NVALID_PAS SWD"), $me mber );   888                login_fo rm( _t("_I NVALID_PAS SWD"), $me mber );
845           re turn false ;   889           re turn false ;
846       }   890       }
847     891  
848       // Upd ate last n avigation  time   892       // Upd ate last n avigation  time
849        if   (   !$member   )
  893        if   (   !$member   )   {
850       {   894            $query   =   "UPDATE   $db   SET   ` D a
t
e
LastNav
`   =   NOW (
)  
WHERE   `ID`   =   $ID";
851            $query   =   "UPDATE   $db   SET   ` L a s t NavTim e `   =   NOW(),   ` LastNav Page `   =   ".   ( int ) $_page['na me_index'] .   "   WHERE   `ID`   =   $ID";    
852           re turn db_re s( $query  );   895           re turn db_re s( $query  );
853       }   896       }
854     897  
855       return  true;   898       return  true;
856   }   899   }
857     900  
858   function c heck_logge d(){   901   function c heck_logge d(){
859       global  $logged;   902       global  $logged;
860       $aAccT ypes = arr ay(1 => 'a dmin', 0 = > 'member' , 2 => 'af f', 3 => ' moderator' );   903       $aAccT ypes = arr ay(1 => 'a dmin', 0 = > 'member' , 2 => 'af f', 3 => ' moderator' );
861       foreac h ($aAccTy pes as $ke y => $valu e) {   904       foreac h ($aAccTy pes as $ke y => $valu e) {
862           if  ($logged[ $value] =  member_aut h( $key, f alse )) br eak;   905           if  ($logged[ $value] =  member_aut h( $key, f alse )) br eak;
863       }   906       }
864   }   907   }
865     908  
866   // 0 - mem ber, 1 - a dmin   909   // 0 - mem ber, 1 - a dmin
867   function   member_aut h   (   $member   =   0,   $error_han dle   =   true  
)
  910   function   member_aut h   (   $member   =   0,   $error_han dle   =   true ,   $bAjx   =   false   )
868   {   911   {
869       global  $site;   912       global  $site;
870       global  $dir;   913       global  $dir;
871       global  $tab;   914       global  $tab;
872       global  $logged;   915       global  $logged;
873     916  
874       switch ( $member  )   917       switch ( $member  )
875       {   918       {
876           ca se 0:   919           ca se 0:
877                $mem         = 'mem ber';   920                $mem         = 'mem ber';
878                $table       = 'Pro files';   921                $table       = 'Pro files';
879                $login_p age = "{$s ite['url'] }member.ph p";   922                $login_p age = "{$s ite['url'] }member.ph p";
880           br eak;   923           br eak;
881           ca se 1:   924           ca se 1:
882                $mem         = 'adm in';   925                $mem         = 'adm in';
883                $table       = 'Adm ins';   926                $table       = 'Adm ins';
884                $login_p age = "{$s ite['url_a dmin']}ind ex.php";   927                $login_p age = "{$s ite['url_a dmin']}ind ex.php";
885           br eak;   928           br eak;
886           ca se 2:   929           ca se 2:
887                $mem         = 'aff ';   930                $mem         = 'aff ';
888                $table       = 'aff ';   931                $table       = 'aff ';
889                $login_p age = "{$s ite['url_a ff']}index .php";   932                $login_p age = "{$s ite['url_a ff']}index .php";
890           br eak;   933           br eak;
891           //   934           //
892           ca se 3:   935           ca se 3:
893                $mem = ' moderator' ;   936                $mem = ' moderator' ;
894                $table =  'moderato rs';   937                $table =  'moderato rs';
895                $login_p age = "{$s ite['url'] }moderator s/index.ph p";   938                $login_p age = "{$s ite['url'] }moderator s/index.ph p";
896           br eak;   939           br eak;
897       }   940       }
898     941  
899       if ( ! $_COOKIE[  $mem . "ID " ] || !$_ COOKIE[ $m em . "Pass word" ] )   942       if ( ! $_COOKIE[  $mem . "ID " ] || !$_ COOKIE[ $m em . "Pass word" ] )
900       {   943       {
901     944  
902           if  ( $error_ handle )   945           if  ( $error_ handle )
903           {   946           {
904               $text = _ t("_LOGIN_ REQUIRED_A E1");   947               $text = _ t("_LOGIN_ REQUIRED_A E1");
905               if ( !$me mber )   948               if ( !$me mber )
906                   $text  .= "<br / >"._t("_LO GIN_REQUIR ED_AE2", $ site['imag es'], $sit e['url'],  $site['tit le']);   949                   $text  .= "<br / >"._t("_LO GIN_REQUIR ED_AE2", $ site['imag es'], $sit e['url'],  $site['tit le']);
907                login_form (   $text,   $member  
);
  950                $bAjxMod e = ( isse t( $_SERVE R['HTTP_X_ REQUESTED_ WITH'] ) a nd $_SERVE R['HTTP_X_ REQUESTED_ WITH'] ==  'XMLHttpRe quest' ) ?  true : fa lse;
    951                if ($mem ber=1 && $ bAjx==true ) $bAjxMod e = true;
    952                login_form (   $text,   $member ,   $bAjxMode   );
908           }   953           }
909           re turn false ;   954           re turn false ;
910       }   955       }
911     956  
912       return  check_log in( $_COOK IE[ $mem .  'ID' ], $ _COOKIE[ $ mem . 'Pas sword' ],  $table, $e rror_handl e );   957       return  check_log in( $_COOK IE[ $mem .  'ID' ], $ _COOKIE[ $ mem . 'Pas sword' ],  $table, $e rror_handl e );
913   }   958   }
914     959  
915   function g etDiscount edAmount(  $number, $ amount )    
916   {    
917       $numbe r = (int)$ number;    
918       $total  = 0;    
919       $arr =  db_arr("S ELECT `Dis countPerce nt` FROM ` ContactDis counts` WH ERE `Profi lesNumber`  <= {$numb er} ORDER  BY `Profil esNumber`  DESC LIMIT  1");    
920       if ( ! $arr )    
921       {    
922           re turn $amou nt;    
923       }    
924       else    
925       {    
926           re turn $arr[ 'DiscountP ercent'] /  100.0 * $ amount;  / / divide b y 100 as d iscont in  percents    
927       }    
928   }    
929      
930   function M emberConta cted( $ID  )   960   function M emberConta cted( $ID  )
931   {   961   {
932       $ID =  (int)$ID;   962       $ID =  (int)$ID;
933       if ( ! $ID )   963       if ( ! $ID )
934           re turn;   964           re turn;
935     965  
936       $c_arr  = db_arr(  "SELECT C OUNT(*) FR OM `Bought Contacts`  WHERE `IDB uyer` = $I D" );   966       $c_arr  = db_arr(  "SELECT C OUNT(*) FR OM `Bought Contacts`  WHERE `IDB uyer` = $I D" );
937       return  $c_arr[0] ;   967       return  $c_arr[0] ;
938   }   968   }
939     969  
940   function M emberWasCo ntacted( $ ID )   970   function M emberWasCo ntacted( $ ID )
941   {   971   {
942       $ID =  (int)$ID;   972       $ID =  (int)$ID;
943       if ( ! $ID )   973       if ( ! $ID )
944           re turn;   974           re turn;
945     975  
946       $c_arr  = db_arr(  "SELECT C OUNT(*) FR OM `Bought Contacts`  WHERE `IDC ontact` =  $ID" );   976       $c_arr  = db_arr(  "SELECT C OUNT(*) FR OM `Bought Contacts`  WHERE `IDC ontact` =  $ID" );
947       return  $c_arr[0] ;   977       return  $c_arr[0] ;
948   }   978   }
949     979  
950     980  
951   function p rofile_del ete( $ID )   981   function p rofile_del ete( $ID )
952   {   982   {
953       global  $MySQL;   983       global  $MySQL;
954       global  $dir;   984       global  $dir;
    985       global  $site;
    986       global  $logged;
955          987       
956       $ID =  (int)$ID;   988       $ID =  (int)$ID;
957          989       
958       if ( ! $ID )   990       if ( ! $ID )
959           re turn false ;   991           re turn false ;
960          992       
961       if ( ! getProfile Info( $ID  ) )   993       if ( ! getProfile Info( $ID  ) )
962           re turn false ;   994           re turn false ;
963     995  
964       module s_del($ID) ;   996       module s_del($ID) ;
965     997  
966       db_res ( "DELETE  FROM `VKis ses` WHERE  `ID` = '{ $ID}' OR ` Member` =  '{$ID}'" ) ;   998       db_res ( "DELETE  FROM `VKis ses` WHERE  `ID` = '{ $ID}' OR ` Member` =  '{$ID}'" ) ;
967       db_res ( "DELETE  FROM `Prof iles` WHER E `ID` = ' {$ID}'" );   999       db_res ( "DELETE  FROM `Prof iles` WHER E `ID` = ' {$ID}'" );
968          1000       
969       if ( ! mysql_affe cted_rows( ) )   1001       if ( ! mysql_affe cted_rows( ) )
970           re turn false ;   1002           re turn false ;
971          1003       
972       db_res ( "DELETE  FROM `Bloc kList` WHE RE `ID` =  '{$ID}' OR  `Profile`  = '{$ID}' ;" );   1004       db_res ( "DELETE  FROM `Bloc kList` WHE RE `ID` =  '{$ID}' OR  `Profile`  = '{$ID}' ;" );
973       db_res ( "DELETE  FROM `Prof ilesTrack`  WHERE `Me mber` = '{ $ID}' OR ` Profile` =  '{$ID}'"  );   1005       db_res ( "DELETE  FROM `Prof ilesTrack`  WHERE `Me mber` = '{ $ID}' OR ` Profile` =  '{$ID}'"  );
974   //  db_res ( "DELETE  FROM `Prof ilesRelati ons` WHERE  `sourceID ` = '{$ID} ' OR `targ etID` = '{ $ID}';" );    
975       db_res ( "DELETE  FROM `Mess ages` WHER E Recipien t = {$ID}  " );   1006       db_res ( "DELETE  FROM `Mess ages` WHER E Recipien t = {$ID}  " );
976       db_res ( "DELETE  FROM `Gues tbook` WHE RE Recipie nt = {$ID}  " );   1007       db_res ( "DELETE  FROM `Gues tbook` WHE RE Recipie nt = {$ID}  " );
977       db_res ( "DELETE  FROM `MemC redits` WH ERE `ID` =  {$ID}" );    
978       db_res ( "DELETE  FROM `aff_ members` W HERE idPro file = {$I D}" );   1008       db_res ( "DELETE  FROM `aff_ members` W HERE idPro file = {$I D}" );
979       db_res ( "DELETE  FROM `HotL ist` WHERE  ID = {$ID } OR Profi le = {$ID} " );   1009       db_res ( "DELETE  FROM `HotL ist` WHERE  ID = {$ID } OR Profi le = {$ID} " );
980       db_res ( "DELETE  FROM `Frie ndList` WH ERE ID = { $ID} OR Pr ofile = {$ ID}" );   1010       db_res ( "DELETE  FROM `Frie ndList` WH ERE ID = { $ID} OR Pr ofile = {$ ID}" );
981       db_res ( "DELETE  FROM `Bloc kList` WHE RE ID = {$ ID} OR Pro file = {$I D}" );   1011       db_res ( "DELETE  FROM `Bloc kList` WHE RE ID = {$ ID} OR Pro file = {$I D}" );
982       db_res ( "DELETE  FROM `Boug htContacts ` WHERE `I DBuyer` =  {$ID} OR ` IDContact`  = {$ID}"  );   1012       db_res ( "DELETE  FROM `Boug htContacts ` WHERE `I DBuyer` =  {$ID} OR ` IDContact`  = {$ID}"  );
983       db_res ( "DELETE  FROM `Prof ileMemLeve ls` WHERE  `IDMember`  = {$ID}"  );   1013       db_res ( "DELETE  FROM `Prof ileMemLeve ls` WHERE  `IDMember`  = {$ID}"  );
984       db_res ( "DELETE  FROM `Prof ilesCommen ts` WHERE  `Sender` =  {$ID} OR  `Recipient ` = {$ID}"  );   1014       db_res ( "DELETE  FROM `Prof ilesCommen ts` WHERE  `Sender` =  {$ID} OR  `Recipient ` = {$ID}"  );
985       db_res ( "DELETE  FROM `Prof ilesPolls`  WHERE `id _profile`  = {$ID}" ) ;   1015       db_res ( "DELETE  FROM `Prof ilesPolls`  WHERE `id _profile`  = {$ID}" ) ;
986       db_res ( "DELETE  FROM `Tags ` WHERE `I D` = {$ID}  AND `Type ` = 'profi le'" );   1016       db_res ( "DELETE  FROM `Tags ` WHERE `I D` = {$ID}  AND `Type ` = 'profi le'" );
987       db_res ( "DELETE  FROM `Grou psMembers`  WHERE `me mberID` =  {$ID}" );   1017       db_res ( "DELETE  FROM `Grou psMembers`  WHERE `me mberID` =  {$ID}" );
988     1018  
989       // del ete profil e votings   1019       // del ete profil e votings
990       requir e_once( BX _DIRECTORY _PATH_CLAS SES . 'BxD olVoting.p hp' );    1020       requir e_once( BX _DIRECTORY _PATH_CLAS SES . 'BxD olVoting.p hp' ); 
991       $oVoti ngProfile  = new BxDo lVoting (' profile',  0, 0);   1021       $oVoti ngProfile  = new BxDo lVoting (' profile',  0, 0);
992       $oVoti ngProfile- >deleteVot ings ($ID) ;   1022       $oVoti ngProfile- >deleteVot ings ($ID) ;
993          1023  
    1024       // del ete profil e comments  
    1025       requir e_once( BX _DIRECTORY _PATH_CLAS SES . 'BxD olCmts.php ' ); 
    1026       $oCmts  = new BxD olCmts ('p rofile', $ ID);
    1027       $oCmts ->onObject Delete ();
    1028       // del ete all co mments in  all commen ts' system s, this us er posted
    1029       $oCmts ->onAuthor Delete ($I D);
    1030  
994       // Cle an gallery   1031       // Cle an gallery
995       $album sRes = db_ res( "SELE CT `ID` FR OM `Galler yAlbums` W HERE `IDMe mber` = {$ ID}" );   1032       $album sRes = db_ res( "SELE CT `ID` FR OM `Galler yAlbums` W HERE `IDMe mber` = {$ ID}" );
996       while  ( $albumAr r = mysql_ fetch_asso c($albumsR es) )   1033       while  ( $albumAr r = mysql_ fetch_asso c($albumsR es) )
997       {   1034       {
998           $a lbumID = $ albumArr[' ID'];   1035           $a lbumID = $ albumArr[' ID'];
999           $o bjectsRes  = db_res(  "SELECT `F ilename`,  `ThumbFile name` FROM  `GalleryO bjects` WH ERE `IDAlb um` = {$al bumID}" );   1036           $o bjectsRes  = db_res(  "SELECT `F ilename`,  `ThumbFile name` FROM  `GalleryO bjects` WH ERE `IDAlb um` = {$al bumID}" );
1000           wh ile ( $obj ectArr = m ysql_fetch _assoc($ob jectsRes)  )   1037           wh ile ( $obj ectArr = m ysql_fetch _assoc($ob jectsRes)  )
1001           {   1038           {
1002                @unlink(  "{$dir['g allery']}{ $objectArr ['Filename ']}" );   1039                @unlink(  "{$dir['g allery']}{ $objectArr ['Filename ']}" );
1003                if ( str len($objec tArr['Thum bFilename' ]) && file _exists("{ $dir['gall ery']}{$ob jectArr['T humbFilena me']}") )   1040                if ( str len($objec tArr['Thum bFilename' ]) && file _exists("{ $dir['gall ery']}{$ob jectArr['T humbFilena me']}") )
1004                    @unl ink( "{$di r['gallery ']}{$objec tArr['Thum bFilename' ]}" );   1041                    @unl ink( "{$di r['gallery ']}{$objec tArr['Thum bFilename' ]}" );
1005           }   1042           }
1006           db _res( "DEL ETE FROM ` GalleryObj ects` WHER E `IDAlbum ` = {$albu mID}" );   1043           db _res( "DEL ETE FROM ` GalleryObj ects` WHER E `IDAlbum ` = {$albu mID}" );
1007       }   1044       }
1008       db_res ( "DELETE  FROM `Gall eryAlbums`  WHERE `ID Member` =  {$ID}" );   1045       db_res ( "DELETE  FROM `Gall eryAlbums`  WHERE `ID Member` =  {$ID}" );
1009     1046  
1010       // Cle an customi zations   1047       // Cle an customi zations
1011       $custo mArr = db_ arr( "SELE CT `Backgr oundFilena me` FROM ` ProfilesSe ttings` WH ERE `IDMem ber` = {$I D}" );   1048       $custo mArr = db_ arr( "SELE CT `Backgr oundFilena me` FROM ` ProfilesSe ttings` WH ERE `IDMem ber` = {$I D}" );
1012       if ( s trlen($cus tomArr['Ba ckgroundFi lename'])  && file_ex ists($dir[ 'profileIm age'] . $c ustomArr[' Background Filename'] ) && is_fi le($dir['p rofileImag e'] . $cus tomArr['Ba ckgroundFi lename'])  )   1049       if ( s trlen($cus tomArr['Ba ckgroundFi lename'])  && file_ex ists($dir[ 'profileIm age'] . $c ustomArr[' Background Filename'] ) && is_fi le($dir['p rofileImag e'] . $cus tomArr['Ba ckgroundFi lename'])  )
1013           un link( $dir ['profileI mage'] . $ customArr[ 'Backgroun dFilename' ] );   1050           un link( $dir ['profileI mage'] . $ customArr[ 'Backgroun dFilename' ] );
1014       db_res ( "DELETE  FROM `Prof ilesSettin gs` WHERE  `IDMember`  = {$ID}"  );   1051       db_res ( "DELETE  FROM `Prof ilesSettin gs` WHERE  `IDMember`  = {$ID}"  );
1015          1052       
1016       // del ete media   1053       // del ete media
1017       $rMedi a = db_res ( "SELECT  `med_id`,  `med_file` , `med_typ e` FROM `m edia` WHER E `med_pro f_id` = {$ ID}" );   1054       $rMedi a = db_res ( "SELECT  `med_id`,  `med_file` , `med_typ e` FROM `m edia` WHER E `med_pro f_id` = {$ ID}" );
1018     1055  
1019       $oVoti ngMedia =  new BxDolV oting ('me dia', 0, 0 );   1056       $oVoti ngMedia =  new BxDolV oting ('me dia', 0, 0 );
1020       while(  $aMedia =  mysql_fet ch_assoc(  $rMedia )  )   1057       while(  $aMedia =  mysql_fet ch_assoc(  $rMedia )  )
1021       {   1058       {
1022           sw itch( $aMe dia['med_t ype'] )   1059           sw itch( $aMe dia['med_t ype'] )
1023           {   1060           {
1024                case 'ph oto':   1061                case 'ph oto':
1025                    $med Dir = $dir ['profileI mage'] . $ ID . "/";   1062                    $med Dir = $dir ['profileI mage'] . $ ID . "/";
1026                    @unl ink( $medD ir . 'icon _' . $aMed ia['med_fi le'] );   1063                    @unl ink( $medD ir . 'icon _' . $aMed ia['med_fi le'] );
1027                    @unl ink( $medD ir . 'phot o_' . $aMe dia['med_f ile'] );   1064                    @unl ink( $medD ir . 'phot o_' . $aMe dia['med_f ile'] );
1028                    @unl ink( $medD ir . 'thum b_' . $aMe dia['med_f ile'] );   1065                    @unl ink( $medD ir . 'thum b_' . $aMe dia['med_f ile'] );
1029                break;   1066                break;
1030                case 'au dio':   1067                case 'au dio':
1031                    $med Dir = $dir ['profileS ound'] . $ ID . "/";   1068                    $med Dir = $dir ['profileS ound'] . $ ID . "/";
1032                    @unl ink( $medD ir . $aMed ia['med_fi le'] );   1069                    @unl ink( $medD ir . $aMed ia['med_fi le'] );
1033                break;   1070                break;
1034                case 'vi deo':   1071                case 'vi deo':
1035                    $med Dir = $dir ['profileV ideo'] . $ ID . "/";   1072                    $med Dir = $dir ['profileV ideo'] . $ ID . "/";
1036                    @unl ink( $medD ir . $aMed ia['med_fi le'] );   1073                    @unl ink( $medD ir . $aMed ia['med_fi le'] );
1037                break;   1074                break;
1038           }   1075           }
1039           //  delete me dia voting              1076           //  delete me dia voting           
1040           $o VotingMedi a->deleteV otings ($a Media['med _id']);   1077           $o VotingMedi a->deleteV otings ($a Media['med _id']);
1041       }   1078       }
1042       
delete Profil e
Galler ies ($ID
);
  1079       $aMem  = array();
1043  
  1080       $aMedi a = array( 'photo','m usic','vid eo');
    1081       foreac h ($aMedia  as $sVal)  {
    1082           $o Media = ne w BxDolSha redMedia($ sVal, $sit e, $dir, $ aMem);
    1083            $oMedia-> delete Us e r Galler y ($ID ,   $logged );
    1084        }
1044          1085       
1045       db_res ( "DELETE  FROM `medi a` WHERE ` med_prof_i d` = {$ID} " );   1086       db_res ( "DELETE  FROM `medi a` WHERE ` med_prof_i d` = {$ID} " );
1046          1087       
1047       @rmdir ( $dir['pr ofileImage '] . $ID ) ;   1088       @rmdir ( $dir['pr ofileImage '] . $ID ) ;
1048       @rmdir ( $dir['pr ofileVideo '] . $ID ) ;   1089       @rmdir ( $dir['pr ofileVideo '] . $ID ) ;
1049       @rmdir ( $dir['pr ofileSound '] . $ID ) ;   1090       @rmdir ( $dir['pr ofileSound '] . $ID ) ;
1050          1091       
1051          1092       
1052       //Clea n blogs   1093       //Clea n blogs
1053       $aBlog  = db_arr( "SELECT `I D` FROM `B logs` WHER E `OwnerID ` = {$ID}" );   1094       $aBlog  = db_arr( "SELECT `I D` FROM `B logs` WHER E `OwnerID ` = {$ID}" );
1054       $iBlog ID = $aBlo g['ID'];   1095       $iBlog ID = $aBlo g['ID'];
1055       if ($i BlogID>0)  {   1096       if ($i BlogID>0)  {
1056           // Clean blog s   1097           // Clean blog s
1057           $o Blogs = ne w BxDolBlo gs(TRUE);   1098           $o Blogs = ne w BxDolBlo gs(TRUE);
1058           $o Blogs->bAd minMode =  TRUE;   1099           $o Blogs->bAd minMode =  TRUE;
1059           (i nt)$_REQUE ST['Delete BlogID'] =  $iBlogID;   1100           (i nt)$_REQUE ST['Delete BlogID'] =  $iBlogID;
1060           $o Blogs->Act ionDeleteB logSQL();   1101           $o Blogs->Act ionDeleteB logSQL();
1061       }   1102       }
1062     1103  
1063       //dele te user cl assifieds   1104       //dele te user cl assifieds
1064       $oClas sifieds =  new BxDolC lassifieds ();   1105       $oClas sifieds =  new BxDolC lassifieds ();
1065       $oClas sifieds->b AdminMode  = TRUE;   1106       $oClas sifieds->b AdminMode  = TRUE;
1066       $oClas sifieds->D eleteProfi leAdvertis ement($ID) ;   1107       $oClas sifieds->D eleteProfi leAdvertis ement($ID) ;
1067     1108  
1068       //dele te user ev ents   1109       //dele te user ev ents
1069       $oEven ts = new B xDolEvents ();   1110       $oEven ts = new B xDolEvents ();
1070       $oEven ts->bAdmin Mode = TRU E;   1111       $oEven ts->bAdmin Mode = TRU E;
1071       $oEven ts->Delete ProfileEve nts($ID);   1112       $oEven ts->Delete ProfileEve nts($ID);
1072     1113  
1073       //dele te cache f ile   1114       //dele te cache f ile
1074       $sCach eFile = $d ir['cache' ] . 'user'  . $ID . ' .php';   1115       $sCach eFile = $d ir['cache' ] . 'user'  . $ID . ' .php';
1075       @unlin k( $sCache File );   1116       @unlin k( $sCache File );
1076       repars eObjTags(  'profile',  $ID );   1117       repars eObjTags(  'profile',  $ID );
1077   }   1118   }
1078     1119  
1079   function p rofile_sen d_message(  $ID, $mes sage )   1120   function p rofile_sen d_message(  $ID, $mes sage )
1080   {   1121   {
1081       global  $site;   1122       global  $site;
1082     1123  
1083       if ( ! (int)$ID )   1124       if ( ! (int)$ID )
1084           re turn false ;   1125           re turn false ;
1085     1126  
1086       if ( ! strlen( $m essage ) )   1127       if ( ! strlen( $m essage ) )
1087           re turn false ;   1128           re turn false ;
1088     1129  
1089       $p_arr  = getProf ileInfo( $ ID ); //db _arr( "SEL ECT `ID`,  `Email` FR OM `Profil es` WHERE  `ID` = '$I D'" );   1130       $p_arr  = getProf ileInfo( $ ID ); //db _arr( "SEL ECT `ID`,  `Email` FR OM `Profil es` WHERE  `ID` = '$I D'" );
1090     1131  
1091       if ( ! $p_arr )   1132       if ( ! $p_arr )
1092           re turn false ;   1133           re turn false ;
1093     1134  
1094       $text  = getParam ("t_AdminE mail");   1135       $text  = getParam ("t_AdminE mail");
1095       $subje ct = getPa ram("t_Adm inEmail_su bject");   1136       $subje ct = getPa ram("t_Adm inEmail_su bject");
1096     1137  
1097       $recip ient = $p_ arr['Email '];   1138       $recip ient = $p_ arr['Email '];
1098     1139  
1099       $aPlus  = array() ;   1140       $aPlus  = array() ;
1100       $aPlus ['MessageT ext'] = "\ r\n$messag e\r\n";   1141       $aPlus ['MessageT ext'] = "\ r\n$messag e\r\n";
1101     1142  
1102       $mail_ ret = send Mail( $rec ipient, $s ubject, $t ext, $p_ar r['ID'], $ aPlus );   1143       $mail_ ret = send Mail( $rec ipient, $s ubject, $t ext, $p_ar r['ID'], $ aPlus );
1103     1144  
1104       if ( ! $mail_ret  )   1145       if ( ! $mail_ret  )
1105           re turn false ;   1146           re turn false ;
1106       return  true;   1147       return  true;
1107   }   1148   }
1108     1149  
1109   function g et_user_on line_statu s ($ID)   1150   function g et_user_on line_statu s ($ID)
1110   {   1151   {
1111       $ID =  (int)$ID;   1152       $ID =  (int)$ID;
1112       $min =  getParam(  "member_o nline_time " );   1153       $min =  getParam(  "member_o nline_time " );
1113        $onl_arr   =   db_arr("SE LECT   count(ID)   as   count_id   FROM   Profiles   WHERE  
LastNav Time   >   SUBDATE(NO W(),   INTERVAL   $min   MINUTE)   AND   ID=$ID");
  1154        $onl_arr   =   db_arr("SE LECT   count(ID)   as   count_id   FROM   Profiles   WHERE   Date LastNav  
>   SUBDATE(NO W(),   INTERVAL   $min   MINUTE)   AND   ID=$ID");
1114       return  (int)( $o nl_arr[cou nt_id] ==  1 );   1155       return  (int)( $o nl_arr[cou nt_id] ==  1 );
1115   }   1156   }
1116     1157  
1117     1158  
1118   /**   1159   /**
1119     * who   1160     * who
1120     *   0 -  all   1161     *   0 -  all
1121     *   1 -  man   1162     *   1 -  man
1122     *   2 -  woman   1163     *   2 -  woman
1123     **/   1164     **/
1124   function g et_users_o nline_numb er ( $who  = 0, $coun try = "")   1165   function g et_users_o nline_numb er ( $who  = 0, $coun try = "")
1125   {   1166   {
1126       global  $dir;   1167       global  $dir;
1127     1168  
1128       if ( ! $who ) $wh o = '';   1169       if ( ! $who ) $wh o = '';
1129     1170  
1130       $min =  getParam(  "member_o nline_time " );   1171       $min =  getParam(  "member_o nline_time " );
1131       switch  ( $who )   1172       switch  ( $who )
1132       {   1173       {
1133           //  chatting   1174           //  chatting
1134           ca se 't':   1175           ca se 't':
1135           ca se 'T':   1176           ca se 'T':
1136                $onl_arr  = db_arr( "SELECT  c ount(DISTI NCTROW IDF rom) AS co unt_onl FR OM IMessag es  WHERE  `When` > S UBDATE(NOW (), INTERV AL $min MI NUTE)");   1177                $onl_arr  = db_arr( "SELECT  c ount(DISTI NCTROW IDF rom) AS co unt_onl FR OM IMessag es  WHERE  `When` > S UBDATE(NOW (), INTERV AL $min MI NUTE)");
1137                break;   1178                break;
1138           //  Members w ith non st andart mem bership   1179           //  Members w ith non st andart mem bership
1139           ca se 'g':   1180           ca se 'g':
1140           ca se 'G':   1181           ca se 'G':
1141                $onl_arr  = db_arr(  "SELECT   COUNT(DIST INCT IDMem ber) AS co unt_onl   1182                $onl_arr  = db_arr(  "SELECT   COUNT(DIST INCT IDMem ber) AS co unt_onl
1142                                      FROM     ProfileMem Levels   1183                                      FROM     ProfileMem Levels
1143                                      INNER JO IN Profile s ON Profi les.ID = P rofileMemL evels.IDMe mber   1184                                      INNER JO IN Profile s ON Profi les.ID = P rofileMemL evels.IDMe mber
1144                                      WHERE   1185                                      WHERE
1145                                          (Dat eExpires I S NULL OR  DateExpire s > NOW())  AND   1186                                          (Dat eExpires I S NULL OR  DateExpire s > NOW())  AND
1146                                          (Dat eStarts IS  NULL OR D ateStarts  <= NOW())  AND   1187                                          (Dat eStarts IS  NULL OR D ateStarts  <= NOW())  AND
1147                                          (Pro files.Stat us = 'Acti ve') AND   1188                                          (Pro files.Stat us = 'Acti ve') AND
1148                                           (
LastNav Time   >   SUBDATE(NO W(),   INTERVAL   $min   MINUTE))"   );
  1189                                           ( Date LastNav  
>   SUBDATE(NO W(),   INTERVAL   $min   MINUTE))"   );
1149                break;   1190                break;
1150           //  from coun try   1191           //  from coun try
1151           ca se 'c':   1192           ca se 'c':
1152           ca se 'C':   1193           ca se 'C':
1153                $country  = process _db_input( $country);   1194                $country  = process _db_input( $country);
1154                 $onl_arr   =   db_arr("SE LECT   count(ID)   as   count_onl   FROM   Profiles   WHERE   Status='Ac tive'   AND   `Country`   =   '$country'   AND  
LastNav Time   >   SUBDATE(NO W(),   INTERVAL   $min   MINUTE)");
  1195                 $onl_arr   =   db_arr("SE LECT   count(ID)   as   count_onl   FROM   Profiles   WHERE   Status='Ac tive'   AND   `Country`   =   '$country'   AND   Date LastNav  
>   SUBDATE(NO W(),   INTERVAL   $min   MINUTE)");
1155                break;   1196                break;
1156           //  men   1197           //  men
1157           ca se 'm':   1198           ca se 'm':
1158           ca se 'M':   1199           ca se 'M':
1159                 $onl_arr   =   db_arr("SE LECT   count(ID)   as   count_onl   FROM   Profiles   WHERE   Status='Ac tive'   AND   Sex='male'   AND  
LastNav Tim e   >   SUBDATE(NO W(),   INTERVAL   $min   MINUTE)");
  1200                 $onl_arr   =   db_arr("SE LECT   count(ID)   as   count_onl   FROM   Profiles   WHERE   Status='Ac tive'   AND   Sex='male'   AND   Date LastNav
e   >   SUBDATE(NO W(),   INTERVAL   $min   MINUTE)");
1160                break;   1201                break;
1161           //  momen   1202           //  momen
1162           ca se 'w':   1203           ca se 'w':
1163           ca se 'W':   1204           ca se 'W':
1164                 $onl_arr   =   db_arr("SE LECT   count(ID)   as   count_onl   FROM   Profiles   WHERE   Status='Ac tive'   AND   Sex='femal e'   AND  
LastNav Tim e   >   SUBDATE(NO W(),   INTERVAL   $min   MINUTE)");
  1205                 $onl_arr   =   db_arr("SE LECT   count(ID)   as   count_onl   FROM   Profiles   WHERE   Status='Ac tive'   AND   Sex='femal e'   AND   Date LastNav
e   >   SUBDATE(NO W(),   INTERVAL   $min   MINUTE)");
1165                break;   1206                break;
1166           //  all   1207           //  all
1167           de fault:   1208           de fault:
1168                 $onl_arr   =   db_arr("SE LECT   count(ID)   as   count_onl   FROM   Profiles   WHERE   Status='Ac tive'   AND  
LastNav Tim e   >   SUBDATE(NO W(),   INTERVAL   $min   MINUTE)");
  1209                 $onl_arr   =   db_arr("SE LECT   count(ID)   as   count_onl   FROM   Profiles   WHERE   Status='Ac tive'   AND   Date LastNav
e   >   SUBDATE(NO W(),   INTERVAL   $min   MINUTE)");
1169                break;   1210                break;
1170       }   1211       }
1171       return  (int)$onl _arr['coun t_onl'];   1212       return  (int)$onl _arr['coun t_onl'];
1172   }   1213   }
1173     1214  
1174   function g et_users_o nline_res  ( $lim = 0  )   1215   function g et_users_o nline_res  ( $lim = 0  )
1175   {   1216   {
1176       if ( ! $lim )   1217       if ( ! $lim )
1177           $l im = getPa ram( "defa ult_online _users_num " );   1218           $l im = getPa ram( "defa ult_online _users_num " );
1178       $min =  getParam(  "member_o nline_time " );   1219       $min =  getParam(  "member_o nline_time " );
1179     1220  
1180        return   db_res("SE LECT   ID,   NickName   FROM   Profiles   WHERE   Status='Ac tive'   AND  
LastNav Tim e   >   SUBDATE(NO W(),   INTERVAL   $min   MINUTE)   ORDER   BY  
LastNav Tim e   DESC   LIMIT   $lim");
  1221        return   db_res("SE LECT   ID,   NickName   FROM   Profiles   WHERE   Status='Ac tive'   AND   Date LastNav
e   >   SUBDATE(NO W(),   INTERVAL   $min   MINUTE)   ORDER   BY   Date LastNav
e   DESC   LIMIT   $lim");
1181   }   1222   }
1182     1223  
1183   function A ddNotifyEm ail ( $ema il,  $Name  = "", $Em ailFlag =  "NotifyMe" , $EmailTe xt = "HTML " )   1224   function A ddNotifyEm ail ( $ema il,  $Name  = "", $Em ailFlag =  "NotifyMe" , $EmailTe xt = "HTML " )
1184   {   1225   {
1185       $email  = process _db_input( trim($emai l));   1226       $email  = process _db_input( trim($emai l));
1186       $Name  = process_ db_input($ Name);   1227       $Name  = process_ db_input($ Name);
1187     1228  
1188       if ( ! strlen($em ail) || !s trstr($ema il,"@") ||  !strstr($ email,".")  )   1229       if ( ! strlen($em ail) || !s trstr($ema il,"@") ||  !strstr($ email,".")  )
1189           re turn 0;   1230           re turn 0;
1190     1231  
1191       $arr =  db_arr("S ELECT ID F ROM Profil es WHERE E mail LIKE  '$email' L IMIT 1");   1232       $arr =  db_arr("S ELECT ID F ROM Profil es WHERE E mail LIKE  '$email' L IMIT 1");
1192       if ( $ arr['ID']  )   1233       if ( $ arr['ID']  )
1193           re turn 0;   1234           re turn 0;
1194     1235  
1195       $arr =  db_arr("S ELECT ID F ROM Notify Emails WHE RE Email L IKE '$emai l' LIMIT 1 ");   1236       $arr =  db_arr("S ELECT ID F ROM Notify Emails WHE RE Email L IKE '$emai l' LIMIT 1 ");
1196       if ( $ arr['ID']  )   1237       if ( $ arr['ID']  )
1197           re turn 0;   1238           re turn 0;
1198     1239  
1199       return  db_res("I NSERT INTO  NotifyEma ils SET Em ail = '$em ail', Name  = '$Name' , EmailFla g = '$Emai lFlag', Em ailText =  '$EmailTex t'");   1240       return  db_res("I NSERT INTO  NotifyEma ils SET Em ail = '$em ail', Name  = '$Name' , EmailFla g = '$Emai lFlag', Em ailText =  '$EmailTex t'");
1200   }   1241   }
1201     1242  
1202   function R eplace_Var s( $path,  $target, $ value )   1243   function R eplace_Var s( $path,  $target, $ value )
1203   {   1244   {
1204     1245  
1205       $conte nt = array ();   1246       $conte nt = array ();
1206     1247  
1207       $f = f open ( $pa th, "r" );   1248       $f = f open ( $pa th, "r" );
1208     1249  
1209       while  (!feof ($f )) { $temp l .= fgets ($f, 4096) ; }   1250       while  (!feof ($f )) { $temp l .= fgets ($f, 4096) ; }
1210     1251  
1211       fclose  ( $f );   1252       fclose  ( $f );
1212     1253  
1213       $conte nt = explo de("\n", $ templ);   1254       $conte nt = explo de("\n", $ templ);
1214     1255  
1215   //------ R EPLACEMENT  ========= ========== ========== ========== =========   1256   //------ R EPLACEMENT  ========= ========== ========== ========== =========
1216       for ($ i = 0; $i  < count($c ontent); $ i++ )   1257       for ($ i = 0; $i  < count($c ontent); $ i++ )
1217       {   1258       {
1218           $t  = $conten t[$i];   1259           $t  = $conten t[$i];
1219           if  ( preg_ma tch("/^\\" .$target." \s/", $t)  )   1260           if  ( preg_ma tch("/^\\" .$target." \s/", $t)  )
1220           {   1261           {
1221                $content [$i] = $ta rget . $va lue;   1262                $content [$i] = $ta rget . $va lue;
1222           }   1263           }
1223       }   1264       }
1224     1265  
1225   //------ R ECORD ==== ========== ========== ========== ========== =========   1266   //------ R ECORD ==== ========== ========== ========== ========== =========
1226       $f = f open ( $pa th, "w" );   1267       $f = f open ( $pa th, "w" );
1227       for ($ i = 0; $i  < count($c ontent)-1;  $i++ )   1268       for ($ i = 0; $i  < count($c ontent)-1;  $i++ )
1228       {   1269       {
1229           fw rite($f,"$ content[$i ]"."\n");   1270           fw rite($f,"$ content[$i ]"."\n");
1230       }   1271       }
1231     1272  
1232       fwrite ($f,"$cont ent[$i]");   1273       fwrite ($f,"$cont ent[$i]");
1233     1274  
1234       fclose  ( $f );   1275       fclose  ( $f );
1235     1276  
1236       return  true;   1277       return  true;
1237   }   1278   }
1238     1279  
1239   ?>   1280   ?>