having users show in topbar

Started by Pod, October 04, 2005, 11:28:36 PM

Previous topic - Next topic

Pod

hello i was wondering if some 1 could help me..on my forum id like users to be listed in my top bar..

like
Total Users Online: 4 Users, 5 guests And Below i want it to list the users that are on...i know some 1 knows how to do this..

thanks :d

heres my site to show ya how the top of my site looks
http://www.wicked-messenger.info
username:test password:test
Things change if you change them, thing about it

Pod

Things change if you change them, thing about it

Karmalakas

pasword is incorrect
but as far as i understand you have to modify index.template.php (or maybe portal.template.php cause you're using simple portal right?)

Pod

am using mkportal with smf...username is Test  password is test.... should login for ya
Things change if you change them, thing about it

Karmalakas

I've never used MKPortal, but i think you should find in Boardindex.template.php this
// "Users online" - in order of activity.
echo '
<tr>
<td class="catbg" 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'] == 1 ? $txt['guest'] : $txt['guests'], ', ' . $context['num_users_online'], ' ', $context['num_users_online'] == 1 ? $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'] == 1 ? $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>';


And if you want it to be shown in every page then you should paste it to Portal.template.php (or smth like this) in a place where you want. Dont forget to put it in <table>....</table> tags if needed

I think this should work, you may test it, but don't blame me if it doesn't help ;)

Pod

Things change if you change them, thing about it

Advertisement: