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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 444
  • Total: 444

Total users online count, no guests

Started by bluedevil, April 07, 2010, 07:39:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mick

I think my code needs a clean up...

It looks like this:

Please welcome JC357, our newest member.   
73076 Posts in 6996 Topics by 1655 Members  Array members online: 1

The code is showing the word "Array" and i cant figure it out.

echo'
<table cellspacing="0" cellpadding="0" border="0" align="" width="100%" summary="">
    <tbody>
        <tr>
            <td style="text-align: center;"><span class="smalltext"><span style="color: rgb(127, 127, 127);">';ssi_latestMember(); echo'</span></td>
            <td style="text-align: center;"><span class="smalltext"><span style="color: rgb(127, 127, 127);">', $context['common_stats']
['total_posts'], ' ', $txt['posts_made'], ' ', $txt['in'], ' ', $context['common_stats']['total_topics'], ' ', $txt['topics'], ' ', $txt['by'], ' ', $context['common_stats']['total_members'], ' ', $txt['members'], ' ', $who = ssi_whosOnline('array'), '  members online: ', $who['num_users_online'],'</span></td>
        </tr>
    </tbody>
</table>';

IchBin

When you start including other SMF variables you'll need to make sure you global them.

Cleaned up a bit for readability too. :)
global $context, $txt;

echo'
<table cellspacing="0" cellpadding="0" border="0" align="" width="100%" summary="">
    <tbody>
        <tr>
            <td style="text-align: center;">
            <span class="smalltext"><span style="color: rgb(127, 127, 127);">', ssi_latestMember() ,'</span>
            </td>
            <td style="text-align: center;">
            <span class="smalltext" style="color: rgb(127, 127, 127);">
            ', $context['common_stats']['total_posts'], ' ', $txt['posts_made'], ' ', $txt['in'], ' ', $context['common_stats']['total_topics'], ' ', $txt['topics'], ' ', $txt['by'], ' ', $context['common_stats']['total_members'], ' ', $txt['members'];
            $who = ssi_whosOnline('array'); 
            echo 'members online: ', $who['num_users_online'],'
            </span>
            </td>
        </tr>
    </tbody>
</table>';


Mick

Excellent.   I never thought of the globals.   Thank you, it works. ;)

Mick

See it on the header area: http://www.chevyavalancheclub.com/index.php  :smitten:

The code i had before only showed everything but the user count.  Now looks cooler O0

This website is proudly hosted on Crocweb Cloud Website Hosting.