Profile in Viewonline

Guides & Snippets for phpBB3. Try the Snippets here and share Your own Snippets
There is no support here! Only Read Access!
User avatar
Post Bot
BBCoder II
BBCoder II
Posts: 44
Joined: 04 Mar 2010, 20:53

Profile in Viewonline

Post by Post Bot »

Profile in Viewonline
Written by neptune

When a users is viewing a profile you can see the name of the users profile.

Open viewonline.php
Find:

Code: Select all

case 'memberlist':
                $location = (strpos($row['session_page'], 'mode=viewprofile') !== false) ? $user->lang['VIEWING_MEMBER_PROFILE'] : $user->lang['VIEWING_MEMBERS'];
                $location_url = append_sid("{$phpbb_root_path}memberlist.$phpEx");
            break; 
Replace with:

Code: Select all

case 'memberlist':

         preg_match('#u=([0-9]+)#', $row['session_page'], $user_id);
         $user_id = (sizeof($user_id)) ? (int) $user_id[1] : 0;

         $sql = 'SELECT user_type, username, user_colour
            FROM ' . USERS_TABLE . '
            WHERE user_id = ' . $user_id;
         $results = $db->sql_query($sql);
         $rows = $db->sql_fetchrow($results);

         $username = ($rows['user_type'] != USER_IGNORE) ? get_username_string('no_profile', $user_id, $rows['username'], $rows['user_colour']) : '<span' . $user_colour . '>' . $rows['username'] . '</span>';

         $location = (strpos($row['session_page'], 'mode=viewprofile') !== false) ? sprintf($user->lang['VIEWING_MEMBER_PROFILE'], $username) : $user->lang['VIEWING_MEMBERS'];
         $location_url = ($rows['user_type'] != USER_IGNORE) ? get_username_string('profile', $user_id, '') : '';

         $db->sql_freeresult($results);
      break; 
Open language/en/common.php
Find:

Code: Select all

'VIEWING_MEMBER_PROFILE'   => 'Viewing member profile',
Replace with:

Code: Select all

'VIEWING_MEMBER_PROFILE'   => 'Viewing %s’s profile',
Daniel
BBCoder II
BBCoder II
Posts: 29
Joined: 23 May 2010, 06:53

Re: Profile in Viewonline

Post by Daniel »

Wow, that cool as, one question, would that be considered stalking?
User avatar
Oliver
BBCoder III
BBCoder III
Posts: 120
Joined: 07 Mar 2010, 11:55

Re: Profile in Viewonline

Post by Oliver »

This is good.

Someone could also make the code which shows that what the user reads the topic. ;)
User avatar
Ashley.S.
BBCoder II
BBCoder II
Posts: 36
Joined: 05 Mar 2010, 12:24
Location: Falmouth, Cornwall, UK
Contact:

Re: Profile in Viewonline

Post by Ashley.S. »

Oliver » 09 Jun 2010, 13:53 wrote:This is good.

Someone could also make the code which shows that what the user reads the topic. ;)
this is probably what you are looking for: http://www.phpbb.com/customise/db/mod/t ... is_online/
Regards,
-Ashley.S. [ Pluto Hosting Managing Director & ProphpBB Moderator ]
cisco007
BBCoder VI
BBCoder VI
Posts: 1015
Joined: 16 Mar 2010, 18:14
Location: Don't really know!

Re: Profile in Viewonline

Post by cisco007 »

wow Olive---r you are never content with what they post for you are you!?
User avatar
Inner Circle
BBCoder III
BBCoder III
Posts: 107
Joined: 20 Mar 2010, 20:25
Location: Germany
Contact:

Re: Profile in Viewonline

Post by Inner Circle »

Daniel » 09 Jun 2010, 02:17 wrote:Wow, that cool as, one question, would that be considered stalking?
I think there was a reason behind that you can´t see which profile someone looks into by the phpbb Staff.
One could argue it as Stalking but almost everyone can see the "Who is Online" Page on a forum.

In the end you are the one who has to decide if you want to use this snippet or not ;)
Last edited by Inner Circle on 09 Jun 2010, 15:04, edited 1 time in total.
User avatar
Fire-Fox
BBCoder IV
BBCoder IV
Posts: 275
Joined: 22 Mar 2010, 13:24
Location: Denmark

Re: Profile in Viewonline

Post by Fire-Fox »

Is there a screenshot of what is does :D
cisco007
BBCoder VI
BBCoder VI
Posts: 1015
Joined: 16 Mar 2010, 18:14
Location: Don't really know!

Re: Profile in Viewonline

Post by cisco007 »

it's simple all it shows you in the viewonline.php is who is watching who's profile!
User avatar
Oliver
BBCoder III
BBCoder III
Posts: 120
Joined: 07 Mar 2010, 11:55

Re: Profile in Viewonline

Post by Oliver »

Fire-Fox » 09 Jun 2010, 15:27 wrote:Is there a screenshot of what is does :D

Push that link: viewonline.php

If someone has read your profile as it is reflected in the profile of anyone.

Does not change. MAYBE IS THAT KIND OF LIKE SNIPPETS ?????
Last edited by Oliver on 09 Jun 2010, 16:04, edited 2 times in total.
Denny
BBCoder II
BBCoder II
Posts: 29
Joined: 10 Mar 2010, 17:48

Re: Profile in Viewonline

Post by Denny »

Ok, close to what I wanted. Why not add a on mouseover user's ID name, and show location in a balloon, or box, where they are looking, instead of showing everyone as in stats ?
Locked