45. File Comparison Report

Produced on Wed Jun 18 08:01:47 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.

45.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.1.1\inc admin.inc.php Sun May 11 13:17:00 2008 UTC
2 Dolphin-v.6.1.2\inc admin.inc.php Thu Jun 12 09:57:41 2008 UTC

45.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 3 2510
Changed 2 10
Inserted 0 0
Removed 0 0

45.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

45.4 Active regular expressions

No regular expressions were active.

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