Sinisakrisan (Talk | contribs) (→Integrate private messaging) |
Sinisakrisan (Talk | contribs) (→Integrate private messaging) |
||
Line 11: | Line 11: | ||
$jspath = JPATH_ROOT.DS.'components'.DS.'com_community'; | $jspath = JPATH_ROOT.DS.'components'.DS.'com_community'; | ||
include_once($jspath.DS.'libraries'.DS.'core.php'); | include_once($jspath.DS.'libraries'.DS.'core.php'); | ||
− | |||
include_once($jspath.DS.'libraries'.DS.'messaging.php'); | include_once($jspath.DS.'libraries'.DS.'messaging.php'); | ||
− | |||
// Add a onclick action to any link to send a message | // 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 | // Here, we assume $usrid contain the id of the user we want to send message to | ||
− | |||
$onclick = CMessaging::getPopup($userid); | $onclick = CMessaging::getPopup($userid); | ||
− | |||
echo '<a onclick="'.$onclick.'" href="#">Send message</a>'; | echo '<a onclick="'.$onclick.'" href="#">Send message</a>'; | ||
</pre> | </pre> |
Revision as of 15:05, 17 January 2013
3rd party component can easily integrate JomSocial features into their component. Among other things, 3rd party other component can
Support JomSocial build-in personal messaging system Use JomSocial user object, CUser Use JomSocial avatar Link to user personal profile page Include user action to JomSocial activity stream, and reward user with points Extends JomSocial via new plugin
Integrate private messaging
$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 onclick="'.$onclick.'" href="#">Send message</a>';