vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Question about leaderboard script I'm writing. (https://vborg.vbsupport.ru/showthread.php?t=214109)

RamdonGhai 05-20-2009 06:23 AM

Question about leaderboard script I'm writing.
 
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.

RamdonGhai 05-20-2009 08:25 PM

Quote:

Originally Posted by Lynne (Post 1814155)
This article should get you started on writing your page - [How-To] vBulletin API Basics: Creating Custom Pages & Misc.

just for testing i put this up
Code:

<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.


All times are GMT. The time now is 09:25 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01617 seconds
  • Memory Usage 1,715KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete