Posted by archard-gdo on April 3, 2008 at 3:23am
What I want to do, is make a forum called "Announcements", and post important site updates in that forum. I'd also like to have links to these topics displayed prominently on the front page of drupal. So I was wondering if there is a way to maybe duplicate the recent posts block but confine it to a particular forum. Maybe it's just matter of adding a simple if statement to the existing code - maybe it's a lot harder than that. I haven't taken a good look at it yet, but I hope to get a general idea of the feasibility of something like this.
Comments
It should be easy, just look
It should be easy, just look at the existing block and change the SQL so that it is limited to a single forum.
Yep, it was really easy. For
Yep, it was really easy.
For those wondering how to do it, in the phpbb_block_recent_topics.inc.php file go to line 38 where it starts
."WHERE $tg.group_name = '$gid' .... etc
and add to the end of that
AND $tt.forum_id = 2
where 2 is your desired forum ID to limit the block to.
Now I have another question
Now I have another question regarding the sort order of the block. Is there a way to make it so that they don't "bump" when you post a new topic in them? I just want a list of topics sorted by the time they were created. I don't see an obvious sorting mechanism in the code... but surely it has to be there?
Try changing ORDER BY
Try changing
ORDER BY $tt.topic_last_post_idto
ORDER BY $tt.topic_id(Not 100% sure I interpreted your question correctly)
It worked :) Thanks arkepp!
It worked :)
Thanks arkepp!