e107 = e107::getInstance(); } public function sc_pm_form_touser() { if(vartrue($this->pmInfo['from_name'])) { return "{$this->pmInfo['from_name']}"; } require_once(e_HANDLER.'user_select_class.php'); $us = new user_select; $type = ($this->pmPrefs['dropdown'] == TRUE ? 'list' : 'popup'); if(check_class($this->pmPrefs['multi_class'])) { $ret = $us->select_form($type, 'textarea.pm_to', '', $this->pmPrefs['pm_class']); } else { $ret = $us->select_form($type, 'pm_to', '', $this->pmPrefs['pm_class']); } return $ret; } public function sc_pm_form_toclass() { if(vartrue($this->pmInfo['from_name'])) { return ''; } if(check_class($this->pmPrefs['opt_userclass']) && check_class($this->pmPrefs['multi_class'])) { $ret = "".LAN_PM_4." "; require_once(e_HANDLER.'userclass_class.php'); $args = (ADMIN ? 'admin, classes' : 'classes, matchclass'); if(check_class($this->pmPrefs['sendall_class'])) { $args = 'member, '.$args; } $ret .= e107::getUserClass()->uc_dropdown('pm_userclass', '', $args); if (strpos($ret,'option') === FALSE) $ret = ''; } return $ret; } public function sc_pm_form_subject() { $value = ''; if(vartrue($this->pmInfo['pm_subject'])) { $value = $this->pmInfo['pm_subject']; if(substr($value, 0, strlen(LAN_PM_58)) != LAN_PM_58) { $value = LAN_PM_58.$value; } } return ""; } public function sc_pm_form_message() { $value = ''; if(vartrue($this->pmInfo['pm_text'])) { if(isset($_POST['quote'])) { $t = time(); $value = "[quote{$t}={$this->pmInfo['from_name']}]\n{$this->pmInfo['pm_text']}\n[/quote{$t}]\n\n"; } } return ""; } public function sc_pm_emotes() { require_once(e_HANDLER.'emote.php'); return r_emote(); } public function sc_pm_post_button() { return ""; } public function sc_pm_preview_button() { return ""; } public function sc_pm_attachment() { if (check_class($this->pmPrefs['attach_class'])) { $ret = "
"; return $ret; } return ''; } public function sc_pm_attachment_icon() { if($this->pmInfo['pm_attachments'] != "") { return ATTACHMENT_ICON; } } public function sc_pm_attachments() { if($this->pmInfo['pm_attachments'] != '') { $attachments = explode(chr(0), $this->pmInfo['pm_attachments']); $i = 0; foreach($attachments as $a) { list($timestamp, $fromid, $rand, $filename) = explode("_", $a, 4); $ret .= "{$filename}
"; $i++; } $ret = substr($ret, 0, -3); return $ret; } } public function sc_pm_receipt() { if (check_class($this->pmPrefs['receipt_class'])) { return "".LAN_PM_10; } return ''; } public function sc_pm_inbox_total() { $pm_inbox = $this->pmManager->pm_getInfo('inbox'); return intval($pm_inbox['inbox']['total']); } public function sc_pm_inbox_unread() { $pm_inbox = $this->pmManager->pm_getInfo('inbox'); return intval($pm_inbox['inbox']['unread']); } public function sc_pm_inbox_filled() { $pm_inbox = $this->pmManager->pm_getInfo('inbox'); return (intval($pm_inbox['inbox']['filled']) > 0 ? $pm_inbox['inbox']['filled'] : ''); } public function sc_pm_outbox_total() { $pm_outbox = $this->pmManager->pm_getInfo('outbox'); return intval($pm_outbox['outbox']['total']); } public function sc_pm_outbox_unread() { $pm_outbox = $this->pmManager->pm_getInfo('outbox'); return intval($pm_outbox['outbox']['unread']); } public function sc_pm_outbox_filled() { $pm_outbox = $this->pmManager->pm_getInfo('outbox'); return (intval($pm_outbox['outbox']['filled']) > 0 ? $pm_outbox['outbox']['filled'] : ''); } public function sc_pm_date($parm = '') { require_once(e_HANDLER.'date_handler.php'); if('lapse' != $parm) { return convert::convert_date($this->pmInfo['pm_sent'], $parm); } else { return convert::computeLapse($this->pmInfo['pm_sent']); } } public function sc_pm_read($parm = '') { if($this->pmInfo['pm_read'] == 0) { return LAN_PM_27; } if($this->pmInfo['pm_read'] == 1) { return LAN_PM_28; } require_once(e_HANDLER.'date_handler.php'); if('lapse' != $parm) { return convert::convert_date($this->pmInfo['pm_read'], $parm); } else { return convert::computeLapse($this->pmInfo['pm_read']); } } public function sc_pm_from_to() { if($this->pmInfo['pm_from'] == USERID) { $ret = LAN_PM_2.':
'; $this->pmInfo['user_name'] = $this->pmInfo['sent_name']; $ret .= $this->e107->tp->parseTemplate("{PM_TO=link}"); } else { $ret = LAN_PM_31.':
'; $this->pmInfo['user_name'] = $this->pmInfo['from_name']; $ret .= $this->e107->tp->parseTemplate("{PM_FROM=link}"); } return $ret; } public function sc_pm_subject($parm = '') { $ret = $this->e107->tp->toHTML($this->pmInfo['pm_subject'], true, 'USER_TITLE'); $prm = explode(',',$parm); if('link' == $prm[0]) { $extra = ''; if (isset($prm[1])) $extra = '.'.$prm[1]; $ret = "".$ret.""; } return $ret; } public function sc_pm_from($parm = '') { if('link' == $parm) { return "{$this->pmInfo['user_name']}"; } else { return $this->pmInfo['user_name']; } } public function sc_pm_select() { return ""; } public function sc_pm_read_icon() { if($this->pmInfo['pm_read'] > 0 ) { return PM_READ_ICON; } else { return PM_UNREAD_ICON; } } public function sc_pm_avatar() { return $this->e107->tp->parseTemplate("{USER_AVATAR={$this->pmInfo['user_image']}}"); } public function sc_pm_block_user() { if(in_array($this->pmInfo['pm_from'], $this->pmBlocks)) { return "".LAN_PM_51.""; } else { return "".LAN_PM_50.""; } } public function sc_pm_delete($parm = '') { if($parm != '') { $extra = '.'.$parm; } else { $extra = '.'.($this->pmInfo['pm_from'] == USERID ? 'outbox' : 'inbox'); } return "".LAN_PM_52.""; } public function sc_pm_delete_selected() { return ""; } public function sc_pm_to($parm = '') { if(is_numeric($this->pmInfo['pm_to'])) { if('link' == $parm) { return "{$this->pmInfo['user_name']}"; } else { return $this->pmInfo['user_name']; } } else { return LAN_PM_63.' '.$this->pmInfo['pm_to']; } } public function sc_pm_message() { return $this->e107->tp->toHTML($this->pmInfo['pm_text'], true); } public function sc_pm_reply() { if($this->pmInfo['pm_to'] == USERID) { $ret = "
".LAN_PM_54."    
"; return $ret; } } public function sc_pm_send_pm_link() { $pm_outbox = $this->pmManager->pm_getInfo('outbox'); if($pm_outbox['outbox']['filled'] < 100) { $link = $this->e107->url->getUrl('pm','main',array('f' => 'send')); return "".PM_SEND_LINK.""; } return ''; } public function sc_pm_newpm_animate() { if($this->pmPrefs['animate']) { $pm_inbox = $this->pmManager->pm_getInfo('inbox'); if($pm_inbox['inbox']['new'] > 0) { return NEWPM_ANIMATION; } } return ''; } public function sc_pm_nextprev($parm = '') { return $this->e107->tp->parseTemplate("{NEXTPREV={$this->pmNextPrev['total']},{$this->pmPrefs['perpage']},{$this->pmNextPrev['start']},".e_SELF."?{$parm}.[FROM]}"); } public function sc_pm_blocked_senders_manage() { $count = $this->e107->sql->db_Count('private_msg_block', '(*)', 'WHERE `pm_block_to` = '.USERID); if (!$count) return ''; return LAN_PM_66; } public function sc_pm_blocked_select() { return ""; } public function sc_pm_blocked_user($parm = '') { if (!$this->pmBlocked['user_name']) { return LAN_PM_72; } if('link' == $parm) { return "{$this->pmBlocked['user_name']}"; } else { return $this->pmBlocked['user_name']; } } public function sc_pm_blocked_date($parm='') { require_once(e_HANDLER.'date_handler.php'); return convert::convert_date($this->pmBlocked['pm_block_datestamp'], $parm); } public function sc_pm_blocked_delete() { return "".LAN_PM_52.""; } public function sc_pm_delete_blocked_selected() { return ""; } } ?>