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

Recent

Welcome to TinyPortal. Please login or sign up.

April 18, 2024, 05:34:05 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,164
  • Total Topics: 21,219
  • Online today: 203
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 170
  • Total: 170

[block] Users Online

Started by tamasir, November 26, 2010, 06:37:20 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

tamasir


Link to my site: http://www.tinyportal.eu
SMF version: SMF 1.1.12
TP version: TinyPortal 1.0 RC1
Default Forum Language: selectable
Mods installed: Googlebot & Spiders Mod      2.0.2

How can I have the number of the robots reported?
QuoteUsers Online
Users: 1
Guests: 1
Spiders: ?
Total: 3

My block :Users Online code
global $settings, $sourcedir, $context, $txt;
   
   // Get the user online today list.
   require_once($sourcedir . '/Subs-MembersOnlineToday.php');
   $membersOnlineTodayOptions = array(
      'sort' => 'login_time',
      'reverse_sort' => true,
      'period' => 'current_day',
      'canview' => 'registered',
   );
   $context += getMembersOnlineTodayStats($membersOnlineTodayOptions);
   
   
   // Users Online Today
   echo '
         <h4 class="titlebg"><span class="left"></span>
            <img class="icon" src="', $settings['images_url'], '/icons/online.gif', '" alt="', $txt['online_users'], '" />', '<span>', $txt['uot_users_online_today'], '</span>
         </h4>
         <p class="inline smalltext">';
   echo
            $txt['uot_total'], ': <b>', $context['num_users_online_today'], '</b>';

         if ($context['viewing_allowed'])
   echo
            ' (', $txt['uot_visible'], ': ', ($context['num_users_online_today'] - $context['num_users_hidden_today']), ', ', $txt['uot_hidden'], ': ', $context['num_users_hidden_today'], ')';

            // Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
            if (!empty($context['users_online_today']) && $context['viewing_allowed'])
            {
   echo
               '<br />', implode(', ', $context['list_users_online_today']);

               // Showing membergroups?
               if (!empty($settings['show_group_key']) && !empty($context['membergroups']))
   echo
                  '<br />[' . implode(']  [', $context['membergroups']) . ']';
            }
   echo '
         </p>';