phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

Top Viewed posts on view forum


 
Search this topic... | Search phpBB2 Discussion... | Search Box
Register or Login to Post    Index » phpBB2 Discussion  Previous TopicPrint TopicNext Topic
Author Message
JLA
Board Member



Joined: 30 Apr 2009

Posts: 310
Location: U.S.A


flag
PostPosted: Wed Sep 18, 2013 10:40 pm 
Post subject: Top Viewed posts on view forum

Before again re-inventing the wheel - are there any old mods for displaying the top 5 viewed posts on the viewforum page for a given forum?

Thanks

_________________
http://www.jlaforums.com
Back to top
StarWolf3000
Board Member



Joined: 10 Jun 2010

Posts: 97
Location: Germany


flag
PostPosted: Sat Sep 21, 2013 10:45 am 
Post subject: Re: Top Viewed posts on view forum

Not really.
There are several MODs with similar functionality (latest 5 posts in all forums), but one providing only the 5 top viewed topics of a given forum is not available.

You can add such a box above the topics list in viewforum, if you edit viewforum.php and viewforum_body.tpl.

I will prepare some MOD syntax compatible instructions to install such a box, so please be patient.
Back to top
JLA
Board Member



Joined: 30 Apr 2009

Posts: 310
Location: U.S.A


flag
PostPosted: Mon Sep 23, 2013 3:38 pm 
Post subject: Re: Top Viewed posts on view forum

Thanks - please let me know when its available.
_________________
http://www.jlaforums.com
Back to top
StarWolf3000
Board Member



Joined: 10 Jun 2010

Posts: 97
Location: Germany


flag
PostPosted: Thu Sep 26, 2013 1:12 pm 
Post subject: Re: Top Viewed posts on view forum

Okay, this one should make it:

Code:
##############################################################
## MOD Title: Show top 5 viewed topics in forum
## MOD Author: StarWolf3000 < n/a > (StarWolf3000) n/a
##
## MOD Description: Allows you to display the 5 most viewed
##                  topics in a forum. Supports sticky and
##                  announcement topics.
##
## MOD Version: 1.0.0
##
## Installation Level: Easy
## Installation Time: ~5 Minutes
##
##
##
## Files To Edit:
##      viewforum.php
##      language/lang_english/lang_main.php
##      templates/subSilver/viewforum_body.tpl
##
##
## Included Files: N/A
##
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
##############################################################
## MOD History:
##
##   2013-09-26 - Version 1.0.0
##      - Initial release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

Oh, and the info for the latest version on phpBB.com does not apply. Its just that I copied it over from my MOD template and forgot to change it. You know, that phpBB.com does not support the 2.x line anymore.



install_top5_viewed_topics.txt
 Description:
Top 5 viewed Topics in selected forum by StarWolf3000

Download
 Filename:  install_top5_viewed_topics.txt
 Filesize:  15.1 KB
 Downloaded:  697 Time(s)

Back to top
JLA
Board Member



Joined: 30 Apr 2009

Posts: 310
Location: U.S.A


flag
PostPosted: Tue Oct 01, 2013 6:19 pm 
Post subject: Re: Top Viewed posts on view forum

Thanks for the code. Some indexes are going to need to be added to the tables if anyone has a huge number of topics or posts in their tables. If not this query is going to take a looooong time.

Since we are only using the topics table when querying on viewforum - a single additional index appears to only be needed there.

_________________
http://www.jlaforums.com
Back to top
drathbun
Board Member



Joined: 24 Jul 2008

Posts: 663
Location: Texas


flag
PostPosted: Fri Oct 04, 2013 2:21 am 
Post subject: Re: Top Viewed posts on view forum

For what it's worth, I had a "most viewed" topics MOD installed on my first board a long time ago. Problem was, since the topics were listed as "most viewed" everyone went to look at them, which only served to keep them in the most viewed list. So the list never changed. icon_smile.gif I think if I were to consider doing it again I would add an expiration date, something like "most viewed topics started within the last 30 days" or something like that.
_________________
phpBBDoctor Blog
Back to top
StarWolf3000
Board Member



Joined: 10 Jun 2010

Posts: 97
Location: Germany


flag
PostPosted: Fri Oct 04, 2013 8:09 am 
Post subject: Re: Top Viewed posts on view forum

I remember that such a MOD existed, but this one only displayed the global top viewed topics that can be displayed for the current user.

Its not a big deal to alter my code to add the date cutoff.

@JLA: What type of index would you add to which table field in the code and in the table definition? Just a single "KEY (`topic_views`)"?
Back to top
JLA
Board Member



Joined: 30 Apr 2009

Posts: 310
Location: U.S.A


flag
PostPosted: Mon Oct 07, 2013 2:53 pm 
Post subject: Re: Top Viewed posts on view forum

drathbun - I agree about the expiration date but we probably would look to do this on a per forum basis as some of our 600+ forum sections would be affected differently.

Starwolf3000 - Ah - good question. When our view forum is queried it is only hitting the topics table. I'm thinking it would need to be a combo index of forum_id and topic_views. We've already removed the parts of the query from users and posts tables.

_________________
http://www.jlaforums.com
Back to top
Display posts from previous:   
Register or Login to Post    Index » phpBB2 Discussion  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0299 seconds using 17 queries. (SQL 0.0032 Parse 0.0024 Other 0.0244)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo