MyBB Community Forums

Full Version: help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys, 

I'm working on a small plugin, but I ran into a small issue... Is there anyway to count all new threads made within a 24 hour time period (example; 12am - 11:59pm)? Or would I have to create a custom variable for that?
Try this:

   $timecut = TIME_NOW - 86400;
   $query = $db->simple_select("threads", "COUNT(*) AS newthreads", "dateline > '$timecut' AND visible='1' AND closed NOT LIKE 'moved|%'");
   $newthreads = my_number_format($db->fetch_field($query, "newthreads"));