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 ignoring Global Announcements

Post by dazbobaby »

I've noticed that Top Stats isn't updating properly:
Image1.jpg
Image2.jpg
You do not have the required permissions to view the files attached to this post.

Top Stats ignoring Global Announcements

Post by Stoker »

This code is from the un-released version:

Code: Select all

// Most viewed topics
if (!empty($config['tsmvt_enable']) && sizeof($flist))
{
	$sql = 'SELECT topic_id, forum_id, topic_title, topic_views, topic_time, topic_first_poster_name, topic_first_poster_colour, topic_poster, topic_last_poster_id
		FROM ' . TOPICS_TABLE . ' 
		WHERE ' . $db->sql_in_set('forum_id', $flist) . '
		ORDER BY topic_views DESC';
	$result = $db->sql_query_limit($sql, $config['tsmvt_number']);
	
	while ($row = $db->sql_fetchrow($result))
	{
		$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id']);
		$view_first_poster = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile' . '&u=' . $row['topic_poster']);
		$view_last_poster = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile' . '&u=' . $row['topic_last_poster_id']);
		
		$template->assign_block_vars('most_viewed', array(
			'TOPIC_ID'						=> $row['topic_id'], 
			'FORUM_ID'	    				=> $row['forum_id'],
			'TOPIC_TITLE'					=> $row['topic_title'],
			'TOPIC_VIEWS'					=> $row['topic_views'],
			'TOPIC_TIME'                    => $user->format_date($row['topic_time']), 
			'TOPIC_FIRST_POSTER_NAME'		=> $row['topic_first_poster_name'],
			'TOPIC_FIRST_POSTER_COLOUR'		=> $row['topic_first_poster_colour'],
			'U_FIRST_TOPIC'					=> $view_topic_url,
			'USERNAME_FIRST'				=> $view_first_poster,
			'USERNAME_LAST'					=> $view_last_poster,
		));
	}
	$db->sql_freeresult($result);
	
	$template->assign_vars(array(
		'S_TSMVT_ENABLE'      			=> $config['tsmvt_enable'],
		'TSMVT_NUMBER'					=> $config['tsmvt_number'],
    ));
}
	
// Most replied topics
if (!empty($config['tsmrt_enable']) && sizeof($flist))
{
	$sql = 'SELECT topic_id, forum_id, topic_title, topic_replies, topic_time, topic_first_poster_name, topic_first_poster_colour, topic_poster, topic_last_poster_id 
		FROM ' . TOPICS_TABLE . ' 
		WHERE ' . $db->sql_in_set('forum_id', $flist) . '
		ORDER BY topic_replies DESC';
	$result = $db->sql_query_limit($sql, $config['tsmrt_number']);
	
	while ($row = $db->sql_fetchrow($result))
	{
		$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id']);
		$view_first_poster = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile' . '&u=' . $row['topic_poster']);
		$view_last_poster = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile' . '&u=' . $row['topic_last_poster_id']);
		
		$template->assign_block_vars('most_replied', array(
			'TOPIC_ID'						=> $row['topic_id'], 
			'FORUM_ID'	    				=> $row['forum_id'],
			'TOPIC_TITLE'					=> $row['topic_title'],
			'TOPIC_REPLIES'					=> $row['topic_replies'],
			'TOPIC_TIME'                    => $user->format_date($row['topic_time']), 
			'TOPIC_FIRST_POSTER_NAME'		=> $row['topic_first_poster_name'],
			'TOPIC_FIRST_POSTER_COLOUR'		=> $row['topic_first_poster_colour'],
			'U_FIRST_TOPIC'					=> $view_topic_url,
			'USERNAME_FIRST'				=> $view_first_poster,
			'USERNAME_LAST'					=> $view_last_poster,
		));
	}
	$db->sql_freeresult($result);
	
	$template->assign_vars(array(
		'S_TSMRT_ENABLE'      			=> $config['tsmrt_enable'],
		'TSMRT_NUMBER'					=> $config['tsmrt_number'],
    ));
}
Should work with global announcements.

Top Stats ignoring Global Announcements

Post by dazbobaby »

Which file is this from Stoker?

got it, functions_top_stats.php

Top Stats ignoring Global Announcements

Post by Stoker »

yes, the most viewed and most replied part of it.

Top Stats issue

Post by matthewtimothy »

I am having problems installing this on my test site. I am running 3.0.10 with the dirtyboard style. I installed this with automod and everything was green lighted. I purged and refreshed dirtyboard so far three times. I know I ran into in the past it was installing under prosilver so I deleted the theme in styles. The only other active style is Artodia mobile. I did make sure to run install_top_stats.php if wondered. When I went to uninstall the mod it worked. I than went to domain/install_top_stats.php and unistalled there. It gave me a green light for success. Now when I view my board i get this error message: template->_tpl_load_file(): File ./styles/DirtyBoard2.0/template/recent_active_body.html does not exist or is empty

1. What may be going wrong for it not to be working??
2. How do i fix this error message??

Worst comes to worst I do have everything backed up and the sql backed up (or I think i do successfully).

thanks

Top Stats issue

Post by Stoker »

1. You need to install it on all styles. Top Stats only supports prosilver so you will have to look close in the dirty style to figure out the changes.
2. The error tells you that the file is missing. So you can just upload the recent_active_body.html to the /styles/DirtyBoard2.0/template folder

Top Stats issue

Post by matthewtimothy »

well in the mod i tried automod>mod>details>to dirtyboard2.0 but I get errors. That would also make since why some other mods I installed I can see on the back end but arent really showing up. Also when I backed up the files before the installs today I did not see recent_active. Although I ONLY looked in the dirtyboard style and not prosilver which may be why.

Thanks, Ill dig deeper and get back. My goal today is to install EVERY stroker mod and then some. Ill also test out the BBCmod you have on a new board.

EDIT:
If i enable prosilver the mods work but not in dirtyboard so need to figure out how :evil:

Top Stats (Percent)

Post by Rhyno »

Heya

How would i get percentage stat on top stats like you have here?

Cheers

Top Stats (Percent)

Post by Stoker »

It will be available in next version.

Top Stats (Percent)

Post by martin123456 »

Rhyno3000 wrote:Heya

How would i get percentage stat on top stats like you have here?

Cheers

viewtopic.php?f=49&t=1955&p=12442&hilit=collapse#p12442 cough

its withing the edits on this topic