mirror of
https://github.com/e107inc/e107.git
synced 2025-07-12 18:46:20 +02:00
Fixes #721 - jump to "last forum post" link added to 'Last Post' time value.
This commit is contained in:
@ -385,8 +385,15 @@ function parse_forum($f, $restricted_string = '')
|
|||||||
{
|
{
|
||||||
$lastpost_name = $tp->toHTML($f['forum_lastpost_user_anon']);
|
$lastpost_name = $tp->toHTML($f['forum_lastpost_user_anon']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$lastpost = $forum->threadGetLastpost($lastpost_thread); //XXX TODO inefficient to have SQL query here.
|
||||||
|
|
||||||
$fVars->LASTPOSTUSER = $lastpost_name;
|
$fVars->LASTPOSTUSER = $lastpost_name;
|
||||||
$fVars->LASTPOSTDATE .= $gen->computeLapse($lastpost_datestamp, time(), false, false, 'short');
|
// {forum_sef}/{thread_id}-{thread_sef}
|
||||||
|
|
||||||
|
$urlData = array('forum_sef'=>$f['forum_sef'], 'thread_id'=>$lastpost['post_thread'],'thread_sef'=>$lastpost['thread_sef']);
|
||||||
|
$url = e107::url('forum', 'topic', $urlData)."?last=1#post-".$lastpost['post_id'];
|
||||||
|
$fVars->LASTPOSTDATE .= "<a href='".$url."'>". $gen->computeLapse($lastpost_datestamp, time(), false, false, 'short')."</a>";
|
||||||
$lastpost_datestamp = $gen->convert_date($lastpost_datestamp, 'forum');
|
$lastpost_datestamp = $gen->convert_date($lastpost_datestamp, 'forum');
|
||||||
$fVars->LASTPOST = $lastpost_datestamp.'<br />'.$lastpost_name." <a href='".$e107->url->create('forum/thread/last', array('name' => $lastpost_name, 'id' => $lastpost_thread))."'>".IMAGE_post2.'</a>';
|
$fVars->LASTPOST = $lastpost_datestamp.'<br />'.$lastpost_name." <a href='".$e107->url->create('forum/thread/last', array('name' => $lastpost_name, 'id' => $lastpost_thread))."'>".IMAGE_post2.'</a>';
|
||||||
|
|
||||||
|
@ -1551,11 +1551,13 @@ class e107forum
|
|||||||
$sql = e107::getDb();
|
$sql = e107::getDb();
|
||||||
$forumId = (int)$forumId;
|
$forumId = (int)$forumId;
|
||||||
$qry = "
|
$qry = "
|
||||||
SELECT t.*, f.forum_id, f.forum_sef, u.user_name, lpu.user_name AS lastpost_username from `#forum_thread` as t
|
SELECT t.*, f.forum_id, f.forum_sef, u.user_name, lpu.user_name AS lastpost_username, MAX(p.post_id) AS lastpost_id FROM `#forum_thread` as t
|
||||||
LEFT JOIN `#forum` AS f ON t.thread_forum_id = f.forum_id
|
LEFT JOIN `#forum` AS f ON t.thread_forum_id = f.forum_id
|
||||||
|
LEFT JOIN `#forum_post` AS p ON t.thread_id = p.post_thread
|
||||||
LEFT JOIN `#user` AS u ON t.thread_user = u.user_id
|
LEFT JOIN `#user` AS u ON t.thread_user = u.user_id
|
||||||
LEFT JOIN `#user` AS lpu ON t.thread_lastuser = lpu.user_id
|
LEFT JOIN `#user` AS lpu ON t.thread_lastuser = lpu.user_id
|
||||||
WHERE t.thread_forum_id = {$forumId}
|
WHERE t.thread_forum_id = {$forumId}
|
||||||
|
GROUP BY thread_id
|
||||||
ORDER BY
|
ORDER BY
|
||||||
t.thread_sticky DESC,
|
t.thread_sticky DESC,
|
||||||
t.thread_lastpost DESC
|
t.thread_lastpost DESC
|
||||||
@ -1579,7 +1581,8 @@ class e107forum
|
|||||||
$sql = e107::getDb();
|
$sql = e107::getDb();
|
||||||
$id = (int)$id;
|
$id = (int)$id;
|
||||||
$qry = "
|
$qry = "
|
||||||
SELECT p.post_user, p.post_user_anon, p.post_datestamp, p.post_thread, u.user_name FROM `#forum_post` AS p
|
SELECT p.post_user, p.post_id, p.post_user_anon, p.post_datestamp, p.post_thread, t.thread_sef, u.user_name FROM `#forum_post` AS p
|
||||||
|
LEFT JOIN `#forum_thread` AS t ON p.post_thread = t.thread_id
|
||||||
LEFT JOIN `#user` AS u ON u.user_id = p.post_user
|
LEFT JOIN `#user` AS u ON u.user_id = p.post_user
|
||||||
WHERE p.post_thread = {$id}
|
WHERE p.post_thread = {$id}
|
||||||
ORDER BY p.post_datestamp DESC LIMIT 0,1
|
ORDER BY p.post_datestamp DESC LIMIT 0,1
|
||||||
|
@ -438,7 +438,15 @@ function parse_thread($thread_info)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$tVars->LASTPOST .= '<br />'.$lastpost_datestamp;
|
$tVars->LASTPOST .= '<br />'.$lastpost_datestamp;
|
||||||
$tVars->LASTPOSTDATE .= $gen->computeLapse($thread_info['thread_lastpost'],time(), false, false, 'short');
|
|
||||||
|
$tVars->LASTPOSTUSER = $thread_info['lastpost_username']; // $lastpost_name;
|
||||||
|
|
||||||
|
$urlData = array('forum_sef'=>$thread_info['forum_sef'], 'thread_id'=>$thread_info['thread_id'],'thread_sef'=>$thread_info['thread_sef']);
|
||||||
|
$url = e107::url('forum', 'topic', $urlData);
|
||||||
|
$url .= (strpos($url,'?')!==false) ? '&' : '?';
|
||||||
|
$url .= "last=1#post-".$thread_info['lastpost_id'];
|
||||||
|
|
||||||
|
$tVars->LASTPOSTDATE .= "<a href='".$url."'>". $gen->computeLapse($thread_info['thread_lastpost'],time(), false, false, 'short')."</a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$newflag = (USER && $thread_info['thread_lastpost'] > USERLV && !in_array($thread_info['thread_id'], $threadsViewed));
|
$newflag = (USER && $thread_info['thread_lastpost'] > USERLV && !in_array($thread_info['thread_id'], $threadsViewed));
|
||||||
@ -767,8 +775,10 @@ function fpages($thread_info, $replies)
|
|||||||
{
|
{
|
||||||
$aa = $a + 1;
|
$aa = $a + 1;
|
||||||
$text .= $text ? ' ' : '';
|
$text .= $text ? ' ' : '';
|
||||||
$urlparms['page'] = $aa;
|
// $urlparms['page'] = $aa;
|
||||||
$url = e107::getUrl()->create('forum/thread/view', $urlparms);
|
|
||||||
|
// $url = e107::getUrl()->create('forum/thread/view', $urlparms);
|
||||||
|
$url = e107::url('forum','topic',$urlparms).'?p='.$aa;
|
||||||
$opts[] = "<a data-toggle='tooltip' title=\"Go to Page $aa\" href='{$url}'>{$aa}</a>"; //FIXME LAN_GOPAGE syntax?
|
$opts[] = "<a data-toggle='tooltip' title=\"Go to Page $aa\" href='{$url}'>{$aa}</a>"; //FIXME LAN_GOPAGE syntax?
|
||||||
}
|
}
|
||||||
$text .= ' ... ';
|
$text .= ' ... ';
|
||||||
@ -776,8 +786,9 @@ function fpages($thread_info, $replies)
|
|||||||
{
|
{
|
||||||
$aa = $a + 1;
|
$aa = $a + 1;
|
||||||
$text .= $text ? ' ' : '';
|
$text .= $text ? ' ' : '';
|
||||||
$urlparms['page'] = $aa;
|
// $urlparms['page'] = $aa;
|
||||||
$url = e107::getUrl()->create('forum/thread/view', $urlparms);
|
// $url = e107::getUrl()->create('forum/thread/view', $urlparms);
|
||||||
|
$url = e107::url('forum','topic',$urlparms).'?p='.$aa;
|
||||||
$opts[] = "<a data-toggle='tooltip' title=\"Go to Page $aa\" href='{$url}'>{$aa}</a>"; //FIXME LAN_GOPAGE syntax?
|
$opts[] = "<a data-toggle='tooltip' title=\"Go to Page $aa\" href='{$url}'>{$aa}</a>"; //FIXME LAN_GOPAGE syntax?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -787,8 +798,9 @@ function fpages($thread_info, $replies)
|
|||||||
{
|
{
|
||||||
$aa = $a + 1;
|
$aa = $a + 1;
|
||||||
$text .= $text ? ' ' : '';
|
$text .= $text ? ' ' : '';
|
||||||
$urlparms['page'] = $aa;
|
// $urlparms['page'] = $aa;
|
||||||
$url = e107::getUrl()->create('forum/thread/view', $urlparms);
|
// $url = e107::getUrl()->create('forum/thread/view', $urlparms);
|
||||||
|
$url = e107::url('forum','topic',$urlparms).'?p='.$aa;
|
||||||
$opts[] = "<a data-toggle='tooltip' title=\"Go to Page $aa\" href='{$url}'>{$aa}</a>"; //FIXME LAN_GOPAGE syntax?
|
$opts[] = "<a data-toggle='tooltip' title=\"Go to Page $aa\" href='{$url}'>{$aa}</a>"; //FIXME LAN_GOPAGE syntax?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user