News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Users Online Today Mod

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

Previous topic - Next topic

Bigguy

No I dont believe there are permissions for this mod but there should be away to do that by modifying the code somehow. Its a good idea though. :)

cyberstang5.0

Quote from: Bigguy on March 07, 2006, 08:57:50 PM
No I dont believe there are permissions for this mod but there should be away to do that by modifying the code somehow. Its a good idea though. :)
Alright, is there anyone brave enough to write the code for this?  I am not a programmer by any means...

Bigguy

I would help but I dont know enough about it yet, sorry.

DemonicInfluence

just make it so that
if($context['user']['is_admin'])
{


is before the mod stuff in the boardindex.template.php of every theme.

Then at the end put
}

Should work to only allow admins to see..

Red

#264
great mod...

any way to change the "online users" list so it would show the list in alphabetical order???

beemer

Quote from: Red on March 10, 2006, 07:43:03 AM
great mod...

any way to change the "online users" list so it would show the list in alphabetical order???


I am sure this has allready been covered in this post
http://www.bmw7resource.co.uk
SMF 1.1 RC1
MKP 1.1 RC1
Helios Multi RC1
-------------------------------------------------------
http://www.thefishsheadnhorsesarse.co.uk
SMF 1.1 RC2
TinyPortal 0.8.6

cbrchris

Great mod!

It works with no problem under the defualt theme.  I am trying to modify the Helios Multi theme for it to work.

I know I have to modify the file: BoardIndex.template.php

I have attempted to insert the required code
// Users online today
echo '
<tr>
<td class="titlebg" colspan="2">', $txt['uot_users_online_today_title'], '</td>
</tr><tr>
<td class="windowbg" width="20" valign="middle" align="center">
<img src="', $settings['images_url'], '/icons/online.gif" alt="', $txt[158], ' ', $txt['uot_users_online_today_title'], '" border="0" />
</td>
<td class="windowbg2" width="100%">';

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

echo $context['num_users_online_today'], ' ', $context['num_users_online_today'] == 1 ? $txt['uot_user_online_today'] : $txt['uot_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']))
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>';


right before the line:
Most users online ever: <b>'.$modSettings['mostOnline'].'</b> ( '.timeformat($modSettings['mostDate']).'

when I attempt to save the updated file within the admin panel to modify the BoardIndex.template.php file, I get this error:   

The file you tried to save generated the following error:
Parse error: parse error, unexpected '>' in BoardIndex.template.php on line 445


line 445 of this file after the modification is:
<td class="windowbg" width="20" valign="middle" align="center">


The board is currently SMF 1.1 RC2.  Any assistance will be greatly appreciated. I don't know enough to determine what the problem is.

Thanks!

beemer

You dont want to put it there

find

                        Most users online today: '.$modSettings['mostOnlineToday'].' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        Most users online ever: <b>'.$modSettings['mostOnline'].'</b> ( '.timeformat($modSettings['mostDate']).'  )

                        </span>


                </td>
        </tr>';


And replace everything below with

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

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

echo $context['num_users_online_today'], ' ', $context['num_users_online_today'] == 1 ? $txt['uot_user_online_today'] : $txt['uot_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']))
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>';

// 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="catbg" 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'] == 1 ? $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="catbg" 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" 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>';
echo $botbox.'</div>';

}

?>
http://www.bmw7resource.co.uk
SMF 1.1 RC1
MKP 1.1 RC1
Helios Multi RC1
-------------------------------------------------------
http://www.thefishsheadnhorsesarse.co.uk
SMF 1.1 RC2
TinyPortal 0.8.6

nebulous

#268
great mod, thanks Carceri.

mouse over username showing last login time is not working in Opera, anyone facing the same problem?
work great on firefox though.

edit: sorry my fault, I disabled opera's "show tooltip"

cbrchris

Thanks beemer! That worked great.

beemer

http://www.bmw7resource.co.uk
SMF 1.1 RC1
MKP 1.1 RC1
Helios Multi RC1
-------------------------------------------------------
http://www.thefishsheadnhorsesarse.co.uk
SMF 1.1 RC2
TinyPortal 0.8.6

kcs

hi all,
i noticed that my MOST USERS stats is not updated... even after i "RECOUNT" under Forum maintenance...

any idea what went wrong?

thanks!

Backlash

i had a problem, and don't know how to fix it.


8: Undefined index: uot_hidden
Datei: /home/www/web23/html/board/Themes/default/BoardIndex.template.php (eval?)
Zeile: 419

8: Undefined index: uot_visible
Datei: /home/www/web23/html/board/Themes/default/BoardIndex.template.php (eval?)
Zeile: 419


8: Undefined index: uot_users_online_today_title
Datei: /home/www/web23/html/board/Themes/default/BoardIndex.template.php (eval?)
Zeile: 410


is there somebody who is able to help me??

perplexed

Quote from: kcs on April 18, 2006, 10:14:37 PM
hi all,
i noticed that my MOST USERS stats is not updated... even after i "RECOUNT" under Forum maintenance...

any idea what went wrong?

thanks!


I could be wrong but I thought that this mod shows the number of members online in a 24hour period, whereas your most users online is most members online at the one time?

So you could have 35 people online in a 24 hour period but only 10 of them on at the same time, so the most online would be 10 not 35

If that's wrong, someone let me know, but that was my understanding :)

perplexed

Quote from: Backlash on April 19, 2006, 06:46:53 PM
i had a problem, and don't know how to fix it.


8: Undefined index: uot_hidden
Datei: /home/www/web23/html/board/Themes/default/BoardIndex.template.php (eval?)
Zeile: 419

8: Undefined index: uot_visible
Datei: /home/www/web23/html/board/Themes/default/BoardIndex.template.php (eval?)
Zeile: 419


8: Undefined index: uot_users_online_today_title
Datei: /home/www/web23/html/board/Themes/default/BoardIndex.template.php (eval?)
Zeile: 410


is there somebody who is able to help me??

there is something about it here in this thread http://www.simplemachines.org/community/index.php?topic=36793.msg520999

kcs

hi,
agree with you on the "bottom" stats portion, but for the "top" portion, there's also a "Users seen today" value... and this value doesnt tally with the users seen on the main index page....

any idea what went wrong?

another query is that, how can i go about "adding" the MOST Seen online Users" on the bottom portion of the stats?

thanks!


Quote from: perplexed on April 20, 2006, 08:13:45 AM
I could be wrong but I thought that this mod shows the number of members online in a 24hour period, whereas your most users online is most members online at the one time?

So you could have 35 people online in a 24 hour period but only 10 of them on at the same time, so the most online would be 10 not 35

If that's wrong, someone let me know, but that was my understanding :)


Quote from: kcs on April 18, 2006, 10:14:37 PM
hi all,
i noticed that my MOST USERS stats is not updated... even after i "RECOUNT" under Forum maintenance...

any idea what went wrong?

thanks!



top_secret

hi people

i´m having problems with the installation...

apears to me this error:

-------------------------------------------------------------------------
391:                   </div>
392:                </td>
393:             </tr>
394:             <tr>
395:                <td class="windowbg2" width="100%">
396:                   <span class="middletext">
397:                      ', $txt['most_online_today'], ': <b>', $modSettings['mostOnlineToday'], '</b>.
398:                      // Users online today
399:    echo '

400:    <tr>

401:       <td class="titlebg" colspan="2">', $txt['uot_users_online_today_title'], '</td>
402:    </tr><tr>
403:       <td class="windowbg" width="20" valign="middle" align="center">
404:          <img src="', $settings['images_url'], '/icons/online.gif" alt="', $txt[158], ' ', $txt['uot_users_online_today_title'], '" border="0" />

----------------------------------------------------------------------------------------

Parse error: parse error, unexpected '>' in .../Themes/default/BoardIndex.template.php on line 400


please help me!!!

im using the DEFAULT THEME and the 1.1 RC2

DemonicInfluence

Quote from: top_secret on April 23, 2006, 02:08:28 PM
hi people

i´m having problems with the installation...

apears to me this error:

-------------------------------------------------------------------------
391:                   </div>
392:                </td>
393:             </tr>
394:             <tr>
395:                <td class="windowbg2" width="100%">
396:                   <span class="middletext">
397:                      ', $txt['most_online_today'], ': <b>', $modSettings['mostOnlineToday'], '</b>.
398:                      // Users online today
399:    echo '

400:    <tr>

401:       <td class="titlebg" colspan="2">', $txt['uot_users_online_today_title'], '</td>
402:    </tr><tr>
403:       <td class="windowbg" width="20" valign="middle" align="center">
404:          <img src="', $settings['images_url'], '/icons/online.gif" alt="', $txt[158], ' ', $txt['uot_users_online_today_title'], '" border="0" />

----------------------------------------------------------------------------------------

Parse error: parse error, unexpected '>' in .../Themes/default/BoardIndex.template.php on line 400


please help me!!!

im using the DEFAULT THEME and the 1.1 RC2



Replace this:;


</div>
</td>
</tr>
<tr>
<td class="windowbg2" width="100%">
<span class="middletext">
', $txt['most_online_today'], ': <b>', $modSettings['mostOnlineToday'], '</b>.
// Users online today
echo '

<tr>

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


with:

</div>
</td>
</tr>
<tr>
<td class="windowbg2" width="100%">
<span class="middletext">
', $txt['most_online_today'], ': <b>', $modSettings['mostOnlineToday'], '</b>.';
// Users online today
echo '

<tr>

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


top_secret

#278
now is this:

Quote419:    if (!empty($context['users_online_today']) && !$context['user']['is_guest'])
420:       echo '<br />', implode(', ', $context['list_users_online_today']);
421:
422:    echo '
423:             <br />', $context['show_stats'] && !$settings['show_sp1_info'] ? '
424:             <a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
425:          </div>
426:       </td>
427:    </tr>';

428:                      ', $txt['most_online_ever'], ': ', $modSettings['mostOnline'], ' (' , timeformat($modSettings['mostDate']), ')

429:                   </span>
430:                </td>
431:             </tr>';

Parse error: parse error, unexpected T_STRING in .../Themes/default/BoardIndex.template.php on line 428

help please !!!  :'(

DemonicInfluence

CHange this:

419:    if (!empty($context['users_online_today']) && !$context['user']['is_guest'])
420:       echo '<br />', implode(', ', $context['list_users_online_today']);
421:
422:    echo '
423:             <br />', $context['show_stats'] && !$settings['show_sp1_info'] ? '
424:             <a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
425:          </div>
426:       </td>
427:    </tr>';

428:                      ', $txt['most_online_ever'], ': ', $modSettings['mostOnline'], ' (' , timeformat($modSettings['mostDate']), ')

429:                   </span>
430:                </td>
431:             </tr>';


to:

419:    if (!empty($context['users_online_today']) && !$context['user']['is_guest'])
420:       echo '<br />', implode(', ', $context['list_users_online_today']);
421:
422:    echo '
423:             <br />', $context['show_stats'] && !$settings['show_sp1_info'] ? '
424:             <a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
425:          </div>
426:       </td>
427:    </tr>
428:                      ', $txt['most_online_ever'], ': ', $modSettings['mostOnline'], ' (' , timeformat($modSettings['mostDate']), ')
429:                   </span>
430:                </td>
431:             </tr>';

Advertisement: