768. File Comparison Report

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

768.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.0.5 compose.php Mon Dec 24 09:44:20 2007 UTC
2 Dolphin-v.6.1.0 compose.php Sat Apr 26 08:19:18 2008 UTC

768.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 9 818
Changed 3 6
Inserted 0 0
Removed 5 18

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

768.4 Active regular expressions

No regular expressions were active.

768.5 Comparison detail

1   <?php   1   <?php
2     2  
3   /********* ********** ********** ********** ********** ********** ********** ******   3   /********* ********** ********** ********** ********** ********** ********** ******
4   *                              D olphin Sma rt Communi ty Builder   4   *                              D olphin Sma rt Communi ty Builder
5   *                                 --------- --------   5   *                                 --------- --------
6   *     begi n                 : M on Mar 23  2006   6   *     begi n                 : M on Mar 23  2006
7   *     copy right             : ( C) 2006 Bo onEx Group   7   *     copy right             : ( C) 2006 Bo onEx Group
8   *     webs ite               : h ttp://www. boonex.com /   8   *     webs ite               : h ttp://www. boonex.com /
9   * This fil e is part  of Dolphin  - Smart C ommunity B uilder   9   * This fil e is part  of Dolphin  - Smart C ommunity B uilder
10   *   10   *
11   * Dolphin  is free so ftware. Th is work is  licensed  under a Cr eative Com mons Attri bution 3.0  License.    11   * Dolphin  is free so ftware. Th is work is  licensed  under a Cr eative Com mons Attri bution 3.0  License. 
12   * http://c reativecom mons.org/l icenses/by /3.0/   12   * http://c reativecom mons.org/l icenses/by /3.0/
13   *   13   *
14   * Dolphin  is distrib uted in th e hope tha t it will  be useful,  but WITHO UT ANY WAR RANTY;   14   * Dolphin  is distrib uted in th e hope tha t it will  be useful,  but WITHO UT ANY WAR RANTY;
15   * without  even the i mplied war ranty of   MERCHANTAB ILITY or F ITNESS FOR  A PARTICU LAR PURPOS E.   15   * without  even the i mplied war ranty of   MERCHANTAB ILITY or F ITNESS FOR  A PARTICU LAR PURPOS E.
16   * See the  Creative C ommons Att ribution 3 .0 License  for more  details.    16   * See the  Creative C ommons Att ribution 3 .0 License  for more  details. 
17   * You shou ld have re ceived a c opy of the  Creative  Commons At tribution  3.0 Licens e along wi th Dolphin   17   * You shou ld have re ceived a c opy of the  Creative  Commons At tribution  3.0 Licens e along wi th Dolphin
18   * see lice nse.txt fi le; if not , write to  marketing @boonex.co m   18   * see lice nse.txt fi le; if not , write to  marketing @boonex.co m
19   ********** ********** ********** ********** ********** ********** ********** *****/   19   ********** ********** ********** ********** ********** ********** ********** *****/
20     20  
21   require_on ce( 'inc/h eader.inc. php' );   21   require_on ce( 'inc/h eader.inc. php' );
22   require_on ce( BX_DIR ECTORY_PAT H_INC . 'd esign.inc. php' );   22   require_on ce( BX_DIR ECTORY_PAT H_INC . 'd esign.inc. php' );
23   require_on ce( BX_DIR ECTORY_PAT H_INC . 'p rofiles.in c.php' );   23   require_on ce( BX_DIR ECTORY_PAT H_INC . 'p rofiles.in c.php' );
24   require_on ce( BX_DIR ECTORY_PAT H_INC . 'm embers.inc .php' );   24   require_on ce( BX_DIR ECTORY_PAT H_INC . 'm embers.inc .php' );
25   require_on ce( BX_DIR ECTORY_PAT H_INC . 'u tils.inc.p hp' );   25   require_on ce( BX_DIR ECTORY_PAT H_INC . 'u tils.inc.p hp' );
26     26  
27   // ------- -------- p age variab les and lo gin   27   // ------- -------- p age variab les and lo gin
28     28  
29     29  
30     30  
31   $logged['m ember'] =  member_aut h( 0 );   31   $logged['m ember'] =  member_aut h( 0 );
32     32  
33   $_page['na me_index']     = 19;   33   $_page['na me_index']     = 19;
34   $_page['he ader']         = _t(  "_COMPOSE_ H" );   34   $_page['he ader']         = _t(  "_COMPOSE_ H" );
35   $_page['he ader_text' ]   = _t(  "_COMPOSE_ H1" );   35   $_page['he ader_text' ]   = _t(  "_COMPOSE_ H1" );
36   $_page['cs s_name']       = 'com pose.css';   36   $_page['cs s_name']       = 'com pose.css';
37     37  
38   $_page['ex tra_js'] =  $oTemplCo nfig -> sT inyMceEdit orCompactJ S;   38   $_page['ex tra_js'] =  $oTemplCo nfig -> sT inyMceEdit orCompactJ S;
39     39  
40   // ------- -------- p age compon ents   40   // ------- -------- p age compon ents
41     41  
42   $_ni = $_p age['name_ index'];   42   $_ni = $_p age['name_ index'];
43   $_page_con t[$_ni]['p age_main_c ode'] = De signBoxCon tent( '',  PageCompPa geMainCode (), $oTemp lConfig ->  PageCompo se_db_num  );   43   $_page_con t[$_ni]['p age_main_c ode'] = De signBoxCon tent( '',  PageCompPa geMainCode (), $oTemp lConfig ->  PageCompo se_db_num  );
44     44  
45   // ------- -------- [ END] page  components   45   // ------- -------- [ END] page  components
46     46  
47   PageCode() ;   47   PageCode() ;
48     48  
49   // ------- -------- p age compon ents funct ions   49   // ------- -------- p age compon ents funct ions
50     50  
51   /**   51   /**
52   * page cod e function   52   * page cod e function
53   */   53   */
54   function P ageCompPag eMainCode( )   54   function P ageCompPag eMainCode( )
55   {   55   {
56       global  $site;   56       global  $site;
57     57  
58       $ret =  '';   58       $ret =  '';
59       $en_in box_notify         =  getParam(" enable_inb ox_notify" );   59       $en_in box_notify         =  getParam(" enable_inb ox_notify" );
60       $en_de st_choice          =  getParam(" enable_msg _dest_choi ce");   60       $en_de st_choice          =  getParam(" enable_msg _dest_choi ce");
61       $free_ mode               =  getParam(  "free_mode " );   61       $free_ mode               =  getParam(  "free_mode " );
62     62  
63       $membe r['ID']            =  (int)$_COO KIE['membe rID'];   63       $membe r['ID']            =  (int)$_COO KIE['membe rID'];
64       $membe r['Passwor d']     =  $_COOKIE[' memberPass word'];   64       $membe r['Passwor d']     =  $_COOKIE[' memberPass word'];
65       $recip ientID             =  getID( $_R EQUEST['ID '], 0 );   65       $recip ientID             =  getID( $_R EQUEST['ID '], 0 );
66     66  
67       $recip ient = get ProfileInf o( $recipi entID );   67       $recip ient = get ProfileInf o( $recipi entID );
68          68       
69       $conta ct_allowed         =  contact_al lowed($mem ber['ID'],  $recipien tID);   69       $conta ct_allowed         =  contact_al lowed($mem ber['ID'],  $recipien tID);
70     70  
71       // Che ck if cred its could  be used fo r message  sending    
72       $could _use_credi ts = false ;    
73      
74       // Che ck if memb er can sen d messages   71       // Che ck if memb er can sen d messages
75       $check _res = che ckAction(  $member['I D'], ACTIO N_ID_SEND_ MESSAGE );   72       $check _res = che ckAction(  $member['I D'], ACTIO N_ID_SEND_ MESSAGE );
76       if ( $ check_res[ CHECK_ACTI ON_RESULT]  != CHECK_ ACTION_RES ULT_ALLOWE D   73       if ( $ check_res[ CHECK_ACTI ON_RESULT]  != CHECK_ ACTION_RES ULT_ALLOWE D
77            &&   !$co uld_use_cr edits   &&   !$co ntact_allo wed   )   74            &&   !$co
ntact_allo wed   )
78       {   75       {
79           $r et = '   76           $r et = '
80                <table w idth="100% " cellpadd ing="4" ce llspacing= "4" border ="0">   77                <table w idth="100% " cellpadd ing="4" ce llspacing= "4" border ="0">
81                    <tr>   78                    <tr>
82                         <td align= "center">'  . $check_ res[CHECK_ ACTION_MES SAGE] . '< /td>   79                         <td align= "center">'  . $check_ res[CHECK_ ACTION_MES SAGE] . '< /td>
83                    </tr >   80                    </tr >
84                </table> ';   81                </table> ';
85           re turn $ret;   82           re turn $ret;
86       }   83       }
87     84  
88       // Set  if credit s should b e used any way    
89       $must_ use_credit s = ($coul d_use_cred its && $ch eck_res[CH ECK_ACTION _RESULT] ! = CHECK_AC TION_RESUL T_ALLOWED) ;    
90      
91       //ob_s tart();   85       //ob_s tart();
92     86  
93       $ret =  '';   87       $ret =  '';
94     88  
95       if ( $ _POST['act ion'] == " send" && s trlen($_PO ST['text'] ) )   89       if ( $ _POST['act ion'] == " send" && s trlen($_PO ST['text'] ) )
96       {   90       {
97           $a ction_resu lt = "";   91           $a ction_resu lt = "";
98     92  
99           //  Check if  recipient  found   93           //  Check if  recipient  found
100           if ( !$recipi ent )   94           if ( !$recipi ent )
101           {   95           {
102                $ret = "   96                $ret = "
103                    <tab le width=\ "100%\" ce llpadding= \"4\" cell spacing=\" 4\" align= \"center\" >   97                    <tab le width=\ "100%\" ce llpadding= \"4\" cell spacing=\" 4\" align= \"center\" >
104                         <tr>   98                         <tr>
105                             <td al ign=center >". _t("_C OMPOSE_REJ ECT_MEMBER _NOT_FOUND ") ."</td>   99                             <td al ign=center >". _t("_C OMPOSE_REJ ECT_MEMBER _NOT_FOUND ") ."</td>
106                         </tr>   100                         </tr>
107                    </ta ble>\n";   101                    </ta ble>\n";
108                return $ ret;   102                return $ ret;
109           }   103           }
110     104  
111           //  Perform s ending   105           //  Perform s ending
112            $send_resu lt   =   MemberSend Message(   $member,   $recipient ,   $must_use_ credits   );   106            $send_resu lt   =   MemberSend Message(   $member,   $recipient  
);
113              107           
114           sw itch ( $se nd_result  )   108           sw itch ( $se nd_result  )
115           {   109           {
116                case 1:   110                case 1:
117                    $act ion_result  .= _t_err ( "_FAILED _TO_SEND_M ESSAGE" );   111                    $act ion_result  .= _t_err ( "_FAILED _TO_SEND_M ESSAGE" );
118                    $hid e_form = ' 0';   112                    $hid e_form = ' 0';
119                    brea k;   113                    brea k;
120                case 3:   114                case 3:
121                    $act ion_result  .= _t_err ( "_You ha ve to wait  for PERIO D minutes  before you  can write  another m essage!",  1 );   115                    $act ion_result  .= _t_err ( "_You ha ve to wait  for PERIO D minutes  before you  can write  another m essage!",  1 );
122                    $hid e_form = ' 1';   116                    $hid e_form = ' 1';
123                    brea k;   117                    brea k;
124                case 5:   118                case 5:
125                    $act ion_result  .= _t_err ( "_FAILED _TO_SEND_M ESSAGE_BLO CK" );   119                    $act ion_result  .= _t_err ( "_FAILED _TO_SEND_M ESSAGE_BLO CK" );
126                    $hid e_form = ' 0';   120                    $hid e_form = ' 0';
127                    brea k;   121                    brea k;
128                case 10:   122                case 10:
129                    $act ion_result  .= _t_err ( "_FAILED _TO_SEND_M ESSAGE_NOT _ACTIVE" ) ;   123                    $act ion_result  .= _t_err ( "_FAILED _TO_SEND_M ESSAGE_NOT _ACTIVE" ) ;
130                    $hid e_form = ' 0';   124                    $hid e_form = ' 0';
131                    brea k;   125                    brea k;
132                case 21:    
133                    $act ion_result  .= _t_err ( "_FAILED _TO_SEND_M ESSAGE_NO_ CREDITS" ) ;    
134                    $hid e_form = ' 0';    
135                    brea k;    
136                default:   126                default:
137                    $act ion_result  .= _t_act ion( "_MES SAGE_SENT"  );   127                    $act ion_result  .= _t_act ion( "_MES SAGE_SENT"  );
138                    $hid e_form = ' 1';   128                    $hid e_form = ' 1';
139                    brea k;   129                    brea k;
140           }   130           }
141       }   131       }
142       $ret . = '<div cl ass="com_b ox"">';   132       $ret . = '<div cl ass="com_b ox"">';
143       if ( s trlen($act ion_result ) )   133       if ( s trlen($act ion_result ) )
144       {   134       {
145           $r et .= $act ion_result ;   135           $r et .= $act ion_result ;
146       }   136       }
147     137  
148     138  
149       if ( $ recipient  &&  $hide_ form != '1 ' )   139       if ( $ recipient  &&  $hide_ form != '1 ' )
150       {   140       {
151           $r et .= '<di v class="c lear_both" ></div>';   141           $r et .= '<di v class="c lear_both" ></div>';
152           $r et .= Prof ileDetails ( $recipie nt['ID'] ) ;   142           $r et .= Prof ileDetails ( $recipie nt['ID'] ) ;
153           $r et .= '<di v class="c lear_both" ></div>';   143           $r et .= '<di v class="c lear_both" ></div>';
154       }   144       }
155     145  
156       if( '1 ' != $hide _form )   146       if( '1 ' != $hide _form )
157       {   147       {
158           $s Subject =  (isset($_R EQUEST['su bject']))  ? 'Re: '.p rocess_db_ input($_RE QUEST['sub ject']) :  '';   148           $s Subject =  (isset($_R EQUEST['su bject']))  ? 'Re: '.p rocess_db_ input($_RE QUEST['sub ject']) :  '';
159           ob _start()   149           ob _start()
160              150           
161           ?>   151           ?>
162           <s cript type ="text/jav ascript">   152           <s cript type ="text/jav ascript">
163                <!--   153                <!--
164                function  changeDes t(control)   154                function  changeDes t(control)
165                {   155                {
166                    if (  control.v alue == 'l ovemail' )   156                    if (  control.v alue == 'l ovemail' )
167                    {   157                    {
168                         z = docume nt.getElem entById("i d0004");   158                         z = docume nt.getElem entById("i d0004");
169                         z.disabled  = false;   159                         z.disabled  = false;
170                    }   160                    }
171                    else   161                    else
172                    {   162                    {
173                         xxx = docu ment.getEl ementById( "id0004");   163                         xxx = docu ment.getEl ementById( "id0004");
174                         xxx.disabl ed = true;   164                         xxx.disabl ed = true;
175                    }   165                    }
176                }   166                }
177                   167                
178                function  checkForm ()   168                function  checkForm ()
179                {   169                {
180                    var  el;   170                    var  el;
181                    var  hasErr = f alse;   171                    var  hasErr = f alse;
182                    var  fild = "";   172                    var  fild = "";
183                    el =  document. getElement ById("inpS ubj");   173                    el =  document. getElement ById("inpS ubj");
184                    if(  el.value.l ength < 3  )   174                    if(  el.value.l ength < 3  )
185                    {   175                    {
186                         el.style.b ackgroundC olor = "pi nk";   176                         el.style.b ackgroundC olor = "pi nk";
187                         el.style.b order = "1 px solid s ilver";   177                         el.style.b order = "1 px solid s ilver";
188                         hasErr = t rue;   178                         hasErr = t rue;
189                         fild += "  <?= _t('_S ubject') ? >";   179                         fild += "  <?= _t('_S ubject') ? >";
190                    }   180                    }
191                    else   181                    else
192                         el.style.b ackgroundC olor = "#f ff";   182                         el.style.b ackgroundC olor = "#f ff";
193                       183                    
194                    if ( hasErr)   184                    if ( hasErr)
195                    {   185                    {
196                         alert( "<? = _t('_ple ase_fill_n ext_fields _first') ? >!" + fild  )   186                         alert( "<? = _t('_ple ase_fill_n ext_fields _first') ? >!" + fild  )
197                         return fal se;   187                         return fal se;
198                    }   188                    }
199                    else   189                    else
200                    {   190                    {
201                         return tru e;   191                         return tru e;
202                    }   192                    }
203                    retu rn false;   193                    retu rn false;
204                }   194                }
205                //-->   195                //-->
206           </ script>   196           </ script>
207              197           
208           <f orm name=" compose_fo rm" method ="post"   198           <f orm name=" compose_fo rm" method ="post"
209              action="<? = $_SERVER ['PHP_SELF '] . ( $re cipient ?  "?ID={$rec ipient['ID ']}" : ""  ) ?>" onsu bmit="retu rn checkFo rm();">   199              action="<? = $_SERVER ['PHP_SELF '] . ( $re cipient ?  "?ID={$rec ipient['ID ']}" : ""  ) ?>" onsu bmit="retu rn checkFo rm();">
210                <table c lass="comp oseTable">   200                <table c lass="comp oseTable">
211                    <tr>   201                    <tr>
212           <?   202           <?
213           if  ( !$recip ient )   203           if  ( !$recip ient )
214           {   204           {
215                ?>   205                ?>
216                         <td class= "form_labe l"><?= _t(  "_SEND_MS G_TO" )?>< /td>   206                         <td class= "form_labe l"><?= _t(  "_SEND_MS G_TO" )?>< /td>
217                         <td class= "form_valu e">   207                         <td class= "form_valu e">
218                             <input  class="in pMessageTo " type="te xt" name=" ID" />   208                             <input  class="in pMessageTo " type="te xt" name=" ID" />
219                         </td>   209                         </td>
220                    </tr >   210                    </tr >
221                    <tr>   211                    <tr>
222                <?   212                <?
223           }   213           }
224           ?>   214           ?>
225                         <td class= "form_labe l"><?= _t( '_Subject' ) ?>:</td>   215                         <td class= "form_labe l"><?= _t( '_Subject' ) ?>:</td>
226                         <td class= "form_valu e">   216                         <td class= "form_valu e">
227                             <input  class="in pSubj" id= "inpSubj"  name="mes_ subject" t ype="text"  value="<? = $sSubjec t; ?>" />   217                             <input  class="in pSubj" id= "inpSubj"  name="mes_ subject" t ype="text"  value="<? = $sSubjec t; ?>" />
228                         </td>   218                         </td>
229                    </tr >   219                    </tr >
230                    <tr>   220                    <tr>
231                         <td class= "form_labe l"><?= _t(  "_Message  text" ) ? >:</td>   221                         <td class= "form_labe l"><?= _t(  "_Message  text" ) ? >:</td>
232                         <td class= "form_valu e">   222                         <td class= "form_valu e">
233                             <texta rea class= "blogText"  id="blogT ext" name= "text"></t extarea>   223                             <texta rea class= "blogText"  id="blogT ext" name= "text"></t extarea>
234                         </td>   224                         </td>
235                    </tr >   225                    </tr >
236           <?   226           <?
237              227           
238           if  ( $_POST[ 'notify']  == 'on' )   228           if  ( $_POST[ 'notify']  == 'on' )
239                $notify_ sel = "che cked";   229                $notify_ sel = "che cked";
240           el se   230           el se
241                $notify_ sel = "";   231                $notify_ sel = "";
242     232  
243           sw itch( $_PO ST['sendto '] )   233           sw itch( $_PO ST['sendto '] )
244           {   234           {
245                case 'em ail':   235                case 'em ail':
246                    $ema il_sel = '  checked=" checked" ' ;   236                    $ema il_sel = '  checked=" checked" ' ;
247                    $lov email_sel  = "";   237                    $lov email_sel  = "";
248                    $bot h_sel = "" ;   238                    $bot h_sel = "" ;
249                    brea k;   239                    brea k;
250                case 'lo vemail':   240                case 'lo vemail':
251                    $ema il_sel = " ";   241                    $ema il_sel = " ";
252                    $lov email_sel  = ' checke d="checked "';   242                    $lov email_sel  = ' checke d="checked "';
253                    $bot h_sel = "" ;   243                    $bot h_sel = "" ;
254                    brea k;   244                    brea k;
255                default:   245                default:
256                    $ema il_sel = " ";   246                    $ema il_sel = " ";
257                    $lov email_sel  = "";   247                    $lov email_sel  = "";
258                    $bot h_sel = '  checked="c hecked"';   248                    $bot h_sel = '  checked="c hecked"';
259                    brea k;   249                    brea k;
260           }   250           }
261     251  
262     252  
263     253  
264           if  ( 'on' ==  $en_dest_ choice )   254           if  ( 'on' ==  $en_dest_ choice )
265           {   255           {
266                $javascr ipt = ( $e n_inbox_no tify ? ""  : "onClick =\"javascr ipt: chang eDest(this );\"" );   256                $javascr ipt = ( $e n_inbox_no tify ? ""  : "onClick =\"javascr ipt: chang eDest(this );\"" );
267                   257                
268                $notify_ dis = "";   258                $notify_ dis = "";
269                if ( !$l ovemail_se l && $en_d est_choice  )   259                if ( !$l ovemail_se l && $en_d est_choice  )
270                {   260                {
271                    $not ify_sel =  "";   261                    $not ify_sel =  "";
272                    $not ify_dis =  ' disabled ="disabled "';   262                    $not ify_dis =  ' disabled ="disabled "';
273                }   263                }
274                   264                
275                ?>   265                ?>
276                    <tr>   266                    <tr>
277                         <td>&nbsp; </td>   267                         <td>&nbsp; </td>
278                         <td nowrap ="nowrap">   268                         <td nowrap ="nowrap">
279                             <input  type="rad io" id="id 0001" name ="sendto"  value="ema il"  <?= $ javascript  . $email_ sel ?> />   269                             <input  type="rad io" id="id 0001" name ="sendto"  value="ema il"  <?= $ javascript  . $email_ sel ?> />
280                             <label  for="id00 01"><?= _t ( "_Send t o e-mail"  )?></label >   270                             <label  for="id00 01"><?= _t ( "_Send t o e-mail"  )?></label >
281                         </td>   271                         </td>
282                    </tr >   272                    </tr >
283                    <tr>   273                    <tr>
284                         <td>&nbsp; </td>   274                         <td>&nbsp; </td>
285                         <td>   275                         <td>
286                             <input  type="rad io" id="id 0002" name ="sendto"  value="lov email" <?=  $javascri pt . $love mail_sel ? > />   276                             <input  type="rad io" id="id 0002" name ="sendto"  value="lov email" <?=  $javascri pt . $love mail_sel ? > />
287                             <label  for="id00 02"><?= _t ( "_Send t o communic ator" ) ?> </label>   277                             <label  for="id00 02"><?= _t ( "_Send t o communic ator" ) ?> </label>
288                                278                             
289                             <input  type="che ckbox" id= "id0004" n ame="notif y" <?= $no tify_sel   . $notify_ dis ?> />   279                             <input  type="che ckbox" id= "id0004" n ame="notif y" <?= $no tify_sel   . $notify_ dis ?> />
290                             <label  for="id00 04"><?=  _ t( "_Notif y by e-mai l" ) ?></l abel>   280                             <label  for="id00 04"><?=  _ t( "_Notif y by e-mai l" ) ?></l abel>
291                         </td>   281                         </td>
292                    </tr >   282                    </tr >
293                    <tr>   283                    <tr>
294                         <td>&nbsp; </td>   284                         <td>&nbsp; </td>
295                         <td nowrap ="nowrap"  colspan="3 " align="l eft" style ="padding- left:5px;" >   285                         <td nowrap ="nowrap"  colspan="3 " align="l eft" style ="padding- left:5px;" >
296                             <input  type="rad io" id="id 0003" name ="sendto"  value="bot h" <?= $ja vascript .   $both_se l ?> />   286                             <input  type="rad io" id="id 0003" name ="sendto"  value="bot h" <?= $ja vascript .   $both_se l ?> />
297                             <label  for=id000 3> <?= _t(  "_both2"  ) ?></labe l>   287                             <label  for=id000 3> <?= _t(  "_both2"  ) ?></labe l>
298                         </td>   288                         </td>
299                    </tr >   289                    </tr >
300                <?   290                <?
301           }   291           }
302           el se   292           el se
303           {   293           {
304                ?>   294                ?>
305                    <inp ut type="h idden" nam e="sendto"  value="lo vemail" />   295                    <inp ut type="h idden" nam e="sendto"  value="lo vemail" />
306                <?   296                <?
307           }   297           }
308           ?>   298           ?>
309                    <tr>   299                    <tr>
310                         <td colspa n="2" clas s="form_co lspan">   300                         <td colspa n="2" clas s="form_co lspan">
311                             <input  class="bu tton" type ="submit"  value=" <? =_t( "_Sen d" ) ?>" / >   301                             <input  class="bu tton" type ="submit"  value=" <? =_t( "_Sen d" ) ?>" / >
312                         </td>   302                         </td>
313                    </tr >   303                    </tr >
314                </table>   304                </table>
315                <input t ype="hidde n" name="a ction" val ue="send"  />   305                <input t ype="hidde n" name="a ction" val ue="send"  />
316           </ form>   306           </ form>
317              307           
318           <?   308           <?
319           $r et .= ob_g et_clean() ;   309           $r et .= ob_g et_clean() ;
320       }   310       }
321       else   311       else
322       {   312       {
323           $r et .= '<di v style="m argin:15px  0px; text -align:cen ter;">' .  _t('_to_co mpose_new_ message',  $recipient ['NickName '], $recip ient['ID'] , $site['u rl'] ) . ' </div>';   313           $r et .= '<di v style="m argin:15px  0px; text -align:cen ter;">' .  _t('_to_co mpose_new_ message',  $recipient ['NickName '], $recip ient['ID'] , $site['u rl'] ) . ' </div>';
324       }   314       }
325       $ret . = '</div>' ;   315       $ret . = '</div>' ;
326     316  
327     317  
328       return  $ret;   318       return  $ret;
329   }   319   }
330     320  
331   /**   321   /**
332    * Send me ssage   322    * Send me ssage
333    */   323    */
334   function   MemberSend Message(   $member,   $recipient ,   $must_use_ credits   =   false   )   324   function   MemberSend Message(   $member,   $recipient  
)
335   {   325   {
336       global  $site;   326       global  $site;
337     327  
338       $en_de st_choice      = getP aram( "ena ble_msg_de st_choice"  );   328       $en_de st_choice      = getP aram( "ena ble_msg_de st_choice"  );
339       $max_m essage_siz e   = getP aram( "max _inbox_mes sage_size"  );   329       $max_m essage_siz e   = getP aram( "max _inbox_mes sage_size"  );
340       $max_m essages        = getP aram( "max _inbox_mes sages" );   330       $max_m essages        = getP aram( "max _inbox_mes sages" );
341     331  
342       // Che ck if reci pient is a ctive   332       // Che ck if reci pient is a ctive
343       if( 'A ctive' !=  $recipient ['Status']  )   333       if( 'A ctive' !=  $recipient ['Status']  )
344       {   334       {
345           re turn 10;   335           re turn 10;
346       }   336       }
347     337  
348       // Che ck if memb er is bloc ked   338       // Che ck if memb er is bloc ked
349       if ( d b_arr( "SE LECT `ID`,  `Profile`  FROM `Blo ckList` WH ERE `Profi le` = {$me mber['ID'] } AND `ID`  = '{$reci pient['ID' ]}';" ) )   339       if ( d b_arr( "SE LECT `ID`,  `Profile`  FROM `Blo ckList` WH ERE `Profi le` = {$me mber['ID'] } AND `ID`  = '{$reci pient['ID' ]}';" ) )
350       {   340       {
351           re turn 5;   341           re turn 5;
352       }   342       }
353     343  
354       // If  must use c redits the n check fo r enough a mount    
355       if ( $ must_use_c redits &&  getProfile Credits( $ member['ID '] ) < (fl oat)$msg_c redits )    
356       {    
357           re turn 21;    
358       }    
359      
360   // antispa m ))   344   // antispa m ))
361       if ( d b_arr("SEL ECT `ID` F ROM `Messa ges` WHERE  `Sender`  = {$member [ID]} AND  date_add(` Date`, INT ERVAL 1 MI NUTE) > No w()") )   345       if ( d b_arr("SEL ECT `ID` F ROM `Messa ges` WHERE  `Sender`  = {$member [ID]} AND  date_add(` Date`, INT ERVAL 1 MI NUTE) > No w()") )
362       {   346       {
363           re turn 3;   347           re turn 3;
364       }   348       }
365     349  
366     350  
367       // Get  sender in fo   351       // Get  sender in fo
368       $sende r = getPro fileInfo(  $member['I D'] );   352       $sende r = getPro fileInfo(  $member['I D'] );
369     353  
370       $aPlus  = array() ;   354       $aPlus  = array() ;
371       $aPlus ['ProfileR eference']  = $sender  ? '<a hre f="' . get ProfileLin k($member[ 'ID']) . ' ">' . $sen der['NickN ame'] . '< /a> (' . g etProfileL ink($membe r['ID']) .  ') ' : '< b>'. _t("_ Visitor")  .'</b>';   355       $aPlus ['ProfileR eference']  = $sender  ? '<a hre f="' . get ProfileLin k($member[ 'ID']) . ' ">' . $sen der['NickN ame'] . '< /a> (' . g etProfileL ink($membe r['ID']) .  ') ' : '< b>'. _t("_ Visitor")  .'</b>';
372     356  
373       // Don 't send no tification  if messag e is sendi ng to emai l   357       // Don 't send no tification  if messag e is sendi ng to emai l
374       if ( $ _POST['not ify'] && ! ($_POST['s endto'] ==  "email" | | $_POST[' sendto'] = = "both")  )   358       if ( $ _POST['not ify'] && ! ($_POST['s endto'] ==  "email" | | $_POST[' sendto'] = = "both")  )
375       {   359       {
376           $m essage_tex t = getPar am("t_Comp ose");   360           $m essage_tex t = getPar am("t_Comp ose");
377           $s ubject = g etParam('t _Compose_s ubject');   361           $s ubject = g etParam('t _Compose_s ubject');
378     362  
379           $a Plus['send erNickName '] = $send er ? $send er['NickNa me'] : _t( "_Visitor" );   363           $a Plus['send erNickName '] = $send er ? $send er['NickNa me'] : _t( "_Visitor" );
380     364  
381           $n otify_res  = sendMail ( $recipie nt['Email' ], $subjec t, $messag e_text, $r ecipient[' ID'], $aPl us );   365           $n otify_res  = sendMail ( $recipie nt['Email' ], $subjec t, $messag e_text, $r ecipient[' ID'], $aPl us );
382     366  
383           if  ( !$notif y_res )   367           if  ( !$notif y_res )
384                echo "<d iv class=\ "err\">".  _t("_Notif ication se nd failed" ) ."</div> <br />\n";   368                echo "<d iv class=\ "err\">".  _t("_Notif ication se nd failed" ) ."</div> <br />\n";
385       }   369       }
386     370  
387       // Sen d message  to email   371       // Sen d message  to email
388       if ( $ en_dest_ch oice && ($ _POST['sen dto'] == " email" ||  $_POST['se ndto'] ==  "both") )   372       if ( $ en_dest_ch oice && ($ _POST['sen dto'] == " email" ||  $_POST['se ndto'] ==  "both") )
389       {   373       {
390           $m essage_tex t = getPar am("t_Mess age");   374           $m essage_tex t = getPar am("t_Mess age");
391           $s ubject       = proces s_pass_dat a( $_POST[ 'mes_subje ct'] );   375           $s ubject       = proces s_pass_dat a( $_POST[ 'mes_subje ct'] );
392     376  
393           $a Plus['Mess ageText']  = strmaxte xtlen( cle ar_xss( re place_full _uris( pro cess_pass_ data( $_PO ST['text']  ) ) ), $m ax_message _size);   377           $a Plus['Mess ageText']  = strmaxte xtlen( cle ar_xss( re place_full _uris( pro cess_pass_ data( $_PO ST['text']  ) ) ), $m ax_message _size);
394              378           
395           $r esult = se ndMail( $r ecipient[' Email'], $ subject, $ message_te xt, $recip ient['ID'] , $aPlus ) ;   379           $r esult = se ndMail( $r ecipient[' Email'], $ subject, $ message_te xt, $recip ient['ID'] , $aPlus ) ;
396       }   380       }
397     381  
398       // Sen d message  to communi cator   382       // Sen d message  to communi cator
399       if ( $ _POST['sen dto'] == " lovemail"  || $_POST[ 'sendto']  == "both"  )   383       if ( $ _POST['sen dto'] == " lovemail"  || $_POST[ 'sendto']  == "both"  )
400       {   384       {
401           //  Restrict  with total  messages  count   385           //  Restrict  with total  messages  count
402           $m essages_co unt = db_a rr( "SELEC T COUNT(*)  AS `mess_ count` FRO M `Message s` WHERE ` Recipient`  = '{$reci pient['ID' ]}'" );   386           $m essages_co unt = db_a rr( "SELEC T COUNT(*)  AS `mess_ count` FRO M `Message s` WHERE ` Recipient`  = '{$reci pient['ID' ]}'" );
403           $m essages_co unt = $mes sages_coun t['mess_co unt'];   387           $m essages_co unt = $mes sages_coun t['mess_co unt'];
404           if  ( ($messa ges_count  - 1) > $ma x_messages  )   388           if  ( ($messa ges_count  - 1) > $ma x_messages  )
405           {   389           {
406                $del_res  = db_res(  "SELECT ` ID` FROM ` Messages`  WHERE `Rec ipient` =  '{$recipie nt['ID']}'  ORDER BY  `Date` ASC  LIMIT ".  ($messages _count - $ max_messag es + 1) );   390                $del_res  = db_res(  "SELECT ` ID` FROM ` Messages`  WHERE `Rec ipient` =  '{$recipie nt['ID']}'  ORDER BY  `Date` ASC  LIMIT ".  ($messages _count - $ max_messag es + 1) );
407                while (  $del_arr =  mysql_fet ch_array($ del_res) )   391                while (  $del_arr =  mysql_fet ch_array($ del_res) )
408                    db_r es( "DELET E FROM `Me ssages` WH ERE `ID` =  {$del_arr ['ID']}" ) ;   392                    db_r es( "DELET E FROM `Me ssages` WH ERE `ID` =  {$del_arr ['ID']}" ) ;
409           }   393           }
410     394  
411           //  Insert me ssage into  database   395           //  Insert me ssage into  database
412           $m essage_tex t    = str maxtextlen ( addslash es( clear_ xss( proce ss_pass_da ta( $_POST ['text'] )  ) ), $max _message_s ize );   396           $m essage_tex t    = str maxtextlen ( addslash es( clear_ xss( proce ss_pass_da ta( $_POST ['text'] )  ) ), $max _message_s ize );
413           $m essage_sub ject = str maxwordlen ( process_ db_input(  $_POST['me s_subject' ] ), 30);   397           $m essage_sub ject = str maxwordlen ( process_ db_input(  $_POST['me s_subject' ] ), 30);
414           $r esult = db _res( "INS ERT INTO ` Messages`  ( `Date`,  `Sender`,  `Recipient `, `Text`,  `Subject` , `New` )  VALUES ( N OW(), {$me mber['ID'] }, {$recip ient['ID'] }, '$messa ge_text',  '$message_ subject',  '1' )" );   398           $r esult = db _res( "INS ERT INTO ` Messages`  ( `Date`,  `Sender`,  `Recipient `, `Text`,  `Subject` , `New` )  VALUES ( N OW(), {$me mber['ID'] }, {$recip ient['ID'] }, '$messa ge_text',  '$message_ subject',  '1' )" );
415       }   399       }
416     400  
417       // If  sending su ccessful t hen mark a s performe d action   401       // If  sending su ccessful t hen mark a s performe d action
418       if ( $ result )   402       if ( $ result )
419       {   403       {
420           ch eckAction(  $member[' ID'], ACTI ON_ID_SEND _MESSAGE,  true );   404           ch eckAction(  $member[' ID'], ACTI ON_ID_SEND _MESSAGE,  true );
421           if  ( $must_u se_credits  )    
422                decProfi leCredits(  $member[' ID'], $msg _credits ) ;    
423       }   405       }
424       else   406       else
425           re turn 1;   407           re turn 1;
426     408  
427       return  0;   409       return  0;
428     410  
429   }   411   }
430   ?>   412   ?>