From a674ca0201b188fd8d7ef29496bbbf7540b39cd2 Mon Sep 17 00:00:00 2001 From: Cameron Date: Mon, 23 May 2016 12:42:21 -0700 Subject: [PATCH] Forum track Page - display last post user and date. --- e107_plugins/forum/forum.php | 12 ++++++++++-- e107_plugins/forum/templates/forum_template.php | 5 ++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/e107_plugins/forum/forum.php b/e107_plugins/forum/forum.php index 32ef54ffa..b9cf469cd 100644 --- a/e107_plugins/forum/forum.php +++ b/e107_plugins/forum/forum.php @@ -50,12 +50,14 @@ if(e_AJAX_REQUEST) } +/* if ($untrackId = varset($_REQUEST['untrack'])) { $forum->track('del', USERID, $untrackId); header('location:'.$e107->url->create('forum/thread/track', array(), 'full=1&encode=0')); exit; } +*/ if(isset($_GET['f'])) { @@ -703,9 +705,10 @@ function forum_track() $viewed = $forum->threadGetUserViewed(); - $qry = "SELECT t.*,th.*, f.* FROM `#forum_track` AS t + $qry = "SELECT t.*,th.*, f.*,u.user_name FROM `#forum_track` AS t LEFT JOIN `#forum_thread` AS th ON t.track_thread = th.thread_id LEFT JOIN `#forum` AS f ON th.thread_forum_id = f.forum_id + LEFT JOIN `#user` AS u ON th.thread_lastuser = u.user_id WHERE t.track_userid = ".USERID." ORDER BY th.thread_lastpost DESC"; $forum_trackstring = ''; @@ -714,19 +717,24 @@ function forum_track() { while($row = $sql->fetch()) { + // e107::getDebug()->log($row); $row['thread_sef'] = eHelper::title2sef($row['thread_name'],'dashl'); $data['NEWIMAGE'] = $IMAGE_nonew_small; + if ($row['thread_datestamp'] > USERLV && !in_array($row['thread_id'], $viewed)) { $data['NEWIMAGE'] = $IMAGE_new_small; } + $data['LASTPOSTUSER'] = !empty($row['user_name']) ? " $row['user_name'], 'id' => $row['thread_lastuser']))."'>".$row['user_name']."" : LAN_ANONYMOUS; + $data['LASTPOSTDATE'] = $tp->toDate($row['thread_lastpost'],'relative'); + $buttonId = "forum-track-button-".intval($row['thread_id']); $forumUrl = e107::url('forum','forum',$row); $threadUrl = e107::url('forum','topic',$row, array('query'=>array('last'=>1))); // ('forum/thread/view', $row); // configs will be able to map thread_* vars to the url - $data['TRACKPOSTNAME'] = "". $row['forum_name']." / ".$tp->toHTML($row['thread_name']).''; + $data['TRACKPOSTNAME'] = "". $row['forum_name']." / ".$tp->toHTML($row['thread_name'], false, 'TITLE').''; // $data['UNTRACK'] = "".LAN_FORUM_0070.""; diff --git a/e107_plugins/forum/templates/forum_template.php b/e107_plugins/forum/templates/forum_template.php index 69526bbbb..cb3599795 100644 --- a/e107_plugins/forum/templates/forum_template.php +++ b/e107_plugins/forum/templates/forum_template.php @@ -125,12 +125,14 @@ $FORUM_TEMPLATE['track']['start'] = "{FORUM_BREADCRUMB}
- + + ".LAN_FORUM_1003." + ".LAN_FORUM_0004." ".LAN_FORUM_1020." @@ -139,6 +141,7 @@ $FORUM_TEMPLATE['track']['start'] = "{FORUM_BREADCRUMB}