mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 03:40:37 +02:00
Private Messenger: Fix for post coming from profile page.
This commit is contained in:
@@ -141,18 +141,25 @@ class pm_extended extends private_message
|
|||||||
{
|
{
|
||||||
$pm_info = array();
|
$pm_info = array();
|
||||||
$pm_outbox = $this->pmManager->pm_getInfo('outbox');
|
$pm_outbox = $this->pmManager->pm_getInfo('outbox');
|
||||||
|
|
||||||
if (is_array($to_uid))
|
if (is_array($to_uid))
|
||||||
{
|
{
|
||||||
$pm_info = $to_uid; // We've been passed a 'reply to' PM
|
$pm_info = $to_uid; // We've been passed a 'reply to' PM
|
||||||
$to_uid = $pm_info['pm_from'];
|
$to_uid = $pm_info['pm_from'];
|
||||||
}
|
}
|
||||||
if($to_uid)
|
|
||||||
|
if(!empty($to_uid))
|
||||||
{
|
{
|
||||||
$sql2 = new db;
|
$sql2 = e107::getDb('sql2');
|
||||||
if($sql2->select('user', 'user_name', 'user_id = '.intval($to_uid)))
|
if($sql2->select('user', 'user_name', 'user_id = '.intval($to_uid))) //TODO add a check for userclass.
|
||||||
{
|
{
|
||||||
$row = $sql2->fetch();
|
$row = $sql2->fetch();
|
||||||
$pm_info['from_name'] = $row['user_name'];
|
$pm_info['from_name'] = $row['user_name'];
|
||||||
|
$pm_info['pm_from'] = intval($to_uid);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "<div class='alert alert-danger'>User Not Found</div>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//echo "Show_send: {$to_uid} from {$pm_info['from_name']} is happening<br />";
|
//echo "Show_send: {$to_uid} from {$pm_info['from_name']} is happening<br />";
|
||||||
|
@@ -158,7 +158,7 @@ if(!class_exists('plugin_pm_pm_shortcodes'))
|
|||||||
// TODO Get rid of e107_handlers/user_select_class.php
|
// TODO Get rid of e107_handlers/user_select_class.php
|
||||||
public function sc_pm_form_touser()
|
public function sc_pm_form_touser()
|
||||||
{
|
{
|
||||||
if(vartrue($this->var['from_name']))
|
if(vartrue($this->var['pm_from']))
|
||||||
{
|
{
|
||||||
return "<input type='hidden' name='pm_to' value='{$this->var['pm_from']}' />{$this->var['from_name']}";
|
return "<input type='hidden' name='pm_to' value='{$this->var['pm_from']}' />{$this->var['from_name']}";
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user