Version 2.2.2
This commit is contained in:
1 parent
22f1b963ee
commit
a3bb603c96
858 files changed
+479463
-188140
No files matched your search
@@ -26,8 +26,8 @@
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class plugin_msg
|
||||
@@ -68,7 +68,7 @@ class plugin_msg
|
||||
|
||||
$this->ipsclass->DB->build_query( array( 'select' => 'a.*',
|
||||
'from' => array( 'attachments' => 'a' ),
|
||||
'where' => "a.attach_rel_module='".$this->module."' AND a.attach_id=".$attach_id,
|
||||
'where' => "a.attach_rel_module='".$this->module."' AND a.attach_id=".$attach_id." AND t.mt_owner_id=".$this->ipsclass->member['id'],
|
||||
'add_join' => array( 0 => array( 'select' => 'p.*',
|
||||
'from' => array( 'message_text' => 'p' ),
|
||||
'where' => "p.msg_id=a.attach_rel_id",
|
||||
@@ -134,19 +134,33 @@ class plugin_msg
|
||||
|
||||
$rows = array();
|
||||
$query = '';
|
||||
$query_bits = array();
|
||||
$match = 0;
|
||||
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! is_array( $attach_ids ) OR ! count( $attach_ids ) )
|
||||
if ( is_array( $attach_ids ) AND count( $attach_ids ) )
|
||||
{
|
||||
$attach_ids = array( -2 );
|
||||
//$attach_ids = array( -2 );
|
||||
$query_bits[] = "attach_id IN (" . implode( ",", $attach_ids ) .")";
|
||||
}
|
||||
|
||||
if ( is_array( $rel_ids ) and count( $rel_ids ) )
|
||||
{
|
||||
$query = " OR attach_rel_id IN (-1," . implode( ",", $rel_ids ) . ")";
|
||||
$query_bits[] = "attach_rel_id IN (" . implode( ",", $rel_ids ) . ")";
|
||||
//$query = " OR attach_rel_id IN (-1," . implode( ",", $rel_ids ) . ")";
|
||||
$match = 1;
|
||||
}
|
||||
|
||||
if( !count($query_bits) )
|
||||
{
|
||||
$query = "attach_id IN (-1)";
|
||||
}
|
||||
else
|
||||
{
|
||||
$query = implode( " OR ", $query_bits );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -155,7 +169,7 @@ class plugin_msg
|
||||
|
||||
$this->ipsclass->DB->build_query( array( 'select' => '*',
|
||||
'from' => 'attachments',
|
||||
'where' => "attach_rel_module='".$this->module."' AND ( attach_id IN(-1,". implode( ",", $attach_ids ) . ") " . $query . " )",
|
||||
'where' => "attach_rel_module='".$this->module."' AND ( " . $query . " )",
|
||||
) );
|
||||
|
||||
$attach_sql = $this->ipsclass->DB->exec_query();
|
||||
|
||||
Reference in new issue
Block a user