News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Users Online Today Mod

Started by Nibogo, November 06, 2005, 01:42:31 AM

Previous topic - Next topic

tones_ie

Hi guys...running smf 1.1.5..black rain v2..no other mods...cant find where to add the code into the BoardIndex.template.php on the theme...tried a few places but get the following ": (: 0, : ) "  not sure wat that is....

heres my BoardIndex.template.php  if anyone can tell me how to get this to work id appreciate it...

<?php
// Version: 1.1.3; BoardIndex

function template_main()
{
   global 
$context$settings$options$txt$scripturl$modSettings;

   
// Show some statistics next to the link tree if SP1 info is off.
   
echo '
<table width="100%" cellpadding="3" cellspacing="0">
   <tr>
      <td valign="bottom">'
theme_linktree(), '</td>
      <td align="right">'
;
   if (!
$settings['show_sp1_info'])
      echo 
'
            '
$txt[19], ': '$context['common_stats']['total_members'], ' &nbsp;&#38;#8226;&nbsp; '$txt[95], ': '$context['common_stats']['total_posts'], ' &nbsp;&#38;#8226;&nbsp; '$txt[64], ': '$context['common_stats']['total_topics'], '
            '
, ($settings['show_latest_member'] ? '<br />' $txt[201] . ' <b>' $context['common_stats']['latest_member']['link'] . '</b>' $txt[581] : '');
   echo 
'
         </td>
      </tr>
   </table>'
;

   
// Show the news fader?  (assuming there are things to show...)
   
if ($settings['show_newsfader'] && !empty($context['fader_news_lines']))
   {
      echo 
'
<div class="tborder" style="margin-bottom: 2ex;">
   <table border="0" width="100%" cellspacing="1" cellpadding="4">
      <tr class="titlebg" align="center">
         <td>'
$txt[102], '</td>
      </tr>
      <tr>
         <td valign="middle" align="center" style="height: 60px;">'
;

      
// Prepare all the javascript settings.
      
echo '
            <div id="smfFadeScroller" style="width: 90%; padding: 2px;"><b>'
$context['news_lines'][0], '</b></div>
            <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
               // The fading delay (in ms.)
               var smfFadeDelay = '
, empty($settings['newsfader_time']) ? 5000 $settings['newsfader_time'], ';
               // Fade from... what text color?  To which background color?
               var smfFadeFrom = {"r": 0, "g": 0, "b": 0}, smfFadeTo = {"r": 255, "g": 255, "b": 255};
               // Surround each item with... anything special?
               var smfFadeBefore = "<b>", smfFadeAfter = "</b>";

               var foreColor, backEl, backColor;

               if (typeof(document.getElementById(\'smfFadeScroller\').currentStyle) != "undefined")
               {
                  foreColor = document.getElementById(\'smfFadeScroller\').currentStyle.color.match(/#([\da-f][\da-f])([\da-f][\da-f])([\da-f][\da-f])/);
                  smfFadeFrom = {"r": parseInt(foreColor[1]), "g": parseInt(foreColor[2]), "b": parseInt(foreColor[3])};

                  backEl = document.getElementById(\'smfFadeScroller\');
                  while (backEl.currentStyle.backgroundColor == "transparent" && typeof(backEl.parentNode) != "undefined")
                     backEl = backEl.parentNode;

                  backColor = backEl.currentStyle.backgroundColor.match(/#([\da-f][\da-f])([\da-f][\da-f])([\da-f][\da-f])/);
                  smfFadeTo = {"r": eval("0x" + backColor[1]), "g": eval("0x" + backColor[2]), "b": eval("0x" + backColor[3])};
               }
               else if (typeof(window.opera) == "undefined" && typeof(document.defaultView) != "undefined")
               {
                  foreColor = document.defaultView.getComputedStyle(document.getElementById(\'smfFadeScroller\'), null).color.match(/rgb\((\d+), (\d+), (\d+)\)/);
                  smfFadeFrom = {"r": parseInt(foreColor[1]), "g": parseInt(foreColor[2]), "b": parseInt(foreColor[3])};

                  backEl = document.getElementById(\'smfFadeScroller\');
                  while (document.defaultView.getComputedStyle(backEl, null).backgroundColor == "transparent" && typeof(backEl.parentNode) != "undefined" && typeof(backEl.parentNode.tagName) != "undefined")
                     backEl = backEl.parentNode;

                  backColor = document.defaultView.getComputedStyle(backEl, null).backgroundColor.match(/rgb\((\d+), (\d+), (\d+)\)/);
                  smfFadeTo = {"r": parseInt(backColor[1]), "g": parseInt(backColor[2]), "b": parseInt(backColor[3])};
               }

               // List all the lines of the news for display.
               var smfFadeContent = new Array(
                  "'
implode('",
                  "'
$context['fader_news_lines']), '"
               );
            // ]]></script>
            <script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/fader.js"></script>
         </td>
      </tr>
   </table>
</div>'
;
   }

   
/* Each category in categories is made up of:
      id, href, link, name, is_collapsed (is it collapsed?), can_collapse (is it okay if it is?),
      new (is it new?), collapse_href (href to collapse/expand), collapse_image (up/down iamge),
      and boards. (see below.) */
   
foreach ($context['categories'] as $category)
   {
      echo 
'
<div class="tborder"><table border="0" width="100%" cellspacing="1" cellpadding="5">
   <tr>
      <td colspan="2" class="catbg'
$category['new'] ? '2' '''" height="18">';

      
// If this category even can collapse, show a link to collapse it.
      
if ($category['can_collapse'])
         echo 
'
         <a href="'
$category['collapse_href'], '">'$category['collapse_image'], '</a>';

      echo 
'
         '
$category['link'], '
      </td>
                <td width="4%" class="catbg'
$category['new'] ? '2' '''"><b>' ,$txt[21], '</b></td>
                <td width="4%" class="catbg'
$category['new'] ? '2' '''"><b>' ,$txt[330], '</b></td>
                <td width="22%" align="center" class="catbg'
$category['new'] ? '2' '''"> '$txt[22], '</td>
   </tr>'
;

      
// Assuming the category hasn't been collapsed...
      
if (!$category['is_collapsed'])
      {
         
/* Each board in each category's boards has:
            new (is it new?), id, name, description, moderators (see below), link_moderators (just a list.),
            children (see below.), link_children (easier to use.), children_new (are they new?),
            topics (# of), posts (# of), link, href, and last_post. (see below.) */
         
foreach ($category['boards'] as $board)
         {
            echo 
'
   <tr class="windowbg2">
      <td class="windowbg" width="6%" align="center" valign="top"><a href="'
$scripturl'?action=unread;board='$board['id'], '.0">';

            
// If the board is new, show a strong indicator.
            
if ($board['new'])
               echo 
'<img src="'$settings['images_url'], '/on.gif" alt="'$txt[333], '" title="'$txt[333], '" border="0" />';
            
// This board doesn't have new posts, but its children do.
            
elseif ($board['children_new'])
               echo 
'<img src="'$settings['images_url'], '/on2.gif" alt="'$txt[333], '" title="'$txt[333], '" border="0" />';
            
// No new posts at all!  The agony!!
            
else
               echo 
'<img src="'$settings['images_url'], '/off.gif" alt="'$txt[334], '" title="'$txt[334], '" border="0" />';

            echo 
'</a></td>
      <td>
         <b><a href="'
$board['href'], '" name="b'$board['id'], '">'$board['name'], '</a></b><br />
         '
$board['description'];

            
// Show the "Moderators: ".  Each has name, href, link, and id. (but we're gonna use link_moderators.)
            
if (!empty($board['moderators']))
               echo 
'
         <div style="padding-top: 1px;" class="smalltext"><i>'
count($board['moderators']) == $txt[298] : $txt[299], ': 'implode(', '$board['link_moderators']), '</i></div>';

            
// Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
            
if (!empty($board['children']))
            {
               
// Sort the links into an array with new boards bold so it can be imploded.
               
$children = array();
               
/* Each child in each board's children has:
                  id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
               
foreach ($board['children'] as $child)
               {
                  
$child['link'] = '<a href="' $child['href'] . '" title="' . ($child['new'] ? $txt[333] : $txt[334]) . ' (' $txt[330] . ': ' $child['topics'] . ', ' $txt[21] . ': ' $child['posts'] . ')">' $child['name'] . '</a>';
                  
$children[] = $child['new'] ? '<b>' $child['link'] . '</b>' $child['link'];
               }

               echo 
'
         <div style="padding-top: 1px;" class="smalltext"><i>'
$txt['parent_boards'], ': 'implode(', '$children), '</i></div>';
            }

            
// Show some basic information about the number of posts, etc.
            
echo '
      </td>
                <td class="small2text windowbg2" valign="middle" width="4%" align="center">
                 '
$board['posts'], '</td><td class="smalltext" valign="middle" width="4%" align="center">
                        '
$board['topics'],'</td><td class="smalltext" valign="middle" width="22%">';

                 if (!empty(
$board['last_post']['id']))
                                        echo 
'
                        <a href="'
$board['last_post']['href'], '"><img alt="go" src="'$settings['images_url'], '/icons/last_post.gif" align="right" hspace="3" border="0" /></a>
                        '
$board['last_post']['time'], '
                        '
$txt['smf88'], ' <b>'$board['last_post']['link'], '</b> '$txt[525], ' '$board['last_post']['member']['link'],
                        
' ' ;





            echo 
'
      </td>
   </tr>'
;
         }
      }

      echo 
'
</table></div>
<br />'
;
   }

   if (
$context['user']['is_logged'])
   {
      echo 
'
<div class="tborder" style="padding: 3px;"><table border="0" width="100%" cellspacing="0" cellpadding="5">
   <tr class="catbg">
      <td align="'
, !$context['right_to_left'] ? 'left' 'right''" class="smalltext">
         <img src="' 
$settings['images_url'] . '/new_some.gif" alt="" border="0" align="middle" /> '$txt[333], '
         <img src="' 
$settings['images_url'] . '/new_none.gif" alt="" border="0" align="middle" style="margin-left: 4ex;" /> '$txt[334], '
      </td>
      <td align="'
, !$context['right_to_left'] ? 'right' 'left''" class="smalltext">';
      
// Show the mark all as read button?
      
if ($settings['show_mark_read'] && !empty($context['categories']))
         echo 
'
         <a href="'
$scripturl'?action=markasread;sa=all;sesc=' $context['session_id'] . '">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/markread.gif" alt="' $txt[452] . '" border="0" />' $txt[452]), '</a>';
      echo 
'
      </td>
   </tr>
</table></div>'
;
   }

   
// Here's where the "Info Center" starts...
   
echo '
<br />
<div class="tborder"><table border="0" width="100%" cellspacing="1" cellpadding="4">
   <tr>
      <td class="blocktitle" align="center" colspan="2"><b>'
$txt[685], '</b></td>
   </tr>'
;

   
// This is the "Recent Posts" bar.
   
if (!empty($settings['number_recent_posts']))
   {
      echo 
'
   <tr>
      <td class="titlebg" colspan="2">'
$txt[214], '</td>
   </tr>
   <tr>
      <td class="windowbg" width="20" valign="middle" align="center">
         <a href="'
$scripturl'?action=recent">
            <img src="'
$settings['images_url'], '/post/xx.gif" alt="'$txt[214], '" border="0" /></a>
      </td>
      <td class="windowbg2">'
;

      
// Only show one post.
      
if ($settings['number_recent_posts'] == 1)
      {
         
// latest_post has link, href, time, subject, short_subject (shortened with...), and topic. (its id.)
         
echo '
         <b><a href="'
$scripturl'?action=recent">'$txt[214], '</a></b>
         <div class="smalltext">
            '
$txt[234], ' &quot;'$context['latest_post']['link'], '&quot; '$txt[235], ' ('$context['latest_post']['time'], ')<br />
         </div>'
;
      }
      
// Show lots of posts.
      
elseif (!empty($context['latest_posts']))
      {
         echo 
'
         <table width="100%" border="0">'
;
         
/* Each post in latest_posts has:
            board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
            subject, short_subject (shortened with...), time, link, and href. */
         
foreach ($context['latest_posts'] as $post)
            echo 
'
            <tr>
               <td align="right" valign="top" nowrap="nowrap">['
$post['board']['link'], ']</td>
               <td valign="top">'
$post['link'], ' '$txt[525], ' '$post['poster']['link'], '</td>
               <td align="right" valign="top" nowrap="nowrap">'
$post['time'], '</td>
            </tr>'
;
         echo 
'
         </table>'
;
      }
      echo 
'
      </td>
   </tr>'
;
   }

   
// Show information about events, birthdays, and holidays on the calendar.
   
if ($context['show_calendar'])
   {
      echo 
'
   <tr>
      <td class="titlebg" colspan="2">'
$context['calendar_only_today'] ? $txt['calendar47b'] : $txt['calendar47'], '</td>
   </tr><tr>
      <td class="windowbg" width="20" valign="middle" align="center">
         <a href="'
$scripturl'?action=calendar">
            <img src="'
$settings['images_url'], '/icons/calendar.gif" alt="'$txt['calendar24'], '" border="0" /></a>
      </td>
      <td class="windowbg2" width="100%">
         <span class="smalltext">'
;

      
// Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P.
      
if (!empty($context['calendar_holidays']))
         echo 
'
            <span style="color: #'
$modSettings['cal_holidaycolor'], ';">'$txt['calendar5'], ' 'implode(', '$context['calendar_holidays']), '</span><br />';

      
// People's birthdays.  Like mine.  And yours, I guess.  Kidding.
      
if (!empty($context['calendar_birthdays']))
      {
         echo 
'
            <span style="color: #'
$modSettings['cal_bdaycolor'], ';">'$context['calendar_only_today'] ? $txt['calendar3'] : $txt['calendar3b'], '</span> ';
         
/* Each member in calendar_birthdays has:
            id, name (person), age (if they have one set?), is_last. (last in list?), and is_today (birthday is today?) */
         
foreach ($context['calendar_birthdays'] as $member)
            echo 
'
            <a href="'
$scripturl'?action=profile;u='$member['id'], '">'$member['is_today'] ? '<b>' ''$member['name'], $member['is_today'] ? '</b>' '', isset($member['age']) ? ' (' $member['age'] . ')' '''</a>'$member['is_last'] ? '<br />' ', ';
      }
      
// Events like community get-togethers.
      
if (!empty($context['calendar_events']))
      {
         echo 
'
            <span style="color: #'
$modSettings['cal_eventcolor'], ';">'$context['calendar_only_today'] ? $txt['calendar4'] : $txt['calendar4b'], '</span> ';
         
/* Each event in calendar_events should have:
            title, href, is_last, can_edit (are they allowed?), modify_href, and is_today. */
         
foreach ($context['calendar_events'] as $event)
            echo 
'
            '
$event['can_edit'] ? '<a href="' $event['modify_href'] . '" style="color: #FF0000;">*</a> ' ''$event['href'] == '' '' '<a href="' $event['href'] . '">'$event['is_today'] ? '<b>' $event['title'] . '</b>' $event['title'], $event['href'] == '' '' '</a>'$event['is_last'] ? '<br />' ', ';

         
// Show a little help text to help them along ;).
         
if ($context['calendar_can_edit'])
            echo 
'
            (<a href="'
$scripturl'?action=helpadmin;help=calendar_how_edit" onclick="return reqWin(this.href);">'$txt['calendar_how_edit'], '</a>)';
      }
      echo 
'
         </span>
      </td>
   </tr>'
;
   }

   
// Show a member bar.  Not heavily ornate, but functional at least.
   
if ($settings['show_member_bar'])
   {
      echo 
'
   <tr>
      <td class="titlebg" colspan="2">'
$txt[331], '</td>
   </tr>
   <tr>
      <td class="windowbg" width="20" valign="middle" align="center">
         '
$context['show_member_list'] ? '<a href="' $scripturl '?action=mlist">' '''<img src="'$settings['images_url'], '/icons/members.gif" alt="'$txt[332], '" border="0" />'$context['show_member_list'] ? '</a>' '''
      </td>
      <td class="windowbg2" width="100%">
         <b>'
$context['show_member_list'] ? '<a href="' $scripturl '?action=mlist">' $txt[332] . '</a>' $txt[332], '</b>
         <div class="smalltext">'
$txt[200], '</div>
      </td>
   </tr>'
;
   }

   
// Show YaBB SP1 style information...
   
if ($settings['show_sp1_info'])
   {
      echo 
'
   <tr>
      <td class="titlebg" colspan="2">'
$txt[645], '</td>
   </tr>
   <tr>
      <td class="windowbg" width="20" valign="middle" align="center">
         <a href="'
$scripturl'?action=stats">
            <img src="'
$settings['images_url'], '/icons/info.gif" alt="'$txt[645], '" border="0" /></a>
      </td>
      <td class="windowbg2" width="100%">
         <table border="0" width="90%"><tr>
            <td class="smalltext">
               <div style="float: '
, !$context['right_to_left'] ? 'left' 'right''; width: 50%;">'$txt[490], ': <b>'$context['common_stats']['total_topics'], '</b></div>'$txt[489], ': <b>'$context['common_stats']['total_posts'], '</b><br />', !empty($context['latest_post']) ? '
               ' 
$txt[659] . ': &quot;' $context['latest_post']['link'] . '&quot;  (' $context['latest_post']['time'] . ')<br />' '''
               <a href="'
$scripturl'?action=recent">'$txt[234], '</a>'$context['show_stats'] ? '<br />
               <a href="' 
$scripturl '?action=stats">' $txt['smf223'] . '</a>' '''
            </td>
            <td width="32%" class="smalltext" valign="top">
               '
$txt[488], ': <b><a href="'$scripturl'?action=mlist">'$context['common_stats']['total_members'], '</a></b><br />
               '
$txt[656], ': <b>'$context['common_stats']['latest_member']['link'], '</b><br />';
      
// If they are logged in, show their unread message count, etc..
      
if ($context['user']['is_logged'])
         echo 
'
               '
$txt['smf199'], ': <b><a href="'$scripturl'?action=pm">'$context['user']['messages'], '</a></b> '$txt['newmessages3'], ': <b><a href="'$scripturl'?action=pm">'$context['user']['unread_messages'], '</a></b>';
      echo 
'
            </td>
         </tr></table>
      </td>
   </tr>'
;
   }

   
// "Users online" - in order of activity.
   
echo '
   <tr>
      <td class="titlebg" colspan="2">'
$txt[158], '</td>
   </tr><tr>
      <td class="windowbg" width="20" valign="middle" align="center">
         '
$context['show_who'] ? '<a href="' $scripturl '?action=who">' '''<img src="'$settings['images_url'], '/icons/online.gif" alt="'$txt[158], '" border="0" />'$context['show_who'] ? '</a>' '''
      </td>
      <td class="windowbg2" width="100%">'
;

   if (
$context['show_who'])
      echo 
'
         <a href="'
$scripturl'?action=who">';

   echo 
$context['num_guests'], ' '$context['num_guests'] == $txt['guest'] : $txt['guests'], ', ' $context['num_users_online'], ' '$context['num_users_online'] == $txt['user'] : $txt['users'];

   
// Handle hidden users and buddies.
   
if (!empty($context['num_users_hidden']) || ($context['show_buddies'] && !empty($context['show_buddies'])))
   {
      echo 
' (';

      
// Show the number of buddies online?
      
if ($context['show_buddies'])
         echo 
$context['num_buddies'], ' '$context['num_buddies'] == $txt['buddy'] : $txt['buddies'];

      
// How about hidden users?
      
if (!empty($context['num_users_hidden']))
         echo 
$context['show_buddies'] ? ', ' ''$context['num_users_hidden'] . ' ' $txt['hidden'];

      echo 
')';
   }

   if (
$context['show_who'])
      echo 
'</a>';

   echo 
'
         <div class="smalltext">'
;

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

   echo 
'
            <br />'
$context['show_stats'] && !$settings['show_sp1_info'] ? '
            <a href="' 
$scripturl '?action=stats">' $txt['smf223'] . '</a>' '''
         </div>
      </td>
   </tr>'
;

   
// If they are logged in, but SP1 style information is off... show a personal message bar.
   
if ($context['user']['is_logged'] && !$settings['show_sp1_info'])
   {
      echo 
'
   <tr>
      <td class="titlebg" colspan="2">'
$txt[159], '</td>
   </tr><tr>
      <td class="windowbg" width="20" valign="middle" align="center">
         '
$context['allow_pm'] ? '<a href="' $scripturl '?action=pm">' '''<img src="'$settings['images_url'], '/message_sm.gif" alt="'$txt[159], '" border="0" />'$context['allow_pm'] ? '</a>' '''
      </td>
      <td class="windowbg2" valign="top">
         <b><a href="'
$scripturl'?action=pm">'$txt[159], '</a></b>
         <div class="smalltext">
            '
$txt[660], ' '$context['user']['messages'], ' '$context['user']['messages'] == $txt[471] : $txt[153], '.... '$txt[661], ' <a href="'$scripturl'?action=pm">'$txt[662], '</a> '$txt[663], '
         </div>
      </td>
   </tr>'
;
   }

   
// Show the login bar. (it's only true if they are logged out anyway.)
   
if ($context['show_login_bar'])
   {
      echo 
'
   <tr>
      <td class="titlebg" colspan="2">'
$txt[34], ' <a href="'$scripturl'?action=reminder" class="smalltext">(' $txt[315] . ')</a></td>
   </tr>
   <tr>
      <td class="windowbg" width="20" align="center">
         <a href="'
$scripturl'?action=login">
            <img src="'
$settings['images_url'], '/icons/login.gif" alt="'$txt[34], '" border="0" /></a>
      </td>
      <td class="windowbg2" valign="middle">
                  <form action="'
$scripturl'?action=login2" method="post" accept-charset="'$context['character_set'], '" style="margin: 0;">
            <table border="0" cellpadding="2" cellspacing="0" width="100%"><tr>
               <td valign="middle" align="left">
                  <label for="user"><b>'
$txt[35], ':</b><br /><input type="text" name="user" id="user" size="15" /></label>
               </td>
               <td valign="middle" align="left">
                  <label for="passwrd"><b>'
$txt[36], ':</b><br /><input type="password" name="passwrd" id="passwrd" size="15" /></label>
               </td>
               <td valign="middle" align="left">
                  <label for="cookielength"><b>'
$txt[497], ':</b><br /><input type="text" name="cookielength" id="cookielength" size="4" maxlength="4" value="'$modSettings['cookieTime'], '" /></label>
               </td>
               <td valign="middle" align="left">
                  <label for="cookieneverexp"><b>'
$txt[508], ':</b><br /><input type="checkbox" name="cookieneverexp" id="cookieneverexp" checked="checked" class="check" /></label>
               </td>
               <td valign="middle" align="left">
                  <input type="submit" value="'
$txt[34], '" />
               </td>
            </tr></table>
         </form>
      </td>
   </tr>'
;
   }

   echo 
'
</table></div>'
;
}

?>




looking to add this bit ( i think )

<file name="$themedir/BoardIndex.template.php">
<operation>
<search position="before"><![CDATA[ ', $txt['most_online_ever'], ': ', $modSettings['mostOnline'], ' (' , timeformat($modSettings['mostDate']), ')
</span>
</td>
</tr>';
]]></search>
<add><![CDATA[
// Users online today

echo '
<tr>
<td class="titlebg" colspan="2">', $txt['uot_users_online_today'], '</td>
</tr><tr>
<td class="windowbg" width="20" valign="middle" align="center">
<img src="', $settings['images_url'], '/icons/online.gif" alt="', $txt['uot_users_online_today'], '" border="0" />
</td>
<td class="windowbg2" width="100%">';

echo '
<div class="smalltext">';

  echo $txt['uot_total'], ': <b>', $context['num_users_online_today'], '</b>';
  if (!$context['user']['is_guest'])
  echo ' (', $txt['uot_visible'], ': ', ($context['num_users_online_today'] - $context['num_hidden_users_online_today']), ', ', $txt['uot_hidden'], ': ', $context['num_hidden_users_online_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['user']['is_guest'])
echo '<br />', implode(', ', $context['list_users_online_today']);

echo '
<br />', $context['show_stats'] && !$settings['show_sp1_info'] ? '
<a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
</div>
</td>
</tr>';]]>
</add>
</operation>
</file>


but cant find any reference to ', $txt['most_online_ever'], ': ', $modSettings['mostOnline'], ' (' , timeformat($modSettings['mostDate']), ') in my template file...


thanks in advance

qubbah

how can i make the latest version can be run in 1.1.5

it is because i want to set it up for the last over 24 hours..
tq

Basie

/\ Yeah I need this too.

Please release a version compatible with 1.1.5?

SgtMic

Quote from: SgtMic on June 11, 2008, 06:38:30 PM
Error log is filling up with this one:

http://www.org/forums/index.php?wwwRedirect
8: Undefined index: uot_yesterday
File: /home/*******/public_html/forums/Sources/Subs-MembersOnlineToday.php
Line: 135


SMF 2.0 Beta 3.1 Public
Mods:
1.     More Spiders      1.1      
2.    Are You Human? Anti-Bot Registration Check    1.3    
3.    Add Domaintools to TrackIP    1.1    
4.    Auto Embed Video/Audio Clips    3.0    
5.    SMF Sitemap    1.3.0    
6.    Recount Posts Maintenance    1.1    
7.    Users Online Today    1.5.2    
8.    Treasury    2.23    
9.    Grouped Who's Online    1.0    
10.    Top 10 Posters Today And This Week Stats

Bump...
There is nothing more deadly than a US Marine and his rifle.
A close second is a US Marine and his K-BAR.
2/5 Fox Co.  (BlackHearts)
FAST Co. 5th Plt. (FIDO)

Cal O'Shaw

I'm also running 1.1.5 and my Admins and Global Moderators would like to see this up only for them, not the general membership.

So, can the version for 1.1.5 be told to show only for Admins (as the 2.0 version seems to allow) and for specific groups (either checkbox or type in the group numbers)?



I think 1.1.5 will be around for awhile after 2.0 gets released because a number of sites (like mine) will wait for the more subtle bugs to come out, be sure upgrading from 1.1.5 to 2.0 is smooth, and any MODs we have to remove before upgrading are updated to work under 2.0.  Just mentioning that so that you don't feel updating the 1.4 (for 1.1.5) version is wasted effort.  It will be greatly appreciated.

Grazie,

Cal

jaccione

I have figured how to set it for admins only to see, althoguh got no idea for global mods

just wrap your block of code in this

if ($context['user']['is_admin'])
{

the code for the mod here
}

and that should stop anyone but admin seeing it. Just checked it in my forums 1.1.5 and seems to be working fine
www.math.net.au for all your math homework needs

DirtRider

SMF 1.1.5
Users Online Today Mod 1.5.2

Forum Link - http://www.s247631067.onlinehome.us/index.php

When trying to install this mod I get the following error, any ideas on this?

The package you are trying to download or install is either corrupt or not compatible with this version of SMF.
http://www.triumphtalk.com

"The real question is not whether machines think but whether men do. "

Basie

Seems like a lot of people would like to use 1.5.2 with SMF 1.1.5 :(

DirtRider

Well I hope we get to be able to do it as it is a real cool mod to have on your forum 
http://www.triumphtalk.com

"The real question is not whether machines think but whether men do. "

tones_ie

#929
Quote from: DirtRider on June 22, 2008, 04:19:00 AM
SMF 1.1.5
Users Online Today Mod 1.5.2

Forum Link - http://www.s247631067.onlinehome.us/index.php

When trying to install this mod I get the following error, any ideas on this?

The package you are trying to download or install is either corrupt or not compatible with this version of SMF.

ure trying to use teh wrong version of the mod for the version of smf u have installed....

for 1.1.5 smf..u need Users_Online_Today_1.4.0.zip



Anyone figure out wats causing the error
8: Undefined index: uot_yesterday
File:............./Sources/Subs-MembersOnlineToday.php
Line: 135

Basie

Quote from: tones_ie on June 22, 2008, 05:23:51 PM
for 1.1.5 smf..u need Users_Online_Today_1.4.0.zip

Yes, we know that... But 1.4.0 has less features.  People are requesting a version of 1.5.2 which is compatible with SMF 1.1.5

tones_ie

Quote from: seek2501 on June 22, 2008, 05:32:44 PM
Quote from: tones_ie on June 22, 2008, 05:23:51 PM
for 1.1.5 smf..u need Users_Online_Today_1.4.0.zip

Yes, we know that... But 1.4.0 has less features.  People are requesting a version of 1.5.2 which is compatible with SMF 1.1.5

yes, i know that too :)
i quoted Dirtrider to try show why he got his error of incomatibilty.....

DirtRider

#932
Ok I tried the version 1.4.0 and it installed. I get the following stats from my board     

Most Online Today: 16. Most Online Ever: 16 (Yesterday at 09:02:45 PM)

and these from the mod

Total: 40 (Visible: 40, Hidden: 0)

:o :o

If I disable this feature then it is correct

Enable "Today" feature
http://www.triumphtalk.com

"The real question is not whether machines think but whether men do. "

ccbtimewiz

I don't see the problem.

Most Online Today means the most users online at one time.

Most Online Ever means the most users online at one time ever.

Total means all the users online at all times.

Apllicmz

update to smf 2.0 beta 3.1

UsersOnlineToday.portuguese.php and UsersOnlineToday.portuguese-utf8.php
UsersOnlineToday.brazilian.php and UsersOnlineToday.brazilian-utf8

<?php

$txt
['uot_users_online_today']='Membros registrado hoje';
$txt['uot_yesterday']='Ontem em ';
$txt['uot_total']='Total';
$txt['uot_visible']='Visível';
$txt['uot_hidden']='Escondido';

?>


<?php

$txt
['uot_users_online_today']='Membros registrado hoje';
$txt['uot_yesterday']='Ontem em ';
$txt['uot_total']='Total';
$txt['uot_visible']='Vis&iacute;vel';
$txt['uot_hidden']='Escondido';

?>


for smf 1.1.x

<file name="$languagedir/Modifications.portuguese.php" error="skip">
<operation>
<search position="end"></search>
<add><![CDATA[$txt['uot_users_online_today']='Membros registrado hoje';
$txt['uot_yesterday']='Ontem em ';
$txt['uot_total']='Total';
$txt['uot_visible']='Vis&iacute;vel';
$txt['uot_hidden']='Escondido';]]>
</add>
</operation>
</file>
<file name="$languagedir/Modifications.brazilian.php" error="skip">
<operation>
<search position="end"></search>
<add><![CDATA[$txt['uot_users_online_today']='Membros registrado hoje';
$txt['uot_yesterday']='Ontem em ';
$txt['uot_total']='Total';
$txt['uot_visible']='Vis&iacute;vel';
$txt['uot_hidden']='Escondido';]]>
</add>
</operation>
</file>


<file name="$languagedir/Stats.portuguese.php" error="skip">
<operation>
<search position="replace"><![CDATA[$txt['users_online_today'] = 'Hoje On-line';
$txt['num_hits'] = 'Total de pagina vistas';
$txt['average_hits'] = 'Media de visitas por dia';
]]></search>
<add><![CDATA[$txt['users_online_today'] = 'Hoje On-line';
$txt['num_hits'] = 'Total de pagina vistas';
$txt['average_hits'] = 'Media de visitas por dia';]]>
</add>
</operation>
</file>
<file name="$languagedir/Stats.brazilian.php" error="skip">
<operation>
<search position="replace"><![CDATA[$txt['users_online_today'] = 'Hoje On-line';
$txt['num_hits'] = 'Total de pagina vistas';
$txt['average_hits'] = 'Media de visitas por dia';
]]></search>
<add><![CDATA[$txt['users_online_today'] = 'Hoje On-line';
$txt['num_hits'] = 'Total de pagina vistas';
$txt['average_hits'] = 'Media de visitas por dia';]]>
</add>
</operation>
</file>



DirtRider

#935
I am running a few themes and this mod works with the all excepting Dilber Multicolor (1.1) Now I know there is most likely some code within this thread someplace that I need to add to my manually to my index.template.php file. However not really being one that is so familiar with coding it would be appreciated if someone here could please tell me how to do this.  :D

Not sure if my index.template.php is needed here so here we go


<?php
// Version: 1.1; index

/* This template is, perhaps, the most important template in the theme. It
contains the main template layer that displays the header and footer of
the forum, namely with main_above and main_below. It also contains the
menu sub template, which appropriately displays the menu; the init sub
template, which is there to set the theme up; (init can be missing.) and
the linktree sub template, which sorts out the link tree.

The init sub template should load any data and set any hardcoded options.

The main_above sub template is what is shown above the main content, and
should contain anything that should be shown up there.

The main_below sub template, conversely, is shown after the main content.
It should probably contain the copyright statement and some other things.

The linktree sub template should display the link tree, using the data
in the $context['linktree'] variable.

The menu sub template should display all the relevant buttons the user
wants and or needs.

For more information on the templating system, please see the site at:
http://www.simplemachines.org/
*/

// Initialize the template... mainly little settings.
function template_init()
{
global $context$settings$options$txt;

/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';

/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';

/* The version this template/theme is for.
This should probably be the version of SMF it was created for. */
$settings['theme_version'] = '1.1';

/* Set a setting that tells the theme that it can render the tabs. */
$settings['use_tabs'] = true;

/* Use plain buttons - as oppossed to text buttons? */
$settings['use_buttons'] = true;

/* Show sticky and lock status seperate from topic icons? */
$settings['seperate_sticky_lock'] = true;

// Color changer
if(!$context['user']['is_guest'] && isset($_POST['options']['theme_color']))
{
   include_once($GLOBALS['sourcedir'] . '/Profile.php');
   makeThemeChanges($context['user']['id'], $settings['theme_id']);
   $options['theme_color'] = $_POST['options']['theme_color'];
}
elseif ($context['user']['is_guest'])
{
   if (isset($_POST['options']['theme_color']))
   {
  $_SESSION['theme_color'] = $_POST['options']['theme_color'];
  $options['theme_color'] = $_SESSION['theme_color'];
   }
   elseif (isset($_SESSION['theme_color']))
  $options['theme_color'] = $_SESSION['theme_color'];
}
}
// The main sub template above the content.
function template_main_above()
{
global $context$settings$options$scripturl$txt$modSettings;

// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"'
$context['right_to_left'] ? ' dir="rtl"' '''><head>
<meta http-equiv="Content-Type" content="text/html; charset='
$context['character_set'], '" />
<meta name="description" content="'
$context['page_title'], '" />', empty($context['robot_no_index']) ? '' '
<meta name="robots" content="noindex" />'
'
<meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/script.js?fin11"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "'
$settings['theme_url'], '";
var smf_images_url = "'
$settings['images_url'], '";
var smf_scripturl = "'
$scripturl'";
var smf_iso_case_folding = '
$context['server']['iso_case_folding'] ? 'true' 'false'';
var smf_charset = "'
$context['character_set'], '";
// ]]></script>
<title>'
$context['page_title'], '</title>';
// Any color set by user?
if (isset($options['theme_color']))
$settings['theme_main_color'] = $options['theme_color'];

// If not set, or if not allowed to set
if(!isset($options['theme_color']) || (isset($settings['allow_color_change']) && $settings['allow_color_change'] == 'no'))
{
// Defaults.
$options['theme_color'] = isset($settings['theme_main_color']) ? $settings['theme_main_color'] : 'lightblue';
$settings['theme_main_color'] = $options['theme_color'];
}
// The ?fin11 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/style.css?fin11" />
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/style_' $settings['theme_main_color'] , '.css?fin11" />
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/print.css?fin11" media="print" />';

/* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
Standards compliance mode happens when you use xhtml... */
if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/fonts-compat.css" />';

// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="'
$scripturl'?action=help" target="_blank" />
<link rel="search" href="' 
$scripturl '?action=search" />
<link rel="contents" href="'
$scripturl'" />';

// If RSS feeds are enabled, advertise the presence of one.
if (!empty($modSettings['xmlnews_enable']))
echo '
<link rel="alternate" type="application/rss+xml" title="'
$context['forum_name'], ' - RSS" href="'$scripturl'?type=rss;action=.xml" />';

// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=prev" />
<link rel="next" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=next" />';

// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="' 
$scripturl '?board=' $context['current_board'] . '.0" />';

// We'll have to use the cookie to remember the header...
if ($context['user']['is_guest'])
$options['collapse_header'] = !empty($_COOKIE['upshrink']);

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '
        <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
                var current_leftbar = '
, empty($options['collapse_leftbar']) ? 'false' 'true'';

                function shrinkHeaderLeftbar(mode)
                {'
;

        
// Guests don't have theme options!!
        
if ($context['user']['is_guest'])
                echo 
'
                        document.cookie = "upshrink=" + (mode ? 1 : 0);'
;
        else
                echo 
'
                        smf_setThemeOption("collapse_leftbar", mode ? 1 : 0, null, "'
$context['session_id'], '");';
        echo 
'
                        document.getElementById("upshrinkLeftbar").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

                        document.getElementById("leftbarHeader").style.display = mode ? "none" : "";

                        current_leftbar = mode;
                }
          // ]]></script>
       <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
                var current_rightbar = '
, empty($options['collapse_rightbar']) ? 'false' 'true'';

                function shrinkHeaderRightbar(mode)
                {'
;

        
// Guests don't have theme options!!
        
if ($context['user']['is_guest'])
                echo 
'
                        document.cookie = "upshrink=" + (mode ? 1 : 0);'
;
        else
                echo 
'
                        smf_setThemeOption("collapse_rightbar", mode ? 1 : 0, null, "'
$context['session_id'], '");';

        echo 
'
                        document.getElementById("upshrinkRightbar").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

                        document.getElementById("rightbarHeader").style.display = mode ? "none" : "";

                        current_rightbar = mode;
                }
        // ]]></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header = '
, empty($options['collapse_header']) ? 'false' 'true'';

function shrinkHeader(mode)
{'
;

// Guests don't have theme options!!
if ($context['user']['is_guest'])
echo '
document.cookie = "upshrink=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "'
$context['session_id'], '");';

echo '
document.getElementById("upshrink").src = smf_images_url + '  
'"/'$settings['theme_main_color'] . '" + (mode ? "/expand.gif" : "/collapse.gif");

document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";
document.getElementById("upshrinkHeader2").style.display = mode ? "none" : "";

current_header = mode;
}
// ]]></script>'
;

// the routine for the info center upshrink
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header_ic = '
, empty($options['collapse_header_ic']) ? 'false' 'true'';

function shrinkHeaderIC(mode)
{'
;

if ($context['user']['is_guest'])
echo '
document.cookie = "upshrinkIC=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "'
$context['session_id'], '");';

echo '
document.getElementById("upshrink_ic").src = smf_images_url + '  
'"/'$settings['theme_main_color'] . '" + (mode ? "/expand.gif" : "/collapse.gif");

document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";

current_header_ic = mode;
}
// ]]></script>
</head>
<body>'
;
// TinyPortal start
     
if($context['TPortal']['fixed_width']!=0)
             echo 
'<table align="center" width="'.$context['TPortal']['fixed_width'].'" cellpadding="0" cellspacing="0" border="0"><tr><td>';
// TinyPortal end
echo '
<div class="maindiv" style="width: ' 
, (isset($settings['page_div_width']) && !empty($settings['page_div_width'])) ? $settings['page_div_width'] : '99%' ,  ';">
<div width="100%" class="topbar"  id="upshrinkHeader"'
, empty($options['collapse_header']) ? '' ' style="display: none;"''>
<table cellspacing="0" cellpadding="0" border="0" style="width:100%;">
<tr>
<td style="padding:0;" width="1" height="120">'
;
/// my code here
if (empty($settings['header_logo_url']))
echo '
<a href="'
$scripturl'"><img src="'$settings['images_url'] . '/'$settings['theme_main_color'], '/logo.jpg" style="margin: 0px;" alt="'$context['forum_name'], '" title="'$context['forum_name'], '"/></a>';
else
echo '
<a href="'
$scripturl'"><img src="'$settings['header_logo_url'], '" style="margin: 0px;" alt="'$context['forum_name'], '" /></a>';
/// end my code

echo '
</td>'
;

if (!empty($settings['show_name_near_logo']))
echo '
<td>
<span style="font-family: \'Trebuchet MS\', Verdana, sans-serif; font-size: 200%; color: white; padding-top: 30px; padding-left: 30px; white-space: normal;"><strong>'
$context['forum_name'], '</strong></span>
</td>'
;
if (!empty($settings['top_right_html']))
echo '
<td valign="top" align="right">
<div style="color: white; padding-top: 10px; float:right;">'
$settings['top_right_html'], '</div>
</td>'
;

echo '
</tr>
</table>
</div>
<div style="width: 100%; padding-top: 4px;" class="topbar2">
<table border="0" cellspacing="0" cellpadding="0" style="width: 100%;">
<tr>'
;

// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '

<td valign="middle" height="30" class="smalltext" style="padding-left:10px; padding-top:0px; padding-bottom:0px;">
<b>'
$txt[102], '</b>: '$context['random_news_line'], '
</td>
'
;
echo '
<td valign="middle" height="30" style="padding-top:0px; padding-bottom:0px; padding-right:20px;" class="middletext" align="right">
<form action="'
$scripturl'?action=search2" method="post" accept-charset="'$context['character_set'], '" style="margin: 0px;">
<a href="'
$scripturl'?action=search;advanced"><img src="'.$settings['images_url'].'/filter.gif" align="middle" style="margin: 0px;" alt="" /></a>
<input type="text" name="search" value="" style="width: 190px;" />&nbsp;
<input type="submit" name="submit" value="'
$txt[182], '" style="width: 11ex;" />
<input type="hidden" name="advanced" value="0" />'
;

// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="'
$context['current_topic'], '" />';

// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd['
$context['current_board'], ']" value="'$context['current_board'], '" />';

echo '
</form>

</td>
</tr>
</table>
</div>
<div class="menubar">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>'
;
// Show the menu here, according to the menu sub template.
template_menu();
echo '
</tr>
</table>
</div>'
;

// Here we start the main page, after the menu bar.
// Unfortunately, IE 6 couldn't handle a div here with a CSS background property, no matter how much I tried. So we use a table for IE here. I love Firefox ^_^ visit getfirefox.com for more info.
// It is time for Microsoft to get rid of IE and make Firefox their primary browser :P
// Ok, Opera can also display the div properly. I love both FF & Opera :)

echo '
'
$context['browser']['is_ie'] ? '<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr><td class="mainpage">' 
'<div class="mainpage">''
<a style="float:right;" href="#" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="'
$settings['images_url'], '/'$settings['theme_main_color'], '/', empty($options['collapse_header']) ? 'collapse.gif' 'expand.gif''" alt="*" title="'$txt['upshrink_description'], '" align="bottom" style="margin: 0 1ex;" /></a><br />';
//TinyPortal Hide user info/news start
if($context['TPortal']['showtop']==1)
{
echo '<div class="memberbardiv">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="20">
</td>
<td class="memberbar">'
;

if($context['user']['is_logged'])
echo '
'
$txt['hello_member_ndt'], ' <b>'$context['user']['name'] , '</b>';
else
echo $txt['welcome_guest'];

echo '
</td>

<td class="middletext" align="right" valign="top" style="padding-right:10px; padding-left:10px;">
$context['current_time'], '
<br/>
</td>

</tr>

<tr>
<td valign="middle" width="1" style="padding-right:10px; padding-left:10px;">'
, !empty($context['user']['avatar']) ? $context['user']['avatar']['image'] : '''</td>

<td class="memberbar">'
;

if($context['user']['is_logged'])
echo '
<br/>
<span class="middletext">'
$context['allow_pm'] ? '<b>' $txt[152] . ' <a href="' $scripturl '?action=pm">' $context['user']['messages'] . ' ' . ($context['user']['messages'] != $txt[153] : $txt[471]) . '</a>' $txt['newmessages4'] . ' ' $context['user']['unread_messages'] . ' ' . ($context['user']['unread_messages'] == $txt['newmessages0'] : $txt['newmessages1']).'</b>' '<br/>''.<br/><br/>
> <a href="'
$scripturl'?action=unread">'$txt['unread_since_visit'], '</a> <br />
> <a href="'
$scripturl'?action=unreadreplies">'$txt['show_unread_replies'], '</a><br />

</span>'
;

echo '
</td>
<td class="middletext" align="right" valign="top" style="padding-right:10px; padding-left:10px;">
<br/>'
;
// Are they logged in?
if ($context['user']['is_logged'])
{
// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']))
{
echo '
'
$txt['totalTimeLogged1'];

// If days is just zero, don't bother to show it.
if ($context['user']['total_time_logged_in']['days'] > 0)
echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];

// Same with hours - only show it if it's above zero.
if ($context['user']['total_time_logged_in']['hours'] > 0)
echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];

// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';
}
// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '
<b>'
$txt[616], '</b><br />';

// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '
'
$context['unapproved_members'] == $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="'$scripturl'?action=viewmembers;sa=browse;type=approve">'$context['unapproved_members'] == $txt['approve_member'] : $context['unapproved_members'] . ' ' $txt['approve_members'], '</a> '$txt['approve_members_waiting'], '<br />';

}
// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
else
{
echo '
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/sha1.js"></script>

<form action="'
$scripturl'?action=login2" method="post" accept-charset="'$context['character_set'], '" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' $context['session_id'] . '\');"' '''>
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
<select name="cookielength">
<option value="60">'
$txt['smf53'], '</option>
<option value="1440">'
$txt['smf47'], '</option>
<option value="10080">'
$txt['smf48'], '</option>
<option value="43200">'
$txt['smf49'], '</option>
<option value="-1" selected="selected">'
$txt['smf50'], '</option>
</select>
<input type="submit" value="'
$txt[34], '" /><br />
<span class="middletext">'
$txt['smf52'], '</span>
<input type="hidden" name="hash_passwrd" value="" />
</form>
<br/><br/>'
;
}

echo '
</td>
</tr>
<tr id="upshrinkHeader2"'
, empty($options['collapse_header']) ? '' ' style="display: none;"''>
<td colspan="3" class="memberbardivbottom">'
;

// color selection box
if(isset($settings['allow_color_change']) && $settings['allow_color_change'] == 'box')
  echo '
   <div style="position: relative; bottom: 13px; right:15px; float:right; ">
<form action="'
$scripturl'" method="post" class="smalltext">
<select name="options[theme_color]">
<option value="lightblue" '
,$settings['theme_main_color'] == 'lightblue' 'selected="selected"''''>Light Blue</option>
<option value="lightnavy" '
,$settings['theme_main_color'] == 'lightnavy' 'selected="selected"''''>Light Navy</option>
<option value="lightsilver" '
,$settings['theme_main_color'] == 'lightsilver' 'selected="selected"''''>Light Silver</option>
<option value="lightturquoise" '
,$settings['theme_main_color'] == 'lightturquoise' 'selected="selected"''''>Light Turquoise</option>
<option value="lightgreen" '
,$settings['theme_main_color'] == 'lightgreen' 'selected="selected"''''>Light Green</option>
<option value="lightolive" '
,$settings['theme_main_color'] == 'lightolive' 'selected="selected"''''>Light Olive</option>
<option value="lightgolden" '
,$settings['theme_main_color'] == 'lightgolden' 'selected="selected"''''>Light Golden</option>
<option value="lightbrown" '
,$settings['theme_main_color'] == 'lightbrown' 'selected="selected"''''>Light Brown</option>
<option value="lightred" '
,$settings['theme_main_color'] == 'lightred' 'selected="selected"''''>Light Red</option>
<option value="lightrose" '
,$settings['theme_main_color'] == 'lightrose' 'selected="selected"''''>Light Rose</option>
<option value="lightlilac" '
,$settings['theme_main_color'] == 'lightlilac' 'selected="selected"''''>Light Lilac</option>
<option value="lightviolet" '
,$settings['theme_main_color'] == 'lightviolet' 'selected="selected"''''>Light Violet</option>
</select>
<input type="submit" name="submit" value="Change" style="width: 11ex;" />
</form>
</div>'
;
if(isset($settings['allow_color_change']) && $settings['allow_color_change'] == 'bars')
echo '
<div style="position: relative; bottom: 15px; right:15px; float:right; ">
<form action="'
$scripturl'" method="post" class="smalltext">
<input style="border: solid 2px #6699CC; background-color: #6699CC; color: #6699CC; width: 20px; font-size: 1px;" type="submit" value="lightblue" name="options[theme_color]"/>
<input style="border: solid 2px #5371AD; background-color: #5371AD; color: #5371AD; width: 20px; font-size: 1px;" type="submit" value="lightnavy" name="options[theme_color]"/>
<input style="border: solid 2px #6C7F93; background-color: #6C7F93; color: #6C7F93; width: 20px; font-size: 1px;" type="submit" value="lightsilver" name="options[theme_color]"/>
<input style="border: solid 2px #53ADAD; background-color: #53ADAD; color: #53ADAD; width: 20px; font-size: 1px;" type="submit" value="lightturquoise" name="options[theme_color]"/>
<input style="border: solid 2px #4DB45D; background-color: #4DB45D; color: #4DB45D; width: 20px; font-size: 1px;" type="submit" value="lightgreen" name="options[theme_color]"/>
<input style="border: solid 2px #93A659; background-color: #93A659; color: #93A659; width: 20px; font-size: 1px;" type="submit" value="lightolive" name="options[theme_color]"/>
<input style="border: solid 2px #D8A259; background-color: #D8A259; color: #D8A259; width: 20px; font-size: 1px;" type="submit" value="lightgolden" name="options[theme_color]"/>
<input style="border: solid 2px #a67259; background-color: #a67259; color: #a67259; width: 20px; font-size: 1px;" type="submit" value="lightbrown" name="options[theme_color]"/>
<input style="border: solid 2px #E15050; background-color: #E15050; color: #E15050; width: 20px; font-size: 1px;" type="submit" value="lightred" name="options[theme_color]"/>
<input style="border: solid 2px #D47BC5; background-color: #D47BC5; color: #D47BC5; width: 20px; font-size: 1px;" type="submit" value="lightrose" name="options[theme_color]"/>
<input style="border: solid 2px #A185D6; background-color: #A185D6; color: #A185D6; width: 20px; font-size: 1px;" type="submit" value="lightlilac" name="options[theme_color]"/>
<input style="border: solid 2px #7F88B2; background-color: #7F88B2; color: #7F88B2; width: 20px; font-size: 1px;" type="submit" value="lightviolet" name="options[theme_color]"/>
</form>
</div>'
;
echo '
</td>
</tr>

</table>
</div>'
;
// End TP user info/news section
}
if(!empty($settings['custom_global_html']))
echo '
<div align="center" style="width: 90%; margin-left: auto; margin-right: auto; margin-top: 10px; border: 0px solid;" class="middletext">
'
$settings['custom_global_html'], '
</div>'
;
// The main content should go here.  A table is used because IE 6 just can't handle a div.
        
echo '<div id="bodyarea" style="padding: 0px 8px 0px 8px;">
        <table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>'
;

// TinyPortal integrated bars
          
if($context['TPortal']['leftbar'])
          {
              echo 
'<td width="' ,$context['TPortal']['leftbar_width'], '" style="padding: ' , isset($context['TPortal']['padding']) ? $context['TPortal']['padding'] : '4' 'px; background-color: transparent; padding-top: 4px;" valign="top">
                 <div id="leftbarHeader"'
, empty($options['collapse_leftbar']) ? '' ' style="display: none;"'' style="padding-top: 5px; width: ' ,$context['TPortal']['leftbar_width'], 'px;">';
                 
TPortal_sidebar('left');
              echo 
'</div></td>';

          }
        echo 
'<td width="100%" align="left" valign="top" style="padding-top: 10px; padding-bottom: 10px;">';
        if(
$context['TPortal']['centerbar'])
                     echo 
'<div>' TPortal_sidebar('center') , '</div>';
}
function 
template_main_below()
{
global $context$settings$options$scripturl$txt;

echo '</td>';

         
// TinyPortal integrated bars
          
if($context['TPortal']['rightbar']){
              echo 
'<td style="padding: ' , isset($context['TPortal']['padding']) ? $context['TPortal']['padding'] : '4' 'px; background-color: transparent; padding-top: 4px;" valign="top" align="right">
                 <div id="rightbarHeader"'
, empty($options['collapse_rightbar']) ? '' ' style="display: none;"'' style="width: ' ,$context['TPortal']['rightbar_width'], 'px; text-align: left; padding-top: 5px;">';
              
TPortal_rightbar();
              echo 
'</div></td>';
          }
        echo 
'</tr></table></div>';

// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '

<div id="footerarea" style="text-align: center; padding-bottom: 1ex;'
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' '''">
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function smfFooterHighlight(element, value)
{
element.src = smf_images_url + "/" + (value ? "h_" : "") + element.id + ".gif";
}
// ]]></script>
<table cellspacing="0" cellpadding="3" border="0" align="center" width="100%">
<tr>
<td width="28%" valign="middle" align="'
, !$context['right_to_left'] ? 'right' 'left''">
<a href="http://www.mysql.com/" target="_blank"><img id="powered-mysql" src="'
$settings['images_url'], '/powered-mysql.gif" alt="'$txt['powered_by_mysql'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://www.php.net/" target="_blank"><img id="powered-php" src="'
$settings['images_url'], '/powered-php.gif" alt="'$txt['powered_by_php'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
<td valign="middle" align="center" style="white-space: nowrap;">
'
theme_copyright(), ' <span class="smalltext">| 'tportal_version(), '</span>
<br/><br/>'
;
if(isset($settings['custom_copyright']))
echo '<span class="smalltext">'$settings['custom_copyright'],'</span>';
  echo'</td>
<td width="28%" valign="middle" align="'
, !$context['right_to_left'] ? 'left' 'right''">
<a href="http://validator.w3.org/check/referer" target="_blank"><img id="valid-xhtml10" src="'
$settings['images_url'], '/valid-xhtml10.gif" alt="'$txt['valid_xhtml'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank"><img id="valid-css" src="'
$settings['images_url'], '/valid-css.gif" alt="'$txt['valid_css'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<span style="float:right; margin-right:10px; font-size:70%;"><b>Dilber MC</b> Theme by <b><a href="http://www.harzem.com/themes/themes.php?theme=dilbermc;color='
$settings['theme_main_color'], '" target="_blank">HarzeM</a></b></span>
</td>
</tr>
</table>'
;

// Show the load time?
if ($context['show_load_time'])
echo '
<span class="smalltext">'
$txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';

// This is an interesting bug in Internet Explorer AND Safari. Rather annoying, it makes overflows just not tall enough.
if (($context['browser']['is_ie'] && !$context['browser']['is_ie4']) || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'])
{
// The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA['
;

// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
if ($context['browser']['is_safari'])
echo '
window.addEventListener("load", smf_codeFix, false);

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if ((codeFix[i].className == "code" || codeFix[i].className == "post" || codeFix[i].className == "signature") && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
}
}'
;
else
echo '
var window_oldOnload = window.onload;
window.onload = smf_codeFix;

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = codeFix.length - 1; i > 0; i--)
{
if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0) && (codeFix[i].offsetHeight != 0 || codeFix[i].className == "code"))
codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
}

if (window_oldOnload)
{
window_oldOnload();
window_oldOnload = null;
}
}'
;

echo '
// ]]></script>'
;
}
// TinyPortal
         
echo '</div>';
     if(
$context['TPortal']['fixed_width']!=0)
             echo 
'</td></tr></table>';
// end
echo '
</div>
'
,($context['browser']['is_ie']) ? '</td></tr></table>' '</div>' '
</div>'
;
// The following will be used to let the user know that some AJAX process is running
echo '
<div id="ajax_in_progress" class="ajax_in_progress" style="display: none;'
$context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' '''">'$txt['ajax_in_progress'], '</div>
</body></html>'
;
}

// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
global $context$settings$options;

echo '<div class="nav" style="font-size: 85%; margin-bottom: 2ex; margin-top: 2ex;">';

// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Show the link, including a URL if it should have one.
echo '<b>'$settings['linktree_link'] && isset($tree['url']) ? '<a href="' $tree['url'] . '" class="nav">' $tree['name'] . '</a>' $tree['name'], '</b>';

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo '&nbsp;>&nbsp;';
}

echo '</div>';
}

// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context$settings$options$scripturl$txt;

// Work out where we currently are.
$current_action 'home';
if (in_array($context['current_action'], array('admin''ban''boardrecount''cleanperms''detailedversion''dumpdb''featuresettings''featuresettings2''findmember''maintain''manageattachments''manageboards''managecalendar''managesearch''membergroups''modlog''news''optimizetables''packageget''packages''permissions''pgdownload''postsettings''regcenter''repairboards''reports''serversettings''serversettings2''smileys''viewErrorLog''viewmembers')))
$current_action 'admin';
if (in_array($context['current_action'], array('search''admin''calendar''gallery''profile''mlist''register''login''help''pm''forum''tpadmin')))
$current_action $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action 'search';
if (isset($_GET['dl']))
$current_action 'dlmanager';
if (isset($_GET['board']) || isset($_GET['topic']))
$current_action 'forum';
if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' 'profile' 'admin';

// Dummy place holder, to set the height
echo'
<td align="center" class="menubg" height="30" width="20">
</td>'
;

// Show the [home] button.
echo'
<td align="center" class="menubg' 
$current_action == 'home' '2' '' '">
<a href="'
$scripturl'">' $txt[103] , '</a>
</td>'
;
       if(
$settings['TPortal_front_type']!='boardindex')
// Show the [forum] button.
echo'
<td align="center" class="menubg' 
$current_action == 'forum' '2' '' '">
<a href="'
$scripturl'?action=forum">'.$txt['tp-forum'].'</a>
</td>'
;
// Show the [help] button.
echo'
<td align="center" class="menubg' 
$current_action == 'help' '2' '' '">
<a href="'
$scripturl'?action=help">' $txt[119] , '</a>
</td>'
;
// How about the [search] button?
if ($context['allow_search'])
echo'
<td align="center" class="menubg' 
$current_action == 'search' '2' '' '">
<a href="'
$scripturl'?action=search">' $txt[182] , '</a>
</td>'
;
// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo'
<td align="center" class="menubg' 
$current_action == 'admin' '2' '' '">
<a href="'
$scripturl'?action=admin">' $txt[2] , '</a>
</td>'
;
// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo'
<td align="center" class="menubg' 
$current_action == 'profile' '2' '' '">
<a href="'
$scripturl'?action=profile">' $txt[79] , '</a>
</td>'
;
// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo'
<td align="center" class="menubg' 
$current_action == 'pm' '2' '' '">
<a href="'
$scripturl'?action=pm">' $txt['pm_short'] , ' '$context['user']['unread_messages'] > '[<strong>'$context['user']['unread_messages'] . '</strong>]' '' '</a>
</td>'
;

// Show the [gallery] button.
echo'
<td align="center" class="menubg' 
$current_action == 'help' '2' '' '">
<a href="'
$scripturl'?action=gallery">' $txt['smfgallery_menu'] , '</a>
</td>'
;


// The [calendar]!
if ($context['allow_calendar'])
echo'
<td align="center" class="menubg' 
$current_action == 'calendar' '2' '' '">
<a href="'
$scripturl'?action=calendar">' $txt['calendar24'] , '</a>
</td>'
;
// the [member] list button
if ($context['allow_memberlist'])
echo'
<td align="center" class="menubg' 
$current_action == 'mlist' '2' '' '">
<a href="'
$scripturl'?action=mlist">' $txt[331] , '</a>
</td>'
;

// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo'
<td align="center" class="menubg' 
$current_action == 'login' '2' '' '">
<a href="'
$scripturl'?action=login">' $txt[34] , '</a>
</td>'
;
// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo'
<td align="center" class="menubg' 
$current_action == 'register' '2' '' '">
<a href="'
$scripturl'?action=register">' $txt[97] , '</a>
</td>'
;
// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo'
<td align="center" class="menubg' 
$current_action == 'logout' '2' '' '">
<a href="'
$scripturl'?action=logout;sesc='$context['session_id'], '">' $txt[108] , '</a>
</td>'
;

// Dummy place holder, to end things
echo'
<td align="center" class="menubg" width="20">
</td>'
;
// TinyPortal
 if($context['TPortal']['leftbar'])
             echo 
'<td style="padding-left: 1ex;"><a href="javascript:void(0);" onclick="shrinkHeaderLeftbar(!current_leftbar); return false;"><img id="upshrinkLeftbar" src="'$settings['images_url'], '/', empty($options['collapse_leftbar']) ? 'upshrink.gif' 'upshrink2.gif''" alt="*" title="'$txt['upshrink_description'], '" style="margin: 2px 0;" border="0" /></a><img id="upshrinkTempLeftbar" src="'$settings['images_url'], '/blank.gif" alt="" style="margin-right: 0ex;" /></td>';
         if(
$context['TPortal']['rightbar'])
             echo 
'<td style="padding-left: 1ex;"><a href="javascript:void(0);" onclick="shrinkHeaderRightbar(!current_rightbar); return false;"><img id="upshrinkRightbar" src="'$settings['images_url'], '/', empty($options['collapse_rightbar']) ? 'upshrink.gif' 'upshrink2.gif''" alt="*" title="'$txt['upshrink_description'], '" style="margin: 2px 0;" border="0" /></a><img id="upshrinkTempRightbar" src="'$settings['images_url'], '/blank.gif" alt="" style="margin-right: 0ex;" /></td>';
// TinyPortal end
echo '
</tr>
</table>'
;
}
// Generate a strip of buttons.
function template_button_strip($button_strip$direction 'top'$force_reset false$custom_td '')
{
global $settings$buttons$context$txt$scripturl;

// Create the buttons...
foreach ($button_strip as $key => $value)
{
if (isset($value['test']) && empty($context[$value['test']]))
{
unset($button_strip[$key]);
continue;
}
elseif (!isset($buttons[$key]) || $force_reset)
$buttons[$key] = '<a href="' $value['url'] . '" ' .( isset($value['custom']) ? $value['custom'] : '') . '>' $txt[$value['text']] . '</a>';

$button_strip[$key] = $buttons[$key];
}

if (empty($button_strip))
return '<td>&nbsp;</td>';

echo '
<td class="'
$direction == 'top' 'main' 'main''strip_first''">&nbsp;</td>
<td class="'
$direction == 'top' 'main' 'main''strip">'implode(' &nbsp;|&nbsp; '$button_strip) , '</td>
<td class="'
$direction == 'top' 'main' 'main''strip_last' '">&nbsp;</td>';
}

?>







   
http://www.triumphtalk.com

"The real question is not whether machines think but whether men do. "

Johno69

#936
I had a MOD like this about a year back, and it scrolled the usernames accross the bottom, rather than having them all there on display.

Does anyone know what that was?

I cant find it.

update: nevermind, I just used a marquee tag.

allymcbeal

I used 1.4 it works.

But I'd prefer that guest don't see how many people login today, what I have to modify for that?
Thanks.

jaccione

Posted this earlier up, this will hide it to only admin, you can probably change the permisson to whatever level you want.
just wrap your block of code in this

if ($context['user']['is_admin'])
{

the code for the mod here
}
www.math.net.au for all your math homework needs

allymcbeal

Hi, jaccione, thanks, but I need all the member log in see how many people login today. :)

Advertisement: