MyBB Community Forums

Full Version: View Today's Threads
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I wanted to know is there a way i can see View Today's Threads in place of View Today's Posts like when we click this link (
http://community.mybb.com/search.php?action=getdaily)
Is it possible ?
Not without custom coding it. It wouldn't be that difficult of a query. This is just a sample query that doesn't implement forum permissions.
$cutoff = TIME_NOW - 86400;
$query = $db->query("SELECT * FROM " . TABLE_PREFIX . "threads WHERE dateline>$cutoff ORDER BY dateline ASC");
while($thread = $db->fetch_array($query))
{
// do something here like formatting time
}
Thanks for the reply dragonexpert
Also how to get only threads where post count is 0
Continuing the query I had earlier.

$query = $db->query("SELECT * FROM " . TABLE_PREFIX . "threads WHERE dateline>$cutoff AND  replies=0 ORDER BY dateline ASC");
(2014-05-29, 03:00 PM)dragonexpert Wrote: [ -> ]Continuing the query I had earlier.

$query = $db->query("SELECT * FROM " . TABLE_PREFIX . "threads WHERE dateline>$cutoff AND  replies=0 ORDER BY dateline ASC");

Thanks dragonexpert Smile
Is there a way i can replace the Default Today Post with this feature of Today Thread with 0 post ?
If you made a separate page for it or a plugin you would edit the link. I believe it is under header templates.
I wanted to know if i can edit the search.php file somehow to replace the getdaily action Smile
You could edit search.php if you really want to, however, I'd suggest either a plugin or making a separate page because when you do an update, you lose any edits made to any files you reuploaded to your webserver.
Hello dragonexpert, can you also tell me how to add forum permissions in this query ?
Thanks a lot
$unviewableforums = get_unsearchable_forums();
$cutoff = TIME_NOW - 86400;
$query = $db->query("SELECT * FROM " . TABLE_PREFIX . "threads WHERE dateline>$cutoff AND  replies=0 AND fid NOT IN(" . $unviewableforums . ") ORDER BY dateline ASC");
That should work.
Pages: 1 2