1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 14:17:49 +02:00

Update forum_shortcodes.php

This commit is contained in:
rica-carv
2016-12-06 19:08:19 +00:00
committed by GitHub
parent 992980ade3
commit dfa0a6a7ee

View File

@@ -483,16 +483,7 @@ class forum_shortcodes extends e_shortcode
$lastpost = $forum->threadGetLastpost($lastpost_thread); //FIXME TODO inefficient to have SQL query here. $lastpost = $forum->threadGetLastpost($lastpost_thread); //FIXME TODO inefficient to have SQL query here.
$urlData = array('forum_sef'=>$this->var['forum_sef'], 'thread_id'=>$lastpost['post_thread'],'thread_sef'=>$lastpost['thread_sef']); $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']; $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']) : "<a href='".e107::url('user/profile/view', array('name' => $this->var['user_name'], 'id' => $this->var['forum_lastpost_user']))."'>{$this->var['user_name']}</a>";
if (!empty($this->var['user_name']))
{
$lastpost_username = "<a href='".e107::url('user/profile/view', array('name' => $this->var['user_name'], 'id' => $this->var['forum_lastpost_user']))."'>{$this->var['user_name']}</a>";
}
else
{
$lastpost_username = e107::getParser()->toHTML($this->var['forum_lastpost_user_anon']);
}
$relativeDate = e107::getParser()->toDate($lastpost_datestamp,'relative'); $relativeDate = e107::getParser()->toDate($lastpost_datestamp,'relative');
if(!empty($parm['type'])) if(!empty($parm['type']))
@@ -523,8 +514,6 @@ class forum_shortcodes extends e_shortcode
} }
} }
return $relativeDate.'<br />'.$lastpost_username." <a href='".$url."'>".IMAGE_post2.'</a>'; return $relativeDate.'<br />'.$lastpost_username." <a href='".$url."'>".IMAGE_post2.'</a>';
// return false;
} }
function sc_startertitle() function sc_startertitle()