Jomsocial message link

tippex 12 Aug, 2010
Hi, I need to post a send message link to jomsocial using the code below.
I am using content form. It creates a article and i need to create a link to send message to author of article.
$jspath = JPATH_ROOT.DS.'components'.DS.'com_community';
include_once($jspath.DS.'libraries'.DS.'core.php');
include_once($jspath.DS.'libraries'.DS.'messaging.php');
 
// Add a onclick action to any link to send a message
// Here, we assume $usrid contain the id of the user we want to send message to
 
$onclick = CMessaging::getPopup($userid);
echo '<a href="javascript:void(0)" onclick="'. $onclick .'">Send message</a>';

Thanks
GreyHead 14 Aug, 2010
Hi tippex,

You can probably add that directly into the Form HTML
<?php
if ( !$mainframe->isSite() ) { return; }
$jspath = JPATH_ROOT.DS.'components'.DS.'com_community';
include_once($jspath.DS.'libraries'.DS.'core.php');
include_once($jspath.DS.'libraries'.DS.'messaging.php');

// Add a onclick action to any link to send a message
// Here, we assume $usrid contain the id of the user we want to send message to

$onclick = CMessaging::getPopup($userid);
echo '<a href="javascript:void(0)" onclick="'. $onclick .'">Send message</a>';
?>

Bob
This topic is locked and no more replies can be posted.