Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Top 5 "Hot" Topics on Forum Home Page Details »»
Top 5 "Hot" Topics on Forum Home Page
Version: 1.1, by amykhar amykhar is offline
Developer Last Online: Nov 2013 Show Printable Version Email this Page

Version: 3.5.0 RC1 Rating:
Released: 07-27-2005 Last Update: 08-01-2005 Installs: 79
Uses Plugins Template Edits
Is in Beta Stage  
No support by the author.

This little one puts a list of the five threads with the most replies that have been active in the past 7 days on your forum home page.

You can change the query to make it 10 topics with most views or whatever suits your needs.

Things you may want to change:

To get the top 10, 20 or whatever topics instead of 5, change
Code:
LIMIT 5
to the number of your choice.

To get the top topics based on views instead of replies, change
Code:
ORDER BY replycount
to
Code:
ORDER BY views
To keep track of the top threads that are currently active, no matter when they were started, change
Code:
WHERE dateline > $datecut
to
Code:
WHERE lastpost > $datecut

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #32  
Old 08-01-2005, 11:32 PM
Kusadasi-Guy Kusadasi-Guy is offline
 
Join Date: May 2004
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Amycar, this is a great plugin!
is there a chance to put this on a vb-powered custom page?
Reply With Quote
  #33  
Old 08-01-2005, 11:34 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Kusadasi-Guy, you could lift the code out of the plugin and use it anywhere that global.php is included. It's a straightforward query. You will need to restructure your template though.

Amy
Reply With Quote
  #34  
Old 08-01-2005, 11:45 PM
Kusadasi-Guy Kusadasi-Guy is offline
 
Join Date: May 2004
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i am really sorry to being noob, but i couldnt. Can you create a small example? This is really too important for me becuase i want to create my VB-powered custom page.

i tried this, and of course it doesnt work;

Quote:
<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'bugs');
define('NO_REGISTER_GLOBALS', 1);

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();

// get special data templates from the datastore
$specialtemplates = array(
);

// pre-cache templates used by all actions
$globaltemplates = array(
'shell_blank'
);

// pre-cache templates used by specific actions
$actiontemplates = array();

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');


$html = <<< HTML
<!-- html starts here -->
require_once('./global.php');
$forumchoice = array();

foreach (array_keys($vbulletin->forumcache) AS $forumid)
{
$forumid = intval($forumid);
$forumperms =& $vbulletin->userinfo['forumpermissions']["$forumid"];

if (isset($vbulletin->forumcache["$forumid"]) AND ($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) AND ($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) AND verify_forum_password($forumid, $vbulletin->forumcache["$forumid"]['password'], false))
{
$forumchoice[] = $forumid;
}
}
$datecut = TIMENOW - (7*24*60*60);
$hottopics = $db->query_read("SELECT * FROM ".TABLE_PREFIX."thread WHERE dateline > $datecut AND forumid IN (". implode(',', $forumchoice) . ") AND open=1 ORDER BY replycount DESC LIMIT 10");
$topicstring = "";
while($hottopic = $db->fetch_array($hottopics))
{
$topicstring.="<b>&raquo;</b> <a href='showthread.php?t=".$hottopic[threadid]."'>".$hottopic[title]."</a> - $hottopic[replycount] replies<br />";
}
eval('$hottopics = "' . fetch_template('hottopics') . '";');
<!-- html ends here -->
HTML;

$navbits["mycookies2.php"] = 'Photo Gallery';
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');

$pagetitle = "Photo Gallery";
eval('print_output("' . fetch_template('shell_blank') . '");');

?>
Reply With Quote
  #35  
Old 08-02-2005, 12:31 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For anyone that is intested, I made a slight change to the xml file. It will now say:

No replies for 0 replies
1 reply (for 1 reply)
12 replies (for multiple replies)

If anyone is interested. let me know, and if Amy oks it, I will post the change here.
Reply With Quote
  #36  
Old 08-02-2005, 01:08 AM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Go for it. I'll even add you as co-author and put it in the original post with your template mod.
Reply With Quote
  #37  
Old 08-02-2005, 01:19 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In the xml file for this mod

Find:

PHP Code:
while($hottopic $db->fetch_array($hottopics))
{
$topicstring.="<a href='showthread.php?t=".$hottopic[threadid]."'>".$hottopic[title]."</a> - ($hottopic[replycount] replies)<br />";

REPLACE it with:

PHP Code:
 while($hottopic $db->fetch_array($hottopics))
{
if (
$hottopic[replycount] == 1)
{
$topicstring.="<a href='showthread.php?t=".$hottopic[threadid]."'>".$hottopic[title]."</a> - ($hottopic[replycount] reply)<br />";
}
else if (
$hottopic[replycount] == 0)
{
$topicstring.="<a href='showthread.php?t=".$hottopic[threadid]."'>".$hottopic[title]."</a> - (No replies)<br />";
}
else
{
$topicstring.="<a href='showthread.php?t=".$hottopic[threadid]."'>".$hottopic[title]."</a> - ($hottopic[replycount] replies)<br />";
}

I know it's crude, but it works.
Reply With Quote
  #38  
Old 08-02-2005, 01:27 AM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I updated the zip and added your name Bob. I am forced to use wordpad cause I'm here at work without my editor of choice. Somebody please make sure the zip file imports ok.
Reply With Quote
  #39  
Old 08-02-2005, 01:30 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, Amy.

You want an updated pic for it?
Reply With Quote
  #40  
Old 08-02-2005, 01:33 AM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sure. Why not. I'm no longer using this plugin on my site cause I moved the content to my side-bar.
Reply With Quote
  #41  
Old 08-02-2005, 07:52 AM
Neal-UK's Avatar
Neal-UK Neal-UK is offline
 
Join Date: Feb 2004
Location: Lancashire, England
Posts: 604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've done the re-install of the updated version but you will need to add the phrases manually again (See start of this thread).

I still can't get it to look like the rest of the 'What's going on' though.......
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:23 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.11385 seconds
  • Memory Usage 2,325KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_code
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete