With this snippet you can see, which profile is watched
- Show username of watched profile with group colours and link to watched profile
Screen: follows
Demo: follows
Instruction
open
viewonline.php
find
- Code: Select all
// Get user list
before add
- Code: Select all
// Which Profile is Watching / 4seven / 2011
function user_get_name($u_id)
{
global $db;
$sql = 'SELECT username, user_colour
FROM ' . USERS_TABLE . '
WHERE user_id = ' . $db->sql_escape($u_id);
$result = $result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if($row)
{
return ': ' . get_username_string('full', $u_id, $row['username'], $row['user_colour']);
}
else
{
return '';
}
}
// Which Profile is Watching / 4seven / 2011
find
- Code: Select all
preg_match('#^([a-z0-9/_-]+)#i', $row['session_page'], $on_page);
if (!sizeof($on_page))
{
$on_page[1] = '';
}
after add
- Code: Select all
// Which Profile is Watching / 4seven / 2011
$on_apps = explode("?",$row['session_page']);
$on_apps = (!empty($on_apps[1])) ? $on_apps[1] : '';
$on_apps_u = ($on_apps && strpos($on_apps, 'u=')) ? user_get_name(str_replace('mode=viewprofile&u=', '', $on_apps)) : '';
// Which Profile is Watching / 4seven / 2011
find
- Code: Select all
'FORUM_LOCATION' => $location,
replace with
- Code: Select all
'FORUM_LOCATION' => $location . $on_apps_u, // Which Profile is Watching / 4seven / 2011
Clear all Board- and Browsercaches