diff --git a/e107_plugins/comment_menu/comment_menu.php b/e107_plugins/comment_menu/comment_menu.php index 43ef759da..97ffb137b 100644 --- a/e107_plugins/comment_menu/comment_menu.php +++ b/e107_plugins/comment_menu/comment_menu.php @@ -22,10 +22,12 @@ if (!defined('e107_INIT')) require_once (e_PLUGIN."comment_menu/comment_menu_shortcodes.php"); $cobj = e107::getObject('comment'); -//require_once (e_HANDLER."comment_class.php"); -//$cobj = new comment; -if (file_exists(THEME."comment_menu_template.php")) +if (file_exists(THEME."templates/comment_menu/comment_menu_template.php")) +{ + require_once (THEME."templates/comment_menu/comment_menu_template.php"); +} +elseif (file_exists(THEME."comment_menu_template.php")) { require_once (THEME."comment_menu_template.php"); } diff --git a/e107_plugins/comment_menu/comment_menu_shortcodes.php b/e107_plugins/comment_menu/comment_menu_shortcodes.php index 5aff2eeab..dfa859337 100644 --- a/e107_plugins/comment_menu/comment_menu_shortcodes.php +++ b/e107_plugins/comment_menu/comment_menu_shortcodes.php @@ -44,15 +44,29 @@ class comment_menu_shortcodes extends e_shortcode return e107::getParser()->toDate($this->var['comment_datestamp'], "relative"); } - function sc_cm_heading() + function sc_cm_heading($parm=null) { - return $this->var['comment_title']; + if(!empty($parm['limit'])) // new v2.1.5 + { + $text = e107::getParser()->text_truncate($this->var['comment_title'], $parm['limit']); + } + else + { + $text = $this->var['comment_title']; + } + + return e107::getParser()->toHtml($text,false,'TITLE'); } function sc_cm_url_pre() { return ($this->var['comment_url'] ? "" : ""); } + + function sc_cm_url() // new v2.1.5 + { + return (!empty($this->var['comment_url'])) ? $this->var['comment_url'] : '#'; + } function sc_cm_url_post() { @@ -69,18 +83,25 @@ class comment_menu_shortcodes extends e_shortcode return $this->var['comment_author']; } - function sc_cm_author_avatar($parm=null) + function sc_cm_author_avatar($parm=null) // new v2.1.5 { $data = array('user_id'=>$this->var['comment_author_id'], 'user_image'=>$this->var['comment_author_image']); return e107::getParser()->toAvatar($data, $parm); } - function sc_cm_comment($parm='') + function sc_cm_comment($parm=null) { $menu_pref = e107::getConfig('menu')->getPref(); $tp = e107::getParser(); $COMMENT = ''; + + + if(!empty($parm['limit'])) // override using shortcode parm. // new v2.1.5 + { + $menu_pref['comment_characters'] = intval($parm['limit']); + } + if($menu_pref['comment_characters'] > 0) {