Commit 178bbb1d authored by Clare Lenihan's avatar Clare Lenihan Committed by Clare Lenihan
Browse files

added a named anchor to posts

changed the last post time to link to that post in a topic
parent bb669fee
<a name="post{$post->id}"></a>
<div> <div>
{if $post->subject && !$nosubject}<h4>{$post->subject|escape}</h4>{/if} {if $post->subject && !$nosubject}<h4>{$post->subject|escape}</h4>{/if}
{$post->ctime} {$post->ctime}
......
...@@ -36,7 +36,8 @@ ...@@ -36,7 +36,8 @@
{/if} {/if}
> >
{$topic->lastposter|display_name|escape}</a> {$topic->lastposter|display_name|escape}</a>
<br>{$topic->lastposttime} <br>
<a href="{$WWWROOT}interaction/forum/topic.php?id={$topic->id}#post{$topic->lastpost}">{$topic->lastposttime}</a>
{/if} {/if}
</td> </td>
{if $moderator} {if $moderator}
......
...@@ -175,7 +175,7 @@ $forum->subscribe = pieform(array( ...@@ -175,7 +175,7 @@ $forum->subscribe = pieform(array(
// gets the info about topics // gets the info about topics
// the last post is found by taking the max id of the posts in a topic with the max post time // the last post is found by taking the max id of the posts in a topic with the max post time
// taking the max id is needed because multiple posts can have the same post time // taking the max id is needed because multiple posts can have the same post time
$sql = 'SELECT t.id, p1.subject, p1.body, p1.poster, p1.deleted, m.user AS moderator, COUNT(p2.*), t.closed, s.topic AS subscribed, ' . db_format_tsfield('p4.ctime', 'lastposttime') . ', p4.poster AS lastposter, m2.user AS lastpostermoderator $sql = 'SELECT t.id, p1.subject, p1.body, p1.poster, p1.deleted, m.user AS moderator, COUNT(p2.*), t.closed, s.topic AS subscribed, p4.id AS lastpost, ' . db_format_tsfield('p4.ctime', 'lastposttime') . ', p4.poster AS lastposter, m2.user AS lastpostermoderator
FROM interaction_forum_topic t FROM interaction_forum_topic t
INNER JOIN {interaction_forum_post} p1 ON (p1.topic = t.id AND p1.parent IS NULL) INNER JOIN {interaction_forum_post} p1 ON (p1.topic = t.id AND p1.parent IS NULL)
LEFT JOIN ( LEFT JOIN (
...@@ -209,7 +209,7 @@ $sql = 'SELECT t.id, p1.subject, p1.body, p1.poster, p1.deleted, m.user AS moder ...@@ -209,7 +209,7 @@ $sql = 'SELECT t.id, p1.subject, p1.body, p1.poster, p1.deleted, m.user AS moder
WHERE t.forum = ? WHERE t.forum = ?
AND t.sticky = ? AND t.sticky = ?
AND t.deleted != 1 AND t.deleted != 1
GROUP BY 1, 2, 3, 4, 5, 6, 8, 9, p4.ctime, p4.poster, p4.id, m2.user GROUP BY 1, 2, 3, 4, 5, 6, 8, 9, 10, p4.ctime, p4.poster, p4.id, m2.user
ORDER BY p4.ctime DESC, p4.id DESC'; ORDER BY p4.ctime DESC, p4.id DESC';
$stickytopics = get_records_sql_array($sql, array($userid, $forumid, 1)); $stickytopics = get_records_sql_array($sql, array($userid, $forumid, 1));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment