Advertisement:

Author Topic: Show username in browser status bar instead of user id number?  (Read 30721 times)

Offline Elijah Bliss

  • Sophist Member
  • *****
  • Posts: 1,340
Show username in browser status bar instead of user id number?
« on: October 17, 2004, 12:54:43 AM »
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

Offline Metho

  • SMF Friend
  • Full Member
  • *
  • Posts: 564
  • Gender: Male
Re: Show username in browser status bar instead of user id number?
« Reply #1 on: October 17, 2004, 02:51:21 AM »
How about this instead? Shows their member name on hover.
In BoardIndex.php
FIND:
Code: [Select]
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:
Code: [Select]
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

Offline Elijah Bliss

  • Sophist Member
  • *****
  • Posts: 1,340
Re: Show username in browser status bar instead of user id number?
« Reply #2 on: October 17, 2004, 03:09:45 AM »
How about this instead? Shows their member name on hover.
In BoardIndex.php
FIND:
Code: [Select]
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:
Code: [Select]
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.

Offline d3v

  • Jr. Member
  • **
  • Posts: 209
Re: Show username in browser status bar instead of user id number?
« Reply #3 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.

Offline Elijah Bliss

  • Sophist Member
  • *****
  • Posts: 1,340
Re: Show username in browser status bar instead of user id number?
« Reply #4 on: June 11, 2005, 09:32:47 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

Offline d3v

  • Jr. Member
  • **
  • Posts: 209
Re: Show username in browser status bar instead of user id number?
« Reply #5 on: June 11, 2005, 09:43:29 PM »
Cough...yeah... thanks it worked

Offline † ÐëepÇuT¹ †

  • Jr. Member
  • **
  • Posts: 353
  • Gender: Male
  • YaBBSe
    • x3Generation
Re: Show username in browser status bar instead of user id number?
« Reply #6 on: June 21, 2005, 03:40:46 PM »
Horay!
Personal Website
x3Generation - gaming
graphics and anime.
 
Favorite Forums
> SimpleMachines Forum
> GamerzPlanet Forums


Offline markd

  • Semi-Newbie
  • *
  • Posts: 33
  • Gender: Male
Re: Show username in browser status bar instead of user id number?
« Reply #7 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..
Code: [Select]
// 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:

Code: [Select]
                 '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!!
« Last Edit: July 12, 2005, 12:41:34 PM by markd »

Offline rojamaia

  • Semi-Newbie
  • *
  • Posts: 83
Re: Show username in browser status bar instead of user id number?
« Reply #8 on: August 27, 2005, 06:47:50 AM »

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.

Code: [Select]
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
Quote
View the profile of
and no name.  In the topic view, there's no hoverlink at all.



« Last Edit: August 27, 2005, 10:33:59 AM by malinaobenny »

Offline hcfwesker

  • SMF Hero
  • ******
  • Posts: 2,213
  • Gender: Male
  • SMF 2.0.4
Re: Show username in browser status bar instead of user id number?
« Reply #9 on: August 05, 2010, 10:44:59 PM »
I know this is like 5 years old.   But can anyone update these for smf 1.1.11

How about this instead? Shows their member name on hover.
In  Sources/BoardIndex.php
FIND:
Code: [Select]
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:
Code: [Select]
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.


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

In Sources/Load.Php:

look for..
Code: [Select]
// 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:

Code: [Select]
                 '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. :)


Offline Masterd

  • SMF Hero
  • ******
  • Posts: 3,887
  • Gender: Male
  • Sapienti satis.
Re: Show username in browser status bar instead of user id number?
« Reply #10 on: August 09, 2010, 08:34:24 AM »
What about this?
My Mods

Sugested that too. Hey ho. I'd link you to the original discussion but it's not visible to most people (seekrit team board stuff that is more dangerous than wikileaks).


Don't PM me for support! Use the appropriate support board!

Offline hcfwesker

  • SMF Hero
  • ******
  • Posts: 2,213
  • Gender: Male
  • SMF 2.0.4
Re: Show username in browser status bar instead of user id number?
« Reply #11 on: August 10, 2010, 10:00:46 PM »
Amazing.  thanx, bro :)