Home : Products : Gossamer Forum : Development, Plugins and Globals :

Products: Gossamer Forum: Development, Plugins and Globals: Re: [Alex] Newest Thread on home page: Edit Log

Here is the list of edits for this post
Re: [Alex] Newest Thread on home page
Alex,

I have implemented this, but it gives you every post within the last 24 hours. How do we narrow that down to just the most recent post?

I have created a global variable <%newest_post%> to identify the post_id for the newest post

I am using the sub routine for the newest_user variable here as my guide and I have modified it for newest_post:


sub { my $table = $DB->table('Post'); $table->select_options("ORDER BY post_id DESC", "LIMIT 1"); return $table->select( 'post_id' )->fetchrow; }



This returns the post_id for the newest post.


The follow up to this would be - what do the <% if %> statements need to look like to restrict the displayed NEWEST_POST from being in a restricted area like "The Administrator Corner."

Last edited by:

shiner: Jun 4, 2002, 1:26 PM

Edit Log: