27. File Comparison Report

Produced on Thu Jul 17 07:17:19 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.

27.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.1.2\inc admin.inc.php Thu Jun 12 09:57:40 2008 UTC
2 Dolphin-v.6.1.3\inc admin.inc.php Wed Jul 16 09:51:20 2008 UTC

27.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 16 2468
Changed 11 32
Inserted 0 0
Removed 4 6

27.3 Comparison options

Whitespace All differences in whitespace within lines are ignored
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

27.4 Active regular expressions

No regular expressions were active.

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