The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Well I am trying to display the stats in the header, and I have this part working good
Code:
<td><span class="style7">Members: $numbermembers<br /> Posts: $totalposts<br /> Threads: $totalthreads<br /> Newest Member: <a href="$vboptions[bburl]/member.php?u=$newuserid"> $newusername</a></span></td> </tr> </table></td> Members: Posts: Threads: Newest Member: The reason it is only showing that is because i have the stats code disabled because it keeps giving my site a database error, so im thinking something must be wrong with the code below, any ideas what is wrong or any other ways at showing this info in the header? Here is my stats code which is giving my site a database error when i have it enabled: Code:
<?xml version="1.0" encoding="ISO-8859-1" ?> - <plugins> - <plugin active="1" product="vbulletin"> <title>Forum Stats, Total Online, Get Newest Member Name</title> <hookname>global_start</hookname> - <phpcode> - <![CDATA[ // forum stats start $numbersmembers = $db->query_first("SELECT COUNT(*) AS users,MAX(userid) AS max FROM " . TABLE_PREFIX . "user"); $numbermembers = number_format($numbersmembers['users']); $counter = $db->query_first("SELECT COUNT(postid) AS posts, COUNT(threadid) AS threads FROM " . TABLE_PREFIX . "post"); $totalposts=number_format($counter['posts']); $countthreads = $db->query_first("SELECT COUNT(*) AS threads FROM " . TABLE_PREFIX . "thread"); $totalthreads=number_format($countthreads['threads']); // forum stats end // total online start $datecut = TIMENOW - $vbulletin->options['cookietimeout']; $headerguests=$db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "session WHERE userid=0 AND lastactivity>$datecut"); $headerusers=$db->query_first("SELECT COUNT(DISTINCT(userid)) AS count FROM " . TABLE_PREFIX . "session WHERE " . TABLE_PREFIX . "session.userid>0 AND " . TABLE_PREFIX . "session.lastactivity>$datecut"); $headerguests=$headerguests[count]; $headerusers=$headerusers[count]; $totalonline=$headerguests+$headerusers; // total online end // get newest member name and userid start $getnewestmember=$db->query_first("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE " . TABLE_PREFIX . "userid=$numbersmembers[max]"); $newusername = $getnewestmember['username']; $newuserid = $getnewestmember['userid']; // get newest member name and userid end ]]> </phpcode> </plugin> </plugins> |
#2
|
|||
|
|||
![]()
Anyone got a few minutes willing to help?
|
#3
|
|||
|
|||
![]()
btw here is the database error i get:
Code:
Database error in vBulletin 3.6.7: Invalid SQL: SELECT userid, username FROM vb3_user WHERE vb3_userid=81394; MySQL Error : Unknown column 'vb3_userid' in 'where clause' Error Number : 1054 Date : Saturday, June 9th 2007 @ 06:53:41 PM |
#4
|
||||
|
||||
![]()
Find:
PHP Code:
PHP Code:
![]() |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|