vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Display Popular Threads on my PHP Website (https://vborg.vbsupport.ru/showthread.php?t=59290)

mixx941 12-20-2003 01:00 AM

Display Popular Threads on my PHP Website
 
Hi everyone. I'm currently working on perfecting a new layout for my site, and I'm wondering if there is a PHP component or something pre-made to display popular threads on my site.

I'm looking for something fairly small, that would fit in the right cell of the middle table here:

http://www.mixx941.com/index.php

Thanks in advance.

filburt1 12-20-2003 02:17 AM

Depends on how you define popular. If you mean number of views:
[sql]
SELECT title, threadid, views FROM thread ORDER BY views DESC LIMIT 10;
[/sql]
Or number of replies:
[sql]
SELECT title, threadid, replycount FROM thread ORDER BY replycount DESC LIMIT 10;
[/sql]

mixx941 12-20-2003 03:09 AM

Thanks for your reply.

However, I do not know exactly what you mean by that code. I know those are SQL queries that should be put in phpMyAdmin, but how would I get it to display on my page, and what database would I put it in, etc?

Thanks

mixx941 12-20-2003 03:22 PM

Okay, I've run those queries on a copy of my vBulletin database...and it gave me this PHP code back:

PHP Code:

<?php
$sql 
'SELECT title, threadid, replycount';
$sql .= 'FROM thread';
$sql .= 'ORDER BY replycount DESC ';
$sql .= 'LIMIT 10 ';
?>

I tried to put that on my PHP page just to see, and it didnt work. How do I make it connect to my database, or is there anything else I'm missing?

Thanks.

shorty 12-21-2003 10:14 AM

You would need to setup a connection to your Vbulletin database, so you could execute that query :)

Are you running another database for your normal page PHP?

mixx941 12-21-2003 01:11 PM

No. It's just straight PHP pages with no database involved.

Thanks in advance.

shorty 12-21-2003 02:11 PM

Check your PMs :)

I can help you quicker on instant messenger.. if you have it :)


All times are GMT. The time now is 08:22 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.01187 seconds
  • Memory Usage 1,720KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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