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

I am currently working on a solution for not displaying posts from restricted areas of your site on the homepage. I am not sure I am on the right track, but this is what I have so far.

1) created a field in the FORUM table called visable_on_homepage
-> visable forums got a 1 and hidden forums got a 0

2) created an action called display_newest_post with newest_post.html as the template
-> SSI: <!--#include virtual="/cgi-bin/forum/gforum.cgi?do=display_newest_post"-->

3) in newest_post.html was trying to construct the if/then statements to compensate for hidden forums, but after a few goes at it, I think this needs to be done via a sub routine in a global variable newest_visable_post.

I think the logic is close to this:

1) essentially use what was covered above in this thread to locate <%newest_post%>
2) obtain the forum_id_fk from <%newest_post%>
3) given that forum_id_fk number, cross reference {my $table = $DB->forum('visable_on_homepage')}
4) if the forum is visable_on_homepage then the value for newest_visable_post = newest_post
5) if the forum is not supposed to be visable, you need to subtract 1 from newest_post (aka the post_id of the most recent post)
6) this should continue in a loop until you find a post_id that is from a forum that is visable_on_homepage
7) once a post_id is determined, you need to be able to call upon the fields of that post.

Last edited by:

shiner: Jun 4, 2002, 1:46 PM

Edit Log: