Version 3.3.4
This commit is contained in:
1 parent
78706903a2
commit
fb6b5baabc
2206 files changed
+409828
-382984
No files matched your search
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* IP.Board v3.3.4
|
||||
* IP.Board messenger attachments plugin
|
||||
* Last Updated: $Date: 2011-09-20 21:18:18 -0400 (Tue, 20 Sep 2011) $
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://hatynka.in
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 6/24/2008
|
||||
* @version $Revision: 9520 $
|
||||
* @version $Revision: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -139,67 +139,62 @@ class plugin_msg extends class_attach
|
||||
|
||||
if ( is_array( $rel_ids ) and count( $rel_ids ) )
|
||||
{
|
||||
$rel_ids = array_map( 'intval', $rel_ids );
|
||||
// We need to reset the array - this query bit will return everything we need, but
|
||||
// if we "OR" join the above query bit with this one, it causes bigger mysql loads
|
||||
$query_bits = array();
|
||||
$query_bits[] = "attach_rel_id IN (" . implode( ",", $rel_ids ) . ")";
|
||||
//$query = " OR attach_rel_id IN (-1," . implode( ",", $rel_ids ) . ")";
|
||||
|
||||
$match = 1;
|
||||
}
|
||||
|
||||
if ( $attach_post_key )
|
||||
{
|
||||
$query_bits[] = "attach_post_key='".$this->DB->addSlashes( $attach_post_key )."'";
|
||||
//$query .= " OR attach_post_key='".$this->DB->addSlashes( $attach_post_key )."'";
|
||||
|
||||
$match = 2;
|
||||
}
|
||||
|
||||
if( !count($query_bits) )
|
||||
{
|
||||
$query = "attach_id IN (-1)";
|
||||
}
|
||||
else
|
||||
{
|
||||
$query = implode( " OR ", $query_bits );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Grab 'em
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'attachments', 'where' => "attach_rel_module='{$this->module}' AND ( {$query} )" ) );
|
||||
$attach_sql = $this->DB->execute();
|
||||
|
||||
//-----------------------------------------
|
||||
// Loop through and filter off naughty ids
|
||||
//-----------------------------------------
|
||||
|
||||
while( $db_row = $this->DB->fetch( $attach_sql ) )
|
||||
if( count($query_bits) )
|
||||
{
|
||||
$_ok = 1;
|
||||
|
||||
if ( $match == 1 )
|
||||
{
|
||||
if ( ! in_array( $db_row['attach_rel_id'], $rel_ids ) )
|
||||
{
|
||||
$_ok = 0;
|
||||
}
|
||||
}
|
||||
else if ( $match == 2 )
|
||||
{
|
||||
if ( $db_row['attach_post_key'] != $attach_post_key )
|
||||
{
|
||||
$_ok = 0;
|
||||
}
|
||||
}
|
||||
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'attachments', 'where' => "attach_rel_module='{$this->module}' AND ( " . implode( ' OR ', $query_bits ) . " )" ) );
|
||||
$attach_sql = $this->DB->execute();
|
||||
|
||||
//-----------------------------------------
|
||||
// Ok?
|
||||
// Loop through and filter off naughty ids
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $_ok )
|
||||
while( $db_row = $this->DB->fetch( $attach_sql ) )
|
||||
{
|
||||
$rows[ $db_row['attach_id'] ] = $db_row;
|
||||
$_ok = 1;
|
||||
|
||||
if ( $match == 1 )
|
||||
{
|
||||
if ( ! in_array( $db_row['attach_rel_id'], $rel_ids ) )
|
||||
{
|
||||
$_ok = 0;
|
||||
}
|
||||
}
|
||||
else if ( $match == 2 )
|
||||
{
|
||||
if ( $db_row['attach_post_key'] != $attach_post_key )
|
||||
{
|
||||
$_ok = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Ok?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $_ok )
|
||||
{
|
||||
$rows[ $db_row['attach_id'] ] = $db_row;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user