42. File Comparison Report

Produced on Mon May 12 13:04:32 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.

42.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.0.5\admin global_settings.php Thu Mar 6 09:13:34 2008 UTC
2 Dolphin-v.6.1.0\admin global_settings.php Sat Apr 26 08:19:16 2008 UTC

42.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 22 1652
Changed 1 2
Inserted 0 0
Removed 20 368

42.3 Comparison options

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

42.4 Active regular expressions

No regular expressions were active.

42.5 Comparison detail

1   <?php   1   <?php
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   /*   21   /*
22    * Page fo r displayi ng and edi ting Globa l Settings  in admin  panel.   22    * Page fo r displayi ng and edi ting Globa l Settings  in admin  panel.
23    */   23    */
24   require_on ce( '../in c/header.i nc.php' );   24   require_on ce( '../in c/header.i nc.php' );
25   require_on ce( BX_DIR ECTORY_PAT H_INC . 'd esign.inc. php' );   25   require_on ce( BX_DIR ECTORY_PAT H_INC . 'd esign.inc. php' );
26   require_on ce( BX_DIR ECTORY_PAT H_INC . 'p rofiles.in c.php' );   26   require_on ce( BX_DIR ECTORY_PAT H_INC . 'p rofiles.in c.php' );
27   require_on ce( BX_DIR ECTORY_PAT H_INC . 'p rof.inc.ph p' );   27   require_on ce( BX_DIR ECTORY_PAT H_INC . 'p rof.inc.ph p' );
28   require_on ce( BX_DIR ECTORY_PAT H_INC . 'a dmin_desig n.inc.php'  );   28   require_on ce( BX_DIR ECTORY_PAT H_INC . 'a dmin_desig n.inc.php'  );
29   require_on ce( BX_DIR ECTORY_PAT H_INC . 'u tils.inc.p hp' );   29   require_on ce( BX_DIR ECTORY_PAT H_INC . 'u tils.inc.p hp' );
30   require_on ce( BX_DIR ECTORY_PAT H_INC . 'i mages.inc. php' );   30   require_on ce( BX_DIR ECTORY_PAT H_INC . 'i mages.inc. php' );
31     31  
32   // Check i f administ rator is l ogged in.   If not di splay logi n form.   32   // Check i f administ rator is l ogged in.   If not di splay logi n form.
33   $logged['a dmin'] = m ember_auth (1);   33   $logged['a dmin'] = m ember_auth (1);
34     34  
35   $_page['cs s_name'] =  'global_s ettings.cs s';   35   $_page['cs s_name'] =  'global_s ettings.cs s';
36     36  
37   // Get cat egory.   37   // Get cat egory.
38     38  
39   if( $_GET[ 'cat'] )   39   if( $_GET[ 'cat'] )
40   {   40   {
41       $cat =  $_GET['ca t'];   41       $cat =  $_GET['ca t'];
42       if ( i s_numeric( $cat) && ( int)$cat < = 0 )   42       if ( i s_numeric( $cat) && ( int)$cat < = 0 )
43       {   43       {
44           $c at = '';   44           $c at = '';
45       }   45       }
46   }   46   }
47   else   47   else
48   {   48   {
49       $cat =  '';   49       $cat =  '';
50   }   50   }
51     51  
52   if ($cat== '1' || $ca t == '16')   52   if ($cat== '1' || $ca t == '16')
53   {   53   {
54       $_page ['header']  = 'Advanc ed Setting s';   54       $_page ['header']  = 'Advanc ed Setting s';
55   }   55   }
56   else    56   else 
57   {   57   {
58       $_page ['header']  = 'Settin gs';   58       $_page ['header']  = 'Settin gs';
59   }   59   }
60     60  
61   // Constan ts.   61   // Constan ts.
62   define('EM AIL_TEMPLA TE_CATEGOR Y', 4);   62   define('EM AIL_TEMPLA TE_CATEGOR Y', 4);
63   define('WA TERMARK_CA TEGORY', 1 6);   63   define('WA TERMARK_CA TEGORY', 1 6);
64     64  
65   define('E_ INVALID_OL D_PASSWORD ', 1);   65   define('E_ INVALID_OL D_PASSWORD ', 1);
66   define('E_ PASSWORD_C ONFIRMATIO N_FAILED',  2);   66   define('E_ PASSWORD_C ONFIRMATIO N_FAILED',  2);
67   define('E_ INVALID_PA SSWORD_LEN GTH', 3);   67   define('E_ INVALID_PA SSWORD_LEN GTH', 3);
68   define('S_ OK', 0);   68   define('S_ OK', 0);
69   define('E_ INVALID_PA RAMETER',  1);   69   define('E_ INVALID_PA RAMETER',  1);
70     70  
71   TopCodeAdm in();   71   TopCodeAdm in();
72     72  
73   // DISPLAY  GLOBAL SE TTINGS MEN U    
74   /*ContentB lockHead(" Global Set tings Menu ");    
75   display_me nu($cat);    
76   ContentBlo ckFoot();* /    
77      
78   ob_start() ;   73   ob_start() ;
79     74  
80   // SAVE CH ANGES   75   // SAVE CH ANGES
81   $save_sett ings = ('y es' == $_P OST['save_ settings'] );   76   $save_sett ings = ('y es' == $_P OST['save_ settings'] );
82   if (strlen ($cat) > 0 )   77   if (strlen ($cat) > 0 )
83   {   78   {
84       // Adm in passwor d was chan ged.  Try  to save it .   79       // Adm in passwor d was chan ged.  Try  to save it .
85       if (FA LSE != $sa ve_setting s && 'ap'  == $cat)   80       if (FA LSE != $sa ve_setting s && 'ap'  == $cat)
86       {   81       {
87           if  ( $demo_m ode )   82           if  ( $demo_m ode )
88           {   83           {
89                echo '<s pan class= "succ">Pas sword can\ 't be chan ged.</span ><br />';   84                echo '<s pan class= "succ">Pas sword can\ 't be chan ged.</span ><br />';
90           }   85           }
91           el se   86           el se
92           {   87           {
93                $result  = save_adm in_passwor d($_COOKIE ['adminID' ], $_POST[ 'pwd_old'] , $_POST[' pwd_new'],  $_POST['p wd_new_con firm']);   88                $result  = save_adm in_passwor d($_COOKIE ['adminID' ], $_POST[ 'pwd_old'] , $_POST[' pwd_new'],  $_POST['p wd_new_con firm']);
94                switch ( $result)   89                switch ( $result)
95                {   90                {
96                    case  S_OK:   91                    case  S_OK:
97                    {   92                    {
98                         // No erro r.  Displa y message.   93                         // No erro r.  Displa y message.
99                         echo '<spa n class="s ucc">Passw ord change d.</span>< br />';   94                         echo '<spa n class="s ucc">Passw ord change d.</span>< br />';
100                    }   95                    }
101                    brea k;   96                    brea k;
102                    case  E_INVALID _OLD_PASSW ORD:   97                    case  E_INVALID _OLD_PASSW ORD:
103                    {   98                    {
104                         echo '<div  class="er r">Error s aving new  password:  wrong old  password!< /div><br>' ;   99                         echo '<div  class="er r">Error s aving new  password:  wrong old  password!< /div><br>' ;
105                    }   100                    }
106                    brea k;   101                    brea k;
107                    case  E_INVALID _PASSWORD_ LENGTH:   102                    case  E_INVALID _PASSWORD_ LENGTH:
108                    {   103                    {
109                         echo '<div  class="er r">Error s aving new  password:  invalid pa ssword len gth (betwe en 3 and 1 1 characte rs).</div> <br>';   104                         echo '<div  class="er r">Error s aving new  password:  invalid pa ssword len gth (betwe en 3 and 1 1 characte rs).</div> <br>';
110                    }   105                    }
111                    brea k;   106                    brea k;
112                    case  E_PASSWOR D_CONFIRMA TION_FAILE D:   107                    case  E_PASSWOR D_CONFIRMA TION_FAILE D:
113                    {   108                    {
114                         echo '<div  class="er r">Error s aving new  passowrd:  password n ot confirm ed.</div>< br>';   109                         echo '<div  class="er r">Error s aving new  passowrd:  password n ot confirm ed.</div>< br>';
115                    }   110                    }
116                }   111                }
117           }   112           }
118       }   113       }
119       // Lan guage sett ings chang ed.  Try t o save the m.    
120       else i f (FALSE ! = $save_se ttings &&  'ls' == $c at)    
121       {    
122           sa ve_languag e_settings ();    
123       }    
124       else i f (FALSE ! = $save_se ttings &&  'ip' == $c at)    
125       {    
126           sa ve_index_p age_settin gs();    
127       }    
128       else i f (FALSE ! = $save_se ttings &&  WATERMARK_ CATEGORY = = $cat)   114       else i f (FALSE ! = $save_se ttings &&  WATERMARK_ CATEGORY = = $cat)
129       {   115       {
130           sa ve_water_m ark();   116           sa ve_water_m ark();
131       }   117       }
132       else i f (FALSE ! = $save_se ttings &&  'all' == $ cat)   118       else i f (FALSE ! = $save_se ttings &&  'all' == $ cat)
133       {   119       {
134           sa ve_setting s_all();   120           sa ve_setting s_all();
135           //  Check $er rors array .  If it's  not empty  display e rror messa ges,   121           //  Check $er rors array .  If it's  not empty  display e rror messa ges,
136           //  otherwise  display s uccess mes sage.   122           //  otherwise  display s uccess mes sage.
137           if  (count($e rrors) > 0 )   123           if  (count($e rrors) > 0 )
138           {   124           {
139                echo get _error_mes sages();   125                echo get _error_mes sages();
140           }   126           }
141           el se   127           el se
142           {   128           {
143                echo '<d iv class=" succ">Sett ings saved .</div><br  />';   129                echo '<d iv class=" succ">Sett ings saved .</div><br  />';
144           }   130           }
145       }   131       }
146       else i f (FALSE ! = $save_se ttings)   132       else i f (FALSE ! = $save_se ttings)
147       {   133       {
148           sw itch ($cat )   134           sw itch ($cat )
149           {   135           {
150                case '1'  :    136                case '1'  : 
151                case '16 ': $aCat =  array('16 ','1','23' ,'3','12', '15'); bre ak;   137                case '16 ': $aCat =  array('16 ','1','23' ,'3','12', '15'); bre ak;
152                case '4'  : $aCat =  array('8' ,'17','4') ; break;   138                case '4'  : $aCat =  array('8' ,'17','4') ; break;
153                default   : $aCat =  array($ca t);   139                default   : $aCat =  array($ca t);
154           }   140           }
155           fo reach ($aC at as $i = > $sKey)   141           fo reach ($aC at as $i = > $sKey)
156           {   142           {
157                if ( WAT ERMARK_CAT EGORY == $ sKey )   143                if ( WAT ERMARK_CAT EGORY == $ sKey )
158                {   144                {
159                    save _water_mar k();   145                    save _water_mar k();
160                }   146                }
161                else   147                else
162                {   148                {
163                    save _settings( $sKey);   149                    save _settings( $sKey);
164                }      150                }   
165           }   151           }
166           //  Check $er rors array .  If it's  not empty  display e rror messa ges,   152           //  Check $er rors array .  If it's  not empty  display e rror messa ges,
167           //  Otherwise  display s uccess mes sage.   153           //  Otherwise  display s uccess mes sage.
168           if  (count($e rrors) > 0 )   154           if  (count($e rrors) > 0 )
169           {   155           {
170                echo get _error_mes sages();   156                echo get _error_mes sages();
171           }   157           }
172           el se   158           el se
173           {   159           {
174                echo '<d iv class=" succ">Sett ings saved .</div><br  />';   160                echo '<d iv class=" succ">Sett ings saved .</div><br  />';
175           }   161           }
176       }   162       }
177   }   163   }
178     164  
179   // Display  forms and  controls  for editin g settings .   165   // Display  forms and  controls  for editin g settings .
180   if ( strle n($cat) >  0)   166   if ( strle n($cat) >  0)
181   {   167   {
182       if ( ' ap' == $ca t )   168       if ( ' ap' == $ca t )
183           $p ageHeader  = display_ admin_pass word();   169           $p ageHeader  = display_ admin_pass word();
184       elseif  ('ls' ==  $cat)    
185           $p ageHeader  = display_ language_s ettings();    
186       elseif  ('ip' ==  $cat)    
187           $p ageHeader  = display_ index_page _settings( );    
188       elseif  ('all' ==  $cat)   170       elseif  ('all' ==  $cat)
189       {   171       {
190           $p ageHeader  = 'All set tings';   172           $p ageHeader  = 'All set tings';
191              173           
192           di splay_admi n_password ();   174           di splay_admi n_password ();
193           di splay_lang uage_setti ngs();    
194           di splay_inde x_page_set tings();    
195           di splay_wate rmark_sett ings();   175           di splay_wate rmark_sett ings();
196           ?>   176           ?>
197           <f orm method ="post" ac tion="<? e cho $_SERV ER['PHP_SE LF']."?cat =all"; ?>" >   177           <f orm method ="post" ac tion="<? e cho $_SERV ER['PHP_SE LF']."?cat =all"; ?>" >
198           <i nput type= "hidden" n ame="save_ settings"  value="yes ">   178           <i nput type= "hidden" n ame="save_ settings"  value="yes ">
199           <? php   179           <? php
200           //  Get a lis t of categ ories.   180           //  Get a lis t of categ ories.
201           $q _str = 'SE LECT `ID`  FROM `GlPa ramsKateg`  WHERE `ID ` <> '. WA TERMARK_CA TEGORY;   181           $q _str = 'SE LECT `ID`  FROM `GlPa ramsKateg`  WHERE `ID ` <> '. WA TERMARK_CA TEGORY;
202           $r es = db_re s($q_str);   182           $r es = db_re s($q_str);
203           //  Iterate t hru catego ries.   183           //  Iterate t hru catego ries.
204           wh ile ($row  = mysql_fe tch_array( $res))   184           wh ile ($row  = mysql_fe tch_array( $res))
205           {   185           {
206                display_ category_s ettings($r ow['ID']);   186                display_ category_s ettings($r ow['ID']);
207           }   187           }
208           ?>   188           ?>
209           <c enter><inp ut type="s ubmit" val ue="Save C hanges" cl ass="text" ></center>   189           <c enter><inp ut type="s ubmit" val ue="Save C hanges" cl ass="text" ></center>
210           </ form>   190           </ form>
211           <? php   191           <? php
212       }   192       }
213       else   193       else
214       {?>   194       {?>
215           <f orm method ="post" ac tion="<? e cho $_SERV ER[PHP_SEL F]."?cat=$ cat"; ?>">   195           <f orm method ="post" ac tion="<? e cho $_SERV ER[PHP_SEL F]."?cat=$ cat"; ?>">
216           <i nput type= "hidden" n ame="save_ settings"  value="yes ">   196           <i nput type= "hidden" n ame="save_ settings"  value="yes ">
217           <? php   197           <? php
218                switch($ cat)   198                switch($ cat)
219                {   199                {
220                    case  '1':   200                    case  '1':
221                    case  '16': $aC at = array ('1','23', '16','3',' 12','15');  break;   201                    case  '16': $aC at = array ('1','23', '16','3',' 12','15');  break;
222                    case  '4' : $aC at = array ('8','17', '4'); brea k;   202                    case  '4' : $aC at = array ('8','17', '4'); brea k;
223                    defa ult  : $aC at = array ($cat);   203                    defa ult  : $aC at = array ($cat);
224                }   204                }
225                foreach  ($aCat as  $i => $sKe y)   205                foreach  ($aCat as  $i => $sKe y)
226                {   206                {
227                    if ( WATERMARK_ CATEGORY = = $sKey)   207                    if ( WATERMARK_ CATEGORY = = $sKey)
228                    {   208                    {
229                         continue;   209                         continue;
230                    }   210                    }
231                    else   211                    else
232                    {   212                    {
233                         $pageHeade r .= displ ay_categor y_settings ($sKey);   213                         $pageHeade r .= displ ay_categor y_settings ($sKey);
234                    }   214                    }
235                }   215                }
236     216  
237           ?>   217           ?>
238           <c enter><inp ut type="s ubmit" val ue="Save C hanges" cl ass="text" ></center>   218           <c enter><inp ut type="s ubmit" val ue="Save C hanges" cl ass="text" ></center>
239           </ form>   219           </ form>
240           <?   220           <?
241           if  ('1' == $ cat || '16 ' == $cat)   221           if  ('1' == $ cat || '16 ' == $cat)
242           {   222           {
243                $pageHea der .= dis play_water mark_setti ngs();   223                $pageHea der .= dis play_water mark_setti ngs();
244           }   224           }
245       }   225       }
246   }   226   }
247     227  
248   $mainConte nt = ob_ge t_clean();   228   $mainConte nt = ob_ge t_clean();
249     229  
250   ContentBlo ckHead( $p ageHeader  );   230   ContentBlo ckHead( $p ageHeader  );
251       echo $ mainConten t;   231       echo $ mainConten t;
252   ContentBlo ckFoot();   232   ContentBlo ckFoot();
253     233  
254     234  
255   BottomCode ();   235   BottomCode ();
256   // END OF  DOCUMENT   236   // END OF  DOCUMENT
257     237  
258   // UTILITY  FUNCTIONS  SECTION    
259      
260   /**    
261    * Display  admin glo bal settin gs menu.    
262    * @param  $cat -- Cu rrently di splayed ca tegory.    
263    */    
264   function d isplay_men u($cat)    
265   {    
266       // Get  a list of  global se tting cate gories and  generate  a menu lis t.    
267       $q_str  = 'SELECT  `ID`, `na me` FROM ` GlParamsKa teg` ORDER  BY `menu_ order` ASC ;';    
268       $res =  mysql_que ry($q_str) ;    
269       $menu  = '<div cl ass="gs_me nu_outer"> ';    
270       $menu  .= '<div c lass="gs_m enu_inner" >';    
271       $menu  .= '<div c lass="gs_m enu"><ul>' ;    
272       // Add  two menu  items manu ally becau se they do n't exist  in databas e.    
273       // The y are 'Cha nge admin  password',  'Change l anguage se ttings', a nd 'Index  Page'.    
274       $custo m = array  (    
275           'a p' => 'Cha nge admin  password',    
276           'l s' => 'Cha nge langua ge setting s',    
277           'i p' => 'Ind ex Page');    
278       foreac h ($custom  as $key = > $value)    
279       {    
280           if  ($cat !=  $key)    
281           {    
282                $href =  "{$_SERVER ['PHP_SELF ']}?cat=$k ey";    
283                $menu .=  "<li><a h ref=\"$hre f\">$value </a></li>\ n";    
284           }    
285           el se    
286           {    
287                $menu .=  "<li>$val ue</li>";    
288           }    
289       }    
290       // Get  number of  items.    
291       $num_i tems = mys ql_num_row s($res) +  5;    
292      
293       $num_c ols = 3;    
294       $items _per_col =  floor($nu m_items /  $num_cols) ;    
295       $i = 3 ;    
296       // Ite rate thru  result rec ordset and  add items  to the me nu.    
297       while  ($row = my sql_fetch_ assoc($res ))    
298       {    
299           if  ($i == $i tems_per_c ol)    
300           {    
301                $i = 0;    
302                $menu .=  '</ul></d iv>'; // F inish item  group.    
303                $menu .=  '<div cla ss="gs_men u"><ul>';  // Start n ew item gr oup.    
304           }    
305           if  ($cat !=  $row['ID'] )    
306           {    
307                $href =  "$_SERVER[ PHP_SELF]? cat=$row[I D]";    
308                $menu .=  "<li><a h ref=\"$hre f\">$row[n ame]</a></ li>\n";    
309           }    
310           el se    
311           {    
312                $menu .=  "<li>$row [name]</li >";    
313           }    
314           $i ++;    
315       }    
316       // Add  "View all " item.    
317       if ('a ll' == $ca t)    
318       {    
319           $m enu .= '<l i>View all </li>';    
320       }    
321       else    
322       {    
323           $m enu .= "<l i><a href= \"$_SERVER [PHP_SELF] ?cat=all\"  style=\"c olor:orang e\">View a ll</a></li >";    
324       }    
325       $menu  .= '</ul>< /div></div ></div>';    
326     238  
327       echo $ menu;    
328     239  
329   }   240   // UTILITY  FUNCTIONS  SECTION
330     241  
331   /**   242   /**
332    * Display  form and  conrols fo r editing  admin pass word.   243    * Display  form and  conrols fo r editing  admin pass word.
333    */   244    */
334   function d isplay_adm in_passwor d()   245   function d isplay_adm in_passwor d()
335   {   246   {
336       ?>   247       ?>
337       <cente r>   248       <cente r>
338       <form  method="po st" action ="<? echo  $_SERVER[P HP_SELF].' ?cat=ap';  ?>">   249       <form  method="po st" action ="<? echo  $_SERVER[P HP_SELF].' ?cat=ap';  ?>">
339       <input  type="hid den" name= "save_sett ings" valu e="yes">   250       <input  type="hid den" name= "save_sett ings" valu e="yes">
340       <table  width="10 0%" cellsp acing="2"  cellpaddin g="3" clas s="text">   251       <table  width="10 0%" cellsp acing="2"  cellpaddin g="3" clas s="text">
341           <! --<tr clas s="panel">   252           <! --<tr clas s="panel">
342                <td cols pan="2"><b >Change ad ministrato r password </b></td>   253                <td cols pan="2"><b >Change ad ministrato r password </b></td>
343           </ tr>-->   254           </ tr>-->
344           <t r>   255           <t r>
345                <td alig n="right"  width="50% "> Old Pas sword: </t d>   256                <td alig n="right"  width="50% "> Old Pas sword: </t d>
346                <td alig n="left" w idth="50%" ><input ty pe="passwo rd" size=" 14" name=" pwd_old">< /td>   257                <td alig n="left" w idth="50%" ><input ty pe="passwo rd" size=" 14" name=" pwd_old">< /td>
347           </ tr>   258           </ tr>
348           <t r>   259           <t r>
349                <td alig n="right"  width="50% "> New Pas sword: </t d>   260                <td alig n="right"  width="50% "> New Pas sword: </t d>
350                <td alig n="left">< input type ="password " size="14 " name="pw d_new"></t d>   261                <td alig n="left">< input type ="password " size="14 " name="pw d_new"></t d>
351           </ tr>   262           </ tr>
352           <t r>   263           <t r>
353                <td alig n="right"  width="50% "> Confirm  New Passw ord: </td>   264                <td alig n="right"  width="50% "> Confirm  New Passw ord: </td>
354                <td alig n="left">< input type ="password " size="14 " name="pw d_new_conf irm"></td>   265                <td alig n="left">< input type ="password " size="14 " name="pw d_new_conf irm"></td>
355           </ tr>   266           </ tr>
356       </tabl e>   267       </tabl e>
357       <br />   268       <br />
358       <input  class=no  type="subm it" value= "Save Pass word" clas s=text>   269       <input  class=no  type="subm it" value= "Save Pass word" clas s=text>
359       </form >   270       </form >
360       </cent er>   271       </cent er>
361       <?php   272       <?php
362          273       
363       return  'Password s';   274       return  'Password s';
364   }   275   }
365     276  
366   function d isplay_wat ermark_set tings()   277   function d isplay_wat ermark_set tings()
367   {   278   {
368       global  $site;   279       global  $site;
369       global  $dir;   280       global  $dir;
370     281  
371       ?>   282       ?>
372       <br/>   283       <br/>
373       <cente r>   284       <cente r>
374       <form  method="po st" enctyp e="multipa rt/form-da ta" action ="<? echo  $_SERVER[' PHP_SELF'] .'?cat=16' ; ?>">   285       <form  method="po st" enctyp e="multipa rt/form-da ta" action ="<? echo  $_SERVER[' PHP_SELF'] .'?cat=16' ; ?>">
375   <table wid th="100%"  cellspacin g="0" cell padding="3 " class="t ext" style ="border-c ollapse: c ollapse; b order: 1px  solid sil ver" borde r="0">         286   <table wid th="100%"  cellspacin g="0" cell padding="3 " class="t ext" style ="border-c ollapse: c ollapse; b order: 1px  solid sil ver" borde r="0">      
376   <tr><td></ td></tr>         <!-- <tr class= "panel">   287   <tr><td></ td></tr>         <!-- <tr class= "panel">
377                <td cols pan="2"><b >Change Wa termark</b ></td>   288                <td cols pan="2"><b >Change Wa termark</b ></td>
378           </ tr>-->   289           </ tr>-->
379   <?   290   <?
380       if ( s trlen(trim (getParam( "Water_Mar k"))) && f ile_exists ( $dir['pr ofileImage '] . getPa ram("Water _Mark") )  )   291       if ( s trlen(trim (getParam( "Water_Mar k"))) && f ile_exists ( $dir['pr ofileImage '] . getPa ram("Water _Mark") )  )
381       {   292       {
382   ?>   293   ?>
383           <t r>   294           <t r>
384                <td cols pan="2" al ign="cente r" valign= "middle">   295                <td cols pan="2" al ign="cente r" valign= "middle">
385                    <img  src="<?=  $site['pro fileImage' ] . getPar am("Water_ Mark") ?>"  border="0 ">   296                    <img  src="<?=  $site['pro fileImage' ] . getPar am("Water_ Mark") ?>"  border="0 ">
386                </td>   297                </td>
387           </ tr>   298           </ tr>
388   <?   299   <?
389       }   300       }
390   ?>   301   ?>
391           <t r>   302           <t r>
392                <td alig n="right"  width="50% "><?echo g etParamDes c("Water_M ark")?>:</ td>   303                <td alig n="right"  width="50% "><?echo g etParamDes c("Water_M ark")?>:</ td>
393                <td alig n="left" w idth="50%" ><input cl ass="no" n ame="file_ watermark"  size="10"  type="fil e"></td>   304                <td alig n="left" w idth="50%" ><input cl ass="no" n ame="file_ watermark"  size="10"  type="fil e"></td>
394           </ tr>   305           </ tr>
395           <t r>   306           <t r>
396                <td alig n="right"  width="50% "><?echo g etParamDes c("transpa rent1")?>< /td>   307                <td alig n="right"  width="50% "><?echo g etParamDes c("transpa rent1")?>< /td>
397                <td alig n="left" w idth="50%" ><input cl ass="no" n ame="trans p1" size=" 10" type=" text" valu e="<?echo  getParam(" transparen t1")?>">%< /td>   308                <td alig n="left" w idth="50%" ><input cl ass="no" n ame="trans p1" size=" 10" type=" text" valu e="<?echo  getParam(" transparen t1")?>">%< /td>
398           </ tr>   309           </ tr>
399            < tr>   310            < tr>
400                <td alig n="right"  width="50% "><?echo g etParamDes c("enable_ watermark" )?></td>   311                <td alig n="right"  width="50% "><?echo g etParamDes c("enable_ watermark" )?></td>
401                <td alig n="left" w idth="50%" ><input cl ass="no" n ame="enabl e_wm" size ="10" type ="checkbox " <?if(get Param("ena ble_waterm ark")) ech o "checked ";?>></td> </tr>   312                <td alig n="left" w idth="50%" ><input cl ass="no" n ame="enabl e_wm" size ="10" type ="checkbox " <?if(get Param("ena ble_waterm ark")) ech o "checked ";?>></td> </tr>
402       <tr><t d align="c enter" col span="2">< input type ="hidden"  name="save _settings"  value="ye s">   313       <tr><t d align="c enter" col span="2">< input type ="hidden"  name="save _settings"  value="ye s">
403       <input  name="MAX _FILE_SIZE " value="2 097152" ty pe="hidden ">   314       <input  name="MAX _FILE_SIZE " value="2 097152" ty pe="hidden ">
404       <input  class="no " value="S ave" type= "submit">   315       <input  class="no " value="S ave" type= "submit">
405       </form >   316       </form >
406       </cent er>   317       </cent er>
407       <br/>   318       <br/>
408           </ td></tr>   319           </ td></tr>
409          </t able>   320          </t able>
410         <br  />   321         <br  />
411     322  
412       <?php   323       <?php
413          324       
414       return  '';   325       return  '';
415   }   326   }
416     327  
417   /**   328   /**
418    * Display  form and  controls f or editing  language  settings.    
419    */    
420   function d isplay_lan guage_sett ings()    
421   {    
422       ?>    
423       <cente r>    
424       <form  method="po st" action ="<? echo  $_SERVER[P HP_SELF].' ?cat=ls';  ?>">    
425       <input  type="hid den" name= "save_sett ings" valu e="yes">    
426       <table  width="10 0%" cellsp acing="2"  cellpaddin g="3" clas s="text">    
427           <! --<tr clas s="panel">    
428                <td cols pan=2><b>  Change lan guage sett ings </b>< /td>    
429           </ tr>-->    
430           <t r class="t able">    
431                <td alig n="right"  width="50% "> <?php e cho getPar amDesc("la ng_default ") ?>: </t d>    
432                <td alig n="left">    
433                    <sel ect name=" lang_defau lt">    
434                         <?php    
435                         $lang_arr  = getLocal izationLan guages();    
436                         $old_val =  getParam( "lang_defa ult");    
437                         foreach ($ lang_arr a s $val)    
438                         {    
439                             if ($o ld_val ==  $val)    
440                             {    
441                                 ec ho "<optio n value=\" $val\" sel ected>$val </option>\ n";    
442                             }    
443                             else    
444                             {    
445                                 ec ho "<optio n value=\" $val\">$va l</option> ";    
446                             }    
447                         }    
448                         ?>    
449                    </se lect>    
450                </td>    
451           </ tr>    
452           <t r class="t able">    
453                <td alig n="right"  width="30% "> <?=getP aramDesc(" lang_enabl e") ?>: </ td>    
454                <td alig n="left">    
455                    <inp ut type="c heckbox" n ame="lang_ enable" <? =(getParam ("lang_ena ble")==1?" checked":" ")?>>    
456                </td>    
457           </ tr>    
458       </tabl e>    
459       <br />    
460       <input  class=no  type="subm it" value= "Save chan ges" class =text>    
461       </form >    
462       </cent er>    
463       <?php    
464           
465       return  'Language s';    
466   }    
467      
468   /**    
469    * Display  form and  controls f or editing  index pag e settings .    
470    */    
471   function d isplay_ind ex_page_se ttings()    
472   {    
473       global  $site;    
474      
475       ?>    
476       <cente r>    
477       <scrip t type="te xt/javascr ipt">    
478       <!--    
479           fu nction cha ngeFlag(fl agISO)    
480           {    
481                flagImag e = docume nt.getElem entById('f lagImageId ');    
482                flagImag e.src = '< ?= $site[' flags'] ?> ' + flagIS O.toLowerC ase() + '. gif';    
483           }    
484       -->    
485       </scri pt>    
486       <form  method="po st" action ="<? echo  $_SERVER[P HP_SELF].' ?cat=ip';  ?>">    
487       <input  type="hid den" name= "save_sett ings" valu e="yes">    
488       <table  width="10 0%" cellsp acing="2"  cellpaddin g="3" clas s="text">    
489           <! -- <tr cla ss="panel" >    
490                <td cols pan="2">&n bsp;<b>Ind ex Page</b ></td>    
491           </ tr>-->    
492           <t r class="t able">    
493                <td alig n="right"  width="40% "> <?=getP aramDesc(" default_co untry") ?> : </td>    
494                <td alig n="left">    
495                    <sel ect name=" default_co untry" onc hange="jav ascript: c hangeFlag( this.value );" >    
496                         <?php    
497                         global $pr of;    
498                         $old_val =  getParam( 'default_c ountry');    
499                         $country_a rr = $prof ['countrie s'];    
500                         foreach ($ country_ar r as $key  => $value)    
501                         {    
502                             if ($o ld_val ==  $key)    
503                             {    
504                                 ec ho "<optio n value=\" $key\" sel ected>". _ t('__'.$va lue) ."</o ption>\n";    
505                             }    
506                             else    
507                             {    
508                                 ec ho "<optio n value=\" $key\">".  _t('__'.$v alue) ."</ option>\n" ;    
509                             }    
510                         }    
511                         ?>    
512                    </se lect>    
513                    &nbs p;<img id= "flagImage Id" src="< ?= $site[' flags'].st rtolower($ old_val) ? >.gif" alt ="flag" />    
514                </td>    
515           </ tr>    
516           <t r>    
517                <td alig n="right"  width="40% "> <?=getP aramDesc(" top_member s_mode") ? >: </td>    
518                <td alig n="left">    
519                    <sel ect name=" top_member s_mode">    
520                         <?php    
521                         $old_val =  getParam( 'top_membe rs_mode');    
522                         $mode_choi ces = arra y(    
523                             'onlin e' => 'Onl ine member s',    
524                             'rand'  => 'Rando m members' ,    
525                             'last'  => 'Lates t members' ,    
526                             'top'  => 'Top me mbers');    
527                         foreach ($ mode_choic es as $key  => $value )    
528                         {    
529                             if ($o ld_val ==  $key)    
530                             {    
531                                 ec ho "<optio n value=\" $key\" sel ected>$val ue</option >\n";    
532                             }    
533                             else    
534                             {    
535                                 ec ho "<optio n value=\" $key\">$va lue</optio n>\n";    
536                             }    
537                         }    
538                         ?>    
539                    </se lect>    
540                </td>    
541           </ tr>    
542           <t r>    
543                <td alig n="right"  width="40% "> <?=getP aramDesc(" featured_m ode") ?>:  </td>    
544                <td alig n="left">    
545                    <sel ect name=" featured_m ode">    
546                         <?php    
547                         $old_val =  getParam( 'featured_ mode');    
548                         $mode_choi ces = arra y(    
549                             'verti cal' => 'V ertical',    
550                             'horiz ontal' =>  'Horizonta l');    
551                         foreach ($ mode_choic es as $key  => $value )    
552                         {    
553                             if ($o ld_val ==  $key)    
554                             {    
555                                 ec ho "<optio n value=\" $key\" sel ected>$val ue</option >\n";    
556                             }    
557                             else    
558                             {    
559                                 ec ho "<optio n value=\" $key\">$va lue</optio n>\n";    
560                             }    
561                         }    
562                         ?>    
563                    </se lect>    
564                </td>    
565           </ tr>    
566           <t r>    
567                <td alig n="right"  width="40% "> <?=getP aramDesc(" featured_n um") ?>: < /td>    
568                <td alig n="left">    
569                    <inp ut type="t ext" class ="no" name ="featured _num" size ="15" valu e="<?= htm lspecialch ars(getPar am('featur ed_num'))  ?>" />    
570                </td>    
571           </ tr>    
572       </tabl e>    
573       <br>    
574       <input  class="no " type="su bmit" valu e="Save ch anges">    
575       </form >    
576       </cent er>    
577       <?php    
578           
579       return  'Index Pa ge';    
580   }    
581      
582   /**    
583    * Display  controls  for editin g category  settings.   329    * Display  controls  for editin g category  settings.
584    * The enc losing for m must be  defined ou tside of t he functio n, this is  done to b e able   330    * The enc losing for m must be  defined ou tside of t he functio n, this is  done to b e able
585    * to disp lay contro ls for edi ting a sin gle catego ry or a gr oup of cat egories.   331    * to disp lay contro ls for edi ting a sin gle catego ry or a gr oup of cat egories.
586    * @param  $cat -- Ca tegory for  which to  display co ntrols.   332    * @param  $cat -- Ca tegory for  which to  display co ntrols.
587    * The fun ction make s use of $ errors glo bal variab le.  This  is an arra y of inval id paramet ers and   333    * The fun ction make s use of $ errors glo bal variab le.  This  is an arra y of inval id paramet ers and
588    * it is u sed to hig hligh thos e paramter s while di splaying.   334    * it is u sed to hig hligh thos e paramter s while di splaying.
589    */   335    */
590   function d isplay_cat egory_sett ings($cat)   336   function d isplay_cat egory_sett ings($cat)
591   {   337   {
592       global  $errors;   338       global  $errors;
593       global  $dir;   339       global  $dir;
594     340  
595       $cat =  (int)$cat ;   341       $cat =  (int)$cat ;
596     342  
597       // Get  category  name.   343       // Get  category  name.
598       $q_str  = "SELECT  `name` FR OM `GlPara msKateg` W HERE `ID`  = '$cat'";   344       $q_str  = "SELECT  `name` FR OM `GlPara msKateg` W HERE `ID`  = '$cat'";
599       $row =  db_arr($q _str);   345       $row =  db_arr($q _str);
600       $cat_n ame = $row ['name'];   346       $cat_n ame = $row ['name'];
601     347  
602       // Get  a list of  category  items.   348       // Get  a list of  category  items.
603       $q_str  = "   349       $q_str  = "
604                SELECT   350                SELECT
605                         `Name`,   351                         `Name`,
606                         `VALUE`,   352                         `VALUE`,
607                         `desc`,   353                         `desc`,
608                         `Type`   354                         `Type`
609                FROM   355                FROM
610                         `GlParams`   356                         `GlParams`
611                WHERE   357                WHERE
612                         `kateg` =  '$cat' AND  `Name` NO T LIKE '%_ subject' O RDER BY `o rder_in_ka teg` ASC";   358                         `kateg` =  '$cat' AND  `Name` NO T LIKE '%_ subject' O RDER BY `o rder_in_ka teg` ASC";
613       $items  = db_res( $q_str);   359       $items  = db_res( $q_str);
614       // Dis play contr ols for ed iting item s.   360       // Dis play contr ols for ed iting item s.
615       ?>   361       ?>
616       <cente r>   362       <cente r>
617       <table  width="10 0%" cellsp acing="0"  cellpaddin g="3" clas s="text" s tyle="bord er-collaps e: collaps e; border:  1px solid  silver" b order="0">   363       <table  width="10 0%" cellsp acing="0"  cellpaddin g="3" clas s="text" s tyle="bord er-collaps e: collaps e; border:  1px solid  silver" b order="0">
618              364           
619           <? php   365           <? php
620           //  Iterate t hru items.   366           //  Iterate t hru items.
621           $i  = 0;   367           $i  = 0;
622           wh ile ($row  = mysql_fe tch_array( $items))   368           wh ile ($row  = mysql_fe tch_array( $items))
623           {   369           {
624                $param_n ame = $row ['Name'];   370                $param_n ame = $row ['Name'];
625                $param_v alue = $ro w['VALUE'] ;   371                $param_v alue = $ro w['VALUE'] ;
626                $param_t ype = $row ['Type'];   372                $param_t ype = $row ['Type'];
627                $param_d esc = $row ['desc'];   373                $param_d esc = $row ['desc'];
628                if (1 ==  $errors[$ param_name ])   374                if (1 ==  $errors[$ param_name ])
629                {   375                {
630                    $cla ss = 'tabl e_err';   376                    $cla ss = 'tabl e_err';
631                }   377                }
632                else   378                else
633                {   379                {
634                    if ( 0 == $i %  2)   380                    if ( 0 == $i %  2)
635                    {   381                    {
636                         $class = ' table';   382                         $class = ' table';
637                    }   383                    }
638                    else   384                    else
639                    {   385                    {
640                         $class = ' table_odd' ;   386                         $class = ' table_odd' ;
641                    }   387                    }
642                }   388                }
643                $i++;   389                $i++;
644                echo "<t r class=\" $class\">< td align=\ "left\" cl ass=\"smal l1\"";   390                echo "<t r class=\" $class\">< td align=\ "left\" cl ass=\"smal l1\"";
645                // Displ ay item ca ption.   391                // Displ ay item ca ption.
646                if ('tex t' == $par am_type)   392                if ('tex t' == $par am_type)
647                {   393                {
648                    echo  ' valign= "top"';   394                    echo  ' valign= "top"';
649                }   395                }
650                echo ">$ param_desc </td><td a lign=\"rig ht\" width =\"200\">" ;   396                echo ">$ param_desc </td><td a lign=\"rig ht\" width =\"200\">" ;
651                // Displ ay item co ntrol.   397                // Displ ay item co ntrol.
652                if ('tex t' == $par am_type)   398                if ('tex t' == $par am_type)
653                {   399                {
654                    if ( EMAIL_TEMP LATE_CATEG ORY == $ca t)   400                    if ( EMAIL_TEMP LATE_CATEG ORY == $ca t)
655                    {   401                    {
656                         // Get ema il subject .   402                         // Get ema il subject .
657                         $subject_n ame = $par am_name.'_ subject';   403                         $subject_n ame = $par am_name.'_ subject';
658                         $q_str = " SELECT `VA LUE` FROM  `GlParams`  WHERE `Na me` = '$su bject_name '";   404                         $q_str = " SELECT `VA LUE` FROM  `GlParams`  WHERE `Na me` = '$su bject_name '";
659                         $res = db_ res($q_str );   405                         $res = db_ res($q_str );
660                         if ($row =  mysql_fet ch_array($ res))   406                         if ($row =  mysql_fet ch_array($ res))
661                         {   407                         {
662                             $subje ct_value =  $row['VAL UE'];   408                             $subje ct_value =  $row['VAL UE'];
663                         }   409                         }
664                         else   410                         else
665                         {   411                         {
666                             $subje ct_value =  '';   412                             $subje ct_value =  '';
667                         }   413                         }
668                         echo "<b>H TML versio n</b>&nbsp ;(";   414                         echo "<b>H TML versio n</b>&nbsp ;(";
669                         echo "<a h ref=\"java script:voi d(0);\" on Click=\"ja vascript:d ocOpen('".  rawurlenc ode($param _value) ." ');\">";   415                         echo "<a h ref=\"java script:voi d(0);\" on Click=\"ja vascript:d ocOpen('".  rawurlenc ode($param _value) ." ');\">";
670                         echo _t("_ Preview");   416                         echo _t("_ Preview");
671                         echo "</a> )<br>";   417                         echo "</a> )<br>";
672     418  
673                         echo 'Subj ect:<br /> ';   419                         echo 'Subj ect:<br /> ';
674                         echo "<inp ut type=\" text\" cla ss=\"no\"  size=\"50\ " name=\"{ $param_nam e}_subject \" value=\ "$subject_ value\"/>< br /><br / >";   420                         echo "<inp ut type=\" text\" cla ss=\"no\"  size=\"50\ " name=\"{ $param_nam e}_subject \" value=\ "$subject_ value\"/>< br /><br / >";
675                         echo 'Body :<br />';   421                         echo 'Body :<br />';
676                         echo "<tex tarea cols =\"50\" ro ws=\"10\"  class=\"no \" name=\" $param_nam e\">". htm lspecialch ars($param _value) ." </textarea >";   422                         echo "<tex tarea cols =\"50\" ro ws=\"10\"  class=\"no \" name=\" $param_nam e\">". htm lspecialch ars($param _value) ." </textarea >";
677     423  
678                         $tags = '< RealName>  <SiteName>  <ConfCode > <Confirm ationLink>  <StrID> < Email> <Pa ssword>     <YourReal Name> <Nic kName>   424                         $tags = '< RealName>  <SiteName>  <ConfCode > <Confirm ationLink>  <StrID> < Email> <Pa ssword>     <YourReal Name> <Nic kName>
679                             <Domai n> <ID> <T EXT> <VKis sLink> <Co ntactInfo>  <DomainNa me> <FromN ame> <Link > <NickSpa mer> <IDsp amer>   425                             <Domai n> <ID> <T EXT> <VKis sLink> <Co ntactInfo>  <DomainNa me> <FromN ame> <Link > <NickSpa mer> <IDsp amer>
680                             <LinkS pamer> <Ma tchProfile Link>    < Requester>  <Profile>  <site> <P rivPhotosM ember> <Lo ginLink> < Title>   426                             <LinkS pamer> <Ma tchProfile Link>    < Requester>  <Profile>  <site> <P rivPhotosM ember> <Lo ginLink> < Title>
681                             <Messa ge_Text> < MessageTex t> <LinkSD atingEvent > <NameSDa ting> <Pla ceSDating>  <WhenStar SDating> < PersonalUI D>   427                             <Messa ge_Text> < MessageTex t> <LinkSD atingEvent > <NameSDa ting> <Pla ceSDating>  <WhenStar SDating> < PersonalUI D>
682                             <Match Link>';   428                             <Match Link>';
683                         echo '<br> <br><br><b >Text vers ion</b><br >';   429                         echo '<br> <br><br><b >Text vers ion</b><br >';
684                         echo 'Subj ect:<br /> ';   430                         echo 'Subj ect:<br /> ';
685                         echo "<inp ut readonl y type=\"t ext\" clas s=\"no\" s ize=\"50\"  name=\"{$ param_name }_subject_ ro\" value =\"$subjec t_value\"/ ><br /><br  />";   431                         echo "<inp ut readonl y type=\"t ext\" clas s=\"no\" s ize=\"50\"  name=\"{$ param_name }_subject_ ro\" value =\"$subjec t_value\"/ ><br /><br  />";
686                         echo 'Body :<br />';   432                         echo 'Body :<br />';
687                         echo "<tex tarea read only cols= \"50\" row s=\"10\" c lass=\"no\ " name=\"{ $param_nam e}_ro\">".  htmlspeci alchars(ht ml2txt($pa ram_value,  $tags)) . "</textare a>";   433                         echo "<tex tarea read only cols= \"50\" row s=\"10\" c lass=\"no\ " name=\"{ $param_nam e}_ro\">".  htmlspeci alchars(ht ml2txt($pa ram_value,  $tags)) . "</textare a>";
688                    }   434                    }
689                    else   435                    else
690                    {   436                    {
691                         echo "<tex tarea cols =\"50\" ro ws=\"10\"  class=\"no \" name=\" $param_nam e\">$param _value</te xtarea>";   437                         echo "<tex tarea cols =\"50\" ro ws=\"10\"  class=\"no \" name=\" $param_nam e\">$param _value</te xtarea>";
692                    }   438                    }
693                }   439                }
694                elseif ( 'digit' ==  $param_ty pe)   440                elseif ( 'digit' ==  $param_ty pe)
695                {   441                {
696                    echo  "<input t ype=\"text \" class=\ "no\" name =\"$param_ name\" siz e=\"15\" v alue=\"$pa ram_value\ " />";   442                    echo  "<input t ype=\"text \" class=\ "no\" name =\"$param_ name\" siz e=\"15\" v alue=\"$pa ram_value\ " />";
697                }   443                }
698                elseif ( 'checkbox'  == $param _type)   444                elseif ( 'checkbox'  == $param _type)
699                {   445                {
700                    echo  "<input t ype=\"chec kbox\" nam e=\"$param _name\" ". ('on' == $ param_valu e ? 'check ed' : ''). '>';   446                    echo  "<input t ype=\"chec kbox\" nam e=\"$param _name\" ". ('on' == $ param_valu e ? 'check ed' : ''). '>';
701                }   447                }
702                elseif ( 'select' = = $param_t ype)   448                elseif ( 'select' = = $param_t ype)
703                {   449                {
704                    if (  'chicks_f or_free' = = $param_n ame )    
705                    {    
706                         $vals = ex plode( ',' , getParam ('chicks_f or_free',  false) );    
707                         $query = " SELECT `ex tra` FROM  `ProfilesD esc` WHERE  name='Sex '";    
708                         $result =  db_arr($qu ery);    
709                         $result['e xtra'] =   str_replac e('\'', '' , $result[ 'extra']);    
710                         $sex = spl it(',' , $ result['ex tra']);    
711                            
712                         echo "<sel ect name=\ "{$param_n ame}[]\" m ultiple>";    
713      
714                         foreach ($ sex as $se x_key)    
715                         {    
716                             if ( i n_array( $ sex_key, $ vals ) )    
717                             {    
718                                 $s elected =  'selected= "selected" ';    
719                             }    
720                             else    
721                             {    
722                                 $s elected =  '';    
723                             }    
724                             echo " <option va lue=\"$sex _key\" $se lected >$s ex_key</op tion>";    
725                         }    
726      
727                         echo "</se lect>";    
728                    }    
729                    else    
730                    {    
731                         echo "&nbs p;";   450                    echo  "&nbsp;";
732                    }   451                }
733                }    
734                elseif ( 'combobox'  == $param _type)   452                elseif ( 'combobox'  == $param _type)
735                {   453                {
736                    if (  'chicks_f or_free_me mbership'  == $param_ name )    
737                    {    
738                         $membershi ps_arr = g etMembersh ips();    
739                         $vals = ge tParam('ch icks_for_f ree_member ship', fal se);    
740                         echo "<sel ect name=\ "$param_na me\">";    
741                         foreach (  $membershi ps_arr as  $membershi pID => $me mbershipNa me )    
742                         {    
743                             if ( $ membership ID == MEMB ERSHIP_ID_ NON_MEMBER  )    
744                                 co ntinue;    
745                             $selec ted = ( (i nt)$vals = = $members hipID ) ?  ' selected  ' : '';    
746                             echo " <option va lue=\"{$me mbershipID }\" $selec ted >{$mem bershipNam e}</option >";    
747                         }    
748                         echo "</se lect>";    
749                    }    
750                    else if ( 'temp late' == $ param_name  )    
751                    {    
752                         $old_val =  getParam( 'template' );   454                    $old _val = get Param('tem plate');
753                         $templ_cho ices = get _templates _array();   455                    $tem pl_choices  = get_tem plates_arr ay();
754     456  
755                         echo "<sel ect name=\ "$param_na me\">";   457                    echo  "<select  name=\"$pa ram_name\" >";
756                         foreach (  $templ_cho ices as $k ey => $val ue )   458                    fore ach ( $tem pl_choices  as $key = > $value )
757                         {   459                    {
758                             echo " <option va lue=\"{$ke y}\" ". ($ old_val ==  $key ? 's elected="s elected"'  : '') .">{ $value}</o ption>\n";   460                         echo "<opt ion value= \"{$key}\"  ". ($old_ val == $ke y ? 'selec ted="selec ted"' : '' ) .">{$val ue}</optio n>\n";
759                         }   461                    }
760                         echo "</se lect>";   462                    echo  "</select >";
761                    }   463                }
762                }    
763                else   464                else
764                {   465                {
765                    echo  "<input t ype=\"text \" name=\" $param_nam e\" value= \"$param_v alue\" siz e=\"30\" / >";   466                    echo  "<input t ype=\"text \" name=\" $param_nam e\" value= \"$param_v alue\" siz e=\"30\" / >";
766                }   467                }
767                echo "</ td></tr>";   468                echo "</ td></tr>";
768           }   469           }
769           ?>   470           ?>
770       </tabl e>   471       </tabl e>
771       </cent er><br />   472       </cent er><br />
772       <?php   473       <?php
773          474       
774       return  ' ';   475       return  ' ';
775   }   476   }
776     477  
777   /**   478   /**
778    * Display  error mes sages.   479    * Display  error mes sages.
779    * @global  $erros --  An array  of param n ames with  invalid va lues.   480    * @global  $erros --  An array  of param n ames with  invalid va lues.
780    * @retval  -- HTML f ormatted e rror messa ges.   481    * @retval  -- HTML f ormatted e rror messa ges.
781    */   482    */
782   function g et_error_m essages()   483   function g et_error_m essages()
783   {   484   {
784       global  $errors;   485       global  $errors;
785       // Ite rate thru  param name s.   486       // Ite rate thru  param name s.
786       foreac h ($errors  as $key = > $val)   487       foreac h ($errors  as $key = > $val)
787       {   488       {
788           if  (1 == $va l)   489           if  (1 == $va l)
789           {   490           {
790                // Get e rror messa ge.   491                // Get e rror messa ge.
791                $q_str =  "SELECT ` desc`, `er r_text` FR OM `GlPara ms` WHERE  `Name`='$k ey'";   492                $q_str =  "SELECT ` desc`, `er r_text` FR OM `GlPara ms` WHERE  `Name`='$k ey'";
792                $row = d b_arr($q_s tr);   493                $row = d b_arr($q_s tr);
793                //   494                //
794                $err_tex t .= "<div  class=\"e rr\">$row[ desc]: $ro w[err_text ]</div><br  />";   495                $err_tex t .= "<div  class=\"e rr\">$row[ desc]: $ro w[err_text ]</div><br  />";
795           }   496           }
796       }   497       }
797       return  $err_text ;   498       return  $err_text ;
798   }   499   }
799     500  
800   /**   501   /**
801    * Save ad ministrato r password  into data base.   502    * Save ad ministrato r password  into data base.
802    * The fun ction chec ks if the  newly ente red passwo rd confirm ed correct ly,   503    * The fun ction chec ks if the  newly ente red passwo rd confirm ed correct ly,
803    * if the  new passwo rd is of a llowable l ength.   504    * if the  new passwo rd is of a llowable l ength.
804    * In case  all the c onditions  are met th e new pass word is wr itten to t he databas e.   505    * In case  all the c onditions  are met th e new pass word is wr itten to t he databas e.
805    * @param  admin_name  -- Admini strator na me (there  can be man y admins).   506    * @param  admin_name  -- Admini strator na me (there  can be man y admins).
806    * @param  $pwd_old - - Old pass word.   507    * @param  $pwd_old - - Old pass word.
807    * @param  $pwd_new - - New pass word.   508    * @param  $pwd_new - - New pass word.
808    * @param  $pwd_new_c onfirm --  New passwo rd confirm ation.   509    * @param  $pwd_new_c onfirm --  New passwo rd confirm ation.
809    * @retval  Returns 0  in case o f success,  otherwise  returns e rror code:   510    * @retval  Returns 0  in case o f success,  otherwise  returns e rror code:
810    * E_INVAL ID_OLD_PAS SWORD -- I n case of  wrong old  password,   511    * E_INVAL ID_OLD_PAS SWORD -- I n case of  wrong old  password,
811    * E_PASSW ORD_CONFIR MATION_FAI LED -- In  case $new_ pwd and $n ew_pwd_con firm are n ot equal,   512    * E_PASSW ORD_CONFIR MATION_FAI LED -- In  case $new_ pwd and $n ew_pwd_con firm are n ot equal,
812    * E_INVAL ID_PASSWOR D_LENGTH - - In case  password i s too shor t, or too  long.   513    * E_INVAL ID_PASSWOR D_LENGTH - - In case  password i s too shor t, or too  long.
813    */   514    */
814   function s ave_admin_ password($ admin_name , $pwd_old , $pwd_new , $pwd_new _confirm)   515   function s ave_admin_ password($ admin_name , $pwd_old , $pwd_new , $pwd_new _confirm)
815   {   516   {
816       // Get  previous  admin pass word from  database.   517       // Get  previous  admin pass word from  database.
817       $q_str  = "SELECT  Password  FROM Admin s WHERE Na me = '$adm in_name'";   518       $q_str  = "SELECT  Password  FROM Admin s WHERE Na me = '$adm in_name'";
818       $row =  db_arr($q _str);   519       $row =  db_arr($q _str);
819       // Che ck passwor d and save  it if che ck conditi ons are me t.   520       // Che ck passwor d and save  it if che ck conditi ons are me t.
820       if ($r ow['Passwo rd'] != md 5($pwd_old )) // Chec k old pass word   521       if ($r ow['Passwo rd'] != md 5($pwd_old )) // Chec k old pass word
821       {   522       {
822           $r esult = E_ INVALID_OL D_PASSWORD ;   523           $r esult = E_ INVALID_OL D_PASSWORD ;
823       }   524       }
824       else i f (strlen( $pwd_new)  > 10 || st rlen($pwd_ new) < 3)  // Check p assword le ngth.   525       else i f (strlen( $pwd_new)  > 10 || st rlen($pwd_ new) < 3)  // Check p assword le ngth.
825       {   526       {
826           $r esult = E_ INVALID_PA SSWORD_LEN GTH;   527           $r esult = E_ INVALID_PA SSWORD_LEN GTH;
827       }   528       }
828       else i f ($pwd_ne w != $pwd_ new_confir m) // Chec k if passw ord confir med correc tly.   529       else i f ($pwd_ne w != $pwd_ new_confir m) // Chec k if passw ord confir med correc tly.
829       {   530       {
830           $r esult = E_ PASSWORD_C ONFIRMATIO N_FAILED;   531           $r esult = E_ PASSWORD_C ONFIRMATIO N_FAILED;
831       }   532       }
832       else / / no error s, save ne w password   533       else / / no error s, save ne w password
833       {   534       {
834           //  Write new  password  to databas e.   535           //  Write new  password  to databas e.
835           $q _str = "UP DATE Admin s SET Pass word = md5 ('$pwd_new ') WHERE N ame = '$ad min_name'" ;   536           $q _str = "UP DATE Admin s SET Pass word = md5 ('$pwd_new ') WHERE N ame = '$ad min_name'" ;
836           my sql_query( $q_str);   537           my sql_query( $q_str);
837           $r esult = S_ OK;   538           $r esult = S_ OK;
838       }   539       }
839       return  $result;   540       return  $result;
840   }   541   }
841     542  
842   /**   543   /**
843    * Save la nguage set tings.    
844    * Save cu rrent lang uage and f lag indica ting if to  enable/di salbe lang uage switc hing.    
845    */    
846   function s ave_langua ge_setting s()    
847   {    
848       // sav e default  language.    
849       if ($_ POST['lang _default'] )    
850       {    
851           se tparam('la ng_default ', $_POST[ 'lang_defa ult']);    
852       }    
853       //    
854       if ('o n' == $_PO ST['lang_e nable'])    
855       {    
856           se tparam('la ng_enable' , '1');    
857       }    
858       else    
859       {    
860           se tparam('la ng_enable' , '0');    
861       }    
862       ?>    
863       <div c lass="succ ">Language  settings  changed.</ div><br />    
864       <?php    
865   }    
866      
867   /**    
868    * Save in dex page s ettings.    
869    */    
870   function s ave_index_ page_setti ngs()    
871   {    
872       setPar am('defaul t_country' , $_POST[' default_co untry']);    
873       setPar am('top_me mbers_mode ', $_POST[ 'top_membe rs_mode']) ;    
874       setPar am('featur ed_mode',  $_POST['fe atured_mod e']);    
875       setPar am('featur ed_num', $ _POST['fea tured_num' ]);    
876       ?>    
877       <div c lass="succ ">Index pa ge paramet ers succes sfully cha nged.</div ><br />    
878       <?php    
879   }    
880      
881   /**    
882    * Save ch anges for  certain ca tegory of  global set tings.   544    * Save ch anges for  certain ca tegory of  global set tings.
883    * @param  $cat -- Ca tegory to  save.   545    * @param  $cat -- Ca tegory to  save.
884    * @global  $errors - - an array  of param  names with  invalid v alues.   546    * @global  $errors - - an array  of param  names with  invalid v alues.
885    * @global  $_POST --  an array  of param n ames and v alues.   547    * @global  $_POST --  an array  of param n ames and v alues.
886    */   548    */
887   function s ave_settin gs($cat)   549   function s ave_settin gs($cat)
888   {   550   {
889       global  $dir;   551       global  $dir;
890     552  
891       assert (strlen($c at) > 0);   553       assert (strlen($c at) > 0);
892       assert ((int)$cat  > 0);   554       assert ((int)$cat  > 0);
893     555  
894       global  $errors;   556       global  $errors;
895     557  
896       // Get  checking  conditions  and error  messages  for every  item in th e category .   558       // Get  checking  conditions  and error  messages  for every  item in th e category .
897       $q_str  = "SELECT  `Name`, ` check` FRO M `GlParam s` WHERE ` kateg` = $ cat";   559       $q_str  = "SELECT  `Name`, ` check` FRO M `GlParam s` WHERE ` kateg` = $ cat";
898       $res =  db_res($q _str);   560       $res =  db_res($q _str);
899     561  
900     562  
901       $q_str  = "SELECT  `ID` FROM  `GlParams Kateg` WHE RE `name`  = 'Variabl es'";   563       $q_str  = "SELECT  `ID` FROM  `GlParams Kateg` WHE RE `name`  = 'Variabl es'";
902       $vid =  db_arr($q _str);   564       $vid =  db_arr($q _str);
903       $q_str  = "SELECT  `ID` FROM  `GlParams Kateg` WHE RE `name`  = 'Profile s'";   565       $q_str  = "SELECT  `ID` FROM  `GlParams Kateg` WHE RE `name`  = 'Profile s'";
904       $pid =  db_arr($q _str);   566       $pid =  db_arr($q _str);
905       $q_str  = "SELECT  `ID` FROM  `GlParams Kateg` WHE RE `name`  = 'SpeedDa ting'";   567       $q_str  = "SELECT  `ID` FROM  `GlParams Kateg` WHE RE `name`  = 'SpeedDa ting'";
906       $sid =  db_arr($q _str);   568       $sid =  db_arr($q _str);
907       $mid =  23;   569       $mid =  23;
908     570  
909       // Ite rate thru  items and  check if v alues ente red are va lid.   571       // Ite rate thru  items and  check if v alues ente red are va lid.
910       while  ($row = my sql_fetch_ array($res ))   572       while  ($row = my sql_fetch_ array($res ))
911       {   573       {
912           $p aram_name  = $row['Na me'];   574           $p aram_name  = $row['Na me'];
913           $c hecked = T RUE;   575           $c hecked = T RUE;
914           //  Generate  function o ut of chec k conditio n (if the  one is not  empty).   576           //  Generate  function o ut of chec k conditio n (if the  one is not  empty).
915           $f _body = $r ow['check' ]; // Get  function b ody.   577           $f _body = $r ow['check' ]; // Get  function b ody.
916           if  ( strlen( $f_body) >  0 )   578           if  ( strlen( $f_body) >  0 )
917           {   579           {
918                $check_f unc = crea te_functio n('$arg0',  $f_body);   580                $check_f unc = crea te_functio n('$arg0',  $f_body);
919                $checked  = FALSE;   581                $checked  = FALSE;
920           }   582           }
921           //  Get new v alue.   583           //  Get new v alue.
922           //  Then chec k if the v alue is va lid.  If i t is then  save it,   584           //  Then chec k if the v alue is va lid.  If i t is then  save it,
923           //  otherwise  generate  error mess age.   585           //  otherwise  generate  error mess age.
924                $param_v alue = $_P OST[$param _name];   586                $param_v alue = $_P OST[$param _name];
925                if ( is_ array( $pa ram_value  ) ) $param _value = i mplode( ', ', $param_ value );   587                if ( is_ array( $pa ram_value  ) ) $param _value = i mplode( ', ', $param_ value );
926           if  ($checked  || $check _func($par am_value))   588           if  ($checked  || $check _func($par am_value))
927           {   589           {
928                // Save  parameter   590                // Save  parameter
929                setParam ($param_na me, $param _value);   591                setParam ($param_na me, $param _value);
930                // updat e header f ile   592                // updat e header f ile
931                /**   593                /**
932                 * Rewri te global  vars at pa rams.inc.p hp from Va riables Ca tegory   594                 * Rewri te global  vars at pa rams.inc.p hp from Va riables Ca tegory
933                 * $vid[ 'ID']   -  ID of Vari ables Cate gory   595                 * $vid[ 'ID']   -  ID of Vari ables Cate gory
934                 * $cat          -  ID of Cate gory that  currently  under chan ges   596                 * $cat          -  ID of Cate gory that  currently  under chan ges
935                 *   597                 *
936                 */   598                 */
937                if ( $vi d['ID'] ==  $cat )   599                if ( $vi d['ID'] ==  $cat )
938                {   600                {
939                    if (  $param_va lue == 'on ' ) $vval  = 1;   601                    if (  $param_va lue == 'on ' ) $vval  = 1;
940                    else if ( $para m_value ==  '' ) $vva l = 0;   602                    else if ( $para m_value ==  '' ) $vva l = 0;
941                    else if ( !preg _match ("/ ^\d+$/i",  $param_val ue) ) $vva l = "'$par am_value'" ;   603                    else if ( !preg _match ("/ ^\d+$/i",  $param_val ue) ) $vva l = "'$par am_value'" ;
942                    else  $vval = $ param_valu e;   604                    else  $vval = $ param_valu e;
943     605  
944                    swit ch ( $para m_name )   606                    swit ch ( $para m_name )
945                    {   607                    {
946                    case  'currency _sign': $v target = ' $doll';   608                    case  'currency _sign': $v target = ' $doll';
947                         break;   609                         break;
948                    case  'profile_ pic_num':  $vtarget =  '$pic_num ';   610                    case  'profile_ pic_num':  $vtarget =  '$pic_num ';
949                         break;   611                         break;
950                    case  'enable_z ip_loc': $ vtarget =  '$en_ziplo c';   612                    case  'enable_z ip_loc': $ vtarget =  '$en_ziplo c';
951                         break;   613                         break;
952                    case  'enable_a ff': $vtar get = '$en _aff';   614                    case  'enable_a ff': $vtar get = '$en _aff';
953                         break;   615                         break;
954                    case  'enable_i nbox_notif y': $vtarg et = '$en_ inbox_noti fy';   616                    case  'enable_i nbox_notif y': $vtarg et = '$en_ inbox_noti fy';
955                         break;   617                         break;
956                    case  'enable_d ir': $vtar get = '$en _dir';   618                    case  'enable_d ir': $vtar get = '$en _dir';
957                         break;   619                         break;
958                    case  'vote_pic _max': $vt arget = '$ max_voting _mark';   620                    case  'vote_pic _max': $vt arget = '$ max_voting _mark';
959                         break;   621                         break;
960                    case  'template ': $vtarge t = '$tmpl ';   622                    case  'template ': $vtarge t = '$tmpl ';
961                         break;   623                         break;
962                    case  'friendli st': $vtar get = '$en able_frien dlist';   624                    case  'friendli st': $vtar get = '$en able_frien dlist';
963                         break;   625                         break;
964                    case  'enable_s dating': $ vtarget =  '$en_sdati ng';    
965                         break;    
966                    case  'enable_t humb': $vt arget = '$ enable_aut o_thumbnai l';   626                    case  'enable_t humb': $vt arget = '$ enable_aut o_thumbnai l';
967                         break;   627                         break;
968                    case  'date_for mat': $vta rget = '$d ate_format ';   628                    case  'date_for mat': $vta rget = '$d ate_format ';
969                         break;   629                         break;
970                    case  'short_da te_format' : $vtarget  = '$short _date_form at';   630                    case  'short_da te_format' : $vtarget  = '$short _date_form at';
971                         break;   631                         break;
972                    defa ult: $vtar get = "";   632                    defa ult: $vtar get = "";
973                    brea k;   633                    brea k;
974                    }   634                    }
975     635  
976                    if (  $vtarget  )   636                    if (  $vtarget  )
977                         Replace_Va rs( BX_DIR ECTORY_PAT H_INC . 'p arams.inc. php', $vta rget, " =  $vval;");   637                         Replace_Va rs( BX_DIR ECTORY_PAT H_INC . 'p arams.inc. php', $vta rget, " =  $vval;");
978                }   638                }
979                elseif (  $pid['ID' ] == $cat  )   639                elseif (  $pid['ID' ] == $cat  )
980                {   640                {
981                    /**   641                    /**
982                     * R ewrite glo bal vars a t params.i nc.php fro m Profiles  Category   642                     * R ewrite glo bal vars a t params.i nc.php fro m Profiles  Category
983                     * $ pid['ID']    - ID of  Profiles C ategory   643                     * $ pid['ID']    - ID of  Profiles C ategory
984                     * $ cat          - ID of  Category t hat curren tly under  changes   644                     * $ cat          - ID of  Category t hat curren tly under  changes
985                     *   645                     *
986                     */   646                     */
987                       647                    
988                    if (  $param_va lue == 'on ' ) $vval  = 1;   648                    if (  $param_va lue == 'on ' ) $vval  = 1;
989                    else if ( $para m_value ==  '' ) $vva l = 0;   649                    else if ( $para m_value ==  '' ) $vva l = 0;
990                    else if ( !preg _match ("/ ^\d+$/i",  $param_val ue) ) $vva l = "'$par am_value'" ;   650                    else if ( !preg _match ("/ ^\d+$/i",  $param_val ue) ) $vva l = "'$par am_value'" ;
991                    else  $vval = $ param_valu e;   651                    else  $vval = $ param_valu e;
992                    swit ch ( $para m_name )   652                    swit ch ( $para m_name )
993                    {   653                    {
994                         case 'thum b_width':  $vtarget =  '$max_thu mb_width';   654                         case 'thum b_width':  $vtarget =  '$max_thu mb_width';
995                             break;   655                             break;
996                         case 'thum b_height':  $vtarget  = '$max_th umb_height ';   656                         case 'thum b_height':  $vtarget  = '$max_th umb_height ';
997                             break;   657                             break;
998                         case 'sear ch_start_a ge': $vtar get = '$se arch_start _age';   658                         case 'sear ch_start_a ge': $vtar get = '$se arch_start _age';
999                             break;   659                             break;
1000                         case 'sear ch_end_age ': $vtarge t = '$sear ch_end_age ';   660                         case 'sear ch_end_age ': $vtarge t = '$sear ch_end_age ';
1001                             break;   661                             break;
1002                         case 'pic_ width': $v target = ' $max_photo _width';   662                         case 'pic_ width': $v target = ' $max_photo _width';
1003                             break;   663                             break;
1004                         case 'pic_ height': $ vtarget =  '$max_phot o_height';   664                         case 'pic_ height': $ vtarget =  '$max_phot o_height';
1005                             break;   665                             break;
1006                         case 'trac k_profile_ view': $vt arget = '$ track_prof ile_view';   666                         case 'trac k_profile_ view': $vt arget = '$ track_prof ile_view';
1007                             break;   667                             break;
1008                         case 'vote s': $vtarg et = '$vot es';   668                         case 'vote s': $vtarg et = '$vot es';
1009                             break;   669                             break;
1010                         case 'vote s_pic': $v target = ' $votes_pic ';   670                         case 'vote s_pic': $v target = ' $votes_pic ';
1011                             break;   671                             break;
1012                         case 'anon _mode': $v target = ' $anon_mode ';   672                         case 'anon _mode': $v target = ' $anon_mode ';
1013                             break;   673                             break;
1014                         case 'enab le_video':  $vtarget  = '$enable _video_upl oad';    
1015                             break;    
1016                         case 'enab le_audio':  $vtarget  = '$enable _audio_upl oad';    
1017                             break;    
1018                         case 'zodi ac': $vtar get = '$en able_zodia c';   674                         case 'zodi ac': $vtar get = '$en able_zodia c';
1019                             break;   675                             break;
1020                         case 'newu sernotify' : $vtarget  = '$newus ernotify';   676                         case 'newu sernotify' : $vtarget  = '$newus ernotify';
1021                             break;   677                             break;
1022                         case 'blog _step': $v target = ' $blog_step ';   678                         case 'blog _step': $v target = ' $blog_step ';
1023                             break;   679                             break;
1024                         case 'enab le_blog':  $vtarget =  '$enable_ blog';   680                         case 'enab le_blog':  $vtarget =  '$enable_ blog';
1025                             break;   681                             break;
1026                         case 'enab le_guestbo ok': $vtar get = '$en able_guest book';    
1027                             break;    
1028                         default: $ vtarget =  "";   682                         default: $ vtarget =  "";
1029                         break;   683                         break;
1030                    }   684                    }
1031     685  
1032                    if (  $vtarget  ) Replace_ Vars( BX_D IRECTORY_P ATH_INC .  'params.in c.php', $v target, "  = $vval;") ;   686                    if (  $vtarget  ) Replace_ Vars( BX_D IRECTORY_P ATH_INC .  'params.in c.php', $v target, "  = $vval;") ;
1033                }   687                }
1034                elseif (  $sid['ID' ] == $cat  )   688                elseif (  $sid['ID' ] == $cat  )
1035                {   689                {
1036                    /**   690                    /**
1037                     * R ewrite glo bal vars a t params.i nc.php fro m SpeedDat ing Catego ry   691                     * R ewrite glo bal vars a t params.i nc.php fro m SpeedDat ing Catego ry
1038                     * $ pid['ID']    - ID of  SpeedDatin g Category   692                     * $ pid['ID']    - ID of  SpeedDatin g Category
1039                     * $ cat          - ID of  Category t hat curren tly under  changes   693                     * $ cat          - ID of  Category t hat curren tly under  changes
1040                     *   694                     *
1041                     */   695                     */
1042     696  
1043                    if (  $param_va lue == 'on ' ) $vval  = 1;   697                    if (  $param_va lue == 'on ' ) $vval  = 1;
1044                    else if ( $para m_value ==  '' ) $vva l = 0;   698                    else if ( $para m_value ==  '' ) $vva l = 0;
1045                    else if ( !preg _match ("/ ^\d+$/i",  $param_val ue) ) $vva l = "'$par am_value'" ;   699                    else if ( !preg _match ("/ ^\d+$/i",  $param_val ue) ) $vva l = "'$par am_value'" ;
1046                    else  $vval = $ param_valu e;   700                    else  $vval = $ param_valu e;
1047                    swit ch ( $para m_name )   701                    swit ch ( $para m_name )
1048                    {   702                    {
1049                         case 'enab le_sdating ': $vtarge t = '$en_s dating';    
1050                             break;    
1051                         default: $ vtarget =  "";   703                         default: $ vtarget =  "";
1052                         break;   704                         break;
1053                    }   705                    }
1054     706  
1055                    if (  $vtarget  ) Replace_ Vars( BX_D IRECTORY_P ATH_INC .  'params.in c.php', $v target, "  = $vval;") ;   707                    if (  $vtarget  ) Replace_ Vars( BX_D IRECTORY_P ATH_INC .  'params.in c.php', $v target, "  = $vval;") ;
1056                }   708                }
1057                elseif(  $mid == $c at )   709                elseif(  $mid == $c at )
1058                {   710                {
1059                    if (  $param_va lue == 'on ' ) $vval  = 1;   711                    if (  $param_va lue == 'on ' ) $vval  = 1;
1060                    else if ( $para m_value ==  '' ) $vva l = 0;   712                    else if ( $para m_value ==  '' ) $vva l = 0;
1061                    else if ( !preg _match ("/ ^\d+$/i",  $param_val ue) ) $vva l = "'$par am_value'" ;   713                    else if ( !preg _match ("/ ^\d+$/i",  $param_val ue) ) $vva l = "'$par am_value'" ;
1062                    else  $vval = $ param_valu e;   714                    else  $vval = $ param_valu e;
1063                    /*   715                    /*
1064                    echo  '<hr>';   716                    echo  '<hr>';
1065                         echo '[' .  $param_na me . '] =>  ' . $vval ;   717                         echo '[' .  $param_na me . '] =>  ' . $vval ;
1066                    echo  '<hr>';   718                    echo  '<hr>';
1067                    */   719                    */
1068                    swit ch ( $para m_name )   720                    swit ch ( $para m_name )
1069                    {   721                    {
1070                         case 'enab le_video_u pload':    
1071                             $vtarg et = '$ena ble_video_ upload';    
1072                         break;    
1073                         case 'enab le_audio_u pload':    
1074                             $vtarg et = '$ena ble_audio_ upload';    
1075                         break;    
1076                         case 'max_ voting_mar k':   722                         case 'max_ voting_mar k':
1077                             $vtarg et = '$max _voting_ma rk';   723                             $vtarg et = '$max _voting_ma rk';
1078                         break;   724                         break;
1079                         case 'min_ voting_mar k':   725                         case 'min_ voting_mar k':
1080                             $vtarg et = '$min _voting_ma rk';   726                             $vtarg et = '$min _voting_ma rk';
1081                         break;   727                         break;
1082                         case 'max_ voting_per iod':   728                         case 'max_ voting_per iod':
1083                             $vtarg et = '$max _voting_pe riod';   729                             $vtarg et = '$max _voting_pe riod';
1084                         break;   730                         break;
1085                         case 'max_ icon_width ':   731                         case 'max_ icon_width ':
1086                             $vtarg et = '$max _icon_widt h';   732                             $vtarg et = '$max _icon_widt h';
1087                         break;   733                         break;
1088                         case 'max_ icon_heigh t':   734                         case 'max_ icon_heigh t':
1089                             $vtarg et = '$max _icon_heig ht';   735                             $vtarg et = '$max _icon_heig ht';
1090                         break;   736                         break;
1091                         case 'max_ thumb_widt h':   737                         case 'max_ thumb_widt h':
1092                             $vtarg et = '$max _thumb_wid th';   738                             $vtarg et = '$max _thumb_wid th';
1093                         break;   739                         break;
1094                         case 'max_ thumb_heig ht':   740                         case 'max_ thumb_heig ht':
1095                             $vtarg et = '$max _thumb_hei ght';   741                             $vtarg et = '$max _thumb_hei ght';
1096                         break;   742                         break;
1097                         case 'max_ photo_widt h':   743                         case 'max_ photo_widt h':
1098                             $vtarg et = '$max _photo_wid th';   744                             $vtarg et = '$max _photo_wid th';
1099                         break;   745                         break;
1100                         case 'max_ photo_heig ht':   746                         case 'max_ photo_heig ht':
1101                             $vtarg et = '$max _photo_hei ght';   747                             $vtarg et = '$max _photo_hei ght';
1102                         break;   748                         break;
1103                         case 'max_ photo_file s':   749                         case 'max_ photo_file s':
1104                             $vtarg et = '$max _photo_fil es';   750                             $vtarg et = '$max _photo_fil es';
1105                         break;   751                         break;
1106                         case 'max_ photo_size ':   752                         case 'max_ photo_size ':
1107                             $vtarg et = '$max _photo_siz e';   753                             $vtarg et = '$max _photo_siz e';
1108                         break;   754                         break;
1109                         case 'max_ video_file s':    
1110                             $vtarg et = '$max _video_fil es';    
1111                         break;    
1112                         case 'max_ video_size ':    
1113                             $vtarg et = '$max _video_siz e';    
1114                         break;    
1115                         case 'max_ audio_file s':    
1116                             $vtarg et = '$max _audio_fil es';    
1117                         break;    
1118                         case 'max_ audio_size ':    
1119                             $vtarg et = '$max _audio_siz e';    
1120                         break;    
1121                         case 'max_ media_titl e':   755                         case 'max_ media_titl e':
1122                             $vtarg et = '$max _media_tit le';   756                             $vtarg et = '$max _media_tit le';
1123                         break;   757                         break;
1124                         case 'min_ media_titl e':   758                         case 'min_ media_titl e':
1125                             $vtarg et = '$min _media_tit le';   759                             $vtarg et = '$min _media_tit le';
1126                         break;   760                         break;
1127                         default: $ vtarget =  '';   761                         default: $ vtarget =  '';
1128                         break;   762                         break;
1129                    }   763                    }
1130     764  
1131                    if (  $vtarget  ) Replace_ Vars( BX_D IRECTORY_P ATH_INC .  'params.in c.php', $v target, "  = $vval;") ;   765                    if (  $vtarget  ) Replace_ Vars( BX_D IRECTORY_P ATH_INC .  'params.in c.php', $v target, "  = $vval;") ;
1132                }   766                }
1133     767  
1134           }   768           }
1135           el se   769           el se
1136           {   770           {
1137                $errors[ $param_nam e] = 1;   771                $errors[ $param_nam e] = 1;
1138           }   772           }
1139       } // w hile   773       } // w hile
1140   }   774   }
1141     775  
1142   /**   776   /**
1143    * Save al l settings .   777    * Save al l settings .
1144    * The fun ction gets  a list of  all setti ng categor ies from d atabase, i terates th ru them,   778    * The fun ction gets  a list of  all setti ng categor ies from d atabase, i terates th ru them,
1145    * and sav es changes  for every  category.   779    * and sav es changes  for every  category.
1146    */   780    */
1147   function s ave_settin gs_all()   781   function s ave_settin gs_all()
1148   {   782   {
1149       // Get  a list of  categorie s.   783       // Get  a list of  categorie s.
1150       $q_str  = 'SELECT  `ID` FROM  `GlParams Kateg` WHE RE `ID` <>  '. WATERM ARK_CATEGO RY;   784       $q_str  = 'SELECT  `ID` FROM  `GlParams Kateg` WHE RE `ID` <>  '. WATERM ARK_CATEGO RY;
1151       $res =  db_res($q _str);   785       $res =  db_res($q _str);
1152       // Ite rate thru  categories .   786       // Ite rate thru  categories .
1153       while  ($row = my sql_fetch_ array($res ))   787       while  ($row = my sql_fetch_ array($res ))
1154       {    
1155           sa ve_setting s($row['ID ']);   788           sa ve_setting s($row['ID ']);
1156       }   789   }
1157   }    
1158     790  
1159   /**   791   /**
1160    * Upload  WaterMark.   792    * Upload  WaterMark.
1161    */   793    */
1162   function s ave_water_ mark()   794   function s ave_water_ mark()
1163   {   795   {
1164       global  $dir;   796       global  $dir;
1165     797  
1166     798  
1167       $gl_pi c['pic'][' width'] =  getParam(  'max_photo _width' );   799       $gl_pi c['pic'][' width'] =  getParam(  'max_photo _width' );
1168       $gl_pi c['pic'][' height'] =  getParam(  'max_phot o_height'  );   800       $gl_pi c['pic'][' height'] =  getParam(  'max_phot o_height'  );
1169          801       
1170       $scan  = getimage size( $_FI LES['file_ watermark' ]['tmp_nam e'] );   802       $scan  = getimage size( $_FI LES['file_ watermark' ]['tmp_nam e'] );
1171     803  
1172       if ( $ scan && (  1 == $scan [2] || 2 = = $scan[2]  || 3 == $ scan[2] ||  6 == $sca n[2] ) )   804       if ( $ scan && (  1 == $scan [2] || 2 = = $scan[2]  || 3 == $ scan[2] ||  6 == $sca n[2] ) )
1173       {   805       {
1174           $u ploadfile  = $dir['tm p'] . $_FI LES['file_ watermark' ]['name'];   806           $u ploadfile  = $dir['tm p'] . $_FI LES['file_ watermark' ]['name'];
1175           $t argetfile  = $dir['pr ofileImage '] . $_FIL ES['file_w atermark'] ['name'];   807           $t argetfile  = $dir['pr ofileImage '] . $_FIL ES['file_w atermark'] ['name'];
1176           if  ( move_up loaded_fil e($_FILES[ 'file_wate rmark']['t mp_name'],  $uploadfi le) )   808           if  ( move_up loaded_fil e($_FILES[ 'file_wate rmark']['t mp_name'],  $uploadfi le) )
1177           {   809           {
1178                $query =  "UPDATE ` GlParams`  SET  `VALU E` ='". ad dslashes($ _FILES['fi le_waterma rk']['name ']) ."' WH ERE `Name`  = 'Water_ Mark'";   810                $query =  "UPDATE ` GlParams`  SET  `VALU E` ='". ad dslashes($ _FILES['fi le_waterma rk']['name ']) ."' WH ERE `Name`  = 'Water_ Mark'";
1179                db_res($ query);   811                db_res($ query);
1180                imageRes ize( $uplo adfile, $t argetfile,  $gl_pic[' pic']['wid th'], $gl_ pic['pic'] ['height']  );   812                imageRes ize( $uplo adfile, $t argetfile,  $gl_pic[' pic']['wid th'], $gl_ pic['pic'] ['height']  );
1181                unlink(  $uploadfil e );   813                unlink(  $uploadfil e );
1182                @chmod($ targetfile , 0644);   814                @chmod($ targetfile , 0644);
1183           }   815           }
1184       }   816       }
1185     817  
1186       $query  = "UPDATE  `GlParams ` SET `VAL UE` ='". ( int)$_POST ['transp1' ] ."' WHER E `Name` =  'transpar ent1'";   818       $query  = "UPDATE  `GlParams ` SET `VAL UE` ='". ( int)$_POST ['transp1' ] ."' WHER E `Name` =  'transpar ent1'";
1187       db_res ($query);   819       db_res ($query);
1188       $query  = "UPDATE  `GlParams ` SET `VAL UE` ='". p rocess_db_ input($_PO ST['enable _wm']) ."'  WHERE `Na me` = 'ena ble_waterm ark'";   820       $query  = "UPDATE  `GlParams ` SET `VAL UE` ='". p rocess_db_ input($_PO ST['enable _wm']) ."'  WHERE `Na me` = 'ena ble_waterm ark'";
1189       db_res ($query);   821       db_res ($query);
1190       ?>   822       ?>
1191       <div c lass="succ ">Watermar k settings  saved.</d iv><br />   823       <div c lass="succ ">Watermar k settings  saved.</d iv><br />
1192       <?php   824       <?php
1193   }   825   }
1194     826  
1195   ?>   827   ?>