Page 1 of 2

Profile in Viewonline

Posted: 08 Jun 2010, 22:16
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',

Re: Profile in Viewonline

Posted: 09 Jun 2010, 02:17
by Daniel
Wow, that cool as, one question, would that be considered stalking?

Re: Profile in Viewonline

Posted: 09 Jun 2010, 13:53
by Oliver
This is good.

Someone could also make the code which shows that what the user reads the topic. ;)

Re: Profile in Viewonline

Posted: 09 Jun 2010, 14:04
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/

Re: Profile in Viewonline

Posted: 09 Jun 2010, 14:08
by cisco007
wow Olive---r you are never content with what they post for you are you!?

Re: Profile in Viewonline

Posted: 09 Jun 2010, 15:03
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 ;)

Re: Profile in Viewonline

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

Re: Profile in Viewonline

Posted: 09 Jun 2010, 15:31
by cisco007
it's simple all it shows you in the viewonline.php is who is watching who's profile!

Re: Profile in Viewonline

Posted: 09 Jun 2010, 15:42
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 ?????

Re: Profile in Viewonline

Posted: 19 Jun 2010, 19:15
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 ?