Version 2.2.0 RC-1
This commit is contained in:
1 parent
f73f8bff6d
commit
22f1b963ee
1034 files changed
+178610
-70897
No files matched your search
@@ -2,26 +2,17 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board 2.1.7
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2005 Invision Power Services, Inc.
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Tuesday 18th of July 2006 05:56:00 PM
|
||||
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2005-10-10 14:08:54 +0100 (Mon, 10 Oct 2005) $
|
||||
| > $Revision: 23 $
|
||||
| > $Date: 2006-09-22 11:28:54 +0100 (Fri, 22 Sep 2006) $
|
||||
| > $Revision: 567 $
|
||||
| > $Author: matt $
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
@@ -35,7 +26,7 @@
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Íåâåðíûé âõîä</h1> Ó Âàñ íåò äîñòóïà ê äèðåêòèâå ýòîãî ôàéëà. Åñëè Âû ïðîâîäèëè îáíîâëåíèÿ, óáåäèòåñü, ÷òî íå çàáûëè îáíîâèòü 'admin.php'.";
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -54,7 +45,7 @@ class ad_xmlout
|
||||
|
||||
function xmlout()
|
||||
{
|
||||
$this->xml_header = '<?xml version="1.0" encoding="WINDOWS-1251"?'.'>';
|
||||
$this->xml_header = '<?xml version="1.0" encoding="ISO-8859-1"?'.'>';
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -67,7 +58,7 @@ class ad_xmlout
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->ipsclass->input['j_do'] )
|
||||
if ( isset($this->ipsclass->input['j_do']) AND $this->ipsclass->input['j_do'] )
|
||||
{
|
||||
$this->ipsclass->input['do'] = $this->ipsclass->input['j_do'];
|
||||
}
|
||||
@@ -84,9 +75,101 @@ class ad_xmlout
|
||||
case 'get-member-names':
|
||||
$this->get_member_names();
|
||||
break;
|
||||
case 'get-dir-size':
|
||||
$this->get_dir_size();
|
||||
break;
|
||||
case 'post-editorswitch':
|
||||
$this->post_editorswitch();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Switch editors
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function post_editorswitch()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Grab public class and do...
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( ROOT_PATH . 'sources/action_public/xmlout.php' );
|
||||
$lib = new xmlout();
|
||||
$lib->ipsclass =& $this->ipsclass;
|
||||
|
||||
require_once( ROOT_PATH . 'sources/classes/class_ajax.php' );
|
||||
$class_ajax = new class_ajax();
|
||||
$class_ajax->ipsclass =& $this->ipsclass;
|
||||
$lib->class_ajax =& $class_ajax;
|
||||
|
||||
return $lib->post_editorswitch();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Get uploads size
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function get_dir_size()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Make sure the uploads path is correct
|
||||
//-----------------------------------------
|
||||
|
||||
$uploads_size = 0;
|
||||
|
||||
if ($dh = @opendir( $this->ipsclass->vars['upload_dir'] ))
|
||||
{
|
||||
while ( $file = @readdir( $dh ) )
|
||||
{
|
||||
if ( ! preg_match( "/^..?$|^index/i", $file ) )
|
||||
{
|
||||
if( is_dir( $this->ipsclass->vars['upload_dir'] . "/" . $file ) )
|
||||
{
|
||||
if( $sub_dh = @opendir( $this->ipsclass->vars['upload_dir'] . "/" . $file ))
|
||||
{
|
||||
while ( $sub_file = @readdir( $sub_dh ) )
|
||||
{
|
||||
if ( ! preg_match( "/^..?$|^index/i", $sub_file ) )
|
||||
{
|
||||
$uploads_size += @filesize( $this->ipsclass->vars['upload_dir'] . "/" . $file . "/" . $sub_file );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$uploads_size += @filesize( $this->ipsclass->vars['upload_dir'] . "/" . $file );
|
||||
}
|
||||
}
|
||||
}
|
||||
@closedir( $dh );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// This piece of code from Jesse's (jesse@jess.on.ca) contribution
|
||||
// to the PHP manual @ php.net posted without license
|
||||
//-----------------------------------------
|
||||
|
||||
if ($uploads_size >= 1048576)
|
||||
{
|
||||
$uploads_size = round($uploads_size / 1048576 * 100 ) / 100 . " mb";
|
||||
}
|
||||
else if ($uploads_size >= 1024)
|
||||
{
|
||||
$uploads_size = round($uploads_size / 1024 * 100 ) / 100 . " k";
|
||||
}
|
||||
else
|
||||
{
|
||||
$uploads_size = $uploads_size . " bytes";
|
||||
}
|
||||
|
||||
$this->print_nocache_headers();
|
||||
@header( "Content-type: text/plain;charset={$this->ipsclass->vars['gb_char_set']}" );
|
||||
print $uploads_size;
|
||||
exit();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Get new posts
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -139,6 +222,8 @@ class ad_xmlout
|
||||
$ids[] = intval($r['id']);
|
||||
}
|
||||
|
||||
$this->print_nocache_headers();
|
||||
@header( "Content-type: text/plain;charset={$this->ipsclass->vars['gb_char_set']}" );
|
||||
print "returnSearch( '".str_replace( "'", "", $name )."', new Array(".implode( ",", $names )."), new Array(".implode( ",", $ids ).") );";
|
||||
exit();
|
||||
}
|
||||
@@ -192,6 +277,8 @@ class ad_xmlout
|
||||
$ids[] = intval($r['suid']);
|
||||
}
|
||||
|
||||
$this->print_nocache_headers();
|
||||
@header( "Content-type: text/plain;charset={$this->ipsclass->vars['gb_char_set']}" );
|
||||
print "returnSearch( '".str_replace( "'", "", $name )."', new Array(".implode( ",", $names )."), new Array(".implode( ",", $ids ).") );";
|
||||
exit();
|
||||
}
|
||||
@@ -205,6 +292,19 @@ class ad_xmlout
|
||||
{
|
||||
return str_replace( '&#39;', ''', htmlspecialchars( $t ) );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Print no cache headers
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function print_nocache_headers()
|
||||
{
|
||||
header("HTTP/1.0 200 OK");
|
||||
header("HTTP/1.1 200 OK");
|
||||
header("Cache-Control: no-cache, must-revalidate, max-age=0");
|
||||
header("Expires: 0");
|
||||
header("Pragma: no-cache");
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Error handler
|
||||
@@ -214,7 +314,7 @@ class ad_xmlout
|
||||
{
|
||||
@header( "Content-type: text/xml" );
|
||||
$this->xml_output = $this->xml_header."\r\n<errors>\r\n";
|
||||
$this->xml_output .= "<error><message>Âû äîëæíû áûòü àâòîðèçîâàíû, ÷òîáû ïîëó÷èòü äîñòóï</message></error>\r\n";
|
||||
$this->xml_output .= "<error><message>You must be logged in to access this feature</message></error>\r\n";
|
||||
$this->xml_output .= "</errors>";
|
||||
print $this->xml_output;
|
||||
exit();
|
||||
|
||||
Reference in new issue
Block a user