logo

Member
Member
Offline Offline
Posts: 46
Mod Release: Add PM link next to email in view profile.

This is a fairly small change, which makes social networking a tad bit easier. Especially since it makes it a single click while viewing a person's profile to start a pm to them.

First, we'll need the image file. Either you can use mine (I xxencoded it for these forums, since I haven't written something for you guys to add for inline uploading yet) or you can make your own icon. The standard size thus far is 16x14 or 16x16 with a few lines of transparency above and below (which is how the email icon works).

Since I don't see an easy way to share a file, and the image I created is tiny, here it is, xxencoded. If you go to http://www.webutils.pl/index.php?idx=xx you can copy and paste the contents of the code block below to get the image file. (Just decode, then save to file)

Code:

begin 644 pm.gif
hFoZ4C1ZV2++E+86++3VMKCvivbRrRyjfuwvCnjzzzk+++++++05t-+2+++I+
h9++++++E+-++++AfK9fQzX+iE8ixZ6HBClT0+48K45fc-ddYNEsdicthiAPS
AL4QrzioMWJ0M+++v
end


Put the resulting pm.gif into:
Code:
themes/default/images


Now, lets make the image get used somewhere!

Open
Code:
Layout/Profile.php


Find
Code:

      <div class="contact-info">'.($fetch['show_email'] == '1' ? call('hide_email', $fetch['email'], '', '', true) : '').


After, Add:
Code:

      '<a href="' . $settings['site_url']. '/index.php?act=sendpm&userid=' . (isset($_GET['id']) ? $_GET['id'] : $user['id']) . '">
      <img src="' . $settings['site_url']. '/themes/' . $settings['site_theme'] . '/images/pm.gif" title="'.$PROFILE_LANG["pm"].'" /></a>'.


Now, lets do the languages right...
Open
Code:
language/en/Profile.php


Find
Code:

$PROFILE_LANG["email"]               = 'Email';


After, Add
Code:

$PROFILE_LANG["pm"]               = 'Private Message';


And done.

When viewing someone's profile, its now a single click to start a private message to them. It uses a built in function of SendPm to look up the user name, and put it in the To field.

eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 1528
Re: Mod Release: Add PM link next to email in view profile.

Not sure if you know this but the online/offline image is a link to send a pm to the user....

Please do not PM me requesting support or anything, use the forums, thats what they are here for
eoCMS Designer
eoCMS Designer
Offline Offline
avatar
Posts: 1290
tbarkass_willamson@hotmail.com
Re: Mod Release: Add PM link next to email in view profile.

Well that's a fair point but hardly obvious without taking a good look around. Worth including as standard?

Seen a bug? Report it!
Member
Member
Offline Offline
Posts: 46
Re: Mod Release: Add PM link next to email in view profile.

Yeah, I didn't notice that, and present functionality (clicking online status) isn't 'standard' functionality by any means, and it's not something most users will know or even guess at, without being told.

Jump to:


0.08 seconds Queries: 13