Top stats collapse issue

Download and support for PhpBB3 Top Stats Mod
Locked
User avatar
martin123456
BBCoder VI
BBCoder VI
Posts: 765
Joined: 25 Jul 2011, 13:29
BBCodes: 34
Favourite MOD: Ban button
Location: Down south!
Contact:

Top stats collapse issue

Post by martin123456 »

Using pre_mod version 3.0.10

I have mchat and the forum cats collapsing also the 10 recent active topics collapsing too :D

but the bottom half of the top stats mod there is no collapse symble

i used your files from this topic below
viewtopic.php?f=49&t=1532&hilit=collapse

and they killed the top half of the mod from collapsing

so i went here http://www.christianbullock.com/2011/ph ... th-cookies and it seems premod has all the edits done already

any idea's ? why the top stats bottom half of the mod has no collapse.

linky if needed http://www.blades-place.co.uk/
User avatar
Stoker
Site Admin
Site Admin
Posts: 3521
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Top stats collapse issue

Post by Stoker »

None of the topstats are collapsing?
Try this for html:

Code: Select all

<!-- IF S_TSMVT_ENABLE or S_TSMRT_ENABLE -->
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<!-- IF S_TSMVT_ENABLE -->
<td valign="top"<!-- IF S_TSMRT_ENABLE --> style="padding-right:2px; width:50%;"<!-- ENDIF -->>
	<div class="forumlist">
	<div class="forabg">
		<div class="inner"><span class="corners-top"><span></span></span>
		<ul class="topiclist">
			<li class="header">
				<dl>
					<dt style="width:70%;">{TSMVT_NUMBER} {L_MOST_VIEWED}</dt>
					<dd class="lastpost" style="width:auto;"><span>{L_VIEWS}</span></dd>
				</dl>
			</li>
		</ul>
		<div class="portaltrigger portalactive"></div>
		<div class="collapsethis">
		<ul class="topiclist forums">
			<!-- BEGIN most_viewed -->
			<li class="row">
			<dl>
				<dt style="width:70%;"><a style="font-size:1.1em; font-weight:bold;" href="{most_viewed.U_FIRST_TOPIC}">{most_viewed.TOPIC_TITLE}</a><br />{L_POST_BY_AUTHOR} <a style="font-weight:bold; color: #{most_viewed.TOPIC_FIRST_POSTER_COLOUR};" href="{most_viewed.USERNAME_FIRST}">{most_viewed.TOPIC_FIRST_POSTER_NAME}</a> {L_POSTED_ON_DATE} {most_viewed.TOPIC_TIME}</dt>
				<dd class="lastpost" style="width:auto;"><span style="font-size:1.1em;">{most_viewed.TOPIC_VIEWS}</span></dd>
			</dl>
			</li>
			<!-- END most_viewed -->
		</ul>
		</div>
		<span class="corners-bottom"><span></span></span></div>
	</div>
	</div>
</td>
<!-- ENDIF -->
<!-- IF S_TSMRT_ENABLE -->
<td valign="top"<!-- IF S_TSMVT_ENABLE --> style="padding-left:2px; width:50%;"<!-- ENDIF -->>
	<div class="forumlist">
	<div class="forabg">
		<div class="inner"><span class="corners-top"><span></span></span>
		<ul class="topiclist">
			<li class="header">
				<dl>
					<dt style="width:70%;">{TSMRT_NUMBER} {L_MOST_REPLIED}</dt>
					<dd class="lastpost" style="width:auto;"><span>{L_REPLIES}</span></dd>
				</dl>
			</li>
		</ul>
		<div class="portaltrigger portalactive"></div>
		<div class="collapsethis">
		<ul class="topiclist forums">
			<!-- BEGIN most_replied -->
			<li class="row">
			<dl>
				<dt style="width:70%;"><a style="font-size:1.1em; font-weight:bold;" href="{most_replied.U_FIRST_TOPIC}">{most_replied.TOPIC_TITLE}</a><br />{L_POST_BY_AUTHOR} <a style="font-weight:bold; color: #{most_replied.TOPIC_FIRST_POSTER_COLOUR};" href="{most_replied.USERNAME_FIRST}">{most_replied.TOPIC_FIRST_POSTER_NAME}</a> {L_POSTED_ON_DATE} {most_replied.TOPIC_TIME}</dt>
				<dd class="lastpost" style="width:auto;"><span style="font-size:1.1em;">{most_replied.TOPIC_REPLIES}</span></dd>
					
			</dl>
			</li>
			<!-- END most_replied -->
		</ul>
		</div>
		<span class="corners-bottom"><span></span></span></div>
	</div>
	</div>
</td>
<!-- ENDIF -->
</tr>
</table>
<!-- ENDIF -->

<!-- IF S_TSMAU_ENABLE or S_TSMAF_ENABLE -->
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<!-- IF S_TSMAU_ENABLE -->
<td valign="top"<!-- IF S_TSMAF_ENABLE --> style="padding-right:2px; width:50%;"<!-- ENDIF -->>
	<div class="forumlist">
	<div class="forabg">
		<div class="inner"><span class="corners-top"><span></span></span>
		<ul class="topiclist">
			<li class="header">
				<dl>
					<dt style="width:70%;">{TSMAU_NUMBER} {L_MOST_ACTIVE_USERS}</dt>
					<dd class="lastpost" style="width:auto;"><span>{L_POSTS}</span></dd>
				</dl>
			</li>
		</ul>
		<div class="portaltrigger portalactive"></div>
		<div class="collapsethis">
		<ul class="topiclist forums">
			<!-- BEGIN most_active_users -->
			<li class="row">
			<dl>
				<dt style="width:70%;"><a style="font-size:1.1em; font-weight:bold; color: #{most_active_users.USER_COLOUR};" href="{most_active_users.USER_ID}">{most_active_users.USERNAME}</a><br />{L_JOINED_US} {most_active_users.USER_REG}</dt>
				<dd class="lastpost" style="width:auto;"><span style="font-size:1.1em;"><a href="{most_active_users.USER_POST_SEARCH}">{most_active_users.USER_POSTS}</a> ({most_active_users.USER_POST_PERCENT}%)</span></dd>
			</dl>
			</li>
			<!-- END most_active_users -->
		</ul>
		</div>
		<span class="corners-bottom"><span></span></span></div>
	</div>
	</div>
</td>
<!-- ENDIF -->
<!-- IF S_TSMAF_ENABLE -->
<td valign="top"<!-- IF S_TSMAU_ENABLE --> style="padding-left:2px; width:50%;"<!-- ENDIF -->>
	<div class="forumlist">
	<div class="forabg">
		<div class="inner"><span class="corners-top"><span></span></span>
		<ul class="topiclist">
			<li class="header">
				<dl>
					<dt style="width:70%;">{TSMAF_NUMBER} {L_MOST_ACTIVE_FORUMS}</dt>
					<dd class="lastpost" style="width:auto;"><span>{L_POSTS}</span></dd>
				</dl>
			</li>
		</ul>
		<div class="portaltrigger portalactive"></div>
		<div class="collapsethis">
		<ul class="topiclist forums">
			<!-- BEGIN most_active_forums -->
			<li class="row">
			<dl>
				<dt style="width:70%;"><a style="font-size:1.1em; font-weight:bold;" href="{most_active_forums.FORUM_URL}">{most_active_forums.FORUM_NAME}</a><br />{most_active_forums.FORUM_DESC}</dt>
				<dd class="lastpost" style="width:auto;"><span style="font-size:1.1em;">{most_active_forums.FORUM_POSTS} ({most_active_forums.FORUM_POSTS_PERCENT}%)</span></dd>
				
			</dl>
			</li>
			<!-- END most_active_forums -->
		</ul>
		</div>
		<span class="corners-bottom"><span></span></span></div>
	</div>
	</div>
</td>
<!-- ENDIF -->
</tr>
</table>
<!-- ENDIF -->

<!-- IF S_TSLVB_ENABLE or S_TSLRU_ENABLE -->
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<!-- IF S_TSLVB_ENABLE -->
<td valign="top"<!-- IF S_TSLVB_ENABLE --> style="padding-right:2px; width:50%;"<!-- ENDIF -->>
	<div class="forumlist">
	<div class="forabg">
		<div class="inner"><span class="corners-top"><span></span></span>
		<ul class="topiclist">
			<li class="header">
				<dl class="icon">
					<dt style="width:98%;">{TSLVB_NUMBER} {L_LAST_VISITED_BOTS}</dt>
				</dl>
			</li>
		</ul>
		<div class="portaltrigger portalactive"></div>
		<div class="collapsethis">
		<ul class="topiclist forums">
			<!-- BEGIN last_visited_bots -->
			<li class="row">
			<dl>
				<dt style="width:98%;">
					<span style="float:left; font-size:1.1em; font-weight:bold; color: #{last_visited_bots.USER_COLOUR};">{last_visited_bots.USERNAME}</span>
					<span style="float:right; font-size:1.1em;">{last_visited_bots.USER_LAST_VISIT}</span>
				</dt>
			</dl>
			</li>
			<!-- END last_visited_bots -->
		</ul>
		</div>
		<span class="corners-bottom"><span></span></span></div>
	</div>
	</div>
</td>
<!-- ENDIF -->
<!-- IF S_TSLRU_ENABLE -->
<td valign="top"<!-- IF S_TSLRU_ENABLE --> style="padding-left:2px; width:50%;"<!-- ENDIF -->>
	<div class="forumlist">
	<div class="forabg">
		<div class="inner"><span class="corners-top"><span></span></span>
		<ul class="topiclist">
			<li class="header">
				<dl class="icon">
					<dt style="width:98%;">{TSLRU_NUMBER} {L_LAST_REGISTERED_USERS}</dt>
				</dl>
			</li>
		</ul>
		<div class="portaltrigger portalactive"></div>
		<div class="collapsethis">
		<ul class="topiclist forums">
			<!-- BEGIN last_registered_user -->
			<li class="row">
			<dl>
				<dt style="width:98%;">
					<span style="float:left; font-size:1.1em; font-weight:bold;"><a style="font-weight:bold; color:#{last_registered_user.USER_COLOUR};" href="{last_registered_user.USER_URL}">{last_registered_user.USERNAME}</a></span>
					<span style="float:right; font-size:1.1em;">{last_registered_user.USER_REGISTERED}</span>
				</dt>
			</dl>
			</li>
			<!-- END last_registered_user -->
		</ul>
		</div>
		<span class="corners-bottom"><span></span></span></div>
	</div>
	</div>
</td>
<!-- ENDIF -->
</tr>
</table>
<!-- ENDIF -->
Board rules! No PM support
User avatar
martin123456
BBCoder VI
BBCoder VI
Posts: 765
Joined: 25 Jul 2011, 13:29
BBCodes: 34
Favourite MOD: Ban button
Location: Down south!
Contact:

Top stats collapse issue

Post by martin123456 »

That fixed it but it gave me % marks like you have here. :D
User avatar
Stoker
Site Admin
Site Admin
Posts: 3521
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Top stats collapse issue

Post by Stoker »

Then you need the includes file too:

Code: Select all

<?php
/**
*
* @package phpBB3
* @version $Id: functions_top_stats.php v1.0.9 20011/25/12 Stoker $
* @copyright (c) 2011 PhpBB3 BBCodes
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
	exit;
}

/**
* Include only once.
*/
if (!defined('INCLUDES_FUNCTIONS_TOP_STATS_PHP'))
{
	define('INCLUDES_FUNCTIONS_TOP_STATS_PHP', true);
	
	$flist = $auth->acl_getf('f_read', true);
	$flist = array_unique(array_keys($flist));
	
// 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 AND t.topic_approved = 1
		ORDER BY t.topic_last_post_time DESC';
	$result = $db->sql_query_limit($sql, $config['tsrat_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_last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_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']);
		$view_viewforum_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']);
		
		$template->assign_block_vars('recent_active', array(
			'TOPIC_TITLE'					=> $row['topic_title'],
			'TOPIC_TIME'                    => $user->format_date($row['topic_time']), 
			'TOPIC_VIEWS'					=> $row['topic_views'],
			'TOPIC_REPLIES'					=> $row['topic_replies'],
			'TOPIC_FIRST_POSTER_NAME'		=> $row['topic_first_poster_name'],
			'TOPIC_FIRST_POSTER_COLOUR'		=> $row['topic_first_poster_colour'],
			'TOPIC_LAST_POSTER_NAME'		=> $row['topic_last_poster_name'],
			'TOPIC_LAST_POSTER_COLOUR'		=> $row['topic_last_poster_colour'],
			'TOPIC_LAST_POST_TIME'			=> $user->format_date($row['topic_last_post_time']),
			'TOPIC_LAST_VIEW_TIME'			=> $user->format_date($row['topic_last_view_time']),
			'U_FIRST_TOPIC'					=> $view_topic_url,
			'U_LAST_TOPIC'					=> $view_last_post_url,
			'USERNAME_FIRST'				=> $view_first_poster,
			'USERNAME_LAST'					=> $view_last_poster,
			'FORUM_NAME'					=> $row['forum_name'],
			'FORUM_IMAGE'					=> $row['forum_image'],
			'FORUM_URL'						=> $view_viewforum_url,
		));
	}
	$db->sql_freeresult($result);
	
	$template->assign_vars(array(
        'JSSCROLL_SPEED'				=> $config['tsjss_speed'],
		'JSSCROLL_INTERVAL'				=> $config['tsjss_interval'],
		'TSRAT_NUMBER'					=> $config['tsrat_number'],
		'TS_JSSCROLL_DIRECTION'			=> $config['ts_jsscroll_direction'],
		'TS_JSSCROLL_PAUSE'				=> $config['ts_jsscroll_pause'],
		'TS_JSSCROLL_NAVIGATION'		=> $config['ts_jsscroll_navigation'],
		'S_TSRAT_ENABLE'      			=> $config['tsrat_enable'],
		'S_TS_JSSCROLL'      			=> $config['ts_jsscroll'],
		'S_TS_TICKER' 	     			=> $config['ts_ticker_enable'],
    ));
}
	
// 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'],
    ));
}

// Most active users
if (!empty($config['tsmau_enable']))
{	
	if( ( $active_users = $cache->get('_ts_most_active_users') ) === false )
	{
		$sql = 'SELECT user_id, username, user_posts, user_colour, user_regdate
			FROM ' . USERS_TABLE . ' WHERE user_inactive_time = 0 AND group_id <> 11
			ORDER BY user_posts DESC';
		$result = $db->sql_query_limit($sql, $config['tsmau_number']);
		
		$active_users = array();
		while ($row = $db->sql_fetchrow($result))
		{
			$active_users[] = $row;
		}
	  
		$db->sql_freeresult($result);

		// Cache for 1 hour
		$cache->put('_ts_most_active_users', $active_users, 3600);
	}
	
	foreach( $active_users as $row )
	{
		$most_active_user = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile' . '&u=' . $row['user_id']);
		$most_active_user_search = append_sid("{$phpbb_root_path}search.$phpEx", 'author_id=' . $row['user_id'] . '&sr=posts');
		$most_active_user_percent = ($row['user_posts'] * 100) / $total_posts;
		
		$template->assign_block_vars('most_active_users', array(
			'USER_ID'						=> $most_active_user,
			'USER_POST_SEARCH'				=> $most_active_user_search,
			'USER_POST_PERCENT'				=> number_format($most_active_user_percent, 2),
			'USERNAME'						=> $row['username'],
			'USER_REG'						=> $user->format_date($row['user_regdate']),
			'USER_POSTS'					=> $row['user_posts'],
			'USER_COLOUR'					=> $row['user_colour'],
		));
	}
	$db->sql_freeresult($result);
	
	$template->assign_vars(array(
		'S_TSMAU_ENABLE'      			=> $config['tsmau_enable'],
		'TSMAU_NUMBER'					=> $config['tsmau_number'],
    ));
}

// Most active forums
if (!empty($config['tsmaf_enable']) && sizeof($flist))
{
	$sql = 'SELECT forum_id, forum_name, forum_posts, forum_desc
		FROM ' . FORUMS_TABLE . ' WHERE ' . $db->sql_in_set('forum_id', $flist) . ' AND forum_type = ' . FORUM_POST . '
		ORDER BY forum_posts DESC';
	$result = $db->sql_query_limit($sql, $config['tsmaf_number']);
	
	while ($row = $db->sql_fetchrow($result))
	{
		$most_active_forums = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']);
		$most_active_forums_percent = ($row['forum_posts'] * 100) / $total_posts;
		
		$template->assign_block_vars('most_active_forums', array(
			'FORUM_URL'						=> $most_active_forums,
			'FORUM_POSTS_PERCENT'			=> number_format($most_active_forums_percent, 2),
			'FORUM_ID'						=> $row['forum_id'],
			'FORUM_NAME'					=> $row['forum_name'],
			'FORUM_DESC'					=> (utf8_strlen($row['forum_desc']) > 41) ? truncate_string($row['forum_desc'], 40) . "\xE2\x80\xA6" : $row['forum_desc'],
			'FORUM_POSTS'					=> $row['forum_posts'],
		));
	}
	$db->sql_freeresult($result);
	
	$template->assign_vars(array(
		'S_TSMAF_ENABLE'      			=> $config['tsmaf_enable'],
		'TSMAF_NUMBER'					=> $config['tsmaf_number'],
    ));
}

// Last visited Bots
if (!empty($config['tslvb_enable']))
{	
	if( ( $last_bots = $cache->get('_ts_last_visited_bots') ) === false )
	{	
		$sql = 'SELECT user_id, username, user_lastvisit, user_colour
			FROM ' . USERS_TABLE . ' WHERE user_inactive_time = 0 AND user_ip = 0
			ORDER BY user_lastvisit DESC';
		$result = $db->sql_query_limit($sql, $config['tslvb_number']);
	
		$last_bots = array();
		while ($row = $db->sql_fetchrow($result))
		{
			$last_bots[] = $row;
		}
	  
		$db->sql_freeresult($result);

		// Cache for 5 minutes
		$cache->put('_ts_last_visited_bots', $last_bots, 300);
	}
	
	foreach( $last_bots as $row )
	{	
		$template->assign_block_vars('last_visited_bots', array(
			'USERNAME'						=> $row['username'],
			'USER_COLOUR'					=> $row['user_colour'],
			'USER_LAST_VISIT'               => $user->format_date($row['user_lastvisit']),
		));
	}
	$db->sql_freeresult($result);
	
	$template->assign_vars(array(
		'S_TSLVB_ENABLE'      			=> $config['tslvb_enable'],
		'TSLVB_NUMBER'					=> $config['tslvb_number'],
    ));
}

// Last registered Users
if (!empty($config['tslru_enable']))
{   
	if( ( $last_users = $cache->get('_ts_last_registered_users') ) === false )
	{
		$sql = 'SELECT user_id, username, user_colour, user_regdate
			FROM ' . USERS_TABLE . ' WHERE user_inactive_time = 0
			ORDER BY user_regdate DESC';
		$result = $db->sql_query_limit($sql, $config['tslru_number']);
   
		$last_users = array();
		while ($row = $db->sql_fetchrow($result))
		{
			$last_users[] = $row;
		}
	  
		$db->sql_freeresult($result);

		// Cache for 5 minutes
		$cache->put('_ts_last_registered_users', $last_users, 300);
	}

	foreach( $last_users as $row )
	{
		$last_registered_user = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile' . '&u=' . $row['user_id']);
	  
		$template->assign_block_vars('last_registered_user', array(
			'USER_URL'                  => $last_registered_user,
			'USERNAME'                  => $row['username'],
			'USER_COLOUR'               => $row['user_colour'],
			'USER_REGISTERED'           => $user->format_date($row['user_regdate']),
		));
	}
	
	$template->assign_vars(array(
		'S_TSLRU_ENABLE'              => $config['tslru_enable'],
		'TSLRU_NUMBER'                   => $config['tslru_number'],
	));
}

// Most Downloaded Attachments
if (!empty($config['tsmdax_enable']) && sizeof($flist))
{   
	if( ( $most_downloaded = $cache->get('_ts_most_downloaded_attachments') ) === false )
	{
		$sql = 'SELECT t.forum_id, a.post_msg_id, a.real_filename, a.download_count, a.filesize, a.filetime
				FROM ' . ATTACHMENTS_TABLE . ' a
				LEFT JOIN ' . FORUMS_TABLE . ' f ON (t.forum_id = f.forum_id)
				WHERE ' . $db->sql_in_set('t.forum_id', $flist) . '
				ORDER BY a.download_count DESC';
		$result = $db->sql_query_limit($sql, $config['tsmda_number']);
   
		$most_downloaded = array();
		while ($row = $db->sql_fetchrow($result))
		{
			$most_downloaded[] = $row;
		}
	  
		$db->sql_freeresult($result);

		// Cache for 60 minutes
		$cache->put('_ts_most_downloaded_attachments', $most_downloaded, 3600);
	}

	foreach( $most_downloaded as $row )
	{
		$most_downloaded_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_msg_id'] . '#p' . $row['post_msg_id']);
	  
		$template->assign_block_vars('most_downloaded_attachments', array(
			'USER_URL'                  => $most_downloaded_url,
			'DOWNLOAD_COUNT'            => $row['download_count'],
			'FILE_NAME'					=> $row['real_filename'],
			'FILE_SIZE'					=> number_format($row['filesize']),
			'FILE_TIME'					=> $user->format_date($row['filetime']),
		));
	}
	
	$template->assign_vars(array(
		'S_TSMDA_ENABLE'              	=> $config['tsmda_enable'],
		'TSMDA_NUMBER'                  => $config['tsmda_number'],
	));
}

}
?>
Board rules! No PM support
User avatar
martin123456
BBCoder VI
BBCoder VI
Posts: 765
Joined: 25 Jul 2011, 13:29
BBCodes: 34
Favourite MOD: Ban button
Location: Down south!
Contact:

Top stats collapse issue

Post by martin123456 »

and that fixed that now i just gotta fix the 3 MOST ACTIVE USERS { JOINED_US } Mon Mar 05, 2012 3:39 pm
User avatar
Stoker
Site Admin
Site Admin
Posts: 3521
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Top stats collapse issue

Post by Stoker »

This is from my common.php

Code: Select all

// BEGIN Top Stats
$lang = array_merge($lang, array(
	'MOST_VIEWED'				=> 'Most viewed topics',
	'MOST_REPLIED'				=> 'Most replied topics',
	'NEWEST_TOPICS'				=> 'Latest Topics',
	'NEWEST_POSTS'				=> 'Latest Posts',
	'RECENT_ACTIVE'				=> 'Recent Active Topics',
	'MOST_ACTIVE_USERS'			=> 'Most active users',
	'JOINED_US'					=> 'Joined us',
	'MOST_ACTIVE_FORUMS'		=> 'Most active forums',
	'PREVIOUS_SCROLL'			=> 'Previous',
	'NEXT_SCROLL'				=> 'Next',
	'START_SCROLL'				=> 'Start',
	'STOP_SCROLL'				=> 'Stop',
	'LAST_REGISTERED_USERS'		=> 'Last registered users',
	'LAST_VISITED_BOTS'			=> 'Last visited bots',
));
// END Top Stats
Board rules! No PM support
User avatar
martin123456
BBCoder VI
BBCoder VI
Posts: 765
Joined: 25 Jul 2011, 13:29
BBCodes: 34
Favourite MOD: Ban button
Location: Down south!
Contact:

Top stats collapse issue

Post by martin123456 »

Fixed and ty stoker your the man.
User avatar
Martin_K
BBCoder III
BBCoder III
Posts: 121
Joined: 02 Sep 2011, 11:13
BBCodes: 10
Favourite BBCode: textarea
Favourite MOD: Newsletter Add on
Location: London, UK
Contact:

Top stats collapse issue

Post by Martin_K »

If anyone is having trouble with some of the boxes working but not working, they could move the javascript out of any boxes that include it the footer, then you can have collapsible boxes working on other pages as well, such as Announcements in Active Topics.

The 'collapse this' javascript in question is:

Code: Select all

<script type="text/javascript">
        $(".forumlist").collapse({show: function(){
                this.animate({
                    opacity: 'toggle',
                    height: 'toggle'
                }, 300);
            },
            hide : function() {
                   
                this.animate({
                    opacity: 'toggle',
                    height: 'toggle'
                }, 300);
            }
        });
</script>
which is direct from http://www.christianbullock.com/

This worked for me, but I wonder if it creates extra server load, or extra browser load, having it in the footer (or header). It would be possible to do an IF statement to have it working only on the page or pages that need it.
User avatar
Stoker
Site Admin
Site Admin
Posts: 3521
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Top stats collapse issue

Post by Stoker »

No, I dont think it will create extra load.
Board rules! No PM support
diskonindza
BBCoder I
BBCoder I
Posts: 2
Joined: 19 Jun 2013, 21:22
BBCodes: 1

Top stats collapse issue

Post by diskonindza »

Anybody for subsliver2?
Locked