diff --git a/e107_core/shortcodes/batch/comment_shortcodes.php b/e107_core/shortcodes/batch/comment_shortcodes.php index 304638ba1..560cc7713 100644 --- a/e107_core/shortcodes/batch/comment_shortcodes.php +++ b/e107_core/shortcodes/batch/comment_shortcodes.php @@ -20,120 +20,125 @@ if (!defined('e107_INIT')) { exit; } class comment_shortcodes extends e_shortcode { var $var; - - function sc_subject_input($parm='') + + function sc_subject_input($parm = '') { $tp = e107::getParser(); $pref = e107::getPref(); - + $form = e107::getForm(); + if(vartrue($pref['nested_comments'])) { - return ""; + $options = array( + 'class' => 'comment subject-input form-control', + 'placeholder' => COMLAN_324, + 'size' => 61, + ); + + $text = '
'; + $text .= $form->text('subject', $tp->toForm($this->var['subject']), 100, $options); + $text .= '
'; + + return $text; } - - return; } - - + + function sc_subject($parm='') { $tp = e107::getParser(); $pref = e107::getPref(); global $SUBJECT, $NEWIMAGE; - - if (vartrue($pref['nested_comments'])) + + if (vartrue($pref['nested_comments'])) { - $SUBJECT = $NEWIMAGE." ".(empty($this->var['comment_subject']) ? $subject : $tp->toHTML($this->var['comment_subject'], TRUE)); + $SUBJECT = $NEWIMAGE." ".(empty($this->var['comment_subject']) ? $SUBJECT : $tp->toHTML($this->var['comment_subject'], TRUE)); } else { $SUBJECT = ''; } - + return $SUBJECT; - + } - - + + function sc_username($parm='') - { + { global $USERNAME; - if (isset($this->var['comment_author_id']) && $this->var['comment_author_id']) + if (isset($this->var['comment_author_id']) && $this->var['comment_author_id']) { - $USERNAME = $parm == 'raw' ? $this->var['comment_author_name'] : " $this->var['comment_author_id'], 'name' => $this->var['comment_author_name']))."'>".$this->var['comment_author_name']."\n"; + $USERNAME = $parm == 'raw' ? $this->var['comment_author_name'] : " $this->var['comment_author_id'], 'name' => $this->var['comment_author_name']))."'>".$this->var['comment_author_name']."\n"; } else { - $this->var['user_id'] = 0; - $USERNAME = preg_replace("/[0-9]+\./", '', vartrue($this->var['comment_author_name'])); - $USERNAME = str_replace("Anonymous", LAN_ANONYMOUS, $USERNAME); + $this->var['user_id'] = 0; + $USERNAME = preg_replace("/[0-9]+\./", '', vartrue($this->var['comment_author_name'])); + $USERNAME = str_replace("Anonymous", LAN_ANONYMOUS, $USERNAME); } return $USERNAME; } - - - function sc_timedate($parm='') - { + + + function sc_timedate($parm='') + { if($parm == 'relative') { - return e107::getDate()->computeLapse($this->var['comment_datestamp'],time(),false, false, 'short'); + return e107::getDate()->computeLapse($this->var['comment_datestamp'],time(),false, false, 'short'); } - + return e107::getDate()->convert_date($this->var['comment_datestamp'], "short"); } - - - function sc_reply($parm='') + + + function sc_reply($parm='') { global $REPLY, $action, $table, $id, $thisaction, $thistable, $thisid; - + $pref = e107::getPref(); $REPLY = ''; if($this->var['comment_lock'] != "1" && $this->var['comment_blocked'] < 1) { - if ($thisaction == "comment" && $pref['nested_comments']) + if ($thisaction == "comment" && $pref['nested_comments']) { $REPLY = "".COMLAN_326.""; } } return $REPLY; } - - - - function sc_comment_avatar($parm='') + + + function sc_comment_avatar($parm = '') { - $tp = e107::getParser(); - - // return $this->var['user_image']; - // $url = $tp->thumbUrl($this->var['user_image']); - // $text = $tp->parseTemplate("{USER_AVATAR=".vartrue($this->var['user_image'],USERIMAGE)."}"); - // $text = $tp->parseTemplate("{USER_AVATAR=".$this->var['user_id']."}"); - - $text = $tp->toAvatar($this->var); - - $text .= ""; - return $text; - } - - - - - function sc_avatar($parm='') + $tp = e107::getParser(); + + // return $this->var['user_image']; + // $url = $tp->thumbUrl($this->var['user_image']); + // $text = $tp->parseTemplate("{USER_AVATAR=".vartrue($this->var['user_image'],USERIMAGE)."}"); + // $text = $tp->parseTemplate("{USER_AVATAR=".$this->var['user_id']."}"); + + $text = $tp->toAvatar($this->var); + + $text .= ''; + + return $text; + } + + + function sc_avatar($parm='') { - return $this->sc_comment_avatar($parm); - + return $this->sc_comment_avatar($parm); + // --------- Legacy Code for reference - + /* global $AVATAR; if (isset($this->var['user_id']) && $this->var['user_id']) { @@ -150,18 +155,18 @@ class comment_shortcodes extends e_shortcode return $this->var['user_image']; */ - + } - - - function sc_comments($parm='') + + + function sc_comments($parm='') { global $COMMENTS; return (isset($this->var['user_id']) && $this->var['user_id'] ? LAN_COMMENTS.": ".$this->var['user_comments'] : COMLAN_194)."
"; } - - - function sc_joined($parm='') + + + function sc_joined($parm='') { global $JOINED, $gen; $JOINED = ''; @@ -171,26 +176,27 @@ class comment_shortcodes extends e_shortcode } return $JOINED; } - - + + function sc_comment_itemid($parm='') // for ajax item id. { - return 'comment-'.intval($this->var['comment_id']); + return 'comment-'.intval($this->var['comment_id']); } - + + function sc_comment_moderate($parm='') { if(!getperms('0') && !getperms("B")) { - return; + return; } - + // TODO put into a