plugins/PrivateMessages.php
changeset 1081 745200a9cc2a
parent 960 e74741b8360b
child 1227 bdac73ed481e
equal deleted inserted replaced
1080:6358f769ecb1 1081:745200a9cc2a
    10 }
    10 }
    11 **!*/
    11 **!*/
    12 
    12 
    13 /*
    13 /*
    14  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
    14  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
    15  * Version 1.1.6 (Caoineag beta 1)
    15  * Copyright (C) 2006-2009 Dan Fuhry
    16  * Copyright (C) 2006-2008 Dan Fuhry
       
    17  *
    16  *
    18  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
    17  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
    19  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
    18  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
    20  *
    19  *
    21  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
    20  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
    81       ?>
    80       ?>
    82         <br />
    81         <br />
    83         <div class="tblholder"><table border="0" width="100%" cellspacing="1" cellpadding="4">
    82         <div class="tblholder"><table border="0" width="100%" cellspacing="1" cellpadding="4">
    84           <tr><th colspan="2"><?php echo $lang->get('privmsgs_lbl_message_from', array('sender' => htmlspecialchars($r['message_from']))); ?></th></tr>
    83           <tr><th colspan="2"><?php echo $lang->get('privmsgs_lbl_message_from', array('sender' => htmlspecialchars($r['message_from']))); ?></th></tr>
    85           <tr><td class="row1"><?php echo $lang->get('privmsgs_lbl_subject') ?></td><td class="row1"><?php echo $r['subject']; ?></td></tr>
    84           <tr><td class="row1"><?php echo $lang->get('privmsgs_lbl_subject') ?></td><td class="row1"><?php echo $r['subject']; ?></td></tr>
    86           <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>
    85           <tr><td class="row2"><?php echo $lang->get('privmsgs_lbl_date') ?></td><td class="row2"><?php echo enano_date(ED_DATE | ED_TIME, $r['date']); ?></td></tr>
    87           <tr><td class="row1"><?php echo $lang->get('privmsgs_lbl_message') ?></td><td class="row1"><?php echo RenderMan::render($r['message_text']);
    86           <tr><td class="row1"><?php echo $lang->get('privmsgs_lbl_message') ?></td><td class="row1"><?php echo RenderMan::render($r['message_text']);
    88           if ( $r['signature'] != '' )
    87           if ( $r['signature'] != '' )
    89           {
    88           {
    90             echo '<hr style="margin-left: 1em; width: 200px;" />';
    89             echo '<hr style="margin-left: 1em; width: 200px;" />';
    91             echo RenderMan::render($r['signature']);
    90             echo RenderMan::render($r['signature']);
   257         if ( ($r['message_to'] != $session->username && $r['message_from'] != $session->username ) || $r['folder_name'] == 'drafts' )
   256         if ( ($r['message_to'] != $session->username && $r['message_from'] != $session->username ) || $r['folder_name'] == 'drafts' )
   258         {
   257         {
   259           die_friendly($lang->get('etc_access_denied_short'), '<p>You are not authorized to view the contents of this message.</p>');
   258           die_friendly($lang->get('etc_access_denied_short'), '<p>You are not authorized to view the contents of this message.</p>');
   260         }
   259         }
   261         $subj = 'Re: ' . $r['subject'];
   260         $subj = 'Re: ' . $r['subject'];
   262         $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 ;-)
   261         $text = "\n\n\nOn " . enano_date(ED_DATE | ED_TIME, $r['date']) . ", " . $r['message_from'] . " wrote:\n> " . str_replace("\n", "\n> ", $r['message_text']); // Way less complicated than using a regex ;-)
   263         
   262         
   264         $tbuf = $text;
   263         $tbuf = $text;
   265         while( preg_match("/\n([\> ]*?)\> \>/", $text) )
   264         while( preg_match("/\n([\> ]*?)\> \>/", $text) )
   266         {
   265         {
   267           $text = preg_replace("/\n([\> ]*?)\> \>/", '\\1>>', $text);
   266           $text = preg_replace("/\n([\> ]*?)\> \>/", '\\1>>', $text);
   635               echo $r['subject'];
   634               echo $r['subject'];
   636               if ( $r['message_read'] == 0 )
   635               if ( $r['message_read'] == 0 )
   637               {
   636               {
   638                 echo '</b>';
   637                 echo '</b>';
   639               }
   638               }
   640               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>';
   639               echo '</a></td><td class="'.$cls.'">'.enano_date(ED_DATE | ED_TIME, $r['date']).'</td><td class="'.$cls.'" style="text-align: center;"><input name="marked_'.$r['message_id'].'" type="checkbox" /></td></tr>';
   641             }
   640             }
   642             $db->free_result();
   641             $db->free_result();
   643           }
   642           }
   644           echo '<tr>
   643           echo '<tr>
   645                   <th style="text-align: right;" colspan="4">
   644                   <th style="text-align: right;" colspan="4">