Version 2.2.2

This commit is contained in:
Neo committed 2025-12-19 00:24:35 -08:00
1 parent 22f1b963ee
commit a3bb603c96
858 files changed
+479463 -188140

No files matched your search

+39 -13
View File
@@ -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_post
@@ -62,6 +62,11 @@ class plugin_post
$_ok = 0;
if( !$attach_id )
{
return FALSE;
}
//-----------------------------------------
// Grab 'em
//-----------------------------------------
@@ -89,8 +94,11 @@ class plugin_post
if ( ! isset( $attach['pid'] ) OR empty( $attach['pid'] ) )
{
if( $attach['attach_member_id'] != $this->ipsclass->member['id'] )
{
return FALSE;
}
}
//-----------------------------------------
// Queued post?
@@ -180,6 +188,7 @@ class plugin_post
//-----------------------------------------
$rows = array();
$query_bits = array();
$query = '';
$match = 0;
@@ -187,30 +196,41 @@ class plugin_post
// Check
//-----------------------------------------
if ( ! is_array( $attach_ids ) OR ! count( $attach_ids ) )
if ( is_array( $attach_ids ) AND count( $attach_ids ) )
{
$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 ( $attach_post_key )
{
$query .= " OR attach_post_key='".$this->ipsclass->DB->add_slashes( $attach_post_key )."'";
$query_bits[] = "attach_post_key='".$this->ipsclass->DB->add_slashes( $attach_post_key )."'";
//$query .= " OR attach_post_key='".$this->ipsclass->DB->add_slashes( $attach_post_key )."'";
$match = 2;
}
if( !count($query_bits) )
{
$query = "attach_id IN (-1)";
}
else
{
$query = implode( " OR ", $query_bits );
}
//-----------------------------------------
// Grab 'em
//-----------------------------------------
$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();
@@ -448,7 +468,7 @@ class plugin_post
{
$this->ipsclass->DB->build_query( array( 'select' => 'p.pid',
'from' => array( 'posts' => 'p' ),
'where' => 'p.pid='. intval( $attach['attach_rel_id'] ),
'where' => 'p.pid='. intval( $attachment['attach_rel_id'] ),
'add_join' => array( 0 => array( 'select' => 't.forum_id, t.tid',
'from' => array( 'topics' => 't' ),
'where' => 't.tid=p.topic_id',
@@ -542,8 +562,6 @@ class plugin_post
// Generate space allowed figure
//-----------------------------------------
if ( $this->ipsclass->member['g_attach_max'] > 0 )
{
if ( $this->ipsclass->member['g_attach_per_post'] )
{
//-----------------------------------------
@@ -555,8 +573,6 @@ class plugin_post
'where' => "attach_post_key='".$post_key."'" ) );
$space_used = intval( $_space_used['figure'] );
$space_allowed = intval( ( $this->ipsclass->member['g_attach_per_post'] * 1024 ) - $space_used );
$space_allowed = $space_allowed < 0 ? 0 : $space_allowed;
}
else
{
@@ -569,9 +585,19 @@ class plugin_post
'where' => 'attach_member_id='.$member_id ) );
$space_used = intval( $_space_used['figure'] );
}
if ( $this->ipsclass->member['g_attach_max'] > 0 )
{
if ( $this->ipsclass->member['g_attach_per_post'] )
{
$space_allowed = intval( ( $this->ipsclass->member['g_attach_per_post'] * 1024 ) - $space_used );
$space_allowed = $space_allowed < 0 ? 0 : $space_allowed;
}
else
{
$space_allowed = intval( ( $this->ipsclass->member['g_attach_max'] * 1024 ) - $space_used );
$space_allowed = $space_allowed < 0 ? 0 : $space_allowed;
}
}
else