plugins/PrivateMessages.php
changeset 345 4ccdfeee9a11
parent 344 be6c5fdd9203
child 387 92664d2efab8
equal deleted inserted replaced
344:be6c5fdd9203 345:4ccdfeee9a11
    84       ?>
    84       ?>
    85         <br />
    85         <br />
    86         <div class="tblholder"><table border="0" width="100%" cellspacing="1" cellpadding="4">
    86         <div class="tblholder"><table border="0" width="100%" cellspacing="1" cellpadding="4">
    87           <tr><th colspan="2"><?php echo $lang->get('privmsgs_lbl_message_from', array('sender' => htmlspecialchars($r['message_from']))); ?></th></tr>
    87           <tr><th colspan="2"><?php echo $lang->get('privmsgs_lbl_message_from', array('sender' => htmlspecialchars($r['message_from']))); ?></th></tr>
    88           <tr><td class="row1"><?php echo $lang->get('privmsgs_lbl_subject') ?></td><td class="row1"><?php echo $r['subject']; ?></td></tr>
    88           <tr><td class="row1"><?php echo $lang->get('privmsgs_lbl_subject') ?></td><td class="row1"><?php echo $r['subject']; ?></td></tr>
    89           <tr><td class="row2"><?php echo $lang->get('privmsgs_lbl_date') ?></td><td class="row2"><?php echo date('M j, Y G:i', $r['date']); ?></td></tr>
    89           <tr><td class="row2"><?php echo $lang->get('privmsgs_lbl_date') ?></td><td class="row2"><?php echo enano_date('M j, Y G:i', $r['date']); ?></td></tr>
    90           <tr><td class="row1"><?php echo $lang->get('privmsgs_lbl_message') ?></td><td class="row1"><?php echo RenderMan::render($r['message_text']);
    90           <tr><td class="row1"><?php echo $lang->get('privmsgs_lbl_message') ?></td><td class="row1"><?php echo RenderMan::render($r['message_text']);
    91           if ( $r['signature'] != '' )
    91           if ( $r['signature'] != '' )
    92           {
    92           {
    93             echo '<hr style="margin-left: 1em; width: 200px;" />';
    93             echo '<hr style="margin-left: 1em; width: 200px;" />';
    94             echo RenderMan::render($r['signature']);
    94             echo RenderMan::render($r['signature']);
   260         if ( ($r['message_to'] != $session->username && $r['message_from'] != $session->username ) || $r['folder_name'] == 'drafts' )
   260         if ( ($r['message_to'] != $session->username && $r['message_from'] != $session->username ) || $r['folder_name'] == 'drafts' )
   261         {
   261         {
   262           die_friendly($lang->get('etc_access_denied_short'), '<p>You are not authorized to view the contents of this message.</p>');
   262           die_friendly($lang->get('etc_access_denied_short'), '<p>You are not authorized to view the contents of this message.</p>');
   263         }
   263         }
   264         $subj = 'Re: ' . $r['subject'];
   264         $subj = 'Re: ' . $r['subject'];
   265         $text = "\n\n\nOn " . date('M j, Y G:i', $r['date']) . ", " . $r['message_from'] . " wrote:\n> " . str_replace("\n", "\n> ", $r['message_text']); // Way less complicated than using a regex ;-)
   265         $text = "\n\n\nOn " . enano_date('M j, Y G:i', $r['date']) . ", " . $r['message_from'] . " wrote:\n> " . str_replace("\n", "\n> ", $r['message_text']); // Way less complicated than using a regex ;-)
   266         
   266         
   267         $tbuf = $text;
   267         $tbuf = $text;
   268         while( preg_match("/\n([\> ]*?)\> \>/", $text) )
   268         while( preg_match("/\n([\> ]*?)\> \>/", $text) )
   269         {
   269         {
   270           $text = preg_replace("/\n([\> ]*?)\> \>/", '\\1>>', $text);
   270           $text = preg_replace("/\n([\> ]*?)\> \>/", '\\1>>', $text);
   330           </tr>
   330           </tr>
   331           <tr>
   331           <tr>
   332             <td class="row1">
   332             <td class="row1">
   333               <?php echo $lang->get('privmsgs_lbl_message'); ?>
   333               <?php echo $lang->get('privmsgs_lbl_message'); ?>
   334             </td>
   334             </td>
   335             <td class="row1" style="width: 80%;">
   335             <td class="row1" style="min-width: 80%;">
   336               <?php
   336               <?php
   337                 if ( isset($_POST['_savedraft']) )
   337                 if ( isset($_POST['_savedraft']) )
   338                 {
   338                 {
   339                   $content = htmlspecialchars($_POST['message']);
   339                   $content = htmlspecialchars($_POST['message']);
   340                 }
   340                 }
   638               echo $r['subject'];
   638               echo $r['subject'];
   639               if ( $r['message_read'] == 0 )
   639               if ( $r['message_read'] == 0 )
   640               {
   640               {
   641                 echo '</b>';
   641                 echo '</b>';
   642               }
   642               }
   643               echo '</a></td><td class="'.$cls.'">'.date('M j, Y G:i', $r['date']).'</td><td class="'.$cls.'" style="text-align: center;"><input name="marked_'.$r['message_id'].'" type="checkbox" /></td></tr>';
   643               echo '</a></td><td class="'.$cls.'">'.enano_date('M j, Y G:i', $r['date']).'</td><td class="'.$cls.'" style="text-align: center;"><input name="marked_'.$r['message_id'].'" type="checkbox" /></td></tr>';
   644             }
   644             }
   645             $db->free_result();
   645             $db->free_result();
   646           }
   646           }
   647           echo '<tr>
   647           echo '<tr>
   648                   <th style="text-align: right;" colspan="4">
   648                   <th style="text-align: right;" colspan="4">