diff --git a/e107_plugins/forum/shortcodes/batch/forum_shortcodes.php b/e107_plugins/forum/shortcodes/batch/forum_shortcodes.php index a7974332f..8b861644b 100644 --- a/e107_plugins/forum/shortcodes/batch/forum_shortcodes.php +++ b/e107_plugins/forum/shortcodes/batch/forum_shortcodes.php @@ -431,38 +431,6 @@ class forum_shortcodes extends e_shortcode function sc_lastpost($parm = null) { -/* - if(!empty($parm['type'])) - { - switch($parm['type']) - { - case "date": // date only - // code - break; - - case "datelink": // date with link - return $this->lastpostdata('date'); - break; - - case "url": // url - return $this->lastpostdata('url'); - break; - - case "username": // username of last-post user. - return $this->lastpostdata('user'); - break; - - case "name": //thread name - // code - break; - - } - } - - return $this->lastpostdata('post'); -*/ - - if (empty($this->var['forum_lastpost_info'])) { return false; @@ -479,7 +447,11 @@ class forum_shortcodes extends e_shortcode $urlData = array('forum_sef'=>$this->var['forum_sef'], 'thread_id'=>$lastpost['post_thread'],'thread_sef'=>$lastpost['thread_sef']); $url = e107::url('forum', 'topic', $urlData)."?last=1#post-".$lastpost['post_id']; $lastpost_username = empty($this->var['user_name']) ? e107::getParser()->toHTML($this->var['forum_lastpost_user_anon']) : " $this->var['user_name'], 'id' => $this->var['forum_lastpost_user']))."'>{$this->var['user_name']}"; - $relativeDate = e107::getParser()->toDate($lastpost_datestamp,'relative'); + + + $format = !empty($options['date-format']) ? $options['date-format'] : 'relative'; + + $relativeDate = e107::getParser()->toDate($lastpost_datestamp, $format); if(!empty($parm['type'])) {