TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 110
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 73
  • Total: 73

Small code fix for TP stats box

Started by fak3, June 21, 2009, 12:07:47 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

fak3



Hi developers and co., have you ever noticed that font-sizes in TP stats box are different (under Users Online are bigger)? I don't know if it's supposed to be, but the fix is really quick. :)

Just open /Themes/default/TPBlocks.template.php and search for:

if(isset($context['TPortal']['userbox']['online']))
{
// add online users
echo '
<h5 class="online"><a href="'.$scripturl.'?action=who">'.$txt[158].'</a></h5>
<div>';

$online = ssi_whosOnline('array');
echo $txt['tp-users'].': '.$online['num_users']. '<br />
'.$txt['tp-guests'].': '.$online['guests'].'<br />
'.$txt['tp-total'].': '.$online['total_users'].'<br />
<div ' , $online['num_users']>14 ? ' style="height: 23ex; overflow: auto;"' : '' ,'>';

foreach($online['users'] as $user)
{
echo $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];
echo '<br />';
}
echo '
</div></div>';
}


Replace it with:

if(isset($context['TPortal']['userbox']['online']))
{
// add online users
echo '
<h5 class="online"><a href="'.$scripturl.'?action=who">'.$txt[158].'</a></h5>';
$online = ssi_whosOnline('array');
echo '
<ul>
<li>'. $txt['tp-users'].': '.$online['num_users']. '</li>
<li>'. $txt['tp-guests'].': '.$online['guests'].'</li>
<li>'. $txt['tp-total'].': '.$online['total_users'].'</li>
</ul>
<div ' , $online['num_users']>14 ? ' style="height: 23ex; overflow: auto;"' : '' ,'>';

foreach($online['users'] as $user)
{
echo $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];
echo '<br />';
}
echo '
</div>';
}


Hope the code is ok (it's working in my TP website), have fun! ;D

bloc

Yes, I know ..that code bit needs some cleaning up. Using a list(which is defined with font-size in tp-style.css already) is way better than just using break tags.

I'll be sure to use this in beta5.

This website is proudly hosted on Crocweb Cloud Website Hosting.