Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Limit one forum to topics started today


leggo-my-eggo
Member

@leggo-my-eggo

OK, I think I have this one solved. I modified my forum.php file to include this block right before the $topics foreach loop.

<?php if( $forum_id == '4' ) { // If this is the "Today Only" forum (#4), replace the $topics query
$today = date('omd');
$today_topics_query = new BB_Query( 'topic',
array(
'forum_id' => 4,
'started' => $today,
'order_by' => 'topic_start_time',
'topic_status' => 'all',
'open' => 'all',
'count' => true,
'per_page' => 20
)
);
$topics = $today_topics_query->results; // Here's the array of topics the query returned.
} ?>

I’ll let you know for sure if it works tomorrow. :)

Skip to toolbar