Top Stats

Modifications for phpBB3.
Try the Mods here and share Your own Mods
Forum rules
You dont have to use ModX or make your mod AutoMod compatible. A simple textfile is fine
But if you post Mods here You also have to give support

Top Stats

Post by mikef35 »

I am using the top stats mod, I understand that if a user does not have permissions to view a certain forum the topics from that forum will not show up in the top 10 scroll. I have been looking at the code but have had no luck in figuring this one out. Does anybody know what would have to be done to make all active topics show in the scroll no matter what the permissions of the user is?


Thanks

Top Stats

Post by martin123456 »

As it's forum permissions based why not just allow it in permissions to see the said forums but with no read permissions ? that way they will see the forums but not read the topics.

Top Stats

Post by mikef35 »

I don't follow what you are saying. The mod only shows users topics based on the users permissions. Or am I wrong?

Top Stats

Post by Stoker »

You are right. Thats how it works.
Why do you want to give permissions for this? Cant you just give users permissions to read the forum?

Top Stats

Post by mikef35 »

I would like the the scroll to show the accurate activity of the forum. If it shows that there is a lot activity in restricted forums it might entice others to apply for those permissions. So, is there a way without having to complete reconstuctive surgery?

Top Stats

Post by Stoker »

Open functions_top_stats.php
Find

Code: Select all

/ Recent Active Topics
if (!empty($config['tsrat_enable']) && sizeof($flist))
{	
	$sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, t.topic_time, t.topic_views, t.topic_poster, t.topic_replies, t.topic_first_poster_name, t.topic_first_poster_colour, t.topic_last_post_id, t.topic_last_poster_name, t.topic_last_poster_colour, t.topic_last_post_time, t.topic_last_view_time, t.topic_last_poster_id, f.forum_name, f.forum_image
		FROM ' . TOPICS_TABLE . ' t
		LEFT JOIN ' . FORUMS_TABLE . ' f ON (t.forum_id = f.forum_id)
		WHERE ' . $db->sql_in_set('t.forum_id', $flist) . ' AND t.topic_moved_id = 0
		ORDER BY t.topic_last_post_time DESC';
	$result = $db->sql_query_limit($sql, $config['tsrat_number']);
Replace with

Code: Select all

// Recent Active Topics
if (!empty($config['tsrat_enable']))
{	
	$sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, t.topic_time, t.topic_views, t.topic_poster, t.topic_replies, t.topic_first_poster_name, t.topic_first_poster_colour, t.topic_last_post_id, t.topic_last_poster_name, t.topic_last_poster_colour, t.topic_last_post_time, t.topic_last_view_time, t.topic_last_poster_id, f.forum_name, f.forum_image
		FROM ' . TOPICS_TABLE . ' t
		LEFT JOIN ' . FORUMS_TABLE . ' f ON (t.forum_id = f.forum_id)
		WHERE t.topic_moved_id = 0
		ORDER BY t.topic_last_post_time DESC';
	$result = $db->sql_query_limit($sql, $config['tsrat_number']);
Test it.-

Top Stats

Post by mikef35 »

Worked well, Thanks

Top Stats

Post by mikef35 »

Stoker,
The above worked well, but what if I wanted to exclude a certain forums. Right now I have it to where all forums show (using your refined code edit above) now I have 2 forums I would like to not show. Any ideas? Thanks

Top Stats

Post by Stoker »

It has been asked before, either here or in the topic at phpbb.com
Do a search nd let me know.

Top Stats

Post by mikef35 »

I have been searching. If you think of it let me know please. Thanks