Show username in browser status bar instead of user id number?

Started by Elijah Bliss, October 17, 2004, 12:54:43 AM

Previous topic - Next topic

Elijah Bliss

In YaBB, when you moused over a unser screen name any where in the forum,
in the status bar you were able to see their username. This came in handy for me
as an admin to track who was who since my users change their screenname everyday.



instead of showing u=2506 show u=Elijah Bliss or username=Elijah Bliss

Metho

How about this instead? Shows their member name on hover.
In BoardIndex.php
FIND:
if (!empty($row['onlineColor']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" style="color: ' . $row['onlineColor'] . ';">' . $row['realName'] . '</a>';
else
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>';

REPLACE WITH: if (!empty($row['onlineColor']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" title="' . $row['memberName'] . '" style="color: ' . $row['onlineColor'] . ';">' . $row['realName'] . '</a>';
else
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" title="' . $row['memberName'] . '">' . $row['realName'] . '</a>';
Easier than messing with linky stuff and more visually useful in my opinion.

- Methonis
Joshua "Methonis" Frazer
Support Specialist
The Simple Machines Team

Elijah Bliss

Quote from: Metho on October 17, 2004, 02:51:21 AM
How about this instead? Shows their member name on hover.
In BoardIndex.php
FIND:
if (!empty($row['onlineColor']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" style="color: ' . $row['onlineColor'] . ';">' . $row['realName'] . '</a>';
else
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>';

REPLACE WITH: if (!empty($row['onlineColor']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" title="' . $row['memberName'] . '" style="color: ' . $row['onlineColor'] . ';">' . $row['realName'] . '</a>';
else
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" title="' . $row['memberName'] . '">' . $row['realName'] . '</a>';
Easier than messing with linky stuff and more visually useful in my opinion.

- Methonis

Thanks, this will suffice.

d3v

what about 1.0.4? I looked into BoardIndex.template and it no longer has the code that you pasted. Just wondering.

Elijah Bliss

Quote from: d3v on June 10, 2005, 11:28:03 PM
what about 1.0.4? I looked into BoardIndex.template and it no longer has the code that you pasted. Just wondering.

Sources/BoardIndex.php

d3v


† ÐëepÇuT¹ †




Personal Website
x3Generation - gaming
graphics and anime.
 

Favorite Forums
> SimpleMachines Forum
> GamerzPlanet Forums


markd

To make the registered username appear in the hover globally (meaning in Posts & PMs)..

In Sources/Load.Php:

look for..

// What a monstrous array...
        $memberContext[$user] = array(
                'username' => &$profile['memberName'],
                'name' => &$profile['realName'],
                'id' => &$profile['ID_MEMBER'],
                'is_guest' => $profile['ID_MEMBER'] == 0,
                'is_buddy' => $profile['buddy'],
                'is_reverse_buddy' => in_array($ID_MEMBER, $buddy_list),
                'buddies' => $buddy_list,
                'title' => !empty($modSettings['titlesEnable']) ? $profile['usertitle'] : '',
                'href' => $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'],
                'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'] . '" title="' . $txt[92] . ' ' .  $profile['realName'] . '">' . $profile['realName'] . '</a>',


and replace the 'link' line with:


                 'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'] . '" title="' . $txt[92] . ' ' .  $profile['memberName'] . '">' . $profile['realName'] . '</a>',


basically you're changing the first occurence of $profile['realName'] in the line to $profile['memberName'].

Works for almost all versions of SMF including the newly released Beta 3 Public.

enjoy.
-markd

edit:  the horizontal scroll bar didn't appear for me (using Firefox) in the replacement code section when I viewed my post, but be sure to copy and paste that ENTIRE line, not just what you see in the box.. it scrolls completely to the right!!

rojamaia


thanks for this mod!  it worked for me.  it's really good and it enables us to monitor our members who keep on changing their display names  :D


actually, i tried this code change in almost every link on my source files.  it worked everywhere, except in the MessageIndex.php on the part where you view who_is_viewing the page or the topic.

if (!empty($row['showOnline']) || allowedTo('moderate_forum'))
$context['view_members_list'][] = empty($row['showOnline']) ? '<i><a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" title="' . $txt[92] . ' ' .  $row['memberName'] . '">' . $row['realName'] . '</a></i>' : '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" title="' . $txt[92] . ' ' .  $row['memberName'] . '">' . $row['realName'] . '</a>';
$context['view_members'][] = array(
'id' => $row['ID_MEMBER'],
'username' => $row['memberName'],
'name' => $row['realName'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" title="' . $txt[92] . ' ' .  $row['memberName'] . '">' . $row['realName'] . '</a>',
'hidden' => empty($row['showOnline']),



In the board view, it only says
QuoteView the profile of
and no name.  In the topic view, there's no hoverlink at all.




hcfwesker

I know this is like 5 years old.   But can anyone update these for smf 1.1.11

Quote from: Metho on October 17, 2004, 02:51:21 AM
How about this instead? Shows their member name on hover.
In  Sources/BoardIndex.php
FIND:
if (!empty($row['onlineColor']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" style="color: ' . $row['onlineColor'] . ';">' . $row['realName'] . '</a>';
else
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>';

REPLACE WITH: if (!empty($row['onlineColor']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" title="' . $row['memberName'] . '" style="color: ' . $row['onlineColor'] . ';">' . $row['realName'] . '</a>';
else
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" title="' . $row['memberName'] . '">' . $row['realName'] . '</a>';
Easier than messing with linky stuff and more visually useful in my opinion.

- Methonis

Doesn't work at all for 1.1.11 , still showing the member ID number in the URL bar.


Quote from: markd on July 12, 2005, 12:38:58 PM
To make the registered username appear in the hover globally (meaning in Posts & PMs)..

In Sources/Load.Php:

look for..

// What a monstrous array...
        $memberContext[$user] = array(
                'username' => &$profile['memberName'],
                'name' => &$profile['realName'],
                'id' => &$profile['ID_MEMBER'],
                'is_guest' => $profile['ID_MEMBER'] == 0,
                'is_buddy' => $profile['buddy'],
                'is_reverse_buddy' => in_array($ID_MEMBER, $buddy_list),
                'buddies' => $buddy_list,
                'title' => !empty($modSettings['titlesEnable']) ? $profile['usertitle'] : '',
                'href' => $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'],
                'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'] . '" title="' . $txt[92] . ' ' .  $profile['realName'] . '">' . $profile['realName'] . '</a>',


and replace the 'link' line with:


                 'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'] . '" title="' . $txt[92] . ' ' .  $profile['memberName'] . '">' . $profile['realName'] . '</a>',


basically you're changing the first occurence of $profile['realName'] in the line to $profile['memberName'].

^^ this one did work, but colored names (including staff) all went to the regular default member link color.

These are 2 necessities for our forum and was thrilled to find them.  they just need an updated touch, please. :)



hcfwesker


Advertisement: