1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-25 17:01:43 +02:00

Forum track Page - display last post user and date.

This commit is contained in:
Cameron
2016-05-23 12:42:21 -07:00
parent db5185fb42
commit a674ca0201
2 changed files with 14 additions and 3 deletions

View File

@@ -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']) ? "<a href='".e107::url('user/profile/view', array('name' => $row['user_name'], 'id' => $row['thread_lastuser']))."'>".$row['user_name']."</a>" : 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'] = "<a href='".$forumUrl."'>". $row['forum_name']."</a> / <a href='".$threadUrl."'>".$tp->toHTML($row['thread_name']).'</a>';
$data['TRACKPOSTNAME'] = "<a href='".$forumUrl."'>". $row['forum_name']."</a> / <a href='".$threadUrl."'>".$tp->toHTML($row['thread_name'], false, 'TITLE').'</a>';
// $data['UNTRACK'] = "<a class='btn btn-default' href='".e_SELF."?untrack.".$row['thread_id']."'>".LAN_FORUM_0070."</a>";

View File

@@ -125,12 +125,14 @@ $FORUM_TEMPLATE['track']['start'] = "{FORUM_BREADCRUMB}<div id='forum-trac
<colgroup>
<col style='width:5%' />
<col />
<col style='width:10%' />
<col style='width:15%' />
<col style='width:5%' />
</colgroup>
<thead>
<tr>
<th colspan='2'>".LAN_FORUM_1003."</th>
<th class='hidden-xs text-center'>".LAN_FORUM_0004."</th>
<th class='text-center'>".LAN_FORUM_1020."</th>
</tr>
</thead>
@@ -139,6 +141,7 @@ $FORUM_TEMPLATE['track']['start'] = "{FORUM_BREADCRUMB}<div id='forum-trac
$FORUM_TEMPLATE['track']['item'] = "<tr>
<td class='text-center'>{NEWIMAGE}</td>
<td>{TRACKPOSTNAME}</td>
<td class='hidden-xs text-center'><small>{LASTPOSTUSER} {LASTPOSTDATE}</small></td>
<td class='text-center'>{UNTRACK}</td>
</tr>";