36. File Comparison Report

Produced on Thu Jul 17 07:17:24 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.

36.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.1.2\inc profiles.inc.php Mon May 26 10:15:40 2008 UTC
2 Dolphin-v.6.1.3\inc profiles.inc.php Wed Jul 16 09:51:20 2008 UTC

36.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 9 1782
Changed 4 8
Inserted 0 0
Removed 4 6

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

36.4 Active regular expressions

No regular expressions were active.

36.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;    
264     263  
265        if   (file_exis ts( $dir['root '] .$nick))   264        if   (file_exis ts( BX_DIRECTO RY_PATH_RO OT .$nick))
266       {   265       {
267           re turn FALSE ;   266           re turn FALSE ;
268       }   267       }
269              268           
270       if ( $ ID )   269       if ( $ ID )
271           $e xist_arr =  db_arr( " SELECT ID,  NickName  FROM `Prof iles` WHER E NickName  = '$nick'  AND ID <>  $ID" );   270           $e xist_arr =  db_arr( " SELECT ID,  NickName  FROM `Prof iles` WHER E NickName  = '$nick'  AND ID <>  $ID" );
272       else   271       else
273           $e xist_arr =  db_arr( " SELECT `Ni ckName` FR OM `Profil es` WHERE  NickName =  '$nick'"  );   272           $e xist_arr =  db_arr( " SELECT `Ni ckName` FR OM `Profil es` WHERE  NickName =  '$nick'"  );
274     273  
275       if ( $ exist_arr  )   274       if ( $ exist_arr  )
276           re turn false ;   275           re turn false ;
277          276       
278       return  true;   277       return  true;
279   }   278   }
280     279  
281   function c onf_email  ($Email, $ ID = 0)   280   function c onf_email  ($Email, $ ID = 0)
282   {   281   {
283       global  $exist_ar r;   282       global  $exist_ar r;
284     283  
285       if ( $ ID )   284       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" );   285           $e xist_arr =  db_arr( " SELECT ID,  NickName  FROM `Prof iles` WHER E UPPER(Em ail) = UPP ER('$Email ') AND ID  <> $ID" );
287       else   286       else
288           $e xist_arr =  db_arr( " SELECT ID,  NickName  FROM `Prof iles` WHER E UPPER(Em ail) = UPP ER('$Email ')" );   287           $e xist_arr =  db_arr( " SELECT ID,  NickName  FROM `Prof iles` WHER E UPPER(Em ail) = UPP ER('$Email ')" );
289     288  
290       if ( $ exist_arr  ) {   289       if ( $ exist_arr  ) {
291           re turn 0;   290           re turn 0;
292       }   291       }
293       return  1;   292       return  1;
294   }   293   }
295     294  
296   function c onf_email_ queue ($Em ail)   295   function c onf_email_ queue ($Em ail)
297   {   296   {
298       global  $exist_ar r;   297       global  $exist_ar r;
299     298  
300       $exist _arr = db_ arr( "SELE CT ID FROM  `NotifyQu eue` WHERE  UPPER(Ema il) = UPPE R('$Email' )" );   299       $exist _arr = db_ arr( "SELE CT ID FROM  `NotifyQu eue` WHERE  UPPER(Ema il) = UPPE R('$Email' )" );
301       if ( $ exist_arr  ) {   300       if ( $ exist_arr  ) {
302           re turn 0;   301           re turn 0;
303       }   302       }
304       return  1;   303       return  1;
305   }   304   }
306     305  
307   function u pload_phot o($pic_ind ex)   306   function u pload_phot o($pic_ind ex)
308   {   307   {
309       global  $pics;   308       global  $pics;
310       global  $site;   309       global  $site;
311       global  $p_arr;   310       global  $p_arr;
312       global  $gl_pic;   311       global  $gl_pic;
313       global  $dir;   312       global  $dir;
314       global  $pictures _text;   313       global  $pictures _text;
315       global  $COMPOSIT E;   314       global  $COMPOSIT E;
316       global  $ADMIN;   315       global  $ADMIN;
317     316  
318       $autoA pproval_if Photo = is AutoApprov al('photo' );   317       $autoA pproval_if Photo = is AutoApprov al('photo' );
319       $up_na me = "file _$pic_inde x";   318       $up_na me = "file _$pic_inde x";
320       $pic_a ddon_field  = "Pic_{$ pic_index} _addon";   319       $pic_a ddon_field  = "Pic_{$ pic_index} _addon";
321       $temp_ filename =  tempnam(r trim($dir[ 'tmp'], '/ '), $p_arr ['ID']);   320       $temp_ filename =  tempnam(r trim($dir[ 'tmp'], '/ '), $p_arr ['ID']);
322       unlink ($temp_fil ename);   321       unlink ($temp_fil ename);
323       $pic_n ame = $pic s[$pic_ind ex]['name' ];   322       $pic_n ame = $pic s[$pic_ind ex]['name' ];
324       $pic_t mp = $_FIL ES[$up_nam e]['tmp_na me'];   323       $pic_t mp = $_FIL ES[$up_nam e]['tmp_na me'];
325       $ext =  strrchr($ _FILES[$up _name]['na me'], '.') ;   324       $ext =  strrchr($ _FILES[$up _name]['na me'], '.') ;
326     325  
327       if ( $ pics[$pic_ index]['ex ist'] )   326       if ( $ pics[$pic_ index]['ex ist'] )
328           un link( "$pi c_name.jpg " );   327           un link( "$pi c_name.jpg " );
329     328  
330     329  
331           $s can = geti magesize($ _FILES[$up _name]['tm p_name']);   330           $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] )   331           if  ( 1 != $s can[2] &&  2 != $scan [2] && 3 ! = $scan[2]  && 6 != $ scan[2] )
333                return 0 ;   332                return 0 ;
334     333  
335     334  
336       if ( m ove_upload ed_file( $ pic_tmp, " {$temp_fil ename}{$ex t}" ) )   335       if ( m ove_upload ed_file( $ pic_tmp, " {$temp_fil ename}{$ex t}" ) )
337       {   336       {
338           if  ( imageRe size( "{$t emp_filena me}{$ext}" , "{$temp_ filename}. jpg", $gl_ pic['pic'] ['width'],  $gl_pic[' pic']['hei ght'], tru e ) )   337           if  ( imageRe size( "{$t emp_filena me}{$ext}" , "{$temp_ filename}. jpg", $gl_ pic['pic'] ['width'],  $gl_pic[' pic']['hei ght'], tru e ) )
339           {   338           {
340                echo _t( "_FAILED_T O_UPLOAD_P IC", $_FIL ES[$up_nam e]['name'] , "undef") ;   339                echo _t( "_FAILED_T O_UPLOAD_P IC", $_FIL ES[$up_nam e]['name'] , "undef") ;
341                return 0 ;   340                return 0 ;
342           }   341           }
343           if  ( strtolo wer($ext)  != '.jpg'  )   342           if  ( strtolo wer($ext)  != '.jpg'  )
344                unlink(  "{$temp_fi lename}{$e xt}" );   343                unlink(  "{$temp_fi lename}{$e xt}" );
345     344  
346           if  ( getPara m( 'enable _watermark ' ) == 'on ' )   345           if  ( getPara m( 'enable _watermark ' ) == 'on ' )
347           {   346           {
348                $transpa rent1 = ge tParam( 't ransparent 1' );   347                $transpa rent1 = ge tParam( 't ransparent 1' );
349                $water_m ark = $dir ['profileI mage'] . g etParam( ' Water_Mark ' );   348                $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) )   349                if (  st rlen(getPa ram( 'Wate r_Mark' ))  && file_e xists($wat er_mark) )
351                {   350                {
352                    appl yWatermark ( "{$temp_ filename}. jpg", "{$t emp_filena me}.jpg",  $water_mar k, $transp arent1 );   351                    appl yWatermark ( "{$temp_ filename}. jpg", "{$t emp_filena me}.jpg",  $water_mar k, $transp arent1 );
353                }   352                }
354           }   353           }
355     354  
356           sr and(time() );   355           sr and(time() );
357           $p _arr[$pic_ addon_fiel d] = rand( 10000, 999 99);   356           $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];   357           $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'];   358           $p ic_name =  $pics[$pic _index]['n ame'];
360           if  ( !rename ( "{$temp_ filename}. jpg", "$pi c_name.jpg " ) )   359           if  ( !rename ( "{$temp_ filename}. jpg", "$pi c_name.jpg " ) )
361           {   360           {
362                echo _t( "_FAILED_T O_UPLOAD_P IC", $_FIL ES[$up_nam e]['name'] , "fail to  rename");   361                echo _t( "_FAILED_T O_UPLOAD_P IC", $_FIL ES[$up_nam e]['name'] , "fail to  rename");
363                return 0 ;   362                return 0 ;
364           }   363           }
365           db _res( "UPD ATE `Profi les` SET $ pic_addon_ field = '" . $p_arr[$ pic_addon_ field] ."'  WHERE ID  = {$p_arr[ 'ID']}" );   364           db _res( "UPD ATE `Profi les` SET $ pic_addon_ field = '" . $p_arr[$ pic_addon_ field] ."'  WHERE ID  = {$p_arr[ 'ID']}" );
366     365  
367           ch mod( "$pic _name.jpg" , 0644 );   366           ch mod( "$pic _name.jpg" , 0644 );
368           $p ictures_te xt = _t_ac tion('_Suc cessfully  uploaded') ;   367           $p ictures_te xt = _t_ac tion('_Suc cessfully  uploaded') ;
369           $p ics[$pic_i ndex]['exi st'] = tru e;   368           $p ics[$pic_i ndex]['exi st'] = tru e;
370     369  
371           if  ( $p_arr[ 'Status']  == 'Active ' && !$aut oApproval_ ifPhoto &&  !$ADMIN )   370           if  ( $p_arr[ 'Status']  == 'Active ' && !$aut oApproval_ ifPhoto &&  !$ADMIN )
372           {   371           {
373                $update_ res = db_r es( "UPDAT E `Profile s` SET `St atus` = 'A pproval' W HERE `ID`  = {$p_arr[ 'ID']}" );   372                $update_ res = db_r es( "UPDAT E `Profile s` SET `St atus` = 'A pproval' W HERE `ID`  = {$p_arr[ 'ID']}" );
374     373  
375                $p_arr[' Status'] =  'Approval ';   374                $p_arr[' Status'] =  'Approval ';
376                modules_ block($p_a rr['ID']);   375                modules_ block($p_a rr['ID']);
377           }   376           }
378           cr eateUserDa taFile( $p _arr['ID']  );   377           cr eateUserDa taFile( $p _arr['ID']  );
379           re turn 1;   378           re turn 1;
380       }   379       }
381       else   380       else
382       {   381       {
383           ec ho _t_err( "_FAILED_T O_UPLOAD_P IC", $_FIL ES[$up_nam e]['name'] , "undef") ;   382           ec ho _t_err( "_FAILED_T O_UPLOAD_P IC", $_FIL ES[$up_nam e]['name'] , "undef") ;
384       }   383       }
385     384  
386       return  0;   385       return  0;
387   }   386   }
388     387  
389   /**   388   /**
390    * Print c ode for me mbership s tatus   389    * Print c ode for me mbership s tatus
391    * $member ID - membe r ID   390    * $member ID - membe r ID
392    * $offer_ upgrade -  will this  code be pr inted at [ c]ontrol [ p]anel   391    * $offer_ upgrade -  will this  code be pr inted at [ c]ontrol [ p]anel
393    */   392    */
394   function G etMembersh ipStatus($ memberID,  $offer_upg rade = tru e, $credit s = 0 )   393   function G etMembersh ipStatus($ memberID,  $offer_upg rade = tru e, $credit s = 0 )
395   {   394   {
396       global  $oTemplCo nfig;   395       global  $oTemplCo nfig;
397     396  
398       $ret =  "";   397       $ret =  "";
399     398  
400       $membe rship_info  = getMemb erMembersh ipInfo($me mberID);   399       $membe rship_info  = getMemb erMembersh ipInfo($me mberID);
401     400  
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 / >";   401       $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     402  
404       // Sho w colored  membership  name   403       // Sho w colored  membership  name
405       if ( $ membership _info['ID' ] == MEMBE RSHIP_ID_S TANDARD )   404       if ( $ membership _info['ID' ] == MEMBE RSHIP_ID_S TANDARD )
406       {   405       {
407           $r et .= _t(  "_MEMBERSH IP_STANDAR D" ). $vie wMembershi pActions;   406           $r et .= _t(  "_MEMBERSH IP_STANDAR D" ). $vie wMembershi pActions;
408           if  ( $offer_ upgrade )   407           if  ( $offer_ upgrade )
409                $ret .=  " ". _t( " _MEMBERSHI P_UPGRADE_ FROM_STAND ARD" );   408                $ret .=  " ". _t( " _MEMBERSHI P_UPGRADE_ FROM_STAND ARD" );
410       }   409       }
411       else   410       else
412       {   411       {
413           $r et .= "<fo nt color=\ "red\">{$m embership_ info['Name ']}</font> $viewMembe rshipActio ns";   412           $r et .= "<fo nt color=\ "red\">{$m embership_ info['Name ']}</font> $viewMembe rshipActio ns";
414     413  
415           $d ays_left =  (int)( ($ membership _info['Dat eExpires']  - time())  / (24 * 3 600) );   414           $d ays_left =  (int)( ($ membership _info['Dat eExpires']  - time())  / (24 * 3 600) );
416     415  
417           if (!is_null( $membershi p_info['Da teExpires' ]))   416           if (!is_null( $membershi p_info['Da teExpires' ]))
418           {   417           {
419                if ( $da ys_left >  0 )   418                if ( $da ys_left >  0 )
420                {   419                {
421                    $ret  .= _t( "_ MEMBERSHIP _EXPIRES_I N_DAYS", $ days_left  );   420                    $ret  .= _t( "_ MEMBERSHIP _EXPIRES_I N_DAYS", $ days_left  );
422                }   421                }
423                else   422                else
424                {   423                {
425                    $ret  .= _t( "_ MEMBERSHIP _EXPIRES_T ODAY", dat e( "H:i",  $membershi p_info['Da teExpires' ] ), date(  "H:i" ) ) ;   424                    $ret  .= _t( "_ MEMBERSHIP _EXPIRES_T ODAY", dat e( "H:i",  $membershi p_info['Da teExpires' ] ), date(  "H:i" ) ) ;
426                }   425                }
427           }   426           }
428           el se   427           el se
429           {   428           {
430                $ret.= _ t("_MEMBER SHIP_EXPIR ES_NEVER") ;   429                $ret.= _ t("_MEMBER SHIP_EXPIR ES_NEVER") ;
431           }   430           }
432     431  
433           if  ( $offer_ upgrade &&  !is_null( $membershi p_info['Da teExpires' ]))   432           if  ( $offer_ upgrade &&  !is_null( $membershi p_info['Da teExpires' ]))
434                $ret .=  " - <a hre f=\"member ship.php\" >". _t( "_ MEMBERSHIP _BUY_MORE_ DAYS" ) ." </a>";   433                $ret .=  " - <a hre f=\"member ship.php\" >". _t( "_ MEMBERSHIP _BUY_MORE_ DAYS" ) ." </a>";
435       }   434       }
436     435  
437       return  $ret;   436       return  $ret;
438   }   437   }
439     438  
440   /**   439   /**
441    * Display  profile d etails: th umbnail, n ickname, s ex, age, l ocation.   440    * 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.   441    * @param  $profile       Profil e data as  returned b y mysql_fe tch_array.
443    */   442    */
444   function d isplay_pro file_detai ls( $profi le )   443   function d isplay_pro file_detai ls( $profi le )
445   {   444   {
446       global  $dir; //  Image fold er   445       global  $dir; //  Image fold er
447       global  $site; //  Image URL   446       global  $site; //  Image URL
448       global  $aPreValu es;   447       global  $aPreValu es;
449     448  
450       // Get  profile t humbnail n ame.   449       // Get  profile t humbnail n ame.
451       $t_nam e = $profi le['ID'].' _0_'.$prof ile['Pic_0 _addon'].' .jpg';   450       $t_nam e = $profi le['ID'].' _0_'.$prof ile['Pic_0 _addon'].' .jpg';
452       // Get  profile t humbnail p ath.   451       // Get  profile t humbnail p ath.
453       $t_pat h = $dir[' profileIma ge'] . $t_ name;   452       $t_pat h = $dir[' profileIma ge'] . $t_ name;
454       // Get  profile t humbnail U RL.   453       // Get  profile t humbnail U RL.
455       $t_url  = $site[' profileIma ge'].$t_na me;   454       $t_url  = $site[' profileIma ge'].$t_na me;
456       // Get  anonymous  thumbnail  url.   455       // Get  anonymous  thumbnail  url.
457       $a_url  = 'male'  == $profil e['Sex'] ?  'man.jpg'  : 'woman. jpg';   456       $a_url  = 'male'  == $profil e['Sex'] ?  'man.jpg'  : 'woman. jpg';
458       $a_url  = $site[' profileIma ge'].$a_ur l;   457       $a_url  = $site[' profileIma ge'].$a_ur l;
459       // Sel ect correc t url.   458       // Sel ect correc t url.
460       if ( f ile_exists ( $t_path  ) )   459       if ( f ile_exists ( $t_path  ) )
461       {   460       {
462           $u rl = $t_ur l;   461           $u rl = $t_ur l;
463       }   462       }
464       else   463       else
465       {   464       {
466           $u rl = $a_ur l;   465           $u rl = $a_ur l;
467       }   466       }
468     467  
469       // Get  profile d etails.   468       // Get  profile d etails.
470       $nickn ame = $pro file['Nick Name'];   469       $nickn ame = $pro file['Nick Name'];
471     470  
472       $age_s ex = _t("_ y/o", $pro file['Age' ])."&nbsp; "._t("_".$ profile['S ex']);   471       $age_s ex = _t("_ y/o", $pro file['Age' ])."&nbsp; "._t("_".$ profile['S ex']);
473     472  
474       $locat ion = $pro file['City '].', '._t ( $aPreVal ues['Count ry'][$prof ile['Count ry']]['LKe y'] );   473       $locat ion = $pro file['City '].', '._t ( $aPreVal ues['Count ry'][$prof ile['Count ry']]['LKe y'] );
475     474  
476       // Dis play profi le details .   475       // Dis play profi le details .
477       ob_sta rt();   476       ob_sta rt();
478   ?>   477   ?>
479       <table  class="pr ofile_deta ils" cells pacing="0"  cellpaddi ng="2" bor der="0">   478       <table  class="pr ofile_deta ils" cells pacing="0"  cellpaddi ng="2" bor der="0">
480           <t r>   479           <t r>
481                <td alig n="center"  class="pr ofile_thum b">   480                <td alig n="center"  class="pr ofile_thum b">
482                    <img  src="<?=  $url ?>" / >   481                    <img  src="<?=  $url ?>" / >
483                </td>   482                </td>
484           </ tr>   483           </ tr>
485           <t r>   484           <t r>
486                <td clas s="profile _nickname"  align="le ft">-&nbsp ;<?= $nick name ?></t d>   485                <td clas s="profile _nickname"  align="le ft">-&nbsp ;<?= $nick name ?></t d>
487           </ tr>   486           </ tr>
488           <t r>   487           <t r>
489                <td clas s="profile _age_sex"  align="lef t" style=" width: 100 px">-&nbsp ;<?= $age_ sex ?></td >   488                <td clas s="profile _age_sex"  align="lef t" style=" width: 100 px">-&nbsp ;<?= $age_ sex ?></td >
490           </ tr>   489           </ tr>
491           <t r>   490           <t r>
492                <td clas s="profile _location"  align="le ft">-&nbsp ;<?= $loca tion ?></t d>   491                <td clas s="profile _location"  align="le ft">-&nbsp ;<?= $loca tion ?></t d>
493           </ tr>   492           </ tr>
494       </tabl e>   493       </tabl e>
495   <?   494   <?
496       $conte nt = ob_ge t_contents ();   495       $conte nt = ob_ge t_contents ();
497       ob_end _clean();   496       ob_end _clean();
498       echo $ content;   497       echo $ content;
499   }   498   }
500     499  
501     500  
502   function P rofileDeta ils( $send erID )   501   function P rofileDeta ils( $send erID )
503   {   502   {
504       global  $site;   503       global  $site;
505       global  $aPreValu es;   504       global  $aPreValu es;
506       global  $dir;    
507     505       
508       $prof_ arr = getP rofileInfo ( $senderI D );   506       $prof_ arr = getP rofileInfo ( $senderI D );
509     507  
510       $count ry = _t( $ aPreValues ['Country' ][$prof_ar r['Country ']]['LKey' ] );   508       $count ry = _t( $ aPreValues ['Country' ][$prof_ar r['Country ']]['LKey' ] );
511       $prof_ age = age( $prof_arr[ 'DateOfBir th']);   509       $prof_ age = age( $prof_arr[ 'DateOfBir th']);
512       $prof_ sex = _t(  "_" . $pro f_arr['Sex ']);   510       $prof_ sex = _t(  "_" . $pro f_arr['Sex ']);
513          511       
514       if( is set( $prof _arr['City '] ) and ! empty( $pr of_arr['Ci ty'] ) )   512       if( is set( $prof _arr['City '] ) and ! empty( $pr of_arr['Ci ty'] ) )
515           $c ountry .=  ", {$prof_ arr['City' ]}";   513           $c ountry .=  ", {$prof_ arr['City' ]}";
516          514       
517       if ( $ prof_arr[' Status'] = = 'Active'  )   515       if ( $ prof_arr[' Status'] = = 'Active'  )
518       {   516       {
519           $n ick_link =  '<a href= "' . getPr ofileLink( $senderID)  . '" targ et="_blank ">' . $pro f_arr['Nic kName'] .  '</a>';   517           $n ick_link =  '<a href= "' . getPr ofileLink( $senderID)  . '" targ et="_blank ">' . $pro f_arr['Nic kName'] .  '</a>';
520       }   518       }
521       else   519       else
522       {   520       {
523           $n ick_link =  $prof_arr ['NickName '];   521           $n ick_link =  $prof_arr ['NickName '];
524       }   522       }
525       $ret . = '<div cl ass="prof_ details_wr apper">';   523       $ret . = '<div cl ass="prof_ details_wr apper">';
526           $r et .= '<di v class="c lear_both" ></div>';   524           $r et .= '<di v class="c lear_both" ></div>';
527           $r et .= get_ member_thu mbnail( $s enderID, ' left' );   525           $r et .= get_ member_thu mbnail( $s enderID, ' left' );
528              526           
529           $r et .= '<di v class="p rof_ditail s_block">' ;   527           $r et .= '<di v class="p rof_ditail s_block">' ;
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('_N ickName'). ':</div><d iv class=" li_value"> ' . $nick_ link . '</ 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('_S ex').':</d iv><div cl ass="li_va lue">' . $ prof_sex .  '</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('_D ateOfBirth ').':</div ><div clas s="li_valu e">' . $pr of_age . ' </div>';
533                $ret .=  '<div clas s="li_word ">'._t('_F rom').':</ div><div c lass="li_v alue"> ' .  $country  . '</div>' ;   531                $ret .=  '<div clas s="li_word ">'._t('_F rom').':</ div><div c lass="li_v alue"> ' .  $country  . '</div>' ;
534           $r et .= '</d iv>';   532           $r et .= '</d iv>';
535           $r et .= '<di v class="c lear_both" ></div>';   533           $r et .= '<di v class="c lear_both" ></div>';
536       $ret . = '</div>' ;   534       $ret . = '</div>' ;
537     535  
538     536  
539       return  $ret;   537       return  $ret;
540   }   538   }
541     539  
542     540  
543     541  
544   function S howPoll( $ uID )   542   function S howPoll( $ uID )
545   {   543   {
546     544  
547       global  $_page;   545       global  $_page;
548       global  $site;   546       global  $site;
549     547  
550       $_page ['js_name' ]   = 'pro file_poll. js';   548       $_page ['js_name' ]   = 'pro file_poll. js';
551          549       
552       $sButt onValue =  _t( '_Vote ' );   550       $sButt onValue =  _t( '_Vote ' );
553     551  
554       $ret . =   552       $ret . =
555   <<<EOS   553   <<<EOS
556       <div i d="dpol_{$ uID}"  cla ss="pollBl ock" >   554       <div i d="dpol_{$ uID}"  cla ss="pollBl ock" >
557           <d iv id="dpo l_caption_ {$uID}" cl ass="pollC aption"></ div>   555           <d iv id="dpo l_caption_ {$uID}" cl ass="pollC aption"></ div>
558           <d iv id="dpo l_question _{$uID}" c lass="poll AnswerBloc k">   556           <d iv id="dpo l_question _{$uID}" c lass="poll AnswerBloc k">
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                <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();">
560                    <img  src="{$si te['icons' ]}pollUp.g if" alt=""  />   558                    <img  src="{$si te['icons' ]}pollUp.g if" alt=""  />
561                </div>   559                </div>
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                <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();">
563                    <img  src="{$si te['icons' ]}pollDown .gif" alt= "" />   561                    <img  src="{$si te['icons' ]}pollDown .gif" alt= "" />
564                </div>   562                </div>
565                <div id= "dpol_ques tion_text_ {$uID}" cl ass="pollQ uestionBlo ck"></div>   563                <div id= "dpol_ques tion_text_ {$uID}" cl ass="pollQ uestionBlo ck"></div>
566           </ div>   564           </ div>
567           <d iv id="dpo l_actions_ {$uID}" cl ass="pollS ubmitBlock ">   565           <d iv id="dpo l_actions_ {$uID}" cl ass="pollS ubmitBlock ">
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                <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;" />
569           </ div>   567           </ div>
570       </div>   568       </div>
571       <scrip t type="te xt/javascr ipt" langu age="javas cript">   569       <scrip t type="te xt/javascr ipt" langu age="javas cript">
572           se nd_data( ' dpol_quest ion_text_{ $uID}', 'q uestions',  '', '{$uI D}' );   570           se nd_data( ' dpol_quest ion_text_{ $uID}', 'q uestions',  '', '{$uI D}' );
573       </scri pt>   571       </scri pt>
574     572  
575   EOS;   573   EOS;
576     574  
577   /*   575   /*
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                <!--<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; ">
579                    <img  src="{$si te['icons' ]}pollSubm it.gif" al t="rez" bo rder="0">   577                    <img  src="{$si te['icons' ]}pollSubm it.gif" al t="rez" bo rder="0">
580                </a>-->   578                </a>-->
581   */   579   */
582       return  $ret;   580       return  $ret;
583     581  
584   }   582   }
585     583  
586   function i sAutoAppro val( $sAct ion )   584   function i sAutoAppro val( $sAct ion )
587   {   585   {
588       $autoA pproval_if Photo   =  ( 'on' ==  getParam(" autoApprov al_ifPhoto ") );   586       $autoA pproval_if Photo   =  ( 'on' ==  getParam(" autoApprov al_ifPhoto ") );
589       $autoA pproval_if Sound   =  ( 'on' ==  getParam(" autoApprov al_ifSound ") );   587       $autoA pproval_if Sound   =  ( 'on' ==  getParam(" autoApprov al_ifSound ") );
590       $autoA pproval_if Video   =  ( 'on' ==  getParam(" autoApprov al_ifVideo ") );   588       $autoA pproval_if Video   =  ( 'on' ==  getParam(" autoApprov al_ifVideo ") );
591       $autoA pproval_if Profile =  ( 'on' ==  getParam(" autoApprov al_ifProfi le") );   589       $autoA pproval_if Profile =  ( 'on' ==  getParam(" autoApprov al_ifProfi le") );
592       $autoA pproval_if Join    =  ( 'on' ==  getParam(" autoApprov al_ifJoin" ) );   590       $autoA pproval_if Join    =  ( 'on' ==  getParam(" autoApprov al_ifJoin" ) );
593     591  
594       switch  ( $sActio n )   592       switch  ( $sActio n )
595       {   593       {
596           ca se 'photo' :   594           ca se 'photo' :
597                return $ autoApprov al_ifPhoto ;   595                return $ autoApprov al_ifPhoto ;
598     596  
599           ca se 'sound' :   597           ca se 'sound' :
600                return $ autoApprov al_ifSound ;   598                return $ autoApprov al_ifSound ;
601     599  
602           ca se 'video' :   600           ca se 'video' :
603                return $ autoApprov al_ifVideo ;   601                return $ autoApprov al_ifVideo ;
604     602  
605           ca se 'profil e':   603           ca se 'profil e':
606                return $ autoApprov al_ifProfi le;   604                return $ autoApprov al_ifProfi le;
607     605  
608           ca se 'join':   606           ca se 'join':
609                return $ autoApprov al_ifJoin;   607                return $ autoApprov al_ifJoin;
610     608  
611           de fault:   609           de fault:
612                return f alse;   610                return f alse;
613       }   611       }
614   }   612   }
615     613  
616     614  
617   /* * * * R ay MP3 Int egration ( Begin) * *  * */   615   /* * * * R ay MP3 Int egration ( Begin) * *  * */
618   function g etRayMp3Pl ayer( $iId , $sPasswo rd, $iView erId)   616   function g etRayMp3Pl ayer( $iId , $sPasswo rd, $iView erId)
619   {   617   {
620       return  getApplic ationConte nt("mp3",  "player",  array('id'  => $iId,  'password'  => md5($s Password),  'vId' =>  $iViewerId ), true);   618       return  getApplic ationConte nt("mp3",  "player",  array('id'  => $iId,  'password'  => md5($s Password),  'vId' =>  $iViewerId ), true);
621   }   619   }
622   /* * * * R ay MP3 Int egration ( End) * * *  */   620   /* * * * R ay MP3 Int egration ( End) * * *  */
623     621  
624   function c reateUserD ataFile( $ userID )   622   function c reateUserD ataFile( $ userID )
625   {   623   {
626        global   $d ir,   $d ate_format ;   624        global   $d
ate_format ;
627     625  
628       $userI D = (int)$ userID;   626       $userI D = (int)$ userID;
629        $fileName   =   $dir['cach e']   .   'user'   .   $userID   .   '.php';   627        $fileName   =   BX_DIRECTO RY_PATH_CA CHE   .   'user'   .   $userID   .   '.php';
630       if( $u serID > 0  )   628       if( $u serID > 0  )
631       {   629       {
632           $u serQuery =  "   630           $u serQuery =  "
633                SELECT   631                SELECT
634                         *,   632                         *,
635                         DATE_FORMA T(`DateLas tLogin`,   '$date_for mat' ) AS  `DateLastL ogin`,   633                         DATE_FORMA T(`DateLas tLogin`,   '$date_for mat' ) AS  `DateLastL ogin`,
636                         DATE_FORMA T(`DateLas tEdit`,    '$date_for mat' ) AS  `DateLastE dit`   634                         DATE_FORMA T(`DateLas tEdit`,    '$date_for mat' ) AS  `DateLastE dit`
637                FROM   635                FROM
638                         `Profiles`   636                         `Profiles`
639                WHERE `I D` = '$use rID' LIMIT  1   637                WHERE `I D` = '$use rID' LIMIT  1
640           ";   638           ";
641              639           
642           $a PreUser =  db_assoc_a rr( $userQ uery );   640           $a PreUser =  db_assoc_a rr( $userQ uery );
643              641           
644           if ( isset( $ aPreUser )  and is_ar ray( $aPre User ) )   642           if ( isset( $ aPreUser )  and is_ar ray( $aPre User ) )
645           {   643           {
646                   644                
647                $sUser =  '<?';   645                $sUser =  '<?';
648                $sUser . = "\n\n";   646                $sUser . = "\n\n";
649                $sUser . = '$aUser[ ' . $userI D . '] = a rray();';   647                $sUser . = '$aUser[ ' . $userI D . '] = a rray();';
650                $sUser . = "\n";   648                $sUser . = "\n";
651                $sUser . = '$aUser[ ' . $userI D . '][\'d atafile\']  = true;';   649                $sUser . = '$aUser[ ' . $userI D . '][\'d atafile\']  = true;';
652                $sUser . = "\n";   650                $sUser . = "\n";
653     651  
654                $replace What = arr ay( '\\',    '\''   ) ;   652                $replace What = arr ay( '\\',    '\''   ) ;
655                $replace To   = arr ay( '\\\\' , '\\\'' ) ;   653                $replace To   = arr ay( '\\\\' , '\\\'' ) ;
656                   654                
657                foreach(  $aPreUser  as $key = >  $value  )   655                foreach(  $aPreUser  as $key = >  $value  )
658                    $sUs er .= '$aU ser[' . $u serID . '] [\'' . $ke y . '\']'  . ' = ' .  '\'' . str _replace(  $replaceWh at, $repla ceTo, $val ue )  . '\ '' . ";\n" ;   656                    $sUs er .= '$aU ser[' . $u serID . '] [\'' . $ke y . '\']'  . ' = ' .  '\'' . str _replace(  $replaceWh at, $repla ceTo, $val ue )  . '\ '' . ";\n" ;
659                   657                
660                $sUser . = "\n" . ' ?>';   658                $sUser . = "\n" . ' ?>';
661                   659                
662                if( $fil e = fopen(  $fileName , "w" ) )   660                if( $fil e = fopen(  $fileName , "w" ) )
663                {   661                {
664                    fwri te( $file,  $sUser );   662                    fwri te( $file,  $sUser );
665                    fclo se( $file  );   663                    fclo se( $file  );
666                    @chm od ($fileN ame, 0666) ;   664                    @chm od ($fileN ame, 0666) ;
667                       665                    
668                    @inc lude( $fil eName );   666                    @inc lude( $fil eName );
669                    retu rn true;   667                    retu rn true;
670                }   668                }
671                else   669                else
672                    retu rn false;   670                    retu rn false;
673                   671                
674           }   672           }
675       }   673       }
676       else   674       else
677           re turn false ;   675           re turn false ;
678   }   676   }
679     677  
680   function g etProfileI nfo( $iPro fileID, $c heckActive Status = f alse, $for ceCache =  false )   678   function g etProfileI nfo( $iPro fileID, $c heckActive Status = f alse, $for ceCache =  false )
681   {   679   {
682       global  $aUser;   680       global  $aUser;
683       global  $dir;    
684       global  $date_for mat;   681       global  $date_for mat;
685          682       
686       $iProf ileID = (i nt)$iProfi leID;   683       $iProf ileID = (i nt)$iProfi leID;
687       if( !$ iProfileID  )   684       if( !$ iProfileID  )
688           re turn false ;   685           re turn false ;
689          686       
690       if( !i sset( $aUs er[$iProfi leID] ) ||  !is_array ( $aUser[$ iProfileID ] ) || $fo rceCache )   687       if( !i sset( $aUs er[$iProfi leID] ) ||  !is_array ( $aUser[$ iProfileID ] ) || $fo rceCache )
691       {   688       {
692            $sCacheFil e   =   $dir['cach e']   .   'user'   .   $iProfileI D   .   '.php';   689            $sCacheFil e   =   BX_DIRECTO RY_PATH_CA CHE   .   'user'   .   $iProfileI D   .   '.php';
693              690           
694           if ( !file_ex ists( $sCa cheFile )  || $forceC ache )   691           if ( !file_ex ists( $sCa cheFile )  || $forceC ache )
695                if( !cre ateUserDat aFile( $iP rofileID )  )   692                if( !cre ateUserDat aFile( $iP rofileID )  )
696                    retu rn false;   693                    retu rn false;
697              694           
698           @i nclude( $s CacheFile  );   695           @i nclude( $s CacheFile  );
699       }   696       }
700          697       
701       if( $c heckActive Status and  $aUser[$i ProfileID] ['Status']  != 'Activ e' )   698       if( $c heckActive Status and  $aUser[$i ProfileID] ['Status']  != 'Activ e' )
702           re turn false ;   699           re turn false ;
703          700       
704       return  $aUser[$i ProfileID] ;   701       return  $aUser[$i ProfileID] ;
705   }   702   }
706     703  
707   function g etNewLette rsNum( $iI D )   704   function g etNewLette rsNum( $iI D )
708   {   705   {
709       $sqlQu ery = "SEL ECT COUNT( `Recipient `) FROM `M essages` W HERE `Reci pient`='$i ID' AND `N ew`='1'";   706       $sqlQu ery = "SEL ECT COUNT( `Recipient `) FROM `M essages` W HERE `Reci pient`='$i ID' AND `N ew`='1'";
710       $iNum  = db_value ($sqlQuery );   707       $iNum  = db_value ($sqlQuery );
711          708       
712       return  $iNum;   709       return  $iNum;
713   }   710   }
714     711  
715   function g etFriendNu mber ($iID )   712   function g etFriendNu mber ($iID )
716   {   713   {
717       $sqlQu ery = "SEL ECT COUNT( *) FROM `F riendList`  WHERE ( ` ID`='$iID'  OR `Profi le`='$iID'  ) AND `Ch eck`='1'";   714       $sqlQu ery = "SEL ECT COUNT( *) FROM `F riendList`  WHERE ( ` ID`='$iID'  OR `Profi le`='$iID'  ) AND `Ch eck`='1'";
718          715       
719       return  db_value( $sqlQuery) ;   716       return  db_value( $sqlQuery) ;
720   }   717   }
721     718  
722   /*   719   /*
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'];   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'];
724   */   721   */
725     722  
726   function g etNickName ( $ID = ''  )   723   function g etNickName ( $ID = ''  )
727   {   724   {
728       global  $dir;    
729      
730      
731       if ( ! $ID && (in t)$_COOKIE ['memberID '] )   725       if ( ! $ID && (in t)$_COOKIE ['memberID '] )
732           $I D = $_COOK IE['member ID'];   726           $I D = $_COOK IE['member ID'];
733     727  
734       if ( ! $ID )   728       if ( ! $ID )
735           re turn '';   729           re turn '';
736          730       
737       $arr =  getProfil eInfo( $ID  );   731       $arr =  getProfil eInfo( $ID  );
738       return  $arr['Nic kName'];   732       return  $arr['Nic kName'];
739   }   733   }
740     734  
741   /*   735   /*
742    * The fun ction retu rns Passwo rd by give n ID.   736    * The fun ction retu rns Passwo rd by give n ID.
743    */   737    */
744   function g etPassword ( $ID = ''  )   738   function g etPassword ( $ID = ''  )
745   {   739   {
746       if ( ! (int)$ID )   740       if ( ! (int)$ID )
747           re turn '';   741           re turn '';
748     742  
749       $arr =  getProfil eInfo( $ID  );   743       $arr =  getProfil eInfo( $ID  );
750       return  $arr['Pas sword'];   744       return  $arr['Pas sword'];
751   }   745   }
752     746  
753   function g etSex( $ID  = '' )   747   function g etSex( $ID  = '' )
754   {   748   {
755       if ( ! (int)$ID )   749       if ( ! (int)$ID )
756           re turn '';   750           re turn '';
757     751  
758       $arr =  getProfil eInfo( $ID  );   752       $arr =  getProfil eInfo( $ID  );
759       return  $arr['Sex '];   753       return  $arr['Sex '];
760   }   754   }
761     755  
762   function g etProfileL ink( $iID,  $sLinkAdd  = '' )   756   function g etProfileL ink( $iID,  $sLinkAdd  = '' )
763   {   757   {
764       global  $site;   758       global  $site;
765     759  
766       $aProf Info = get ProfileInf o( $iID );   760       $aProf Info = get ProfileInf o( $iID );
767       $iID =  ($aProfIn fo['Couple '] > 0 &&  $aProfInfo ['ID'] > $ aProfInfo[ 'Couple'])  ? $aProfI nfo['Coupl e'] : $iID ;   761       $iID =  ($aProfIn fo['Couple '] > 0 &&  $aProfInfo ['ID'] > $ aProfInfo[ 'Couple'])  ? $aProfI nfo['Coupl e'] : $iID ;
768     762  
769       if ( g etParam('e nable_modr ewrite') = = 'on' )   763       if ( g etParam('e nable_modr ewrite') = = 'on' )
770           $s Link = $si te['url']. getNickNam e($iID) .  ( $sLinkAd d ? "?{$sL inkAdd}" :  '' );   764           $s Link = $si te['url']. getNickNam e($iID) .  ( $sLinkAd d ? "?{$sL inkAdd}" :  '' );
771       else   765       else
772           $s Link = $si te['url']. 'profile.p hp?ID='.$i ID . ( $sL inkAdd ? " &{$sLinkAd d}" : '' ) ;   766           $s Link = $si te['url']. 'profile.p hp?ID='.$i ID . ( $sL inkAdd ? " &{$sLinkAd d}" : '' ) ;
773          767       
774       return  $sLink;   768       return  $sLink;
775   }   769   }
776     770  
777     771  
778   /**   772   /**
779    * Shows h ow many da ys, hours,  minutes m ember was  onine last  time   773    * Shows h ow many da ys, hours,  minutes m ember was  onine last  time
780    *   774    *
781    * @param   $lastNavT ime   775    * @param   $lastNavT ime
782    *   776    *
783    * @return  int   777    * @return  int
784    */   778    */
785   function   getProfile LastOnline Period( $l astNavTime  )   779   function   getProfile LastOnline Period( $l astNavTime  )
786   {   780   {
787           if  ( $lastNa vTime != 0  )   781           if  ( $lastNa vTime != 0  )
788           {   782           {
789                $time =  date("U")  - $lastNav Time;   783                $time =  date("U")  - $lastNav Time;
790     784  
791                if ( $ti me <= 300  )   785                if ( $ti me <= 300  )
792                {   786                {
793                    //$r et = '<str ong>' . _t ('_Online' ) . '</str ong>';   787                    //$r et = '<str ong>' . _t ('_Online' ) . '</str ong>';
794                    $ret  = '<div c lass="onli ne">' . _t ('_Online' ) . '</div >';   788                    $ret  = '<div c lass="onli ne">' . _t ('_Online' ) . '</div >';
795                }   789                }
796                else   790                else
797                {   791                {
798                    $min utes = flo or( $time  / 60 );   792                    $min utes = flo or( $time  / 60 );
799                    if (  $minutes  > 60 )   793                    if (  $minutes  > 60 )
800                    {   794                    {
801                         $hours = f loor( $tim e / 3600 ) ;   795                         $hours = f loor( $tim e / 3600 ) ;
802                         if ( $hour s > 24 )   796                         if ( $hour s > 24 )
803                         {   797                         {
804                             $days  = floor( $ time / 864 00 );   798                             $days  = floor( $ time / 864 00 );
805                             $hours  = floor(  ( $time -  $days*8640 0 ) / 3600  );   799                             $hours  = floor(  ( $time -  $days*8640 0 ) / 3600  );
806                             $minut es = floor ( ( $time  - $days*86 400 - $hou rs*3600 )  / 60 );   800                             $minut es = floor ( ( $time  - $days*86 400 - $hou rs*3600 )  / 60 );
807                         }   801                         }
808                         else   802                         else
809                         {   803                         {
810                             $minut es = floor  ( ( $time  - $hours* 3600 ) / 6 0 );   804                             $minut es = floor  ( ( $time  - $hours* 3600 ) / 6 0 );
811                         }   805                         }
812                    }   806                    }
813     807  
814                    /*   808                    /*
815                    if(  $days > 31  )   809                    if(  $days > 31  )
816                    {   810                    {
817                         $lnt = '<s trong>' .  _t('_more_ month_ago' ) . '</str ong>';   811                         $lnt = '<s trong>' .  _t('_more_ month_ago' ) . '</str ong>';
818                    }   812                    }
819                    else   813                    else
820                    {   814                    {
821                         if( $days  > 7 )   815                         if( $days  > 7 )
822                         {   816                         {
823                             $lnt =  '<strong> ' . _t('_m ore_week_a go') . '</ strong>';   817                             $lnt =  '<strong> ' . _t('_m ore_week_a go') . '</ strong>';
824                         }   818                         }
825                         else   819                         else
826                         {   820                         {
827                             if ( $ days >= 7  )   821                             if ( $ days >= 7  )
828                                 $l nt = '<str ong>' . _t ('_week_ag o') . '</s trong>';   822                                 $l nt = '<str ong>' . _t ('_week_ag o') . '</s trong>';
829                             else   823                             else
830                             */   824                             */
831                                 // $lnt = ( $ days ? $da ys . ' day (s) ago' :  ( $hours  ? $hours .  ' hour(s)  ago' : $m inutes . '  minutes a go' )) . ' ';   825                                 // $lnt = ( $ days ? $da ys . ' day (s) ago' :  ( $hours  ? $hours .  ' hour(s)  ago' : $m inutes . '  minutes a go' )) . ' ';
832                                 if ( $days )   826                                 if ( $days )
833                                 {   827                                 {
834                                      $ret = _ t( '_day(s )', $days  );// $days  .   828                                      $ret = _ t( '_day(s )', $days  );// $days  .
835                                 }   829                                 }
836                                 el seif( $hou rs )   830                                 el seif( $hou rs )
837                                 {   831                                 {
838                                      $ret = _ t( '_hour( s)', $hour s );   832                                      $ret = _ t( '_hour( s)', $hour s );
839                                 }   833                                 }
840                                 el se   834                                 el se
841                                 {   835                                 {
842                                      $ret = _ t( '_minut e(s)', $mi nutes );   836                                      $ret = _ t( '_minut e(s)', $mi nutes );
843                                 }   837                                 }
844     838  
845                                 /*   839                                 /*
846                         }   840                         }
847                    }   841                    }
848                    */   842                    */
849     843  
850                }   844                }
851     845  
852           }   846           }
853           el se   847           el se
854           {   848           {
855                $ret = ' <div class ="never">'  . _t('_ne ver') . '< /div>';   849                $ret = ' <div class ="never">'  . _t('_ne ver') . '< /div>';
856           }   850           }
857     851  
858           re turn $ret;   852           re turn $ret;
859   }   853   }
860     854  
861   function p eriodic_ch eck_ban()  {   855   function p eriodic_ch eck_ban()  {
862       //Clea ning Ban t able   856       //Clea ning Ban t able
863       $Check SQL = "   857       $Check SQL = "
864           SE LECT `Admi nBanList`.   858           SE LECT `Admi nBanList`.
865           FR OM `AdminB anList`    859           FR OM `AdminB anList` 
866           WH ERE (   860           WH ERE (
867                `DateTim e` + INTER VAL `Time`  SECOND <  NOW()   861                `DateTim e` + INTER VAL `Time`  SECOND <  NOW()
868           )   862           )
869       ";   863       ";
870       $vChec kBanRes =  db_res($Ch eckSQL);   864       $vChec kBanRes =  db_res($Ch eckSQL);
871       while  ( $aCheckB anRes = my sql_fetch_ assoc($vCh eckBanRes)  ) {   865       while  ( $aCheckB anRes = my sql_fetch_ assoc($vCh eckBanRes)  ) {
872           $s DeleteBanS QL = "DELE TE FROM `A dminBanLis t` WHERE ` ProfID`='{ $aCheckBan Res['ProfI D']}'";   866           $s DeleteBanS QL = "DELE TE FROM `A dminBanLis t` WHERE ` ProfID`='{ $aCheckBan Res['ProfI D']}'";
873           db _res($sDel eteBanSQL) ;   867           db _res($sDel eteBanSQL) ;
874       }   868       }
875   }   869   }
876     870  
877   function i sLoggedBan ned($iCurU serID = 0)  {   871   function i sLoggedBan ned($iCurU serID = 0)  {
878       $iCCur UserID = ( $iCurUserI D>0) ? $iC urUserID :  (int)$_CO OKIE['memb erID'];   872       $iCCur UserID = ( $iCurUserI D>0) ? $iC urUserID :  (int)$_CO OKIE['memb erID'];
879       if ($i CCurUserID ) {   873       if ($i CCurUserID ) {
880           $C heckSQL =  "   874           $C heckSQL =  "
881                SELECT *     875                SELECT *  
882                FROM `Ad minBanList   876                FROM `Ad minBanList
883                WHERE `P rofID`='{$ iCCurUserI D}'   877                WHERE `P rofID`='{$ iCCurUserI D}'
884           ";   878           ";
885           db _res($Chec kSQL);   879           db _res($Chec kSQL);
886           if  (mysql_af fected_row s()>0) {   880           if  (mysql_af fected_row s()>0) {
887                return t rue;   881                return t rue;
888           }   882           }
889       }   883       }
890       return  false;   884       return  false;
891   }   885   }
892     886  
893   function m ake_check_ ban() {   887   function m ake_check_ ban() {
894       //Make  automatic ally logou t for Bann ed members   888       //Make  automatic ally logou t for Bann ed members
895       if (is LoggedBann ed((int)$_ COOKIE['me mberID']))  {   889       if (is LoggedBann ed((int)$_ COOKIE['me mberID']))  {
896           se tcookie( ' memberID',  $_COOKIE[ 'memberID' ], time()  - 48 * 360 0, '/' );   890           se tcookie( ' memberID',  $_COOKIE[ 'memberID' ], time()  - 48 * 360 0, '/' );
897           se tcookie( ' memberPass word', $_C OOKIE['mem berPasswor d'], time( ) - 48 * 3 600, '/' ) ;   891           se tcookie( ' memberPass word', $_C OOKIE['mem berPasswor d'], time( ) - 48 * 3 600, '/' ) ;
898       }   892       }
899   }   893   }
900     894  
901   make_check _ban();   895   make_check _ban();