Version 3.2.3
This commit is contained in:
1 parent
ae5c01cc78
commit
78706903a2
2641 files changed
+228363
-201264
No files matched your search
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* IP.Board post attachments plugin
|
||||
* Last Updated: $Date: 2010-10-20 09:03:17 -0400 (Wed, 20 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-09-20 21:18:18 -0400 (Tue, 20 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 6/24/2008
|
||||
* @version $Revision: 7003 $
|
||||
* @version $Revision: 9520 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -36,7 +36,7 @@ class plugin_post extends class_attach
|
||||
* Constructor
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
@@ -113,7 +113,7 @@ class plugin_post extends class_attach
|
||||
// Check..
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! isset( $attach['pid'] ) OR empty( $attach['pid'] ) )
|
||||
if ( empty( $attach['pid'] ) )
|
||||
{
|
||||
if( $attach['attach_member_id'] != $this->memberData['member_id'] )
|
||||
{
|
||||
@@ -319,10 +319,7 @@ class plugin_post extends class_attach
|
||||
}
|
||||
|
||||
|
||||
$this->DB->build( array( "select" => 'COUNT(*) as cnt', 'from' => 'attachments', 'where' => "attach_post_key='{$post_key}'" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
$cnt = $this->DB->fetch();
|
||||
$cnt = $this->DB->buildAndFetch( array( "select" => 'COUNT(*) as cnt', 'from' => 'attachments', 'where' => "attach_post_key='{$post_key}'" ) );
|
||||
|
||||
if ( $cnt['cnt'] )
|
||||
{
|
||||
@@ -390,14 +387,11 @@ class plugin_post extends class_attach
|
||||
|
||||
if ( count( $pids ) )
|
||||
{
|
||||
$this->DB->build( array(
|
||||
'select' => 'count(*) as cnt',
|
||||
'from' => 'attachments',
|
||||
'where' => "attach_rel_module='post' AND attach_rel_id IN(" . implode( ',', $pids ) . ")") );
|
||||
$this->DB->execute();
|
||||
|
||||
$cnt = $this->DB->fetch();
|
||||
|
||||
$cnt = $this->DB->buildAndFetch( array(
|
||||
'select' => 'count(*) as cnt',
|
||||
'from' => 'attachments',
|
||||
'where' => "attach_rel_module='post' AND attach_rel_id IN(" . implode( ',', $pids ) . ")") );
|
||||
|
||||
$count = intval( $cnt['cnt'] );
|
||||
}
|
||||
|
||||
@@ -487,7 +481,7 @@ class plugin_post extends class_attach
|
||||
|
||||
if ( isset( $topic['forum_id'] ) )
|
||||
{
|
||||
if ( isset($_moderator[ $topic['forum_id'] ]['edit_post']) and $_moderator[ $topic['forum_id'] ]['edit_post'] )
|
||||
if ( !empty($_moderator[ $topic['forum_id'] ]['edit_post']) )
|
||||
{
|
||||
$ok_to_remove = TRUE;
|
||||
}
|
||||
@@ -574,7 +568,7 @@ class plugin_post extends class_attach
|
||||
'where' => "attach_post_key='{$post_key}'"
|
||||
) );
|
||||
|
||||
$space_used = intval( $_space_used['figure'] );
|
||||
$space_used = $_space_used['figure'] ? $_space_used['figure'] : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -588,7 +582,7 @@ class plugin_post extends class_attach
|
||||
'where' => "attach_member_id={$member_id} AND attach_rel_module IN( 'post', 'msg' )"
|
||||
) );
|
||||
|
||||
$space_used = intval( $_space_used['figure'] );
|
||||
$space_used = $_space_used['figure'] ? $_space_used['figure'] : 0;
|
||||
}
|
||||
|
||||
if ( $this->memberData['g_attach_max'] > 0 )
|
||||
@@ -601,9 +595,9 @@ class plugin_post extends class_attach
|
||||
'where' => "attach_member_id={$member_id} AND attach_rel_module IN( 'post', 'msg' )"
|
||||
) );
|
||||
|
||||
$g_space_used = intval( $_g_space_used['figure'] );
|
||||
$g_space_used = $_g_space_used['figure'] ? $_g_space_used['figure'] : 0;
|
||||
|
||||
if( intval( ( $this->memberData['g_attach_max'] * 1024 ) - $g_space_used ) < 0 )
|
||||
if( ( $this->memberData['g_attach_max'] * 1024 ) - $g_space_used < 0 )
|
||||
{
|
||||
$space_used = $g_space_used;
|
||||
$total_space_allowed = $this->memberData['g_attach_max'] * 1024;
|
||||
@@ -666,7 +660,7 @@ class plugin_post extends class_attach
|
||||
IPSDebug::fireBug( 'info', array( 'Max single file size: ' . $max_single_upload ) );
|
||||
|
||||
$return = array( 'space_used' => $space_used, 'space_left' => $space_left, 'space_allowed' => $space_allowed, 'max_single_upload' => $max_single_upload, 'total_space_allowed' => $total_space_allowed );
|
||||
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user