50. File Comparison Report

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

50.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.1.1\inc profiles.inc.php Sat Apr 26 08:19:14 2008 UTC
2 Dolphin-v.6.1.2\inc profiles.inc.php Mon May 26 10:15:41 2008 UTC

50.2 Comparison summary

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

50.3 Comparison options

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

50.4 Active regular expressions

No regular expressions were active.

50.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 . '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 . 'i mages.inc. php' );   23   require_on ce( BX_DIR ECTORY_PAT H_INC . 'i mages.inc. php' );
24   require_on ce( BX_DIR ECTORY_PAT H_INC . 'p arams.inc. php' );   24   require_on ce( BX_DIR ECTORY_PAT H_INC . 'p arams.inc. php' );
25   require_on ce( BX_DIR ECTORY_PAT H_INC . 't ags.inc.ph p' );   25   require_on ce( BX_DIR ECTORY_PAT H_INC . 't ags.inc.ph p' );
26     26  
27     27  
28   $aUser = a rray(); // global cac he array   28   $aUser = a rray(); // global cac he array
29     29  
30     30  
31   function S howZodiacS ign( $date  )   31   function S howZodiacS ign( $date  )
32   {   32   {
33       global  $site;   33       global  $site;
34     34  
35       if ( $ date == "0 000-00-00"  )   35       if ( $ date == "0 000-00-00"  )
36           re turn "";   36           re turn "";
37     37  
38       if ( s trlen($dat e) )   38       if ( s trlen($dat e) )
39       {   39       {
40           $m  = substr(  $date, -5 , 2 );   40           $m  = substr(  $date, -5 , 2 );
41           $d  = substr(  $date, -2 , 2 );   41           $d  = substr(  $date, -2 , 2 );
42     42  
43           sw itch ( $m  )   43           sw itch ( $m  )
44           {   44           {
45                case '01 ': if ( $d  <= 20 ) $ sign = "ca pricorn";  else $sign  = "aquari us";   45                case '01 ': if ( $d  <= 20 ) $ sign = "ca pricorn";  else $sign  = "aquari us";
46                break;   46                break;
47                case '02 ': if ( $d  <= 20 ) $ sign = "aq uarius"; e lse $sign  = "pisces" ;   47                case '02 ': if ( $d  <= 20 ) $ sign = "aq uarius"; e lse $sign  = "pisces" ;
48                break;   48                break;
49                case '03 ': if ( $d  <= 20 ) $ sign = "pi sces"; els e $sign =  "aries";   49                case '03 ': if ( $d  <= 20 ) $ sign = "pi sces"; els e $sign =  "aries";
50                break;   50                break;
51                case '04 ': if ( $d  <= 20 ) $ sign = "ar ies"; else  $sign = " taurus";   51                case '04 ': if ( $d  <= 20 ) $ sign = "ar ies"; else  $sign = " taurus";
52                break;   52                break;
53                case '05 ': if ( $d  <= 20 ) $ sign = "ta urus"; els e $sign =  "gemini";   53                case '05 ': if ( $d  <= 20 ) $ sign = "ta urus"; els e $sign =  "gemini";
54                break;   54                break;
55                case '06 ': if ( $d  <= 21 ) $ sign = "ge mini"; els e $sign =  "cancer";   55                case '06 ': if ( $d  <= 21 ) $ sign = "ge mini"; els e $sign =  "cancer";
56                break;   56                break;
57                case '07 ': if ( $d  <= 22 ) $ sign = "ca ncer"; els e $sign =  "leo";   57                case '07 ': if ( $d  <= 22 ) $ sign = "ca ncer"; els e $sign =  "leo";
58                break;   58                break;
59                case '08 ': if ( $d  <= 23 ) $ sign = "le o"; else $ sign = "vi rgo";   59                case '08 ': if ( $d  <= 23 ) $ sign = "le o"; else $ sign = "vi rgo";
60                break;   60                break;
61                case '09 ': if ( $d  <= 23 ) $ sign = "vi rgo"; else  $sign = " libra";   61                case '09 ': if ( $d  <= 23 ) $ sign = "vi rgo"; else  $sign = " libra";
62                break;   62                break;
63                case '10 ': if ( $d  <= 23 ) $ sign = "li bra"; else  $sign = " scorpio";   63                case '10 ': if ( $d  <= 23 ) $ sign = "li bra"; else  $sign = " scorpio";
64                break;   64                break;
65                case '11 ': if ( $d  <= 22 ) $ sign = "sc orpio"; el se $sign =  "sagittar ius";   65                case '11 ': if ( $d  <= 22 ) $ sign = "sc orpio"; el se $sign =  "sagittar ius";
66                break;   66                break;
67                case '12 ': if ( $d  <= 21 ) $ sign = "sa gittarius" ; else $si gn = "capr icorn";   67                case '12 ': if ( $d  <= 21 ) $ sign = "sa gittarius" ; else $si gn = "capr icorn";
68           }   68           }
69     69  
70     70  
71           re turn '<img  src="' .  $site['zod iac'] . 'z odiac_' .  $sign . '. gif" alt=" ' . $sign  . '" title ="' . $sig n . '" />' ;   71           re turn '<img  src="' .  $site['zod iac'] . 'z odiac_' .  $sign . '. gif" alt=" ' . $sign  . '" title ="' . $sig n . '" />' ;
72     72  
73       }   73       }
74       else   74       else
75       {   75       {
76           re turn "";   76           re turn "";
77       }   77       }
78   }   78   }
79     79  
80   function S howFriendL ist( $id,  $aMutualFr iends = 0  )   80   function S howFriendL ist( $id,  $aMutualFr iends = 0  )
81   {   81   {
82       global  $site;   82       global  $site;
83       global  $max_thum b_width;   83       global  $max_thum b_width;
84       global  $max_thum b_height;   84       global  $max_thum b_height;
85     85  
86       if ($a MutualFrie nds == 0)   86       if ($a MutualFrie nds == 0)
87           $a MutualFrie nds = arra y();   87           $a MutualFrie nds = arra y();
88          88       
89       $id =  (int)$id;   89       $id =  (int)$id;
90       $frien d_list_que ry = "SELE CT `Profil es`.* FROM  `FriendLi st`   90       $frien d_list_que ry = "SELE CT `Profil es`.* FROM  `FriendLi st`
91                                       LEFT JO IN `Profil es` ON (`P rofiles`.` ID` = `Fri endList`.` Profile` A ND `Friend List`.`ID`  = '$id' O R `Profile s`.`ID` =  `FriendLis t`.`ID` AN D `FriendL ist`.`Prof ile` = '$i d')   91                                       LEFT JO IN `Profil es` ON (`P rofiles`.` ID` = `Fri endList`.` Profile` A ND `Friend List`.`ID`  = '$id' O R `Profile s`.`ID` =  `FriendLis t`.`ID` AN D `FriendL ist`.`Prof ile` = '$i d')
92                                       WHERE ( `FriendLis t`.`Profil e` = '$id'  OR `Frien dList`.`ID ` = '$id')  AND `Frie ndList`.`C heck` = '1 ' ORDER BY  `Profiles `.`Picture ` DESC LIM IT 12";   92                                       WHERE ( `FriendLis t`.`Profil e` = '$id'  OR `Frien dList`.`ID ` = '$id')  AND `Frie ndList`.`C heck` = '1 ' ORDER BY  `Profiles `.`Picture ` DESC LIM IT 12";
93     93  
94       $frien d_list_res  = db_res( "$friend_l ist_query" );   94       $frien d_list_res  = db_res( "$friend_l ist_query" );
95          95       
96       $iCoun ter = 0;   96       $iCoun ter = 0;
97       $ret =  '';   97       $ret =  '';
98          98       
99       while  ( $friend_ list_arr =  mysql_fet ch_assoc(  $friend_li st_res ) )   99       while  ( $friend_ list_arr =  mysql_fet ch_assoc(  $friend_li st_res ) )
100       {   100       {
101     101  
102          if  (!array_ke y_exists($ friend_lis t_arr['ID' ], $aMutua lFriends)) {   102          if  (!array_ke y_exists($ friend_lis t_arr['ID' ], $aMutua lFriends)) {
103              103           
104           $i Counter ++ ;   104           $i Counter ++ ;
105           $s Key = '1';   105           $s Key = '1';
106           if ( $iCounte r == 3 )   106           if ( $iCounte r == 3 )
107                $sKey =  '2';   107                $sKey =  '2';
108              108           
109           $r et .= '<di v class="f riends_thu mb_'.$sKey .'">' . ge t_member_t humbnail($ friend_lis t_arr['ID' ], 'none')  . '<div c lass="brow se_nick">< a href="'  . getProfi leLink($fr iend_list_ arr['ID'])  . '">' .  $friend_li st_arr['Ni ckName'] .  '</a></di v><div cla ss="clear_ both"></di v></div>';   109           $r et .= '<di v class="f riends_thu mb_'.$sKey .'">' . ge t_member_t humbnail($ friend_lis t_arr['ID' ], 'none')  . '<div c lass="brow se_nick">< a href="'  . getProfi leLink($fr iend_list_ arr['ID'])  . '">' .  $friend_li st_arr['Ni ckName'] .  '</a></di v><div cla ss="clear_ both"></di v></div>';
110              110           
111           if ( $iCounte r == 3)   111           if ( $iCounte r == 3)
112                $iCounte r = 0;   112                $iCounte r = 0;
113       }   113       }
114     114  
115     115  
116       }   116       }
117     117  
118       return  $ret;   118       return  $ret;
119   }   119   }
120     120  
121   function s endKissPop Up( $iReci pientID, $ icon = tru e, $sText  = '' )   121   function s endKissPop Up( $iReci pientID, $ icon = tru e, $sText  = '' )
122   {   122   {
123       global  $oTemplCo nfig;   123       global  $oTemplCo nfig;
124       global  $site;   124       global  $site;
125     125  
126     126  
127       if(  $ icon )   127       if(  $ icon )
128       {   128       {
129           $r et = "<a h ref=\"java script:voi d(0);\" on click=\"ja vascript:  window.ope n( 'greet. php?sendto =$iRecipie ntID', '',  'width={$ oTemplConf ig -> popU pWindowWid th},height ={$oTemplC onfig -> p opUpWindow Height},me nubar=no,s tatus=no,r esizable=n o,scrollba rs=yes,too lbar=no, l ocation=no ' );\"><im g src=\""  . getTempl ateIcon('k iss.gif')  . "\" alt= \"" . _t(  "_Send Kis s" ) . "\"  title=\""  . _t( "_S end Kiss"  ) . "\" /> </a>";   129           $r et = "<a h ref=\"java script:voi d(0);\" on click=\"ja vascript:  window.ope n( 'greet. php?sendto =$iRecipie ntID', '',  'width={$ oTemplConf ig -> popU pWindowWid th},height ={$oTemplC onfig -> p opUpWindow Height},me nubar=no,s tatus=no,r esizable=n o,scrollba rs=yes,too lbar=no, l ocation=no ' );\"><im g src=\""  . getTempl ateIcon('k iss.gif')  . "\" alt= \"" . _t(  "_Send Kis s" ) . "\"  title=\""  . _t( "_S end Kiss"  ) . "\" /> </a>";
130       }   130       }
131       else   131       else
132       {   132       {
133           $r et = "<a h ref=\"java script:voi d(0);\" on click=\"ja vascript:  window.ope n( 'greet. php?sendto =$iRecipie ntID', '',  'width={$ oTemplConf ig -> popU pWindowWid th},height ={$oTemplC onfig -> p opUpWindow Height},me nubar=no,s tatus=no,r esizable=n o,scrollba rs=yes,too lbar=no, l ocation=no ' );\">" .  _t( "_Sen d Kiss" )  . "</a>";   133           $r et = "<a h ref=\"java script:voi d(0);\" on click=\"ja vascript:  window.ope n( 'greet. php?sendto =$iRecipie ntID', '',  'width={$ oTemplConf ig -> popU pWindowWid th},height ={$oTemplC onfig -> p opUpWindow Height},me nubar=no,s tatus=no,r esizable=n o,scrollba rs=yes,too lbar=no, l ocation=no ' );\">" .  _t( "_Sen d Kiss" )  . "</a>";
134       }   134       }
135     135  
136       return  $ret;   136       return  $ret;
137   }   137   }
138     138  
139   function c art_pop( $ text, $act ion, $ID =  0, $javas cript = ""  )   139   function c art_pop( $ text, $act ion, $ID =  0, $javas cript = ""  )
140   {   140   {
141       global  $oTemplCo nfig;   141       global  $oTemplCo nfig;
142     142  
143       if ( $ action ==  "add" )   143       if ( $ action ==  "add" )
144       {   144       {
145           if  ( !$ID )   145           if  ( !$ID )
146                return " ";   146                return " ";
147           re turn "<a h ref=\"java script:voi d(0);\" on Click=\"ja vascript:  window.ope n( 'cart_p op.php?act ion=add&am p;ID=$ID',  'cart_$ID ', 'width= {$oTemplCo nfig -> po pUpWindowW idth},heig ht={$oTemp lConfig ->  popUpWind owHeight}, menubar=no ,status=no ,resizable =no,scroll bars=yes,t oolbar=no,  location= no' );\" $ javascript >$text</a> ";   147           re turn "<a h ref=\"java script:voi d(0);\" on Click=\"ja vascript:  window.ope n( 'cart_p op.php?act ion=add&am p;ID=$ID',  'cart_$ID ', 'width= {$oTemplCo nfig -> po pUpWindowW idth},heig ht={$oTemp lConfig ->  popUpWind owHeight}, menubar=no ,status=no ,resizable =no,scroll bars=yes,t oolbar=no,  location= no' );\" $ javascript >$text</a> ";
148       }   148       }
149       elseif  ( $action  == "empty " )   149       elseif  ( $action  == "empty " )
150           re turn "<a $ class_part  href=\"ja vascript:v oid(0);\"  onClick=\" javascript : window.o pen( 'cart _pop.php?a ction=empt y', 'cart' , 'width={ $oTemplCon fig -> pop UpWindowWi dth},heigh t={$oTempl Config ->  popUpWindo wHeight},m enubar=no, status=no, resizable= no,scrollb ars=yes,to olbar=no,  location=n o' );\" $j avascript> $text</a>" ;   150           re turn "<a $ class_part  href=\"ja vascript:v oid(0);\"  onClick=\" javascript : window.o pen( 'cart _pop.php?a ction=empt y', 'cart' , 'width={ $oTemplCon fig -> pop UpWindowWi dth},heigh t={$oTempl Config ->  popUpWindo wHeight},m enubar=no, status=no, resizable= no,scrollb ars=yes,to olbar=no,  location=n o' );\" $j avascript> $text</a>" ;
151   }   151   }
152     152  
153   function s ound_pop(  $text, $me mber, $ID  )   153   function s ound_pop(  $text, $me mber, $ID  )
154   {   154   {
155       if ( ! $ID )    r eturn;   155       if ( ! $ID )    r eturn;
156       return  "<a href= \"javascri pt:void(0) ;\" onClic k=\"javasc ript:windo w.open( 's ound_pop.p hp?ID=$ID' , '', 'wid th=280,hei ght=200,me nubar=no,s tatus=no,r esizable=n o,scrollba rs=yes,too lbar=no, l ocation=no ' );\">$te xt</a>";   156       return  "<a href= \"javascri pt:void(0) ;\" onClic k=\"javasc ript:windo w.open( 's ound_pop.p hp?ID=$ID' , '', 'wid th=280,hei ght=200,me nubar=no,s tatus=no,r esizable=n o,scrollba rs=yes,too lbar=no, l ocation=no ' );\">$te xt</a>";
157   }   157   }
158     158  
159   function v ideo_pop(  $text, $me mber, $ID  )   159   function v ideo_pop(  $text, $me mber, $ID  )
160   {   160   {
161       if ( ! $ID )   161       if ( ! $ID )
162           re turn;   162           re turn;
163       return  "<a href= \"javascri pt:void(0) ;\" onClic k=\"javasc ript:windo w.open( 'v ideo_pop.p hp?ID=$ID' , '', 'wid th=280,hei ght=350,me nubar=no,s tatus=no,r esizable=n o,scrollba rs=yes,too lbar=no, l ocation=no ' );\">$te xt</a>";   163       return  "<a href= \"javascri pt:void(0) ;\" onClic k=\"javasc ript:windo w.open( 'v ideo_pop.p hp?ID=$ID' , '', 'wid th=280,hei ght=350,me nubar=no,s tatus=no,r esizable=n o,scrollba rs=yes,too lbar=no, l ocation=no ' );\">$te xt</a>";
164   }   164   }
165     165  
166   function g etMediaPop ( $text, $ aMedia )   166   function g etMediaPop ( $text, $ aMedia )
167   {   167   {
168       global  $oTemplCo nfig;   168       global  $oTemplCo nfig;
169     169  
170       $ret =  '';   170       $ret =  '';
171     171  
172       $ret . = '<a href ="javascri pt:void(0) ;" onClick ="javascri pt:window. open( \'vi deo_pop.ph p?mediaID= ' . $aMedi a['med_id' ] . '\', \ '\', \'wid th=' . $oT emplConfig  -> popUpW indowWidth  . ',heigh t=' . $oTe mplConfig  -> popUpWi ndowHeight  . ',menub ar=no,stat us=no,resi zable=no,s crollbars= yes,toolba r=no, loca tion=no\'  );">' . $t ext . '</a >';   172       $ret . = '<a href ="javascri pt:void(0) ;" onClick ="javascri pt:window. open( \'vi deo_pop.ph p?mediaID= ' . $aMedi a['med_id' ] . '\', \ '\', \'wid th=' . $oT emplConfig  -> popUpW indowWidth  . ',heigh t=' . $oTe mplConfig  -> popUpWi ndowHeight  . ',menub ar=no,stat us=no,resi zable=no,s crollbars= yes,toolba r=no, loca tion=no\'  );">' . $t ext . '</a >';
173     173  
174     174  
175       return  $ret;   175       return  $ret;
176   }   176   }
177     177  
178   // Check i f this con tact was b ought   178   // Check i f this con tact was b ought
179   function c ontact_all owed( $mem berID, $pr ofileID )   179   function c ontact_all owed( $mem berID, $pr ofileID )
180   {   180   {
181       $membe rID = (int )$memberID ;   181       $membe rID = (int )$memberID ;
182       $profi leID = (in t)$profile ID;   182       $profi leID = (in t)$profile ID;
183     183  
184       $exist _arr = db_ arr( "SELE CT COUNT(* ) AS `coun t` FROM `B oughtConta cts`   184       $exist _arr = db_ arr( "SELE CT COUNT(* ) AS `coun t` FROM `B oughtConta cts`
185                                 WH ERE `IDBuy er` = $mem berID AND  `IDContact ` = $profi leID   185                                 WH ERE `IDBuy er` = $mem berID AND  `IDContact ` = $profi leID
186                                      OR `IDBu yer` = $pr ofileID AN D `IDConta ct` = $mem berID" );   186                                      OR `IDBu yer` = $pr ofileID AN D `IDConta ct` = $mem berID" );
187       if ( $ exist_arr[ 'count'] )   187       if ( $ exist_arr[ 'count'] )
188           re turn true;   188           re turn true;
189       else   189       else
190           re turn false ;   190           re turn false ;
191   }   191   }
192     192  
193   // Buy con tact in sh opping car t   193   // Buy con tact in sh opping car t
194   function b uyContact(  $memberID , $profile ID, $trans actionID =  '' )   194   function b uyContact(  $memberID , $profile ID, $trans actionID =  '' )
195   {   195   {
196       $membe rID = (int )$memberID ;   196       $membe rID = (int )$memberID ;
197       $profi leID = (in t)$profile ID;   197       $profi leID = (in t)$profile ID;
198       $trans actionID =  (int)$tra nsactionID ;   198       $trans actionID =  (int)$tra nsactionID ;
199     199  
200       $exist _arr = db_ arr( "SELE CT * FROM  `BoughtCon tacts` WHE RE `IDBuye r` = $memb erID AND ` IDContact`  = $profil eID" );   200       $exist _arr = db_ arr( "SELE CT * FROM  `BoughtCon tacts` WHE RE `IDBuye r` = $memb erID AND ` IDContact`  = $profil eID" );
201       if ( $ exist_arr  )   201       if ( $ exist_arr  )
202       {   202       {
203           db _res( "UPD ATE `Bough tContacts`  SET `Hide FromBuyer`  = 0 WHERE  `IDBuyer`  = $member ID AND `ID Contact` =  $profileI D" );   203           db _res( "UPD ATE `Bough tContacts`  SET `Hide FromBuyer`  = 0 WHERE  `IDBuyer`  = $member ID AND `ID Contact` =  $profileI D" );
204           re turn false ;   204           re turn false ;
205       }   205       }
206     206  
207       if ( $ transactio nID )   207       if ( $ transactio nID )
208           $r esult = db _res( "INS ERT INTO ` BoughtCont acts` SET  `IDBuyer`  = $memberI D, `IDCont act` = $pr ofileID, ` Transactio nID` = $tr ansactionI D " );   208           $r esult = db _res( "INS ERT INTO ` BoughtCont acts` SET  `IDBuyer`  = $memberI D, `IDCont act` = $pr ofileID, ` Transactio nID` = $tr ansactionI D " );
209       else   209       else
210           $r esult = db _res( "INS ERT INTO ` BoughtCont acts` SET  `IDBuyer`  = $memberI D, `IDCont act` = $pr ofileID "  );   210           $r esult = db _res( "INS ERT INTO ` BoughtCont acts` SET  `IDBuyer`  = $memberI D, `IDCont act` = $pr ofileID "  );
211     211  
212       return  $result;   212       return  $result;
213   }   213   }
214   /**   214   /**
215    * Functio n in depen ds on the  profile ty pe return  age   215    * Functio n in depen ds on the  profile ty pe return  age
216    * or ages  of profil e.   216    * or ages  of profil e.
217    *   217    *
218    * @param  array $aPr ofile   218    * @param  array $aPr ofile
219    *   219    *
220    * return  array   220    * return  array
221    */   221    */
222   function g etProfileA geFromArra y( $aProfi le )   222   function g etProfileA geFromArra y( $aProfi le )
223   {   223   {
224       //prin t_r( $aPro file );   224       //prin t_r( $aPro file );
225       $ret =  array();   225       $ret =  array();
226     226  
227       $ret[]  = age( $a Profile['D ateOfBirth ']);   227       $ret[]  = age( $a Profile['D ateOfBirth ']);
228     228  
229       return  $ret;   229       return  $ret;
230   }   230   }
231     231  
232     232  
233   function a ge( $birth _date )   233   function a ge( $birth _date )
234   {   234   {
235       if ( $ birth_date  == "0000- 00-00" )   235       if ( $ birth_date  == "0000- 00-00" )
236           re turn _t("_ uknown");   236           re turn _t("_ uknown");
237     237  
238       $bd =  explode( " -", $birth _date );   238       $bd =  explode( " -", $birth _date );
239       $age =  date("Y")  - $bd[0]  - 1;   239       $age =  date("Y")  - $bd[0]  - 1;
240     240  
241       $arr[1 ] = "m";   241       $arr[1 ] = "m";
242       $arr[2 ] = "d";   242       $arr[2 ] = "d";
243     243  
244       for (  $i = 1; $a rr[$i]; $i ++ )   244       for (  $i = 1; $a rr[$i]; $i ++ )
245       {   245       {
246           $n  = date( $ arr[$i] );   246           $n  = date( $ arr[$i] );
247           if  ( $n < $b d[$i] )   247           if  ( $n < $b d[$i] )
248                break;   248                break;
249           if  ( $n > $b d[$i] )   249           if  ( $n > $b d[$i] )
250           {   250           {
251                ++$age;   251                ++$age;
252                break;   252                break;
253           }   253           }
254       }   254       }
255     255  
256       return  $age;   256       return  $age;
257   }   257   }
258     258  
259     259  
260   function c onf_nick($ nick, $ID  = 0 )   260   function c onf_nick($ nick, $ID  = 0 )
261   {   261   {
262       global  $exist_ar r;   262       global  $exist_ar r;
263       global  $dir;   263       global  $dir;
264     264  
265       if (fi le_exists( $dir['root '].$nick))   265       if (fi le_exists( $dir['root '].$nick))
266       {   266       {
267           re turn FALSE ;   267           re turn FALSE ;
268       }   268       }
269              269           
270       if ( $ ID )   270       if ( $ ID )
271           $e xist_arr =  db_arr( " SELECT ID,  NickName  FROM `Prof iles` WHER E NickName  = '$nick'  AND ID <>  $ID" );   271           $e xist_arr =  db_arr( " SELECT ID,  NickName  FROM `Prof iles` WHER E NickName  = '$nick'  AND ID <>  $ID" );
272       else   272       else
273           $e xist_arr =  db_arr( " SELECT `Ni ckName` FR OM `Profil es` WHERE  NickName =  '$nick'"  );   273           $e xist_arr =  db_arr( " SELECT `Ni ckName` FR OM `Profil es` WHERE  NickName =  '$nick'"  );
274     274  
275       if ( $ exist_arr  )   275       if ( $ exist_arr  )
276           re turn false ;   276           re turn false ;
277          277       
278       return  true;   278       return  true;
279   }   279   }
280     280  
281   function c onf_email  ($Email, $ ID = 0)   281   function c onf_email  ($Email, $ ID = 0)
282   {   282   {
283       global  $exist_ar r;   283       global  $exist_ar r;
284     284  
285       if ( $ ID )   285       if ( $ ID )
286           $e xist_arr =  db_arr( " SELECT ID,  NickName  FROM `Prof iles` WHER E UPPER(Em ail) = UPP ER('$Email ') AND ID  <> $ID" );   286           $e xist_arr =  db_arr( " SELECT ID,  NickName  FROM `Prof iles` WHER E UPPER(Em ail) = UPP ER('$Email ') AND ID  <> $ID" );
287       else   287       else
288           $e xist_arr =  db_arr( " SELECT ID,  NickName  FROM `Prof iles` WHER E UPPER(Em ail) = UPP ER('$Email ')" );   288           $e xist_arr =  db_arr( " SELECT ID,  NickName  FROM `Prof iles` WHER E UPPER(Em ail) = UPP ER('$Email ')" );
289     289  
290       if ( $ exist_arr  ) {   290       if ( $ exist_arr  ) {
291           re turn 0;   291           re turn 0;
292       }   292       }
293       return  1;   293       return  1;
294   }   294   }
295     295  
296   function c onf_email_ queue ($Em ail)   296   function c onf_email_ queue ($Em ail)
297   {   297   {
298       global  $exist_ar r;   298       global  $exist_ar r;
299     299  
300       $exist _arr = db_ arr( "SELE CT ID FROM  `NotifyQu eue` WHERE  UPPER(Ema il) = UPPE R('$Email' )" );   300       $exist _arr = db_ arr( "SELE CT ID FROM  `NotifyQu eue` WHERE  UPPER(Ema il) = UPPE R('$Email' )" );
301       if ( $ exist_arr  ) {   301       if ( $ exist_arr  ) {
302           re turn 0;   302           re turn 0;
303       }   303       }
304       return  1;   304       return  1;
305   }   305   }
306     306  
307   function u pload_phot o($pic_ind ex)   307   function u pload_phot o($pic_ind ex)
308   {   308   {
309       global  $pics;   309       global  $pics;
310       global  $site;   310       global  $site;
311       global  $p_arr;   311       global  $p_arr;
312       global  $gl_pic;   312       global  $gl_pic;
313       global  $dir;   313       global  $dir;
314       global  $pictures _text;   314       global  $pictures _text;
315       global  $COMPOSIT E;   315       global  $COMPOSIT E;
316       global  $ADMIN;   316       global  $ADMIN;
317     317  
318       $autoA pproval_if Photo = is AutoApprov al('photo' );   318       $autoA pproval_if Photo = is AutoApprov al('photo' );
319       $up_na me = "file _$pic_inde x";   319       $up_na me = "file _$pic_inde x";
320       $pic_a ddon_field  = "Pic_{$ pic_index} _addon";   320       $pic_a ddon_field  = "Pic_{$ pic_index} _addon";
321       $temp_ filename =  tempnam(r trim($dir[ 'tmp'], '/ '), $p_arr ['ID']);   321       $temp_ filename =  tempnam(r trim($dir[ 'tmp'], '/ '), $p_arr ['ID']);
322       unlink ($temp_fil ename);   322       unlink ($temp_fil ename);
323       $pic_n ame = $pic s[$pic_ind ex]['name' ];   323       $pic_n ame = $pic s[$pic_ind ex]['name' ];
324       $pic_t mp = $_FIL ES[$up_nam e]['tmp_na me'];   324       $pic_t mp = $_FIL ES[$up_nam e]['tmp_na me'];
325       $ext =  strrchr($ _FILES[$up _name]['na me'], '.') ;   325       $ext =  strrchr($ _FILES[$up _name]['na me'], '.') ;
326     326  
327       if ( $ pics[$pic_ index]['ex ist'] )   327       if ( $ pics[$pic_ index]['ex ist'] )
328           un link( "$pi c_name.jpg " );   328           un link( "$pi c_name.jpg " );
329     329  
330     330  
331           $s can = geti magesize($ _FILES[$up _name]['tm p_name']);   331           $s can = geti magesize($ _FILES[$up _name]['tm p_name']);
332           if  ( 1 != $s can[2] &&  2 != $scan [2] && 3 ! = $scan[2]  && 6 != $ scan[2] )   332           if  ( 1 != $s can[2] &&  2 != $scan [2] && 3 ! = $scan[2]  && 6 != $ scan[2] )
333                return 0 ;   333                return 0 ;
334     334  
335     335  
336       if ( m ove_upload ed_file( $ pic_tmp, " {$temp_fil ename}{$ex t}" ) )   336       if ( m ove_upload ed_file( $ pic_tmp, " {$temp_fil ename}{$ex t}" ) )
337       {   337       {
338           if  ( imageRe size( "{$t emp_filena me}{$ext}" , "{$temp_ filename}. jpg", $gl_ pic['pic'] ['width'],  $gl_pic[' pic']['hei ght'], tru e ) )   338           if  ( imageRe size( "{$t emp_filena me}{$ext}" , "{$temp_ filename}. jpg", $gl_ pic['pic'] ['width'],  $gl_pic[' pic']['hei ght'], tru e ) )
339           {   339           {
340                echo _t( "_FAILED_T O_UPLOAD_P IC", $_FIL ES[$up_nam e]['name'] , "undef") ;   340                echo _t( "_FAILED_T O_UPLOAD_P IC", $_FIL ES[$up_nam e]['name'] , "undef") ;
341                return 0 ;   341                return 0 ;
342           }   342           }
343           if  ( strtolo wer($ext)  != '.jpg'  )   343           if  ( strtolo wer($ext)  != '.jpg'  )
344                unlink(  "{$temp_fi lename}{$e xt}" );   344                unlink(  "{$temp_fi lename}{$e xt}" );
345     345  
346           if  ( getPara m( 'enable _watermark ' ) == 'on ' )   346           if  ( getPara m( 'enable _watermark ' ) == 'on ' )
347           {   347           {
348                $transpa rent1 = ge tParam( 't ransparent 1' );   348                $transpa rent1 = ge tParam( 't ransparent 1' );
349                $water_m ark = $dir ['profileI mage'] . g etParam( ' Water_Mark ' );   349                $water_m ark = $dir ['profileI mage'] . g etParam( ' Water_Mark ' );
350                if (  st rlen(getPa ram( 'Wate r_Mark' ))  && file_e xists($wat er_mark) )   350                if (  st rlen(getPa ram( 'Wate r_Mark' ))  && file_e xists($wat er_mark) )
351                {   351                {
352                    appl yWatermark ( "{$temp_ filename}. jpg", "{$t emp_filena me}.jpg",  $water_mar k, $transp arent1 );   352                    appl yWatermark ( "{$temp_ filename}. jpg", "{$t emp_filena me}.jpg",  $water_mar k, $transp arent1 );
353                }   353                }
354           }   354           }
355     355  
356           sr and(time() );   356           sr and(time() );
357           $p _arr[$pic_ addon_fiel d] = rand( 10000, 999 99);   357           $p _arr[$pic_ addon_fiel d] = rand( 10000, 999 99);
358           $p ics[$pic_i ndex]['nam e'] = "{$d ir['profil eImage']}{ $p_arr['ID ']}_{$pic_ index}_".  $p_arr[$pi c_addon_fi eld];   358           $p ics[$pic_i ndex]['nam e'] = "{$d ir['profil eImage']}{ $p_arr['ID ']}_{$pic_ index}_".  $p_arr[$pi c_addon_fi eld];
359           $p ic_name =  $pics[$pic _index]['n ame'];   359           $p ic_name =  $pics[$pic _index]['n ame'];
360           if  ( !rename ( "{$temp_ filename}. jpg", "$pi c_name.jpg " ) )   360           if  ( !rename ( "{$temp_ filename}. jpg", "$pi c_name.jpg " ) )
361           {   361           {
362                echo _t( "_FAILED_T O_UPLOAD_P IC", $_FIL ES[$up_nam e]['name'] , "fail to  rename");   362                echo _t( "_FAILED_T O_UPLOAD_P IC", $_FIL ES[$up_nam e]['name'] , "fail to  rename");
363                return 0 ;   363                return 0 ;
364           }   364           }
365           db _res( "UPD ATE `Profi les` SET $ pic_addon_ field = '" . $p_arr[$ pic_addon_ field] ."'  WHERE ID  = {$p_arr[ 'ID']}" );   365           db _res( "UPD ATE `Profi les` SET $ pic_addon_ field = '" . $p_arr[$ pic_addon_ field] ."'  WHERE ID  = {$p_arr[ 'ID']}" );
366     366  
367           ch mod( "$pic _name.jpg" , 0644 );   367           ch mod( "$pic _name.jpg" , 0644 );
368           $p ictures_te xt = _t_ac tion('_Suc cessfully  uploaded') ;   368           $p ictures_te xt = _t_ac tion('_Suc cessfully  uploaded') ;
369           $p ics[$pic_i ndex]['exi st'] = tru e;   369           $p ics[$pic_i ndex]['exi st'] = tru e;
370     370  
371           if  ( $p_arr[ 'Status']  == 'Active ' && !$aut oApproval_ ifPhoto &&  !$ADMIN )   371           if  ( $p_arr[ 'Status']  == 'Active ' && !$aut oApproval_ ifPhoto &&  !$ADMIN )
372           {   372           {
373                $update_ res = db_r es( "UPDAT E `Profile s` SET `St atus` = 'A pproval' W HERE `ID`  = {$p_arr[ 'ID']}" );   373                $update_ res = db_r es( "UPDAT E `Profile s` SET `St atus` = 'A pproval' W HERE `ID`  = {$p_arr[ 'ID']}" );
374     374  
375                $p_arr[' Status'] =  'Approval ';   375                $p_arr[' Status'] =  'Approval ';
376                modules_ block($p_a rr['ID']);   376                modules_ block($p_a rr['ID']);
377           }   377           }
378           cr eateUserDa taFile( $p _arr['ID']  );   378           cr eateUserDa taFile( $p _arr['ID']  );
379           re turn 1;   379           re turn 1;
380       }   380       }
381       else   381       else
382       {   382       {
383           ec ho _t_err( "_FAILED_T O_UPLOAD_P IC", $_FIL ES[$up_nam e]['name'] , "undef") ;   383           ec ho _t_err( "_FAILED_T O_UPLOAD_P IC", $_FIL ES[$up_nam e]['name'] , "undef") ;
384       }   384       }
385     385  
386       return  0;   386       return  0;
387   }   387   }
388     388  
389   /**   389   /**
390    * Print c ode for me mbership s tatus   390    * Print c ode for me mbership s tatus
391    * $member ID - membe r ID   391    * $member ID - membe r ID
392    * $offer_ upgrade -  will this  code be pr inted at [ c]ontrol [ p]anel   392    * $offer_ upgrade -  will this  code be pr inted at [ c]ontrol [ p]anel
393    */   393    */
394   function G etMembersh ipStatus($ memberID,  $offer_upg rade = tru e, $credit s = 0 )   394   function G etMembersh ipStatus($ memberID,  $offer_upg rade = tru e, $credit s = 0 )
395   {   395   {
396       global  $oTemplCo nfig;   396       global  $oTemplCo nfig;
397     397  
398       $ret =  "";   398       $ret =  "";
399     399  
400       $membe rship_info  = getMemb erMembersh ipInfo($me mberID);   400       $membe rship_info  = getMemb erMembersh ipInfo($me mberID);
401     401  
402       $viewM embershipA ctions = " <br />(<a  onclick=\" javascript :window.op en('explan ation.php? explain=me mbership&a mp;type=". $membershi p_info['ID ']."', '',  'width=50 0, height= 400, menub ar=no, sta tus=no, re sizable=no , scrollba rs=yes, to olbar=no,  location=n o');\" hre f=\"javasc ript:void( 0);\">"._t ("_VIEW_ME MBERSHIP_A CTIONS")." </a>)<br / >";   402       $viewM embershipA ctions = " <br />(<a  onclick=\" javascript :window.op en('explan ation.php? explain=me mbership&a mp;type=". $membershi p_info['ID ']."', '',  'width=50 0, height= 400, menub ar=no, sta tus=no, re sizable=no , scrollba rs=yes, to olbar=no,  location=n o');\" hre f=\"javasc ript:void( 0);\">"._t ("_VIEW_ME MBERSHIP_A CTIONS")." </a>)<br / >";
403     403  
404       // Sho w colored  membership  name   404       // Sho w colored  membership  name
405       if ( $ membership _info['ID' ] == MEMBE RSHIP_ID_S TANDARD )   405       if ( $ membership _info['ID' ] == MEMBE RSHIP_ID_S TANDARD )
406       {   406       {
407           $r et .= _t(  "_MEMBERSH IP_STANDAR D" ). $vie wMembershi pActions;   407           $r et .= _t(  "_MEMBERSH IP_STANDAR D" ). $vie wMembershi pActions;
408           if  ( $offer_ upgrade )   408           if  ( $offer_ upgrade )
409                $ret .=  " ". _t( " _MEMBERSHI P_UPGRADE_ FROM_STAND ARD" );   409                $ret .=  " ". _t( " _MEMBERSHI P_UPGRADE_ FROM_STAND ARD" );
410       }   410       }
411       else   411       else
412       {   412       {
413           $r et .= "<fo nt color=\ "red\">{$m embership_ info['Name ']}</font> $viewMembe rshipActio ns";   413           $r et .= "<fo nt color=\ "red\">{$m embership_ info['Name ']}</font> $viewMembe rshipActio ns";
414     414  
415           $d ays_left =  (int)( ($ membership _info['Dat eExpires']  - time())  / (24 * 3 600) );   415           $d ays_left =  (int)( ($ membership _info['Dat eExpires']  - time())  / (24 * 3 600) );
416     416  
417           if (!is_null( $membershi p_info['Da teExpires' ]))   417           if (!is_null( $membershi p_info['Da teExpires' ]))
418           {   418           {
419                if ( $da ys_left >  0 )   419                if ( $da ys_left >  0 )
420                {   420                {
421                    $ret  .= _t( "_ MEMBERSHIP _EXPIRES_I N_DAYS", $ days_left  );   421                    $ret  .= _t( "_ MEMBERSHIP _EXPIRES_I N_DAYS", $ days_left  );
422                }   422                }
423                else   423                else
424                {   424                {
425                    $ret  .= _t( "_ MEMBERSHIP _EXPIRES_T ODAY", dat e( "H:i",  $membershi p_info['Da teExpires' ] ), date(  "H:i" ) ) ;   425                    $ret  .= _t( "_ MEMBERSHIP _EXPIRES_T ODAY", dat e( "H:i",  $membershi p_info['Da teExpires' ] ), date(  "H:i" ) ) ;
426                }   426                }
427           }   427           }
428           el se   428           el se
429           {   429           {
430                $ret.= _ t("_MEMBER SHIP_EXPIR ES_NEVER") ;   430                $ret.= _ t("_MEMBER SHIP_EXPIR ES_NEVER") ;
431           }   431           }
432     432  
433           if  ( $offer_ upgrade &&  !is_null( $membershi p_info['Da teExpires' ]))   433           if  ( $offer_ upgrade &&  !is_null( $membershi p_info['Da teExpires' ]))
434                $ret .=  " - <a hre f=\"member ship.php\" >". _t( "_ MEMBERSHIP _BUY_MORE_ DAYS" ) ." </a>";   434                $ret .=  " - <a hre f=\"member ship.php\" >". _t( "_ MEMBERSHIP _BUY_MORE_ DAYS" ) ." </a>";
435       }   435       }
436     436  
437       return  $ret;   437       return  $ret;
438   }   438   }
439     439  
440   /**   440   /**
441    * Display  profile d etails: th umbnail, n ickname, s ex, age, l ocation.   441    * Display  profile d etails: th umbnail, n ickname, s ex, age, l ocation.
442    * @param  $profile       Profil e data as  returned b y mysql_fe tch_array.   442    * @param  $profile       Profil e data as  returned b y mysql_fe tch_array.
443    */   443    */
444   function d isplay_pro file_detai ls( $profi le )   444   function d isplay_pro file_detai ls( $profi le )
445   {   445   {
446       global  $dir; //  Image fold er   446       global  $dir; //  Image fold er
447       global  $site; //  Image URL   447       global  $site; //  Image URL
448       global  $aPreValu es;   448       global  $aPreValu es;
449     449  
450       // Get  profile t humbnail n ame.   450       // Get  profile t humbnail n ame.
451       $t_nam e = $profi le['ID'].' _0_'.$prof ile['Pic_0 _addon'].' .jpg';   451       $t_nam e = $profi le['ID'].' _0_'.$prof ile['Pic_0 _addon'].' .jpg';
452       // Get  profile t humbnail p ath.   452       // Get  profile t humbnail p ath.
453       $t_pat h = $dir[' profileIma ge'] . $t_ name;   453       $t_pat h = $dir[' profileIma ge'] . $t_ name;
454       // Get  profile t humbnail U RL.   454       // Get  profile t humbnail U RL.
455       $t_url  = $site[' profileIma ge'].$t_na me;   455       $t_url  = $site[' profileIma ge'].$t_na me;
456       // Get  anonymous  thumbnail  url.   456       // Get  anonymous  thumbnail  url.
457       $a_url  = 'male'  == $profil e['Sex'] ?  'man.jpg'  : 'woman. jpg';   457       $a_url  = 'male'  == $profil e['Sex'] ?  'man.jpg'  : 'woman. jpg';
458       $a_url  = $site[' profileIma ge'].$a_ur l;   458       $a_url  = $site[' profileIma ge'].$a_ur l;
459       // Sel ect correc t url.   459       // Sel ect correc t url.
460       if ( f ile_exists ( $t_path  ) )   460       if ( f ile_exists ( $t_path  ) )
461       {   461       {
462           $u rl = $t_ur l;   462           $u rl = $t_ur l;
463       }   463       }
464       else   464       else
465       {   465       {
466           $u rl = $a_ur l;   466           $u rl = $a_ur l;
467       }   467       }
468     468  
469       // Get  profile d etails.   469       // Get  profile d etails.
470       $nickn ame = $pro file['Nick Name'];   470       $nickn ame = $pro file['Nick Name'];
471     471  
472       $age_s ex = _t("_ y/o", $pro file['Age' ])."&nbsp; "._t("_".$ profile['S ex']);   472       $age_s ex = _t("_ y/o", $pro file['Age' ])."&nbsp; "._t("_".$ profile['S ex']);
473     473  
474       $locat ion = $pro file['City '].', '._t ( $aPreVal ues['Count ry'][$prof ile['Count ry']]['LKe y'] );   474       $locat ion = $pro file['City '].', '._t ( $aPreVal ues['Count ry'][$prof ile['Count ry']]['LKe y'] );
475     475  
476       // Dis play profi le details .   476       // Dis play profi le details .
477       ob_sta rt();   477       ob_sta rt();
478   ?>   478   ?>
479       <table  class="pr ofile_deta ils" cells pacing="0"  cellpaddi ng="2" bor der="0">   479       <table  class="pr ofile_deta ils" cells pacing="0"  cellpaddi ng="2" bor der="0">
480           <t r>   480           <t r>
481                <td alig n="center"  class="pr ofile_thum b">   481                <td alig n="center"  class="pr ofile_thum b">
482                    <img  src="<?=  $url ?>" / >   482                    <img  src="<?=  $url ?>" / >
483                </td>   483                </td>
484           </ tr>   484           </ tr>
485           <t r>   485           <t r>
486                <td clas s="profile _nickname"  align="le ft">-&nbsp ;<?= $nick name ?></t d>   486                <td clas s="profile _nickname"  align="le ft">-&nbsp ;<?= $nick name ?></t d>
487           </ tr>   487           </ tr>
488           <t r>   488           <t r>
489                <td clas s="profile _age_sex"  align="lef t" style=" width: 100 px">-&nbsp ;<?= $age_ sex ?></td >   489                <td clas s="profile _age_sex"  align="lef t" style=" width: 100 px">-&nbsp ;<?= $age_ sex ?></td >
490           </ tr>   490           </ tr>
491           <t r>   491           <t r>
492                <td clas s="profile _location"  align="le ft">-&nbsp ;<?= $loca tion ?></t d>   492                <td clas s="profile _location"  align="le ft">-&nbsp ;<?= $loca tion ?></t d>
493           </ tr>   493           </ tr>
494       </tabl e>   494       </tabl e>
495   <?   495   <?
496       $conte nt = ob_ge t_contents ();   496       $conte nt = ob_ge t_contents ();
497       ob_end _clean();   497       ob_end _clean();
498       echo $ content;   498       echo $ content;
499   }   499   }
500     500  
501     501  
502   function P rofileDeta ils( $send erID )   502   function P rofileDeta ils( $send erID )
503   {   503   {
504       global  $site;   504       global  $site;
505       global  $aPreValu es;   505       global  $aPreValu es;
506       global  $dir;   506       global  $dir;
507     507  
508       $prof_ arr = getP rofileInfo ( $senderI D );   508       $prof_ arr = getP rofileInfo ( $senderI D );
509     509  
510       $count ry = _t( $ aPreValues ['Country' ][$prof_ar r['Country ']]['LKey' ] );   510       $count ry = _t( $ aPreValues ['Country' ][$prof_ar r['Country ']]['LKey' ] );
511       $prof_ age = age( $prof_arr[ 'DateOfBir th']);   511       $prof_ age = age( $prof_arr[ 'DateOfBir th']);
512       $prof_ sex = _t(  "_" . $pro f_arr['Sex ']);   512       $prof_ sex = _t(  "_" . $pro f_arr['Sex ']);
513     513       
    514       if( is set( $prof _arr['City '] ) and ! empty( $pr of_arr['Ci ty'] ) )
    515           $c ountry .=  ", {$prof_ arr['City' ]}";
    516       
514       if ( $ prof_arr[' Status'] = = 'Active'  )   517       if ( $ prof_arr[' Status'] = = 'Active'  )
515       {   518       {
516           $n ick_link =  '<a href= "' . getPr ofileLink( $senderID)  . '" targ et="_blank ">' . $pro f_arr['Nic kName'] .  '</a>';   519           $n ick_link =  '<a href= "' . getPr ofileLink( $senderID)  . '" targ et="_blank ">' . $pro f_arr['Nic kName'] .  '</a>';
517       }   520       }
518       else   521       else
519       {   522       {
520           $n ick_link =  $prof_arr ['NickName '];   523           $n ick_link =  $prof_arr ['NickName '];
521       }   524       }
522       $ret . = '<div cl ass="prof_ details_wr apper">';   525       $ret . = '<div cl ass="prof_ details_wr apper">';
523           $r et .= '<di v class="c lear_both" ></div>';   526           $r et .= '<di v class="c lear_both" ></div>';
524           $r et .= get_ member_thu mbnail( $s enderID, ' left' );   527           $r et .= get_ member_thu mbnail( $s enderID, ' left' );
525              528           
526           $r et .= '<di v class="p rof_ditail s_block">' ;   529           $r et .= '<di v class="p rof_ditail s_block">' ;
527                $ret .=  '<div clas s="li_word ">'._t('_N ickName'). ':</div><d iv class=" li_value"> ' . $nick_ link . '</ div>';   530                $ret .=  '<div clas s="li_word ">'._t('_N ickName'). ':</div><d iv class=" li_value"> ' . $nick_ link . '</ div>';
528                $ret .=  '<div clas s="li_word ">'._t('_S ex').':</d iv><div cl ass="li_va lue">' . $ prof_sex .  '</div>';   531                $ret .=  '<div clas s="li_word ">'._t('_S ex').':</d iv><div cl ass="li_va lue">' . $ prof_sex .  '</div>';
529                $ret .=  '<div clas s="li_word ">'._t('_D ateOfBirth ').':</div ><div clas s="li_valu e">' . $pr of_age . ' </div>';   532                $ret .=  '<div clas s="li_word ">'._t('_D ateOfBirth ').':</div ><div clas s="li_valu e">' . $pr of_age . ' </div>';
530                $ret .=  '<div clas s="li_word ">'._t('_F rom').':</ div><div c lass="li_v alue"> ' .  $country  . '</div>' ;   533                $ret .=  '<div clas s="li_word ">'._t('_F rom').':</ div><div c lass="li_v alue"> ' .  $country  . '</div>' ;
531           $r et .= '</d iv>';   534           $r et .= '</d iv>';
532           $r et .= '<di v class="c lear_both" ></div>';   535           $r et .= '<di v class="c lear_both" ></div>';
533       $ret . = '</div>' ;   536       $ret . = '</div>' ;
534     537  
535     538  
536       return  $ret;   539       return  $ret;
537   }   540   }
538     541  
539     542  
540     543  
541   function S howPoll( $ uID )   544   function S howPoll( $ uID )
542   {   545   {
543     546  
544       global  $_page;   547       global  $_page;
545       global  $site;   548       global  $site;
546     549  
547       $_page ['js_name' ]   = 'pro file_poll. js';   550       $_page ['js_name' ]   = 'pro file_poll. js';
548          551       
549       $sButt onValue =  _t( '_Vote ' );   552       $sButt onValue =  _t( '_Vote ' );
550     553  
551       $ret . =   554       $ret . =
552   <<<EOS   555   <<<EOS
553       <div i d="dpol_{$ uID}"  cla ss="pollBl ock" >   556       <div i d="dpol_{$ uID}"  cla ss="pollBl ock" >
554           <d iv id="dpo l_caption_ {$uID}" cl ass="pollC aption"></ div>   557           <d iv id="dpo l_caption_ {$uID}" cl ass="pollC aption"></ div>
555           <d iv id="dpo l_question _{$uID}" c lass="poll AnswerBloc k">   558           <d iv id="dpo l_question _{$uID}" c lass="poll AnswerBloc k">
556                <div id= "dpol_arr_ up_{$uID}"  class="po llUp" onmo useover="j avascript:  scroll_st art(docume nt.getElem entById('d pol_questi on_text_{$ uID}'), 'd own');" on mouseout=" javascript : scroll_s top();">   559                <div id= "dpol_arr_ up_{$uID}"  class="po llUp" onmo useover="j avascript:  scroll_st art(docume nt.getElem entById('d pol_questi on_text_{$ uID}'), 'd own');" on mouseout=" javascript : scroll_s top();">
557                    <img  src="{$si te['icons' ]}pollUp.g if" alt=""  />   560                    <img  src="{$si te['icons' ]}pollUp.g if" alt=""  />
558                </div>   561                </div>
559                <div id= "dpol_arr_ down_{$uID }" class=" pollDown"  onmouseove r="javascr ipt: scrol l_start(do cument.get ElementByI d('dpol_qu estion_tex t_{$uID}') , 'up');"  onmouseout ="javascri pt: scroll _stop();">   562                <div id= "dpol_arr_ down_{$uID }" class=" pollDown"  onmouseove r="javascr ipt: scrol l_start(do cument.get ElementByI d('dpol_qu estion_tex t_{$uID}') , 'up');"  onmouseout ="javascri pt: scroll _stop();">
560                    <img  src="{$si te['icons' ]}pollDown .gif" alt= "" />   563                    <img  src="{$si te['icons' ]}pollDown .gif" alt= "" />
561                </div>   564                </div>
562                <div id= "dpol_ques tion_text_ {$uID}" cl ass="pollQ uestionBlo ck"></div>   565                <div id= "dpol_ques tion_text_ {$uID}" cl ass="pollQ uestionBlo ck"></div>
563           </ div>   566           </ div>
564           <d iv id="dpo l_actions_ {$uID}" cl ass="pollS ubmitBlock ">   567           <d iv id="dpo l_actions_ {$uID}" cl ass="pollS ubmitBlock ">
565                <input t ype="butto n" value=" {$sButtonV alue}" onc lick="java script: se nd_data( ' dpol_quest ion_text_{ $uID}', 'v ote', '&am p;param='  + ( docume nt.getElem entById( ' current_vo te_{$uID}'  ) ? docum ent.getEle mentById(  'current_v ote_{$uID} ' ).value  : '' ), '{ $uID}' );  return fal se;" />   568                <input t ype="butto n" value=" {$sButtonV alue}" onc lick="java script: se nd_data( ' dpol_quest ion_text_{ $uID}', 'v ote', '&am p;param='  + ( docume nt.getElem entById( ' current_vo te_{$uID}'  ) ? docum ent.getEle mentById(  'current_v ote_{$uID} ' ).value  : '' ), '{ $uID}' );  return fal se;" />
566           </ div>   569           </ div>
567       </div>   570       </div>
568       <scrip t type="te xt/javascr ipt" langu age="javas cript">   571       <scrip t type="te xt/javascr ipt" langu age="javas cript">
569           se nd_data( ' dpol_quest ion_text_{ $uID}', 'q uestions',  '', '{$uI D}' );   572           se nd_data( ' dpol_quest ion_text_{ $uID}', 'q uestions',  '', '{$uI D}' );
570       </scri pt>   573       </scri pt>
571     574  
572   EOS;   575   EOS;
573     576  
574   /*   577   /*
575                <!--<a h ref="#" on click="jav ascript: s end_data(  'dpol_ques tion_text_ {$uID}', ' vote', '&p aram=' + (  document. getElement ById( 'cur rent_vote_ {$uID}' )  ? document .getElemen tById( 'cu rrent_vote _{$uID}' ) .value : ' ' ), '{$uI D}' ); ret urn false; ">   578                <!--<a h ref="#" on click="jav ascript: s end_data(  'dpol_ques tion_text_ {$uID}', ' vote', '&p aram=' + (  document. getElement ById( 'cur rent_vote_ {$uID}' )  ? document .getElemen tById( 'cu rrent_vote _{$uID}' ) .value : ' ' ), '{$uI D}' ); ret urn false; ">
576                    <img  src="{$si te['icons' ]}pollSubm it.gif" al t="rez" bo rder="0">   579                    <img  src="{$si te['icons' ]}pollSubm it.gif" al t="rez" bo rder="0">
577                </a>-->   580                </a>-->
578   */   581   */
579       return  $ret;   582       return  $ret;
580     583  
581   }   584   }
582     585  
583   function i sAutoAppro val( $sAct ion )   586   function i sAutoAppro val( $sAct ion )
584   {   587   {
585       $autoA pproval_if Photo   =  ( 'on' ==  getParam(" autoApprov al_ifPhoto ") );   588       $autoA pproval_if Photo   =  ( 'on' ==  getParam(" autoApprov al_ifPhoto ") );
586       $autoA pproval_if Sound   =  ( 'on' ==  getParam(" autoApprov al_ifSound ") );   589       $autoA pproval_if Sound   =  ( 'on' ==  getParam(" autoApprov al_ifSound ") );
587       $autoA pproval_if Video   =  ( 'on' ==  getParam(" autoApprov al_ifVideo ") );   590       $autoA pproval_if Video   =  ( 'on' ==  getParam(" autoApprov al_ifVideo ") );
588       $autoA pproval_if Profile =  ( 'on' ==  getParam(" autoApprov al_ifProfi le") );   591       $autoA pproval_if Profile =  ( 'on' ==  getParam(" autoApprov al_ifProfi le") );
589       $autoA pproval_if Join    =  ( 'on' ==  getParam(" autoApprov al_ifJoin" ) );   592       $autoA pproval_if Join    =  ( 'on' ==  getParam(" autoApprov al_ifJoin" ) );
590     593  
591       switch  ( $sActio n )   594       switch  ( $sActio n )
592       {   595       {
593           ca se 'photo' :   596           ca se 'photo' :
594                return $ autoApprov al_ifPhoto ;   597                return $ autoApprov al_ifPhoto ;
595     598  
596           ca se 'sound' :   599           ca se 'sound' :
597                return $ autoApprov al_ifSound ;   600                return $ autoApprov al_ifSound ;
598     601  
599           ca se 'video' :   602           ca se 'video' :
600                return $ autoApprov al_ifVideo ;   603                return $ autoApprov al_ifVideo ;
601     604  
602           ca se 'profil e':   605           ca se 'profil e':
603                return $ autoApprov al_ifProfi le;   606                return $ autoApprov al_ifProfi le;
604     607  
605           ca se 'join':   608           ca se 'join':
606                return $ autoApprov al_ifJoin;   609                return $ autoApprov al_ifJoin;
607     610  
608           de fault:   611           de fault:
609                return f alse;   612                return f alse;
610       }   613       }
611   }   614   }
612     615  
613     616  
614   /* * * * R ay MP3 Int egration ( Begin) * *  * */   617   /* * * * R ay MP3 Int egration ( Begin) * *  * */
615   function g etRayMp3Pl ayer( $iId , $sPasswo rd, $iView erId)   618   function g etRayMp3Pl ayer( $iId , $sPasswo rd, $iView erId)
616   {   619   {
617       return  getApplic ationConte nt("mp3",  "player",  array('id'  => $iId,  'password'  => md5($s Password),  'vId' =>  $iViewerId ), true);   620       return  getApplic ationConte nt("mp3",  "player",  array('id'  => $iId,  'password'  => md5($s Password),  'vId' =>  $iViewerId ), true);
618   }   621   }
619   /* * * * R ay MP3 Int egration ( End) * * *  */   622   /* * * * R ay MP3 Int egration ( End) * * *  */
620     623  
621   function c reateUserD ataFile( $ userID )   624   function c reateUserD ataFile( $ userID )
622   {   625   {
623       global  $dir, $da te_format;   626       global  $dir, $da te_format;
624     627  
625       $userI D = (int)$ userID;   628       $userI D = (int)$ userID;
626       $fileN ame = $dir ['cache']  . 'user' .  $userID .  '.php';   629       $fileN ame = $dir ['cache']  . 'user' .  $userID .  '.php';
627       if( $u serID > 0  )   630       if( $u serID > 0  )
628       {   631       {
629           $u serQuery =  "   632           $u serQuery =  "
630                SELECT   633                SELECT
631                         *,   634                         *,
632                         DATE_FORMA T(`DateLas tLogin`,   '$date_for mat' ) AS  `DateLastL ogin`,   635                         DATE_FORMA T(`DateLas tLogin`,   '$date_for mat' ) AS  `DateLastL ogin`,
633                         DATE_FORMA T(`DateLas tEdit`,    '$date_for mat' ) AS  `DateLastE dit`   636                         DATE_FORMA T(`DateLas tEdit`,    '$date_for mat' ) AS  `DateLastE dit`
634                FROM   637                FROM
635                         `Profiles`   638                         `Profiles`
636                WHERE `I D` = '$use rID' LIMIT  1   639                WHERE `I D` = '$use rID' LIMIT  1
637           ";   640           ";
638              641           
639           $a PreUser =  db_assoc_a rr( $userQ uery );   642           $a PreUser =  db_assoc_a rr( $userQ uery );
640              643           
641           if ( isset( $ aPreUser )  and is_ar ray( $aPre User ) )   644           if ( isset( $ aPreUser )  and is_ar ray( $aPre User ) )
642           {   645           {
643                   646                
644                $sUser =  '<?';   647                $sUser =  '<?';
645                $sUser . = "\n\n";   648                $sUser . = "\n\n";
646                $sUser . = '$aUser[ ' . $userI D . '] = a rray();';   649                $sUser . = '$aUser[ ' . $userI D . '] = a rray();';
647                $sUser . = "\n";   650                $sUser . = "\n";
648                $sUser . = '$aUser[ ' . $userI D . '][\'d atafile\']  = true;';   651                $sUser . = '$aUser[ ' . $userI D . '][\'d atafile\']  = true;';
649                $sUser . = "\n";   652                $sUser . = "\n";
650     653  
651                $replace What = arr ay( '\\',    '\''   ) ;   654                $replace What = arr ay( '\\',    '\''   ) ;
652                $replace To   = arr ay( '\\\\' , '\\\'' ) ;   655                $replace To   = arr ay( '\\\\' , '\\\'' ) ;
653                   656                
654                foreach(  $aPreUser  as $key = >  $value  )   657                foreach(  $aPreUser  as $key = >  $value  )
655                    $sUs er .= '$aU ser[' . $u serID . '] [\'' . $ke y . '\']'  . ' = ' .  '\'' . str _replace(  $replaceWh at, $repla ceTo, $val ue )  . '\ '' . ";\n" ;   658                    $sUs er .= '$aU ser[' . $u serID . '] [\'' . $ke y . '\']'  . ' = ' .  '\'' . str _replace(  $replaceWh at, $repla ceTo, $val ue )  . '\ '' . ";\n" ;
656                   659                
657                $sUser . = "\n" . ' ?>';   660                $sUser . = "\n" . ' ?>';
658                   661                
659                if( $fil e = fopen(  $fileName , "w" ) )   662                if( $fil e = fopen(  $fileName , "w" ) )
660                {   663                {
661                    fwri te( $file,  $sUser );   664                    fwri te( $file,  $sUser );
662                    fclo se( $file  );   665                    fclo se( $file  );
663                    @chm od ($fileN ame, 0666) ;   666                    @chm od ($fileN ame, 0666) ;
664                       667                    
665                    @inc lude( $fil eName );   668                    @inc lude( $fil eName );
666                    retu rn true;   669                    retu rn true;
667                }   670                }
668                else   671                else
669                    retu rn false;   672                    retu rn false;
670                   673                
671           }   674           }
672       }   675       }
673       else   676       else
674           re turn false ;   677           re turn false ;
675   }   678   }
676     679  
677   function g etProfileI nfo( $iPro fileID, $c heckActive Status = f alse, $for ceCache =  false )   680   function g etProfileI nfo( $iPro fileID, $c heckActive Status = f alse, $for ceCache =  false )
678   {   681   {
679       global  $aUser;   682       global  $aUser;
680       global  $dir;   683       global  $dir;
681       global  $date_for mat;   684       global  $date_for mat;
682          685       
683       $iProf ileID = (i nt)$iProfi leID;   686       $iProf ileID = (i nt)$iProfi leID;
684       if( !$ iProfileID  )   687       if( !$ iProfileID  )
685           re turn false ;   688           re turn false ;
686          689       
687       if( !i sset( $aUs er[$iProfi leID] ) ||  !is_array ( $aUser[$ iProfileID ] ) || $fo rceCache )   690       if( !i sset( $aUs er[$iProfi leID] ) ||  !is_array ( $aUser[$ iProfileID ] ) || $fo rceCache )
688       {   691       {
689           $s CacheFile  = $dir['ca che'] . 'u ser' . $iP rofileID .  '.php';   692           $s CacheFile  = $dir['ca che'] . 'u ser' . $iP rofileID .  '.php';
690              693           
691           if ( !file_ex ists( $sCa cheFile )  || $forceC ache )   694           if ( !file_ex ists( $sCa cheFile )  || $forceC ache )
692                if( !cre ateUserDat aFile( $iP rofileID )  )   695                if( !cre ateUserDat aFile( $iP rofileID )  )
693                    retu rn false;   696                    retu rn false;
694              697           
695           @i nclude( $s CacheFile  );   698           @i nclude( $s CacheFile  );
696       }   699       }
697          700       
698       if( $c heckActive Status and  $aUser[$i ProfileID] ['Status']  != 'Activ e' )   701       if( $c heckActive Status and  $aUser[$i ProfileID] ['Status']  != 'Activ e' )
699           re turn false ;   702           re turn false ;
700          703       
701       return  $aUser[$i ProfileID] ;   704       return  $aUser[$i ProfileID] ;
702   }   705   }
703     706  
704   function g etNewLette rsNum( $iI D )   707   function g etNewLette rsNum( $iI D )
705   {   708   {
706       $sqlQu ery = "SEL ECT COUNT( `Recipient `) FROM `M essages` W HERE `Reci pient`='$i ID' AND `N ew`='1'";   709       $sqlQu ery = "SEL ECT COUNT( `Recipient `) FROM `M essages` W HERE `Reci pient`='$i ID' AND `N ew`='1'";
707       $iNum  = db_value ($sqlQuery );   710       $iNum  = db_value ($sqlQuery );
708          711       
709       return  $iNum;   712       return  $iNum;
710   }   713   }
711     714  
712   function g etFriendNu mber ($iID )   715   function g etFriendNu mber ($iID )
713   {   716   {
714       $sqlQu ery = "SEL ECT COUNT( *) FROM `F riendList`  WHERE ( ` ID`='$iID'  OR `Profi le`='$iID'  ) AND `Ch eck`='1'";   717       $sqlQu ery = "SEL ECT COUNT( *) FROM `F riendList`  WHERE ( ` ID`='$iID'  OR `Profi le`='$iID'  ) AND `Ch eck`='1'";
715          718       
716       return  db_value( $sqlQuery) ;   719       return  db_value( $sqlQuery) ;
717   }   720   }
718     721  
719   /*   722   /*
720   * The func tion retur ns NickNam e by given  ID. If no  ID specif ied, it tr yes to get  if from _ COOKIE['me mberID'];   723   * The func tion retur ns NickNam e by given  ID. If no  ID specif ied, it tr yes to get  if from _ COOKIE['me mberID'];
721   */   724   */
722     725  
723   function g etNickName ( $ID = ''  )   726   function g etNickName ( $ID = ''  )
724   {   727   {
725       global  $dir;   728       global  $dir;
726     729  
727     730  
728       if ( ! $ID && (in t)$_COOKIE ['memberID '] )   731       if ( ! $ID && (in t)$_COOKIE ['memberID '] )
729           $I D = $_COOK IE['member ID'];   732           $I D = $_COOK IE['member ID'];
730     733  
731       if ( ! $ID )   734       if ( ! $ID )
732           re turn '';   735           re turn '';
733          736       
734       $arr =  getProfil eInfo( $ID  );   737       $arr =  getProfil eInfo( $ID  );
735       return  $arr['Nic kName'];   738       return  $arr['Nic kName'];
736   }   739   }
737     740  
738   /*   741   /*
739    * The fun ction retu rns Passwo rd by give n ID.   742    * The fun ction retu rns Passwo rd by give n ID.
740    */   743    */
741   function g etPassword ( $ID = ''  )   744   function g etPassword ( $ID = ''  )
742   {   745   {
743       if ( ! (int)$ID )   746       if ( ! (int)$ID )
744           re turn '';   747           re turn '';
745     748  
746       $arr =  getProfil eInfo( $ID  );   749       $arr =  getProfil eInfo( $ID  );
747       return  $arr['Pas sword'];   750       return  $arr['Pas sword'];
748   }   751   }
749     752  
750   function g etSex( $ID  = '' )   753   function g etSex( $ID  = '' )
751   {   754   {
752       if ( ! (int)$ID )   755       if ( ! (int)$ID )
753           re turn '';   756           re turn '';
754     757  
755       $arr =  getProfil eInfo( $ID  );   758       $arr =  getProfil eInfo( $ID  );
756       return  $arr['Sex '];   759       return  $arr['Sex '];
757   }   760   }
758     761  
759   function g etProfileL ink( $iID,  $sLinkAdd  = '' )   762   function g etProfileL ink( $iID,  $sLinkAdd  = '' )
760   {   763   {
761       global  $site;   764       global  $site;
762     765  
763       $aProf Info = get ProfileInf o( $iID );   766       $aProf Info = get ProfileInf o( $iID );
764       $iID =  ($aProfIn fo['Couple '] > 0 &&  $aProfInfo ['ID'] > $ aProfInfo[ 'Couple'])  ? $aProfI nfo['Coupl e'] : $iID ;   767       $iID =  ($aProfIn fo['Couple '] > 0 &&  $aProfInfo ['ID'] > $ aProfInfo[ 'Couple'])  ? $aProfI nfo['Coupl e'] : $iID ;
765     768  
766       if ( g etParam('e nable_modr ewrite') = = 'on' )   769       if ( g etParam('e nable_modr ewrite') = = 'on' )
767           $s Link = $si te['url']. getNickNam e($iID) .  ( $sLinkAd d ? "?{$sL inkAdd}" :  '' );   770           $s Link = $si te['url']. getNickNam e($iID) .  ( $sLinkAd d ? "?{$sL inkAdd}" :  '' );
768       else   771       else
769           $s Link = $si te['url']. 'profile.p hp?ID='.$i ID . ( $sL inkAdd ? " &{$sLinkAd d}" : '' ) ;   772           $s Link = $si te['url']. 'profile.p hp?ID='.$i ID . ( $sL inkAdd ? " &{$sLinkAd d}" : '' ) ;
770          773       
771       return  $sLink;   774       return  $sLink;
772   }   775   }
773     776  
774     777  
775   /**   778   /**
776    * Shows h ow many da ys, hours,  minutes m ember was  onine last  time   779    * Shows h ow many da ys, hours,  minutes m ember was  onine last  time
777    *   780    *
778    * @param   $lastNavT ime   781    * @param   $lastNavT ime
779    *   782    *
780    * @return  int   783    * @return  int
781    */   784    */
782   function   getProfile LastOnline Period( $l astNavTime  )   785   function   getProfile LastOnline Period( $l astNavTime  )
783   {   786   {
784           if  ( $lastNa vTime != 0  )   787           if  ( $lastNa vTime != 0  )
785           {   788           {
786                $time =  date("U")  - $lastNav Time;   789                $time =  date("U")  - $lastNav Time;
787     790  
788                if ( $ti me <= 300  )   791                if ( $ti me <= 300  )
789                {   792                {
790                    //$r et = '<str ong>' . _t ('_Online' ) . '</str ong>';   793                    //$r et = '<str ong>' . _t ('_Online' ) . '</str ong>';
791                    $ret  = '<div c lass="onli ne">' . _t ('_Online' ) . '</div >';   794                    $ret  = '<div c lass="onli ne">' . _t ('_Online' ) . '</div >';
792                }   795                }
793                else   796                else
794                {   797                {
795                    $min utes = flo or( $time  / 60 );   798                    $min utes = flo or( $time  / 60 );
796                    if (  $minutes  > 60 )   799                    if (  $minutes  > 60 )
797                    {   800                    {
798                         $hours = f loor( $tim e / 3600 ) ;   801                         $hours = f loor( $tim e / 3600 ) ;
799                         if ( $hour s > 24 )   802                         if ( $hour s > 24 )
800                         {   803                         {
801                             $days  = floor( $ time / 864 00 );   804                             $days  = floor( $ time / 864 00 );
802                             $hours  = floor(  ( $time -  $days*8640 0 ) / 3600  );   805                             $hours  = floor(  ( $time -  $days*8640 0 ) / 3600  );
803                             $minut es = floor ( ( $time  - $days*86 400 - $hou rs*3600 )  / 60 );   806                             $minut es = floor ( ( $time  - $days*86 400 - $hou rs*3600 )  / 60 );
804                         }   807                         }
805                         else   808                         else
806                         {   809                         {
807                             $minut es = floor  ( ( $time  - $hours* 3600 ) / 6 0 );   810                             $minut es = floor  ( ( $time  - $hours* 3600 ) / 6 0 );
808                         }   811                         }
809                    }   812                    }
810     813  
811                    /*   814                    /*
812                    if(  $days > 31  )   815                    if(  $days > 31  )
813                    {   816                    {
814                         $lnt = '<s trong>' .  _t('_more_ month_ago' ) . '</str ong>';   817                         $lnt = '<s trong>' .  _t('_more_ month_ago' ) . '</str ong>';
815                    }   818                    }
816                    else   819                    else
817                    {   820                    {
818                         if( $days  > 7 )   821                         if( $days  > 7 )
819                         {   822                         {
820                             $lnt =  '<strong> ' . _t('_m ore_week_a go') . '</ strong>';   823                             $lnt =  '<strong> ' . _t('_m ore_week_a go') . '</ strong>';
821                         }   824                         }
822                         else   825                         else
823                         {   826                         {
824                             if ( $ days >= 7  )   827                             if ( $ days >= 7  )
825                                 $l nt = '<str ong>' . _t ('_week_ag o') . '</s trong>';   828                                 $l nt = '<str ong>' . _t ('_week_ag o') . '</s trong>';
826                             else   829                             else
827                             */   830                             */
828                                 // $lnt = ( $ days ? $da ys . ' day (s) ago' :  ( $hours  ? $hours .  ' hour(s)  ago' : $m inutes . '  minutes a go' )) . ' ';   831                                 // $lnt = ( $ days ? $da ys . ' day (s) ago' :  ( $hours  ? $hours .  ' hour(s)  ago' : $m inutes . '  minutes a go' )) . ' ';
829                                 if ( $days )   832                                 if ( $days )
830                                 {   833                                 {
831                                      $ret = _ t( '_day(s )', $days  );// $days  .   834                                      $ret = _ t( '_day(s )', $days  );// $days  .
832                                 }   835                                 }
833                                 el seif( $hou rs )   836                                 el seif( $hou rs )
834                                 {   837                                 {
835                                      $ret = _ t( '_hour( s)', $hour s );   838                                      $ret = _ t( '_hour( s)', $hour s );
836                                 }   839                                 }
837                                 el se   840                                 el se
838                                 {   841                                 {
839                                      $ret = _ t( '_minut e(s)', $mi nutes );   842                                      $ret = _ t( '_minut e(s)', $mi nutes );
840                                 }   843                                 }
841     844  
842                                 /*   845                                 /*
843                         }   846                         }
844                    }   847                    }
845                    */   848                    */
846     849  
847                }   850                }
848     851  
849           }   852           }
850           el se   853           el se
851           {   854           {
852                $ret = ' <div class ="never">'  . _t('_ne ver') . '< /div>';   855                $ret = ' <div class ="never">'  . _t('_ne ver') . '< /div>';
853           }   856           }
854     857  
855           re turn $ret;   858           re turn $ret;
856   }   859   }
857     860  
858   function p eriodic_ch eck_ban()  {   861   function p eriodic_ch eck_ban()  {
859       //Clea ning Ban t able   862       //Clea ning Ban t able
860       $Check SQL = "   863       $Check SQL = "
861           SE LECT `Admi nBanList`.   864           SE LECT `Admi nBanList`.
862           FR OM `AdminB anList`    865           FR OM `AdminB anList` 
863           WH ERE (   866           WH ERE (
864                `DateTim e` + INTER VAL `Time`  SECOND <  NOW()   867                `DateTim e` + INTER VAL `Time`  SECOND <  NOW()
865           )   868           )
866       ";   869       ";
867       $vChec kBanRes =  db_res($Ch eckSQL);   870       $vChec kBanRes =  db_res($Ch eckSQL);
868       while  ( $aCheckB anRes = my sql_fetch_ assoc($vCh eckBanRes)  ) {   871       while  ( $aCheckB anRes = my sql_fetch_ assoc($vCh eckBanRes)  ) {
869           $s DeleteBanS QL = "DELE TE FROM `A dminBanLis t` WHERE ` ProfID`='{ $aCheckBan Res['ProfI D']}'";   872           $s DeleteBanS QL = "DELE TE FROM `A dminBanLis t` WHERE ` ProfID`='{ $aCheckBan Res['ProfI D']}'";
870           db _res($sDel eteBanSQL) ;   873           db _res($sDel eteBanSQL) ;
871       }   874       }
872   }   875   }
873     876  
874   function i sLoggedBan ned($iCurU serID = 0)  {   877   function i sLoggedBan ned($iCurU serID = 0)  {
875       $iCCur UserID = ( $iCurUserI D>0) ? $iC urUserID :  (int)$_CO OKIE['memb erID'];   878       $iCCur UserID = ( $iCurUserI D>0) ? $iC urUserID :  (int)$_CO OKIE['memb erID'];
876       if ($i CCurUserID ) {   879       if ($i CCurUserID ) {
877           $C heckSQL =  "   880           $C heckSQL =  "
878                SELECT *     881                SELECT *  
879                FROM `Ad minBanList   882                FROM `Ad minBanList
880                WHERE `P rofID`='{$ iCCurUserI D}'   883                WHERE `P rofID`='{$ iCCurUserI D}'
881           ";   884           ";
882           db _res($Chec kSQL);   885           db _res($Chec kSQL);
883           if  (mysql_af fected_row s()>0) {   886           if  (mysql_af fected_row s()>0) {
884                return t rue;   887                return t rue;
885           }   888           }
886       }   889       }
887       return  false;   890       return  false;
888   }   891   }
889     892  
890   function m ake_check_ ban() {   893   function m ake_check_ ban() {
891       //Make  automatic ally logou t for Bann ed members   894       //Make  automatic ally logou t for Bann ed members
892       if (is LoggedBann ed((int)$_ COOKIE['me mberID']))  {   895       if (is LoggedBann ed((int)$_ COOKIE['me mberID']))  {
893           se tcookie( ' memberID',  $_COOKIE[ 'memberID' ], time()  - 48 * 360 0, '/' );   896           se tcookie( ' memberID',  $_COOKIE[ 'memberID' ], time()  - 48 * 360 0, '/' );
894           se tcookie( ' memberPass word', $_C OOKIE['mem berPasswor d'], time( ) - 48 * 3 600, '/' ) ;   897           se tcookie( ' memberPass word', $_C OOKIE['mem berPasswor d'], time( ) - 48 * 3 600, '/' ) ;
895       }   898       }
896   }   899   }
897     900  
898   make_check _ban();   901   make_check _ban();