Advertisement:

Author Topic: Osclass PM plugin  (Read 270 times)

darasxx

  • Newbie
  • *
  • Posts: 2
Osclass PM plugin
« on: February 17, 2019, 04:55:36 am »
Hi everyone!

First of all sorry for my bad english if u don't understand something what i am writing that's because im not from england/USA so please don't be mad :)

The problem what i have is with plugin osclass PM, yes i know it's a little bit old and we have plenty plugins that kind on market but they are not free so i decided to try it, and if it will works I will work on it to customize it for my use. So plugin is attached in post so all of you can see it what's inside. The problem is when i send a PM to a user, for example to my other account i see it in inbox section but i cant read the message, after i click on title of message i get page not found. :( Can anyone plz help?

This is what is in messages php file that plugin claim to be missing.

BTW sending an message to admin works just fine, after login do admin pannel i can read all PM from users but not as user from another user

Quote
<?php if(osc_is_web_user_logged_in() ) {
   $pm_id = Params::getParam('message'); 
   switch(Params::getParam('box')) {
      case 'inbox':
         $pm = ModelPM::newInstance()->getRecipientMessage(osc_logged_user_id(), 1, 0, $pm_id );
         if($pm['recipNew'] == 1) {
            ModelPM::newInstance()->updateMessageAsRead($pm['pm_id']);
         }
      break;
      case 'outbox':
         $pm = ModelPM::newInstance()->getSenderMessage(osc_logged_user_id(), 1, $pm_id );
      break;
   }
   $words[] = array('
Quote
','
', '[quoteAuthor]','[/quoteAuthor]');
   $words[] = array('<div class="messQuote">','</div>', '<div class="quoteAuthor">','</div>');
   $message  = osc_mailBeauty($pm['pm_message'], $words) ;
?>
<div class="content user_account">
    <h2>
        <strong><?php echo __('Message: ', 'osclass_pm') . osc_highlight($pm['pm_subject'], 50); ?></strong>
    </h2>
    <div id="sidebar">
        <?php echo osc_private_user_menu(); ?>
    </div>
    <div id="main">
      <?php if(Params::getParam('box') == 'inbox') { ?>
         <a href="<?php echo osc_base_url(true) . '?page=custom&file=osclass_pm/user-inbox.php'; ?>">Back to inbox</a>
      <?php } elseif(Params::getParam('box') == 'outbox') { ?>
         <a href="<?php echo osc_base_url(true) . '?page=custom&file=osclass_pm/user-outbox.php'; ?>">Back to outbox</a>
      <?php } ?>
      <br />
      <br />
      <div class="pm_main">
         <div class="pm_author">
            <?php if($pm['sender_id'] != 0){
                     $user = User::newInstance()->findByPrimaryKey($pm['sender_id']);
                  } else { $user['s_name'] = pmAdmin();} ?>
            <span class="sender"><?php _e('Sender:','osclass_pm'); ?></span>
            <br />
            <span class="sender_name"><?php echo $user['s_name']; ?></span>
         </div>
         <div class="pm_message">
            <div class="pm_tools">
               <div class="pm_sub">
                  <span class="subject_pm"><?php echo $pm['pm_subject']; ?></span>
                  <br />
                  <?php if($pm['recip_id'] != 0){
                           $user = User::newInstance()->findByPrimaryKey($pm['recip_id']);
                        } else { $user['s_name'] = pmAdmin();} ?>
                  <?php echo __('Sent to: ','osclass_pm') . $user['s_name'] . ' ' . __('on: ','osclass_pm') . osc_format_date($pm['message_date']) . ', ' . osclass_pm_format_time($pm['message_date']); ?>
               </div>
               <ul class="reset pm_tool">
                  <li class="reply"><a href="<?php echo osc_base_url(true) . '?page=custom&file=osclass_pm/user-send.php&mType=reply&messId=' . $pm_id . '&userId=' . $pm['sender_id']; ?>" ><?php _e('Reply','osclass_pm'); ?></a></li>
                  <li class="quote"><a href="<?php echo osc_base_url(true) . '?page=custom&file=osclass_pm/user-send.php&mType=quote&messId=' . $pm_id . '&userId=' . $pm['sender_id']; ?>" ><?php _e('Quote','osclass_pm'); ?></a></li>
                  <li class="del"><a onclick="if (!confirm('<?php _e('Are you sure you want to delete this personal messages?','osclass_pm'); ?>')) return false;" href="<?php echo osc_base_url(true) . '?page=custom&file=osclass_pm/user-proc.php&pms=' . $pm['pm_id'] . '&option=delMessages&box=inbox'; ?>" ><?php _e('Delete','osclass_pm'); ?></a></li>
               </ul>             
            </div>
            <div class="pm_mess">
               <?php echo nl2br($message); ?>
            </div>
         </div>
      </div>
    </div>
</div>
<?php } else {
Session::newInstance()->_setReferer(osc_user_login_url() . '&http_referer=' . osc_base_url(true) . '?page=custom&file=osclass_pm/user-messages.php?message=' . Params::getParam('message') . '&box=' . Params::getParam('box') );
// HACK TO DO A REDIRECT ?>
       <script>location.href="<?php echo osc_user_login_url(); ?>"</script>
<?php } ?>
« Last Edit: February 17, 2019, 06:55:24 am by darasxx »

Resta

  • Sr. Member
  • ****
  • Posts: 345
Re: Osclass PM plugin
« Reply #1 on: February 19, 2019, 04:14:47 am »
Hi,

There may be a problem with your installation or something.  I installed it and tested it - seems to be working fine and shows message, sends replies, etc., but I think it is old and not supported anymore and I don't know if it is safe to use (many old plugins were not updated to DAO, was this updated?).

darasxx

  • Newbie
  • *
  • Posts: 2
Re: Osclass PM plugin
« Reply #2 on: February 19, 2019, 07:41:55 am »
Don't know :/ i found it here random on one of the topics