241. File Comparison Report

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

241.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.0.5\inc profiles.inc.php Fri Nov 2 12:17:10 2007 UTC
2 Dolphin-v.6.1.0\inc profiles.inc.php Sat Apr 26 08:19:14 2008 UTC

241.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 19 1676
Changed 11 73
Inserted 1 4
Removed 7 88

241.3 Comparison options

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

241.4 Active regular expressions

No regular expressions were active.

241.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   // get cre dits amoun t by optio n index    
179   function g etCreditsA mountByInd ex( $credI ndex )    
180   {    
181       $credI ndex = (in t)$credInd ex;    
182       $minCr edits = (f loat)getPa ram( 'min_ credit_a'  );    
183       $maxCr edits = (f loat)getPa ram( 'max_ credit_a'  );    
184       $credi tStep = (f loat)getPa ram( 'cred it_step' ) ;    
185       $res =  $minCredi ts + $cred Index * $c reditStep;    
186       if ( $ res > $max Credits )    
187           $r es = $maxC redits;    
188       return  sprintf(  "%.2f", $r es );    
189   }    
190      
191   // get cre dits price  by option  index    
192   function g etCreditsP riceByInde x( $credIn dex )    
193   {    
194       $credI ndex = (in t)$credInd ex;    
195       $minCr edits = (f loat)getPa ram( 'min_ credit_a'  );    
196       $maxCr edits = (f loat)getPa ram( 'max_ credit_a'  );    
197       $credi tStep = (f loat)getPa ram( 'cred it_step' ) ;    
198       $credi t2money =  (float)get Param( 'cr edit2money ' ); // ho w many cre dits for o ne money u nit    
199       $credi tDiscountS tep = (flo at)getPara m( 'credit _discount_ step' );    
200       $credi tsAmount =  $minCredi ts + $cred Index * $c reditStep;    
201       if ( $ creditsAmo unt > $max Credits )    
202       {    
203           $c reditsAmou nt = $maxC redits;    
204           $c redIndex =  (int)(($m axCredits  - $minCred its) / $cr editStep);    
205       }    
206       $res =  $creditsA mount / $c redit2mone y - $credI ndex * $cr editDiscou ntStep;    
207       return  sprintf(  "%.2f", $r es );    
208   }    
209      
210   // Check i f this con tact was b ought   178   // Check i f this con tact was b ought
211   function c ontact_all owed( $mem berID, $pr ofileID )   179   function c ontact_all owed( $mem berID, $pr ofileID )
212   {   180   {
213       $membe rID = (int )$memberID ;   181       $membe rID = (int )$memberID ;
214       $profi leID = (in t)$profile ID;   182       $profi leID = (in t)$profile ID;
215     183  
216       $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`
217                                 WH ERE `IDBuy er` = $mem berID AND  `IDContact ` = $profi leID   185                                 WH ERE `IDBuy er` = $mem berID AND  `IDContact ` = $profi leID
218                                      OR `IDBu yer` = $pr ofileID AN D `IDConta ct` = $mem berID" );   186                                      OR `IDBu yer` = $pr ofileID AN D `IDConta ct` = $mem berID" );
219       if ( $ exist_arr[ 'count'] )   187       if ( $ exist_arr[ 'count'] )
220           re turn true;   188           re turn true;
221       else   189       else
222           re turn false ;   190           re turn false ;
223   }   191   }
224     192  
225   // Buy con tact in sh opping car t   193   // Buy con tact in sh opping car t
226   function b uyContact(  $memberID , $profile ID, $trans actionID =  '' )   194   function b uyContact(  $memberID , $profile ID, $trans actionID =  '' )
227   {   195   {
228       $membe rID = (int )$memberID ;   196       $membe rID = (int )$memberID ;
229       $profi leID = (in t)$profile ID;   197       $profi leID = (in t)$profile ID;
230       $trans actionID =  (int)$tra nsactionID ;   198       $trans actionID =  (int)$tra nsactionID ;
231     199  
232       $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" );
233       if ( $ exist_arr  )   201       if ( $ exist_arr  )
234       {   202       {
235           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" );
236           re turn false ;   204           re turn false ;
237       }   205       }
238     206  
239       if ( $ transactio nID )   207       if ( $ transactio nID )
240           $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 " );
241       else   209       else
242           $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 "  );
243     211  
244       return  $result;   212       return  $result;
245   }   213   }
246   /**   214   /**
247    * 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
248    * or ages  of profil e.   216    * or ages  of profil e.
249    *   217    *
250    * @param  array $aPr ofile   218    * @param  array $aPr ofile
251    *   219    *
252    * return  array   220    * return  array
253    */   221    */
254   function g etProfileA geFromArra y( $aProfi le )   222   function g etProfileA geFromArra y( $aProfi le )
255   {   223   {
256       //prin t_r( $aPro file );   224       //prin t_r( $aPro file );
257       $ret =  array();   225       $ret =  array();
258     226  
259       $ret[]  = age( $a Profile['D ateOfBirth ']);   227       $ret[]  = age( $a Profile['D ateOfBirth ']);
260     228  
261       return  $ret;   229       return  $ret;
262   }   230   }
263     231  
264     232  
265   function a ge( $birth _date )   233   function a ge( $birth _date )
266   {   234   {
267       if ( $ birth_date  == "0000- 00-00" )   235       if ( $ birth_date  == "0000- 00-00" )
268           re turn _t("_ uknown");   236           re turn _t("_ uknown");
269     237  
270       $bd =  explode( " -", $birth _date );   238       $bd =  explode( " -", $birth _date );
271       $age =  date("Y")  - $bd[0]  - 1;   239       $age =  date("Y")  - $bd[0]  - 1;
272     240  
273       $arr[1 ] = "m";   241       $arr[1 ] = "m";
274       $arr[2 ] = "d";   242       $arr[2 ] = "d";
275     243  
276       for (  $i = 1; $a rr[$i]; $i ++ )   244       for (  $i = 1; $a rr[$i]; $i ++ )
277       {   245       {
278           $n  = date( $ arr[$i] );   246           $n  = date( $ arr[$i] );
279           if  ( $n < $b d[$i] )   247           if  ( $n < $b d[$i] )
280                break;   248                break;
281           if  ( $n > $b d[$i] )   249           if  ( $n > $b d[$i] )
282           {   250           {
283                ++$age;   251                ++$age;
284                break;   252                break;
285           }   253           }
286       }   254       }
287     255  
288       return  $age;   256       return  $age;
289   }   257   }
290     258  
291     259  
292   function c onf_nick($ nick, $ID  = 0 )   260   function c onf_nick($ nick, $ID  = 0 )
293   {   261   {
294       global  $exist_ar r;   262       global  $exist_ar r;
295       global  $dir;   263       global  $dir;
296     264  
297       if (fi le_exists( $dir['root '].$nick))   265       if (fi le_exists( $dir['root '].$nick))
298       {   266       {
299           re turn FALSE ;   267           re turn FALSE ;
300       }   268       }
301              269           
302       if ( $ ID )   270       if ( $ ID )
303           $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" );
304       else   272       else
305           $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'"  );
306     274  
307       if ( $ exist_arr  )   275       if ( $ exist_arr  )
308           re turn false ;   276           re turn false ;
309          277       
310       return  true;   278       return  true;
311   }   279   }
312     280  
313   function c onf_email  ($Email, $ ID = 0)   281   function c onf_email  ($Email, $ ID = 0)
314   {   282   {
315       global  $exist_ar r;   283       global  $exist_ar r;
316     284  
317       if ( $ ID )   285       if ( $ ID )
318           $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" );
319       else   287       else
320           $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 ')" );
321     289  
322       if ( $ exist_arr  ) {   290       if ( $ exist_arr  ) {
323           re turn 0;   291           re turn 0;
324       }   292       }
325       return  1;   293       return  1;
326   }   294   }
327     295  
328   function c onf_email_ queue ($Em ail)   296   function c onf_email_ queue ($Em ail)
329   {   297   {
330       global  $exist_ar r;   298       global  $exist_ar r;
331     299  
332       $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' )" );
333       if ( $ exist_arr  ) {   301       if ( $ exist_arr  ) {
334           re turn 0;   302           re turn 0;
335       }   303       }
336       return  1;   304       return  1;
337   }   305   }
338     306  
339   function u pload_phot o($pic_ind ex)   307   function u pload_phot o($pic_ind ex)
340   {   308   {
341       global  $pics;   309       global  $pics;
342       global  $site;   310       global  $site;
343       global  $p_arr;   311       global  $p_arr;
344       global  $gl_pic;   312       global  $gl_pic;
345       global  $dir;   313       global  $dir;
346       global  $pictures _text;   314       global  $pictures _text;
347       global  $COMPOSIT E;   315       global  $COMPOSIT E;
348       global  $ADMIN;   316       global  $ADMIN;
349     317  
350       $autoA pproval_if Photo = is AutoApprov al('photo' );   318       $autoA pproval_if Photo = is AutoApprov al('photo' );
351       $up_na me = "file _$pic_inde x";   319       $up_na me = "file _$pic_inde x";
352       $pic_a ddon_field  = "Pic_{$ pic_index} _addon";   320       $pic_a ddon_field  = "Pic_{$ pic_index} _addon";
353       $temp_ filename =  tempnam(r trim($dir[ 'tmp'], '/ '), $p_arr ['ID']);   321       $temp_ filename =  tempnam(r trim($dir[ 'tmp'], '/ '), $p_arr ['ID']);
354       unlink ($temp_fil ename);   322       unlink ($temp_fil ename);
355       $pic_n ame = $pic s[$pic_ind ex]['name' ];   323       $pic_n ame = $pic s[$pic_ind ex]['name' ];
356       $pic_t mp = $_FIL ES[$up_nam e]['tmp_na me'];   324       $pic_t mp = $_FIL ES[$up_nam e]['tmp_na me'];
357       $ext =  strrchr($ _FILES[$up _name]['na me'], '.') ;   325       $ext =  strrchr($ _FILES[$up _name]['na me'], '.') ;
358     326  
359       if ( $ pics[$pic_ index]['ex ist'] )   327       if ( $ pics[$pic_ index]['ex ist'] )
360           un link( "$pi c_name.jpg " );   328           un link( "$pi c_name.jpg " );
361     329  
362     330  
363           $s can = geti magesize($ _FILES[$up _name]['tm p_name']);   331           $s can = geti magesize($ _FILES[$up _name]['tm p_name']);
364           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] )
365                return 0 ;   333                return 0 ;
366     334  
367     335  
368       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}" ) )
369       {   337       {
370           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 ) )
371           {   339           {
372                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") ;
373                return 0 ;   341                return 0 ;
374           }   342           }
375           if  ( strtolo wer($ext)  != '.jpg'  )   343           if  ( strtolo wer($ext)  != '.jpg'  )
376                unlink(  "{$temp_fi lename}{$e xt}" );   344                unlink(  "{$temp_fi lename}{$e xt}" );
377     345  
378           if  ( getPara m( 'enable _watermark ' ) == 'on ' )   346           if  ( getPara m( 'enable _watermark ' ) == 'on ' )
379           {   347           {
380                $transpa rent1 = ge tParam( 't ransparent 1' );   348                $transpa rent1 = ge tParam( 't ransparent 1' );
381                $water_m ark = $dir ['profileI mage'] . g etParam( ' Water_Mark ' );   349                $water_m ark = $dir ['profileI mage'] . g etParam( ' Water_Mark ' );
382                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) )
383                {   351                {
384                    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 );
385                }   353                }
386           }   354           }
387     355  
388           sr and(time() );   356           sr and(time() );
389           $p _arr[$pic_ addon_fiel d] = rand( 10000, 999 99);   357           $p _arr[$pic_ addon_fiel d] = rand( 10000, 999 99);
390           $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];
391           $p ic_name =  $pics[$pic _index]['n ame'];   359           $p ic_name =  $pics[$pic _index]['n ame'];
392           if  ( !rename ( "{$temp_ filename}. jpg", "$pi c_name.jpg " ) )   360           if  ( !rename ( "{$temp_ filename}. jpg", "$pi c_name.jpg " ) )
393           {   361           {
394                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");
395                return 0 ;   363                return 0 ;
396           }   364           }
397           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']}" );
398     366  
399           ch mod( "$pic _name.jpg" , 0644 );   367           ch mod( "$pic _name.jpg" , 0644 );
400           $p ictures_te xt = _t_ac tion('_Suc cessfully  uploaded') ;   368           $p ictures_te xt = _t_ac tion('_Suc cessfully  uploaded') ;
401           $p ics[$pic_i ndex]['exi st'] = tru e;   369           $p ics[$pic_i ndex]['exi st'] = tru e;
402     370  
403           if  ( $p_arr[ 'Status']  == 'Active ' && !$aut oApproval_ ifPhoto &&  !$ADMIN )   371           if  ( $p_arr[ 'Status']  == 'Active ' && !$aut oApproval_ ifPhoto &&  !$ADMIN )
404           {   372           {
405                $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']}" );
406     374  
407                $p_arr[' Status'] =  'Approval ';   375                $p_arr[' Status'] =  'Approval ';
408                modules_ block($p_a rr['ID']);   376                modules_ block($p_a rr['ID']);
409           }   377           }
410           cr eateUserDa taFile( $p _arr['ID']  );   378           cr eateUserDa taFile( $p _arr['ID']  );
411           re turn 1;   379           re turn 1;
412       }   380       }
413       else   381       else
414       {   382       {
415           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") ;
416       }   384       }
417     385  
418       return  0;   386       return  0;
419   }   387   }
420     388  
421   /**   389   /**
422    * Print c ode for me mbership s tatus   390    * Print c ode for me mbership s tatus
423    * $member ID - membe r ID   391    * $member ID - membe r ID
424    * $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
425    * $credit s - will p rint credi ts status  if $credit s == 1    
426    */   393    */
427   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 )
428   {   395   {
429       global  $oTemplCo nfig;   396       global  $oTemplCo nfig;
430     397  
431       $ret =  "";   398       $ret =  "";
432     399  
433       $membe rship_info  = getMemb erMembersh ipInfo($me mberID);   400       $membe rship_info  = getMemb erMembersh ipInfo($me mberID);
434     401  
435       $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 / >";
436     403  
437       // Sho w colored  membership  name   404       // Sho w colored  membership  name
438       if ( $ membership _info['ID' ] == MEMBE RSHIP_ID_S TANDARD )   405       if ( $ membership _info['ID' ] == MEMBE RSHIP_ID_S TANDARD )
439       {   406       {
440           $r et .= _t(  "_MEMBERSH IP_STANDAR D" ). $vie wMembershi pActions;   407           $r et .= _t(  "_MEMBERSH IP_STANDAR D" ). $vie wMembershi pActions;
441           if  ( $offer_ upgrade )   408           if  ( $offer_ upgrade )
442                $ret .=  " ". _t( " _MEMBERSHI P_UPGRADE_ FROM_STAND ARD" );   409                $ret .=  " ". _t( " _MEMBERSHI P_UPGRADE_ FROM_STAND ARD" );
443       }   410       }
444       else   411       else
445       {   412       {
446           $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";
447     414  
448           $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) );
449     416  
450           if (!is_null( $membershi p_info['Da teExpires' ]))   417           if (!is_null( $membershi p_info['Da teExpires' ]))
451           {   418           {
452                if ( $da ys_left >  0 )   419                if ( $da ys_left >  0 )
453                {   420                {
454                    $ret  .= _t( "_ MEMBERSHIP _EXPIRES_I N_DAYS", $ days_left  );   421                    $ret  .= _t( "_ MEMBERSHIP _EXPIRES_I N_DAYS", $ days_left  );
455                }   422                }
456                else   423                else
457                {   424                {
458                    $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" ) ) ;
459                }   426                }
460           }   427           }
461           el se   428           el se
462           {   429           {
463                $ret.= _ t("_MEMBER SHIP_EXPIR ES_NEVER") ;   430                $ret.= _ t("_MEMBER SHIP_EXPIR ES_NEVER") ;
464           }   431           }
465     432  
466           if  ( $offer_ upgrade &&  !is_null( $membershi p_info['Da teExpires' ]))   433           if  ( $offer_ upgrade &&  !is_null( $membershi p_info['Da teExpires' ]))
467                $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>";
468       }   435       }
469     436  
470       if ( $ credits )    
471       {    
472           $g old_arr_cr ed_amount  = getProfi leCredits(  $memberID  );    
473           $r et .= "<br  /><u>" .  _t( "_MEMB ERSHIP_CRE DITS" ) .  "</u> (<a  href=\"jav ascript: v oid(0);\"  onClick=\" javascript : window.o pen('expla nation.php ?explain=c redits', ' ', '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' );\">" ._t("_Expl anation"). "</a>)<br  />";    
474           if  ( $gold_a rr_cred_am ount )    
475                $ret .=  _t( "_MEMB ERSHIP_CRE DITS_YES",  $gold_arr _cred_amou nt )."<br  />";    
476           el se    
477                $ret .=  _t( "_MEMB ERSHIP_CRE DITS_NO"). "<br />";    
478           if  ( $offer_ upgrade )    
479                $ret .=  " - <a hre f=\"member ship.php\" >". _t( "_ MEMBERSHIP _CREDITS_B UY_MORE" )  ."</a>";    
480       }    
481      
482       return  $ret;   437       return  $ret;
483   }   438   }
484     439  
485   /**   440   /**
486    * return  number of  credits fo r profile    
487    */    
488   function g etProfileC redits( $I D )    
489   {    
490       $ID =  (int)$ID;    
491       $arr =  db_arr( " SELECT `Am ount` FROM  `MemCredi ts` WHERE  `ID` = $ID  LIMIT 1"  );    
492       return  sprintf(  "%.2f", (f loat)$arr[ 0] );    
493   }    
494      
495   /**    
496    * increas e number o f credits  for profil e    
497    */    
498   function i ncProfileC redits( $I D, $inc )    
499   {    
500       $ID =  (int)$ID;    
501       $inc =  (float)$i nc;    
502       $arr =  db_arr( " SELECT COU NT(`ID`) F ROM `MemCr edits` WHE RE `ID` =  $ID" );    
503       if ( $ arr[0] )    
504       {    
505           re turn db_re s( "UPDATE  `MemCredi ts` SET `A mount` = ` Amount` +  $inc WHERE  `ID` = $I D" );    
506       }    
507       else    
508       {    
509           re turn db_re s( "INSERT  INTO `Mem Credits` S ET `Amount ` = $inc,  `ID` = $ID " );    
510       }    
511   }    
512      
513   /**    
514    * decreas e number o f credits  for profil e    
515    */    
516   function d ecProfileC redits( $I D, $dec )    
517   {    
518       $ID =  (int)$ID;    
519       $dec =  (float)$d ec;    
520       return  db_res( " UPDATE `Me mCredits`  SET `Amoun t` = `Amou nt` - $dec  WHERE `ID ` = $ID" ) ;    
521   }    
522      
523   /**    
524    * 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.
525    * @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.
526    */   443    */
527   function d isplay_pro file_detai ls( $profi le )   444   function d isplay_pro file_detai ls( $profi le )
528   {   445   {
529       global  $dir; //  Image fold er   446       global  $dir; //  Image fold er
530       global  $site; //  Image URL   447       global  $site; //  Image URL
531        global   $ p r of ;   448        global   $ aP r eValues ;
532     449  
533       // Get  profile t humbnail n ame.   450       // Get  profile t humbnail n ame.
534       $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';
535       // Get  profile t humbnail p ath.   452       // Get  profile t humbnail p ath.
536       $t_pat h = $dir[' profileIma ge'] . $t_ name;   453       $t_pat h = $dir[' profileIma ge'] . $t_ name;
537       // Get  profile t humbnail U RL.   454       // Get  profile t humbnail U RL.
538       $t_url  = $site[' profileIma ge'].$t_na me;   455       $t_url  = $site[' profileIma ge'].$t_na me;
539       // Get  anonymous  thumbnail  url.   456       // Get  anonymous  thumbnail  url.
540       $a_url  = 'male'  == $profil e['Sex'] ?  'man.jpg'  : 'woman. jpg';   457       $a_url  = 'male'  == $profil e['Sex'] ?  'man.jpg'  : 'woman. jpg';
541       $a_url  = $site[' profileIma ge'].$a_ur l;   458       $a_url  = $site[' profileIma ge'].$a_ur l;
542       // Sel ect correc t url.   459       // Sel ect correc t url.
543       if ( f ile_exists ( $t_path  ) )   460       if ( f ile_exists ( $t_path  ) )
544       {   461       {
545           $u rl = $t_ur l;   462           $u rl = $t_ur l;
546       }   463       }
547       else   464       else
548       {   465       {
549           $u rl = $a_ur l;   466           $u rl = $a_ur l;
550       }   467       }
551     468  
552       // Get  profile d etails.   469       // Get  profile d etails.
553       $nickn ame = $pro file['Nick Name'];   470       $nickn ame = $pro file['Nick Name'];
554     471  
555       $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']);
556     473  
557        $location   =   $profile[' City'].',   '._t(   '__'. $ p r of [' c ountr ies '][$profil e['Country ']]  
);
  474        $location   =   $profile[' City'].',   '._t(  
$ aP r eValues [' C ountr y '][$profil e['Country ']] ['LKey']   );
558     475  
559       // Dis play profi le details .   476       // Dis play profi le details .
560       ob_sta rt();   477       ob_sta rt();
561   ?>   478   ?>
562       <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">
563           <t r>   480           <t r>
564                <td alig n="center"  class="pr ofile_thum b">   481                <td alig n="center"  class="pr ofile_thum b">
565                    <img  src="<?=  $url ?>" / >   482                    <img  src="<?=  $url ?>" / >
566                </td>   483                </td>
567           </ tr>   484           </ tr>
568           <t r>   485           <t r>
569                <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>
570           </ tr>   487           </ tr>
571           <t r>   488           <t r>
572                <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 >
573           </ tr>   490           </ tr>
574           <t r>   491           <t r>
575                <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>
576           </ tr>   493           </ tr>
577       </tabl e>   494       </tabl e>
578   <?   495   <?
579       $conte nt = ob_ge t_contents ();   496       $conte nt = ob_ge t_contents ();
580       ob_end _clean();   497       ob_end _clean();
581       echo $ content;   498       echo $ content;
582   }   499   }
583     500  
584     501  
585   function P rofileDeta ils( $send erID )   502   function P rofileDeta ils( $send erID )
586   {   503   {
587       global  $site;   504       global  $site;
588        global   $ p r of ;   505        global   $ aP r eValues ;
589       global  $dir;   506       global  $dir;
590     507  
591       //$pro f_query =  "SELECT `N ickName`,  `Headline` , `DateOfB irth`, `Se x`, `Count ry`, `Pic_ 0_addon`,  `Status`   FROM `Prof iles` WHER E `ID` = ' $senderID' ";    
592       //$pro f_arr = db _arr($prof _query);    
593           
594       $prof_ arr = getP rofileInfo ( $senderI D );   508       $prof_ arr = getP rofileInfo ( $senderI D );
595     509  
596        $country   =   _t(   '__'. $ p r of [' c ountr ies '][$prof_a rr['Countr y']]  
);
  510        $country   =   _t(  
$ aP r eValues [' C ountr y '][$prof_a rr['Countr y']] ['LKey']   );
597       $prof_ age = age( $prof_arr[ 'DateOfBir th']);   511       $prof_ age = age( $prof_arr[ 'DateOfBir th']);
598       $prof_ sex = _t(  "_" . $pro f_arr['Sex ']);   512       $prof_ sex = _t(  "_" . $pro f_arr['Sex ']);
599     513  
600       if ( $ prof_arr[' Status'] = = 'Active'  )   514       if ( $ prof_arr[' Status'] = = 'Active'  )
601       {   515       {
602           $n ick_link =  '<a href= "' . getPr ofileLink( $senderID)  . '" targ et="_blank ">' . $pro f_arr['Nic kName'] .  '</a>';   516           $n ick_link =  '<a href= "' . getPr ofileLink( $senderID)  . '" targ et="_blank ">' . $pro f_arr['Nic kName'] .  '</a>';
603       }   517       }
604       else   518       else
605       {   519       {
606           $n ick_link =  $prof_arr ['NickName '];   520           $n ick_link =  $prof_arr ['NickName '];
607       }   521       }
608       $ret . = '<div cl ass="prof_ details_wr apper">';   522       $ret . = '<div cl ass="prof_ details_wr apper">';
609            $ret   .=   '<div   class= \ "clear_bot h \ "></div>';   523            $ret   .=   '<div   class=
"clear_bot h
"></div>';
610           $r et .= get_ member_thu mbnail( $s enderID, ' left' );   524           $r et .= get_ member_thu mbnail( $s enderID, ' left' );
611              525           
612           $r et .= '<di v class="p rof_ditail s_block">' ;   526           $r et .= '<di v class="p rof_ditail s_block">' ;
613                $ret .=  '<div clas s="li_word ">'._t('_N ickName'). ':</div><d iv class=" li_value"> ' . $nick_ link . '</ div>';   527                $ret .=  '<div clas s="li_word ">'._t('_N ickName'). ':</div><d iv class=" li_value"> ' . $nick_ link . '</ div>';
614                $ret .=  '<div clas s="li_word ">'._t('_S ex').':</d iv><div cl ass="li_va lue">' . $ prof_sex .  '</div>';   528                $ret .=  '<div clas s="li_word ">'._t('_S ex').':</d iv><div cl ass="li_va lue">' . $ prof_sex .  '</div>';
615                $ret .=  '<div clas s="li_word ">'._t('_D ateOfBirth ').':</div ><div clas s="li_valu e">' . $pr of_age . ' </div>';   529                $ret .=  '<div clas s="li_word ">'._t('_D ateOfBirth ').':</div ><div clas s="li_valu e">' . $pr of_age . ' </div>';
616                $ret .=  '<div clas s="li_word ">'._t('_F rom').':</ div><div c lass="li_v alue"> ' .  $country  . '</div>' ;   530                $ret .=  '<div clas s="li_word ">'._t('_F rom').':</ div><div c lass="li_v alue"> ' .  $country  . '</div>' ;
617           $r et .= '</d iv>';   531           $r et .= '</d iv>';
618            $ret   .=   '<div   class= \ "clear_bot h \ "></div>';   532            $ret   .=   '<div   class=
"clear_bot h
"></div>';
619       $ret . = '</div>' ;   533       $ret . = '</div>' ;
620     534  
621     535  
622       return  $ret;   536       return  $ret;
623   }   537   }
624     538  
625     539  
626     540  
627   function S howPoll( $ uID )   541   function S howPoll( $ uID )
628   {   542   {
629     543  
630       global  $_page;   544       global  $_page;
631       global  $site;   545       global  $site;
632     546  
633       $_page ['js_name' ]   = 'pro file_poll. js';   547       $_page ['js_name' ]   = 'pro file_poll. js';
634          548       
635       $sButt onValue =  _t( '_Vote ' );   549       $sButt onValue =  _t( '_Vote ' );
636     550  
637       $ret . =   551       $ret . =
638   <<<EOS   552   <<<EOS
639       <div i d="dpol_{$ uID}"  cla ss="pollBl ock" >   553       <div i d="dpol_{$ uID}"  cla ss="pollBl ock" >
640           <d iv id="dpo l_caption_ {$uID}" cl ass="pollC aption"></ div>   554           <d iv id="dpo l_caption_ {$uID}" cl ass="pollC aption"></ div>
641           <d iv id="dpo l_question _{$uID}" c lass="poll AnswerBloc k">   555           <d iv id="dpo l_question _{$uID}" c lass="poll AnswerBloc k">
642                <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();">   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();">
643                    <img  src="{$si te['icons' ]}pollUp.g if" alt=""  />   557                    <img  src="{$si te['icons' ]}pollUp.g if" alt=""  />
644                </div>   558                </div>
645                <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();">   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();">
646                    <img  src="{$si te['icons' ]}pollDown .gif" alt= "" />   560                    <img  src="{$si te['icons' ]}pollDown .gif" alt= "" />
647                </div>   561                </div>
648                <div id= "dpol_ques tion_text_ {$uID}" cl ass="pollQ uestionBlo ck"></div>   562                <div id= "dpol_ques tion_text_ {$uID}" cl ass="pollQ uestionBlo ck"></div>
649           </ div>   563           </ div>
650           <d iv id="dpo l_actions_ {$uID}" cl ass="pollS ubmitBlock ">   564           <d iv id="dpo l_actions_ {$uID}" cl ass="pollS ubmitBlock ">
651                 <input   type="butt on"   value="
$sButtonVa lue
"   onclick="j avascript:   send_data(   'dpol_ques tion_text_ {$uID}',   'vote',   '&
param='   +   (   document.g etElementB yId(   'current_v ote_{$uID} '   )   ?   document.g etElementB yId(   'current_v ote_{$uID} '   ).value   :   ''   ),   '{$uID}'   );   return   false;"
>
  565                 <input   type="butt on"   value=" { $sButtonVa lue } "   onclick="j avascript:   send_data(   'dpol_ques tion_text_ {$uID}',   'vote',   '& amp; param='   +   (   document.g etElementB yId(   'current_v ote_{$uID} '   )   ?   document.g etElementB yId(   'current_v ote_{$uID} '   ).value   :   ''   ),   '{$uID}'   );   return   false;"   / >
652                    
653                <!--<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; ">    
654                    <img  src="{$si te['icons' ]}pollSubm it.gif" al t="rez" bo rder="0">    
655                </a>-->    
656           </ div>   566           </ div>
657       </div>   567       </div>
658       <scrip t type="te xt/javascr ipt" langu age="javas cript">   568       <scrip t type="te xt/javascr ipt" langu age="javas cript">
659      
660           se nd_data( ' dpol_quest ion_text_{ $uID}', 'q uestions',  '', '{$uI D}' );   569           se nd_data( ' dpol_quest ion_text_{ $uID}', 'q uestions',  '', '{$uI D}' );
661      
662       </scri pt>   570       </scri pt>
663     571  
664   EOS;   572   EOS;
665     573  
666     574   /*
    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; ">
    576                    <img  src="{$si te['icons' ]}pollSubm it.gif" al t="rez" bo rder="0">
    577                </a>-->
    578   */
667       return  $ret;   579       return  $ret;
668     580  
669   }   581   }
670     582  
671   function i sAutoAppro val( $sAct ion )   583   function i sAutoAppro val( $sAct ion )
672   {   584   {
673       $autoA pproval_if Photo = (  'on' == ge tParam("au toApproval _ifPhoto")  );   585       $autoA pproval_if Photo   =  ( 'on' ==  getParam(" autoApprov al_ifPhoto ") );
674       $autoA pproval_if Sound = (  'on' == ge tParam("au toApproval _ifSound")  );   586       $autoA pproval_if Sound   =  ( 'on' ==  getParam(" autoApprov al_ifSound ") );
675       $autoA pproval_if Video = (  'on' == ge tParam("au toApproval _ifVideo")  );   587       $autoA pproval_if Video   =  ( 'on' ==  getParam(" autoApprov al_ifVideo ") );
676       $autoA pproval_if Profile =  ( 'on' ==  getParam(" autoApprov al_ifProfi le") );   588       $autoA pproval_if Profile =  ( 'on' ==  getParam(" autoApprov al_ifProfi le") );
677       $autoA pproval_if Join = ( ' on' == get Param("aut oApproval_ ifJoin") ) ;   589       $autoA pproval_if Join    =  ( 'on' ==  getParam(" autoApprov al_ifJoin" ) );
678     590  
679       switch  ( $sActio n )   591       switch  ( $sActio n )
680       {   592       {
681           ca se 'photo' :   593           ca se 'photo' :
682                return $ autoApprov al_ifPhoto ;   594                return $ autoApprov al_ifPhoto ;
683     595  
684           ca se 'sound' :   596           ca se 'sound' :
685                return $ autoApprov al_ifSound ;   597                return $ autoApprov al_ifSound ;
686     598  
687           ca se 'video' :   599           ca se 'video' :
688                return $ autoApprov al_ifVideo ;   600                return $ autoApprov al_ifVideo ;
689     601  
690           ca se 'profil e':   602           ca se 'profil e':
691                return $ autoApprov al_ifProfi le;   603                return $ autoApprov al_ifProfi le;
692     604  
693           ca se 'join':   605           ca se 'join':
694                return $ autoApprov al_ifJoin;   606                return $ autoApprov al_ifJoin;
695     607  
696           de fault:   608           de fault:
697                return f alse;   609                return f alse;
698       }   610       }
699   }   611   }
700     612  
701     613  
702   /* * * * R ay MP3 Int egration ( Begin) * *  * */   614   /* * * * R ay MP3 Int egration ( Begin) * *  * */
703   function g etRayMp3Pl ayer( $iId , $sPasswo rd, $iView erId)   615   function g etRayMp3Pl ayer( $iId , $sPasswo rd, $iView erId)
704   {   616   {
705       return  getApplic ationConte nt("mp3",  "player",  array('id'  => $iId,  'password'  => md5($s Password),  'vId' =>  $iViewerId ), true);   617       return  getApplic ationConte nt("mp3",  "player",  array('id'  => $iId,  'password'  => md5($s Password),  'vId' =>  $iViewerId ), true);
706   }   618   }
707   /* * * * R ay MP3 Int egration ( End) * * *  */   619   /* * * * R ay MP3 Int egration ( End) * * *  */
708     620  
709   function c reateUserD ataFile( $ userID )   621   function c reateUserD ataFile( $ userID )
710   {   622   {
711        global   $dir,   $date_form at ,   $aUser ;   623        global   $dir,   $date_form at
;
712           
713     624  
714       $userI D = (int)$ userID;   625       $userI D = (int)$ userID;
715       $fileN ame = $dir ['cache']  . 'user' .  $userID .  '.php';   626       $fileN ame = $dir ['cache']  . 'user' .  $userID .  '.php';
716       if( $u serID > 0  )   627       if( $u serID > 0  )
717       {   628       {
718           $u serQuery =  "   629           $u serQuery =  "
719                SELECT   630                SELECT
720                         *,   631                         *,
721                         DATE_FORMA T(`
LastLog gedI n`,    '$date_for mat'   )   AS   `
LastLog gedI n`,
  632                         DATE_FORMA T(` Date LastLog i n`,    '$date_for mat'   )   AS   ` Date LastLog i n`,
722                         DATE_FORMA T(`
Last Mo di fied `,    '$date_for mat'   )   AS   `
Last Mo di fied `
  633                         DATE_FORMA T(` Date Last E di t `,     '$date_for mat'   )   AS   ` Date Last E di t `
723                FROM   634                FROM
724                         `Profiles`   635                         `Profiles`
725                WHERE `I D` = '$use rID' LIMIT  1   636                WHERE `I D` = '$use rID' LIMIT  1
726           ";   637           ";
727              638           
728           $a PreUser =  db_assoc_a rr( $userQ uery );   639           $a PreUser =  db_assoc_a rr( $userQ uery );
729              640           
730           if ( isset( $ aPreUser )  and is_ar ray( $aPre User ) )   641           if ( isset( $ aPreUser )  and is_ar ray( $aPre User ) )
731           {   642           {
732                   643                
733                $sUser =  '<?';   644                $sUser =  '<?';
734                $sUser . = "\n\n";   645                $sUser . = "\n\n";
735                $sUser . = '$aUser[ ' . $userI D . '] = a rray();';   646                $sUser . = '$aUser[ ' . $userI D . '] = a rray();';
736                $sUser . = "\n";   647                $sUser . = "\n";
737                $sUser . = '$aUser[ ' . $userI D . '][\'d atafile\']  = true;';   648                $sUser . = '$aUser[ ' . $userI D . '][\'d atafile\']  = true;';
738                $sUser . = "\n";   649                $sUser . = "\n";
739     650  
740                $replace What = arr ay( '\\',    '\''   ) ;   651                $replace What = arr ay( '\\',    '\''   ) ;
741                $replace To   = arr ay( '\\\\' , '\\\'' ) ;   652                $replace To   = arr ay( '\\\\' , '\\\'' ) ;
742                   653                
743                foreach(  $aPreUser  as $key = >  $value  )   654                foreach(  $aPreUser  as $key = >  $value  )
744                    $sUs er .= '$aU ser[' . $u serID . '] [\'' . $ke y . '\']'  . ' = ' .  '\'' . str _replace(  $replaceWh at, $repla ceTo, $val ue )  . '\ '' . ";\n" ;   655                    $sUs er .= '$aU ser[' . $u serID . '] [\'' . $ke y . '\']'  . ' = ' .  '\'' . str _replace(  $replaceWh at, $repla ceTo, $val ue )  . '\ '' . ";\n" ;
745                   656                
746                $sUser . = "\n" . ' ?>';   657                $sUser . = "\n" . ' ?>';
747                   658                
748                if( $fil e = fopen(  $fileName , "w" ) )   659                if( $fil e = fopen(  $fileName , "w" ) )
749                {   660                {
750                    fwri te( $file,  $sUser );   661                    fwri te( $file,  $sUser );
751                    fclo se( $file  );   662                    fclo se( $file  );
752                    @chm od ($fileN ame, 0666) ;   663                    @chm od ($fileN ame, 0666) ;
753                       664                    
754                    @inc lude( $fil eName );   665                    @inc lude( $fil eName );
755                    retu rn true;   666                    retu rn true;
756                }   667                }
757                else   668                else
758                    retu rn false;   669                    retu rn false;
759                   670                
760           }   671           }
761       }   672       }
762       else   673       else
763           re turn false ;   674           re turn false ;
764   }   675   }
765     676  
766   function g etProfileI nfo( $iPro fileID, $c heckActive Status = f alse, $for ceCache =  false )   677   function g etProfileI nfo( $iPro fileID, $c heckActive Status = f alse, $for ceCache =  false )
767   {   678   {
768       global  $aUser;   679       global  $aUser;
769       global  $dir;   680       global  $dir;
770       global  $date_for mat;   681       global  $date_for mat;
771          682       
772       $iProf ileID = (i nt)$iProfi leID;   683       $iProf ileID = (i nt)$iProfi leID;
773       if( !$ iProfileID  )   684       if( !$ iProfileID  )
774           re turn false ;   685           re turn false ;
775          686       
776       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 )
777       {   688       {
778           $s CacheFile  = $dir['ca che'] . 'u ser' . $iP rofileID .  '.php';   689           $s CacheFile  = $dir['ca che'] . 'u ser' . $iP rofileID .  '.php';
779              690           
780           if ( !file_ex ists( $sCa cheFile )  || $forceC ache )   691           if ( !file_ex ists( $sCa cheFile )  || $forceC ache )
781                if( !cre ateUserDat aFile( $iP rofileID )  )   692                if( !cre ateUserDat aFile( $iP rofileID )  )
782                    retu rn false;   693                    retu rn false;
783              694           
784           @i nclude( $s CacheFile  );   695           @i nclude( $s CacheFile  );
785       }   696       }
786          697       
787       if( $c heckActive Status and  $aUser[$i ProfileID] ['Status']  != 'Activ e' )   698       if( $c heckActive Status and  $aUser[$i ProfileID] ['Status']  != 'Activ e' )
788           re turn false ;   699           re turn false ;
789          700       
790       return  $aUser[$i ProfileID] ;   701       return  $aUser[$i ProfileID] ;
791   }   702   }
792     703  
793   function g etNewLette rsNum( $iI D )   704   function g etNewLette rsNum( $iI D )
794   {   705   {
795       $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'";
796       $iNum  = db_value ($sqlQuery );   707       $iNum  = db_value ($sqlQuery );
797          708       
798       return  $iNum;   709       return  $iNum;
799   }   710   }
800     711  
801   function g etFriendNu mber ($iID )   712   function g etFriendNu mber ($iID )
802   {   713   {
803       $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'";
804          715       
805       return  db_value( $sqlQuery) ;   716       return  db_value( $sqlQuery) ;
806   }   717   }
807     718  
808   /*   719   /*
809   * 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'];
810   */   721   */
811     722  
812   function g etNickName ( $ID = ''  )   723   function g etNickName ( $ID = ''  )
813   {   724   {
814       global  $dir;   725       global  $dir;
815     726  
816     727  
817       if ( ! $ID && (in t)$_COOKIE ['memberID '] )   728       if ( ! $ID && (in t)$_COOKIE ['memberID '] )
818           $I D = $_COOK IE['member ID'];   729           $I D = $_COOK IE['member ID'];
819     730  
820       if ( ! $ID )   731       if ( ! $ID )
821           re turn '';   732           re turn '';
822          733       
823       $arr =  getProfil eInfo( $ID  );   734       $arr =  getProfil eInfo( $ID  );
824       return  $arr['Nic kName'];   735       return  $arr['Nic kName'];
825   }   736   }
826     737  
827   /*   738   /*
828    * The fun ction retu rns Passwo rd by give n ID.   739    * The fun ction retu rns Passwo rd by give n ID.
829    */   740    */
830   function g etPassword ( $ID = ''  )   741   function g etPassword ( $ID = ''  )
831   {   742   {
832       if ( ! (int)$ID )   743       if ( ! (int)$ID )
833           re turn '';   744           re turn '';
834     745  
835       $arr =  getProfil eInfo( $ID  );   746       $arr =  getProfil eInfo( $ID  );
836       return  $arr['Pas sword'];   747       return  $arr['Pas sword'];
837   }   748   }
838     749  
839   function g etSex( $ID  = '' )   750   function g etSex( $ID  = '' )
840   {   751   {
841       if ( ! (int)$ID )   752       if ( ! (int)$ID )
842           re turn '';   753           re turn '';
843     754  
844       $arr =  getProfil eInfo( $ID  );   755       $arr =  getProfil eInfo( $ID  );
845       return  $arr['Sex '];   756       return  $arr['Sex '];
846   }   757   }
847     758  
848   function g etProfileL ink( $iID,  $sLinkAdd  = '' )   759   function g etProfileL ink( $iID,  $sLinkAdd  = '' )
849   {   760   {
850       global  $site;   761       global  $site;
    762  
    763       $aProf Info = get ProfileInf o( $iID );
    764       $iID =  ($aProfIn fo['Couple '] > 0 &&  $aProfInfo ['ID'] > $ aProfInfo[ 'Couple'])  ? $aProfI nfo['Coupl e'] : $iID ;
    765  
851       if ( g etParam('e nable_modr ewrite') = = 'on' )   766       if ( g etParam('e nable_modr ewrite') = = 'on' )
852           $s Link = $si te['url']. getNickNam e($iID) .  ( $sLinkAd d ? "?{$sL inkAdd}" :  '' );   767           $s Link = $si te['url']. getNickNam e($iID) .  ( $sLinkAd d ? "?{$sL inkAdd}" :  '' );
853       else   768       else
854           $s Link = $si te['url']. 'profile.p hp?ID='.$i ID . ( $sL inkAdd ? " &{$sLinkAd d}" : '' ) ;   769           $s Link = $si te['url']. 'profile.p hp?ID='.$i ID . ( $sL inkAdd ? " &{$sLinkAd d}" : '' ) ;
855          770       
856       return  $sLink;   771       return  $sLink;
857   }   772   }
858     773  
859     774  
860   /**   775   /**
861    * Shows h ow many da ys, hours,  minutes m ember was  onine last  time   776    * Shows h ow many da ys, hours,  minutes m ember was  onine last  time
862    *   777    *
863    * @param   $lastNavT ime   778    * @param   $lastNavT ime
864    *   779    *
865    * @return  int   780    * @return  int
866    */   781    */
867   function   getProfile LastOnline Period( $l astNavTime  )   782   function   getProfile LastOnline Period( $l astNavTime  )
868   {   783   {
869           if  ( $lastNa vTime != 0  )   784           if  ( $lastNa vTime != 0  )
870           {   785           {
871                $time =  date("U")  - $lastNav Time;   786                $time =  date("U")  - $lastNav Time;
872     787  
873                if ( $ti me <= 300  )   788                if ( $ti me <= 300  )
874                {   789                {
875                    //$r et = '<str ong>' . _t ('_Online' ) . '</str ong>';   790                    //$r et = '<str ong>' . _t ('_Online' ) . '</str ong>';
876                    $ret  = '<div c lass="onli ne">' . _t ('_Online' ) . '</div >';   791                    $ret  = '<div c lass="onli ne">' . _t ('_Online' ) . '</div >';
877                }   792                }
878                else   793                else
879                {   794                {
880                    $min utes = flo or( $time  / 60 );   795                    $min utes = flo or( $time  / 60 );
881                    if (  $minutes  > 60 )   796                    if (  $minutes  > 60 )
882                    {   797                    {
883                         $hours = f loor( $tim e / 3600 ) ;   798                         $hours = f loor( $tim e / 3600 ) ;
884                         if ( $hour s > 24 )   799                         if ( $hour s > 24 )
885                         {   800                         {
886                             $days  = floor( $ time / 864 00 );   801                             $days  = floor( $ time / 864 00 );
887                             $hours  = floor(  ( $time -  $days*8640 0 ) / 3600  );   802                             $hours  = floor(  ( $time -  $days*8640 0 ) / 3600  );
888                             $minut es = floor ( ( $time  - $days*86 400 - $hou rs*3600 )  / 60 );   803                             $minut es = floor ( ( $time  - $days*86 400 - $hou rs*3600 )  / 60 );
889                         }   804                         }
890                         else   805                         else
891                         {   806                         {
892                             $minut es = floor  ( ( $time  - $hours* 3600 ) / 6 0 );   807                             $minut es = floor  ( ( $time  - $hours* 3600 ) / 6 0 );
893                         }   808                         }
894                    }   809                    }
895     810  
896                    /*   811                    /*
897                    if(  $days > 31  )   812                    if(  $days > 31  )
898                    {   813                    {
899                         $lnt = '<s trong>' .  _t('_more_ month_ago' ) . '</str ong>';   814                         $lnt = '<s trong>' .  _t('_more_ month_ago' ) . '</str ong>';
900                    }   815                    }
901                    else   816                    else
902                    {   817                    {
903                         if( $days  > 7 )   818                         if( $days  > 7 )
904                         {   819                         {
905                             $lnt =  '<strong> ' . _t('_m ore_week_a go') . '</ strong>';   820                             $lnt =  '<strong> ' . _t('_m ore_week_a go') . '</ strong>';
906                         }   821                         }
907                         else   822                         else
908                         {   823                         {
909                             if ( $ days >= 7  )   824                             if ( $ days >= 7  )
910                                 $l nt = '<str ong>' . _t ('_week_ag o') . '</s trong>';   825                                 $l nt = '<str ong>' . _t ('_week_ag o') . '</s trong>';
911                             else   826                             else
912                             */   827                             */
913                                 // $lnt = ( $ days ? $da ys . ' day (s) ago' :  ( $hours  ? $hours .  ' hour(s)  ago' : $m inutes . '  minutes a go' )) . ' ';   828                                 // $lnt = ( $ days ? $da ys . ' day (s) ago' :  ( $hours  ? $hours .  ' hour(s)  ago' : $m inutes . '  minutes a go' )) . ' ';
914                                 if ( $days )   829                                 if ( $days )
915                                 {   830                                 {
916                                      $ret = _ t( '_day(s )', $days  );// $days  .   831                                      $ret = _ t( '_day(s )', $days  );// $days  .
917                                 }   832                                 }
918                                 el seif( $hou rs )   833                                 el seif( $hou rs )
919                                 {   834                                 {
920                                      $ret = _ t( '_hour( s)', $hour s );   835                                      $ret = _ t( '_hour( s)', $hour s );
921                                 }   836                                 }
922                                 el se   837                                 el se
923                                 {   838                                 {
924                                      $ret = _ t( '_minut e(s)', $mi nutes );   839                                      $ret = _ t( '_minut e(s)', $mi nutes );
925                                 }   840                                 }
926     841  
927                                 /*   842                                 /*
928                         }   843                         }
929                    }   844                    }
930                    */   845                    */
931     846  
932                }   847                }
933     848  
934           }   849           }
935           el se   850           el se
936           {   851           {
937                $ret = ' <div class ="never">'  . _t('_ne ver') . '< /div>';   852                $ret = ' <div class ="never">'  . _t('_ne ver') . '< /div>';
938           }   853           }
939     854  
940           re turn $ret;   855           re turn $ret;
941   }   856   }
942     857  
943   ?>   858   function p eriodic_ch eck_ban()  {
    859       //Clea ning Ban t able
    860       $Check SQL = "
    861           SE LECT `Admi nBanList`.
    862           FR OM `AdminB anList` 
    863           WH ERE (
    864                `DateTim e` + INTER VAL `Time`  SECOND <  NOW()
    865           )
    866       ";
    867       $vChec kBanRes =  db_res($Ch eckSQL);
    868       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']}'";
    870           db _res($sDel eteBanSQL) ;
    871       }
    872   }
    873  
    874   function i sLoggedBan ned($iCurU serID = 0)  {
    875       $iCCur UserID = ( $iCurUserI D>0) ? $iC urUserID :  (int)$_CO OKIE['memb erID'];
    876       if ($i CCurUserID ) {
    877           $C heckSQL =  "
    878                SELECT *  
    879                FROM `Ad minBanList
    880                WHERE `P rofID`='{$ iCCurUserI D}'
    881           ";
    882           db _res($Chec kSQL);
    883           if  (mysql_af fected_row s()>0) {
    884                return t rue;
    885           }
    886       }
    887       return  false;
    888   }
    889  
    890   function m ake_check_ ban() {
    891       //Make  automatic ally logou t for Bann ed members
    892       if (is LoggedBann ed((int)$_ COOKIE['me mberID']))  {
    893           se tcookie( ' memberID',  $_COOKIE[ 'memberID' ], time()  - 48 * 360 0, '/' );
    894           se tcookie( ' memberPass word', $_C OOKIE['mem berPasswor d'], time( ) - 48 * 3 600, '/' ) ;
    895       }
    896   }
    897  
    898   make_check _ban();