mirror of
https://github.com/e107inc/e107.git
synced 2025-08-21 13:52:35 +02:00
This commit is contained in:
@@ -504,7 +504,7 @@ if(count($del_qry) > 0)
|
||||
$delList = $sql->db_getList();
|
||||
foreach($delList as $p)
|
||||
{
|
||||
$pm->del($p['pm_id']);
|
||||
$pm->del($p['pm_id'], TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -274,32 +274,32 @@ class private_message
|
||||
* When physically deleted, any attachments are deleted as well
|
||||
*
|
||||
* @param integer $pmid - ID of the PM
|
||||
* @param boolean $force - set to TRUE to force deletion of unread PMs
|
||||
* @return boolean|string - FALSE if PM not found, or other DB error. String if successful
|
||||
*/
|
||||
function del($pmid)
|
||||
function del($pmid, $force = FALSE)
|
||||
{
|
||||
$pmid = (int)$pmid;
|
||||
$ret = '';
|
||||
$del_pm = FALSE;
|
||||
$newvals = '';
|
||||
if($this->e107->sql->db_Select('private_msg', '*', 'pm_id = '.$pmid.' AND (pm_from = '.USERID.' OR pm_to = '.USERID.')'))
|
||||
{
|
||||
$row = $this->e107->sql->db_Fetch();
|
||||
if($row['pm_to'] == USERID)
|
||||
if (!$force && ($row['pm_to'] == USERID))
|
||||
{
|
||||
$newvals = 'pm_read_del = 1';
|
||||
$ret .= LAN_PM_42.'<br />';
|
||||
if($row['pm_sent_del'] == 1) { $del_pm = TRUE; }
|
||||
if($row['pm_sent_del'] == 1) { $force = TRUE; }
|
||||
}
|
||||
if($row['pm_from'] == USERID)
|
||||
if (!$force && ($row['pm_from'] == USERID))
|
||||
{
|
||||
if($newvals != '') { $del_pm = TRUE; }
|
||||
if($newvals != '') { $force = TRUE; }
|
||||
$newvals = 'pm_sent_del = 1';
|
||||
$ret .= LAN_PM_43."<br />";
|
||||
if($row['pm_read_del'] == 1) { $del_pm = TRUE; }
|
||||
if($row['pm_read_del'] == 1) { $force = TRUE; }
|
||||
}
|
||||
|
||||
if($del_pm == TRUE)
|
||||
if($force == TRUE)
|
||||
{
|
||||
// Delete any attachments and remove PM from db
|
||||
$attachments = explode(chr(0), $row['pm_attachments']);
|
||||
|
@@ -107,11 +107,11 @@ class pm_handler_shortcodes
|
||||
$type = ($this->pmPrefs['dropdown'] == TRUE ? 'list' : 'popup');
|
||||
if(check_class($this->pmPrefs['multi_class']))
|
||||
{
|
||||
$ret = $us->select_form($type, 'textarea.pm_to');
|
||||
$ret = $us->select_form($type, 'textarea.pm_to', '', $this->pmPrefs['pm_class']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$ret = $us->select_form($type, 'pm_to');
|
||||
$ret = $us->select_form($type, 'pm_to', '', $this->pmPrefs['pm_class']);
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user