While the "send privatemsg to user" link appears on user profile pages, it doesn't appear on any Node full-views. Would like to implement this feature, and enable the site admin to chose which content types the "send privatemsg to user" would appear on. Another nice option, IMHO, would be that when sending a privatemsg via this method (i.e., "send msg to user" link on a node page) you couldn't add any additional recipients as you're trying to send the PM. Reason being: you're trying to send a message just to that user.

Comments

spyderpie’s picture

Also, to add to this, if you are using Content Profile, it would be nice if you could add this link there as well.

berdir’s picture

Status: Active » Needs review
StatusFileSize
new4.38 KB

Ok, attached is a first patch which allows to add such a link to nodes. It allows to configure the following things:

- Configure which node types should display the link
- Configure if the link should be displayed for teasers too (global setting)
- Configure if such a link should also be displayed for the comments of the selected node types
- Configure if send private message link should be displayed on profiles (profile specific)
- Configure if send private message to xy should also be displayed for the current user ( globally controlled in privatemsg_get_link, works for every place where that function is used). This also provides a solution for #395632: Make "send this user a message" not appear on one's own profile.

Please test this. I think this should really contain enough configuration options, If someone needs something more complex, it should be written in an own module.

berdir’s picture

Version: » 6.x-1.x-dev
spacereactor’s picture

sorry new to drupal. how do i add the patch? when i click on the patch is another webpage.

mrgoltra’s picture

I use cygwin the easiest way for me under Windows

mrgoltra’s picture

mrgoltra’s picture

This patch will not work for RC2 just incase someone wants to know.

parrottvision’s picture

subscribe

sbydrupal’s picture

The patch in #2 did not work with the latest 6.x-1.x-dev version on June 11 2009.

Would it be possible to get an update on this issue. Thanks.

naheemsays’s picture

Status: Needs review » Needs work
StatusFileSize
new4.15 KB

Rerolled, but setting to cnw as I think the text strings need improving.

I have also modified the patch to take advantage of new features since the original where the message default subject is also automatically set -but once again, the text strings here are poor.

sbydrupal’s picture

Thanks Nbz.

In meanwhile, I tried to replicate the same functionality with Author Pane Module. It is pretty good.
The messaging link is already available for Nodes or Blocks.

With few tweaks, managed to insert the "Send Private Message Link" along with Online/Offline,... from Authors pane, into Node template.

I will check your patch. Thanks.

naheemsays’s picture

authorpane works well in most cases - its what is used on my site too (all comments themes like forums, no pm contact for normal nodes.)

sbydrupal’s picture

in fact, author pane works for nodes also, including anonymous users sending message.... everything is fine so far. I use D6.12 and last version of author pane, pretty useful.

sbydrupal’s picture

For information, as a solution with author pane, I inserted the below code (within php quotes)

$account = user_load(array('uid' => $node->uid));
print theme('author_pane', $account, NULL, 'author-pane');

to node.tpl.php, and everything flows with no problem afterall.

berdir’s picture

If using author pane works and is enough for most users, I'd say we can close this issue as won't fix. No need to implement a feature twice.

mrgoltra’s picture

Good Day,

I wish I could use author pane but I can't. I tried the patch @ #10 no failed hunks, config page shows up, selected content type but it is not showing up on the links. I am using RC3. Any other ideas?

Thank you,

Mark

volocuga’s picture

Need it too for RC3.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new5.5 KB

Just tested this again, nbz's patch works perfectly fine here.

I just changed the strings a bit (still not good, looking for improvements) added variable_del() calls and re-rolled to remove the offsets and fuzz.

Setting to needs review because that's what the patch needs :)

If you it does not work for someone, please provide a detailed description, if possible with screenshots (configuration and so on).

berdir’s picture

Version: 6.x-1.x-dev »
StatusFileSize
new5.28 KB

Re-rolled against 2.x-dev. Removed "display link to self" option since that one is covered in #520390: Option to configure the display of the send message to themself link.

Bilmar’s picture

subscribing

berdir’s picture

Version: » 7.x-1.x-dev
Status: Needs review » Patch (to be ported)

Commited to 6.x-2.x-dev, needs to be ported to 7.x.

berdir’s picture

Status: Patch (to be ported) » Fixed

Ported and commited to 7.x

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

druppeler’s picture

Version: 7.x-1.x-dev »
Status: Closed (fixed) » Active

I would really like to have this feature as described in this issue.

I see it has been implemented in 6.x-2.x-dev but that is not a recommended version.

Could you please tell me:

1) Is there a plan to make 6.x-2.x-dev a recommended version?
2) Is 6.x-2.x-dev as it is now (not a recommended version) safe to use in a production site?

Thanks ahead of time :-)

berdir’s picture

Status: Active » Closed (fixed)

1) Of course.
2) Depends on how you use it I guess. It is rather stable and we have a lot of tests to ensure that it works correcty but there will be chances to the UI and structure. Also, there are no security notices so you need to keep it up to date on yourself.

iparsin’s picture

@Berdir Just use the privatemsg as of today 7/24/2010, the lines was shifted but your patch still works like charm. Impossible to make it works without help from people like you, thank you!