vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Show most popular thread on index page (https://vborg.vbsupport.ru/showthread.php?t=25755)

Scott MacVicar 08-17-2001 10:00 PM

This is probably too small to qualify has a hack but i've seen one or two posts looking for it. This finds the most popular thread on the board.

Open index.php and before
Code:

// get total posts
$countposts=$DB_site->query_first('SELECT COUNT(*) AS posts FROM post');

add either of the following depending on what you want to be picked as most popular.

Code:

//Most Popular Thread by Replies
$popular=$DB_site->query_first("SELECT * FROM thread ORDER by replycount DESC LIMIT 1");

Code:

//Most Popular Thread by Views
$popular=$DB_site->query_first("SELECT * FROM thread ORDER by views DESC LIMIT 1");

then below that add the following
Code:

eval("\$popularthread = \"".gettemplate("popular_thread")."\";");
save index.php and upload.

Then within the control panel click add templates.

Template name is popular_thread
and the code should be this
Code:

Most popular thread is <a href="showthread.php?s=$session[sessionhash]&threadid=$popular[threadid]">$popular[title]</a>
Then in either of your forumhome templates place $popularthread and the text "Most populat thread is THREADTITLE"
the threadtitle will be a link to the title.

maverick1236 08-19-2001 12:00 AM

doesnt show up in forum home :(

Reef Board 08-19-2001 07:16 AM

Same here - doesn't work for me, either.

Phil~

Mobile 08-19-2001 10:20 AM

nice one PPN works fine, take a look http://www.skytronic-forums.com/forum/

ltr Mobile

inetd 08-19-2001 10:37 AM

don't work...
please fix bug's... :(

Scott MacVicar 08-19-2001 11:06 AM

Are you getting any error messages at all?

i've installed it twice on other boards and it worked fine. Another person pasted in both lines for getting most popular. Ie the one for popular by reply and the popular by views. Make sure you only paste one of them in.

inetd 08-19-2001 12:00 PM

Ok. Thx! All work! Fine work!
You could not make Show most popular thread on index page at present (at the rate of 24 hours)?

dwh 08-22-2001 06:02 AM

Not a bad idea but I think I'll skip this one. The one weakness to the linear style bulletin board is that once you go beyond one page it's much harder to read and manage than threaded bbs'es or some other style bbs'es (it does exist). On my board this would just encourage people to make those monster threads even more unmanageable.

maverick1236 08-25-2001 12:55 PM

all code is correct

just doesnt show up!?

weird....

:)

pgowder 11-05-2001 02:56 PM

How can I use this on a non vb page?


All times are GMT. The time now is 04:58 PM.

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.01173 seconds
  • Memory Usage 1,728KB
  • 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
  • (5)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete