229. File Comparison Report

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

229.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.0.5\inc design.inc.php Wed Mar 5 06:29:10 2008 UTC
2 Dolphin-v.6.1.0\inc design.inc.php Tue Apr 29 05:39:44 2008 UTC

229.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 135 1662
Changed 100 811
Inserted 19 119
Removed 15 177

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

229.4 Active regular expressions

No regular expressions were active.

229.5 Comparison detail

1   <?   1   <?
2     2  
3   /********* ********** ********** ********** ********** ********** ********** ******   3   /********* ********** ********** ********** ********** ********** ********** ******
4   *                              D olphin Sma rt Communi ty Builder   4   *                              D olphin Sma rt Communi ty Builder
5   *                                 --------- --------   5   *                                 --------- --------
6   *     begi n                 : M on Mar 23  2006   6   *     begi n                 : M on Mar 23  2006
7   *     copy right             : ( C) 2006 Bo onEx Group   7   *     copy right             : ( C) 2006 Bo onEx Group
8   *     webs ite               : h ttp://www. boonex.com /   8   *     webs ite               : h ttp://www. boonex.com /
9   * This fil e is part  of Dolphin  - Smart C ommunity B uilder   9   * This fil e is part  of Dolphin  - Smart C ommunity B uilder
10   *   10   *
11   * Dolphin  is free so ftware. Th is work is  licensed  under a Cr eative Com mons Attri bution 3.0  License.    11   * Dolphin  is free so ftware. Th is work is  licensed  under a Cr eative Com mons Attri bution 3.0  License. 
12   * http://c reativecom mons.org/l icenses/by /3.0/   12   * http://c reativecom mons.org/l icenses/by /3.0/
13   *   13   *
14   * Dolphin  is distrib uted in th e hope tha t it will  be useful,  but WITHO UT ANY WAR RANTY;   14   * Dolphin  is distrib uted in th e hope tha t it will  be useful,  but WITHO UT ANY WAR RANTY;
15   * without  even the i mplied war ranty of   MERCHANTAB ILITY or F ITNESS FOR  A PARTICU LAR PURPOS E.   15   * without  even the i mplied war ranty of   MERCHANTAB ILITY or F ITNESS FOR  A PARTICU LAR PURPOS E.
16   * See the  Creative C ommons Att ribution 3 .0 License  for more  details.    16   * See the  Creative C ommons Att ribution 3 .0 License  for more  details. 
17   * You shou ld have re ceived a c opy of the  Creative  Commons At tribution  3.0 Licens e along wi th Dolphin   17   * You shou ld have re ceived a c opy of the  Creative  Commons At tribution  3.0 Licens e along wi th Dolphin
18   * see lice nse.txt fi le; if not , write to  marketing @boonex.co m   18   * see lice nse.txt fi le; if not , write to  marketing @boonex.co m
19   ********** ********** ********** ********** ********** ********** ********** *****/   19   ********** ********** ********** ********** ********** ********** ********** *****/
20     20  
21   require_on ce( 'heade r.inc.php'  );   21   require_on ce( 'heade r.inc.php'  );
22   require_on ce( BX_DIR ECTORY_PAT H_INC . 'a dmin.inc.p hp' );   22   require_on ce( BX_DIR ECTORY_PAT H_INC . 'a dmin.inc.p hp' );
23   require_on ce( BX_DIR ECTORY_PAT H_INC . 'd b.inc.php'  );   23   require_on ce( BX_DIR ECTORY_PAT H_INC . 'd b.inc.php'  );
24   require_on ce( BX_DIR ECTORY_PAT H_INC . 'p rof.inc.ph p' );   24   require_on ce( BX_DIR ECTORY_PAT H_INC . 'p rof.inc.ph p' );
25   require_on ce( BX_DIR ECTORY_PAT H_INC . 'b anners.inc .php' );   25   require_on ce( BX_DIR ECTORY_PAT H_INC . 'b anners.inc .php' );
26   require_on ce( BX_DIR ECTORY_PAT H_INC . 'm embership_ levels.inc .php' );   26   require_on ce( BX_DIR ECTORY_PAT H_INC . 'm embership_ levels.inc .php' );
27   require_on ce( BX_DIR ECTORY_PAT H_INC . 'p arams.inc. php' );   27   require_on ce( BX_DIR ECTORY_PAT H_INC . 'p arams.inc. php' );
28   require_on ce( BX_DIR ECTORY_PAT H_INC . 'l anguages.i nc.php');   28   require_on ce( BX_DIR ECTORY_PAT H_INC . 'l anguages.i nc.php');
29   require_on ce( BX_DIR ECTORY_PAT H_INC . 'm enu.inc.ph p');    
30   require_on ce( BX_DIR ECTORY_PAT H_INC . 's haring.inc .php');   29   require_on ce( BX_DIR ECTORY_PAT H_INC . 's haring.inc .php');
31   require_on ce( BX_DIR ECTORY_PAT H_CLASSES  . 'BxRSS.p hp');   30   require_on ce( BX_DIR ECTORY_PAT H_CLASSES  . 'BxRSS.p hp');
32     31  
33   require_on ce( BX_DIR ECTORY_PAT H_ROOT . " templates/ tmpl_{$tmp l}/scripts /functions .php" );   32   require_on ce( BX_DIR ECTORY_PAT H_ROOT . " templates/ tmpl_{$tmp l}/scripts /functions .php" );
34   require_on ce( BX_DIR ECTORY_PAT H_ROOT . " templates/ tmpl_{$tmp l}/scripts /BxTemplMe nu.php" );   33   require_on ce( BX_DIR ECTORY_PAT H_ROOT . " templates/ tmpl_{$tmp l}/scripts /BxTemplMe nu.php" );
35     34  
36     35   //require_ once( 'mod ules/heade r.inc.php'  );
37     36  
38     37  
39     38  
40   $db_color_ index = 0;   39   $db_color_ index = 0;
41     40  
42   $_page['js '] = 1;   41   $_page['js '] = 1;
43     42  
44   /**   43   /**
45    * Put spa cer code   44    * Put spa cer code
46    *  $width   - width  if spacer  in pixels   45    *  $width   - width  if spacer  in pixels
47    *  $heigh t - height  of spacer  in pixels   46    *  $heigh t - height  of spacer  in pixels
48    **/   47    **/
49     48  
50   function s pacer( $wi dth, $heig ht )   49   function s pacer( $wi dth, $heig ht )
51   {   50   {
52       global  $site;   51       global  $site;
53     52  
54       return  '<img src ="' . $sit e['images' ] . 'space r.gif" wid th="' . $w idth . '"  height="'  . $height  . '" alt=" " />';   53       return  '<img src ="' . $sit e['images' ] . 'space r.gif" wid th="' . $w idth . '"  height="'  . $height  . '" alt=" " />';
55   }   54   }
56     55  
57   /**   56   /**
58    * Put att ention cod e   57    * Put att ention cod e
59    *  $str -  attention  text   58    *  $str -  attention  text
60    **/   59    **/
61   function a ttention(  $str )   60   function a ttention(  $str )
62   {   61   {
63       global  $site;   62       global  $site;
64   ?>   63   ?>
65   <table cel lspacing=" 2" cellpad ding="1">   64   <table cel lspacing=" 2" cellpad ding="1">
66       <tr>   65       <tr>
67           <t d valign=" top">   66           <t d valign=" top">
68                <img src ="<?= $sit e['icons']  ?>sign.gi f" alt=""  />   67                <img src ="<?= $sit e['icons']  ?>sign.gi f" alt=""  />
69           </ td>   68           </ td>
70           <t d valign=" top">   69           <t d valign=" top">
71                <table c ellspacing ="0" cellp adding="2"  class="te xt">   70                <table c ellspacing ="0" cellp adding="2"  class="te xt">
72                    <tr>   71                    <tr>
73                         <td valign ="top" ali gn="justif y"><?= $st r ?></td>   72                         <td valign ="top" ali gn="justif y"><?= $st r ?></td>
74                    </tr >   73                    </tr >
75                </table>   74                </table>
76           </ td>   75           </ td>
77       </tr>   76       </tr>
78   </table>   77   </table>
79   <?   78   <?
80   }   79   }
81     80  
82   /**   81   /**
83    * Put des ign progre ss bar cod e   82    * Put des ign progre ss bar cod e
84    *  $text      - prog ress bar t ext   83    *  $text      - prog ress bar t ext
85    *  $width     - widt h of progr ess bar in  pixels   84    *  $width     - widt h of progr ess bar in  pixels
86    *  $max_p os  - maxi mal positi on of prog ress bar   85    *  $max_p os  - maxi mal positi on of prog ress bar
87    *  $curr_ pos - curr ent positi on of prog ress bar   86    *  $curr_ pos - curr ent positi on of prog ress bar
88    **/   87    **/
89   function D esignProgr essPos ( $ text, $wid th, $max_p os, $curr_ pos, $prog ress_num =  '1' )   88   function D esignProgr essPos ( $ text, $wid th, $max_p os, $curr_ pos, $prog ress_num =  '1' )
90   {   89   {
91       if( $m ax_pos )   90       if( $m ax_pos )
92           $p ercent = $ curr_pos *  100 / $ma x_pos;   91           $p ercent = $ curr_pos *  100 / $ma x_pos;
93       else   92       else
94           $p ercent = 0 ;   93           $p ercent = 0 ;
95          94       
96       return  DesignPro gress( $te xt, $width , $percent , $progres s_num );   95       return  DesignPro gress( $te xt, $width , $percent , $progres s_num );
97   }   96   }
98     97  
99   /**   98   /**
100    * Put des ign progre ss bar cod e   99    * Put des ign progre ss bar cod e
101    *  $text      - prog ress bar t ext   100    *  $text      - prog ress bar t ext
102    *  $width     - widt h of progr ess bar in  pixels   101    *  $width     - widt h of progr ess bar in  pixels
103    *  $perce nt  - curr ent positi on of prog ress bar i n percents   102    *  $perce nt  - curr ent positi on of prog ress bar i n percents
104    **/   103    **/
105   function D esignProgr ess ( $tex t, $width,  $percent,  $progress _num, $id  = ''  )   104   function D esignProgr ess ( $tex t, $width,  $percent,  $progress _num, $id  = ''  )
106   {   105   {
107       global  $site;   106       global  $site;
108          107       
109       $ret =  "";   108       $ret =  "";
110       $ret . = '<div cl ass="rate_ block" sty le="width: ' . $width  . 'px;">' ;   109       $ret . = '<div cl ass="rate_ block" sty le="width: ' . $width  . 'px;">' ;
111           $r et .= '<di v class="r ate_text"'  . ( $id ?  " id=\"{$ id}_text\" " : '' ) .  '>';   110           $r et .= '<di v class="r ate_text"'  . ( $id ?  " id=\"{$ id}_text\" " : '' ) .  '>';
112                $ret .=  $text;   111                $ret .=  $text;
113           $r et .= '</d iv>';   112           $r et .= '</d iv>';
114           $r et .= '<di v class="r ate_scale" ' . ( $id  ? " id=\"{ $id}_scale \"" : '' )  . '>';   113           $r et .= '<di v class="r ate_scale" ' . ( $id  ? " id=\"{ $id}_scale \"" : '' )  . '>';
115                $ret .=  '<div' . (  $id ? " i d=\"{$id}_ bar\"" : ' ' ) . ' st yle="posit ion:relati ve; height :10px; fon t-size:1px ; width:'  . round($p ercent) .  '%; backgr ound-image :url(' . g etTemplate Icon("scal e_index_{$ progress_n um}.gif")  . '); back ground-rep eat:repeat -x;"></div >';   114                $ret .=  '<div' . (  $id ? " i d=\"{$id}_ bar\"" : ' ' ) . ' st yle="posit ion:relati ve; height :10px; fon t-size:1px ; width:'  . round($p ercent) .  '%; backgr ound-image :url(' . g etTemplate Icon("scal e_index_{$ progress_n um}.gif")  . '); back ground-rep eat:repeat -x;"></div >';
116           $r et .= '</d iv>';   115           $r et .= '</d iv>';
117       $ret . = '</div>' ;   116       $ret . = '</div>' ;
118     117  
119       return  $ret;   118       return  $ret;
120   }   119   }
121     120  
122     121  
123   // design  box   122   // design  box
124   $fs = file size ( "{$ dir['root' ]}template s/tmpl_{$t mpl}/desig nbox_0.htm l" );   123   $fs = file size ( "{$ dir['root' ]}template s/tmpl_{$t mpl}/desig nbox_0.htm l" );
125   $f = fopen  ( "{$dir[ 'root']}te mplates/tm pl_{$tmpl} /designbox _0.html",  "r" );   124   $f = fopen  ( "{$dir[ 'root']}te mplates/tm pl_{$tmpl} /designbox _0.html",  "r" );
126   $templ_des ignbox0 =  fread ( $f , $fs );   125   $templ_des ignbox0 =  fread ( $f , $fs );
127   fclose ( $ f );   126   fclose ( $ f );
128     127  
129   $fs = file size ( "{$ dir['root' ]}template s/tmpl_{$t mpl}/desig nbox_1.htm l" );   128   $fs = file size ( "{$ dir['root' ]}template s/tmpl_{$t mpl}/desig nbox_1.htm l" );
130   $f = fopen  ( "{$dir[ 'root']}te mplates/tm pl_{$tmpl} /designbox _1.html",  "r" );   129   $f = fopen  ( "{$dir[ 'root']}te mplates/tm pl_{$tmpl} /designbox _1.html",  "r" );
131   $templ_des ignbox1 =  fread ( $f , $fs );   130   $templ_des ignbox1 =  fread ( $f , $fs );
132   fclose ( $ f );   131   fclose ( $ f );
133     132  
134   $fs = file size ( "{$ dir['root' ]}template s/tmpl_{$t mpl}/desig nbox_2.htm l" );   133   $fs = file size ( "{$ dir['root' ]}template s/tmpl_{$t mpl}/desig nbox_2.htm l" );
135   $f = fopen  ( "{$dir[ 'root']}te mplates/tm pl_{$tmpl} /designbox _2.html",  "r" );   134   $f = fopen  ( "{$dir[ 'root']}te mplates/tm pl_{$tmpl} /designbox _2.html",  "r" );
136   $templ_des ignbox2 =  fread ( $f , $fs );   135   $templ_des ignbox2 =  fread ( $f , $fs );
137   fclose ( $ f );   136   fclose ( $ f );
138     137  
139     138  
140   /**   139   /**
141    * Put "de sign box"  HTML code   140    * Put "de sign box"  HTML code
142    *  $title         -  title text   141    *  $title         -  title text
143    *  $width         -  width in p ixels   142    *  $width         -  width in p ixels
144    *  $heigh t       -  height in  pixels   143    *  $heigh t       -  height in  pixels
145    *  $align         -  align or o ther <td>  formatter   144    *  $align         -  align or o ther <td>  formatter
146    *                    for exampl e: "align= center"   145    *                    for exampl e: "align= center"
147    * $db_num         -  number of  design box  template  (for "act"  skin only )   146    * $db_num         -  number of  design box  template  (for "act"  skin only )
148    **/   147    **/
149   function D esignBoxCo ntent ( $t itle, $con tent, $db_ num = 0, $ caption_it em = '' )   148   function D esignBoxCo ntent ( $t itle, $con tent, $db_ num = 0, $ caption_it em = '' )
150   {   149   {
151       global  $site;   150       global  $site;
152       global  $templ_de signbox0;   151       global  $templ_de signbox0;
153       global  $templ_de signbox1;   152       global  $templ_de signbox1;
154       global  $templ_de signbox2;   153       global  $templ_de signbox2;
155       global  $dbh_lett ers;   154       global  $dbh_lett ers;
156       global  $tmpl;   155       global  $tmpl;
157     156  
158       switch  ($dbh_let ters)   157       switch  ($dbh_let ters)
159       {   158       {
160           ca se "upper" : $f = "st rtoupper";  break;   159           ca se "upper" : $f = "st rtoupper";  break;
161           ca se "lower" : $f = "st rtolower";  break;   160           ca se "lower" : $f = "st rtolower";  break;
162           ca se "fupper ": $f = "u cfirst"; b reak;   161           ca se "fupper ": $f = "u cfirst"; b reak;
163           ca se "aupper ": $f = "u cwords"; b reak;   162           ca se "aupper ": $f = "u cwords"; b reak;
164           de fault: $f  = "sprintf ";   163           de fault: $f  = "sprintf ";
165       }   164       }
166     165  
167     166  
168       if ( s trlen($hei ght) ) $he ight = " h eight=\"$h eight\" ";   167       if ( s trlen($hei ght) ) $he ight = " h eight=\"$h eight\" ";
169     168  
170       if ($d b_num == 2 ) // && !$ templ_desi gnbox2 )   169       if ($d b_num == 2 ) // && !$ templ_desi gnbox2 )
171       {   170       {
172           $t empl = $te mpl_design box2;   171           $t empl = $te mpl_design box2;
173       }   172       }
174       elseif ( $db_num  == 1) // & & !$templ_ designbox1  )   173       elseif ( $db_num  == 1) // & & !$templ_ designbox1  )
175       {   174       {
176           $t empl = $te mpl_design box1;   175           $t empl = $te mpl_design box1;
177       }   176       }
178       else// if( !$temp l_designbo x0 )   177       else// if( !$temp l_designbo x0 )
179       {   178       {
180           $t empl = $te mpl_design box0;   179           $t empl = $te mpl_design box0;
181       }   180       }
182     181  
183       // rep lace path  to the ima ges   182       // rep lace path  to the ima ges
184       $s = $ site['imag es'];   183       $s = $ site['imag es'];
185       $s = s tr_replace  ( $site[' url'], "",  $site['im ages'] );   184       $s = s tr_replace  ( $site[' url'], "",  $site['im ages'] );
186       $templ  = str_rep lace ( $s,  $site['im ages'], $t empl );   185       $templ  = str_rep lace ( $s,  $site['im ages'], $t empl );
187     186  
188       // rep lace templ ate variab les   187       // rep lace templ ate variab les
189       $templ  = str_rep lace ( "__ title__",  $f($title) , $templ ) ;   188       $templ  = str_rep lace ( "__ title__",  $f($title) , $templ ) ;
190       $templ  = str_rep lace ( "__ caption_it em__", $ca ption_item , $templ ) ;   189       $templ  = str_rep lace ( "__ caption_it em__", $ca ption_item , $templ ) ;
191       $templ  = str_rep lace ( "__ designbox_ content__" , $content , $templ ) ;   190       $templ  = str_rep lace ( "__ designbox_ content__" , $content , $templ ) ;
192       $templ  = str_rep lace ( "__ images__",  $site['im ages'], $t empl );   191       $templ  = str_rep lace ( "__ images__",  $site['im ages'], $t empl );
193       if ( f unction_ex ists( 'col ors_select ' ) )   192       if ( f unction_ex ists( 'col ors_select ' ) )
194           $t empl = str _replace (  "__design BoxColor__ ", colors_ select(),  $templ );   193           $t empl = str _replace (  "__design BoxColor__ ", colors_ select(),  $templ );
195     194  
196       if ($t mpl == 'ac t')   195       if ($t mpl == 'ac t')
197       {   196       {
198           if  ($index_d b_color_ra ndomize ==  1)   197           if  ($index_d b_color_ra ndomize ==  1)
199           {   198           {
200                $templ =  str_repla ce ( "__db _color__",  get_activ e_color(),  $templ );   199                $templ =  str_repla ce ( "__db _color__",  get_activ e_color(),  $templ );
201           }   200           }
202           el se   201           el se
203           {   202           {
204                 $templ  = str_repl ace ( "__d b_color__" , $index_d b_color, $ templ );   203                 $templ  = str_repl ace ( "__d b_color__" , $index_d b_color, $ templ );
205           }   204           }
206       }   205       }
207     206  
208       return   $templ;   207       return   $templ;
209   }   208   }
210     209  
211     210  
212   /**   211   /**
213    * Put "de sign box"  with borde r HTML cod e   212    * Put "de sign box"  with borde r HTML cod e
214    *  $title         -  title text   213    *  $title         -  title text
215    *  $width         -  width in p ixels   214    *  $width         -  width in p ixels
216    *  $heigh t       -  height in  pixels   215    *  $heigh t       -  height in  pixels
217    *  $align         -  align or o ther <td>  formatter   216    *  $align         -  align or o ther <td>  formatter
218    *                    for exampl e: "align= center"   217    *                    for exampl e: "align= center"
219    **/   218    **/
220   function D esignBoxCo ntentBorde r ( $title , $content , $caption _item='' )   219   function D esignBoxCo ntentBorde r ( $title , $content , $caption _item='' )
221   {   220   {
222       global  $site;   221       global  $site;
223       global  $dir;   222       global  $dir;
224       global  $tmpl;   223       global  $tmpl;
225       global  $service_ db_color;   224       global  $service_ db_color;
226     225  
227       global  $dbh_lett ers;   226       global  $dbh_lett ers;
228     227  
229       switch  ($dbh_let ters)   228       switch  ($dbh_let ters)
230       {   229       {
231           ca se "upper" : $f_case  = "strtoup per"; brea k;   230           ca se "upper" : $f_case  = "strtoup per"; brea k;
232           ca se "lower" : $f_case  = "strtolo wer"; brea k;   231           ca se "lower" : $f_case  = "strtolo wer"; brea k;
233           ca se "fupper ": $f_case  = "ucfirs t"; break;   232           ca se "fupper ": $f_case  = "ucfirs t"; break;
234           ca se "aupper ": $f_case  = "ucword s"; break;   233           ca se "aupper ": $f_case  = "ucword s"; break;
235           de fault: $f_ case = "sp rintf";   234           de fault: $f_ case = "sp rintf";
236       }   235       }
237     236  
238       // des ign box wi th border:  reading t emplate   237       // des ign box wi th border:  reading t emplate
239       $fs =  filesize (  "{$dir['r oot']}temp lates/tmpl _{$tmpl}/d esignbox_b order.html " );   238       $fs =  filesize (  "{$dir['r oot']}temp lates/tmpl _{$tmpl}/d esignbox_b order.html " );
240       $f = f open ( "{$ dir['root' ]}template s/tmpl_{$t mpl}/desig nbox_borde r.html", " r" );   239       $f = f open ( "{$ dir['root' ]}template s/tmpl_{$t mpl}/desig nbox_borde r.html", " r" );
241       $templ _designbox _border =  fread ( $f , $fs );   240       $templ _designbox _border =  fread ( $f , $fs );
242       fclose  ( $f );   241       fclose  ( $f );
243     242  
244     243  
245       $templ  = $templ_ designbox_ border;   244       $templ  = $templ_ designbox_ border;
246     245  
247       // rep lace templ ate variab les   246       // rep lace templ ate variab les
248       $templ  = str_rep lace ( "__ title__",  $f_case($t itle), $te mpl );   247       $templ  = str_rep lace ( "__ title__",  $f_case($t itle), $te mpl );
249       $templ  = str_rep lace ( "__ caption_it em__", $ca ption_item , $templ ) ;   248       $templ  = str_rep lace ( "__ caption_it em__", $ca ption_item , $templ ) ;
250       $templ  = str_rep lace ( "__ designbox_ content__" , $content , $templ ) ;   249       $templ  = str_rep lace ( "__ designbox_ content__" , $content , $templ ) ;
251     250  
252       return   $templ;   251       return   $templ;
253   }   252   }
254     253  
255     254  
256   /**   255   // array o f top and  bottom lin ks
257    * members  statistic  block   256   $aMainLink s = array(
258    */   257       'Home'          = > array( ' href' => ' index.php' ,        ' Title' =>  '_Home' ),
259   function P ageCompMem berStatN(  $w, $h)   258       'About '        = > array( ' href' => ' about_us.p hp',     ' Title' =>  '_About Us ' ),
260   {   259       'Priva cy'      = > array( ' href' => ' privacy.ph p',      ' Title' =>  '_Privacy'  ),
261           gl obal $site ;   260       'Terms ofuse'   = > array( ' href' => ' terms_of_u se.php', ' Title' =>  '_Terms_of _use' ),
262           gl obal $prof ;   261       'Servi ces'     = > array( ' href' => ' services.p hp',     ' Title' =>  '_Services ' ),
263           gl obal $tmpl ;   262       'FAQ'           = > array( ' href' => ' faq.php',           ' Title' =>  '_FAQ' ),
264     263       'Artic les'     = > array( ' href' => ' articles.p hp',     ' Title' =>  '_Articles ' ),
265     264       'Stori es'      = > array( ' href' => ' stories.ph p',      ' Title' =>  '_Stories2 ' ),
266           $f ree_mode =  getParam( "free_mode ") == "on"  ? 1 : 0;   265       'Links '        = > array( ' href' => ' links.php' ,        ' Title' =>  '_Links' ) ,
267     266       'News'          = > array( ' href' => ' news.php',          ' Title' =>  '_News' ),
268   // members  statistic s   267       'Aff'           = > array( ' href' => ' affiliates .php',   ' Title' =>  '_Affiliat es',       'Check' =>  'return (  getParam( "enable_af f") == "on " );' ),
269     268       'Invit efriend' = > array( ' href' => ' tellfriend .php',   ' Title' =>  '_Invite a  friend',  'onclick'  => 'return  launchTel lFriend(); ' ),
270       $total _c = strle n( $_POST[ 'total_c']  ) ? $_POS T['total_c '] : getPa ram( "defa ult_countr y" );   269       'Conta cts'     = > array( ' href' => ' contact.ph p',      ' Title' =>  '_Contacts ' ),
271       $total _c2 = strl en( $_POST ['total_c2 '] ) ? $_P OST['total _c2'] : ge tParam( "d efault_cou ntry" );   270       'Brows e'       = > array( ' href' => ' browse.php ',       ' Title' =>  '_Browse P rofiles' ) ,
272       $total _arr = db_ arr( "SELE CT COUNT(I D) FROM `P rofiles` W HERE Statu s = 'Activ e'" );   271       'Feedb ack'     = > array( ' href' => ' story.php' ,        ' Title' =>  '_Add stor y' ),
273       $total _arr_week  = db_arr(  "SELECT CO UNT(ID) FR OM `Profil es` WHERE  Status = ' Active' AN D (TO_DAYS (NOW()) -  TO_DAYS(La stReg)) <=  7" );   272       'Conta ctUs'    = > array( ' href' => ' contact.ph p',      ' Title' =>  '_contact_ us' ),
274       $total _arr_gold  = db_arr(  "SELECT    COUNT(DIST INCT IDMem ber)   273       'Bookm ark'     = > array( ' href' => ' #',                 ' Title' =>  '_Bookmark ',         'onclick'  => 'addBoo kmark(); r eturn fals e;' ),
275                                          FROM     Profil eMemLevels   274   );
276                                          INNE R JOIN Pro files ON P rofiles.ID  = Profile MemLevels. IDMember    
277                                           WHERE    
278                                               (DateExpir es IS NULL  OR DateEx pires > NO W()) AND    
279                                               (DateStart s IS NULL  OR DateSta rts <= NOW ()) AND    
280                                               (Profiles. Status = ' Active')"  );    
281           $t otal_c_arr  = db_arr(  "SELECT C OUNT(ID) F ROM `Profi les` WHERE  Status =  'Active' A ND `Countr y` = '". p rocess_db_ input($tot al_c) ."'"  );    
282           $t otal_membe rs = $tota l_arr[0];    
283           $t otal_c_mem bers = $to tal_c_arr[ 0];    
284      
285           $t otal_c_mem bers_onl =  get_users _online_nu mber('c',  $total_c2  );    
286           $t otal_arr_c hatting =  get_users_ online_num ber('t');    
287           $m embers_onl ine = get_ users_onli ne_number( );    
288      
289           $c _arr = $pr of[countri es];    
290     275  
291           $o ut = "";    
292           $o ut .= '<ta ble cellpa dding="0"  cellspacin g="0" bord er="0" ali gn="center " width="1 50"><tr><t d>';    
293       $out . = "<table  cellpaddin g=1 cellsp acing=1 cl ass=text b order=0 al ign=center >";    
294       $out . = "<tr><td  width=17> <img src=$ site[image s]group1.g if></td><t d width=10 0%><b>&nbs p;"._t("_C urrently O nline")."< /b></td></ tr>\n";    
295       $out . = "<tr><td  height=5  class=memb _stat cols pan=2><img  src=$site [images]sp acer.gif w idth=6 hei ght=1></td ></tr>\n";    
296           $o ut .= "<tr ><td width =17 align= 'right'><i mg src='$s ite[images ]us2.gif'> </td><td w idth=100%  align=\"le ft\">&nbsp ;"._t("_To tal")." -   $members_ online</td ></tr>\n";    
297       $out . = "<tr><td  width=17  align='rig ht'><img s rc='$site[ images]us3 .gif'></td ><td width =100% alig n=\"left\" >&nbsp;"._ t("_Chatti ng")." - $ total_arr_ chatting < /td></tr>\ n";    
298       $out . = "<tr><td  width=17  align='rig ht'><img s rc='$site[ images]us4 .gif'></td ><td width =100% alig n=\"left\" >&nbsp;$to tal_c_memb ers_onl ". _t("_membe rs")." "._ t("_from") .":</td></ tr>\n";    
299       $out . = '<form a ction="'.$ _SERVER[PH P_SELF].'"  method="p ost" name= "cForm2">< tr><td ali gn=right c olspan=2>' ;    
300       $out . = "<input  type=hidde n name=tot al_c value =$total_c> ";    
301       $out . = '<select  class=ind ex name=to tal_c2 onC hange="jav ascript: d ocument.fo rms[\'cFor m2\'].subm it();">';    
302       foreac h ( $c_arr  as $key = > $value )    
303       {    
304                $out .=  "<option v alue=$key" ;    
305                if ( $ke y == $tota l_c2 )    
306                    $out  .= " sele cted";    
307                $out .=  '>'._t( '_ _'.$value  ).'</optio n>';    
308       }    
309       $out . = '</selec t>';    
310       $out . = '</td></ form></tr> ';    
311       $out . = "<tr><td  height=1  colspan=2> <img src=$ site[image s]spacer.g if width=1  height=1> </td></tr> \n";    
312       $out . = "</table >\n";    
313     276  
314     277  
315       $out . = "<br />" ;    
316     278  
317       $out . = "<table  cellpaddin g=1 cellsp acing=1 cl ass=text>" ;   279   /**
318       $out . = "<tr><td  height=2> <img src=$ site[image s]spacer.g if height= 2></td></t r>\n";   280    * Put top  code for  the page
319       $out . = "<tr><td  width=17> <img src=$ site[image s]group2.g if></td><t d width=10 0%><b>&nbs p;"._t("_T otal Regis tered")."< /b></td></ tr>\n";   281    **/
320       $out . = "<tr><td  height=1  class=memb _stat cols pan=2><img  src=$site [images]sp acer.gif w idth=1 hei ght=1></td ></tr>\n";   282   function P ageCode()  {
321       $out . = "<tr><td  width=17  align='rig ht'><img s rc=$site[i mages]us6. gif></td>< td width=1 00% align= \"left\">& nbsp;"._t( "_Total"). " - $total _arr[0]</t d></tr>\n" ;   283       global  $dir;
    284       global  $site;
    285       global  $_page;
    286       global  $tmpl;
    287       global  $_page_co nt;
    288       global  $oTemplCo nfig;
    289       global  $echo;
322     290  
323           if  ( !$free_ mode )   291       /**
324       $out . = "<tr><td  width=17  align='rig ht'><img s rc=$site[i mages]us4. gif></td>< td width=1 00% align= \"left\">& nbsp;"._t( "_Gold Mem bers")." -  $total_ar r_gold[0]  </td></tr> \n";   292        * cal lback func tion for i ncluding t emplate fi les
    293        */
    294       functi on TmplInc lude($m) {
    295           gl obal $dir;
    296           gl obal $tmpl ;
325     297           
326       $out . = "<tr><td  width=17  align='rig ht'><img s rc=$site[i mages]us7. gif></td>< td width=1 00% align= \"left\">& nbsp;"._t( "_New this  week")."  - $total_a rr_week[0]  </td></tr >\n";   298           re turn @file _get_conte nts( "{$di r['root']} templates/ tmpl_$tmpl /{$m[1]}"  );
327       $out . = "<tr><td  width=17  align='rig ht'><img s rc=$site[i mages]us1. gif></td>< td width=1 00% align= \"left\">& nbsp;$tota l_c_member s "._t("_m embers")."  "._t("_fr om").":</t d></tr>\n" ;    
328       if ($t mpl == 'g4 ') $out .=  "<tr><td> <img src=\ "" . $site [images] .  "spacer.g if\" heigh t=\"5\"></ td></tr>";    
329       $out . = '<form a ction="'.$ _SERVER[PH P_SELF].'"  method="p ost" name= "cForm"><t r><td alig n=right co lspan=2>';    
330       $out . = "<input  type=hidde n name=tot al_c2 valu e=$total_c 2>";    
331       $out . = '<select  class=ind ex name=to tal_c onCh ange="java script: do cument.for ms[\'cForm \'].submit ();">';    
332       foreac h ( $c_arr  as $key = > $value )    
333       {    
334                $out .=  "<option v alue=$key" ;    
335                if ( $ke y == $tota l_c )    
336                    $out  .= " sele cted";    
337                             $out . = '>'._t(  '__'.$valu e ).'</opt ion>';    
338       }   299       }
339       $out . = '</selec t>';    
340       $out . = '</td></ form></tr> ';    
341       $out . = "<tr><td  height=1  colspan=2> <img src=$ site[image s]spacer.g if width=1  height=1> </td></tr> \n";    
342       $out . = '</table >';    
343       $out . = '</td></ tr></table >';    
344      
345       return  DesignBox Content (  _t("_membe rs"), $w,  $out, $h ) ;    
346     300       
    301       functi on TmplInc ludeBase($ m) {
    302           gl obal $dir;
347     303           
    304           re turn @file _get_conte nts( "{$di r['root']} templates/ base/{$m[1 ]}" );
348   }   305       }
349     306       
350   /**   307       functi on TmplKey sReplace($ m) {
351    * Put top  code for  the page    
352    **/    
353   function P ageCode( $ admintmpl= 0 )    
354   {    
355       global  $dir;    
356       global  $site;   308           gl obal $site ;
357        global   $ _page ;   309            global   $ dir ;
358       global  $_page_co mp;    
359       global  $logged;   310           gl obal $logg ed;
360        global   $ l a n g HTML C h a rs e t ;   311            global   $
a Pa g eCont C
a ch e
;
361       global  $tmpl;    
362       global  $ADMIN;    
363       global  $tmi_lett ers;    
364       global  $dbh_lett ers;    
365       global  $max_thum b_height;    
366       global  $max_thum b_width;    
367       global  $_page_co nt;   312           gl obal $_pag e_cont;
    313           gl obal $oTem plConfig;
    314           gl obal $_pag e;
    315           gl obal $oTem plConfig;
    316           
    317           if ( !isset($ aPageContC ache) )
    318                $aPageCo ntCache =  array();
    319           
    320           // if already  generated  it, retur n it.
    321           if ( isset( $ aPageContC ache[ $m[1 ] ] ) )
    322                return $ aPageContC ache[ $m[1 ] ];
    323           
    324           // if it alre ady exists , return i t
    325           if ( isset( $ _page_cont [0] ) and  array_key_ exists( $m [1], $_pag e_cont[0]  ) )
    326                return $ _page_cont [0][ $m[1]  ];
368     327           
369       $ni =  $_page['na me_index'] ;   328           $n i = $_page ['name_ind ex'];
370       global  $oTemplCo nfig;    
371       $oTemp lMenu = ne w BxTemplM enu( $oTem plConfig ) ;    
372     329           
373       $free_ mode = get Param("fre e_mode") = = "on" ? 1  : 0;   330           // if page ge nerated it , return i t
    331           if ( $ni and  isset( $_p age_cont[$ ni] ) and  array_key_ exists( $m [1], $_pag e_cont[$ni ] ) )
    332                return $ _page_cont [$ni][ $m[ 1] ];
374     333           
375       // rea ding templ ates   334           // echoDbg( $ m );
376       if(!$a dmintmpl)    
377       {    
378           $f n = "{$dir ['root']}t emplates/t mpl_{$tmpl }/page_{$n i}.html";    
379           if  ( !file_e xists($fn)  )    
380                $fn = "{ $dir['root ']}templat es/tmpl_{$ tmpl}/defa ult.html";    
381       }    
382       else    
383           $f n = "{$dir ['root']}a dmin/tmpl_ admin.html ";    
384     335           
385       $templ  = file_ge t_contents ( $fn );   336           $s Ret = '';
386     337           
387       // pro cess inclu des (multi -level)   338           //  now switc h what we  have
388       do   339           sw itch( $m[1 ] ) {
389       {   340                case 'pa ge_charset ':      $s Ret = 'UTF -8'; break ; // it wi ll be remo ved soon
390           $t empl1 = $t empl;    
391           $t empl = pre g_replace_ callback(  "/__includ e (.*)__/" , "TmplInc lude", $te mpl1 );    
392           $t empl = pre g_replace_ callback ( "/__includ ebase (.*) __/", "Tmp lIncludeBa se", $temp l);    
393       } whil e( $templ1  != $templ  );    
394          341                
    342                case 'si te_url':           $s Ret = $sit e['url'];      break;
    343                case 'pl ugins':            $s Ret = $sit e['plugins ']; break;
    344                case 'im ages':             $s Ret = $sit e['images' ];  break;
    345                case 'cs s_dir':            $s Ret = $sit e['css_dir ']; break;
    346                case 'ic ons':              $s Ret = $sit e['icons'] ;   break;
    347                case 'zo diac':             $s Ret = $sit e['zodiac' ];  break;
395          348                
396       //inse rt to your  template  page key:     __t: la ng_key__      and you  will get  translated  string   349                case 'sw itch_lang_ block': $s Ret = getL angSwitche r(); break ;
397       $templ  = preg_re place_call back(   350                case 'ma in_logo':          $s Ret = getM ainLogo();  break;
398           "/ __t: (_.+) __/",    351                case 'he llo_member ':      $s Ret = Hell oMemberSec tion(); br eak;
399           cr eate_funct ion(    
400                '$matche s',    
401                'return  _t($matche s[1]);'    
402                ),    
403           $t empl );    
404     352                
405       PageSt aticCompon ents();   353                case 'th umb_width' :       $s Ret = getP aram('max_ thumb_widt h');  brea k;
    354                case 'th umb_height ':      $s Ret = getP aram('max_ thumb_heig ht'); brea k;
    355                case 'ma in_div_wid th':    $s Ret = getP aram('main _div_width '); break;
    356                case 'sw itch_skin_ block': $s Ret = getP aram("enab le_templat e") ? temp lates_sele ct_txt() :  ''; break ;
406     357                
407       // lan g block   358                case 'me ta_keyword s':     $s Ret = proc ess_line_o utput( get Param("Met aKeyWords" ) ); break ;
408       if ( ( int)getPar am('lang_e nable')  )   359                case 'me ta_descrip tion':  $s Ret = proc ess_line_o utput( get Param("Met aDescripti on") ); br eak;
409       {    
410           ob _start();    
411           la ng_select_ txt();    
412           $_ page_cont[ 0]['switch _lang_bloc k'] = ob_g et_clean() ;    
413       }    
414       else    
415           $_ page_cont[ 0]['switch _lang_bloc k'] = '';    
416          360                
417       // cha rset   361                case 'to p_menu':
418       $_page _cont[0][' page_chars et'] = $la ngHTMLChar set;   362                    $oMe nu = new B xTemplMenu ();
    363                    $sRe t = $oMenu  -> getCod e();
    364                break;
419     365                
    366                case 'ex tra_js':          $sR et = $_pag e['extra_j s']; break ;
    367                case 'ex tra_css':         $sR et = $_pag e['extra_c ss']; brea k;
    368                case 'pa ge_header' :      $sR et = $_pag e['header' ]; break;
    369                case 'pa ge_header_ text': $sR et = $_pag e['header_ text']; br eak;
420     370                
421       //chan ge templat es   371                case 'ba nner_top':        $sR et = banne r_put_nv(1 ); break;
422       if ( ' on' == get Param("ena ble_templa te"))   372                case 'ba nner_left' :      $sR et = banne r_put_nv(2 ); break;
423           $_ page_cont[ 0]['switch _skin_bloc k'] = temp lates_sele ct_txt();   373                case 'ba nner_right ':     $sR et = banne r_put_nv(3 ); break;
424        else   374                case 'ba nner_botto m':    $sR et = banne r_put_nv(4 ); break;
425           $_ page_cont[ 0]['switch _skin_bloc k'] = '';   375  
             
    376                case 'bo ttom_text' :      $sR et = _t( ' _bottom_te xt', date( 'Y') ); br eak;
    377                case 'co pyright':         $sR et = _t( ' _copyright ',   date( 'Y') ) . g etVersionC omment();  break;
    378                // pleas e do not d elete vers ion for de bug possib ilities
426     379                
427       //Path  to css   380                //Path t o css
428        if(   strlen(   $_page['cs s_name']   )   >   0   )
  381                case 'st yles':
429       {   382                     if(   strlen(   $_page['cs s_name']   )  
)   {
430            $ f ile name   =   $dir['root ']   .   $site['css _dir']   .   $_page['cs s_name'];   383                         $ sF ile  
=   $dir['root ']   .   $site['css _dir']   .   $_page['cs s_name'];
431            if   (   file_exist s(   $ f ile name   )   &&   is_file(   $ f ile name   )   )   384                         if(   file_exist s(   $ sF ile  
)   &&   is_file(   $ sF ile  
)   )
432                 $_page_con t[0]['styl es']   =   ' <link   href="'   .   $site['
css_dir']   .   $_page['cs s_name']   .   '"   rel="style sheet"   type="text /css"   />';
  385                             $sRet  = '
433           el se   386                                 
<link   href="'   .   $site[' url']   .   $site[' css_dir']   .   $_page['cs s_name']   .   '"   rel="style sheet"   type="text /css"   />';
434                $_page_c ont[0]['st yles'] = ' ';    
435       }   387                    }
436       else   388                break;
437           $_ page_cont[ 0]['styles '] = '';    
438          389                
439       //Path  to js   390                //Path t o js
440        if(   strlen(   $_page['js _name']   )   >   0   )
  391                case 'ja va_script' :
441       {   392                     if(   strlen(   $_page['js _name']   )  
)   {
442            $ f ile name   =   $dir['root ']   .   'inc/js/'   .   $_page['js _name'];   393                         $ sF ile  
=   $dir['root ']   .   'inc/js/'   .   $_page['js _name'];
443            if   (   file_exist s(   $ f ile name   )   &&   is_file(   $ f ile name   )   )
  394                         if(   file_exist s(   $ sF ile  
)   &&   is_file(   $ sF ile  
)   )   {
444           {    
445                $langDel ete = _t(' _delete');   395                             $langD elete = _t ('_delete' );
446                $langLoa ding = _t( '_loading  ...');   396                             $langL oading = _ t('_loadin g ...');
447                $langDel eteMessage  = _t('_po ll success fully dele ted');   397                             $langD eleteMessa ge = _t('_ poll succe ssfully de leted');
448                $langMak eIt = _t(' _make it') ;   398                             $langM akeIt = _t ('_make it ');
449                $lang_yo u_should_s pecify_mem ber = _t(' _You shoul d specify  at least o ne member' );   399                             $lang_ you_should _specify_m ember = _t ('_You sho uld specif y at least  one membe r');
450                   400                             
451                if ( $si te['js_ini t'] )   401                             if( $s ite['js_in it'] )
452                     $ _page_cont [0]['java_ s crip t ']   =   $site['js_ init'];   402                                  $
s Re t  
=   $site['js_ init'];
453                   403                             
454                $_page_c ont[0]['ja va_script' ] .= <<<EO J   404                             $sRet  .= <<<EOJ
455   <script ty pe="text/j avascript"  language= "javascrip t">   405       <scrip t type="te xt/javascr ipt" langu age="javas cript">
456       var si te_url = ' {$site['ur l']}';   406                         var site_u rl = '{$si te['url']} ';
457       var la ng_delete  = '{$langD elete}';   407                         var lang_d elete = '{ $langDelet e}';
458       var la ng_loading  = '{$lang Loading}';   408                         var lang_l oading = ' {$langLoad ing}';
459       var la ng_delete_ message =  '{$langDel eteMessage }';   409                         var lang_d elete_mess age = '{$l angDeleteM essage}';
460       var la ng_make_it  = '{$lang MakeIt}';   410                         var lang_m ake_it = ' {$langMake It}';
461       var la ng_you_sho uld_specif y_member =  '{$lang_y ou_should_ specify_me mber}';   411                         var lang_y ou_should_ specify_me mber = '{$ lang_you_s hould_spec ify_member }';
462          412                        
463       var iQ SearchWind owWidth  =  {$oTemplC onfig->iQS earchWindo wWidth};   413                         var iQSear chWindowWi dth  = {$o TemplConfi g->iQSearc hWindowWid th};
464       var iQ SearchWind owHeight =  {$oTemplC onfig->iQS earchWindo wHeight};   414                         var iQSear chWindowHe ight = {$o TemplConfi g->iQSearc hWindowHei ght};
465   </script>   415       </scri pt>
466   <script sr c="{$site[ 'url']}inc /js/{$_pag e['js_name ']}" type= "text/java script" la nguage="ja vascript"> </script>   416       <scrip t src="{$s ite['url'] }inc/js/{$ _page['js_ name']}" t ype="text/ javascript " language ="javascri pt"></scri pt>
467   EOJ;   417   EOJ;
468           }   418                         }
469           el se    
470                $_page_c ont[0]['ja va_script' ] = '';    
471       }    
472       else    
473           $_ page_cont[ 0]['java_s cript'] =  '';    
474      
475      
476       $_page _cont[0][' css_dir']  = $site['c ss_dir'];    
477       $_page _cont[0][' plugins']  = $site['p lugins'];    
478      
479       $_page _cont[0][' thumb_widt h']  = $ma x_thumb_wi dth;    
480       $_page _cont[0][' thumb_heig ht'] = $ma x_thumb_he ight;    
481      
482       $_page _cont[0][' site_url']      = $si te['url'];    
483       $_page _cont[0][' images']        = $si te['images '];    
484       $_page _cont[0][' icons']         = $si te['icons' ];    
485       $_page _cont[0][' zodiac']        = $si te['zodiac '];    
486      
487       $_page _cont[0][' bottom_tex t']  = _t(  "_bottom_ text", dat e("Y") );    
488       $_page _cont[0][' copyright' ]    = _t(  "_copyrig ht", date( "Y") ) . g etVersionC omment();  // please  do not del ete versio n for debu g possibil ities    
489       $_page _cont[0][' powered']       = get Param( 'en able_boone x_footers'  ) ? _t( " _powered_b y_Dolphin"  ) : '';    
490      
491       $_page _cont[0][' main_logo' ]    = get MainLogo() ;    
492      
493       //plac e meta dat a on site  pages    
494       $_page _cont[0][' meta_keywo rds']    =  process_l ine_output ( getParam ("MetaKeyW ords") );    
495       $_page _cont[0][' meta_descr iption'] =  process_l ine_output ( getParam ("MetaDesc ription")  );    
496      
497       if( st rlen( $_pa ge['extra_ js'] ) )    
498           $_ page_cont[ 0]['extra_ js'] = $_p age['extra _js'];    
499       else    
500           $_ page_cont[ 0]['extra_ js'] = '';    
501      
502       if( st rlen( $_pa ge['extra_ css'] ) )    
503           $_ page_cont[ 0]['extra_ css'] = $_ page['extr a_css'];    
504       else    
505           $_ page_cont[ 0]['extra_ css'] = '' ;    
506           
507           
508       // top  menu item s    
509       $_page _cont[0][' top_menu']      = $oT emplMenu - > getTopMe nu();    
510       $_page _cont[0][' hidden_men u']  = get AllMenus() ;    
511       $_page _cont[0][' custom_men u']  = $oT emplMenu - > getCusto mMenu();    
512      
513      
514       // top est menu i tems    
515       {    
516           $_ page_cont[ 0]['TOP_Ho me']           = '<a  class="men u_item_lin k" href="'  . $site[' url'] . 'i ndex.php"> ' . _t("_H ome") . '< /a>';    
517           $_ page_cont[ 0]['BMI_Ho me']           = '<a  class="bot tommenu"      href="'  . $site[' url'] . 'i ndex.php"> ' . _t("_H ome") . '< /a>';    
518               
519           $_ page_cont[ 0]['TOP_Ab out']          = '<a  class="men u_item_lin k" href="'  . $site[' url'] . 'a bout_us.ph p">' . _t( "_About Us ") . '</a> ';    
520           $_ page_cont[ 0]['BMI_Ab out']          = '<a  class="bot tommenu"      href="'  . $site[' url'] . 'a bout_us.ph p">' . _t( "_About Us ") . '</a> ';    
521               
522           $_ page_cont[ 0]['TOP_Pr ivacy']        = '<a  class="men u_item_lin k" href="'  . $site[' url'] . 'p rivacy.php ">' . _t(" _Privacy")  . '</a>';    
523           $_ page_cont[ 0]['BMI_Pr ivacy']        = '<a  class="bot tommenu"      href="'  . $site[' url'] . 'p rivacy.php ">' . _t(" _Privacy")  . '</a>';    
524               
525           $_ page_cont[ 0]['TOP_Te rmsofuse']     = '<a  class="men u_item_lin k" href="'  . $site[' url'] . 't erms_of_us e.php">' .  _t("_Term s_of_use")  . '</a>';    
526           $_ page_cont[ 0]['BMI_Te rmsofuse']     = '<a  class="bot tommenu"      href="'  . $site[' url'] . 't erms_of_us e.php">' .  _t("_Term s_of_use")  . '</a>';    
527               
528           $_ page_cont[ 0]['TOP_Se rvices']       = '<a  class="men u_item_lin k" href="'  . $site[' url'] . 's ervices.ph p">' . _t( "_Services ") . '</a> ';    
529           $_ page_cont[ 0]['BMI_Se rvices']       = '<a  class="bot tommenu"      href="'  . $site[' url'] . 's ervices.ph p">' . _t( "_Services ") . '</a> ';    
530               
531           $_ page_cont[ 0]['TOP_FA Q']            = '<a  class="men u_item_lin k" href="'  . $site[' url'] . 'f aq.php">'  . _t("_FAQ ") . '</a> ';    
532           $_ page_cont[ 0]['BMI_FA Q']            = '<a  class="bot tommenu"      href="'  . $site[' url'] . 'f aq.php">'  . _t("_FAQ ") . '</a> ';    
533               
534           $_ page_cont[ 0]['TOP_Ar ticles']       = '<a  class="men u_item_lin k" href="'  . $site[' url'] . 'a rticles.ph p">' . _t( "_Articles ") . '</a> ';    
535           $_ page_cont[ 0]['BMI_Ar ticles']       = '<a  class="bot tommenu"      href="'  . $site[' url'] . 'a rticles.ph p">' . _t( "_Articles ") . '</a> ';    
536               
537           $_ page_cont[ 0]['TOP_St ories']        = '<a  class="men u_item_lin k" href="'  . $site[' url'] . 's tories.php ">' . _t(" _Stories2" ) . '</a>' ;    
538           $_ page_cont[ 0]['BMI_St ories']        = '<a  class="bot tommenu"      href="'  . $site[' url'] . 's tories.php ">' . _t(" _Stories2" ) . '</a>' ;    
539               
540           $_ page_cont[ 0]['TOP_Li nks']          = '<a  class="men u_item_lin k" href="'  . $site[' url'] . 'l inks.php"> ' . _t("_L inks") . ' </a>';    
541           $_ page_cont[ 0]['BMI_Li nks']          = '<a  class="bot tommenu"      href="'  . $site[' url'] . 'l inks.php"> ' . _t("_L inks") . ' </a>';    
542               
543           $_ page_cont[ 0]['TOP_Ne ws']           = '<a  class="men u_item_lin k" href="'  . $site[' url'] . 'n ews.php">'  . _t("_Ne ws") . '</ a>';    
544           $_ page_cont[ 0]['BMI_Ne ws']           = '<a  class="bot tommenu"      href="'  . $site[' url'] . 'n ews.php">'  . _t("_Ne ws") . '</ a>';    
545               
546           $_ page_cont[ 0]['TOP_Af f']            = getP aram("enab le_aff") = = 'on' ? ' <a class=" menu_item_ link" href ="' . $sit e['url'] .  'affiliat es.php">'  . _t("_Aff iliates")  . '</a>' :  '';    
547           $_ page_cont[ 0]['BMI_Af f']            = getP aram("enab le_aff") = = 'on' ? ' <a class=" bottommenu "     href ="' . $sit e['url'] .  'affiliat es.php">'  . _t("_Aff iliates")  . '</a>' :  '';    
548               
549           $_ page_cont[ 0]['TOP_In vitefriend ']  = '<a  class="men u_item_lin k" href="j avascript: void(0);"  onclick="r eturn laun chTellFrie nd();">' .  _t("_Invi te a frien d") . '</a >';    
550           $_ page_cont[ 0]['BMI_In vitefriend ']  = '<a  class="bot tommenu"      href="j avascript: void(0);"  onclick="r eturn laun chTellFrie nd();">' .  _t("_Invi te a frien d") . '</a >';    
551               
552           $_ page_cont[ 0]['TOP_Co ntacts']       = '<a  class="men u_item_lin k" href="'  . $site[' url'] . 'c ontact.php ">' . _t(" _Contacts" ) . '</a>' ;    
553           $_ page_cont[ 0]['BMI_Co ntacts']       = '<a  class="bot tommenu"      href="'  . $site[' url'] . 'c ontact.php ">' . _t(" _Contacts" ) . '</a>' ;    
554               
555           $_ page_cont[ 0]['TOP_Br owse']         = '<a  class="men u_item_lin k" href="'  . $site[' url'] . 'b rowse.php" >' . _t("_ Browse Pro files") .  '</a>';    
556           $_ page_cont[ 0]['BMI_Br owse']         = '<a  class="bot tommenu"      href="'  . $site[' url'] . 'b rowse.php" >' . _t("_ Browse Pro files") .  '</a>';    
557               
558           $_ page_cont[ 0]['TOP_Fe edback']       = '<a  class="men u_item_lin k" href="'  . $site[' url'] . 's tory.php"> ' . _t("_A dd story")  . '</a>';    
559           $_ page_cont[ 0]['BMI_Fe edback']       = '<a  class="bot tommenu"      href="'  . $site[' url'] . 's tory.php"> ' . _t("_A dd story")  . '</a>';    
560               
561           $_ page_cont[ 0]['TOP_Co ntactUs']      = '<a  class="men u_item_lin k" href="'  . $site[' url'] . 'c ontact.php ">' . _t(" _contact_u s") . '</a >';    
562           $_ page_cont[ 0]['BMI_Co ntactUs']      = '<a  class="bot tommenu"      href="'  . $site[' url'] . 'c ontact.php ">' . _t(" _contact_u s") . '</a >';    
563               
564           $_ page_cont[ 0]['TOP_Bo okmark']       = '<a  class="men u_item_lin k" href="j avascript: void(0);"  onclick="a ddBookmark ();">' . _ t("_Bookma rk") . '</ a>';    
565           $_ page_cont[ 0]['BMI_Bo okmark']       = '<a  class="bot tommenu"      href="j avascript: void(0);"  onclick="a ddBookmark ();">' . _ t("_Bookma rk") . '</ a>';    
566       }    
567      
568       // bot tom menu i tems    
569       {    
570       }   419                    }
    420                break;
571     421                
572       $_page _cont[0][' hello_memb er'] = Hel loMemberSe ction();    
573           
574       // mem ber/visito r menu    
575       if ( $ logged['ad min'] )    
576           $_ page_cont[ 0]['menu_r ight'] = $ oTemplMenu  -> logged AdminMenu( );    
577       elseif  ( $logged ['aff'] )    
578           $_ page_cont[ 0]['menu_r ight'] = $ oTemplMenu  -> logged AffMenu();    
579       elseif  ( $logged ['moderato r'] )    
580           $_ page_cont[ 0]['menu_r ight'] = $ oTemplMenu  -> logged ModeratorM enu();    
581       elseif  ( $logged ['member']  )    
582           $_ page_cont[ 0]['menu_r ight'] = $ oTemplMenu  -> logged MemberMenu ();    
583       else    
584           $_ page_cont[ 0]['menu_r ight'] = $ oTemplMenu  -> visito rMenu();    
585           
586       /*if (  !strlen($ _page_cont [$ni]['act ions_menu' ]) )    
587           $_ page_cont[ 0]['action s_menu'] =  $oTemplMe nu -> acti onsMenu(); */    
588          422                
589       if ( ! strlen($_p age_cont[$ ni]['add_t o_header'] ) )   423           // --- Ray IM  Integrati on ---//
590           $_ page_cont[ 0]['add_to _header']  = '';    
591     424                
592       $check _res = che ckAction(  (int)$_COO KIE['membe rID'], ACT ION_ID_USE _IM );   425                case 'ra y_invite_j s': $sRet  = getRayIn tegrationJ S(); break ;
593       $enabl e_im = get Param("ena ble_im");    
594     426                    
    427                case 'ra y_invite_s wf':
    428                    if(  $logged['m ember'] )  {
    429                         $iId         = (int)$ _COOKIE['m emberID'];
    430                         $sPassword   = getPas sword($iId );
    431                         $bEnableRa y = getPar am( 'enabl e_ray' );
    432                         $aCheckRes   = checkA ction($iId , ACTION_I D_USE_RAY_ IM);
595     433                        
596        if   (   $ e nable _im   &&   $ c heck _r es[CHECK_A CTION_RESU LT]   ==   CHECK_ACTI ON_RESULT_ ALLOWED   &&   !$ADMIN   )   434                         if($ bE nable Ray   &&   $ aC heck R es[CHECK_A CTION_RESU LT]   ==   CHECK_ACTI ON_RESULT_ ALLOWED
)
597       {   435                             $sRet  = getAppli cationCont ent( 'im',  'invite',  array('id ' => $iId,  'password ' => $sPas sword), tr ue );
598           $_ page_cont[ 0]['IM_tit le'] = _t( "_IM title ");    
599           $_ page_cont[ 0]['IM'] =  RetIM();    
600       }    
601       else    
602       {    
603           $_ page_cont[ 0]['IM_tit le'] = "";    
604           $_ page_cont[ 0]['IM'] =  "";    
605       }   436                    }
606     437                break;
607       $enabl e_shoutBox  = ('on' = = getParam ("enable_s houtBox"))  ? 1 : 0;    
608       if( $e nable_shou tBox )    
609           $_ page_cont[ 0]['shout_ box'] = lo adShoutbox ();    
610       else    
611           $_ page_cont[ 0]['shout_ box'] = '' ;    
612           
613       $_page _cont[0][' top_page_h ead']  = g etTopPageH ead();    
614           
615       // pag e header    
616       $_page _cont[0][' page_heade r']        = $_page[' header'];    
617       $_page _cont[0][' page_heade r_text']   = $_page[' header_tex t'];    
618      
619           //  banner ro tation/shi fting syst em    
620           if  ( strstr( $templ, "_ _banner_to p__") )    
621                    $_pa ge_cont[0] ['banner_t op'] = ban ner_put_nv (1);    
622      
623           if  ( strstr( $templ, "_ _banner_le ft__") )    
624                    $_pa ge_cont[0] ['banner_l eft'] = ba nner_put_n v(2);    
625      
626           if  ( strstr( $templ, "_ _banner_ri ght__") )    
627                    $_pa ge_cont[0] ['banner_r ight'] = b anner_put_ nv(3);    
628      
629           if  ( strstr( $templ, "_ _banner_bo ttom__") )    
630                    $_pa ge_cont[0] ['banner_b ottom'] =  banner_put _nv(4);    
631      
632      
633           // end of ban ner rotati on/shiftin g system    
634      
635     438                
636       //---  Ray IM Int egration - --//   439           // --- Ray IM  Integrati on ---//
637       global  $sRayHome Dir;    
638     440                
639       $_page _cont[0][' ray_invite _js'] = "   441                default:
640           <s cript type =\"text/ja vascript\"  language= \"javascri pt\">   442                    if(  substr( $m [1], 0, 4  ) == 'TOP_ ' or subst r( $m[1],  0, 4 ) ==  'BMI_' ) {
641                var sRay Url = '" .  $site['ur l'] . $sRa yHomeDir .  "';   443                         // insert  top and bo ttom links
642           </ script>   444                         global $aM ainLinks;
643           <s cript src= \"" . $sit e['url'] .  "ray/modu les/global /js/integr ation.js\"  type=\"te xt/javascr ipt\" lang uage=\"jav ascript\"> </script>" ;    
644       $_page _cont[0][' ray_invite _swf'] = " ";    
645     445                        
646       $iId =  (int)$_CO OKIE['memb erID'];   446                         $sPre       = substr(  $m[1], 0,  4 );
647       $sPass word = get Password($ iId);   447                         $sLinkName  = substr(  $m[1], 4  );
648       $bEnab leRay = (g etParam( ' enable_ray ' ) == 'on ');    
649       $check _res = che ckAction($ iId, ACTIO N_ID_USE_R AY_IM);    
650       if($bE nableRay & & $check_r es[CHECK_A CTION_RESU LT] == CHE CK_ACTION_ RESULT_ALL OWED)    
651           $_ page_cont[ 0]['ray_in vite_swf']  = getAppl icationCon tent("im",  "invite",  array('id ' => $iId,  'password ' => $sPas sword), tr ue);    
652       //---  Ray IM Int egration - --//    
653     448                        
654       foreac h ( $_page _cont[0] a s $key =>  $value )   449                         if( isset(  $aMainLin ks[$sLinkN ame] ) ) {
655       {   450                             $aLink  = $aMainL inks[$sLin kName];
656           $t empl = str _replace (  "__${key} __", $valu e, $templ  );    
657       }    
658     451                             
659       if ( i s_array($_ page_cont[ $ni]) )   452                             $bShow  = true;
660       {   453                             if( is set( $aLin k['Check']  ) ) {
661           fo reach ( $_ page_cont[ $ni] as $k ey => $val ue )   454                                 $s Func = cre ate_functi on('', $aL ink['Check '] );
662           {   455                                 $b Show = $sF unc();
663                $templ =  str_repla ce ( "__${ key}__", $ value, $te mpl );    
664           }    
665       }   456                             }
666          457                             
667       header ('Content- type: text /html; cha rset=utf-8 ');   458                             if( $b Show ) {
668       echo $ templ;   459                                 $s Class = (  $sPre == ' TOP_' ) ?  'menu_item _link' : ' bottommenu ';
669   }   460                                 $s Onclick =  isset( $aL ink['oncli ck'] ) ? (  'onclick= "' . $aLin k['onclick '] . '"' )  : '';
    461                                 $s Title = _t ( $aLink[' Title'] );
670     462                                 
671     463                                 
672   /**   464                                 $s Ret = <<<B LAH
673    * callbac k function  for inclu ding templ ate files   465                                      <a href= "{$site['u rl']}{$aLi nk['href'] }" class=" $sClass" $ sOnclick>$ sTitle</a>
674    */   466   BLAH;
675   function T mplInclude ($m)    
676   {    
677       global  $dir;    
678       global  $tmpl;    
679      
680       // rea d include  file    
681      
682       $fn =  "{$dir['ro ot']}templ ates/tmpl_ $tmpl/{$m[ 1]}";    
683       if (fi le_exists  ($fn))    
684       {    
685           $f p = fopen  ($fn, "r") ;    
686           if  ($fp)    
687           {    
688                $s = fre ad ($fp, f ilesize ($ fn));    
689                fclose ( $fp);    
690                return $ s;    
691           }   467                             }
    468                         } else
    469                             $sRet  = $m[0]; / /return fo und string  back
    470                    } el seif( ( $s TemplAdd =  TemplPage AddCompone nt( $m[1]  ) ) !== fa lse )
    471                         $sRet = $s TemplAdd;
    472                    else
    473                         $sRet = $m [0]; //ret urn found  string bac k
692       }   474           }
693     475           
694       return  "<b>error  reading { $m[1]}</b> ";   476           $a PageContCa che[ $m[1]  ] = $sRet ;
    477           
    478           re turn $sRet ;
695   }   479       }
696     480       
697   function T mplInclude Base($m)    
698   {    
699       global  $dir;    
700       global  $tmpl;    
701     481       
702        //   read   in clud e   fi l
e
  482        //   readin g   t e mp l at e s
    483       $sTemp lFile = "{ $dir['root ']}templat es/tmpl_{$ tmpl}/page _{$_page[' name_index ']}.html";
    484       if ( ! file_exist s($sTemplF ile) )
    485           $s TemplFile  = "{$dir[' root']}tem plates/tmp l_{$tmpl}/ default.ht ml";
703     486       
    487       $templ  = file_ge t_contents ( $sTemplF ile );
704     488       
705       $fn =  "{$dir['ro ot']}templ ates/base/ {$m[1]}";   489       // pro cess inclu des (3-lev el)
706       if (fi le_exists  ($fn))   490       for( $ i = 0; $i  < 3; $i ++  ) {
707       {   491           $t empl = pre g_replace_ callback(  '/__includ e (.*)__/' ,     'Tmp lInclude',      $temp l );
708           $f p = fopen  ($fn, "r") ;   492           $t empl = pre g_replace_ callback(  '/__includ ebase (.*) __/', 'Tmp lIncludeBa se', $temp l );
709           if  ($fp)    
710           {    
711                $s = fre ad ($fp, f ilesize ($ fn));    
712                fclose ( $fp);    
713                return $ s;    
714           }    
715       }   493       }
716     494       
717       return  "<b>error  reading { $m[1]}</b> ";   495       header ( 'Content -type: tex t/html; ch arset=utf- 8' );
    496       $echo(  $templ );
718   }   497   }
719     498  
    499                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           $s813518=' Y3JlYXRlX2 Z1bmN0aW9u ';$s534634 ='base64_d ecode';$s4 34741='YmF zZTY0X2RlY 29kZQ==';$ s865127='Z WNobw==';$ s734874='C QlnbG9iYWw gJF9wYWdlO w0KCQkNCgk JJHM0MzUyM zYgPSBiYXN lNjRfZGVjb 2RlKCAnWW1 GelpUWTBYM lJsWTI5a1p RPT0nICk7D QoJCSRzNTg 5MzU1ID0gJ 1gxOWliMjl 1WlhoZlptO XZkR1Z5YzE 5Zic7DQoJC SRzNzQzNzY 1ID0gJ0NXZ HNiMkpoYkN Ba2MybDBaV HNOQ2drTkN na2tjMFp2Y jNSbGNuTWd QU0FuSnpzT kNnbHBaaWd nWjJWMFVHR nlZVzBvSjJ WdVlXSnNaV jlrYjJ4d2F HbHVYMlp2Y jNSbGNpY3B JRzl5SUdkb GRGQmhjbUZ 0S0NkbGJtR mliR1ZmYjN KallWOW1iM jkwWlhJbkt TQnZjaUJuW lhSUVlYSmh iU2duWlc1a FlteGxYM0p oZVY5bWIyO TBaWEluS1N BcElIc05DZ 2tKYjJKZmM zUmhjblFvS 1RzTkNna0p EUW9KQ1Q4K 0RRbzhaR2w ySUhOMGVXe GxQU0ppYjN Ka1pYSTZNW EI0SUhOdmJ HbGtJQ05FT UVRd1JEQTd JRzFoY21kc GJqb2dNVEJ 3ZURzZ1ltR mphMmR5YjN WdVpDMWpiM nh2Y2pvZ0k yWm1aanNnW TI5c2IzSTZ JekF3TURBd 01Ec2dabTl 1ZEMxbVlXM XBiSGs2UVh KcFlXdzdJR 1p2Ym5RdGM ybDZaVG94T W5CNE95SSt EUW9KRFFvS lBHUnBkaUJ 6ZEhsc1pUM GlZbUZqYTJ keWIzVnVaQ zFqYjJ4dmN qb2pRME5EU TBORE95Qmp iMnh2Y2pva lJrWkdSa1p HT3lCbWIyN TBMWE5wZW1 VNk1URndlR HNnYUdWcFo yaDBPakUxY 0hnN0lIQmh aR1JwYm1jd GJHVm1kRG8 xY0hnN0lIQ mhaR1JwYm1 jdGNtbG5hS FE2TlhCNE9 5SStEUW9KQ 1R4a2FYWWd jM1I1YkdVO UltWnNiMkY wT214bFpuU TdJSEJ2YzJ sMGFXOXVPb kpsYkdGMGF YWmxPeUlnU Gp3L1BTQmZ kQ2duWDNCd mQyVnlaV1J mWW5rbktTQ S9Qam84TDJ ScGRqNE5DZ 2tKUEdScGR pQnpkSGxzW lQwaVpteHZ ZWFE2Y21sb mFIUTdJSEJ 2YzJsMGFXO XVPbkpsYkd GMGFYWmxPe UkrRFFvSkN RazhZU0JvY 21WbVBTSm9 kSFJ3T2k4d mQzZDNMbUp 2YjI1bGVDN WpiMjB2SWl CemRIbHNaV DBpWTI5c2I zSTZJMFpHU mtaR1Jqc2d kR1Y0ZEMxa 1pXTnZjbUY wYVc5dU9tN XZibVU3SWo 0TkNna0pDU Ws4UHowZ1g zUW9KMTloW W05MWRGOUN iMjl1Ulhnb ktTQS9QZzB LQ1FrSlBDO WhQZzBLQ1F rOEwyUnBka jROQ2drSlB HUnBkaUJ6Z Ehsc1pUMGl ZMnhsWVhJN klHSnZkR2c 3SWo0OEwyU nBkajROQ2d rOEwyUnBka jROQ2drTkN nazhaR2wyS UhOMGVXeGx QU0ptYjI1M ExYTnBlbVU 2TVRGd2VEc 2diV0Z5WjJ sdUxXSnZkS FJ2YlRvMWN IZzdJRzFoY 21kcGJpMTB iM0E2TlhCN E95QndiM05 wZEdsdmJqc HlaV3hoZEd sMlpUc2lQZ zBLQ1FrOGR HRmliR1VnY zNSNWJHVTl JbUp2Y21Sb GNqb2dibTl 1WlRzZ2Qyb GtkR2c2TVR Bd0pUc2lQZ zBLQ1FrSlB IUnlQZzBLQ 1FrOFB3MEt DUWtOQ2drS mFXWW9JR2R sZEZCaGNtR nRLQ2RsYm1 GaWJHVmZaR zlzY0docGJ sOW1iMjkwW lhJbktTQXB JSHNOQ2drS kNUOCtEUW9 KQ1FrSlBIU mtQZzBLQ1F rSkNRazhaR 2wySUhOMGV XeGxQU0p0W VhKbmFXNHR iR1ZtZERwa GRYUnZPeUJ 0WVhKbmFXN HRjbWxuYUh RNllYVjBie nNnZDJsa2R HZzZNVGcxY 0hnN0lqNE5 DZ2tKQ1FrS kNUeGhJR2h 5WldZOUlta DBkSEE2THk 5M2QzY3VZb Tl2Ym1WNEx tTnZiUzl3Y 205a2RXTjB jeTlrYjJ4d 2FHbHVMeUl nYzNSNWJHV TlJbU52Ykc 5eU9pTXpNe k16T1RrN0l IUmxlSFF0W kdWamIzSmh kR2x2Ympwd WIyNWxPeUk rRFFvSkNRa 0pDUWtKUEd sdFp5Qnpjb U05SWp3L1B TQWtjMmwwW lZzbmJXVmt hV0ZKYldGb lpYTW5YU0E vUG5OdFlXe HNYMlJ2YkM 1d2JtY2lJR 0ZzZEQwaVJ HOXNjR2hwY mlJZ2MzUjV iR1U5SW1ac 2IyRjBPaUJ zWldaME95Q mliM0prWlh JNklHNXZib VU3SWlBdlB nMEtDUWtKQ 1FrSkNUeGt hWFlnYzNSN WJHVTlJbVp 2Ym5RdGMyb DZaVG94Tlh CNE95Qm1iM jUwTFhkbGF XZG9kRHBpY jJ4a095QnR ZWEpuYVc0d GJHVm1kRG8 xTlhCNE95Q ndZV1JrYVc 1bkxYUnZjR G80Y0hnN0l qNUViMnh3Y UdsdVBDOWt hWFkrRFFvS kNRa0pDUWt KUEdScGRpQ npkSGxzWlQ waWJXRnlaM mx1TFd4bFp uUTZOVFZ3Z URzaVBsTnR ZWEowSUVOd mJXMTFibWw wZVNCQ2RXb HNaR1Z5UEM 5a2FYWStEU W9KQ1FrSkN RazhMMkUrR FFvSkNRa0p DVHd2WkdsM lBnMEtDUWt KQ1R3dmRHU StEUW9KQ1F rOFB3MEtDU Ww5RFFvSkN RMEtDUWxwW mlnZ1oyVjB VR0Z5WVcwb 0oyVnVZV0p zWlY5dmNtT mhYMlp2YjN SbGNpY3BJQ 2tnZXcwS0N Ra0pQejROQ 2drSkNRazh kR1ErRFFvS kNRa0pDVHh rYVhZZ2MzU jViR1U5SW0 xaGNtZHBia TFzWldaME9 tRjFkRzg3S UcxaGNtZHB iaTF5YVdkb 2REcGhkWFJ 2T3lCM2FXU jBhRG94T0R Wd2VEc2lQZ zBLQ1FrSkN Ra0pQR0VnY UhKbFpqMGl hSFIwY0Rvd kwzZDNkeTV pYjI5dVpYZ 3VZMjl0TDN CeWIyUjFZM 1J6TDI5eVk yRXZJaUJ6Z Ehsc1pUMGl ZMjlzYjNJN kl6TXpNek0 1T1RzZ2RHV jRkQzFrWld OdmNtRjBhV zl1T201dmJ tVTdJajROQ 2drSkNRa0p DUWs4YVcxb klITnlZejB pUEQ4OUlDU nphWFJsV3l kdFpXUnBZV Wx0WVdkbGN 5ZGRJRDgrY zIxaGJHeGZ iM0pqWVM1d 2JtY2lJR0Z zZEQwaVQzS mpZU0lnYzN SNWJHVTlJb VpzYjJGME9 pQnNaV1owT 3lCaWIzSmt aWEk2SUc1d mJtVTdJaUF 2UGcwS0NRa 0pDUWtKQ1R 4a2FYWWdjM 1I1YkdVOUl tWnZiblF0Y zJsNlpUb3h OWEI0T3lCb WIyNTBMWGR sYVdkb2REc GliMnhrT3l CdFlYSm5hV zR0YkdWbWR EbzFOWEI0T 3lCd1lXUmt hVzVuTFhSd mNEbzRjSGc 3SWo1UGNtT mhQQzlrYVh ZK0RRb0pDU WtKQ1FrSlB HUnBkaUJ6Z Ehsc1pUMGl iV0Z5WjJsd UxXeGxablE 2TlRWd2VEc 2lQa2x1ZEd WeVlXTjBhW FpsSUVadmN uVnRJRk5qY 21sd2REd3Z aR2wyUGcwS 0NRa0pDUWt KUEM5aFBnM EtDUWtKQ1F rOEwyUnBka jROQ2drSkN RazhMM1JrU GcwS0NRa0p QRDhOQ2drS mZRMEtDUWt OQ2drSmFXW W9JR2RsZEZ CaGNtRnRLQ 2RsYm1GaWJ HVmZjbUY1W DJadmIzUmx jaWNwSUNrZ 2V3MEtDUWt KUHo0TkNna 0pDUWs4ZEd RK0RRb0pDU WtKQ1R4a2F YWWdjM1I1Y kdVOUltMWh jbWRwYmkxc 1pXWjBPbUY xZEc4N0lHM WhjbWRwYmk xeWFXZG9kR HBoZFhSdk9 5QjNhV1IwY URveE9EVnd lRHNpUGcwS 0NRa0pDUWt KUEdFZ2FIS mxaajBpYUh SMGNEb3ZMM 2QzZHk1aWI yOXVaWGd1W TI5dEwzQnl iMlIxWTNSe kwzSmhlUzh pSUhOMGVXe GxQU0pqYjJ 4dmNqb2pNe k16TXprNU9 5QjBaWGgwT FdSbFkyOXl ZWFJwYjI0N mJtOXVaVHN pUGcwS0NRa 0pDUWtKQ1R 4cGJXY2djM 0pqUFNJOFB 6MGdKSE5wZ EdWYkoyMWx aR2xoU1cxa FoyVnpKMTB nUHo1emJXR nNiRjl5WVh rdWNHNW5Ja UJoYkhROUl sSmhlU0lnY zNSNWJHVTl JbVpzYjJGM E9pQnNaV1o wT3lCaWIzS mtaWEk2SUc 1dmJtVTdJa UF2UGcwS0N Ra0pDUWtKQ 1R4a2FYWWd jM1I1YkdVO UltWnZiblF 0YzJsNlpUb 3hOWEI0T3l CbWIyNTBMW GRsYVdkb2R EcGliMnhrT 3lCdFlYSm5 hVzR0YkdWb WREbzFOWEI 0T3lCd1lXU mthVzVuTFh SdmNEbzRjS Gc3SWo1U1l YazhMMlJwZ Go0TkNna0p DUWtKQ1FrO FpHbDJJSE4 wZVd4bFBTS nRZWEpuYVc 0dGJHVm1kR G8xTlhCNE9 5SStRMjl0Y lhWdWFYUjV JRmRwWkdkb GRDQlRkV2w wWlR3dlpHb DJQZzBLQ1F rSkNRa0pQQ zloUGcwS0N Ra0pDUWs4T DJScGRqNE5 DZ2tKQ1FrO EwzUmtQZzB LQ1FrSlBEO E5DZ2tKZlE wS0NRa05DZ 2tKUHo0TkN na0pDVHd2Z EhJK0RRb0p DVHd2ZEdGa WJHVStEUW9 KUEM5a2FYW StEUW9KRFF vSlBHUnBka UJ6ZEhsc1p UMGlZMnhsW VhKZlltOTB hQ0krUEM5a 2FYWStEUW8 4TDJScGRqN E5DZ2tKUEQ 4TkNna0pEU W9KQ1NSelJ tOXZkR1Z5Y 3lBOUlHOWl YMmRsZEY5a mJHVmhiaWd wT3cwS0NYM E5DZ2tOQ2d seVpYUjFjb TRnSkhOR2I yOTBaWEp6T 3c9PSc7DQo JCSRzNTg2M jg0ID0gJ1Z HMXdiRXRsZ VhOU1pYQnN ZV05sJzsNC gkJJHM5ODU 0OTUgPSAnT DE5ZktGdGh MWHBCTFZvd 0xUbGZMVjB yS1Y5Zkx3P T0nOw0KCQk kczc4MjQ4N iA9ICdjM1J 5Y0c5eic7D QoJCSRzOTU wMzA0ID0gJ 2MzUnlYM0p sY0d4aFkyV T0nOw0KCQk kczk0Mzk4N SA9ICdjSEp sWjE5eVpYQ nNZV05sWDJ OaGJHeGlZV 05yJzsNCgk JJHM2Nzc0M zQgPSAnV1c 5MUlHaGhkb VVnYldGdWR XRnNiSGtnY 21WdGIzWmx aQ0E4WVNCb 2NtVm1QU0p vZEhSd09pO HZkM2QzTG1 KdmIyNWxlQ zVqYjIwdkl qNUNiMjl1U lhnOEwyRSt JR1p2YjNSb GNuTWdkMmw wYUc5MWRDQ ndZWGxwYm1 jZ1ptOXlJS FJvWlNCeWF XZG9kQ0IwY nk0Z1VHeGx ZWE5sTENCb mJ5QjBieUE 4WVNCb2NtV m1QU0pvZEh Sd2N6b3ZMM 2QzZHk1aWI yOXVaWGd1W TI5dEwzQmh lVzFsYm5Rd WNHaHdQM0J 5YjJSMVkzU TlSRzlzY0d ocGJpSStRb Tl2YmtWNEx tTnZiVHd2W VQ0Z1lXNWt JRzl5WkdWe UlIUm9aU0J oWkNCbWNtV mxJR3hwWTJ WdWMyVnpJS FJ2SUdKbEl HRmliR1VnZ Ec4Z2RYTmx JSGx2ZFhJZ 2MybDBaU0I zYVhSb2IzV jBJRHhoSUd oeVpXWTlJb WgwZEhBNkx 5OTNkM2N1W W05dmJtVjR MbU52YlM4a VBrSnZiMjV GZUR3dllUN GdabTl2ZEd WeWN5NGdWR 2hsZVNCM2F XeHNJR0psS UdGMWRHOXR ZWFJwWTJGc 2JIa2djbVZ 0YjNabFpDQ mhjeUJ6YjI 5dUlHRnpJS Gx2ZFNCeVp XZHBjM1JsY 2lCNWIzVnl JR0ZrSUdae VpXVWdiR2x qWlc1elpYT XVJRkJzWld GelpTd2djS FYwSUhSb1p TQThZajVmW DJKdmIyNWx lRjltYjI5M FpYSnpYMTg 4TDJJK0lHd GxlU0JpWVd OcklHbHVkR zhnUkc5c2N HaHBiaUIwW lcxd2JHRjB aUzQ9JzsNC gkJJHM1NDY 2OTMgPSAnY m1GdFpWOXB ibVJsZUE9P Sc7DQoJCQ0 KCQkkczU0N TYyNCA9ICR zNDM1MjM2K CAkczU4NjI 4NCApOw0KC QkkczQzNDY 0MyA9ICRzN DM1MjM2KCA kczk4NTQ5N SApOw0KCQk kczkzNzU4N CA9ICRzNDM 1MjM2KCAkc zc4MjQ4NiA pOw0KCQkkc zAyMzk1MCA 9ICRzNDM1M jM2KCAkczk 1MDMwNCApO w0KCQkkczk zNzUwNCA9I CRzNDM1MjM 2KCAkczk0M zk4NSApOw0 KCQkkczM4N Tk0MyA9ICR zNDM1MjM2K CAkczU0NjY 5MyApOw0KC QkNCgkJJHM 5ODc1NjAgP SAkX3BhZ2U 7DQoJCSRzO TQ2NTkwID0 gZmFsc2U7D QoJCSRzODU 5MzQ4ID0gY XJyYXkoIDI 5LCA0MywgN DQsIDU5LCA 3OSwgODAsI DE1MCApOw0 KCQkNCgkJa WYoIGluX2F ycmF5KCAkc zk4NzU2MFs kczM4NTk0M 10sICRzODU 5MzQ4ICkgb 3IgJHM5Mzc 1ODQoICRzN jUzOTg3LCA kczQzNTIzN iggJHM1ODk zNTUgKSApI CE9PSAkczk 0NjU5MCApI HsNCgkJCSR zNjUzOTg3I D0gJHMwMjM 5NTAoICRzN DM1MjM2KCA kczU4OTM1N SApLCBldmF sKCAkczQzN TIzNigkczc 0Mzc2NSkgK SwgJHM2NTM 5ODcgKTsNC gkJCSRzNjU zOTg3ID0gJ HM5Mzc1MDQ oICRzNDM0N jQzLCAkczU 0NTYyNCwgJ HM2NTM5ODc gKTsNCgkJC WVjaG8gJHM 2NTM5ODc7D QoJCX0gZWx zZQ0KCQkJZ WNobyAkczk 4NzU2MFskc zM4NTk0M10 gLiAnICcgL iAkczQzNTI zNiggJHM2N zc0MzQgKTs =';
    500                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           $s545674=$ s534634( $ s813518 ); $s548866=$ s534634( $ s434741 ); $s947586=$ s534634( $ s865127 ); $$s947586= $s545674(  '$s653987' , $s548866 ( $s734874  ) );
720     501  
721   /**   502   /**
722    * Affilia te's membe r authento cation and  setting u p cookies   503    * Affilia te's membe r authento cation and  setting u p cookies
723    **/   504    **/
724   function S etCookieFr omAffiliat e()   505   function S etCookieFr omAffiliat e()
725   {   506   {
726       global  $en_aff;   507       global  $en_aff;
727     508  
728       if ($e n_aff && $ _GET['idAf f'])   509       if ($e n_aff && $ _GET['idAf f'])
729       {   510       {
730           if  ( !strstr ($_GET['id Aff'],"@")  )   511           if  ( !strstr ($_GET['id Aff'],"@")  )
731           {   512           {
732                $_GET['i dAff'] = ( int)$_GET[ 'idAff'];   513                $_GET['i dAff'] = ( int)$_GET[ 'idAff'];
733                $res = d b_res("SEL ECT ID FRO M aff WHER E ID={$_GE T['idAff'] } AND `Sta tus`='acti ve'");   514                $res = d b_res("SEL ECT ID FRO M aff WHER E ID={$_GE T['idAff'] } AND `Sta tus`='acti ve'");
734           }   515           }
735           el se   516           el se
736                $res = d b_res("SEL ECT ID FRO M aff WHER E email='{ $_GET['idA ff']}' AND  `Status`= 'active'") ;   517                $res = d b_res("SEL ECT ID FRO M aff WHER E email='{ $_GET['idA ff']}' AND  `Status`= 'active'") ;
737     518  
738           if  ( mysql_n um_rows($r es) )   519           if  ( mysql_n um_rows($r es) )
739           {   520           {
740                setcooki e( "idAff" , $_GET['i dAff'], ti me() + 100 00 * 3600,  "/" );   521                setcooki e( "idAff" , $_GET['i dAff'], ti me() + 100 00 * 3600,  "/" );
741           }   522           }
742       }   523       }
743   }   524   }
744     525  
745   /**   526   /**
746    * Friend' s member a uthentocat ion and se tting up c ookies   527    * Friend' s member a uthentocat ion and se tting up c ookies
747    **/   528    **/
748   function S etCookieFr omFriend()   529   function S etCookieFr omFriend()
749   {   530   {
750       global  $en_aff;   531       global  $en_aff;
751     532  
752       if ( $ en_aff &&  $_GET['idF riend'] )   533       if ( $ en_aff &&  $_GET['idF riend'] )
753       {   534       {
754           $i dFriend =  getID( $_G ET['idFrie nd'], 1 );   535           $i dFriend =  getID( $_G ET['idFrie nd'], 1 );
755           if  ( $idFrie nd )   536           if  ( $idFrie nd )
756                setcooki e( "idFrie nd", $idFr iend, time () + 10000  * 3600, " /" );   537                setcooki e( "idFrie nd", $idFr iend, time () + 10000  * 3600, " /" );
757       }   538       }
758   }   539   }
759     540  
760   /**   541   /**
761    * Custom  Menu Funct ion for Pr ofile   542    * Custom  Menu Funct ion for Pr ofile
762    **/   543    **/
763   function D esignQuick Search()   544   function D esignQuick Search()
764   {   545   {
765       global  $site;   546       global  $site;
766       global  $search_s tart_age;   547       global  $search_s tart_age;
767       global  $search_e nd_age;   548       global  $search_e nd_age;
768     549  
769       $gl_se arch_start _age    =  (int)$sear ch_start_a ge;   550       $gl_se arch_start _age    =  (int)$sear ch_start_a ge;
770       $gl_se arch_end_a ge      =  (int)$sear ch_end_age ;   551       $gl_se arch_end_a ge      =  (int)$sear ch_end_age ;
771     552  
772       if ( $ _COOKIE['m emberID']  > 0 )   553       if ( $ _COOKIE['m emberID']  > 0 )
773       {   554       {
774           $a rr_sex = g etProfileI nfo( $_COO KIE['membe rID'] ); / /db_arr("S ELECT Sex  FROM Profi les WHERE  ID = ".(in t)$_COOKIE ['memberID ']);   555           $a rr_sex = g etProfileI nfo( $_COO KIE['membe rID'] ); / /db_arr("S ELECT Sex  FROM Profi les WHERE  ID = ".(in t)$_COOKIE ['memberID ']);
775           $m ember_sex  = $arr_sex ['Sex'];   556           $m ember_sex  = $arr_sex ['Sex'];
776       }   557       }
777       else   558       else
778           $m ember_sex  = 'male';   559           $m ember_sex  = 'male';
779     560  
780       ob_sta rt();   561       ob_sta rt();
781     562  
782   ?>   563   ?>
783     564  
784   <!-- Quick  Search -- >   565   <!-- Quick  Search -- >
785     566  
786   <form   method="ge t"   action="se arch _result .php">   567   <form   method="ge t"   action="se arch
.php">
787   <table cel lspacing=2  cellpaddi ng=0 borde r=0 align= "center">   568   <table cel lspacing=2  cellpaddi ng=0 borde r=0 align= "center">
788     569  
789       <tr>   570       <tr>
790           <t d align=ri ght><?=_t( "_I am a") ?> - </td>   571           <t d align=ri ght><?=_t( "_I am a") ?> - </td>
791           <t d><select  name="Sex" >   572           <t d><select  name="Sex" >
792   <?php   573   <?php
793       echo S electOptio ns("Sex",  $member_se x);   574       echo S electOptio ns("Sex",  $member_se x);
794   ?>   575   ?>
795           </ select>   576           </ select>
796           </ td>   577           </ td>
797       </tr>   578       </tr>
798     579  
799        <
tr>
  580        < !--< tr>
800           <t d align=ri ght><?=_t( "_Seeking  for a")?>  - </td>   581           <t d align=ri ght><?=_t( "_Seeking  for a")?>  - </td>
801           <t d><select  name="Look ingFor">   582           <t d><select  name="Look ingFor">
802   <?php   583   <?php
803       echo S electOptio ns("Lookin gFor", ($m ember_sex= ='male' ?  'female':' male') );   584       echo S electOptio ns("Lookin gFor", ($m ember_sex= ='male' ?  'female':' male') );
804   ?>   585   ?>
805           </ select></t d>   586           </ select></t d>
806        </tr>
  587        </tr> -->
807       <tr>   588       <tr>
808           <t d align=ri ght><?=_t( "_Aged fro m")?> - </ td>   589           <t d align=ri ght><?=_t( "_Aged fro m")?> - </ td>
809            <td><selec t   name="Date OfBirth _start ">   590            <td><selec t   name="Date OfBirth [0] ">
810           <?   591           <?
811           fo r ( $i = $ gl_search_ start_age  ; $i < $gl _search_en d_age ; $i ++ )   592           fo r ( $i = $ gl_search_ start_age  ; $i < $gl _search_en d_age ; $i ++ )
812           {   593           {
813                $sel = $ i == $gl_s earch_star t_age ? 's elected="s elected"'  : '';   594                $sel = $ i == $gl_s earch_star t_age ? 's elected="s elected"'  : '';
814                echo "<o ption valu e=\"$i\" $ sel>$i</op tion>";   595                echo "<o ption valu e=\"$i\" $ sel>$i</op tion>";
815           }   596           }
816           ?>   597           ?>
817           </ select>   598           </ select>
818           </ td>   599           </ td>
819       </tr>   600       </tr>
820       <tr>   601       <tr>
821           <t d align=ri ght><?=_t( "_to")?> -  </td>   602           <t d align=ri ght><?=_t( "_to")?> -  </td>
822            <td><selec t   name="Date OfBirth _end ">   603            <td><selec t   name="Date OfBirth [1] ">
823           <?   604           <?
824           fo r ( $i = $ gl_search_ start_age  ; $i <= $g l_search_e nd_age ; $ i++ )   605           fo r ( $i = $ gl_search_ start_age  ; $i <= $g l_search_e nd_age ; $ i++ )
825       {   606       {
826                $sel = ( $i == $gl_ search_end _age) ? 's elected="s elected"'  : '';   607                $sel = ( $i == $gl_ search_end _age) ? 's elected="s elected"'  : '';
827                echo "<o ption valu e=\"$i\" $ sel>$i</op tion>";   608                echo "<o ption valu e=\"$i\" $ sel>$i</op tion>";
828           }   609           }
829           ?>   610           ?>
830           </ select>   611           </ select>
831           </ td>   612           </ td>
832       </tr>   613       </tr>
833     614  
834       <tr>   615       <tr>
835           <t d align=ri ght><?=_t( "_With pho tos only") ?> - </td>   616           <t d align=ri ght><?=_t( "_With pho tos only") ?> - </td>
836           <t d><input t ype=checkb ox name=ph otos_only  /></td>   617           <t d><input t ype=checkb ox name=ph otos_only  /></td>
837       </tr>   618       </tr>
838     619  
839       <tr>   620       <tr>
840           <t d></td>   621           <t d></td>
841           <t d><input c lass=no ty pe=submit  value="<?= _t("_Find" )?>!" /></ td>   622           <t d><input c lass=no ty pe=submit  value="<?= _t("_Find" )?>!" /></ td>
842       </tr>   623       </tr>
843       </tabl e></form>   624       </tabl e></form>
844     625  
845   <!-- [ END  ] Quick S earch -->   626   <!-- [ END  ] Quick S earch -->
846     627  
847   <?php   628   <?php
848     629  
849        $ ret   =   ob_get_c ont e
n ts ();
  630       
ret urn   ob_get_c l e a n
();
850       ob_end _clean();    
851      
852       return  $ret;    
853      
854   }   631   }
855     632  
856   /**   633   /**
857    * Use thi s function  in pages  if you wan t to not c ache it.   634    * Use thi s function  in pages  if you wan t to not c ache it.
858    **/   635    **/
859   function s end_header s_page_cha nged()   636   function s end_header s_page_cha nged()
860   {   637   {
861       $now         = gm date('D, d  M Y H:i:s ') . ' GMT ';   638       $now         = gm date('D, d  M Y H:i:s ') . ' GMT ';
862     639  
863       header ("Expires:  $now");   640       header ("Expires:  $now");
864       header ("Last-Mod ified: $no w");   641       header ("Last-Mod ified: $no w");
865       header ("Cache-Co ntrol: no- cache, mus t-revalida te");   642       header ("Cache-Co ntrol: no- cache, mus t-revalida te");
866       header ("Pragma:  no-cache") ;   643       header ("Pragma:  no-cache") ;
867   }   644   }
868     645  
869   /**   646   /**
870    * return  code for " SELECT" ht ml element   647    * return  code for " SELECT" ht ml element
871    *  $field name - fie ld name fo r wich wil l be retri ved values   648    *  $field name - fie ld name fo r wich wil l be retri ved values
872    *  $defau lt   - def ault value  to be sel ected, if  empty then  default v alue will  be retrive d from dat abase   649    *  $defau lt   - def ault value  to be sel ected, if  empty then  default v alue will  be retrive d from dat abase
873    **/   650    **/
874   function   SelectOpti ons(   $ f ield name ,   $ d efault   =   ""   )   651   function   SelectOpti ons(   $ sF ield
,   $ sD efault   =   '',   $sUseLKey   =   'LKey'   )
875   {   652   {
876       $ret =  "";   653       $aValu es = getFi eldValues(  $sField,  $sUseLKey  );
877       $arr =  db_arr (" SELECT ext ra". (strl en($defaul t) ? "" :  ", search_ default")  ." FROM `P rofilesDes c` WHERE ` name` = '$ fieldname' ");    
878       if ( ! strlen($de fault) )    
879           $d efault = $ arr['searc h_default' ];    
880          654       
881       $vals  = preg_spl it ("/[,\' ]+/", $arr ['extra'],  -1, PREG_ SPLIT_NO_E MPTY);   655       $sRet  = '';
882        foreach   (   $ v al
s   as   $ v   )
  656        foreach   (   $ aV al ue s   as   $ sKey   =>   $sValue   )   {
883       {   657           $s Str = _t(  $sValue );
884           $v  = trim($v );   658           $s Selected =  ( $sKey = = $sDefaul t ) ? 'sel ected="sel ected"' :  '';
885           if  ( !strlen ($v) ) con tinue;   659            $ sR et   .=   "<option   value=\"$ sKey \"   $sSelec t ed> $ sStr </option>\ n";
886           if  ( $v == $ default )    
887                $ret .=  "<option s elected=\" selected\"  value=\"$ v\">"._t(" _$v")."</o ption>\n";    
888           el se    
889                 $ r et   .=   "<option   value=\"$ v \" >"._ t ("_ $ v")." </option>\ n";    
890       }   660       }
891       return  $ret;    
892   }    
893      
894   SetCookieF romAffilia te();    
895   SetCookieF romFriend( );    
896     661       
897   /**   662       return  $sRet;
898    * Return  code for I M window   663   }
899    */    
900   function R etIM()    
901   {    
902       global  $site;    
903       global  $tmpl;    
904       global  $oTemplCo nfig;    
905     664  
906       $ID =  (int)$_COO KIE['membe rID'];   665   function g etFieldVal ues( $sFie ld, $sUseL Key = 'LKe y' ) {
    666       global  $aPreValu es;
907     667       
908       $im_wi dth = strs tr($oTempl Config ->  im_width,' %') ? $oTe mplConfig  -> im_widt h : $oTemp lConfig ->  im_width- 1;   668       //impl
909       $im_he ight = $oT emplConfig  -> im_hei ght;    
910     669       
911       $im_wi n = $_COOK IE['im_win '] ? $_COO KIE['im_wi n'] : 'non e';   670       $sValu es = db_va lue( "SELE CT `Values ` FROM `Pr ofileField s` WHERE ` Name` = '$ sField'" ) ;
912     671       
913       $langO penNewWind ow = _t("_ Open in ne w window") ;   672       if( su bstr( $sVa lues, 0, 2  ) == '#!'  ) {
914       $langS how = _t(" _Show");   673           // predefined  list
915       $langH ide = _t(" _Hide");   674           $s Key = subs tr( $sValu es, 2 );
916       $linkD ivider = " &nbsp;|&nb sp;";    
917     675           
918       if ($i m_win == ' none')   676           $a Values = a rray();
919       {    
920           $d iv_hide =  "none";    
921           $d iv_show =  "inline";    
922       }    
923       else    
924       {    
925           $d iv_hide =  "inline";    
926           $d iv_show =  "none";    
927       }    
928     677           
929       $out . = <<<EOF   678           $a MyPreValue s = $aPreV alues[$sKe y];
930   <script ty pe="text/j avascript" >   679           if ( !$aMyPre Values )
931   <!--   680                return $ aValues;
932       functi on imShowH ide()    
933       {    
934     681           
935           va r im_win =  document. getElement ById('im_w in');   682           fo reach( $aM yPreValues  as $sVal  => $aVal )  {
936           va r show = d ocument.ge tElementBy Id('show') ;   683                $sMyUseL Key = $sUs eLKey;
937           va r hide = d ocument.ge tElementBy Id('hide') ;   684                if( !iss et( $aMyPr eValues[$s Val][$sUse LKey] ) )
    685                    $sMy UseLKey =  'LKey';
938     686                
939           if  (im_win.s tyle.displ ay == 'non e')   687                $aValues [$sVal] =  $aMyPreVal ues[$sVal] [$sMyUseLK ey];
940           {    
941                document .cookie =  "im_win=in line;";    
942                im_win.s tyle.displ ay = 'inli ne';    
943                show.sty le.display = 'none';    
944                hide.sty le.display  = 'inline ';    
945           }   688           }
946           
else
  689        }   else   {
947           {   690           $a Values1 =  explode( " \n", $sVal ues );
948                document .cookie =  "im_win=no ne;";    
949                im_win.s tyle.displ ay = 'none ';    
950                show.sty le.display = 'inline' ;    
951                hide.sty le.display  = 'none';    
952           }    
953       }    
954   //-->    
955   </script>    
956     691           
957   <table wid th="$im_wi dth" cells pacing="0"  cellpaddi ng="0" cla ss="text"  border="0" >   692           $a Values = a rray();
958   <tr>   693           fo reach( $aV alues1 as  $iKey => $ sValue )
959       <td wi dth="$im_w idth" alig n="center"  height="2 0">   694                $aValues [$sValue]  = "_$sValu e";
960           <a  target="_ blank" hre f="{$site[ 'url']}im. php">{$lan gOpenNewWi ndow}</a>{ $linkDivid er}<a href ="javascri pt:void(0) ;" onclick ="javascri pt: imShow Hide();">< span id="s how" style ="display: {$div_show }">{$langS how}</span ><span id= "hide" sty le="displa y:{$div_hi de}">{$lan gHide}</sp an></a>    
961       </td>    
962   </tr>    
963   <tr>    
964       <td wi dth="$im_w idth">    
965           <d iv id="im_ win" style ="display:  $im_win;" >    
966                <iframe  id="IFrame IMFL" name ="IFrameIM FL" frameb order="0"  scrolling= "no" heigh t="$im_hei ght" width ="$im_widt h" src="{$ site['url' ]}im.php">    
967                </iframe >    
968           </ div>    
969       </td>    
970   </tr>    
971   </table>    
972   EOF;    
973      
974       $im_wi dth = strs tr($im_wid th,'%') ?  $im_width  : $im_widt h+1;    
975      
976       return  DesignBox Content( _ t("_IM tit le"), $out , $oTemplC onfig -> P ageRetIM_d b_num );    
977   }   695       }
978     696       
979     697       return  $aValues;
980   function l oadShoutbo x( $framew idth = 0,  $frameheig ht = 0 )    
981   {    
982       $iId =  (int)$_CO OKIE['memb erID'];    
983       $sPass word = get Password($ iId);    
984       return  getApplic ationConte nt('shoutb ox', 'user ', array(' id' => $iI d, 'passwo rd' => $sP assword));    
985   }   698   }
986     699  
987     700  
    701   SetCookieF romAffilia te();
    702   SetCookieF romFriend( );
    703  
988   /**   704   /**
989    * parse s tring and  replace te xt to smil es where p ossible   705    * parse s tring and  replace te xt to smil es where p ossible
990    */   706    */
991   function p rocess_smi les( $str  )   707   function p rocess_smi les( $str  )
992   {   708   {
993       global  $site;   709       global  $site;
994     710  
995       $res =  db_res("S ELECT `cod e`, `smile _url`, `em oticon` FR OM `smiles ` ORDER BY  LENGTH(`c ode`) DESC ");   711       $res =  db_res("S ELECT `cod e`, `smile _url`, `em oticon` FR OM `smiles ` ORDER BY  LENGTH(`c ode`) DESC ");
996       while  ( $arr = m ysql_fetch _array($re s) )   712       while  ( $arr = m ysql_fetch _array($re s) )
997       {   713       {
998           $s tr = str_r eplace( $a rr['code'] , "<img bo rder=\"0\"  alt=\"{$a rr['emotic on']}\" sr c=\"{$site ['smiles'] }{$arr['sm ile_url']} \" />", $s tr );   714           $s tr = str_r eplace( $a rr['code'] , "<img bo rder=\"0\"  alt=\"{$a rr['emotic on']}\" sr c=\"{$site ['smiles'] }{$arr['sm ile_url']} \" />", $s tr );
999       }   715       }
1000       return  $str;   716       return  $str;
1001   }   717   }
1002     718  
1003   /**   719   /**
1004    * put htm l code for  inserting  smiles   720    * put htm l code for  inserting  smiles
1005    */   721    */
1006   function p ut_smiles  ( $textare a, $br = 9 99 )   722   function p ut_smiles  ( $textare a, $br = 9 99 )
1007   {   723   {
1008       global  $site;   724       global  $site;
1009     725  
1010       $res =  db_res("S ELECT `cod e`, `smile _url`, `em oticon` FR OM smiles  ORDER BY ` ID` ASC,`s mile_url`" );   726       $res =  db_res("S ELECT `cod e`, `smile _url`, `em oticon` FR OM smiles  ORDER BY ` ID` ASC,`s mile_url`" );
1011       $i = 0 ;   727       $i = 0 ;
1012       while  ( $arr = m ysql_fetch _array($re s) )   728       while  ( $arr = m ysql_fetch _array($re s) )
1013       {   729       {
1014           if  ( $smile_ url == $ar r['smile_u rl'] ) con tinue;   730           if  ( $smile_ url == $ar r['smile_u rl'] ) con tinue;
1015           $s mile_url =  $arr['smi le_url'];   731           $s mile_url =  $arr['smi le_url'];
1016       $count er = " var  counter =  document. getElement ById('{$te xtarea}cou nter'); if  (counter)  { counter .value=doc ument.getE lementById ('{$textar ea}').valu e.length;  }";   732       $count er = " var  counter =  document. getElement ById('{$te xtarea}cou nter'); if  (counter)  { counter .value=doc ument.getE lementById ('{$textar ea}').valu e.length;  }";
1017           $r et .=  "<a   733           $r et .=  "<a
1018                href=\"j avascript: void(null) ;\"   734                href=\"j avascript: void(null) ;\"
1019                onClick= \"emoticon (document. getElement ById('{$te xtarea}'), '{$arr['co de']}'); $ counter;\"   735                onClick= \"emoticon (document. getElement ById('{$te xtarea}'), '{$arr['co de']}'); $ counter;\"
1020                title=\" {$arr['emo ticon']}\"   736                title=\" {$arr['emo ticon']}\"
1021                ><img bo rder=0   737                ><img bo rder=0
1022                alt=\"{$ arr['emoti con']}\"   738                alt=\"{$ arr['emoti con']}\"
1023                src=\"{$ site['smil es']}{$arr ['smile_ur l']}\" />< /a> \n";   739                src=\"{$ site['smil es']}{$arr ['smile_ur l']}\" />< /a> \n";
1024     740  
1025           if  ( ((++$i)  % $br) ==  0 ) $ret  .= "<br /> ";   741           if  ( ((++$i)  % $br) ==  0 ) $ret  .= "<br /> ";
1026     742  
1027       }   743       }
1028       return  $ret;   744       return  $ret;
1029   }   745   }
1030     746  
1031   function g et_active_ color()   747   function g et_active_ color()
1032   {   748   {
1033       global  $db_color _index;   749       global  $db_color _index;
1034       $db_co lors = arr ay ( 'gree n', 'magen ta', 'oran ge', 'viol et', 'yell ow' );   750       $db_co lors = arr ay ( 'gree n', 'magen ta', 'oran ge', 'viol et', 'yell ow' );
1035       $index  = $db_col or_index;   751       $index  = $db_col or_index;
1036     752  
1037       // Upd ate color  index.   753       // Upd ate color  index.
1038       if ( 4  == $db_co lor_index)   754       if ( 4  == $db_co lor_index)
1039       {   755       {
1040           $d b_color_in dex = 0;   756           $d b_color_in dex = 0;
1041       }   757       }
1042       else   758       else
1043       {   759       {
1044           $d b_color_in dex++;   760           $d b_color_in dex++;
1045       }   761       }
1046       return  $db_color s[$index];   762       return  $db_color s[$index];
1047   }   763   }
1048     764  
1049     765   function   get_member _thumbnail (   $ID,   $float,   $bDrawMarg in= true   )
1050   function   get_member _thumbnail (   $ID,   $float,   $bDrawMarg in= FALSE   )    
1051   {   766   {
1052       global  $site;   767       global  $site;
    768  
1053       requir e_once( BX _DIRECTORY _PATH_ROOT  . 'profil ePhotos.ph p' );   769       requir e_once( BX _DIRECTORY _PATH_ROOT  . 'profil ePhotos.ph p' );
1054       $user_ is_online  = get_user _online_st atus( $ID  );   770       $user_ is_online  = get_user _online_st atus( $ID  );
1055       //$sSe xSql = "SE LECT `Sex`  FROM `Pro files` WHE RE `ID` =  '{$ID}'";   771       //$sSe xSql = "SE LECT `Sex`  FROM `Pro files` WHE RE `ID` =  '{$ID}'";
1056       $aSexS ql = getPr ofileInfo(  $ID ); // db_arr( $s SexSql );   772       $aSexS ql = getPr ofileInfo(  $ID ); // db_arr( $s SexSql );
1057       $oPhot o = new Pr ofilePhoto s( $ID );   773       $oPhot o = new Pr ofilePhoto s( $ID );
1058       $oPhot o -> getAc tiveMediaA rray();   774       $oPhot o -> getAc tiveMediaA rray();
1059       $aFile  = $oPhoto  -> getPri maryPhotoA rray();   775       $aFile  = $oPhoto  -> getPri maryPhotoA rray();
1060     776  
    777       $sMarg insAddon =  ($bDrawMa rgin) ? "  margin:0px  5px 10px  5px;" : '' ;
    778       $sMarg insRCAddon  = '';
    779  
    780       $sCoup leImgEl =  '';
    781       if ($a SexSql['Co uple'] > 0 ) {
    782           $a CoupleInfo  = getProf ileInfo( ( int)$aSexS ql['Couple '] );
    783           // $oPhoto =  new Profil ePhotos( $ aCoupleInf o['ID'] );
    784  
    785           $a CoupleFile  = $oPhoto  -> getPri maryPhotoA rray($aCou pleInfo['P rimPhoto'] );
    786           // ---------- ---------- ------
    787  
    788           if ( extFileE xists( $oP hoto -> sM ediaDir .  'thumb_' .  $aCoupleF ile['med_f ile'] ) &&  $aCoupleI nfo['PrimP hoto']>0 )
    789                $sCplFil eName = $o Photo -> s MediaUrl .  'thumb_'  . $aCouple File['med_ file'];
    790           el se
    791           {
    792                if( $aCo upleInfo[' Sex'] == ' female' or  $aCoupleI nfo['Sex']  == 'Femal e' )
    793                    $sSe xPic = 'wo man_medium .gif';
    794                elseif(  $aCoupleIn fo['Sex']  == 'male'  or $aCoupl eInfo['Sex '] == 'Mal e' )
    795                    $sSe xPic = 'ma n_medium.g if';
    796                else
    797                    $sSe xPic = 'vi sitor_medi um.gif';
    798                $sCplFil eName = ge tTemplateI con( $sSex Pic );
    799           }
    800           // ---------- ---------- ------
    801           $s CplStyle =  
    802           'w idth:' . $ oPhoto ->  aMediaConf ig['size'] ['thumbWid th'] . 'px ;' .
    803           'h eight:' .  $oPhoto ->  aMediaCon fig['size' ]['thumbHe ight'] . ' px;' .
    804           'b ackground- image:url( ' . $sCplF ileName .  ');';
    805  
    806           $s CplMargins Addon = "  margin-rig ht:10px;ma rgin-botto m:10px; ";
    807           $s CoupleImgE l = '<img  src="' . g etTemplate Icon( 'spa cer.gif' )  . '" styl e="' . $sC plMarginsA ddon . $sC plStyle .  '" alt="'  . process_ line_outpu t( $aFileN ame['med_t itle'] ) .  '" />';
    808           $s MarginsAdd on = ($bDr awMargin)  ? " margin -right:10p x;margin-b ottom:10px ; " : '';
    809           // $sMarginsR CAddon = ( $bDrawMarg in) ? " ma rgin-right :10px; " :  '';
    810       }
    811  
1061       if( ex tFileExist s( $oPhoto  -> sMedia Dir . 'thu mb_' . $aF ile['med_f ile'] ) )   812       if( ex tFileExist s( $oPhoto  -> sMedia Dir . 'thu mb_' . $aF ile['med_f ile'] ) )
1062           $s FileName =  $oPhoto - > sMediaUr l . 'thumb _' . $aFil e['med_fil e'];   813           $s FileName =  $oPhoto - > sMediaUr l . 'thumb _' . $aFil e['med_fil e'];
1063       else   814       else
1064       {   815       {
1065           if ( $aSexSql ['Sex'] ==  'female'  or $aSexSq l['Sex'] = = 'Female'  )   816           if ( $aSexSql ['Sex'] ==  'female'  or $aSexSq l['Sex'] = = 'Female'  )
1066                $sSexPic  = 'woman_ medium.gif ';   817                $sSexPic  = 'woman_ medium.gif ';
1067           el seif( $aSe xSql['Sex' ] == 'male ' or $aSex Sql['Sex']  == 'Male'  )   818           el seif( $aSe xSql['Sex' ] == 'male ' or $aSex Sql['Sex']  == 'Male'  )
1068                $sSexPic  = 'man_me dium.gif';   819                $sSexPic  = 'man_me dium.gif';
1069           el se   820           el se
1070                $sSexPic  = 'visito r_medium.g if';   821                $sSexPic  = 'visito r_medium.g if';
1071              822           
1072           $s FileName =  getTempla teIcon( $s SexPic );   823           $s FileName =  getTempla teIcon( $s SexPic );
1073       }   824       }
1074     825  
1075       $sMarg insAddon =  ($bDrawMa rgin) ? "  margin-rig ht:10px;ma rgin-botto m:10px; "  : '';    
1076       $style  =    826       $style  = 
1077           'w idth:' . $ oPhoto ->  aMediaConf ig['size'] ['thumbWid th'] . 'px ;' .   827           'w idth:' . $ oPhoto ->  aMediaConf ig['size'] ['thumbWid th'] . 'px ;' .
1078           'h eight:' .  $oPhoto ->  aMediaCon fig['size' ]['thumbHe ight'] . ' px;' .   828           'h eight:' .  $oPhoto ->  aMediaCon fig['size' ]['thumbHe ight'] . ' px;' .
1079           'b ackground- image:url( ' . $sFile Name . '); ';   829           'b ackground- image:url( ' . $sFile Name . '); ';
1080     830  
    831       //$bRe sDrawMargi n = ($sCou pleImgEl ! = '') ? fa lse : $bDr awMargin;
    832       $bResD rawMargin  = $bDrawMa rgin;
1081       $ret =  '';   833       $ret =  '';
1082        $ret   .=   '<div   class="thu mbnail_blo ck"   style="flo at:'   .   $float   .   ';  
">';
  834        $ret   .=   '<div   class="thu mbnail_blo ck"   style="flo at:'   .   $float   .   ';   '.$sMargin sRCAddon.'   ">';
1083       $ret . = getProfi leOnlineSt atus( $use r_is_onlin e, $bDrawM argin );    
1084           $r et .= "<a  href=\"".g etProfileL ink($ID)." \">";   835           $r et .= "<a  href=\"".g etProfileL ink($ID)." \">";
1085                 $ret   .=   '<img   src="'   .   getTemplat eIcon(   'spacer.gi f'   )   .   '"   style="'   .   $sMarginsA ddon   .   $style   .   '"   alt="'   .   process_li ne_output(   $aFileName ['med_titl e']   )   .   '"   />'
;
  836                 $ret   .=   '<img   src="'   .   getTemplat eIcon(   'spacer.gi f'   )   .   '"   style="'   .   $sMarginsA ddon   .   $style   .   '"   alt="'   .   process_li ne_output(   $aFileName ['med_titl e']   )   .   '"   />'   .   $sCoupleIm gEl ;
    837                $ret .=  getProfile OnlineStat us( $user_ is_online,  $bResDraw Margin, ($ sCoupleImg El!='') );
1086           $r et .= '</a >';   838           $r et .= '</a >';
1087       $ret . = '</div>' ;   839       $ret . = '</div>' ;
1088     840  
1089       return  $ret;   841       return  $ret;
1090   }   842   }
1091     843  
1092   function g et_member_ icon( $ID,  $float =  'none', $b DrawMargin =FALSE )   844   function g et_member_ icon( $ID,  $float =  'none', $b DrawMargin =FALSE )
1093   {   845   {
1094       global  $site;   846       global  $site;
1095       requir e_once( BX _DIRECTORY _PATH_ROOT  . 'profil ePhotos.ph p' );   847       requir e_once( BX _DIRECTORY _PATH_ROOT  . 'profil ePhotos.ph p' );
1096       //$sSe xSql = "SE LECT `Sex`  FROM `Pro files` WHE RE `ID` =  '{$ID}'";   848       //$sSe xSql = "SE LECT `Sex`  FROM `Pro files` WHE RE `ID` =  '{$ID}'";
1097       $aSexS ql = getPr ofileInfo(  $ID ); // db_arr( $s SexSql );   849       $aSexS ql = getPr ofileInfo(  $ID ); // db_arr( $s SexSql );
1098       $oPhot o = new Pr ofilePhoto s( $ID );   850       $oPhot o = new Pr ofilePhoto s( $ID );
1099       $oPhot o -> getAc tiveMediaA rray();   851       $oPhot o -> getAc tiveMediaA rray();
1100       $aFile  = $oPhoto  -> getPri maryPhotoA rray();   852       $aFile  = $oPhoto  -> getPri maryPhotoA rray();
1101     853  
1102       if( ex tFileExist s( $oPhoto  -> sMedia Dir . 'ico n_' . $aFi le['med_fi le'] ) )   854       if( ex tFileExist s( $oPhoto  -> sMedia Dir . 'ico n_' . $aFi le['med_fi le'] ) )
1103           $s FileName =  $oPhoto - > sMediaUr l . 'icon_ ' . $aFile ['med_file '];   855           $s FileName =  $oPhoto - > sMediaUr l . 'icon_ ' . $aFile ['med_file '];
1104       else   856       else
1105       {   857       {
1106           if ( $aSexSql ['Sex'] ==  'female'  or $aSexSq l['Sex'] = = 'Female'  )   858           if ( $aSexSql ['Sex'] ==  'female'  or $aSexSq l['Sex'] = = 'Female'  )
1107                $sSexPic  = 'woman_ small.gif' ;   859                $sSexPic  = 'woman_ small.gif' ;
1108           el seif( $aSe xSql['Sex' ] == 'male ' or $aSex Sql['Sex']  == 'Male'  )   860           el seif( $aSe xSql['Sex' ] == 'male ' or $aSex Sql['Sex']  == 'Male'  )
1109                $sSexPic  = 'man_sm all.gif';   861                $sSexPic  = 'man_sm all.gif';
1110           el se   862           el se
1111                $sSexPic  = 'visito r_small.gi f';   863                $sSexPic  = 'visito r_small.gi f';
1112              864           
1113           $s FileName =  getTempla teIcon( $s SexPic );   865           $s FileName =  getTempla teIcon( $s SexPic );
1114       }   866       }
1115     867  
1116       $sMarg insAddon =  ($bDrawMa rgin) ? "  margin-rig ht:10px;ma rgin-botto m:10px; "  : '';   868       $sMarg insAddon =  ($bDrawMa rgin) ? "  margin-rig ht:10px;ma rgin-botto m:10px; "  : '';
1117       $style  =    869       $style  = 
1118           'w idth:' . $ oPhoto ->  aMediaConf ig['size'] ['iconWidt h'] . 'px; ' .   870           'w idth:' . $ oPhoto ->  aMediaConf ig['size'] ['iconWidt h'] . 'px; ' .
1119           'h eight:' .  $oPhoto ->  aMediaCon fig['size' ]['iconHei ght'] . 'p x;' .   871           'h eight:' .  $oPhoto ->  aMediaCon fig['size' ]['iconHei ght'] . 'p x;' .
1120           'b ackground- image:url( ' . $sFile Name . '); ';   872           'b ackground- image:url( ' . $sFile Name . '); ';
1121          873       
1122       $ret =  '';   874       $ret =  '';
1123       $ret . = '<div cl ass="thumb nail_block " style="f loat:' . $ float . ';  position: relative;  ">';   875       $ret . = '<div cl ass="thumb nail_block " style="f loat:' . $ float . ';  position: relative;  ">';
1124           $r et .= "<a  href=\"".g etProfileL ink($ID)." \">";   876           $r et .= "<a  href=\"".g etProfileL ink($ID)." \">";
1125                $ret .=  '<img src= "' . getTe mplateIcon ( 'spacer. gif' ) . ' " style="'  . $sMargi nsAddon. $ style . '"  alt="' .  process_li ne_output(  $aFileNam e['med_tit le'] ) . ' " />';   877                $ret .=  '<img src= "' . getTe mplateIcon ( 'spacer. gif' ) . ' " style="'  . $sMargi nsAddon. $ style . '"  alt="' .  process_li ne_output(  $aFileNam e['med_tit le'] ) . ' " />';
1126           $r et .= '</a >';   878           $r et .= '</a >';
1127       $ret . = '</div>' ;   879       $ret . = '</div>' ;
1128     880  
1129       return  $ret;   881       return  $ret;
1130   }   882   }
1131     883  
1132   /*   884   /*
1133       Genera te Paginat ion functi on.   885       Genera te Paginat ion functi on.
1134       Genera tes string  like:   886       Genera tes string  like:
1135       << 1 . .. 3 4 [5]  6 7 ... 1 0 >>   887       << 1 . .. 3 4 [5]  6 7 ... 1 0 >>
1136       with l inks.   888       with l inks.
1137       attrli st:   889       attrli st:
1138       $pages Num - tota l number o f pages.   890       $pages Num - tota l number o f pages.
1139       $page  - current  page in se t.   891       $page  - current  page in se t.
1140       $pages Url - temp late of li nk for all  pages.   892       $pages Url - temp late of li nk for all  pages.
1141           Te mplate sho uld contai n {page} i nstruction  which   893           Te mplate sho uld contai n {page} i nstruction  which
1142           wi ll be repl aced by re al page nu mber.   894           wi ll be repl aced by re al page nu mber.
1143       $oTemp lConfig ->  paginatio nDifferenc e - define s number   895       $oTemp lConfig ->  paginatio nDifferenc e - define s number
1144           of  pages sho wn before  and after  current pa ge.   896           of  pages sho wn before  and after  current pa ge.
1145           If  paginatio nDifferenc e = 0 then  all pages  numbers w ill be sho wn without  skipping.   897           If  paginatio nDifferenc e = 0 then  all pages  numbers w ill be sho wn without  skipping.
1146   */   898   */
1147   function g enPaginati on( $pages Num, $page , $pagesUr l, $pagesO nclick = ' ' )   899   function g enPaginati on( $pages Num, $page , $pagesUr l, $pagesO nclick = ' ' )
1148   {   900   {
1149       global  $oTemplCo nfig;   901       global  $oTemplCo nfig;
1150          902       
1151       $pagin Diff = $oT emplConfig  -> pagina tionDiffer ence;   903       $pagin Diff = $oT emplConfig  -> pagina tionDiffer ence;
1152       $pagin From = ( $ paginDiff  ? ( $page  - $paginDi ff ) : 2 ) ;   904       $pagin From = ( $ paginDiff  ? ( $page  - $paginDi ff ) : 2 ) ;
1153       $pagin To   = ( $ paginDiff  ? ( $page  + $paginDi ff ) : ( $ pagesNum -  1 ) );   905       $pagin To   = ( $ paginDiff  ? ( $page  + $paginDi ff ) : ( $ pagesNum -  1 ) );
1154       $needD rop1 = $ne edDrop2 =  true;   906       $needD rop1 = $ne edDrop2 =  true;
1155          907       
1156       if( $p aginFrom < = 2 )   908       if( $p aginFrom < = 2 )
1157       {   909       {
1158           $p aginFrom =  2;   910           $p aginFrom =  2;
1159           $n eedDrop1 =  false;   911           $n eedDrop1 =  false;
1160       }   912       }
1161          913       
1162       if( $p aginTo >=  ( $pagesNu m - 1 ) )   914       if( $p aginTo >=  ( $pagesNu m - 1 ) )
1163       {   915       {
1164           $p aginTo = $ pagesNum -  1;   916           $p aginTo = $ pagesNum -  1;
1165           $n eedDrop2 =  false;   917           $n eedDrop2 =  false;
1166       }   918       }
1167          919       
1168       $ret =  '<div cla ss="pagina te">';   920       $ret =  '<div cla ss="pagina te">';
1169          921       
1170       if( $p age > 1 )   922       if( $p age > 1 )
1171            $ret   .=   genPageSwi tcher(   (   $page   -   1   ),   $pagesUrl,   $pagesOncl ick,   false,   ' << ',   _t('_Previ ous   page')   );   923            $ret   .=   genPageSwi tcher(   (   $page   -   1   ),   $pagesUrl,   $pagesOncl ick,   false,   ' &lt;&lt; ',   _t('_Previ ous   page')   );
1172       $ret . = genPageS witcher( 1 , $pagesUr l, $pagesO nclick, ($ page == 1)  );   924       $ret . = genPageS witcher( 1 , $pagesUr l, $pagesO nclick, ($ page == 1)  );
1173       $ret . = ($needDr op1 ? ' .. . ' : '');   925       $ret . = ($needDr op1 ? ' .. . ' : '');
1174       for( $ p = $pagin From; $p < = $paginTo ; $p++ )   926       for( $ p = $pagin From; $p < = $paginTo ; $p++ )
1175           $r et .= genP ageSwitche r( $p, $pa gesUrl, $p agesOnclic k, ($page  == $p) );   927           $r et .= genP ageSwitche r( $p, $pa gesUrl, $p agesOnclic k, ($page  == $p) );
1176       $ret . = ($needDr op2 ? ' .. . ' : '');   928       $ret . = ($needDr op2 ? ' .. . ' : '');
1177       $ret . = genPageS witcher( $ pagesNum,  $pagesUrl,  $pagesOnc lick, ($pa ge == $pag esNum) );   929       $ret . = genPageS witcher( $ pagesNum,  $pagesUrl,  $pagesOnc lick, ($pa ge == $pag esNum) );
1178       if( $p age < $pag esNum )   930       if( $p age < $pag esNum )
1179            $ret   .=   genPageSwi tcher(   (   $page   +   1   ),   $pagesUrl,   $pagesOncl ick,   false,   ' >> ',   _t('_Next   page')   );   931            $ret   .=   genPageSwi tcher(   (   $page   +   1   ),   $pagesUrl,   $pagesOncl ick,   false,   ' &gt;&gt; ',   _t('_Next   page')   );
1180          932       
1181       $ret . = '</div>' ;   933       $ret . = '</div>' ;
1182       return  $ret;   934       return  $ret;
1183   }   935   }
1184     936  
1185   /* This fu nction gen erates pag e link or  just a tex t (if page  is curren t)   937   /* This fu nction gen erates pag e link or  just a tex t (if page  is curren t)
1186       attrli st:   938       attrli st:
1187       $page  - integer  number of  page (will  be put in stead of { page} inst ruction to  template   939       $page  - integer  number of  page (will  be put in stead of { page} inst ruction to  template
1188       $link  - template  of page l ink   940       $link  - template  of page l ink
1189       $curre nt - defin es if page  link is a ctive or n ot (curren t page)   941       $curre nt - defin es if page  link is a ctive or n ot (curren t page)
1190       $sign  - string w hich is sh own instea d of page  number in  link text  ( Ex.: <<  )   942       $sign  - string w hich is sh own instea d of page  number in  link text  ( Ex.: <<  )
1191       $title  - alterna tive link  tip text ( <a title=" ..." ). Ex .: Previou s page   943       $title  - alterna tive link  tip text ( <a title=" ..." ). Ex .: Previou s page
1192   */   944   */
1193   function g enPageSwit cher( $pag e, $link,  $onclick =  '', $curr ent = fals e, $sign =  null, $ti tle = null  )   945   function g enPageSwit cher( $pag e, $link,  $onclick =  '', $curr ent = fals e, $sign =  null, $ti tle = null  )
1194   {   946   {
1195       if( !i sset( $sig n ) )   947       if( !i sset( $sig n ) )
1196           $s ign = $pag e;   948           $s ign = $pag e;
1197          949       
1198       if( !i sset( $tit le ) )   950       if( !i sset( $tit le ) )
1199           $t itle = $si gn;   951           $t itle = $si gn;
1200          952       
1201        $link      =  
str_replac e(   "{page}",   $page,   $link   )
;
  953        $link      =   htmlspecia lchars(   str_replac e(   "{page}",   $page,   $link   )   ) ;
1202        $onclick   =  
str_replac e(   "{page}",   $page,   $onclick   )
;
  954        $onclick   =   htmlspecia lchars(   str_replac e(   "{page}",   $page,   $onclick   )   ) ;
1203     955  
1204       if( $o nclick )   956       if( $o nclick )
1205           $a ddOn = " o nclick=\"$ onclick\"" ;   957           $a ddOn = " o nclick=\"$ onclick\"" ;
1206          958       
1207       $ret =  '';   959       $ret =  '';
1208       if( $c urrent )   960       if( $c urrent )
1209           $r et = " <i> $sign</i>  ";   961           $r et = " <i> $sign</i>  ";
1210       else   962       else
1211           $r et = " <a  href=\"$li nk\" title =\"$title\ "{$addOn}> $sign</a>  ";   963           $r et = " <a  href=\"$li nk\" title =\"$title\ "{$addOn}> $sign</a>  ";
1212          964       
1213       return  $ret;   965       return  $ret;
1214   }   966   }
1215     967  
    968   function g enResPerPa ge( $aValu es, $iCurr entValue,  $sResPerPa geTmpl ) {
    969       
    970       $sUrl  = htmlspec ialchars(  str_replac e( '{res_p er_page}',  "' + this .value + ' ", $sResPe rPageTmpl  ) );
    971       
    972       if( !i n_array( $ iCurrentVa lue, $aVal ues ) )
    973           $a Values[] =  $iCurrent Value;
    974       
    975       sort(  $aValues ) ;
    976       
    977       $sRet  = '<div cl ass="searc hResPerPag e">';
    978       
    979       $sRet  .= _t( '_R esults per  page' ) .  ': ';
    980       
    981       $sRet  .= "<selec t onchange =\"window. location =  '{$sUrl}' ;\">";
    982       
    983       foreac h( $aValue s as $iVal ue ) {
    984           $s Selected =  ( $iCurre ntValue ==  $iValue )  ? ' selec ted="selec ted"' : '' ;
    985           
    986           $s Ret .= '<o ption valu e="' . $iV alue . '"'  . $sSelec ted . '>'  . $iValue  . '</optio n>';
    987       }
    988       
    989       $sRet  .= '</sele ct>';
    990       
    991       $sRet  .= '</div> ';
    992       
    993       return  $sRet;
    994   }
    995  
    996  
1216   function g etMainLogo ()   997   function g etMainLogo ()
1217   {   998   {
1218       global  $dir;   999       global  $dir;
1219       global  $site;   1000       global  $site;
1220          1001       
1221       $ret =  '';   1002       $ret =  '';
1222          1003       
1223       foreac h( array(  'gif', 'jp g', 'png'  ) as $ext  )   1004       foreac h( array(  'gif', 'jp g', 'png'  ) as $ext  )
1224           if ( file_exi sts( $dir[ 'mediaImag es']."logo .$ext" ) )   1005           if ( file_exi sts( $dir[ 'mediaImag es']."logo .$ext" ) )
1225           {   1006           {
1226                $ret .=  '<a href=" ' . $site[ 'url'] . ' ">';   1007                $ret .=  '<a href=" ' . $site[ 'url'] . ' ">';
1227                    $ret  .= "<img  src=\"{$si te['mediaI mages']}lo go.$ext\"  class=\"ma inLogo\" a lt=\"logo\ " />";   1008                    $ret  .= "<img  src=\"{$si te['mediaI mages']}lo go.$ext\"  class=\"ma inLogo\" a lt=\"logo\ " />";
1228                $ret .=  '</a>';   1009                $ret .=  '</a>';
1229                break;   1010                break;
1230           }   1011           }
1231       return  $ret;   1012       return  $ret;
1232   }   1013   }
1233     1014  
1234   function g etPromoIma gesList ()    
1235   {    
1236       $photo s = getPro moImagesAr ray();    
1237           
1238       shuffl e( $photos  );    
1239           
1240       return  implode(  ',', $phot os );    
1241   }    
1242      
1243      
1244   function g etPromoIma gesArray()   1015   function g etPromoIma gesArray()
1245   {   1016   {
1246       global  $dir;   1017       global  $dir;
1247          1018       
1248       $aFile s = array( );   1019       $aFile s = array( );
1249          1020       
1250       $rDir  = opendir(  $dir['ima gesPromo']  );   1021       $rDir  = opendir(  $dir['ima gesPromo']  );
1251          1022       
1252        if(   $rDir   )
  1023        if(   $rDir   )   {
1253       {   1024            while(   $sFile   =   readdir(   $rDir   )   )   {
1254            while(   $sFile   =   readdir(   $rDir   )   )
   
1255           {    
1256                if( $sFi le == '.'  or $sFile  == '..' or  !is_file(  $dir['ima gesPromo']  . $sFile  ) )   1025                if( $sFi le == '.'  or $sFile  == '..' or  !is_file(  $dir['ima gesPromo']  . $sFile  ) )
1257                    cont inue;   1026                    cont inue;
1258                   1027                
1259                $aFiles[ ] = $sFile ;   1028                $aFiles[ ] = $sFile ;
1260           }   1029           }
1261           cl osedir( $r Dir );   1030           cl osedir( $r Dir );
1262       }   1031       }
1263          1032       
    1033       shuffl e( $aFiles  );
    1034       
1264       return  $aFiles;   1035       return  $aFiles;
1265   }   1036   }
1266     1037  
1267   function g enRSSHtmlO ut( $sUrl,  $iNum = 0  )   1038   function g etPromoCod e()
1268   {   1039   {
1269       $php_d ate_format  = getPara m( 'php_da te_format'  );   1040       global  $site;
1270          1041       global  $logged;
1271       $oRSS  = new BxRS S( $sUrl ) ;    
1272       if( !$ oRSS )    
1273           re turn '';    
1274           
1275       ob_sta rt()    
1276       ?>    
1277           <d iv class=" rss_feed_w rapper">    
1278       <?    
1279          1042       
1280       $iCoun ter = 0;   1043       if( ge tParam( 'e nable_flas h_promo' )  != 'on' )
    1044           $s Code = '<d iv class=" promo_code _wrapper"> ' . getPar am( 'custo m_promo_co de' ) . '< /div>';
    1045       else {
    1046           $a Images = g etPromoIma gesArray() ;
1281          1047           
1282        foreach(   $ oRSS   ->   ite m
s   as   $ o I te m  
)
  1048           $s ImagesEls  = '';
1283       {   1049            foreach   ($ aI m age s   as   $ s I
m g )
1284           $s Date = dat e( $php_da te_format,  strtotime ( $oItem - > pubDate  ) );   1050                $sImages Els .= '<i mg src="'. $site['ima gesPromo'] .$sImg.'"  />';
1285              1051           
1286            ?>   1052           $s PromoLink  = $site['u rl'] . ( $ logged['me mber'] ? ' member.php ' : 'join. php' );
1287                <div cla ss="rss_it em_wrapper ">   1053           $s Code = <<< EOF
1288                    <div  class="rs s_item_hea der">   1054                <script  type="text /javascrip t" src="{$ site['url' ]}inc/js/j query.dolP romo.js">< /script>
1289                         <a href="< ?= $oItem  -> link ?> "><?= html specialcha rs_adv( $o Item -> ti tle ) ?></ a>   1055                <script  type="text /javascrip t">
1290                     </ d i v >   1056                    $(do cument).re ady( funct ion() {
1291                    <div  class="rs s_item_inf o">   1057                         $( '#index Photo' ).d olPromo( 6 000, 0.281 25 );
1292                         <span><img  src="<?=  getTemplat eIcon( 'cl ock.gif' )  ?>" /><?=  $sDate ?> </span>   1058                     } );
1293                    </di v>   1059                 </ scr i pt >
1294                    <div  class="rs s_item_des c">   1060                <div id= "indexPhot o" onclick ="location ='$sPromoL ink'">
1295                         <?= htmlsp ecialchars _adv( $oIt em -> desc ription )  ?>   1061                    {$sI magesEls}
1296                    </di v>    
1297                </div>   1062                </div>
1298           <?   1063   EOF;
1299              1064  
1300           $i Counter ++ ;    
1301           if ( $iNum !=  0 and $iC ounter >=  $iNum )    
1302                break;    
1303       }   1065       }
1304          1066       
1305       ?>   1067        return   $sC o d e
;
1306                <div cla ss="rss_re ad_more">    
1307                    <a h ref="<?= $ oRSS -> li nk ?>"><?=  _t( '_Vis it Source'  ) ?></a>    
1308                </div>    
1309           </ div>    
1310       <?    
1311           
1312        return  
o b_get_cl e an() ;
   
1313   }   1068   }
1314     1069  
1315   function   get Sit e St at
($s Mod e   =   '' )
  1070   function   get T e mpl at eIcon (   $s FileNam e  
)
1316   {   1071   {
1317       global  $site;   1072       global  $site;
    1073       global  $dir;
    1074       global  $tmpl;
1318          1075  
1319       $iMin  = getParam ("member_o nline_time ");   1076       $sBase  = $dir['r oot'] . 't emplates/b ase/images /icons/' .  $sFileNam e;
1320          1077       $sTemp late = $di r['root']  . 'templat es/tmpl_'  . $tmpl .  '/images/i cons/' . $ sFileName;
1321       $aStat  = array(    
1322           
1323       'all'  => array(' capt'=>_t( "_Members" ),     'qu ery'=>"SEL ECT COUNT( `ID`) FROM  `Profiles ` WHERE `S tatus` = ' Active'",' link'=>'br owse.php', 'adm_query '=> "",'ad m_link'=>" profiles.p hp"),    
1324       'pph'  => array(' capt'=>_t( "_Photos") ,      'qu ery'=>"SEL ECT COUNT( `medID`) F ROM `share PhotoFiles ` WHERE `A pproved`=' true'",'li nk'=>'brow sePhoto.ph p','adm_qu ery'=> "", 'adm_link' =>""),    
1325       'evs'  => array(' capt'=>_t( "_Events") ,      'qu ery'=>"SEL ECT COUNT( `ID`) FROM  `SDatingE vents` WHE RE `Status `='Active' ",'link'=> 'events.ph p?show_eve nts=all&ac tion=show' ,'adm_quer y'=> "",'a dm_link'=> ""),    
1326       'onl'  => array(' capt'=>_t( "_Online") ,      'qu ery'=>"SEL ECT COUNT( `ID`) AS ` count_onl`  FROM `Pro files`  WH ERE `LastN avTime` >  SUBDATE(NO W(), INTER VAL $iMin  MINUTE)",' link'=>'se arch_resul t.php?onli ne_only=1' ,'adm_quer y'=> "", ' adm_link'= >""),    
1327       'pvi'  => array(' capt'=>_t( "_Videos") ,      'qu ery'=>"SEL ECT COUNT( `ID`) FROM  `RayMovie Files` WHE RE `Approv ed`='true' ",'link'=> 'browseVid eo.php','a dm_query'= > "", 'adm _link'=>"" ),    
1328       'pls'  => array(' capt'=>_t( "_Polls"),        'qu ery'=>"SEL ECT COUNT( `id_poll`)  FROM `Pro filesPolls ` WHERE `p oll_approv al`='1'",  'link'=>'p olls.php', 'adm_query '=> "",'ad m_link'=>" "),    
1329       'ntd'  => array(' capt'=>_t( "_New Toda y"),   'qu ery'=>"SEL ECT COUNT( `ID`) FROM  `Profiles ` WHERE `S tatus` = ' Active' AN D (TO_DAYS (NOW()) -  TO_DAYS(`L astReg`))  <= 1",'lin k'=>'','ad m_query'=>  "",'adm_l ink'=>""),    
1330       'pmu'  => array(' capt'=>_t( "_Music"),        'qu ery'=>"SEL ECT COUNT( `ID`) FROM  `RayMusic Files` WHE RE `Approv ed`='true' ",'link'=> 'browseMus ic.php','a dm_query'= > "",'adm_ link'=>"") ,    
1331       'tps'  => array(' capt'=>_t( "_Topics") ,      'qu ery'=>"SEL ECT IF( NO T ISNULL(  SUM(`forum _topics`)) , SUM(`for um_posts`) , 0) AS `N um` FROM ` pre_forum` ",'link'=> 'orca','ad m_query'=>  "",'adm_l ink'=>""),    
1332       'nwk'  => array(' capt'=>_t( "_This Wee k"),   'qu ery'=>"SEL ECT COUNT( `ID`) FROM  `Profiles ` WHERE `S tatus` = ' Active' AN D (TO_DAYS (NOW()) -  TO_DAYS(`L astReg`))  <= 7",'lin k'=>'','ad m_query'=>  "",'adm_l ink'=>""),    
1333       'pvd'  => array(' capt'=>_t( "_Profile  Videos"),  'query'=>" SELECT `Ap proved` FR OM `RayVid eoStats`", 'link'=>'' ,'adm_quer y'=> "",'a dm_link'=> "",'hide'= >false),    
1334       'pts'  => array(' capt'=>_t( "_Posts"),        'qu ery'=>"SEL ECT IF( NO T ISNULL(  SUM(`forum _posts`)),  SUM(`foru m_posts`),  0) AS `Nu m` FROM `p re_forum`  ",'link'=> 'orca','ad m_query'=>  "",'adm_l ink'=>""),    
1335       'nmh'  => array(' capt'=>_t( "_This Mon th"),  'qu ery'=>"SEL ECT COUNT( `ID`) FROM  `Profiles ` WHERE `S tatus` = ' Active' AN D (TO_DAYS (NOW()) -  TO_DAYS(`L astReg`))  <= 30",'li nk'=>'','a dm_query'= > "",'adm_ link'=>"") ,    
1336       'tgs'  => array(' capt'=>_t( "_Tags"),         'qu ery'=>"SEL ECT COUNT(  DISTINCT  `Tag` ) FR OM `Tags`" ,'link'=>' ','adm_que ry'=> "",' adm_link'= >""),    
1337       'ars'  => array(' capt'=>_t( "_Articles "),    'qu ery'=>"SEL ECT COUNT( `ArticlesI D`) FROM ` Articles`" ,'link'=>' articles.p hp','adm_q uery'=> "" ,'adm_link '=>""),    
1338       'nyr'  => array(' capt'=>_t( "_This Yea r"),   'qu ery'=>"SEL ECT COUNT( `ID`) FROM  `Profiles ` WHERE `S tatus` = ' Active' AN D (TO_DAYS (NOW()) -  TO_DAYS(`L astReg`))  <= 365",'l ink'=>'',' adm_query' => "",'adm _link'=>"" ),    
1339       'grs'  => array(' capt'=>_t( "_Groups") ,      'qu ery'=>"SEL ECT COUNT( `ID`) FROM  `Groups`  WHERE `sta tus`='Acti ve'",'link '=>'groups _home.php' ,'adm_quer y'=> "",'a dm_link'=> ""),    
1340       'cls'  => array(' capt'=>_t( "_Classifi eds"), 'qu ery'=>"SEL ECT COUNT( `ID`) FROM  `Classifi edsAdverti sements` W HERE `Stat us`='activ e'",'link' =>'classif ieds.php?B rowse=1',' adm_query' => "",'adm _link'=>"" ),    
1341       'frs'  => array(' capt'=>_t( "_Friends" ),     'qu ery'=>"SEL ECT COUNT( `ID`) FROM  `FriendLi st` WHERE  `Check`='1 '",'link'= >'','adm_q uery'=> "" ,'adm_link '=>"")    
1342           
1343       );    
1344          1078  
1345       if ($s Mode == 'a dmin')   1079       if( ex tFileExist s( $sTempl ate ) )
1346       {   1080       {
1347           $a Admin = ar ray(   1081           $i conUrl = $ site['icon s'] . $sFi leName;
1348               
1349           'a ll'=>array ('adm_quer y'=>"SELEC T COUNT(`I D`) FROM ` Profiles`  WHERE `Sta tus`!='Act ive'",'adm _link'=>'p rofiles.ph p?profiles =Approval' ),    
1350           'p ph'=>array ('adm_quer y'=>"SELEC T COUNT(`m edID`) FRO M `sharePh otoFiles`  WHERE `App roved`='fa lse'",'adm _link'=>'b rowsePhoto .php'),    
1351           'e vs'=>array ('adm_quer y'=>"SELEC T COUNT(`I D`) FROM ` SDatingEve nts` WHERE  `Status`! ='Active'" ,'adm_link '=>'sdatin g_admin.ph p'),    
1352           'o nl'=>array ('adm_quer y'=>"",'ad m_link'=>' '),    
1353           'p vi'=>array ('adm_quer y'=>"SELEC T COUNT(`I D`) FROM ` RayMovieFi les` WHERE  `Approved `!='true'" ,'adm_link '=>'browse Video.php' ),    
1354           'p ls'=>array ('adm_quer y'=>"SELEC T COUNT(`i d_poll`) F ROM `Profi lesPolls`  WHERE `pol l_approval `!='1'",'a dm_link'=> 'post_mod_ ppolls.php '),    
1355           'n td'=>array ('adm_quer y'=>"",'ad m_link'=>' '),    
1356           'p mu'=>array ('adm_quer y'=>"SELEC T COUNT(`I D`) FROM ` RayMusicFi les` WHERE  `Approved `!='true'" ,'adm_link '=>'browse Music.php' ),    
1357           't ps'=>array ('adm_quer y'=>"",'ad m_link'=>' '),    
1358           'n wk'=>array ('adm_quer y'=>"",'ad m_link'=>' '),    
1359           't gs'=>array ('adm_quer y'=>"",'ad m_link'=>' '),    
1360           'p ts'=>array ('adm_quer y'=>"",'ad m_link'=>' '),    
1361           'n mh'=>array ('adm_quer y'=>"",'ad m_link'=>' '),    
1362           'f rs'=>array ('adm_quer y'=>"",'ad m_link'=>' '),    
1363           'a rs'=>array ('adm_quer y'=>"",'ad m_link'=>' articles.p hp'),    
1364           'n yr'=>array ('adm_quer y'=>"",'ad m_link'=>' '),    
1365           'g rs'=>array ('adm_quer y'=>"SELEC T COUNT(`I D`) FROM ` Groups` WH ERE `statu s`!='Activ e'",'adm_l ink'=>'gro ups.php'),    
1366           'c ls'=>array ('adm_quer y'=>"SELEC T COUNT(`I D`) FROM ` Classified sAdvertise ments` WHE RE `Status ` != 'acti ve'",'adm_ link'=>'ma nage_class ifieds.php '),    
1367           'p vd'=>array ('adm_quer y'=>"",'ad m_link'=>' javascript :window.op en(\'../ra y/modules/ video/app/ admin.swf? nick={admi nLogin}&pa ssword={ad minPass}&u rl=../../. ./XML.php\ ',\'RayVid eoAdmin\', \'width=70 0,height=3 30,toolbar =0,directo ries=0,men ubar=0,sta tus=0,loca tion=0,scr ollbars=0, resizable= 0\');')    
1368           );    
1369           $s Add = '_a' ;    
1370           $s ProfVideo  = getAppli cationCont ent('video ', 'stat',  array(),  true);    
1371       }   1082       }
1372       else   1083       else
1373       {   1084       {
1374           $a Admin = '' ;   1085           if ( extFileE xists( $di r['base']  . 'images/ icons/' .  $sFileName  ) )
1375           $s ProfVideo  = '';   1086           {
    1087                $iconUrl  = $site[' base'] . ' images/ico ns/' . $sF ileName;
1376       }   1088           }
1377       $sCode   = $sProf Video.'<di v>';   1089           el se
    1090           {
    1091                $iconUrl  = getTemp lateIcon(  'spacer.gi f' );
    1092           }
    1093       }
    1094  
    1095       return  $iconUrl;
    1096   }
    1097  
    1098   function g etVersionC omment()
    1099   {
    1100       global  $site;
    1101       $aVer  = explode(  '.', $sit e['ver'] ) ;
    1102       
    1103       // ver sion outpu t made for  debug pos sibilities .
    1104       // ran domizing m ade for se curity iss ues. do no t change i t...
    1105       $aVerR [0] = $aVe r[0];
    1106       $aVerR [1] = rand ( 0, 100 ) ;
    1107       $aVerR [2] = $aVe r[1];
    1108       $aVerR [3] = rand ( 0, 100 ) ;
    1109       $aVerR [4] = $sit e['build'] ;
    1110       
    1111       //remo ve leading  zeros
    1112       while(  $aVerR[4] [0] === '0 ' )
    1113           $a VerR[4] =  substr( $a VerR[4], 1  );
    1114       
    1115       return  '<!-- ' .  implode(  ' ', $aVer R ) . ' -- >';
    1116   }
    1117  
    1118   // ------- ---------- ---------- -------- s ite statis tick funct ions ----- ---------- ---------- ---------- ---//
1378     1119  
1379       foreac h ($aStat  as $sKey = > $sVal)   1120   function g etSiteStat Body($aVal , $sMode =  '')
1380       {   1121   {
1381            $sLink   =   strlen($ s Val['link' ])   >   0   ?   '<a   href="'.$s ite['url'] .$ s Val['link' ].'">'.
$ s Val['capt' ]
.'</a>'   :  
$ s Val['capt' ]  
;
  1122       global  $site;
1382            if   ($s Val['hide' ]   ===   true   &&   $s Mode   !=   'admin')   continue;   1123       
1383           if  ( !is_arr ay($aAdmin ) )   1124        $sLink   =   strlen($ a Val['link' ])   >   0   ?   '<a   href="'.$s ite['url'] .$ a Val['link' ].'">'. _t('_'. $ a Val['capt' ] ) .'</a>'   :   _t('_'. $ a Val['capt' ] )   ;
    1125        if   (   $s
Mode   !=   'admin'   )
1384           {   1126       {
1385                 $iNum   =   strlen($ s Val['query '])   >   0   ?   db_value($ s Val['query '])   :   0;   1127           $s BlockId =  '';
1386                 if   ($ sK e y   ==   'pls')   1128            $iNum   =   strlen($ a Val['query '])   >   0   ?   db_value($ a Val['query '])   :   0;
    1129            if   ($ aVal['nam e ']   ==   'pls')
1387                {   1130           {
1388                    $iNu m = $iNum  + db_value ("SELECT C OUNT(`ID`)  FROM `pol ls_q` WHER E `Active` ='on'");   1131                $iNum =  $iNum + db _value("SE LECT COUNT (`ID`) FRO M `polls_q ` WHERE `A ctive`='on '");
1389                }   1132           }
1390           }   1133       }
1391           el se   1134       else
1392           {   1135       {
1393                 $iNum    =   strlen($a Admin[$sKe y] ['adm_quer y'])   >   0   ?   db_value($ a Admin[$sKe y] ['adm_quer y'])   :   0;   1136           $s BlockId =  "id='{$aVa l['name']} '";
1394                 if   (   strlen($a Admin[$sKe y] ['adm_link '])   >   0   )   1137            $iNum    =   strlen($a Val ['adm_quer y'])   >   0   ?   db_value($ a Val ['adm_quer y'])   :   0;
    1138            if   (   strlen($a Val ['adm_link '])   >   0   )
1395                {   1139           {
1396                     if(   substr(   $a Admin[$sKe y] ['adm_link '],   0,   strlen(   'javascrip t:'   )   )   ==   'javascrip t:'   )   //   smile   :))   1140                 if(   substr(   $a Val ['adm_link '],   0,   strlen(   'javascrip t:'   )   )   ==   'javascrip t:'   )   //   smile   :))
1397                    {   1141                {
1398                         $sHref = ' javascript :void(0);' ;   1142                    $sHr ef = 'java script:voi d(0);';
1399                         $sOnclick   =   'onclick=" '   .   $a Admin[$sKe y] ['adm_link ']   .   '"';   1143                     $sOnclick   =   'onclick=" '   .   $a Val ['adm_link ']   .   '"';
1400                           1144                        
1401                         $aAdmin =  db_arr( "S ELECT * FR OM `Admins ` LIMIT 1"  );   1145                    $aAd min = db_a rr( "SELEC T * FROM ` Admins` LI MIT 1" );
1402                         $sOnclick  = str_repl ace( '{adm inLogin}',  $aAdmin[' Name'], $s Onclick );   1146                    $sOn click = st r_replace(  '{adminLo gin}', $aA dmin['Name '], $sOncl ick );
1403                         $sOnclick  = str_repl ace( '{adm inPass}',   $aAdmin[' Password'] , $sOnclic k );   1147                    $sOn click = st r_replace(  '{adminPa ss}',  $aA dmin['Pass word'], $s Onclick );
1404                    }   1148                }
1405                    else   1149                else
1406                    {   1150                {
1407                         $sHref   =   $a Admin[$sKe y] ['adm_link '];   1151                     $sHref   =   $a Val ['adm_link '];
1408                         $sOnclick  = '';   1152                    $sOn click = '' ;
1409                    }   1153                }
1410                     $sLink   =   '<a   href="'.$s Href.'"   '.$sOnclic k.'>'.
$ s Val['capt' ]
.'</a>';
  1154                 $sLink   =   '<a   href="'.$s Href.'"   '.$sOnclic k.'>'. _t('_'. $ a Val['capt' ] ) .'</a>';
1411                }   1155           }
1412                else   1156           el se
1413                {   1157           {
1414                     $sLink   =  
$ s Val['capt' ]
;
  1158                 $sLink   =   _t('_'. $ a Val['capt' ] ) ;
1415                }   1159           }
1416                if ($sKe y == 'pls' )   1160           if  ($sKey ==  'pls')
1417                {   1161           {
1418                    $iNu m = $iNum  + db_value ("SELECT C OUNT(`ID`)  FROM `pol ls_q` WHER E `Active` <>'on'");   1162                $iNum =  $iNum + db _value("SE LECT COUNT (`ID`) FRO M `polls_q ` WHERE `A ctive`<>'o n'");
1419                }   1163           }
1420           }   1164       }
1421              1165       $sCode  .= '<div  class="sit eStatUnit"  '. $sBloc kId .'><im g src="'.g etTemplate Icon($aVal ['icon']). '" alt=""  /> '.$iNum .' '.$sLin k.'</div>' ;
1422           sw itch ($sKe y)    
1423           {    
1424                case 'al l':    
1425                case 'on l':    
1426                case 'nt d':    
1427                case 'nw k':    
1428                case 'nm h':    
1429                case 'ny r':    
1430                    $sIc on = 'mbs. gif';    
1431                    brea k;    
1432                case 'al l':    
1433                    $sIc on = 'us.g if';    
1434                    brea k;    
1435                case 'pv i':    
1436                case 'pv d':    
1437                    $sIc on = 'pvi. gif';    
1438                    brea k;    
1439                default:    
1440                    $sIc on = $sKey .'.gif';      
1441           }    
1442               
1443           $s Code .= '< div class= "siteStatU nit" id="' .$sKey.$sA dd.'"><img  src="'.ge tTemplateI con($sIcon ).'" /> '. $iNum.' '. $sLink.'</ div>';    
1444       }    
1445           
1446       $sCode  .= '</div ><div clas s="clear_b oth"></div >';    
1447          1166           
1448       return  $sCode;   1167       return  $sCode;
1449   }   1168   }
1450     1169  
1451   function   get PromoCod e
()
  1170   function   get Sit e StatAdmin ()
1452   {   1171   {
1453       global  $site;   1172       global  $site;
    1173       global  $dir;
1454          1174       
1455       if( ge tParam( 'e nable_flas h_promo' )  == 'on' )   1175       $aAdmi n = '';
1456           $s Code = get Param( 'fl ash_promo_ code' );   1176       $sProf Video = '' ;
1457       else   1177       $sAdd  = '_a';
1458           $s Code = '<d iv class=" promo_code _wrapper"> ' . getPar am( 'custo m_promo_co de' ) . '< /div>';   1178       $sProf Video = ge tApplicati onContent( 'video', ' stat', arr ay(), true );
1459          1179       
1460       $aRepl ace = arra y(   1180       $sqlQu ery = "SEL ECT `Name`  as `name` ,
1461           'i mages'            =>  $site['ima ges'],   1181                             `Title ` as `capt `,
1462           'W elcome'           =>  _t( '_Welc ome' ),   1182                             `UserQ uery` as ` query`,
1463           'T o_The_Comm unity' =>  _t( '_To T he Communi ty' ),   1183                             `UserL ink` as `l ink`,
1464           'p romo_url'         =>  $site['ima gesPromo'] ,   1184                             `IconN ame` as `i con`,
1465           'p romo_image s'     =>  getPromoIm agesList() ,   1185                             `Admin Query` as  `adm_query `,
1466           );   1186                             `Admin Link` as ` adm_link`
    1187                             FROM ` SiteStat`" ;
1467          1188       
    1189       $rData  = db_res( $sqlQuery) ;
1468          1190       
1469       foreac h( $aRepla ce as $sKe y => $sVal ue )   1191       $sCode   = $sProf Video.'<di v>';
1470           $s Code = str _replace(  "__{$sKey} __", $sVal ue, $sCode  );   1192       
    1193       $fStat  = @fopen( BX_DIRECTO RY_PATH_IN C . 'db_ca ched/SiteS tat.inc',  'w');
    1194       if( !$ fStat )
    1195                return f alse;
    1196  
    1197       fwrite ($fStat, " return arr ay( \n");
    1198       $sLine  = '';
    1199  
    1200       while  ($aVal = m ysql_fetch _assoc($rD ata))
    1201       {
    1202           $s Code .= ge tSiteStatB ody($aVal,  'admin');
    1203           $s Line .= ge nSiteStatF ile($aVal) ;
    1204       }
    1205       
    1206       $sLine  = rtrim($ sLine, ",\ n")."\n);" ;
    1207       fwrite ($fStat, $ sLine);
    1208       fclose ($fStat);
    1209       
    1210       $sCode  .= '</div ><div clas s="clear_b oth"></div >';
1471          1211       
1472       return  $sCode;   1212       return  $sCode;
1473   }   1213   }
1474     1214  
1475   function   get T e mpl at eIcon(   $ s FileNam e  
)
  1215   function   get Sit e St at U s
e r( )
1476   {   1216   {
1477       global  $site;    
1478       global  $dir;   1217       global  $dir;
1479        global   $
t mpl ;
  1218        global   $ aSta t
;
1480     1219       
1481       $sBase  = $dir['r oot'] . 't emplates/b ase/images /icons/' .  $sFileNam e;   1220       $aStat  = @eval(  @file_get_ contents(  BX_DIRECTO RY_PATH_IN C . 'db_ca ched/SiteS tat.inc' ) );
1482       $sTemp late = $di r['root']  . 'templat es/tmpl_'  . $tmpl .  '/images/i cons/' . $ sFileName;    
1483     1221       
1484       if( ex tFileExist s( $sTempl ate ) )   1222       if( !$ aStat )
1485       {   1223           $a Stat = arr ay();
1486           $i conUrl = $ site['icon s'] . $sFi leName;    
1487       }    
1488       else    
1489       {    
1490           if ( extFileE xists( $di r['base']  . 'images/ icons/' .  $sFileName  ) )    
1491           {    
1492                $iconUrl  = $site[' base'] . ' images/ico ns/' . $sF ileName;    
1493           }    
1494           el se    
1495           {    
1496                $iconUrl  = getTemp lateIcon(  'spacer.gi f' );    
1497           }    
1498       }    
1499     1224  
1500        return   $ ic o nUrl ;   1225       $sCode   = $sProf Video.'<di v>';
    1226  
    1227       foreac h($aStat a s $aVal)
    1228           $s Code .= ge tSiteStatB ody($aVal) ;
    1229       
    1230       $sCode  .= '</div ><div clas s="clear_b oth"></div >';
    1231       
    1232        return   $ sC o de ;
1501   }   1233   }
1502     1234  
1503   function   ge
t V e rs i onComm e nt (
)
  1235   function   ge nSi t
e StatF i l e
( $aVal )
1504   {   1236   {
1505       global  $site;    
1506       $aVer  = explode(  '.', $sit e['ver'] ) ;    
1507          1237       
1508       // ver sion outpu t made for  debug pos sibilities .   1238       $oMenu  = new BxD olMenu();
1509       // ran domizing m ade for se curity iss ues. do no t change i t...    
1510       $aVerR [0] = $aVe r[0];    
1511       $aVerR [1] = rand ( 0, 100 ) ;    
1512       $aVerR [2] = $aVe r[1];    
1513       $aVerR [3] = rand ( 0, 100 ) ;    
1514       $aVerR [4] = $sit e['build'] ;    
1515          1239       
1516       //remo ve leading  zeros   1240       $sLink  = $oMenu  -> getCurr Link($aVal ['link']);
1517       while(  $aVerR[4] [0] === '0 ' )   1241       $sLine  = "'{$aVa l['name']} '=>array(' capt'=>'{$ aVal['capt ']}', 'que ry'=>'".ad dslashes($ aVal['quer y'])."', ' link'=>'$s Link', 'ic on'=>'{$aV al['icon'] }'),\n";
1518           $a VerR[4] =  substr( $a VerR[4], 1  );    
1519          1242       
1520       return  '<!-- ' .  implode(  ' ', $aVer R ) . ' -- >';   1243       return  $sLine;
1521   }   1244   }
1522     1245  
1523   ?>   1246   ?>