vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Top 5 "Hot" Topics on Forum Home Page (https://vborg.vbsupport.ru/showthread.php?t=93094)

amykhar 07-27-2005 10:00 PM

Top 5 "Hot" Topics on Forum Home Page
 
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

Darth Gill 07-28-2005 11:14 PM

I installed it and modified the template a little bit to my liking. But you have a HUGE BUG!

Take this out of $topicstring in the plugin! "http://www.eaforums.com/forums/"

amykhar 07-28-2005 11:33 PM

Quote:

Originally Posted by Darth Gill
I installed it and modified the template a little bit to my liking. But you have a HUGE BUG!

Take this out of $topicstring in the plugin! "http://www.eaforums.com/forums/"

Oops. I never really intended to share this one. I'll fix that now.

amykhar 07-28-2005 11:42 PM

The problem is fixed in the zip.

Neal-UK 07-29-2005 12:56 AM

Quote:

Originally Posted by amykhar
The problem is fixed in the zip.

still doing it on my forum

Neal-UK 07-29-2005 01:03 AM

...but sorted it 'mesell'

kall 07-29-2005 07:11 AM

Hahahahah! Love the 5th Topic's title amy!!

Boofo 07-29-2005 08:08 AM

That's our Amy! ;)

If anyone is interested, I edited a few things to make this look more in line with the rest of the What's Going On box. See the attached pic. ;)

It is also collaspable. ;)

Darth Gill 07-29-2005 11:03 AM

I did the same thing... I made it collapseable as well as moved the number of replies to the title attribute so that it shows only on mouseovers. I also replaced the breaklines with spaces.... One more change is since my board likes to have long lengthy discussions over months at a time, I made it the 5 hottest topics for the month. :)

Here's a screenshot.

http://forums.5solas.org/

amykhar 07-29-2005 01:26 PM

Yeah, my what's going on box is very different than most people's. That's why I put in there that the html was only a suggestion ;)

Amy

amykhar 07-29-2005 01:27 PM

Cripes! I just looked at the screenshot. Off to repair it :blush:

Amy

Boofo 07-29-2005 07:28 PM

Quote:

Originally Posted by Darth Gill
I did the same thing... I made it collapseable as well as moved the number of replies to the title attribute so that it shows only on mouseovers. I also replaced the breaklines with spaces.... One more change is since my board likes to have long lengthy discussions over months at a time, I made it the 5 hottest topics for the month. :)

Here's a screenshot.

http://forums.5solas.org/

Looks good and I really like the wood looking thead and tcat. ;)

GrendelKhan{TSU 07-30-2005 03:10 AM

cool thx amy!

<<< installs

Quote:

Originally Posted by Boofo
That's our Amy! ;)

If anyone is interested, I edited a few things to make this look more in line with the rest of the What's Going On box. See the attached pic. ;)

It is also collaspable. ;)

im interested. :) can I get get this somehow? :D

Neal-UK 07-30-2005 03:43 AM

Quote:

Originally Posted by Boofo
That's our Amy! ;)

If anyone is interested, I edited a few things to make this look more in line with the rest of the What's Going On box. See the attached pic. ;)

It is also collaspable. ;)

I overwrote the hack with the new version but the list is exactly the same.

I unistalled the hack and reinstalled it but the list still looks the same.

amykhar 07-30-2005 03:46 AM

Quote:

Originally Posted by nealparry
I overwrote the hack with the new version but the list is exactly the same.

I unistalled the hack and reinstalled it but the list still looks the same.

I'm not sure what you are saying to me? What did you expect to change?

Amy

Neal-UK 07-30-2005 03:46 AM

Quote:

Originally Posted by amykhar
I'm not sure what you are saying to me? What did you expect to change?

Amy

you said you had made some changes so it fits in with the rest of 'what's going on'

amykhar 07-30-2005 03:48 AM

No. I never said that :) Somebody else said they made changes on their board. In the install instructions, I specifically noted that the template html was just a suggestion and you may want to tweak it.

I fixed the url problem that the first user has.

Amy

Neal-UK 07-30-2005 03:50 AM

Quote:

Originally Posted by amykhar
No. I never said that :) Somebody else said they made changes on their board. In the install instructions, I specifically noted that the template html was just a suggestion and you may want to tweak it.

I fixed the url problem that the first user has.

Amy

sorry your right, it's that time again!

Boofo 07-30-2005 04:58 AM

Quote:

Originally Posted by GrendelKhan{TSU
cool thx amy!

<<< installs



im interested. :) can I get get this somehow? :D

If amy ok's it, I will post the changes here. A very small part of the xml had to be changed, too. ;)

Neal-UK 07-30-2005 09:55 AM

Quote:

Originally Posted by Boofo
If amy ok's it, I will post the changes here. A very small part of the xml had to be changed, too. ;)

yes please good bud!

Neal-UK 07-30-2005 05:52 PM

Quote:

Originally Posted by nealparry
yes please good bud!

go on, you know you want too

GrendelKhan{TSU 08-01-2005 08:39 AM

Quote:

Originally Posted by GrendelKhan{TSU
im interested. :) can I get get this somehow? :D

bump


or can someone direct me to the location of the instructions to do this. (change design to match forums)

<< hopeless n00b :(

amykhar 08-01-2005 01:57 PM

Bob, have mercy on em already :D If they wait for me to make a template edit, they'll have grandchildren. :D

Boofo 08-01-2005 02:06 PM

All I was waiting for was your ok. I'll post it shortly. ;)

Boofo 08-01-2005 02:09 PM

In your FORUMHOME template

Find:

HTML Code:

</table>
<br />
<!-- end what's going on box -->

ABOVE it add:

HTML Code:

<!-- This Week's Hot Topics -->
<tbody>
<tr>
<td class="thead" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_hottopics')"><img id="collapseimg_forumhome_hottopics" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_hottopics].gif" alt="" border="0" /></a><span class="smallfont"><strong>$vbphrase[hottopics]</strong><span>
</td>
</tr>
</tbody>
<tbody id="collapseobj_forumhome_hottopics" style="$vbcollapse[collapseobj_forumhome_hottopics]">
$hottopics
</tbody>
<!-- end This Week's Hot Topics -->

Make a new phrase:

Quote:

Phrase Type: GLOBAL
Product: Hot Topics on Forum Home
Varname: hottopics
Text: This Week's Hot Topics
Done!
Enjoy!

BS5 08-01-2005 05:33 PM

Hello,

I have upload this plugin but I have this erorr (see it in attach). It upload with out any title.

BS5

amykhar 08-01-2005 05:38 PM

I don't know what could be going wrong. I have not changed the plugin and nobody else seems to have that problem.

Rich 08-01-2005 05:49 PM

Hello,

Exactly how do I install this? lol I downloaded the package, and took a look at the install directions. Then I went in to the ACP to see where I Import Products, but I have no idea where that is to be done. lol
This is my first modification to a 3.5 RC1. Sorry for my ignorance.

Neal-UK 08-01-2005 06:14 PM

Quote:

Originally Posted by Boofo
In your FORUMHOME template

I've done all that but mine still looks exactly the same...weird

womensden 08-01-2005 08:33 PM

Worked perfect. Another job well done Amy!

*Clicks install*

Kusadasi-Guy 08-01-2005 11:32 PM

Amycar, this is a great plugin!
is there a chance to put this on a vb-powered custom page?

amykhar 08-01-2005 11:34 PM

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

Kusadasi-Guy 08-01-2005 11:45 PM

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') . '");');

?>


Boofo 08-02-2005 12:31 AM

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.

amykhar 08-02-2005 01:08 AM

Go for it. I'll even add you as co-author and put it in the original post with your template mod.

Boofo 08-02-2005 01:19 AM

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

amykhar 08-02-2005 01:27 AM

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.

Boofo 08-02-2005 01:30 AM

Thanks, Amy. ;)

You want an updated pic for it?

amykhar 08-02-2005 01:33 AM

Sure. Why not. :D I'm no longer using this plugin on my site cause I moved the content to my side-bar.

Neal-UK 08-02-2005 07:52 AM

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


All times are GMT. The time now is 04:50 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.01510 seconds
  • Memory Usage 1,847KB
  • 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
  • (2)bbcode_html_printable
  • (2)bbcode_php_printable
  • (15)bbcode_quote_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
  • (40)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