################################################################################
##
## Hack Title: User Always Browsing
## Hack Version: 1.0.1
## Hack Author: John McKernan (JohnMcK )
##
## Hack Description: This hack ensures that the user's name is always
## shown in 'Users browsing this forum' (view-forum
## pages).
##
## This simple hack does not affect the online user list
## refresh rate.
##
## phpBB Version: 2.0.4 - 2.0.6
##
## Difficulty Level: Easy
## Installation Time: 5 Minutes
##
## Files To Edit: (1)
## \includes\page_header.php
##
## Release History:
## 1.0.0 - Initial release (Aug 29, 2003)
## 1.0.1 - Nov 17, 2003
## Fixed bug - extraneous comma
##
################################################################################
##
## FOR UPDATES/SUPPORT, please visit
http://www.phpbbhacks.com/forums
##
## Stay up-to-date on the latest news involving our hacks, sign-up for
## our newsletter at
http://wwww.presagemedia.com/lists/?p=subscribe
##
## This author supports phpBBHacks.com. This hack is made available
## solely through their database at
http://www.phpbbhacks.com
##
## If you are new to installing hacks for phpBB, may I suggest that you take
## a look at my 'Installing phpBB Hacks' tutorial at phpBBHacks.com. You can
## find it here:
http://www.phpbbhacks.com/forums/viewtopic.php?t=12211. You
## may also want to take a look at my other tutorials and articles available
## at
http://www.presagemedia.com/hacks/cms_articles.php
##
################################################################################
##
## This hack is released under the GPL License.
## All Intellectual Property Rights are retained by the hack author(s)
## shown above.
##
## This hack can be freely used, but not distributed, without permission.
##
################################################################################
## Author Notes:
##
## This hack requires php 4.0.
##
## This hack has been tested/verified on v 2.0.4 & 2.0.6
##
################################################################################
##
##----------[ OPEN ]-------------------------------------
##
\includes\page_header.php
##
##----------[ FIND ]-------------------------------------
##
if ( empty($online_userlist) )
{
$online_userlist = $lang['None'];
}
##
##----------[ AFTER, ADD ]-------------------------------
##
// user always browsing - only needed if on view-forum & user is not hidden
if ( isset($forum_id) && $userdata['session_logged_in'] && $userdata['user_allow_viewonline'] )
{
// build online link for current user
if ( $userdata['user_level'] == ADMIN )
{
$userlink_name = '<b>' . $userdata['username'] . '</b>';
$userlink_style = 'style="color:#' . $theme['fontcolor3'] . '"';
}
else if ( $userdata['user_level'] == MOD )
{
$userlink_name = '<b>' . $userdata['username'] . '</b>';
$userlink_style = 'style="color:#' . $theme['fontcolor2'] . '"';
}
else
{
$userlink_name = $userdata['username'];
$userlink_style = '';
}
$user_browsing_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $userdata['user_id']) . '"' . $userlink_style . '>' . $userlink_name . '</a>';
// if userlist shows `none` replace with user_browsing_link
if ( $online_userlist == $lang['None'] )
{
$online_userlist = $user_browsing_link;
}
// add link if user is missing from list
else if ( substr_count($online_userlist, $user_browsing_link) == 0 )
{
$online_userlist .= ', ' . $user_browsing_link;
}
}
##
##----------[ SAVE AND CLOSE ALL FILES ]-----------------
##
## End
##