788. File Comparison Report

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

788.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.0.5 guestbook.php Thu Sep 20 09:00:20 2007 UTC
2 Dolphin-v.6.1.0 guestbook.php Thu Mar 27 04:18:34 2008 UTC

788.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 752
Changed 0 0
Inserted 0 0
Removed 1 1

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

788.4 Active regular expressions

No regular expressions were active.

788.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( 'inc/h eader.inc. php' );   21   require_on ce( 'inc/h eader.inc. php' );
22   require_on ce( BX_DIR ECTORY_PAT H_INC . 'd esign.inc. php' );   22   require_on ce( BX_DIR ECTORY_PAT H_INC . 'd esign.inc. php' );
23   require_on ce( BX_DIR ECTORY_PAT H_INC . 'p rofiles.in c.php' );   23   require_on ce( BX_DIR ECTORY_PAT H_INC . 'p rofiles.in c.php' );
24   require_on ce( BX_DIR ECTORY_PAT H_INC . 'p rofile_dis p.inc.php'  );    
25   require_on ce( BX_DIR ECTORY_PAT H_INC . 'u tils.inc.p hp' );   24   require_on ce( BX_DIR ECTORY_PAT H_INC . 'u tils.inc.p hp' );
26     25  
27   // Authent ification  no require d here. Ju st check i f somebody  logged in .   26   // Authent ification  no require d here. Ju st check i f somebody  logged in .
28     27  
29   if ( !( $l ogged['adm in'] = mem ber_auth(  1, false )  ) )   28   if ( !( $l ogged['adm in'] = mem ber_auth(  1, false )  ) )
30       if ( ! ( $logged[ 'member']  = member_a uth( 0, fa lse ) ) )   29       if ( ! ( $logged[ 'member']  = member_a uth( 0, fa lse ) ) )
31           if  ( !( $log ged['aff']  = member_ auth( 2, f alse )) )   30           if  ( !( $log ged['aff']  = member_ auth( 2, f alse )) )
32                $logged[ 'moderator '] = membe r_auth( 3,  false );   31                $logged[ 'moderator '] = membe r_auth( 3,  false );
33     32  
34     33  
35   // ------- -------- p age variab les and lo gin   34   // ------- -------- p age variab les and lo gin
36     35  
37   $_page['na me_index']     = 47;   36   $_page['na me_index']     = 47;
38   $_page['cs s_name']       = 'gue stbook.css ';   37   $_page['cs s_name']       = 'gue stbook.css ';
39   $_page['ex tra_js'] =  $oTemplCo nfig -> sT inyMceEdit orJS;   38   $_page['ex tra_js'] =  $oTemplCo nfig -> sT inyMceEdit orJS;
40     39  
41     40  
42   $period =  1; // time  period be fore user  can add an other reco rd (in min utes)   41   $period =  1; // time  period be fore user  can add an other reco rd (in min utes)
43   $records_o n_page = 1 6; // numb er of reco rds at the  page   42   $records_o n_page = 1 6; // numb er of reco rds at the  page
44   $record_ma xlength =  1600; // m ax length  of record   43   $record_ma xlength =  1600; // m ax length  of record
45   $record_li mit = 100;  // maximu m number o f records  in the gue st book   44   $record_li mit = 100;  // maximu m number o f records  in the gue st book
46     45  
47     46  
48   $_page['he ader'] = _ t("_guestb ook");   47   $_page['he ader'] = _ t("_guestb ook");
49   /* $_page[ 'header_te xt'] = ('g 4' != $tmp l) ? _t("_ guestbook" ) : "<img  src=\"{$si te['images ']}guestbo ok.gif\">" ; */   48   /* $_page[ 'header_te xt'] = ('g 4' != $tmp l) ? _t("_ guestbook" ) : "<img  src=\"{$si te['images ']}guestbo ok.gif\">" ; */
50   $_page['he ader_text' ] =_t("_gu estbook");   49   $_page['he ader_text' ] =_t("_gu estbook");
51   // ------- -------- p age compon ents   50   // ------- -------- p age compon ents
52     51  
53   //$w_ex =  20;   52   //$w_ex =  20;
54     53  
55   $_ni = $_p age['name_ index'];   54   $_ni = $_p age['name_ index'];
56     55  
57   $_page_con t[$_ni]['p age_main_c ode'] = Th isPageMain Code();   56   $_page_con t[$_ni]['p age_main_c ode'] = Th isPageMain Code();
58     57  
59   // ------- -------- [ END] page  components   58   // ------- -------- [ END] page  components
60     59  
61   PageCode() ;   60   PageCode() ;
62     61  
63   // ------- -------- p age compon ents funct ions   62   // ------- -------- p age compon ents funct ions
64     63  
65   /**   64   /**
66    * page co de functio n   65    * page co de functio n
67    */   66    */
68   function T hisPageMai nCode()   67   function T hisPageMai nCode()
69   {   68   {
70       global  $logged;   69       global  $logged;
71     70  
72       $ret =  "";   71       $ret =  "";
73     72  
74       $membe r['ID'] =  (int)$_COO KIE['membe rID'];   73       $membe r['ID'] =  (int)$_COO KIE['membe rID'];
75       $owner  = $_REQUE ST['owner' ] ? (int)$ _REQUEST[' owner'] :  (int)$_COO KIE['membe rID'];   74       $owner  = $_REQUE ST['owner' ] ? (int)$ _REQUEST[' owner'] :  (int)$_COO KIE['membe rID'];
76     75  
77       // Che ck if memb ership all ows this a ction   76       // Che ck if memb ership all ows this a ction
78       $check _res = che ckAction(  $member['I D'], ACTIO N_ID_VIEW_ GUESTBOOK  );   77       $check _res = che ckAction(  $member['I D'], ACTIO N_ID_VIEW_ GUESTBOOK  );
79       if ( $ check_res[ CHECK_ACTI ON_RESULT]  != CHECK_ ACTION_RES ULT_ALLOWE D && !$log ged['admin '] && $mem ber['ID']  != $owner  )   78       if ( $ check_res[ CHECK_ACTI ON_RESULT]  != CHECK_ ACTION_RES ULT_ALLOWE D && !$log ged['admin '] && $mem ber['ID']  != $owner  )
80       {   79       {
81           $r et .= "<br  />   80           $r et .= "<br  />
82                <table w idth=\"100 %\" cellpa dding=1 ce llspacing= 1 border=0 >   81                <table w idth=\"100 %\" cellpa dding=1 ce llspacing= 1 border=0 >
83                    <tr>   82                    <tr>
84                         <td class= text align =center>   83                         <td class= text align =center>
85                             <br /> ". $check_ res[CHECK_ ACTION_MES SAGE] ."<b r />   84                             <br /> ". $check_ res[CHECK_ ACTION_MES SAGE] ."<b r />
86                         </td>   85                         </td>
87                    </tr >   86                    </tr >
88                </table> \n";   87                </table> \n";
89           re turn $ret;   88           re turn $ret;
90       }   89       }
91          90       
92       $check _res = che ckAction(  $owner, AC TION_ID_US E_GUESTBOO K );   91       $check _res = che ckAction(  $owner, AC TION_ID_US E_GUESTBOO K );
93       if( $c heck_res[C HECK_ACTIO N_RESULT]  != CHECK_A CTION_RESU LT_ALLOWED  && !$logg ed['admin' ] )   92       if( $c heck_res[C HECK_ACTIO N_RESULT]  != CHECK_A CTION_RESU LT_ALLOWED  && !$logg ed['admin' ] )
94       {   93       {
95           $r et .= $mem ber['ID']  == $owner  ? $check_r es[CHECK_A CTION_MESS AGE] : _t_ err("_This  guestbook  disabled  by it's ow ner");   94           $r et .= $mem ber['ID']  == $owner  ? $check_r es[CHECK_A CTION_MESS AGE] : _t_ err("_This  guestbook  disabled  by it's ow ner");
96           re turn $ret;   95           re turn $ret;
97       }   96       }
98          97       
99       if( $_ GET['actio n'] == 'sh ow_add' &&  $_GET['ow ner'] )   98       if( $_ GET['actio n'] == 'sh ow_add' &&  $_GET['ow ner'] )
100       {   99       {
101           $r et .= Show AddRecord( );   100           $r et .= Show AddRecord( );
102           re turn $ret;   101           re turn $ret;
103       }   102       }
104          103       
105       if( $_ POST['acti on'] == 'n ew' && $_P OST['owner '] && strl en($_POST[ 'newrecord ']) )   104       if( $_ POST['acti on'] == 'n ew' && $_P OST['owner '] && strl en($_POST[ 'newrecord ']) )
106           $r et .= AddR ecord();   105           $r et .= AddR ecord();
107     106  
108       if( $_ GET['actio n'] == 'de lete' && $ _GET['owne r'] && (in t)$_GET['d elete_id']  != 0 )   107       if( $_ GET['actio n'] == 'de lete' && $ _GET['owne r'] && (in t)$_GET['d elete_id']  != 0 )
109           $r et .= Dele teRecord() ;   108           $r et .= Dele teRecord() ;
110     109  
111       $ret . = PrintGue stbook();   110       $ret . = PrintGue stbook();
112     111  
113       return  $ret;   112       return  $ret;
114   }   113   }
115     114  
116   function P rintGuestb ook()   115   function P rintGuestb ook()
117   {   116   {
118       global  $logged;   117       global  $logged;
119       global  $site;   118       global  $site;
120       global  $records_ on_page;   119       global  $records_ on_page;
121       global  $date_for mat;   120       global  $date_for mat;
122       global  $oTemplCo nfig;   121       global  $oTemplCo nfig;
123     122  
124       $ret =  "";   123       $ret =  "";
125       $owner  = $_REQUE ST['owner' ] ? (int)$ _REQUEST[' owner'] :  (int)$_COO KIE['membe rID'];   124       $owner  = $_REQUE ST['owner' ] ? (int)$ _REQUEST[' owner'] :  (int)$_COO KIE['membe rID'];
126       $id =  ($_COOKIE[ 'memberID' ] ? $_COOK IE['member ID'] : 0);   125       $id =  ($_COOKIE[ 'memberID' ] ? $_COOK IE['member ID'] : 0);
127       $from  = (int)$_R EQUEST['fr om'];   126       $from  = (int)$_R EQUEST['fr om'];
128     127  
129       if ( ! $owner )   128       if ( ! $owner )
130           re turn $ret;   129           re turn $ret;
131     130  
132       // Pri nt owner's  informati on   131       // Pri nt owner's  informati on
133       $ret . = "<br />   132       $ret . = "<br />
134           <t able width =\"100%\"  cellpaddin g=\"0\" ce llspacing= \"0\" bord er=\"0\">   133           <t able width =\"100%\"  cellpaddin g=\"0\" ce llspacing= \"0\" bord er=\"0\">
135                <tr>   134                <tr>
136                    <td  colspan=\" 2\">" .   135                    <td  colspan=\" 2\">" .
137                         ProfileDet ails( $own er ) .   136                         ProfileDet ails( $own er ) .
138                    "</t d>   137                    "</t d>
139                </tr>   138                </tr>
140           </ table>\n";   139           </ table>\n";
141     140  
142       // Pri nt page co ntrols   141       // Pri nt page co ntrols
143       $recor ds_num = d b_arr("SEL ECT COUNT(  * ) AS `r ec_num` FR OM `Guestb ook` WHERE  `Recipien t` = '{$ow ner}'");   142       $recor ds_num = d b_arr("SEL ECT COUNT(  * ) AS `r ec_num` FR OM `Guestb ook` WHERE  `Recipien t` = '{$ow ner}'");
144       if ( $ records_nu m['rec_num '] > $reco rds_on_pag e )   143       if ( $ records_nu m['rec_num '] > $reco rds_on_pag e )
145       {   144       {
146           $r et .= "<br  />   145           $r et .= "<br  />
147                <table b order=\"0\ " cellpadd ing=\"1\"  cellspacin g=\"1\" wi dth=\"100% \">   146                <table b order=\"0\ " cellpadd ing=\"1\"  cellspacin g=\"1\" wi dth=\"100% \">
148                    <tr>   147                    <tr>
149                         <td align= \"center\"  class=\"t ext\">";   148                         <td align= \"center\"  class=\"t ext\">";
150     149  
151           if ( $from >=  $records_ on_page )   150           if ( $from >=  $records_ on_page )
152           {   151           {
153                $nfrom =  (0 < ($fr om - $reco rds_on_pag e)) ? ($fr om - $reco rds_on_pag e) : 0;   152                $nfrom =  (0 < ($fr om - $reco rds_on_pag e)) ? ($fr om - $reco rds_on_pag e) : 0;
154                $ret .=  "   153                $ret .=  "
155                             <a hre f=\"guestb ook.php?ow ner={$owne r}&from={$ nfrom}\">& lt;&lt;&nb sp;</a>";   154                             <a hre f=\"guestb ook.php?ow ner={$owne r}&from={$ nfrom}\">& lt;&lt;&nb sp;</a>";
156           }   155           }
157     156  
158           $i  = 0;   157           $i  = 0;
159           $p ages = 1;   158           $p ages = 1;
160           wh ile ( $i <  $records_ num['rec_n um'] )   159           wh ile ( $i <  $records_ num['rec_n um'] )
161           {   160           {
162                if ($i = = $from)   161                if ($i = = $from)
163                    $ret  .= "   162                    $ret  .= "
164                             {$page s}&nbsp;";   163                             {$page s}&nbsp;";
165                else   164                else
166                    $ret  .= "   165                    $ret  .= "
167                             <a hre f=\"guestb ook.php?ow ner={$owne r}&from=".  $i ."\">{ $pages}&nb sp;</a>";   166                             <a hre f=\"guestb ook.php?ow ner={$owne r}&from=".  $i ."\">{ $pages}&nb sp;</a>";
168                $i = $i  + $records _on_page;   167                $i = $i  + $records _on_page;
169                $pages++ ;   168                $pages++ ;
170           }   169           }
171     170  
172           if  ( $record s_num['rec _num'] > ( $from + $r ecords_on_ page) )   171           if  ( $record s_num['rec _num'] > ( $from + $r ecords_on_ page) )
173           {   172           {
174                $nfrom =  $from + $ records_on _page;   173                $nfrom =  $from + $ records_on _page;
175                $ret .=  "   174                $ret .=  "
176                             <a hre f=\"guestb ook.php?ow ner={$owne r}&from={$ nfrom}\">& nbsp;>></a >";   175                             <a hre f=\"guestb ook.php?ow ner={$owne r}&from={$ nfrom}\">& nbsp;>></a >";
177           }   176           }
178     177  
179           $r et .= "   178           $r et .= "
180                         </td>   179                         </td>
181                    </tr >   180                    </tr >
182                </table> \n";   181                </table> \n";
183       }   182       }
184     183  
185       // Pri nt guestbo ok entries   184       // Pri nt guestbo ok entries
186       $query  = "   185       $query  = "
187           SE LECT   186           SE LECT
188                `Guestbo ok`.`ID`,   187                `Guestbo ok`.`ID`,
189                DATE_FOR MAT(`Date` , '$date_f ormat' ) A S 'Date',   188                DATE_FOR MAT(`Date` , '$date_f ormat' ) A S 'Date',
190                `IP`,   189                `IP`,
191                `Sender` ,   190                `Sender` ,
192                `Profile s`.`NickNa me`,   191                `Profile s`.`NickNa me`,
193                `Recipie nt`,   192                `Recipie nt`,
194                `Text`,   193                `Text`,
195                `New`   194                `New`
196           FR OM `Guestb ook`   195           FR OM `Guestb ook`
197           LE FT JOIN `P rofiles` O N   196           LE FT JOIN `P rofiles` O N
198                `Profile s`.`ID` =  `Sender`   197                `Profile s`.`ID` =  `Sender`
199           WH ERE   198           WH ERE
200                `Recipie nt`='{$own er}'   199                `Recipie nt`='{$own er}'
201           OR DER BY `Da te` DESC   200           OR DER BY `Da te` DESC
202           LI MIT {$from }, {$recor ds_on_page }   201           LI MIT {$from }, {$recor ds_on_page }
203           ";   202           ";
204       $recor ds_res = d b_res( $qu ery );   203       $recor ds_res = d b_res( $qu ery );
205       if ( $ records_nu m['rec_num '] > 0 )   204       if ( $ records_nu m['rec_num '] > 0 )
206       {   205       {
207           $r et .= "<br  />   206           $r et .= "<br  />
208                <table c lass=\"gb_ msgs_table \">   207                <table c lass=\"gb_ msgs_table \">
209                    <tr>   208                    <tr>
210                         <th width= \"20%\">"  . _t( "_Fr om") . "</ th>   209                         <th width= \"20%\">"  . _t( "_Fr om") . "</ th>
211                         <th width= \"80%\">"  . _t( "_Te xt") . "</ th>   210                         <th width= \"80%\">"  . _t( "_Te xt") . "</ th>
212                    </tr >";   211                    </tr >";
213              212           
214           $t r_class =  'odd';   213           $t r_class =  'odd';
215              214           
216           wh ile ( $rec ords_arr =  mysql_fet ch_array($ records_re s) )   215           wh ile ( $rec ords_arr =  mysql_fet ch_array($ records_re s) )
217           {   216           {
218                $record_ text =  $r ecords_arr ['Text'] ;   217                $record_ text =  $r ecords_arr ['Text'] ;
219                $ret .=  "   218                $ret .=  "
220                    <tr  class=\"gb _msg_row_{ $tr_class} \">   219                    <tr  class=\"gb _msg_row_{ $tr_class} \">
221                         <td width= \"20%\" cl ass=\"picP osition\"> " .   220                         <td width= \"20%\" cl ass=\"picP osition\"> " .
222                             get_me mber_thumb nail($reco rds_arr['S ender'], ' none' ) .   221                             get_me mber_thumb nail($reco rds_arr['S ender'], ' none' ) .
223                             '<b><a  href="'.g etProfileL ink($owner ).'">'.$re cords_arr[ 'NickName' ].'</a></b ><br />'.   222                             '<b><a  href="'.g etProfileL ink($owner ).'">'.$re cords_arr[ 'NickName' ].'</a></b ><br />'.
224                             $recor ds_arr['Da te'] .   223                             $recor ds_arr['Da te'] .
225                         "</td>   224                         "</td>
226                         <td width= \"80%\" va lign=\"top \">";   225                         <td width= \"80%\" va lign=\"top \">";
227                   226                
228                if ( $ow ner == $id  || $logge d['admin']  )   227                if ( $ow ner == $id  || $logge d['admin']  )
229                {   228                {
230                    $ret  .= "   229                    $ret  .= "
231                                 <d iv class=\ "gb_msg_ac tions\">   230                                 <d iv class=\ "gb_msg_ac tions\">
232                                      <a href= \"guestboo k.php?owne r={$owner} &action=de lete&delet e_id={$rec ords_arr[' ID']}\">".   231                                      <a href= \"guestboo k.php?owne r={$owner} &action=de lete&delet e_id={$rec ords_arr[' ID']}\">".
233                                          _t(" _Delete")  .   232                                          _t(" _Delete")  .
234                                      "</a>   233                                      "</a>
235                                 </ div>";   234                                 </ div>";
236                }   235                }
237                   236                
238                $ret .=  "   237                $ret .=  "
239                                 <d iv>{$recor d_text}</d iv>   238                                 <d iv>{$recor d_text}</d iv>
240                                239                             
241                         </td>   240                         </td>
242                    </tr >";   241                    </tr >";
243                   242                
244                $tr_clas s = ($tr_c lass == 'o dd') ? 'ev en' : 'odd ';   243                $tr_clas s = ($tr_c lass == 'o dd') ? 'ev en' : 'odd ';
245           }   244           }
246           $r et .= "   245           $r et .= "
247                </table> ";   246                </table> ";
248       }   247       }
249          248       
250       // Pri nt add new  entry lin k   249       // Pri nt add new  entry lin k
251       $ret . = "   250       $ret . = "
252                <div cla ss=\"add_l ink\">   251                <div cla ss=\"add_l ink\">
253                    <a h ref=\"{$_S ERVER['PHP _SELF']}?o wner={$own er}&amp;ac tion=show_ add\">" .  _t( "_Add  record") .  "</a>   252                    <a h ref=\"{$_S ERVER['PHP _SELF']}?o wner={$own er}&amp;ac tion=show_ add\">" .  _t( "_Add  record") .  "</a>
254                </div>";   253                </div>";
255       return  $ret;   254       return  $ret;
256   }   255   }
257     256  
258   // Print a dd new ent ry form   257   // Print a dd new ent ry form
259   function S howAddReco rd()   258   function S howAddReco rd()
260   {   259   {
261       $owner  = $_REQUE ST['owner' ] ? (int)$ _REQUEST[' owner'] :  (int)$_COO KIE['membe rID'];   260       $owner  = $_REQUE ST['owner' ] ? (int)$ _REQUEST[' owner'] :  (int)$_COO KIE['membe rID'];
262          261       
263       $ret =  "   262       $ret =  "
264                <form na me=\"guest book_form\ " method=\ "POST\" ac tion=\"gue stbook.php ?owner={$o wner}\">   263                <form na me=\"guest book_form\ " method=\ "POST\" ac tion=\"gue stbook.php ?owner={$o wner}\">
265                <input t ype=\"hidd en\" name= \"owner\"  value=\"{$ owner}\">   264                <input t ype=\"hidd en\" name= \"owner\"  value=\"{$ owner}\">
266                <input t ype=\"hidd en\" name= \"action\"  value=\"n ew\">   265                <input t ype=\"hidd en\" name= \"action\"  value=\"n ew\">
267                <table w idth=\"100 %\" cellpa dding=\"1\ " cellspac ing=\"1\"  border=\"0 \">   266                <table w idth=\"100 %\" cellpa dding=\"1\ " cellspac ing=\"1\"  border=\"0 \">
268                    <tr>   267                    <tr>
269                         <td align= \"center\"  class=\"t ext\"><b>"  . _t( "_A dd record" ) . "</b>< /td>   268                         <td align= \"center\"  class=\"t ext\"><b>"  . _t( "_A dd record" ) . "</b>< /td>
270                    </tr >   269                    </tr >
271                    <tr>   270                    <tr>
272                         <td style= \"text-ali gn:center; \" class=\ "text\">   271                         <td style= \"text-ali gn:center; \" class=\ "text\">
273                         <textarea  name=\"new record\" c lass=\"gue stbookText Area\" id= \"newrecor d\"></text area></td>   272                         <textarea  name=\"new record\" c lass=\"gue stbookText Area\" id= \"newrecor d\"></text area></td>
274                    </tr >   273                    </tr >
275                    <tr>   274                    <tr>
276                         <td align= \"center\" ><input cl ass=\"no\"  name=\"ad d\" type=\ "submit\"  value=\"".  _t("Add r ecord") ." \"></td>   275                         <td align= \"center\" ><input cl ass=\"no\"  name=\"ad d\" type=\ "submit\"  value=\"".  _t("Add r ecord") ." \"></td>
277                    </tr >   276                    </tr >
278                </table>   277                </table>
279                </form>\ n";   278                </form>\ n";
280       return  $ret;   279       return  $ret;
281   }   280   }
282     281  
283   function A ddRecord()   282   function A ddRecord()
284   {   283   {
285       global  $record_m axlength;   284       global  $record_m axlength;
286       global  $period;   285       global  $period;
287       global  $record_l imit;   286       global  $record_l imit;
288       global  $logged;   287       global  $logged;
289     288  
290       $ret =  "";   289       $ret =  "";
291     290  
292       $recor d_text = a ddslashes( clear_xss(  process_p ass_data($ _POST['new record'])) );   291       $recor d_text = a ddslashes( clear_xss(  process_p ass_data($ _POST['new record'])) );
293       $recor d_sender =  strlen($_ COOKIE['me mberID'])  ? (int)$_C OOKIE['mem berID'] :  "";   292       $recor d_sender =  strlen($_ COOKIE['me mberID'])  ? (int)$_C OOKIE['mem berID'] :  "";
294       $recor d_recipien t = (int)$ _REQUEST[' owner'];   293       $recor d_recipien t = (int)$ _REQUEST[' owner'];
295       $ip =  ( getenv(' HTTP_CLIEN T_IP') ? g etenv('HTT P_CLIENT_I P') : gete nv('REMOTE _ADDR') );   294       $ip =  ( getenv(' HTTP_CLIEN T_IP') ? g etenv('HTT P_CLIENT_I P') : gete nv('REMOTE _ADDR') );
296       if ( ! $record_re cipient )   295       if ( ! $record_re cipient )
297           re turn $ret;   296           re turn $ret;
298     297  
299       // Tes t if IP is  defined   298       // Tes t if IP is  defined
300       if ( ! $ip )   299       if ( ! $ip )
301       {   300       {
302           $r et .= "<br  />   301           $r et .= "<br  />
303                <table w idth=\"100 %\" cellpa dding=\"1\ " cellspac ing=\"1\"  border=\"0 \">   302                <table w idth=\"100 %\" cellpa dding=\"1\ " cellspac ing=\"1\"  border=\"0 \">
304                    <tr>   303                    <tr>
305                         <td class= \"text\" a lign=\"cen ter\">   304                         <td class= \"text\" a lign=\"cen ter\">
306                             <br /> ". _t_err( "_sorry, i  can not d efine you  ip adress.  IT'S TIME  TO COME O UT !") ."< br />   305                             <br /> ". _t_err( "_sorry, i  can not d efine you  ip adress.  IT'S TIME  TO COME O UT !") ."< br />
307                         </td>   306                         </td>
308                    </tr >   307                    </tr >
309                </table> \n";   308                </table> \n";
310           re turn $ret;   309           re turn $ret;
311       }   310       }
312     311  
313       // Tes t if last  message is  old enoug h   312       // Tes t if last  message is  old enoug h
314       $last_ count = db _arr( "SEL ECT COUNT(  * ) AS `l ast_count`  FROM `Gue stbook` WH ERE `IP` =  '{$ip}' A ND (UNIX_T IMESTAMP(N OW()) - UN IX_TIMESTA MP(`Date`)  < {$perio d}*60)" );   313       $last_ count = db _arr( "SEL ECT COUNT(  * ) AS `l ast_count`  FROM `Gue stbook` WH ERE `IP` =  '{$ip}' A ND (UNIX_T IMESTAMP(N OW()) - UN IX_TIMESTA MP(`Date`)  < {$perio d}*60)" );
315       if ( $ last_count ['last_cou nt'] != 0  )   314       if ( $ last_count ['last_cou nt'] != 0  )
316       {   315       {
317           $r et .= "<br  />   316           $r et .= "<br  />
318                <table w idth=\"100 %\" cellpa dding=\"1\ " cellspac ing=\"1\"  border=\"0 \">   317                <table w idth=\"100 %\" cellpa dding=\"1\ " cellspac ing=\"1\"  border=\"0 \">
319                    <tr>   318                    <tr>
320                         <td class= \"text\" a lign=\"cen ter\">   319                         <td class= \"text\" a lign=\"cen ter\">
321                             <br /> ". _t_err( "_You have  to wait f or PERIOD  minutes be fore you c an write a nother mes sage!", $p eriod) ."< br />   320                             <br /> ". _t_err( "_You have  to wait f or PERIOD  minutes be fore you c an write a nother mes sage!", $p eriod) ."< br />
322                         </td>   321                         </td>
323                    </tr >   322                    </tr >
324                </table> \n";   323                </table> \n";
325           re turn $ret;   324           re turn $ret;
326       }   325       }
327     326  
328       // Res trict with  total rec ords count   327       // Res trict with  total rec ords count
329       $total _count = d b_arr( "SE LECT COUNT (*) AS `to tal_count`  FROM `Gue stbook` WH ERE `Recip ient` = '{ $record_re cipient}'"  );   328       $total _count = d b_arr( "SE LECT COUNT (*) AS `to tal_count`  FROM `Gue stbook` WH ERE `Recip ient` = '{ $record_re cipient}'"  );
330       if ( ( $total_cou nt['total_ count'] -  1) > $reco rd_limit )   329       if ( ( $total_cou nt['total_ count'] -  1) > $reco rd_limit )
331       {   330       {
332           $d el_res = d b_res( "SE LECT `ID`  FROM `Gues tbook` WHE RE `Recipi ent` = '{$ record_rec ipient}' O RDER BY `D ate` ASC L IMIT ". ($ total_coun t['total_c ount'] - $ record_lim it + 1) );   331           $d el_res = d b_res( "SE LECT `ID`  FROM `Gues tbook` WHE RE `Recipi ent` = '{$ record_rec ipient}' O RDER BY `D ate` ASC L IMIT ". ($ total_coun t['total_c ount'] - $ record_lim it + 1) );
333           wh ile ( $del _arr = mys ql_fetch_a rray($del_ res) )   332           wh ile ( $del _arr = mys ql_fetch_a rray($del_ res) )
334                db_res(  "DELETE FR OM `Guestb ook` WHERE  `ID` = {$ del_arr['I D']}" );   333                db_res(  "DELETE FR OM `Guestb ook` WHERE  `ID` = {$ del_arr['I D']}" );
335       }   334       }
336     335  
337       // Per form inser tion   336       // Per form inser tion
338       db_res ( "INSERT  INTO `Gues tbook` SET  `Date` =  NOW(), `IP ` = '{$ip} ', `Sender ` = '{$rec ord_sender }', `Recip ient` = '{ $record_re cipient}',  `Text` =  '{$record_ text}', `N ew` = '1'"  );   337       db_res ( "INSERT  INTO `Gues tbook` SET  `Date` =  NOW(), `IP ` = '{$ip} ', `Sender ` = '{$rec ord_sender }', `Recip ient` = '{ $record_re cipient}',  `Text` =  '{$record_ text}', `N ew` = '1'"  );
339     338  
340       return  $ret;   339       return  $ret;
341   }   340   }
342     341  
343   function D eleteRecor d()   342   function D eleteRecor d()
344   {   343   {
345       global  $logged;   344       global  $logged;
346     345  
347       $ret =  "";   346       $ret =  "";
348       $owner  = (int)$_ REQUEST['o wner'];   347       $owner  = (int)$_ REQUEST['o wner'];
349       $id =  ($_COOKIE[ 'memberID' ] ? $_COOK IE['member ID'] : 0);   348       $id =  ($_COOKIE[ 'memberID' ] ? $_COOK IE['member ID'] : 0);
350       $delet e_id = (in t)$_GET['d elete_id'] ;   349       $delet e_id = (in t)$_GET['d elete_id'] ;
351     350  
352       if ( ! $owner ||  !($owner = = $id || $ logged['ad min']) )   351       if ( ! $owner ||  !($owner = = $id || $ logged['ad min']) )
353           re turn $ret;   352           re turn $ret;
354     353  
355       db_res ( "DELETE  FROM `Gues tbook` WHE RE `ID` =  '$delete_i d'" );   354       db_res ( "DELETE  FROM `Gues tbook` WHE RE `ID` =  '$delete_i d'" );
356     355  
357       return  $ret;   356       return  $ret;
358   }   357   }
359     358  
360   function P rintInfo(  $id = 0 )   359   function P rintInfo(  $id = 0 )
361   {   360   {
362       if ( $ id > 0 )   361       if ( $ id > 0 )
363       {   362       {
364           $i nfo_arr =  getProfile Info( $id  );   363           $i nfo_arr =  getProfile Info( $id  );
365           $i nfo_sex =  _t( "_{$in fo_arr['Se x']}" );   364           $i nfo_sex =  _t( "_{$in fo_arr['Se x']}" );
366           $i nfo_age =  age( $info _arr['Date OfBirth']  );   365           $i nfo_age =  age( $info _arr['Date OfBirth']  );
367           $r et = "<p a lign=\"lef t\">". _t( "_Nickname ") .": <st rong>{$inf o_arr['Nic kName']}</ strong><br  />". _t(" _Sex") .":  <strong>{ $info_sex} </strong>< br />". _t ("_DateOfB irth") .":  <strong>{ $info_age} </strong>< br /></p>" ;   366           $r et = "<p a lign=\"lef t\">". _t( "_Nickname ") .": <st rong>{$inf o_arr['Nic kName']}</ strong><br  />". _t(" _Sex") .":  <strong>{ $info_sex} </strong>< br />". _t ("_DateOfB irth") .":  <strong>{ $info_age} </strong>< br /></p>" ;
368       }   367       }
369       else   368       else
370       {   369       {
371           $r et = _t("_ no_info");   370           $r et = _t("_ no_info");
372       }   371       }
373     372  
374       return  $ret;   373       return  $ret;
375   }   374   }
376     375  
377   ?>   376   ?>