mirror of
https://github.com/e107inc/e107.git
synced 2025-07-29 10:50:25 +02:00
Forum view now uses PM shortcode rather than direct link.
This commit is contained in:
@@ -503,11 +503,17 @@ class plugin_forum_view_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
$text .= "<li><a href='#'>".$this->sc_posts()."</a></li>";
|
$text .= "<li><a href='#'>".$this->sc_posts()."</a></li>";
|
||||||
|
|
||||||
$text .= "<li class='divider'></li>";
|
|
||||||
|
|
||||||
if(e107::isInstalled('pm') && ($this->postInfo['post_user'] > 0))
|
if(e107::isInstalled('pm') && ($this->postInfo['post_user'] > 0))
|
||||||
{
|
{
|
||||||
$text .= "<li><a href='".e_PLUGIN_ABS."pm/pm.php?send.{$this->postInfo['post_user']}'>".$tp->toGlyph('envelope')." ".LAN_FORUM_2036." </a></li>";
|
if($pmButton = $tp->parseTemplate("{SENDPM: user=".$this->postInfo['post_user']."&glyph=envelope&class=pm-send}",true))
|
||||||
|
{
|
||||||
|
$text .= "<li class='divider'></li>";
|
||||||
|
$text .= "<li>".$pmButton."</li>";
|
||||||
|
}
|
||||||
|
|
||||||
|
// $text .= "<li><a href='".e_PLUGIN_ABS."pm/pm.php?send.{$this->postInfo['post_user']}'>".$tp->toGlyph('envelope')." ".LAN_FORUM_2036." </a></li>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if($website = $this->sc_website())
|
if($website = $this->sc_website())
|
||||||
|
@@ -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
|
* @return null|string
|
||||||
*/
|
*/
|
||||||
function sc_sendpm($parm='')
|
function sc_sendpm($parm=null)
|
||||||
{
|
{
|
||||||
|
|
||||||
// global $sysprefs, $pm_prefs;
|
// global $sysprefs, $pm_prefs;
|
||||||
// $pm_prefs = $sysprefs->getArray("pm_prefs");
|
// $pm_prefs = $sysprefs->getArray("pm_prefs");
|
||||||
|
|
||||||
|
if(is_string($parm))
|
||||||
|
{
|
||||||
|
$parm = array('user'=>$parm);
|
||||||
|
}
|
||||||
|
|
||||||
$pm_prefs = e107::getPlugPref('pm');
|
$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");
|
require_once(e_PLUGIN."pm/pm_class.php");
|
||||||
|
|
||||||
$pm = new private_message;
|
$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'))
|
if(deftrue('FONTAWESOME') && deftrue('BOOTSTRAP'))
|
||||||
{
|
{
|
||||||
$img = e107::getParser()->toGlyph('fa-paper-plane','');
|
$img = e107::getParser()->toGlyph($glyph,'');
|
||||||
return "<a class='btn btn-sm btn-default' href='".$url ."'>{$img} ".LAN_PM_35."</a>";
|
return "<a class='".$class."' href='".$url ."'>{$img} ".LAN_PM_35."</a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user