[Snippet] Which Profile is Watching (en) (new)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
Instructionopenviewonline.php
findCode:
before addCode:
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 '';
}
}
findCode:
preg_match('#^([a-z0-9/_-]+)#i', $row['session_page'], $on_page);
if (!sizeof($on_page))
{
$on_page[1] = '';
}
after addCode:
$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)) : '';
findCode:
'FORUM_LOCATION' => $location,
replace withCode:
'FORUM_LOCATION' => $location . $on_apps_u,
Clear all Board- and Browsercaches