The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Having problems with calling functions
Hi everyone,
I was reading a few of the posts here and decided to test some of them and see if I learned anything, but I guess I didn't. What I'm trying to do is I wanted to show the total number of threads on my homepage, which is not integrated to vbulletin, it is a seperate page. I have this page saved as php and I have put this at the begining of the page, <?php chdir("./my forums directory/"); require('./global.php'); chdir("../"); ?> the problem I have though is that I don't know what to do from there, how do I write a command/script that would call the total number of threads from the vbulletin's database? thank you for your help. |
#2
|
||||
|
||||
PHP Code:
|
#3
|
||||
|
||||
Quote:
|
#4
|
||||
|
||||
Quote:
PHP Code:
|
#5
|
||||
|
||||
lol, my bad. missing a double quote, and first $count var should have s.
|
#6
|
||||
|
||||
Quote:
the code that I have so far is, Code:
<?php chdir("/home/***/public_html/forums"); require('/home/***/public_html/forums/global.php'); chdir("../"); $count = $DB_site->query("SELECT COUNT(*) AS totalthread FROM " . TABLE_PREFIX . "thread"); while ($count = $DB_site->fetch_array($counts)) { $totalthread = $count['totalthread']; } print ("Total threads: $totalthread"); ?> |
#7
|
||||
|
||||
try this one. fix $count to $counts
PHP Code:
|
#8
|
|||
|
|||
tnguy3n's query should work.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|