diff --git a/e107_plugins/forum/shortcodes/batch/view_shortcodes.php b/e107_plugins/forum/shortcodes/batch/view_shortcodes.php
index 3e83819eb..4eb890397 100644
--- a/e107_plugins/forum/shortcodes/batch/view_shortcodes.php
+++ b/e107_plugins/forum/shortcodes/batch/view_shortcodes.php
@@ -503,11 +503,17 @@ class plugin_forum_view_shortcodes extends e_shortcode
}
$text .= "
".$this->sc_posts()."";
- $text .= "";
+
if(e107::isInstalled('pm') && ($this->postInfo['post_user'] > 0))
{
- $text .= "".$tp->toGlyph('envelope')." ".LAN_FORUM_2036." ";
+ if($pmButton = $tp->parseTemplate("{SENDPM: user=".$this->postInfo['post_user']."&glyph=envelope&class=pm-send}",true))
+ {
+ $text .= "";
+ $text .= "".$pmButton."";
+ }
+
+ // $text .= "".$tp->toGlyph('envelope')." ".LAN_FORUM_2036." ";
}
if($website = $this->sc_website())
diff --git a/e107_plugins/pm/e_shortcode.php b/e107_plugins/pm/e_shortcode.php
index 62ee34983..a98daaadf 100644
--- a/e107_plugins/pm/e_shortcode.php
+++ b/e107_plugins/pm/e_shortcode.php
@@ -76,29 +76,42 @@ class pm_shortcodes extends e_shortcode
/**
- * @param int $parm - User ID.
+ * @param array|string $parm - User ID or array of values (see below)
+ * @param int $parm['user']
+ * @param string $parm['glyph']
+ * @param string $parm['class']
+ *
* @return null|string
*/
- function sc_sendpm($parm='')
+ function sc_sendpm($parm=null)
{
// global $sysprefs, $pm_prefs;
// $pm_prefs = $sysprefs->getArray("pm_prefs");
+
+ if(is_string($parm))
+ {
+ $parm = array('user'=>$parm);
+ }
+
$pm_prefs = e107::getPlugPref('pm');
- $url = e107::url('pm','index').'?send.'.$parm;
+ $url = e107::url('pm','index').'?send.'.$parm['user'];
require_once(e_PLUGIN."pm/pm_class.php");
$pm = new private_message;
+ $glyph = empty($parm['glyph']) ? 'fa-paper-plane' : $parm['glyph'];
+ $class = empty($parm['class']) ? 'btn btn-sm btn-default' : $parm['class'];
- if(check_class($pm_prefs['pm_class']) && $pm->canSendTo($parm)) // check $this->pmPrefs['send_to_class'].
+
+ if(check_class($pm_prefs['pm_class']) && $pm->canSendTo($parm['user'])) // check $this->pmPrefs['send_to_class'].
{
if(deftrue('FONTAWESOME') && deftrue('BOOTSTRAP'))
{
- $img = e107::getParser()->toGlyph('fa-paper-plane','');
- return "{$img} ".LAN_PM_35."";
+ $img = e107::getParser()->toGlyph($glyph,'');
+ return "{$img} ".LAN_PM_35."";
}