I need help with a query please...
I haven't been able to get anything to work with the plug in system, but I have seen similar hacks that use a similar idea.
The query needs to pull the number of posts a user has so far today for display in the posbit. (Not the past 24 hours, just in the current day).
How can I do this? Thanks.
~007
Here's the code that worked on 3.0: (rolling 24 hours, however, but this doesn't work either on 3.5)
PHP Code:
$cutoff=time()-86400;
$postcount=$DB_site->query_first("SELECT COUNT(*) AS total FROM post WHERE userid='$userid' AND dateline >= $cutoff");
I am trying to put it in postbit_start.
It comes up with "Call to a member function on a non-object" and I'm guessing it's because syntax has changed in 3.5... but I haven't the slightest clue where to begin. Any ideas?