Log in

View Full Version : Question about leaderboard script I'm writing.


RamdonGhai
05-20-2009, 06:23 AM
How are you guys doing, I wasn't sure if this is the right section but,

I'm trying to write a php script that will somehow access the SQL database to find out how many open threads there are in all forums, and how many closed threads there are...

basically with that, i can put that into my home page so when a user loads that page it'll tell them how many threads there are open, and how many there are that have been closed (my site is a story telling site, after a set amount of posts the threads close)

thanks alot for all of the help!

Lynne
05-20-2009, 03:31 PM
This article should get you started on writing your page - [How-To] vBulletin API Basics: Creating Custom Pages & Misc. (https://vborg.vbsupport.ru/showthread.php?t=98009)

RamdonGhai
05-20-2009, 08:25 PM
This article should get you started on writing your page - [How-To] vBulletin API Basics: Creating Custom Pages & Misc. (https://vborg.vbsupport.ru/showthread.php?t=98009)

just for testing i put this up <html><head><title>Test</title></head>
<body><?php echo mysql_result(mysql_query("SELECT COUNT(*) as Num FROM thread Where open

= 0"),0); ?></body>
</html>

i uploaded this to /forums directory and it doesn't return any value when I load it in the browser.

How would the script know which db to get the values from?

Lynne
05-20-2009, 11:30 PM
If that's all you put up, then you didn't follow that article at all. If you followed the article, you'd be able to put your query into the body of the php page and assign the output to a variable that you can put into your template.