The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Showing posts/member count on non-forum HTML page
Showing posts and member count on non-forum HTML page.
Like this: 12116 forum members - 1104618 posts |
#2
|
||||
|
||||
Anyone? I would even pay a little (using paypal) to get this done !
Thanks |
#3
|
||||
|
||||
PHP Code:
|
#4
|
||||
|
||||
Thanks a lot, which file do I need to include in my non-forum page to get this data ?
|
#5
|
||||
|
||||
include your forums' global.php
|
#6
|
||||
|
||||
Thanks a lot...
I can´t seem to get it right - in my HTML page I added a little include, like this: <?php include("stats.php"); ?> In the stats.php file I have this: <?php include_once('../forum/global.php'); // get total members $numbersmembers=$db->query_first('SELECT COUNT(*) AS users FROM " . TABLE_PREFIX . "user'); $numbermembers = number_format($numbersmembers['users']); // get total posts $countposts=$db->query_first('SELECT COUNT(*) AS " . TABLE_PREFIX . "posts FROM post'); $totalposts = number_format($countposts['posts']); //$countthreads=$db->query_first('SELECT COUNT(*) AS " . TABLE_PREFIX . "threads FROM thread'); //$totalthreads = number_format($countthreads['threads']); echo $numbermembers . " forum members - " . $totalposts . " posts"; ?> What is wrong? Thanks |
#7
|
||||
|
||||
what happens when you run the stats.php?
|
#8
|
||||
|
||||
Fatal error: Call to a member function query_first() on a non-object in D:\home\mysite\stats.php on line 5
|
#9
|
|||
|
|||
Use $vbulletin->db->query_first instead of $db->query_first
|
#10
|
||||
|
||||
Same result:
Fatal error: Call to a member function query_first() on a non-object in D:\home\mysite\stats.php on line 5 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|