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 10 markup


 
Search this topic... | Search MOD Requests... | Search Box
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Author Message
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Tue Mar 23, 2010 4:35 am 
Post subject: Top 10 markup

Hi,

I would like to mark up the top 10 active topics in viewforum and in the search-result.
Is that possible?

icon_biggrin.gif

/Holger
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Wed Jun 02, 2010 4:09 am 
Post subject: Re: Top 10 markup

Nobody?
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 449
Location: Québec


flag
PostPosted: Wed Jun 02, 2010 11:31 am 
Post subject: Re: Top 10 markup

Doesn't sound too hard, but I don't actually know what you mean icon_redface.gif
Can you explain or give an example, please?
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Wed Jun 02, 2010 1:38 pm 
Post subject: Re: Top 10 markup

icon_redface.gif
I would like to mark up the 10 most active topics with a star or something ...
When clicking on the STAR I get to a list with the most active topics.
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 449
Location: Québec


flag
PostPosted: Wed Jun 02, 2010 5:55 pm 
Post subject: Re: Top 10 markup

Hm, so when you go to viewforum, these ten would appear first or they would just have the star added? The way I see it, you would have to make a query searching for the number of posts in every topic (in that forum only, possibly) and making a top ten, then check for every topic displayed in the page if it's part of those. If so, add the star, otherwise skip to the next.

I can't really get involved in that much code at the moment, though, and I'm not too familiar with this area of phpBB2.

The query should look like SELECT topic FROM table WHERE forum = this_one ORDER BY post_count DESC LIMIT 10, I think. But I don't know the names of all the tables and columns and I'm not even sure there is a "post_count" entry in the topics' table...
Then you could check, in viewforum, where the topics are inserted into the page, if whatever variable they use to identify them is found in the array returned by the query, and add the star accordingly.
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Thu Jun 03, 2010 2:37 am 
Post subject: Re: Top 10 markup

Quote:
... or they would just have the star added?

Exactly!

Thank you for helping me going in the right direction!
Yes, they should be marked with a star in viewforum and in viewtopic.

Does anybody know if there is a possibility to calculate the activity?
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 449
Location: Québec


flag
PostPosted: Thu Jun 03, 2010 12:45 pm 
Post subject: Re: Top 10 markup

As I can see, forum_topic has the topic_views and topic_replies columns that could be used. You could just pick the highest value from one of these (or both), depending on your personal definition of "active".

This table also has a forum_id column, as I suspected, which is perfect for what you're trying to do. My SQL is a bit rusted, but you should be able to use something pretty close to this: SELECT topic_id FROM forum_topics WHERE forum_id = '$forum_id' ORDER BY topic_replies DESC LIMIT 10

The rest isn't going to be too easy, though. You'll have to have a good look through viewforum.php, check how they handle topics and display them. You'll probably need exceptions for announcements (which are shown on every page) and forums that have less than 10 topics.

Good luck!

Edit: I just saw you want the star in viewtopic.php as well. This one should be easier, since you just have to run the query and display the star where you want if this topic_id is part of the results.
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Fri Jun 04, 2010 2:41 am 
Post subject: Re: Top 10 markup

Thank you so much Salvatos! I will give it a try!
Back to top
Dog Cow
Board Member



Joined: 18 Nov 2008

Posts: 378


flag
PostPosted: Tue Jun 15, 2010 2:03 pm 
Post subject: Re: Top 10 markup

Have a look at this MOD: http://www.phpbb.com/community/viewtopic.php?f=16&t=506862
_________________
Moof!
Lincoln's Tomb, Oak Ridge Cemetery, Springfield ILMac 512K BlogMac GUI
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Tue Jun 15, 2010 2:13 pm 
Post subject: Re: Top 10 markup

Whooo-hoooo! That looks nice! icon_biggrin.gif
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Wed Jun 16, 2010 5:10 am 
Post subject: Re: Top 10 markup

It works very nice, but I had to deactivate AJAX (AJAX Refresh Rate = 0).
The AJAX-function destroyed the complete page.
Back to top
dondino
Board Member



Joined: 09 Dec 2008

Posts: 144


flag
PostPosted: Thu Jul 01, 2010 10:47 am 
Post subject: Re: Top 10 markup

maybe dog cow can revise its code
Back to top
Dog Cow
Board Member



Joined: 18 Nov 2008

Posts: 378


flag
PostPosted: Fri Jul 02, 2010 5:17 pm 
Post subject: Re: Top 10 markup

I don't know. It could be that you would need to make changes for your specific template. I tested the AJAX code using the phpBB 2.0.23 subsilver template, and that was it.
_________________
Moof!
Lincoln's Tomb, Oak Ridge Cemetery, Springfield ILMac 512K BlogMac GUI
Back to top
Display posts from previous:   
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT - 4 Hours
 
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.0497 seconds using 17 queries. (SQL 0.0094 Parse 0.0009 Other 0.0393)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo