View Full Version : Show most popular thread on index page
Scott MacVicar
18 Aug 2001, 20:55
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:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
add either of the following depending on what you want to be picked as most popular.
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
then below that add the following
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
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:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
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
19 Aug 2001, 01:00
doesnt show up in forum home :(
Reef Board
19 Aug 2001, 08:16
Same here - doesn't work for me, either.
Phil~
nice one PPN works fine, take a look http://www.skytronic-forums.com/forum/
ltr Mobile
don't work...
please fix bug's... :(
Scott MacVicar
19 Aug 2001, 12:06
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.
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)?
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
25 Aug 2001, 13:55
all code is correct
just doesnt show up!?
weird....
:)
pgowder
05 Nov 2001, 15:56
How can I use this on a non vb page?
Scott MacVicar
05 Nov 2001, 16:04
Is the nonvb page Perl, PHP or ASP??
or are you wishing to call it via SSI.
pgowder
05 Nov 2001, 16:15
I would prefer a ssi call, but I can make the page php if I need to.
Scott MacVicar
05 Nov 2001, 17:04
simpliest way is if the page is php
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
then just place $popular somewhere on your page and it will say like
Most popular thread is Some Title Here and the title will be a link to the thread.
pgowder
05 Nov 2001, 18:23
That did it.
Now, how could I have it include the top 5 most popular??
I want to have a box on my front page with the top 5 threads.
thanks
Scott MacVicar
05 Nov 2001, 19:05
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Use $popular list the top 5 threads with a line break seperating them adjust as you wish.
cityofangelus
10 Dec 2001, 14:12
Great hack really like this one.
Work perfectly thanks :)
Great Hack PPN, i luv it but i had the "Show most popular thread" in a table and my most popular thread has a very long title, more then 40 characters so i reduced it 2 25. If someone is interested, here it is: :)
root/index.php
find:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Under that add:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Then find in popular_thread thread:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
and change it to:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Now with this there will be 25 characters displayed of the Most Popular thread, ofcourse you can change that to your size.
musicfreak12399
21 Jun 2002, 23:29
Is there a way to do this hack for any specific forum? Because that would be really great for my board if there was a way to do that
Chris M
22 Jun 2002, 12:05
Sounds like a great hack!!!
Nice PPN...
And great idea Lesane!!!
Definately installing this one...
Satan
musicfreak12399
23 Jun 2002, 00:29
no one has ansewer to my question? im sure there is a way to do it, but i do not know how...
Is there a way to do this hack for any specific forum? Because that would be really great for my board if there was a way to do that
Can you do both of these at the same time?
Originally posted by PPN
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Exactly how would you insert this?
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
musicfreak12399
23 Jun 2002, 04:25
have it like this
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Template Change
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Thanks but I still don't understand quite yet. What about the eval part that goes under it? Don't I need 2 of them? And what do I call the templates? Can you give me the complete code with this stuff in it, please? :) And is there any way to incorporate Lesane's addon for the character limit in these?
Originally posted by musicfreak12399
have it like this
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Template Change
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
How could I do this for the following code?
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Originally posted by Lesane
Great Hack PPN, i luv it but i had the "Show most popular thread" in a table and my most popular thread has a very long title, more then 40 characters so i reduced it 2 25.
musicfreak12399,
I figured it out. Instead of making any templates, I just used the template code you gave directly in the forum home template. I put the first 2 parts in the index.php and that last 2 lines of code in the forumhome template. Is that what you meant?
Is there any way to make these so they won't show a private forum or thread?
Snapperhaed
27 Mar 2003, 03:12
Nice Hack thanks. Installed on v2.3 #3 Easily. The code I used was that which was posted by 'musicfreak12399' above. There is a slight code difference.
On the forum home template, you will note that his code has an extra: '[threadid]' on it - While it will work that way, its not correct. Just remove it from the end and you should be fine.
Thanks!
vBulletin® v3.6.12, Copyright ©2000-2012, Jelsoft Enterprises Ltd.