The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
thread and reply count
Hello, i tried to make an hack to count the number of threads and replies of every member of my forum.
I tried to do that with the following query : $usertherd = $DB_site->query_first("SELECT COUNT(threadid) AS total FROM thread WHERE postuserid=$post[userid] "); $usertherdcoun = $usertherd[total]; $userpostdcoun = $post[posts] - $usertherdcoun ; $userscann = $DB_site->query_first("SELECT COUNT(threadid) AS total FROM thread WHERE postuserid=$post[userid] AND forumid=37"); $userscann1 = $DB_site->query_first("SELECT COUNT(threadid) AS total FROM thread WHERE postuserid=$post[userid] AND forumid=20"); $userscann2 = $DB_site->query_first("SELECT COUNT(threadid) AS total FROM thread WHERE postuserid=$post[userid] AND forumid=12"); $userscanncoun = $userscann[total]+$userscann1[total]+$userscann2[total] ; i put this in function.php below this lines: $post[homepage]=""; $post[findposts]=""; $post[signature]=""; $onlinestatus=""; } Now, the problem is that, when i delete a member without deleting his posts i have the following error message : Database error in vBulletin 2.2.6: Invalid SQL: SELECT COUNT(threadid) AS total FROM thread WHERE postuserid= mysql error: You have an error in your SQL syntax near '' at line 1 mysql error number: 1064 help me please thanks |
#2
|
||||
|
||||
yea I got that as well when it was an "unregistered" person posting.... Please help
|
#3
|
||||
|
||||
put an if clause around the query that makes sure userid is set.
Amy |
#4
|
||||
|
||||
use this code:
PHP Code:
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|