The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Query to get number of post for a user today?
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:
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? |
#2
|
||||
|
||||
well, the syntaxis error i can see is that you're using $DB_site-> and as far as i know that's from vb 3.0.x
so the proper command should be $vbulletin->db->query_frist, so, making the whole sentence be: PHP Code:
|
#3
|
||||
|
||||
Thanks, but I get the following with that:
Fatal error: Call to a member function on a non-object in ...../includes/class_postbit.php(251) : eval()'d code on line 2 What should I do? |
#4
|
||||
|
||||
Try:
$db->query_first |
#5
|
||||
|
||||
Hey, I get the same error with that.. Hmmm..
|
#6
|
||||
|
||||
0k, now try this:
PHP Code:
PHP Code:
|
#7
|
||||
|
||||
Getting closer..
I get this: Parse error: parse error in ..../includes/class_postbit.php(251) : eval()'d code on line 2 |
#8
|
||||
|
||||
none of em worked, hmmmm =/ what else can be the error, well, i think this one of this 2 should work:
PHP Code:
PHP Code:
|
#9
|
||||
|
||||
Bad news...
No go. Thanks for helping though. The COUNT (*) isn't the problem is it? |
#10
|
||||
|
||||
hmmm, well, try the query frist via phpmyadmin without variables or vbulletin commands, something like:
[SQL] "SELECT COUNT(*) AS total FROM post WHERE userid='1' AND dateline >= 86400 "); [/SQL] if it doesnt work, well, maybe you have an sql syntaxis error, that's the only way to know if you're right |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|