Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Lastest Post Title...

Quote Reply
Lastest Post Title...
I'm trying to add the title of the latest post in each forum to the main category view of GForum. So, where is displays the last post timestamp, it would display the title of it as well. Has anyone done this?

Sean
Quote Reply
Re: [SeanP] Lastest Post Title... In reply to
I just gave this a go, and it seems to work well :)

<%last_title_global($forum_last_id)%>

Code:
sub {
my $post_id = $_[0];
my $post_title = $DB->table('Post')->select( ['post_subject'], { post_id => $post_id } )->fetchrow;
return $post_title;
}

You need to put it in category_list.html, around;

Code:
<% if forum_total%>
<%nbsp forum_last_date%><br><nobr>by&nbsp;<a href="gforum.cgi?username=<%GT::CGI::escape($forum_last_poster)%>;<%hidden_query%>"><%nbsp forum_last_poster%></a>&nbsp;<a href="gforum.cgi?post=<%forum_last_id%>;<%hidden_query%>#<%forum_last_id%>"><img src="<%image_url%>/jump_last.gif" width="14" height="11" border="0" alt="Jump to post"></a></nobr>
<% else%>

Hope that helps Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Lastest Post Title... In reply to
That works great! I added an href around it to make it linked to the post:

Code:
<a href="gforum.cgi?post=<%forum_last_id%>;<%hidden_query%>#<%forum_last_id%>"><%latest_post_title($forum_last_id)%></a>

Thanks Andy!