Version 2.2.0 RC-1

This commit is contained in:
Neo committed 2025-12-19 00:22:37 -08:00
1 parent f73f8bff6d
commit 22f1b963ee
1034 files changed
+178610 -70897

No files matched your search

+165 -74
View File
@@ -2,27 +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
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2005-10-14 18:52:45 +0100 (Fri, 14 Oct 2005) $
| > $Revision: 50 $
| > $Date: 2006-10-13 10:24:39 +0100 (Fri, 13 Oct 2006) $
| > $Revision: 635 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
@@ -34,13 +24,19 @@
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_ACP' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}
class admin_cache_functions
{
var $master_set = 1;
var $messages = array();
var $no_rebuild = 0;
var $template = "";
var $master_set = 1;
var $messages = array();
var $no_rebuild = 0;
var $template = "";
//-----------------------------------------
// Constructor
@@ -52,11 +48,12 @@ class admin_cache_functions
// Get the libraries
//-----------------------------------------
require_once( KERNEL_PATH.'class_template.php' );
require_once( KERNEL_PATH.'class_template_engine.php' );
$this->template = new class_template();
$this->template->root_path = CACHE_PATH;
$this->template->root_path = CACHE_PATH;
$this->template->allow_php_code = intval( IPB_ACP_ALLOW_TEMPLATE_PHP );
}
//============================================================================================================
@@ -113,14 +110,25 @@ class admin_cache_functions
$theids = array();
foreach( $ids as $i => $d )
foreach( $ids as $d )
{
$theids[] = $d['set_skin_set_id'];
}
$this->ipsclass->DB->do_update( 'skin_sets', array( 'set_cache_wrapper' => $wrapper ), 'set_skin_set_id IN ('.implode(',',$theids).') AND set_skin_set_id != 1' );
$this->messages[] = "Îáíîâëåíèå îôîðìëåíèÿ âûïîëíåíî... (id: ".implode(',',$theids).")";
if( is_object($this->ipsclass->cachelib) AND !$this->no_rebuild )
{
$this->ipsclass->DB->build_query( array( 'select' => '*', 'from' => 'skin_sets', 'where' => 'set_skin_set_id IN ('.implode(',',$theids).') AND set_skin_set_id != 1' ) );
$this->ipsclass->DB->exec_query();
while( $r = $this->ipsclass->DB->fetch_row() )
{
$this->ipsclass->cachelib->do_put( 'Skin_Store_' . $r['set_skin_set_id'], $r );
}
}
$this->messages[] = "Done wrapper rebuild... (id: ".implode(',',$theids).")";
}
//============================================================================================================
@@ -131,32 +139,56 @@ class admin_cache_functions
// TEMPLATE: Recache and splash
//-----------------------------------------
function _recache_templates( $id, $parent="", $group_only="", $root=1 )
function _recache_templates( $id, $parent="", $group_only="", $root=1, $master_only=0 )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$ids = array( 0 => array( 'id' => $id, 'parent' => $parent ) );
//-----------------------------------------
// Get any children
// Make sure master templates are written
//-----------------------------------------
if ( $id == 1 and IN_DEV )
if ( $id == 1 )
{
$id = -1;
$master_only = 1;
}
$this->ipsclass->DB->simple_construct( array( 'select' => 'set_skin_set_id, set_skin_set_parent', 'from' => 'skin_sets', 'where' => "set_skin_set_parent=$id" ) );
$this->ipsclass->DB->simple_exec();
//-----------------------------------------
// Just doing root?
//-----------------------------------------
while ( $r = $this->ipsclass->DB->fetch_row() )
if ( $master_only )
{
$ids[] = array( 'id' => $r['set_skin_set_id'], 'parent' => $r['set_skin_set_parent'] );
$ids = array( 0 => array( 'id' => 1, 'parent' => -1 ) );
}
if ( $id == -1 and IN_DEV )
else
{
$id = 1;
}
//-----------------------------------------
// Get any children
//-----------------------------------------
if ( $id == 1 and IN_DEV )
{
$id = -1;
}
$this->ipsclass->DB->simple_construct( array( 'select' => 'set_skin_set_id, set_skin_set_parent', 'from' => 'skin_sets', 'where' => "set_skin_set_parent=$id" ) );
$this->ipsclass->DB->simple_exec();
while ( $r = $this->ipsclass->DB->fetch_row() )
{
$ids[] = array( 'id' => $r['set_skin_set_id'], 'parent' => $r['set_skin_set_parent'] );
}
if ( $id == -1 and IN_DEV )
{
$id = 1;
}
}
//-----------------------------------------
// SPIN TO WIN!
//-----------------------------------------
@@ -191,13 +223,12 @@ class admin_cache_functions
$out = "class {$group['group_name']}_{$id} {\n\n";
$out .= ' var $ipsclass;'."\n";
//$out .= 'function '. $group['group_name'] .'( $ipsclass )'."\n{\n".'$this->ipsclass = &$ipsclass;'."\n}\n\n";
$templates = $this->_get_templates( $id, $parent, 'groups', $group['group_name'] );
foreach ($templates as $func_name => $data )
{
$out .= $this->template->convert_html_to_php( $data['func_name'], $data['func_data'], $data['section_content'] ) ."\n";
$out .= $this->template->convert_html_to_php( $data['func_name'], $data['func_data'], $data['section_content'], "", "", $master_only ? 0 : 1 ) ."\n";
if ( $data['set_id'] == $id )
{
@@ -242,7 +273,7 @@ class admin_cache_functions
$this->_write_template_to_file( $id, $group['group_name'], $start.$out.$end );
}
$this->messages[] = "HTML øàáëîíû óñïåøíî îáíîâëåíû... (id: $id)";
$this->messages[] = "Done HTML templates rebuild... (id: $id)";
}
}
@@ -290,7 +321,7 @@ class admin_cache_functions
{
if ( ! is_writeable( CACHE_PATH.'cache/skin_cache/cacheid_'.$id.'/'.$group_name.'.php' ) )
{
$this->messages[] = "::cache_id_{$id}/{$group_name}.php not writeable - cannot cache to PHP files";
$this->messages[] = "<span class='rss-feed-invalid'>cache/skin_cache/cacheid_{$id}/{$group_name}.php not writeable - cannot cache to PHP file</span>";
$good_to_go = 0;
}
else
@@ -306,7 +337,7 @@ class admin_cache_functions
}
else
{
$this->messages[] = "::cache_id_{$id} íå çàïèñàí - íåâîçìîæíî ñîçäàâàòü òàì php ôàéëû";
$this->messages[] = "<span class='rss-feed-invalid'>cache/skin_cache/cacheid_{$id} not writeable - cannot cache to PHP file</span>";
}
}
@@ -324,7 +355,7 @@ class admin_cache_functions
$return = 1;
$this->messages[] = "/skin_cache/cacheid_{$id}/{$group_name}.php óñïåøíî çàïèñàí";
$this->messages[] = "Wrote skin_cache/cacheid_{$id}/{$group_name}.php";
}
}
@@ -383,6 +414,8 @@ class admin_cache_functions
if ( $return == 'titles' )
{
$templates[ $r['group_name'] ] = $r;
$this->template_count[ $r['set_id'] ] = isset($this->template_count[ $r['set_id'] ]) ? $this->template_count[ $r['set_id'] ] : array();
$this->template_count[ $r['set_id'] ][ $r['group_name'] ] = isset($this->template_count[ $r['set_id'] ][ $r['group_name'] ]) ? $this->template_count[ $r['set_id'] ][ $r['group_name'] ] : array( 'count' => 0 );
$this->template_count[ $r['set_id'] ][ $r['group_name'] ]['count']++;
}
else if ( $return == 'group' )
@@ -428,14 +461,14 @@ class admin_cache_functions
if ( ! file_exists( $skin_dir ) )
{
$this->messages[] = "Ýòîò ñòèëü óñòàíîâëåí â áåçîïàñíîì ðåæèìå (safe mode) è php ôàéëû êåøà îòñóòñòâóþò, ñîîòâåòñòâåíî íåò íåîáõîäèìîñòè çàïóñêàòü ýòó óòèëèòó äëÿ ýòîãî ñòèëÿ.";
$this->messages[] = "This template set is a safe mode only skin and no PHP skin files exist, there is no need to run this tool on this template set.";
return 0;
}
if ( ! is_readable($skin_dir) )
{
$this->messages[] = "ÎØÈÁÊÀ: Íåâîçìîæíà çàïèñü â ïàïêó /$skin_dir/, ïîæàëóéñòà, ïðîâåðüòå ïðàâà äîñòóïà (CHMOD) &#151; îíè äîëæíû áûòü 0777!";
$this->messages[] = "FAILD: Cannot write into '$skin_dir', please check the CHMOD value, and if needed, CHMOD to 0777 via FTP. IBF cannot do this for you.";
return 0;
}
@@ -455,7 +488,7 @@ class admin_cache_functions
# Ignore bugtracker
if ( $name == 'skin_bugtracker' )
{
$this->messages[] = "Ïðîïóùåí skin_bugtracker.php...";
$this->messages[] = "Skipping skin_bugtracker.php...";
continue;
}
@@ -466,7 +499,7 @@ class admin_cache_functions
}
else
{
$this->messages[] = "Íåâîçìîæíî îòêðûòü äëÿ ÷òåíèÿ ôàéë $filename, ýòîò ôàéë ïðîïóùåí...";
$this->messages[] = "Could not open $filename for reading, skipping file...";
continue;
}
@@ -475,7 +508,7 @@ class admin_cache_functions
if ( ! preg_match( "/\n/", $fdata ) )
{
$this->messages[] = "Ôàéë $filename ïóñòîé, ýòîò ôàéë ïðîïóùåí...";
$this->messages[] = "Could not find any line endings in $filename, skipping file...";
continue;
}
@@ -491,16 +524,22 @@ class admin_cache_functions
// Skip javascript functions...
//-----------------------------------------
#print htmlspecialchars( $f )."<br />";
if ( preg_match( "/<script/i", $f ) )
{
$script_token = 1;
$script_jump = 0;
#print "<span style='color:purple'>In script...</span><br />";
}
if ( preg_match( "/<\/script>/i", $f ) )
{
$script_token = 0;
$script_jump = 0;
#print "<span style='color:purple'>OUT script...</span><br />";
}
//-----------------------------------------
@@ -514,6 +553,14 @@ class admin_cache_functions
$script_jump = 1;
$script_token = 0;
}
if ( preg_match( "#<if=[\'\"]#", $f ) )
{
$script_jump = 1;
$script_token = 0;
#print "<span style='color:green'>IF found...[ Jump: $script_jump / Token: $script_token ]</span<br />";
}
}
if ( $script_token == 0 AND $script_jump == 1 )
@@ -523,19 +570,29 @@ class admin_cache_functions
$script_jump = 0;
$script_token = 1;
}
if ( preg_match( "#</if>#", $f ) )
{
$script_jump = 0;
$script_token = 1;
#print "<span style='color:green'>/IF found...[ Jump: $script_jump / Token: $script_token ]</span><br />";
}
}
//-----------------------------------------
// NOT IN JS
//-----------------------------------------
if ($script_token == 0)
if ( ! $script_token )
{
if ( preg_match( "/^function\s*([\w\_]+)\s*\((.*)\)/i", $f, $matches ) )
{
$functions[$matches[1]] = '';
$config[$matches[1]] = $matches[2];
$flag = $matches[1];
#print "---<b>".$matches[1]."</b> [ Jump: $script_jump / Token: $script_token ]<br />";
$functions[ $matches[1] ] = '';
$config[ $matches[1] ] = $matches[2];
$flag = $matches[1];
continue;
}
}
@@ -545,7 +602,7 @@ class admin_cache_functions
else
{
// Make JS safe (UBE - Ugly, but effective)
$f = preg_replace( "#if\s+?\(#is" , "i~f~(~" , $f );
$f = preg_replace( "#else#is" , "e~lse~" , $f );
$f = preg_replace( "#else\s+?if#is", "e~lse~i~f", $f );
@@ -607,17 +664,17 @@ class admin_cache_functions
}
else
{
$this->messages[] = "Íåâîçìîæíî îòêðûòü äëÿ ÷òåíèÿ ïàïêó /$skin_dir/.";
$this->messages[] = "Could not open directory $skin_dir for reading!.";
return 0;
}
}
else
{
$this->messages[] = "Íåò ïàïêè $skin_dir &#151; ïîæàëóéñòà, ïðîâåðüòå ïåðåìåííóþ \$root_path â ôàéëå admin.php.";
$this->messages[] = "$skin_dir is not a directory, please check the \$root_path variable in admin.php.";
return 0;
}
$this->messages[] = "Îáíîâëåíèå php ôàéëîâ êåøà óñïåøíî çàâåðøåíî.";
$this->messages[] = "Completed database rebuild from PHP cache files.";
return 1;
}
@@ -710,6 +767,17 @@ class admin_cache_functions
$this->ipsclass->DB->do_update( 'skin_sets', array( 'set_cache_css' => $css ), 'set_skin_set_id IN ('.implode(',',$set_ids).') AND set_skin_set_id != 1' );
if ( is_object($this->ipsclass->cachelib) AND ! $this->no_rebuild )
{
$this->ipsclass->DB->build_query( array( 'select' => '*', 'from' => 'skin_sets', 'where' => 'set_skin_set_id IN ('.implode(',',$set_ids).') AND set_skin_set_id != 1' ) );
$this->ipsclass->DB->exec_query();
while( $r = $this->ipsclass->DB->fetch_row() )
{
$this->ipsclass->cachelib->do_put( 'Skin_Store_' . $r['set_skin_set_id'], $r );
}
}
//-----------------------------------------
// Update flat-file caches
//-----------------------------------------
@@ -724,7 +792,7 @@ class admin_cache_functions
$start .= "/*------------------------------------------------------------------*/\n\n";
$start .= "/*~START CSS~*/\n\n";
$css = $this->ipsclass->txt_windowstounix($start.$css);
$css = $this->ipsclass->txt_windowstounix( $start . trim( $css ) );
if ( file_exists( CACHE_PATH."style_images" ) )
{
@@ -755,22 +823,22 @@ class admin_cache_functions
@fclose($FH);
@chmod( CACHE_PATH."style_images/css_".$id['set_skin_set_id'].".css", 0777 );
$this->messages[] = "Îáíîâëåíèå ôàéëà êåøà CSS ñòèëåé css_{$id['set_skin_set_id']}...";
$this->messages[] = "Rebuilding css file for css_{$id['set_skin_set_id']}...";
}
else
{
$this->messages[] = "<br /><b>Ôàéë ñ êåøåì css_{$id['set_skin_set_id']} íå îáíîâëåí! Ïðîâåðüòå ïðàâà äîñòóïà (CHMOD) ó /style_images/ è /style_images/css_{$id['set_skin_set_id']}.css!</b>";
$this->messages[] = "<br /><b>Cache file css_{$id['set_skin_set_id']} not updated. Check CHMOD permissions on ./style_images and ./style_images/css_{$id['set_skin_set_id']}.css</b>";
}
}
}
else
{
$this->messages[] = "<b>Ôàéë(û) êåøà íå îáíîâëåí(û). Ïðîâåðüòå ïðàâà äîñòóïà (CHMOD) ó /style_images/ è /style_images/css_{$id['set_skin_set_id']}.css!</b>";
$this->messages[] = "<b>Cache file(s) not updated. Check CHMOD permissions on ./style_images and ./style_images/css_{$id['set_skin_set_id']}.css</b>";
}
}
else
{
$this->messages[] = "<b>Ôàéë(û) êåøà íå îáíîâëåí(û). Ïàïêà /style_images/ íå ñóùåñòâóåò!</b>";
$this->messages[] = "<b>Cache file(s) not updated. style_images folder not present</b>";
}
}
@@ -801,14 +869,29 @@ class admin_cache_functions
$this->ipsclass->DB->manual_addslashes = 1;
$ids_to_update = array();
foreach( $ids as $i )
{
$macros = $this->_get_macros($i['id'], $i['parent'], $root);
$this->messages[] = "Âûïîëíåíî... (Ìàêðîñ: {$i['id']})...";
$this->messages[] = "Done.... (Macro ID: {$i['id']})...";
$this->ipsclass->DB->do_update( 'skin_sets', array( 'set_cache_macro' => $this->ipsclass->DB->add_slashes(serialize($macros)) ), 'set_skin_set_id='.$i['id'] );
$ids_to_update[] = $i['id'];
}
$this->ipsclass->DB->manual_addslashes = 0;
if ( is_object( $this->ipsclass->cachelib ) AND ! $this->no_rebuild )
{
$this->ipsclass->DB->build_query( array( 'select' => '*', 'from' => 'skin_sets', 'where' => 'set_skin_set_id IN ('.implode(',',$ids_to_update).')' ) );
$this->ipsclass->DB->exec_query();
while( $r = $this->ipsclass->DB->fetch_row() )
{
$this->ipsclass->cachelib->do_put( 'Skin_Store_' . $r['set_skin_set_id'], $r );
}
}
}
@@ -857,8 +940,8 @@ class admin_cache_functions
{
$this->no_rebuild = 1;
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'skin_sets', 'order' => 'set_skin_set_parent, set_skin_set_id ASC' ) );
$this->ipsclass->DB->simple_exec();
$this->ipsclass->DB->build_query( array( 'select' => '*', 'from' => 'skin_sets', 'order' => 'set_skin_set_parent, set_skin_set_id ASC' ) );
$this->ipsclass->DB->exec_query();
while ( $r = $this->ipsclass->DB->fetch_row() )
{
@@ -880,23 +963,23 @@ class admin_cache_functions
// Custom Macros
//-----------------------------------------
$this->messages[] = "Îáíîâëåíèå ìàêðîñîâ äëÿ {$skins[$aid]['set_name']}...";
$this->messages[] = "Rebuilding Macros for set {$skins[$aid]['set_name']}...";
$this->_recache_macros($aid, $skins[ $aid ]['set_skin_set_parent']);
//-----------------------------------------
// Custom CSS
//-----------------------------------------
$this->messages[] = "Îáíîâëåíèå CSS-ñòèëåé äëÿ {$skins[$aid]['set_name']}...";
$this->messages[] = "Rebuilding CSS for set {$skins[$aid]['set_name']}...";
$this->_write_css_to_cache( $aid, $skins[ $aid ]['set_skin_set_parent'] );
//-----------------------------------------
// Custom HTML
//-----------------------------------------
$this->messages[] = "Îáíîâëåíèå êåøà HTML øàáëîíîâ äëÿ {$skins[$aid]['set_name']}...";
$this->messages[] = "Rebuilding HTML templates cache for set {$skins[$aid]['set_name']}...";
$this->_recache_templates( $aid, $skins[ $aid ]['set_skin_set_parent'] );
@@ -904,16 +987,27 @@ class admin_cache_functions
// Custom Wrappers
//-----------------------------------------
$this->messages[] = "Îáíîâëåíèå êåøà ãëàâíîãî øàáëîíà ôîðóìà äëÿ {$skins[$aid]['set_name']}...";
$this->messages[] = "Rebuilding wrappers cache for set {$skins[$aid]['set_name']}...";
$this->_recache_wrapper( $aid, $skins[ $aid ]['set_skin_set_parent'] );
}
if( is_object($this->ipsclass->cachelib) )
{
$this->ipsclass->DB->build_query( array( 'select' => '*', 'from' => 'skin_sets', 'where' => 'set_skin_set_id IN ('.implode(',',$affected).')' ) );
$this->ipsclass->DB->exec_query();
while( $r = $this->ipsclass->DB->fetch_row() )
{
$this->ipsclass->cachelib->do_put( 'Skin_Store_' . $r['set_skin_set_id'], $r );
}
}
$this->messages[] = "Îáíîâëåíèå óñòàíîâîê ID ñòèëÿ...";
$this->messages[] = "Rebuilding the skin set ID relationship cache...";
$this->_rebuild_skin_id_cache($skins);
return $message;
return TRUE;
}
//-----------------------------------------
@@ -937,10 +1031,7 @@ class admin_cache_functions
foreach( $skins as $row )
{
if ( $row['set_skin_set_parent'] > 1 )
{
$parent = ','.$row['set_skin_set_parent'];
}
$parent = $row['set_skin_set_parent'] > 1 ? ','.$row['set_skin_set_parent'] : '';
$this->ipsclass->cache['skin_id_cache'][ $row['set_skin_set_id'] ] = array( 'set_skin_set_id' => $row['set_skin_set_id'],
'set_tree_list' => $row['set_skin_set_id'].$parent.',1',
+63 -47
View File
@@ -2,27 +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
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $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 $
+---------------------------------------------------------------------------
|
@@ -34,6 +24,11 @@
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_ACP' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}
class admin_forum_functions
{
@@ -56,11 +51,11 @@ class admin_forum_functions
function forum_build_children($root_id, $temp_html="", $depth_guide="")
{
if ( is_array( $this->ipsclass->forums->forum_cache[ $root_id ] ) )
if ( isset($this->ipsclass->forums->forum_cache[ $root_id ]) AND is_array( $this->ipsclass->forums->forum_cache[ $root_id ] ) )
{
foreach( $this->ipsclass->forums->forum_cache[ $root_id ] as $id => $forum_data )
foreach( $this->ipsclass->forums->forum_cache[ $root_id ] as $forum_data )
{
if ( $this->ipsclass->vars['forum_cache_minimum'] )
if ( isset($this->ipsclass->vars['forum_cache_minimum']) AND $this->ipsclass->vars['forum_cache_minimum'] )
{
$forum_data['description'] = "<!--DESCRIPTION:{$forum_data['id']}-->";
$this->need_desc[] = $forum_data['id'];
@@ -88,6 +83,8 @@ class admin_forum_functions
$desc = "";
$mod_string = "";
$r['skin_id'] = isset($r['skin_id']) ? $r['skin_id'] : '';
//-----------------------------------------
// Skin
//-----------------------------------------
@@ -136,7 +133,7 @@ class admin_forum_functions
// forum...
//-----------------------------------------
if ( ! $cfid = $children[ $count - 2 ] )
if ( !isset($children[ $count - 2 ]) OR ! $cfid = $children[ $count - 2 ] )
{
$cfid = $r['id'];
}
@@ -148,7 +145,7 @@ class admin_forum_functions
if ( count( $sub ) )
{
$subforums = '<fieldset style="margin-top:4px"><legend>Ïîäôîðóìû:</legend>'.implode( ", ", $sub ).'</fieldset>';
$subforums = '<fieldset style="margin-top:4px"><legend>Subforums</legend>'.implode( ", ", $sub ).'</fieldset>';
}
$desc = "{$r['description']}{$subforums}";
@@ -158,13 +155,15 @@ class admin_forum_functions
// Moderators
//-----------------------------------------
foreach( $this->moderators as $phpid => $data )
$r['_modstring'] = "";
foreach( $this->moderators as $data )
{
if ( $data['forum_id'] == $r['id'] )
{
if ($data['is_group'] == 1)
{
$data['_fullname'] = 'Ãðóïïà: '.$data['group_name'];
$data['_fullname'] = 'Group: '.$data['group_name'];
}
else
{
@@ -179,8 +178,8 @@ class admin_forum_functions
// Print
//-----------------------------------------
$this->skins[$r['skin_id']] = $this->skins[$r['skin_id']] ? $this->skins[$r['skin_id']] : '';
$this->skins[$r['skin_id']] = (isset($this->skins[$r['skin_id']]) AND $this->skins[$r['skin_id']]) ? $this->skins[$r['skin_id']] : '';
return $this->html->render_forum_row( $desc, $r, $depth_guide, $this->skins[$r['skin_id']] );
}
@@ -306,27 +305,33 @@ class admin_forum_functions
if ( $this->show_all )
{
foreach( $this->ipsclass->forums->forum_cache['root'] as $id => $forum_data )
foreach( $this->ipsclass->forums->forum_cache['root'] as $forum_data )
{
$cat_data = $forum_data;
$depth_guide = "";
$temp_html = "";
if ( is_array( $this->ipsclass->forums->forum_cache[ $forum_data['id'] ] ) )
if ( isset($this->ipsclass->forums->forum_cache[ $forum_data['id'] ]) AND is_array( $this->ipsclass->forums->forum_cache[ $forum_data['id'] ] ) )
{
foreach( $this->ipsclass->forums->forum_cache[ $forum_data['id'] ] as $id => $forum_data )
foreach( $this->ipsclass->forums->forum_cache[ $forum_data['id'] ] as $forum_data )
{
if ( $this->ipsclass->vars['forum_cache_minimum'] )
if ( isset($this->ipsclass->vars['forum_cache_minimum']) AND $this->ipsclass->vars['forum_cache_minimum'] )
{
$forum_data['description'] = "<!--DESCRIPTION:{$forum_data['id']}-->";
$this->need_desc[] = $forum_data['id'];
}
$temp_html .= $this->render_forum($forum_data, $depth_guide);
$temp_html = $this->forum_build_children( $forum_data['id'], $temp_html, '<span style="color:gray">&#0124;</span>'.$depth_guide . $this->ipsclass->forums->depth_guide );
}
}
if( !$temp_html )
{
$temp_html = $this->html->render_no_forums( $cat_data['id'] );
}
$this->ipsclass->html .= $this->forum_show_cat($temp_html, $cat_data);
unset($temp_html);
}
@@ -341,16 +346,17 @@ class admin_forum_functions
$seen_count = 0;
$total_items = 0;
foreach( $this->ipsclass->forums->forum_cache[ 'root' ] as $id => $forum_data )
foreach( $this->ipsclass->forums->forum_cache[ 'root' ] as $forum_data )
{
$cat_data = $forum_data;
$depth_guide = "";
$temp_html = "";
if ( is_array( $this->ipsclass->forums->forum_cache[ $forum_data['id'] ] ) )
if ( isset($this->ipsclass->forums->forum_cache[ $forum_data['id'] ]) AND is_array( $this->ipsclass->forums->forum_cache[ $forum_data['id'] ] ) )
{
foreach( $this->ipsclass->forums->forum_cache[ $forum_data['id'] ] as $id => $forum_data )
foreach( $this->ipsclass->forums->forum_cache[ $forum_data['id'] ] as $forum_data )
{
if ( $this->ipsclass->vars['forum_cache_minimum'] )
if ( isset($this->ipsclass->vars['forum_cache_minimum']) AND $this->ipsclass->vars['forum_cache_minimum'] )
{
$forum_data['description'] = "<!--DESCRIPTION:{$forum_data['id']}-->";
$this->need_desc[] = $forum_data['id'];
@@ -360,6 +366,11 @@ class admin_forum_functions
}
}
if( !$temp_html )
{
$temp_html = $this->html->render_no_forums( $cat_data['id'] );
}
$this->ipsclass->html .= $this->forum_show_cat($temp_html, $cat_data);
unset($temp_html);
}
@@ -371,7 +382,7 @@ class admin_forum_functions
else
{
$cat_data = $forum_data;
$cat_data = array();
$depth_guide = "";
@@ -380,9 +391,9 @@ class admin_forum_functions
$cat_data = $this->ipsclass->forums->forum_by_id[ $fid ];
$depth_guide = "";
foreach( $this->ipsclass->forums->forum_cache[ $fid ] as $id => $forum_data )
foreach( $this->ipsclass->forums->forum_cache[ $fid ] as $forum_data )
{
if ( $this->ipsclass->vars['forum_cache_minimum'] )
if ( isset($this->ipsclass->vars['forum_cache_minimum']) AND $this->ipsclass->vars['forum_cache_minimum'] )
{
$forum_data['description'] = "<!--DESCRIPTION:{$forum_data['id']}-->";
$this->need_desc[] = $forum_data['id'];
@@ -392,6 +403,11 @@ class admin_forum_functions
}
}
if( !$temp_html )
{
$temp_html = $this->html->render_no_forums( $cat_data['id'] );
}
$this->ipsclass->html .= $this->forum_show_cat( $temp_html, $this->ipsclass->forums->forum_by_id[ $fid ], 0, 1 );
unset($temp_html);
}
@@ -400,7 +416,7 @@ class admin_forum_functions
// Get descriptions?
//-----------------------------------------
if ( $this->ipsclass->vars['forum_cache_minimum'] and count($this->need_desc) )
if ( isset($this->ipsclass->vars['forum_cache_minimum']) AND $this->ipsclass->vars['forum_cache_minimum'] and count($this->need_desc) )
{
$this->ipsclass->DB->simple_construct( array( 'select' => 'id,description', 'from' => 'forums', 'where' => 'id IN('.implode( ',', $this->need_desc ) .')' ) );
$this->ipsclass->DB->simple_exec();
@@ -420,22 +436,22 @@ class admin_forum_functions
{
if ( $restrict != 1 )
{
$jump_array[] = array( '-1', 'Ñäåëàòü ðîäèòåëüñêèì/îñíîâíûì (êàòåãîðèÿ)' );
//$jump_array[] = array( '-1', 'Make Root (Category)' );
}
else
{
$jump_array = array();
}
foreach( $this->ipsclass->forums->forum_cache['root'] as $id => $forum_data )
foreach( $this->ipsclass->forums->forum_cache['root'] as $forum_data )
{
$jump_array[] = array( $forum_data['id'], $forum_data['name'] );
$depth_guide = $this->ipsclass->forums->depth_guide;
if ( is_array( $this->ipsclass->forums->forum_cache[ $forum_data['id'] ] ) )
if ( isset($this->ipsclass->forums->forum_cache[ $forum_data['id'] ]) AND is_array( $this->ipsclass->forums->forum_cache[ $forum_data['id'] ] ) )
{
foreach( $this->ipsclass->forums->forum_cache[ $forum_data['id'] ] as $id => $forum_data )
foreach( $this->ipsclass->forums->forum_cache[ $forum_data['id'] ] as $forum_data )
{
$jump_array[] = array( $forum_data['id'], $depth_guide.$forum_data['name'] );
@@ -453,9 +469,9 @@ class admin_forum_functions
function forums_forum_list_internal($root_id, $jump_array=array(), $depth_guide="")
{
if ( is_array( $this->ipsclass->forums->forum_cache[ $root_id ] ) )
if ( isset($this->ipsclass->forums->forum_cache[ $root_id ]) AND is_array( $this->ipsclass->forums->forum_cache[ $root_id ] ) )
{
foreach( $this->ipsclass->forums->forum_cache[ $root_id ] as $id => $forum_data )
foreach( $this->ipsclass->forums->forum_cache[ $root_id ] as $forum_data )
{
$jump_array[] = array( $forum_data['id'], $depth_guide.$forum_data['name'] );
@@ -474,7 +490,7 @@ class admin_forum_functions
function ad_forums_forum_data()
{
foreach( $this->ipsclass->forums->forum_cache['root'] as $id => $forum_data )
foreach( $this->ipsclass->forums->forum_cache['root'] as $forum_data )
{
$forum_data['depthed_name'] = $forum_data['name'];
$forum_data['root_forum'] = 1;
@@ -483,9 +499,9 @@ class admin_forum_functions
$depth_guide = $this->ipsclass->forums->depth_guide;
if ( is_array( $this->ipsclass->forums->forum_cache[ $forum_data['id'] ] ) )
if ( isset($this->ipsclass->forums->forum_cache[ $forum_data['id'] ]) AND is_array( $this->ipsclass->forums->forum_cache[ $forum_data['id'] ] ) )
{
foreach( $this->ipsclass->forums->forum_cache[ $forum_data['id'] ] as $id => $forum_data )
foreach( $this->ipsclass->forums->forum_cache[ $forum_data['id'] ] as $forum_data )
{
$forum_data['depthed_name'] = $depth_guide.$forum_data['name'];
@@ -505,9 +521,9 @@ class admin_forum_functions
function forums_forum_data_internal($root_id, $jump_array=array(), $depth_guide="")
{
if ( is_array( $this->ipsclass->forums->forum_cache[ $root_id ] ) )
if ( isset($this->ipsclass->forums->forum_cache[ $root_id ]) AND is_array( $this->ipsclass->forums->forum_cache[ $root_id ] ) )
{
foreach( $this->ipsclass->forums->forum_cache[ $root_id ] as $id => $forum_data )
foreach( $this->ipsclass->forums->forum_cache[ $root_id ] as $forum_data )
{
$forum_data['depthed_name'] = $depth_guide.$forum_data['name'];
+281 -162
View File
@@ -2,28 +2,18 @@
/*
+--------------------------------------------------------------------------
| 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
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2005-12-08 16:32:40 +0000 (Thu, 08 Dec 2005) $
| > $Revision: 96 $
| > $Author: bfarber $
| > $Date: 2006-10-16 14:09:47 +0100 (Mon, 16 Oct 2006) $
| > $Revision: 650 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
| > Admin functions library
@@ -34,6 +24,11 @@
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_ACP' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}
class admin_functions
{
@@ -41,27 +36,58 @@ class admin_functions
var $ipsclass;
var $img_url;
var $page_title = "Äîáðî ïîæàëîâàòü â àäìèíöåíòð Invision Power Board";
var $page_detail = "Âû ìîæåòå íàñòðàèâàòü âàø ôîðóì, èñïîëüçóÿ ýòîò àäìèíöåíòð.<br><br>Íàæàòèå íà îäíó èç ññûëîê â ëåâîì ìåíþ çàãðóçèò âûáðàííûå íàñòðîéêè â îêíå ñïðàâà äëÿ àäìèíèñòðèðîâàíèÿ. Êàæäàÿ îïöèÿ ñîäåðæèò êàêóþ-òî èíôîðìàöèþ.";
var $session_type = NULL;
var $html;
var $errors = "";
var $nav = array();
var $time_offset = 0;
var $jump_menu = "";
var $no_jump = 0;
var $master_skin = array();
var $depth_guide = '--';
var $menu_ids = array();
var $errors = "";
var $nav = array();
var $time_offset = 0;
var $jump_menu = "";
var $no_jump = 0;
var $master_skin = array();
var $depth_guide = '--';
var $menu_ids = array();
var $page_title = "";
var $page_detail = "";
/*-------------------------------------------------------------------------*/
// CONSTRUCTOR
// Get security auth key
/*-------------------------------------------------------------------------*/
function admin_functions()
/**
* Returns the admin's security AUTH key
*
* @return string md5 auth key
*/
function security_auth_get()
{
$this->ipsclass->base_url = $this->ipsclass->base_url;
$this->img_url = $this->ipsclass->skin_url;
return md5( $this->ipsclass->member['email'] . '^' . $this->ipsclass->member['joined'] . '^' . $this->ipsclass->member['ip_address'] . md5( $this->ipsclass->vars['sql_pass'] ) );
}
/*-------------------------------------------------------------------------*/
// Check security key
/*-------------------------------------------------------------------------*/
/**
* Checks the security key
*
* @param string md5 auth key
* @param int return and not die?
*/
function security_auth_check( $auth_key='', $return_and_not_die=0 )
{
$auth_key = ( $auth_key ) ? $auth_key : trim( $_POST['_admin_auth_key'] );
if ( $auth_key != $this->security_auth_get() )
{
if ( $return_and_not_die )
{
return FALSE;
}
else
{
$this->error( "Security Mismatch - please go back and reload the form before attempting to submit the form / press the button again", 0 );
exit();
}
}
}
/*-------------------------------------------------------------------------*/
@@ -79,13 +105,15 @@ class admin_functions
return TRUE;
}
$this->ipsclass->member['_perm_cache'] = $this->ipsclass->unpack_member_cache( $this->ipsclass->member['row_perm_cache'] );
//-------------------------------
// Get lang: NEEDS SORTIN'
//-------------------------------
if ( ! is_array( $this->perm_lang ) OR ! count( $this->perm_lang ) )
{
require_once( ROOT_PATH."cache/lang_cache/ru/acp_lang_acpperms.php" );
require_once( ROOT_PATH."cache/lang_cache/en/acp_lang_acpperms.php" );
$this->perm_lang = $lang;
}
@@ -97,11 +125,10 @@ class admin_functions
list( $perm_main , $_data ) = explode( '|', $perm );
list( $perm_child, $perm_bit ) = explode( ':', $_data );
if ( ! $this->ipsclass->member['_perm_cache'][ $perm_main ] )
{
$this->ipsclass->kill_menu = 1;
$this->ipsclass->admin->error("Âû íå èìååò äîñòóïà ê ýòîé òàáëèöå: ".$this->perm_lang[ $perm_main ] );
$this->ipsclass->admin->error("You do not have permission to access the tab: ".$this->perm_lang[ $perm_main ] );
exit();
}
@@ -116,11 +143,11 @@ class admin_functions
{
if ( $this->perm_lang[ $perm_main .':'. $perm_child ] )
{
$this->ipsclass->admin->error("Âû íå èìååò äîñòóïà ê âîçìîæíîñòè: ".$this->perm_lang[ $perm_main .':'. $perm_child ]);
$this->ipsclass->admin->error("You do not have permission to access the feature: ".$this->perm_lang[ $perm_main .':'. $perm_child ]);
}
else
{
$this->ipsclass->admin->error("Âû íå èìååò äîñòóïà ê ýòîé âîçìîæíîñòè");
$this->ipsclass->admin->error("You do not have permission to access that feature");
}
exit();
@@ -136,7 +163,7 @@ class admin_functions
{
if ( ! $this->ipsclass->member['_perm_cache'][ $perm_main .':'. $perm_child .':'. $perm_bit ] )
{
$this->ipsclass->admin->error("Âû íå èìååò äîñòóïà ê ôóíêöèè ýòîé âîçìîæíîñòè");
$this->ipsclass->admin->error("You do not have permission to access that feature function");
exit();
}
}
@@ -148,8 +175,27 @@ class admin_functions
// ACP_SESSION
/*-------------------------------------------------------------------------*/
function acp_session_validation( $check_ip=1 )
function acp_session_validation()
{
//----------------------------------
// Got a cookie wookey?
// Small security risk currently
// Until we add in the auth key to forms
//----------------------------------
/*
$cookie['admin_session_id'] = $this->ipsclass->my_getcookie('ipb_admin_session_id');
if ( $cookie['admin_session_id'] )
{
$this->ipsclass->input['adsess'] = $cookie['admin_session_id'];
$this->session_type = 'cookie';
}*/
//-----------------------------------------
// Check
//-----------------------------------------
if ( ! $this->ipsclass->input['adsess'] )
{
//----------------------------------
@@ -157,7 +203,7 @@ class admin_functions
//----------------------------------
$this->ipsclass->admin_session['_session_validated'] = 0;
$this->ipsclass->admin_session['_session_message'] = "Ñåññèé àäìèíèñòðàòîðà íå íàéäåíî";
$this->ipsclass->admin_session['_session_message'] = "No administration session found";
return FALSE;
}
else
@@ -166,9 +212,7 @@ class admin_functions
// We have a URL adsess, lets verify...
//----------------------------------
$this->ipsclass->DB->query("SELECT * FROM ibf_admin_sessions WHERE session_id='".$this->ipsclass->input['adsess']."'");
$row = $this->ipsclass->DB->fetch_row();
$row = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*', 'from' => 'admin_sessions', 'where' => "session_id='".$this->ipsclass->input['adsess']."'" ) );
if ( $row['session_id'] == "" )
{
@@ -177,7 +221,7 @@ class admin_functions
//----------------------------------
$this->ipsclass->admin_session['_session_validated'] = 0;
$this->ipsclass->admin_session['_session_message'] = "Íåâîçìîæíî çàïðîñèòü ñåññèþ";
$this->ipsclass->admin_session['_session_message'] = "Could not retrieve session record";
return FALSE;
}
else if ($row['session_member_id'] == "")
@@ -187,7 +231,7 @@ class admin_functions
//----------------------------------
$this->ipsclass->admin_session['_session_validated'] = 0;
$this->ipsclass->admin_session['_session_message'] = "Íåâîçìîæíî îïðåäåëèòü ïðàâèëüíûé ID";
$this->ipsclass->admin_session['_session_message'] = "Could not retrieve a valid member id";
return FALSE;
}
else
@@ -215,7 +259,7 @@ class admin_functions
$this->ipsclass->DB->exec_query();
$this->ipsclass->member = $this->ipsclass->DB->fetch_row();
$this->ipsclass->member['_perm_cache'] = unserialize( $this->ipsclass->member['row_perm_cache'] );
$this->ipsclass->member['_perm_cache'] = isset($this->ipsclass->member['row_perm_cache']) AND is_string($this->ipsclass->member['row_perm_cache']) ? unserialize( $this->ipsclass->member['row_perm_cache'] ) : '';
//----------------------------------
// Get perms
@@ -232,7 +276,7 @@ class admin_functions
//----------------------------------
$this->ipsclass->admin_session['_session_validated'] = 0;
$this->ipsclass->admin_session['_session_message'] = "ID ïîëüçîâàòåëÿ íåâåðíî";
$this->ipsclass->admin_session['_session_message'] = "Member ID invalid";
return FALSE;
}
else
@@ -240,15 +284,15 @@ class admin_functions
//----------------------------------
// Member found, check passy
//----------------------------------
if ($row['session_member_login_key'] != $this->ipsclass->member['member_login_key'])
if ( $row['session_member_login_key'] != md5( $this->ipsclass->member['joined'] . $this->ipsclass->member['ip_address'] ) )
{
//----------------------------------
// Passys don't match..
//----------------------------------
$this->ipsclass->admin_session['_session_validated'] = 0;
$this->ipsclass->admin_session['_session_message'] = "Ñåññèÿ ïàðîëÿ íå ñîâïàäàåò";
$this->ipsclass->admin_session['_session_message'] = "Session member password mismatch";
return FALSE;
}
else
@@ -260,7 +304,7 @@ class admin_functions
if ($this->ipsclass->member['g_access_cp'] != 1)
{
$this->ipsclass->admin_session['_session_validated'] = 0;
$this->ipsclass->admin_session['_session_message'] = "Âû íå èìååò äîñòóïà â àäìèíöåíòð";
$this->ipsclass->admin_session['_session_message'] = "You do not have access to the administrative CP";
return FALSE;
}
else
@@ -282,14 +326,14 @@ class admin_functions
if ( $this->ipsclass->admin_session['session_running_time'] < ( time() - 60*60*2) )
{
$this->ipsclass->admin_session['_session_validated'] = 0;
$this->ipsclass->admin_session['_session_message'] = "Òåêóùàÿ ñåññèÿ àäìèíèñòðàòîðà èñòåêëà";
$this->ipsclass->admin_session['_session_message'] = "This administration session has expired";
}
//------------------------------
// Are we checking IP's?
//------------------------------
else if ($check_ip == 1)
else if ( IPB_ACP_IP_MATCH == 1)
{
$first_ip = preg_replace( "/^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/", "\\1.\\2.\\3", $this->ipsclass->admin_session['session_ip_address'] );
$second_ip = preg_replace( "/^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/", "\\1.\\2.\\3", $this->ipsclass->ip_address );
@@ -297,7 +341,7 @@ class admin_functions
if ( $first_ip != $second_ip )
{
$this->ipsclass->admin_session['_session_validated'] = 0;
$this->ipsclass->admin_session['_session_message'] = "Âàø òåêóùèé IP íå ñîâïàäàåò íè ñ îäíîé íàøåé çàïèñüþ";
$this->ipsclass->admin_session['_session_message'] = "Your current IP address does not match the one in our records";
return FALSE;
}
}
@@ -400,7 +444,7 @@ class admin_functions
{
$skin_array[] = array( $id, $data['set_name'] );
if ( is_array( $this->master_skin[ $id ] ) )
if ( isset($this->master_skin[ $id ]) AND is_array( $this->master_skin[ $id ] ) )
{
foreach( $this->master_skin[ $id ] as $id => $data )
{
@@ -438,7 +482,7 @@ class admin_functions
// IMPORT FUNCTION
/*-------------------------------------------------------------------------*/
function import_xml( $infilename )
function import_xml( $infilename, $postfield='FILE_UPLOAD' )
{
//-----------------------------------------
// Allowed file-types
@@ -450,9 +494,9 @@ class admin_functions
// Upload
//-----------------------------------------
$FILE_NAME = $_FILES['FILE_UPLOAD']['name'];
$FILE_SIZE = $_FILES['FILE_UPLOAD']['size'];
$FILE_TYPE = $_FILES['FILE_UPLOAD']['type'];
$FILE_NAME = $_FILES[ $postfield ]['name'];
$FILE_SIZE = $_FILES[ $postfield ]['size'];
$FILE_TYPE = $_FILES[ $postfield ]['type'];
//-----------------------------------------
// Naughty Opera adds the filename on the end of the
@@ -461,21 +505,23 @@ class admin_functions
$FILE_TYPE = preg_replace( "/^(.+?);.*$/", "\\1", $FILE_TYPE );
$content = "";
//-----------------------------------------
// Naughty Mozilla likes to use "none" to indicate an empty upload field.
// I love universal languages that aren't universal.
//-----------------------------------------
if ( $_FILES['FILE_UPLOAD']['name'] == "" or ! $_FILES['FILE_UPLOAD']['name'] or ($_FILES['FILE_UPLOAD']['name'] == "none") )
if ( $_FILES[ $postfield ]['name'] == "" or ! $_FILES[ $postfield ]['name'] or ($_FILES[ $postfield ]['name'] == "none") )
{
continue;
return $content;
}
//-----------------------------------------
// Not a naughty file?
//-----------------------------------------
$file_extension = preg_replace( "#^.*\.(.+?)$#si", "\\1", strtolower( $_FILES['FILE_UPLOAD']['name'] ) );
$file_extension = preg_replace( "#^.*\.(.+?)$#si", "\\1", strtolower( $_FILES[ $postfield ]['name'] ) );
if ( ! in_array( $file_extension, $allowed_files ) )
{
@@ -483,11 +529,13 @@ class admin_functions
return '';
}
$content = "";
//-----------------------------------------
// Continue...
//-----------------------------------------
if ( strstr( $FILE_NAME, $infilename ) )
{
if ( move_uploaded_file( $_FILES[ 'FILE_UPLOAD' ]['tmp_name'], $this->ipsclass->vars['upload_dir']."/".$FILE_NAME) )
if ( move_uploaded_file( $_FILES[ $postfield ]['tmp_name'], $this->ipsclass->vars['upload_dir']."/".$FILE_NAME) )
{
if ( $FILE_NAME == $infilename.'.gz' )
{
@@ -671,7 +719,7 @@ class admin_functions
if ( ! is_dir($from_path) )
{
$this->errors = "Íåâîçìîæíî íàéòè ïàïêó /$from_path";
$this->errors = "Could not locate directory '$from_path'";
return FALSE;
}
@@ -679,7 +727,7 @@ class admin_functions
{
if ( ! @mkdir($to_path, $mode) )
{
$this->errors = "Íåâîçìîæíî ñîçäàòü ïàïêó /$to_path/! Ïîæàëóéñòà, ïðîâåðüòå ïðàâà äîñòóïà (CHMOD) è ïîïðîáóéòå ñíîâà.";
$this->errors = "Could not create directory '$to_path' please check the CHMOD permissions and re-try";
return FALSE;
}
else
@@ -790,7 +838,7 @@ class admin_functions
if (! is_array($new) )
{
$ibforums->admin->error("Îøèáêà! Íå óäàëîñü îáíîâèòü êîíôèãóðàöèîííûé ôàéë ôîðóìà. Äåéñòâèå îòìåíåíî!");
$this->ipsclass->admin->error("Error whilst attempting to rebuild the board config file, attempt aborted");
}
//-----------------------------------------
@@ -859,7 +907,7 @@ class admin_functions
}
else
{
$this->ipsclass->admin->error("Êðèòè÷åñêàÿ îøèáêà! Íå óäàëîñü îòêðûòü äëÿ çàïèñè ôàéë conf_global.php - èçìåíåíèÿ íå áóäóò âíåñåíû. Íåîáõîäèìî èçìåíèòü ïðàâà äîñòóïà (CHMOD) ê ôàéëó íà 0777.");
$this->ipsclass->admin->error("Fatal Error: Could not open conf_global for writing - no changes applied. Try changing the CHMOD to 0777");
}
// Pass back the new $INFO array to anyone who cares...
@@ -877,29 +925,34 @@ class admin_functions
function compile_forum_perms()
{
$r_array = array( 'READ' => '', 'REPLY' => '', 'START' => '', 'UPLOAD' => '' );
$r_array = array( 'READ' => '', 'REPLY' => '', 'START' => '', 'UPLOAD' => '', 'DOWNLOAD' => '', 'SHOW' => '' );
if ($this->ipsclass->input['READ_ALL'] == 1)
if (isset($this->ipsclass->input['READ_ALL']) AND $this->ipsclass->input['READ_ALL'] == 1)
{
$r_array['READ'] = '*';
}
if ($this->ipsclass->input['REPLY_ALL'] == 1)
if (isset($this->ipsclass->input['REPLY_ALL']) AND $this->ipsclass->input['REPLY_ALL'] == 1)
{
$r_array['REPLY'] = '*';
}
if ($this->ipsclass->input['START_ALL'] == 1)
if (isset($this->ipsclass->input['START_ALL']) AND $this->ipsclass->input['START_ALL'] == 1)
{
$r_array['START'] = '*';
}
if ($this->ipsclass->input['UPLOAD_ALL'] == 1)
if (isset($this->ipsclass->input['UPLOAD_ALL']) AND $this->ipsclass->input['UPLOAD_ALL'] == 1)
{
$r_array['UPLOAD'] = '*';
}
if ($this->ipsclass->input['SHOW_ALL'] == 1)
if (isset($this->ipsclass->input['DOWNLOAD_ALL']) AND $this->ipsclass->input['DOWNLOAD_ALL'] == 1)
{
$r_array['DOWNLOAD'] = '*';
}
if (isset($this->ipsclass->input['SHOW_ALL']) AND $this->ipsclass->input['SHOW_ALL'] == 1)
{
$r_array['SHOW'] = '*';
}
@@ -911,7 +964,7 @@ class admin_functions
{
if ($r_array['SHOW'] != '*')
{
if ($this->ipsclass->input[ 'SHOW_'.$data['perm_id'] ] == 1)
if (isset($this->ipsclass->input[ 'SHOW_'.$data['perm_id'] ]) AND $this->ipsclass->input[ 'SHOW_'.$data['perm_id'] ] == 1)
{
$r_array['SHOW'] .= $data['perm_id'].",";
}
@@ -919,7 +972,7 @@ class admin_functions
//-----------------------------------------
if ($r_array['READ'] != '*')
{
if ($this->ipsclass->input[ 'READ_'.$data['perm_id'] ] == 1)
if (isset($this->ipsclass->input[ 'READ_'.$data['perm_id'] ]) AND $this->ipsclass->input[ 'READ_'.$data['perm_id'] ] == 1)
{
$r_array['READ'] .= $data['perm_id'].",";
}
@@ -927,7 +980,7 @@ class admin_functions
//-----------------------------------------
if ($r_array['REPLY'] != '*')
{
if ($this->ipsclass->input[ 'REPLY_'.$data['perm_id'] ] == 1)
if (isset($this->ipsclass->input[ 'REPLY_'.$data['perm_id'] ]) AND $this->ipsclass->input[ 'REPLY_'.$data['perm_id'] ] == 1)
{
$r_array['REPLY'] .= $data['perm_id'].",";
}
@@ -935,7 +988,7 @@ class admin_functions
//-----------------------------------------
if ($r_array['START'] != '*')
{
if ($this->ipsclass->input[ 'START_'.$data['perm_id'] ] == 1)
if (isset($this->ipsclass->input[ 'START_'.$data['perm_id'] ]) AND $this->ipsclass->input[ 'START_'.$data['perm_id'] ] == 1)
{
$r_array['START'] .= $data['perm_id'].",";
}
@@ -943,18 +996,27 @@ class admin_functions
//-----------------------------------------
if ($r_array['UPLOAD'] != '*')
{
if ($this->ipsclass->input[ 'UPLOAD_'.$data['perm_id'] ] == 1)
if (isset($this->ipsclass->input[ 'UPLOAD_'.$data['perm_id'] ]) AND $this->ipsclass->input[ 'UPLOAD_'.$data['perm_id'] ] == 1)
{
$r_array['UPLOAD'] .= $data['perm_id'].",";
}
}
//-----------------------------------------
if ($r_array['DOWNLOAD'] != '*')
{
if (isset($this->ipsclass->input[ 'DOWNLOAD_'.$data['perm_id'] ]) AND $this->ipsclass->input[ 'DOWNLOAD_'.$data['perm_id'] ] == 1)
{
$r_array['DOWNLOAD'] .= $data['perm_id'].",";
}
}
}
$r_array['START'] = preg_replace( "/,$/", "", $r_array['START'] );
$r_array['REPLY'] = preg_replace( "/,$/", "", $r_array['REPLY'] );
$r_array['READ'] = preg_replace( "/,$/", "", $r_array['READ'] );
$r_array['UPLOAD'] = preg_replace( "/,$/", "", $r_array['UPLOAD'] );
$r_array['SHOW'] = preg_replace( "/,$/", "", $r_array['SHOW'] );
$r_array['START'] = preg_replace( "/,$/", "", $r_array['START'] );
$r_array['REPLY'] = preg_replace( "/,$/", "", $r_array['REPLY'] );
$r_array['READ'] = preg_replace( "/,$/", "", $r_array['READ'] );
$r_array['UPLOAD'] = preg_replace( "/,$/", "", $r_array['UPLOAD'] );
$r_array['DOWNLOAD'] = preg_replace( "/,$/", "", $r_array['DOWNLOAD'] );
$r_array['SHOW'] = preg_replace( "/,$/", "", $r_array['SHOW'] );
return $r_array;
}
@@ -965,18 +1027,25 @@ class admin_functions
function print_popup()
{
global $use_gzip;
//--------------------------------------
// Message in a bottle?
//--------------------------------------
if ( $this->ipsclass->main_msg )
{
$html = $this->ipsclass->skin_global_acp->global_message();
}
$html = $this->ipsclass->main_msg ? $this->ipsclass->skin_acp_global->global_message() : '';
$html .= $this->ipsclass->skin_global_acp->global_popup( $this->ipsclass->html );
$html .= $this->ipsclass->skin_acp_global->global_popup( $this->ipsclass->html );
if ( IPB_ACP_USE_GZIP == 1 )
{
$buffer = ob_get_contents();
ob_end_clean();
@ob_start('ob_gzhandler');
print $buffer;
}
@header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
@header("Cache-Control: no-cache, must-revalidate");
@header("Pragma: no-cache");
print $html;
@@ -993,7 +1062,7 @@ class admin_functions
if ( $this->ipsclass->can_use_fancy_js )
{
$this->ipsclass->html .= "<script type='text/javascript'>ajax_refresh( '$url', '$text', $addtotext );</script>\n<div style='height:300px;overflow:auto;font-weight:bold;line-height:140%;padding:5px;border:1px solid #000' id='refreshbox'>Èíèöèàëèçàöèÿ...</div>";
$this->ipsclass->html .= "<script type='text/javascript'>ajax_refresh( '$url', '$text', $addtotext );</script>\n<div style='height:300px;overflow:auto;font-weight:bold;line-height:140%;padding:5px;border:1px solid #000' id='refreshbox'>Initializing...</div>";
}
else
{
@@ -1016,7 +1085,7 @@ class admin_functions
}
else
{
print $this->ipsclass->skin_global_acp->global_redirect_hit( $url, $text );
print $this->ipsclass->skin_acp_global->global_redirect_hit( $url, $text );
exit();
}
}
@@ -1025,7 +1094,7 @@ class admin_functions
// Multi-redirect (hit)
/*-------------------------------------------------------------------------*/
function output_multiple_redirect_done($text='Ãîòîâî!')
function output_multiple_redirect_done($text='Completed!')
{
if ( $this->ipsclass->can_use_fancy_js )
{
@@ -1036,7 +1105,7 @@ class admin_functions
}
else
{
print $this->ipsclass->skin_global_acp->global_redirect_done( $text );
print $this->ipsclass->skin_acp_global->global_redirect_done( $text );
exit();
}
}
@@ -1047,18 +1116,23 @@ class admin_functions
function output()
{
global $use_gzip;
$html = "";
$navigation = array();
$message = "";
$help = "";
$member_bar = "";
$query_html = "";
//-----------------------------------------
// Debug?
//-----------------------------------------
if ($this->ipsclass->DB->obj['debug'])
{
flush();
print "<html><head><title>SQL Îòëàä÷èê</title><body bgcolor='white'><style type='text/css'> TABLE, TD, TR, BODY { font-family: verdana,arial, sans-serif;color:black;font-size:11px }</style>";
print "<h1 align='center'>SQL Îáùåå âðåìÿ: {$this->ipsclass->DB->sql_time} äëÿ {$this->ipsclass->DB->query_cnt} çàïðîñîâ</h1><br />".$this->ipsclass->DB->debug_html;
print "<br /><div align='center'><strong>Îáùåå âðåìÿ ðàáîòû SQL: {$this->ipsclass->DB->sql_time}</div></body></html>";
print "<html><head><title>SQL Debugger</title><body bgcolor='white'><style type='text/css'> TABLE, TD, TR, BODY { font-family: verdana,arial, sans-serif;color:black;font-size:11px }</style>";
print "<h1 align='center'>SQL Total Time: {$this->ipsclass->DB->sql_time} for {$this->ipsclass->DB->query_cnt} queries</h1><br />".$this->ipsclass->DB->debug_html;
print "<br /><div align='center'><strong>Total SQL Time: {$this->ipsclass->DB->sql_time}</div></body></html>";
exit();
}
@@ -1066,15 +1140,15 @@ class admin_functions
// Start function proper
//-----------------------------------------
$html = str_replace( '<%CONTENT%>', $this->ipsclass->skin_global_acp->global_frame_wrapper(), $this->ipsclass->skin_global_acp->global_main_wrapper() );
$html = str_replace( '<%CONTENT%>', $this->ipsclass->skin_acp_global->global_frame_wrapper(), $this->ipsclass->skin_acp_global->global_main_wrapper() );
$this->ipsclass->DB->close_db();
$navigation = array( "<a href='{$this->ipsclass->base_url}&act=index'>Íà ãëàâíóþ</a>" );
$navigation = array( "<a href='{$this->ipsclass->base_url}&act=index'>ACP Home</a>" );
if ( count($this->nav) > 0 )
{
foreach ( $this->nav as $idx => $links )
foreach ( $this->nav as $links )
{
if ($links[0] != "")
{
@@ -1093,17 +1167,22 @@ class admin_functions
if ( count($navigation) > 0 )
{
$html = str_replace( "<%NAV%>", $this->ipsclass->skin_global_acp->global_wrap_nav( implode( " &gt; ", $navigation ) ), $html );
$html = str_replace( "<%NAV%>", $this->ipsclass->skin_acp_global->global_wrap_nav( implode( " &gt; ", $navigation ) ), $html );
}
//-----------------------------------------
// Member bar..
//-----------------------------------------
$member_bar = $this->ipsclass->skin_acp_global->global_memberbar();
$html = str_replace( "<%MEMBERBAR%>", $member_bar, $html );
//--------------------------------------
// Message in a bottle?
//--------------------------------------
if ( $this->ipsclass->main_msg )
{
$message = $this->ipsclass->skin_global_acp->global_message();
}
$message = $this->ipsclass->main_msg ? $this->ipsclass->skin_acp_global->global_message() : '';
//--------------------------------------
// Help?
@@ -1112,9 +1191,9 @@ class admin_functions
$this->ipsclass->html_help_msg = $this->ipsclass->html_help_msg ? $this->ipsclass->html_help_msg : $this->page_detail;
$this->ipsclass->html_help_title = $this->ipsclass->html_help_title ? $this->ipsclass->html_help_title : $this->page_title;
if ( $this->ipsclass->html_help_title )
if ( $this->ipsclass->html_help_title AND $this->ipsclass->html_help_msg )
{
$help = $this->ipsclass->skin_global_acp->global_help_block( $this->ipsclass->html_help_title, $this->ipsclass->html_help_msg );
$help = $this->ipsclass->skin_acp_global->information_box( $this->ipsclass->html_help_title, $this->ipsclass->html_help_msg.'<br />&nbsp;' ) . "<br >";
}
//-----------------------------------------
@@ -1141,8 +1220,6 @@ class admin_functions
// Show queries
//-----------------------------------------
$query_html = "";
if ( IN_DEV and count( $this->ipsclass->DB->obj['cached_queries']) )
{
$queries = "";
@@ -1157,12 +1234,12 @@ class admin_functions
$queries .= htmlspecialchars($q).'<hr />';
}
$query_html .= $this->ipsclass->skin_global_acp->global_query_output($queries);
$query_html .= $this->ipsclass->skin_acp_global->global_query_output($queries);
}
global $Debug;
$query_html .= "<div align='center'><br />Âðåìÿ ãåíåðàöèè ñòðàíèöû: ".$Debug->endTimer()."</div>";
$query_html .= "<div align='center'><br />Time: ".$Debug->endTimer()."</div>";
//-----------------------------------------
// Other tags...
@@ -1185,14 +1262,23 @@ class admin_functions
$html = str_replace( "<body", "<body ".$this->ipsclass->body_extra, $html );
}
$html = str_replace( "<#IMG_DIR#>", $this->ipsclass->skin['_imagedir'], $html );
$html = str_replace( "<#EMO_DIR#>", $this->ipsclass->skin['_emodir'] , $html );
//-----------------------------------------
// Gzip?
//-----------------------------------------
if ($use_gzip == 1)
if ( IPB_ACP_USE_GZIP )
{
$buffer = ob_get_contents();
ob_end_clean();
$buffer = "";
if( count( ob_list_handlers() ) )
{
$buffer = ob_get_contents();
ob_end_clean();
}
@ob_start('ob_gzhandler');
print $buffer;
}
@@ -1212,15 +1298,16 @@ class admin_functions
function build_tabs()
{
$onoff['content'] = 'taboff';
$onoff['lookandfeel'] = 'taboff';
$onoff['tools'] = 'taboff';
$onoff['components'] = 'taboff';
$onoff['admin'] = 'taboff';
$onoff['content'] = 'taboff-main';
$onoff['lookandfeel'] = 'taboff-main';
$onoff['tools'] = 'taboff-main';
$onoff['components'] = 'taboff-main';
$onoff['admin'] = 'taboff-main';
$onoff['help'] = 'taboff-main';
$onoff[ $this->ipsclass->menu_type ] = 'tabon';
$onoff[ $this->ipsclass->menu_type ] = 'tabon-main';
return $this->ipsclass->skin_global_acp->global_tabs( $onoff );
return $this->ipsclass->skin_acp_global->global_tabs( $onoff );
}
/*-------------------------------------------------------------------------*/
@@ -1245,9 +1332,9 @@ class admin_functions
require_once( ROOT_PATH."sources/acp_loaders/acp_pages_".$this->ipsclass->menu_type.".php" );
$this->pages = $PAGES;
$this->cats = $CATS;
$this->desc = $DESC;
$this->pages = isset($PAGES) ? $PAGES : array();
$this->cats = isset($CATS) ? $CATS : array();
$this->desc = isset($DESC) ? $DESC : array();
$html = $this->build_tree();
@@ -1299,13 +1386,13 @@ class admin_functions
}
$this->ipsclass->main_msg = "";
$this->ipsclass->html_title = "IPB: Àäìèíöåíòð: Ïåðåàäðåñàöèÿ...";
$this->ipsclass->html_title = "IPB: ACP: Redirecting...";
$html = $this->ipsclass->skin_global_acp->global_redirect( $url, $time, $text );
$html = $this->ipsclass->skin_acp_global->global_redirect( $url, $time, $text );
$this->ipsclass->html = str_replace( '<%CONTENT%>', $html, $this->ipsclass->skin_global_acp->global_main_wrapper() );
$this->ipsclass->html = str_replace( '<%CONTENT%>', $html, $this->ipsclass->skin_acp_global->global_main_wrapper() );
$this->ipsclass->html = str_replace( '<%TITLE%>' , $this->ipsclass->html_title, $this->ipsclass->html );
$this->ipsclass->html = str_replace( "<body", "<body style='background-image:url({$this->ipsclass->skin_url}/images/blank.gif)'", $this->ipsclass->html );
$this->ipsclass->html = str_replace( "<body", "<body style='background-image:url({$this->ipsclass->skin_acp_url}/images/blank.gif)'", $this->ipsclass->html );
@header("Content-type: text/html");
print $this->ipsclass->html;
@@ -1349,17 +1436,17 @@ class admin_functions
function error($error="", $is_popup=0)
{
$this->page_title = "Ñîîáùåíèå àäìèíöåíòðà";
$this->page_detail = "&nbsp;";
$this->page_title = "Admin CP Message";
$this->page_detail = $error;//"&nbsp;";
$this->ipsclass->html .= "<div class='tableborder'>
<div class='maintitle'>Ñîîáùåíèå àäìèíöåíòðà</div>
<div class='tdrow1' style='padding:8px'>
/*$this->ipsclass->html .= "<div class='tableborder'>
<div class='tableheaderalt'>Admin CP Message</div>
<div class='tablerow1' style='padding:8px'>
<span style='font-size:12px'>$error</span>
</div>
</div>";
</div>";*/
if ($is_popup == 0)
if ( $is_popup == 0 )
{
$this->output();
}
@@ -1377,19 +1464,19 @@ class admin_functions
{
if ( $redirect )
{
$this->redirect( $this->ipsclass->base_url.'&'.$link_url, "<b>$title</b><br />Ïåðåìåùåíèå ê: ".$link_text );
$this->redirect( $this->ipsclass->base_url.'&'.$link_url, "<b>$title</b><br />Redirecting to: ".$link_text );
}
$this->page_title = $title;
$this->page_detail = "Äåéñòâèå âûïîëíåíî óñïåøíî";
$this->page_detail = "The action was executed successfully";
$this->ipsclass->adskin->td_header[] = array( "&nbsp;" , "100%" );
$this->ipsclass->html .= $this->ipsclass->adskin->start_table("Ðåçóëüòàò");
$this->ipsclass->html .= $this->ipsclass->adskin->start_table("Result");
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic( "<a href='{$this->ipsclass->base_url}&{$link_url}'>Ïåðåéòè â: $link_text</a>", "center" );
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic( "<a href='{$this->ipsclass->base_url}&{$link_url}'>Go to: $link_text</a>", "center" );
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic( "<a href='{$this->ipsclass->base_url}&act=index'>Ïåðåéòè íà ãëàâíóþ ñòðàíèöó àäìèíöåíòðà</a>", "center" );
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic( "<a href='{$this->ipsclass->base_url}&act=index'>Go to: Administration Home</a>", "center" );
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
@@ -1400,18 +1487,18 @@ class admin_functions
// INFO screen
/*-------------------------------------------------------------------------*/
function info_screen($text="", $title='Ïðåäóïðåæäåíèå Safe Mode')
function info_screen($text="", $title='Safe Mode Restriction Warning')
{
$this->page_title = $title;
$this->page_detail = "Ïîæàëóéñòà, ïîìíèòå ñëåäóþùåå:";
$this->page_detail = "Please note the following:";
$this->ipsclass->adskin->td_header[] = array( "&nbsp;" , "100%" );
$this->ipsclass->html .= $this->ipsclass->adskin->start_table("Ðåçóëüòàò");
$this->ipsclass->html .= $this->ipsclass->adskin->start_table("Result");
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic( $text );
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic( "<a href='{$this->ipsclass->base_url}&act=index'>Ïåðåéòè íà: ãëàâíóþ ñòðàíèöó àäìèíöåíòðà</a>", "center" );
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic( "<a href='{$this->ipsclass->base_url}&act=index'>Go to: Administration Home</a>", "center" );
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
@@ -1430,8 +1517,7 @@ class admin_functions
//----------------------------------
$html = "";
$links = "";
//----------------------------------
// Known menu stuff
//----------------------------------
@@ -1443,9 +1529,11 @@ class admin_functions
foreach($this->cats as $cid => $data)
{
$name = $data[0];
$color = $data[1];
$extra = $data[2];
$links = "";
$name = isset($data[0]) ? $data[0] : NULL;
$color = isset($data[1]) ? $data[1] : NULL;
$extra = isset($data[2]) ? $data[2] : NULL;
$this->menu_ids[] = $cid;
@@ -1453,7 +1541,7 @@ class admin_functions
foreach($this->pages[ $cid ] as $pid => $pdata)
{
if ( $pdata[2] != "" )
if ( isset($pdata[2]) AND $pdata[2] != "" )
{
if ( ! @is_dir( ROOT_PATH.$pdata[2] ) )
{
@@ -1461,6 +1549,32 @@ class admin_functions
}
}
if ( isset($pdata[4]) AND $pdata[4] )
{
$icon = "<img src='{$this->ipsclass->skin_acp_url}/images/menu_shortcut.gif' border='0' alt='' valign='absmiddle'>";
$extra_css = ';font-style:italic';
}
else
{
$icon = "<img src='{$this->ipsclass->skin_acp_url}/images/item_bullet.gif' border='0' alt='' valign='absmiddle'>";
$extra_css = "";
}
if ( isset($pdata[3]) AND $pdata[3] == 1 )
{
$theurl = $this->ipsclass->vars['board_url'].'/index.'.$this->ipsclass->vars['php_ext'].'?';
}
else
{
$theurl = $this->ipsclass->base_url.'&';
}
if( isset($pdata[5]) AND $pdata[5] == 1 )
{
$theurl = "";
$extra_css = "' target='_blank";
}
//----------------------------------
// Got actual restrictions?
//----------------------------------
@@ -1517,10 +1631,15 @@ class admin_functions
}
}
$links .= $this->ipsclass->adskin->menu_cat_link($pid, $cid, $pdata[1], $pdata[0], $pdata[3], $pdata[4], $no_access);
if ( $no_access )
{
$extra_css .= ";color:#777";
}
$links .= $this->ipsclass->skin_acp_global->global_menu_cat_link( $cid, $pid, $icon, $theurl, $pdata[1], $extra_css, $pdata[0] );
}
$html .= $this->ipsclass->adskin->menu_cat_wrap( $show, $name, $links, $cid, $this->desc[$cid], $color, $extra );
$html .= $this->ipsclass->skin_acp_global->global_menu_cat_wrap( $name, $links, $cid, isset($this->desc[$cid]) ? $this->desc[$cid] : '' );
unset($links);
@@ -1556,7 +1675,7 @@ class admin_functions
{
$html .= "<optgroup label='$name[0]'>\n";
foreach($PAGES[ $cid ] as $pid => $pdata)
foreach($PAGES[ $cid ] as $pdata)
{
$html .= "<option value='$pdata[1]'>$pdata[0]</option>\n";
}
@@ -1564,7 +1683,7 @@ class admin_functions
$html .= "</optgroup>\n";
}
$html .= "</select>&nbsp;<input type='button' class='jmenubutton' value='Âïåðåä!' onclick='dojump();' />\n</form>";
$html .= "</select>&nbsp;<input type='button' class='jmenubutton' value='Go!' onclick='dojump();' />\n</form>";
return $html;
}
@@ -1586,13 +1705,13 @@ class admin_functions
$html = "<form name='gobaakaachoo'>
<select name='chooseacardanycard' class='realbutton' onchange=\"autojumpmenu(this)\">
<option value=''>Áûñòðûé ïåðåõîä ïî ñòèëþ: {$r['set_name']}</option>
<option value=''>Set: {$r['set_name']} options</option>
<option value=''>-------------------</option>
<option value='{$this->ipsclass->adskin->base_url}&section=lookandfeel&act=wrap&code=edit&id={$r['set_skin_set_id']}&p={$r['set_skin_set_parent']}'>Èçìåíèòü ãëàâíûé øàáëîí ôîðóìà</option>
<option value='{$this->ipsclass->adskin->base_url}&section=lookandfeel&act=templ&code=edit&id={$r['set_skin_set_id']}&p={$r['set_skin_set_parent']}'>Èçìåíèòü HTML øàáëîíû ñòèëÿ</option>
<option value='{$this->ipsclass->adskin->base_url}&section=lookandfeel&act=style&code=edit&id={$r['set_skin_set_id']}&p={$r['set_skin_set_parent']}'>Èçìåíèòü CSS ñòèëè (ðàñøèðåííûé ðåæèì)</option>
<option value='{$this->ipsclass->adskin->base_url}&section=lookandfeel&act=style&code=colouredit&id={$r['set_skin_set_id']}&p={$r['set_skin_set_parent']}'>Èçìåíèòü CSS ñòèëè (ïðîñòîé ðåæèì)</option>
<option value='{$this->ipsclass->adskin->base_url}&section=lookandfeel&act=image&code=edit&id={$r['set_skin_set_id']}&p={$r['set_skin_set_parent']}'>Èçìåíèòü ìàêðîñû</option>
<option value='{$this->ipsclass->adskin->base_url}&section=lookandfeel&act=wrap&code=edit&id={$r['set_skin_set_id']}&p={$r['set_skin_set_parent']}'>Edit Board Header & Footer Wrapper</option>
<option value='{$this->ipsclass->adskin->base_url}&section=lookandfeel&act=templ&code=edit&id={$r['set_skin_set_id']}&p={$r['set_skin_set_parent']}'>Edit Template HTML</option>
<option value='{$this->ipsclass->adskin->base_url}&section=lookandfeel&act=style&code=edit&id={$r['set_skin_set_id']}&p={$r['set_skin_set_parent']}'>Edit CSS (Advanced Mode)</option>
<option value='{$this->ipsclass->adskin->base_url}&section=lookandfeel&act=style&code=colouredit&id={$r['set_skin_set_id']}&p={$r['set_skin_set_parent']}'>Edit CSS (Easy Mode)</option>
<option value='{$this->ipsclass->adskin->base_url}&section=lookandfeel&act=image&code=edit&id={$r['set_skin_set_id']}&p={$r['set_skin_set_parent']}'>Edit Replacement Macros</option>
</select>
</form>";
+118 -120
View File
@@ -1,6 +1,7 @@
<?php
//===========================================================================
// Simple library that holds all the links for the admin cp
// Invision Power Board
//===========================================================================
// CAT_ID => array( PAGE_ID => (PAGE_NAME, URL ) )
@@ -12,45 +13,45 @@
// $PAGES[ $cat_id ][$page_id][4] = Item icon: 1= redirect 0 = Normal
$PAGES = array(
# ÍÀÑÒÐÎÉÊÈ
# SETTINGS
100 => array (
1 => array( 'Âñå îñíîâíûå íàñòðîéêè', 'act=op' ),
2 => array( 'Äîáàâèòü íîâûé ïàðàìåòð' , 'act=op&code=settingnew' ),
7 => array( 'Âêëþ÷åíèå/Âûêëþ÷åíèå' , 'act=op&code=findsetting&key='.urlencode('Âêëþ÷åíèå / Âûêëþ÷åíèå ôîðóìà'), '', 0, 1 ),
8 => array( 'Ïðàâèëà ôîðóìà' , 'act=op&code=findsetting&key='.urlencode('Ïðàâèëà ôîðóìà'), '', 0, 1 ),
9 => array( 'Ãëîáàëüíûå íàñòðîéêè' , 'act=op&code=findsetting&key='.urlencode('Ãëîáàëüíûå Íàñòðîéêè ôîðóìà'), '', 0, 1 ),
10 => array( 'Íàñòðîéêè áûñòðîäåéñòâèÿ' , 'act=op&code=findsetting&key='.urlencode('Íàñòðîéêè Áûñòðîäåéñòâèÿ'), '', 0, 1 ),
// 11 => array( 'IP Chat' , 'act=pin&code=ipchat' ),
12 => array( 'Ðåãèñòðàöèÿ IPB' , 'act=pin&code=reg' ),
// 14 => array( 'IPB Copyright Removal' , 'act=pin&code=copy' ),
1 => array( 'View All General Settings', 'act=op' ),
2 => array( 'Add New General Setting' , 'act=op&code=settingnew' ),
7 => array( 'Turn Board On / Off' , 'act=op&code=findsetting&key='.urlencode('boardoffline/online'), '', 0, 1 ),
8 => array( 'Board Guidelines' , 'act=op&code=findsetting&key='.urlencode('boardguidelines'), '', 0, 1 ),
9 => array( 'General Configuration' , 'act=op&code=findsetting&key='.urlencode('generalconfiguration'), '', 0, 1 ),
10 => array( 'CPU Saving' , 'act=op&code=findsetting&key='.urlencode('cpusaving&optimization'), '', 0, 1 ),
11 => array( 'IP Chat' , 'act=pin&code=ipchat' ),
12 => array( 'IPB License' , 'act=pin&code=reg' ),
14 => array( 'IPB Copyright Removal' , 'act=pin&code=copy' ),
),
# ÓÏÐÀÂËÅÍÈÅ ÏÎËÜÇÎÂÀÒÅËßÌÈ
# MEMBER MANAGEMENT
200 => array (
1 => array( 'Ñîçäàòü íîâûé ôîðóì' , 'act=forum&code=new' ),
2 => array( 'Óïðàâëåíèå ôîðóìàìè' , 'act=forum' ),
3 => array( 'Ìàñêè äîñòóïà' , 'act=group&code=permsplash'),
6 => array( 'Ìîäåðàòîðû' , 'act=mod' ),
7 => array( 'Ìóëüòè-ìîäåðàöèÿ òåì', 'act=multimod' ),
8 => array( 'Íàñòðîéêè êîðçèíû' , 'act=op&code=setting_view&conf_group=14', '', 0, 1 ),
1 => array( 'New Forum' , 'act=forum&code=new' ),
2 => array( 'Manage Forums' , 'act=forum' ),
3 => array( 'Permission Masks' , 'act=group&code=permsplash'),
6 => array( 'Moderators' , 'act=mod' ),
7 => array( 'Topic Multi-Moderation', 'act=multimod' ),
8 => array( 'Trash Can Set-Up' , 'act=op&code=findsetting&key=trashcanset-up', '', 0, 1 ),
),
300 => array (
1 => array ( 'Óïðàâëåíèå ïîëüçîâàòåëÿìè' , 'act=mem&code=search' ),
2 => array ( 'Ñîçäàòü íîâîãî ïîëüçîâàòåëÿ' , 'act=mem&code=add' ),
6 => array ( 'Óïðàâëåíèå çâàíèÿìè' , 'act=mem&code=title'),
7 => array ( 'Óïðàâëåíèå ãðóïïàìè' , 'act=group' ),
8 => array ( 'Óïðàâëåíèå íåàêòèâèðîâàí.' , 'act=mem&code=mod' ),
9 => array ( 'Äîïîëíèòåëüíûå ïîëÿ ïðîôèëÿ' , 'act=field' ),
11 => array ( 'IP óòèëèòû' , 'act=mtools' ),
12 => array ( 'Ïðîôèëè ïîëüçîâàòåëåé' , 'act=op&code=setting_view&conf_group=4', '', 0, 1 ),
1 => array ( 'Manage Members' , 'act=mem&code=search' ),
2 => array ( 'Add New Member' , 'act=mem&code=add' ),
6 => array ( 'Manage Ranks' , 'act=mem&code=title'),
7 => array ( 'Manage User Groups' , 'act=group' ),
8 => array ( 'Manage Validating' , 'act=mem&code=mod' ),
9 => array ( 'Custom Profile Fields' , 'act=field' ),
11 => array ( 'IP Member Tools' , 'act=mtools' ),
12 => array ( 'Member Settings' , 'act=op&code=findsetting&key=userprofiles', '', 0, 1 ),
),
/* íå àêòóàëüíî äëÿ Ðîññèè
400 => array(
1 => array( 'Manage Payment Gateways' , 'act=msubs&code=index-gateways' ),
2 => array( 'Manage Packages' , 'act=msubs&code=index-packages' ),
@@ -61,170 +62,167 @@ $PAGES = array(
9 => array( 'Subscription Settings' , 'act=op&code=findsetting&key='.urlencode('subscriptionsmanager'), '', 0, 1 ),
),
*/
# POST MANAGEMENT
500 => array (
1 => array( 'Òèïû ïðèêðåïëÿåìûõ ôàéëîâ' , 'act=attach&code=types' ),
2 => array( 'Ñòàòèñòèêà ïðèêðåïë. ôàéëîâ' , 'act=attach&code=stats' ),
3 => array( 'Ïîèñê ïðèêðåïë. ôàéëîâ' , 'act=attach&code=search' ),
1 => array( 'Attachment Types' , 'act=attach&code=types' ),
2 => array( 'Attachment Stats' , 'act=attach&code=stats' ),
3 => array( 'Attachment Search' , 'act=attach&code=search' ),
),
600 => array(
1 => array( 'Äîïîëíèòåëüíûå BB-êîäû' , 'act=admin&code=bbcode' ),
2 => array( 'Äîáàâèòü íîâûé BB-êîä' , 'act=admin&code=bbcode_add' ),
1 => array( 'Custom BBCode Manager' , 'act=admin&code=bbcode' ),
2 => array( 'Add New BBCode' , 'act=admin&code=bbcode_add' ),
),
700 => array(
1 => array( 'Ìåíåäæåð ñìàéëèêîâ' , 'act=admin&code=emo' ),
2 => array( 'Èìïîðò/ýêñïîðò ñìàéëèêîâ' , 'act=admin&code=emo_packsplash' ),
1 => array( 'Emoticon Manager' , 'act=admin&code=emo' ),
2 => array( 'Import/Export Packs' , 'act=admin&code=emo_packsplash' ),
),
800 => array (
1 => array( 'Ôèëüòðû íåöåíçóðíûõ ñëîâ', 'act=admin&code=badword' ),
6 => array( 'Ôèëüòðû áëîêèðîâêè (ban)' , 'act=admin&code=ban' ),
1 => array( 'Manage Badword Filters', 'act=admin&code=badword' ),
6 => array( 'Manage Ban Filters' , 'act=admin&code=ban' ),
),
# SKINS & LANGS
900 => array (
1 => array( 'Ìåíåäæåð ñòèëåé' , 'act=sets' ),
2 => array( 'Óòèëèòû äëÿ ñòèëåé' , 'act=skintools' ),
3 => array( 'Ïîèñê è çàìåíà â ñòèëÿõ' , 'act=skintools&code=searchsplash' ),
4 => array( 'Èìïîðò/ýêñïîðò ñòèëåé' , 'act=import' ),
5 => array( 'Ïðîñòàÿ ñìåíà ëîãîòèïà' , 'act=skintools&code=easylogo' ),
1 => array( 'Skin Manager' , 'act=sets' ),
2 => array( 'Skin Tools' , 'act=skintools' ),
3 => array( 'Skin Search & Replace' , 'act=skintools&code=searchsplash' ),
4 => array( 'Skin Import/Export' , 'act=import' ),
5 => array( 'Easy Logo Changer' , 'act=skintools&code=easylogo' ),
),
1000 => array (
1 => array( 'Óïðàâëåíèå ÿçûêàìè' , 'act=lang' ),
2 => array( 'Èìïîðòèðîâàíèå ÿçûêà' , 'act=lang&code=import' ),
1 => array( 'Manage Languages' , 'act=lang' ),
2 => array( 'Import a Language' , 'act=lang&code=import' ),
),
# ADMIN
1100 => array (
1 => array( 'Ðàçäåëû ïîìîùè' , 'act=help' ),
2 => array( 'Óïðàâëåíèå êåøåì' , 'act=admin&code=cache' ),
3 => array( 'Ïåðåñ÷åò è îáíîâëåíèå' , 'act=rebuild' ),
4 => array( 'Óòèëèòû î÷èñòêè' , 'act=rebuild&code=tools' ),
1 => array( 'Manage Help Files' , 'act=help' ),
2 => array( 'Cache Control' , 'act=admin&code=cache' ),
3 => array( 'Recount & Rebuild' , 'act=rebuild' ),
4 => array( 'Clean-up Tools' , 'act=rebuild&code=tools' ),
),
1200 => array(
1 => array( 'Óïðàâëåíèå ðàññûëêàìè' , 'act=postoffice' ),
2 => array( 'Ñîçäàòü ðàññûëêó' , 'act=postoffice&code=mail_new' ),
3 => array( 'Æóðíàë e-mail îòïðàâëåíèé' , 'act=emaillog', '', 0, 1 ),
4 => array( 'Æóðíàë e-mail îøèáîê' , 'act=emailerror', '', 0, 1 ),
5 => array( 'E-mail íàñòðîéêè' , 'act=op&code=findsetting&key='.urlencode('Íàñòðîéêè e-mail'), '', 0, 1 ),
1 => array( 'Manage Bulk Mail' , 'act=postoffice' ),
2 => array( 'Create New Email' , 'act=postoffice&code=mail_new' ),
3 => array( 'View Email Logs' , 'act=emaillog', '', 0, 1 ),
4 => array( 'View Email Error Logs' , 'act=emailerror', '', 0, 1 ),
5 => array( 'Email Settings' , 'act=op&code=findsetting&key=emailset-up', '', 0, 1 ),
),
1300 => array (
1 => array( 'Ìåíåäæåð çàäà÷' , 'act=task' ),
2 => array( 'Æóðíàë âûïîëíåííûõ çàäà÷ ' , 'act=task&code=log' ),
1 => array( 'Task Manager' , 'act=task' ),
2 => array( 'View Task Logs' , 'act=task&code=log' ),
),
1400 => array(
1 => array( 'Invision Gallery' , 'act=gallery' ),
2 => array( '|-- Íàñòðîéêè' , 'act=op&code=findsetting&key='.urlencode('Íàñòðîéêè ãàëåðåè'), '', 0, 0 ),
3 => array( '|-- Ìåíåäæåð àëüáîìîâ' , 'act=gallery&code=albums' , 'modules/gallery' ),
4 => array( '|-- Ìåíåäæåð ìóëüòèìåäèà' , 'act=gallery&code=media' , 'modules/gallery' ),
5 => array( '|-- Ãðóïïû' , 'act=gallery&code=groups' , 'modules/gallery' ),
6 => array( '|-- Ñòàòèñòèêà' , 'act=gallery&code=stats' , 'modules/gallery' ),
7 => array( '|-- Óòèëèòû' , 'act=gallery&code=tools' , 'modules/gallery' ),
8 => array( '&#039;-- Ôîðìà ïóáëèêàöèè' , 'act=gallery&code=postform', 'modules/gallery' ),
2 => array( '|-- Settings' , 'act=op&code=findsetting&key='.urlencode('invisiongallerysettings'), '', 0, 0 ),
3 => array( '|-- Album Manager' , 'act=gallery&code=albums' , 'modules/gallery' ),
4 => array( '|-- Multimedia Manager' , 'act=gallery&code=media' , 'modules/gallery' ),
5 => array( '|-- Groups' , 'act=gallery&code=groups' , 'modules/gallery' ),
6 => array( '|-- Stats' , 'act=gallery&code=stats' , 'modules/gallery' ),
7 => array( '|-- Tools' , 'act=gallery&code=tools' , 'modules/gallery' ),
8 => array( '&#039;-- Post Form' , 'act=gallery&code=postform', 'modules/gallery' ),
),
1450 => array(
1 => array( 'Invision Community Blog' , 'act=blog' ),
2 => array( 'Íàñòðîéêè áëîãîâ' , 'act=op&code=findsetting&key='.urlencode('Íàñòðîéêè áëîãîâ'), '', 0, 1 ),
3 => array( 'Ãðóïïû' , 'act=blog&amp;cmd=groups' ),
4 => array( 'Áëîêè' , 'act=blog&amp;cmd=cblocks' ),
5 => array( 'Óòèëèòû' , 'act=blog&amp;cmd=tools' ),
1 => array( 'Community Blog' , 'act=blog' ),
2 => array( 'Blog Settings' , 'act=op&code=findsetting&key='.urlencode('communityblog'), '', 0, 1 ),
3 => array( 'Groups' , 'act=blog&amp;cmd=groups' ),
4 => array( 'Content Blocks' , 'act=blog&amp;cmd=cblocks' ),
5 => array( 'Tools' , 'act=blog&amp;cmd=tools' ),
),
1500 => array (
1 => array( 'Ñòàòèñòèêà ðåãèñòðàöèé' , 'act=stats&code=reg' ),
2 => array( 'Ñòàòèñòèêà íîâûõ òåì' , 'act=stats&code=topic' ),
3 => array( 'Ñòàòèñòèêà ñîîáùåíèé' , 'act=stats&code=post' ),
4 => array( 'Ñòàòèñòèêà ëè÷íûõ ñîîáùåíèé' , 'act=stats&code=msg' ),
5 => array( 'Ñòàòèñòèêà ïðîñìîòðîâ òåì' , 'act=stats&code=views' ),
1 => array( 'Registration Stats' , 'act=stats&code=reg' ),
2 => array( 'New Topic Stats' , 'act=stats&code=topic' ),
3 => array( 'Post Stats' , 'act=stats&code=post' ),
4 => array( 'Personal Message' , 'act=stats&code=msg' ),
5 => array( 'Topic Views' , 'act=stats&code=views' ),
),
1600 => array (
1 => array( 'SQL Óòèëèòà' , 'act=mysql' ),
2 => array( 'SQL Ðåçåðâíàÿ êîïèÿ (backup)' , 'act=mysql&code=backup' ),
3 => array( 'SQL Èíôîðìàöèÿ', 'act=mysql&code=runtime' ),
4 => array( 'SQL Ñèñòåìíûå ïåðåìåííûå' , 'act=mysql&code=system' ),
5 => array( 'SQL Ïðîöåññû' , 'act=mysql&code=processes' ),
1 => array( 'SQL Toolbox' , 'act=mysql' ),
2 => array( 'SQL Back Up' , 'act=mysql&code=backup' ),
3 => array( 'SQL Runtime Info', 'act=mysql&code=runtime' ),
4 => array( 'SQL System Vars' , 'act=mysql&code=system' ),
5 => array( 'SQL Processes' , 'act=mysql&code=processes' ),
),
1700 => array(
1 => array( 'Äåéñòâèÿ ìîäåðàòîðîâ' , 'act=modlog' ),
2 => array( 'Äåéñòâèÿ àäìèíèñòðàòîðîâ' , 'act=adminlog' ),
3 => array( 'E-mail îòïðàâëåíèÿ' , 'act=emaillog' ),
4 => array( 'Æóðíàë e-mail îøèáîê', 'act=emailerror' ),
5 => array( 'Äåéñòâèÿ ïîèñêîâûõ áîòîâ' , 'act=spiderlog' ),
6 => array( 'Æóðíàë ïðåäóïðåæäåíèé' , 'act=warnlog' ),
1 => array( 'View Moderator Logs' , 'act=modlog' ),
2 => array( 'View Admin Logs' , 'act=adminlog' ),
3 => array( 'View Email Logs' , 'act=emaillog' ),
4 => array( 'View Email Error Logs', 'act=emailerror' ),
5 => array( 'View Bot Logs' , 'act=spiderlog' ),
6 => array( 'View Warn Logs' , 'act=warnlog' ),
),
);
$CATS = array (
100 => array( "Ñèñòåìíûå íàñòðîéêè" , '#caf2d9;margin-bottom:12px;' ),
100 => array( "System Settings" , '#caf2d9;margin-bottom:12px;' ),
200 => array( 'Óïðàâëåíèå ôîðóìàìè' , '#F9FFA2' ),
300 => array( 'Ïîëüçîâàòåëè è ãðóïïû' , '#F9FFA2' ),
/* íå àêòóàëüíî äëÿ Ðîññèè
400 => array( "Ïîäïèñêè" , '#F9FFA2;margin-bottom:12px;' ),
*/
200 => array( 'Forum Control' , '#F9FFA2' ),
300 => array( 'Users and Groups' , '#F9FFA2' ),
400 => array( "Subscriptions" , '#F9FFA2;margin-bottom:12px;' ),
500 => array( "Ïðèêðåïëÿåìûå ôàéëû" , '#f5cdcd' ),
600 => array( "Äîïîëíèòåëüíûå BB-êîäû" , '#f5cdcd' ),
700 => array( "Ñìàéëèêè" , '#f5cdcd' ),
800 => array( "Ôèëüòðû", '#f5cdcd;margin-bottom:12px;' ),
500 => array( "Attachments" , '#f5cdcd' ),
600 => array( "Custom BBCode" , '#f5cdcd' ),
700 => array( "Emoticons" , '#f5cdcd' ),
800 => array( "Word & Ban Filters", '#f5cdcd;margin-bottom:12px;' ),
900 => array( 'Ñòèëè' , '#DFE6EF' ),
1000 => array( 'ßçûêè' , '#DFE6EF;margin-bottom:12px;' ),
900 => array( 'Skins & Templates' , '#DFE6EF' ),
1000 => array( 'Languages' , '#DFE6EF;margin-bottom:12px;' ),
1100 => array( 'Äîïîëíèòåëüíî' , '#caf2d9' ),
1200 => array( 'Ðàáîòà ñ e-mail' , '#caf2d9' ),
1300 => array( 'Ìåíåäæåð çàäà÷' , '#caf2d9;margin-bottom:12px;' ),
1100 => array( 'Maintenance' , '#caf2d9' ),
1200 => array( 'Post Office' , '#caf2d9' ),
1300 => array( 'Task Manager' , '#caf2d9;margin-bottom:12px;' ),
1400 => array( "Invision Gallery" , '#F9FFA2;' ),
1450 => array( "Community Blog" , '#F9FFA2;margin-bottom:12px;' ),
1500 => array( 'Öåíòð ñòàòèñòèêè' , '#f5cdcd' ),
1600 => array( 'Óïðàâëåíèå SQL' , '#f5cdcd' ),
1700 => array( 'Æóðíàëû ôîðóìíûõ îïåðàöèé' , '#f5cdcd' ),
1500 => array( 'Statistic Center' , '#f5cdcd' ),
1600 => array( 'SQL Management' , '#f5cdcd' ),
1700 => array( 'Board Logs' , '#f5cdcd' ),
);
$DESC = array (
100 => "Íàñòðîéêè ôîðóìà, òàêèå êàê íàñòðîéêà cookies, âîçìîæíîñòè ïî áåçîïàñíîñòè, âîçìîæíîñòè ïóáëèêàöèè ñîîáùåíèé è ò.ä.",
100 => "Edit forum settings such as cookie paths, security features, posting abilities, etc",
200 => "Ñîçäàíèå, èçìåíåíèå, óäàëåíèå è ñîðòèðîâêà êàòåãîðèé, ôîðóìîâ è ìîäåðàòîðîâ",
300 => "Óïðàâëåíèå ïîëüçîâàòåëÿìè, ãðóïïàìè è çâàíèÿìè",
/* íå àêòóàëüíî äëÿ Ðîññèè
400 => "Óïðàâëåíèå ïîäïèñêàìè âàøèõ ïîëüçîâàòåëåé",
*/
500 => "Óïðàâëåíèå ïðèêðåïëÿåìûìè ôàéëàìè",
600 => "Óïðàâëåíèå äîïîëíèòåëüíàìè BB-êîäàìè",
700 => "Óïðàâëåíèå ñìàéëèêàìè, ýêñïîðò è èìïîðò ãðóïï ñìàéëèêîâ",
800 => "Óïðàâëåíèå ôèëüòðàìè áàíîâ è íåöåíçóðíûõ ñëîâ",
200 => "Create, edit, remove and re-order categories, forums and moderators",
300 => "Manage members, groups and ranks",
400 => "Manage your members' subscriptions and more",
900 => "Óïðàâëåíèå øàáëîíàìè, ñòèëÿìè, öâåòàìè è èçîáðàæåíèÿìè",
1000 => "Óïðàâëåíèå ÿçûêîâûìè ôàéëàìè",
500 => "Manage your attachments",
600 => "Manage your custom BBCode",
700 => "Manage your emoticons and upload/download emoticon packs",
800 => "Manage your badword and ban filters",
1100 => "Óïðàâëåíèå ðàçäåëàìè ïîìîùè, ôèëüòðàìè íåöåíçóðíûõ ñëîâ è ñìàéëèêàìè",
1200 => "Óïðàâëåíèå e-mail è ðàññûëêàìè",
1300 => "Óïðàâëåíèå çàïëàíèðîâàííûìè çàäà÷àìè",
900 => "Manage templates, skins, colours and images.",
1000 => "Manage language sets",
1400 => "Óïðàâëåíèå âàøåé ãàëåðååé",
1450 => "Óïðàâëåíèå âàøèìè áëîãàìè",
1100 => "Manage Help Files, Bad Word Filters and Emoticons",
1200 => "Manage your email and bulk mail members",
1300 => "Manage your scheduled tasks.",
1500 => "Ïîëó÷åíèå ñòàòèñòèêè ðåãèñòðàöèé è ïóáëèêàöèè ñîîáùåíèé",
1600 => "Óïðàâëåíèå âàøåé áàçîé äàííûõ, ïî÷èíêà, îïòèìèçàöèÿ è ýêñïîðòèðîâàíèå äàííûõ",
1700 => "Ïðîñìîòð æóðíàëà îïåðàöèé àäìèíèñòðàòîðîâ, ìîäåðàòîðîâ è e-mail (òîëüêî ãëàâíûå àäìèíèñòðàòîðû)", );
1400 => "Manage your gallery",
1450 => "Manage your community blog",
1500 => "Get registration and posting statistics",
1600 => "Manage your SQL database; repair, optimize and export data",
1700 => "View admin, moderator and email logs (Root admin only)",
);
?>
+159 -89
View File
@@ -2,28 +2,18 @@
/*
+--------------------------------------------------------------------------
| 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
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2006-02-03 16:54:26 +0000 (Fri, 03 Feb 2006) $
| > $Revision: 137 $
| > $Author: bfarber $
| > $Date: 2006-10-05 17:04:08 +0100 (Thu, 05 Oct 2006) $
| > $Revision: 609 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
| > Admin HTML stuff library
@@ -34,6 +24,11 @@
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_ACP' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}
class admin_skin
{
@@ -51,7 +46,7 @@ class admin_skin
function init_admin_skin()
{
$this->base_url = $this->ipsclass->base_url;
$this->img_url = $this->ipsclass->skin_url;
$this->img_url = $this->ipsclass->skin_acp_url;
}
/*-------------------------------------------------------------------------*/
@@ -60,7 +55,7 @@ class admin_skin
function print_top($title="",$desc="")
{
return $this->ipsclass->skin_global_acp->global_header( $title, $desc );
return $this->ipsclass->skin_acp_global->global_header( $title, $desc );
}
/*-------------------------------------------------------------------------*/
@@ -69,7 +64,7 @@ class admin_skin
function wrap_nav($links)
{
return $this->ipsclass->skin_global_acp->global_wrap_nav( $links );
return $this->ipsclass->skin_acp_global->global_wrap_nav( $links );
}
/*-------------------------------------------------------------------------*/
@@ -78,7 +73,7 @@ class admin_skin
function print_foot()
{
return $this->ipsclass->skin_global_acp->global_footer( date("Y") );
return $this->ipsclass->skin_acp_global->global_footer( date("Y") );
}
/*-------------------------------------------------------------------------*/
@@ -87,7 +82,7 @@ class admin_skin
function menu_top()
{
return $this->ipsclass->skin_global_acp->global_menu_header();
return $this->ipsclass->skin_acp_global->global_menu_header();
}
/*-------------------------------------------------------------------------*/
@@ -96,7 +91,7 @@ class admin_skin
function menu_foot()
{
return $this->ipsclass->skin_global_acp->global_menu_footer();
return $this->ipsclass->skin_acp_global->global_menu_footer();
}
/*-------------------------------------------------------------------------*/
@@ -113,7 +108,7 @@ class admin_skin
if ( $this->ipsclass->input['act'] != 'idx' )
{
$extra_query = str_replace( '&amp;', '&', $this->ipsclass->parse_clean_value($_SERVER['QUERY_STRING']) );
$extra_query = str_replace( '&amp;', '&', $this->ipsclass->parse_clean_value($this->ipsclass->my_getenv('QUERY_STRING')) );
$extra_query = str_replace( "{$this->ipsclass->vars['board_url']}" , "" , $extra_query );
$extra_query = preg_replace( "!/?admin\.{$this->ipsclass->vars['php_ext']}!i", "" , $extra_query );
$extra_query = preg_replace( "!^\?!" , "" , $extra_query );
@@ -122,52 +117,9 @@ class admin_skin
$extra_query = preg_replace( "!s=(\w){32}!" , "" , $extra_query );
}
return $this->ipsclass->skin_global_acp->global_frame_set( $extra_query );
return $this->ipsclass->skin_acp_global->global_frame_set( $extra_query );
}
/*-------------------------------------------------------------------------*/
// Print the global menu cat wrap
/*-------------------------------------------------------------------------*/
function menu_cat_wrap($show, $name="", $links="", $id = "", $desc, $color='#FFF', $extra='')
{
return $this->ipsclass->skin_global_acp->global_menu_cat_wrap($show, $name, $links, $id, $desc, $color, $extra);
}
/*-------------------------------------------------------------------------*/
// Print the global menu cat link
/*-------------------------------------------------------------------------*/
function menu_cat_link($pid, $cid, $url="", $name="", $urltype=0, $isredirect=0, $no_access=0)
{
if ( $urltype == 1 )
{
$theurl = $this->ipsclass->vars['board_url'].'/index.'.$this->ipsclass->vars['php_ext'].'?';
}
else
{
$theurl = $this->ipsclass->base_url;
}
if ( $isredirect )
{
$icon = "<img src='{$this->ipsclass->skin_url}/images/menu_shortcut.gif' border='0' alt='' valign='absmiddle' />";
$extra_css = ';font-style:italic';
}
else
{
$icon = "<img src='{$this->ipsclass->skin_url}/images/item.gif' border='0' alt='' valign='absmiddle' />";
$extra_css = "";
}
if ( $no_access )
{
$extra_css .= ";color:#777";
}
return $this->ipsclass->skin_global_acp->global_menu_cat_link( $cid, $pid, $icon, $extra_css, $name, $url, $theurl );
}
/*-------------------------------------------------------------------------*/
// JS Make button
/*-------------------------------------------------------------------------*/
@@ -181,9 +133,9 @@ class admin_skin
// JS Help Link
/*-------------------------------------------------------------------------*/
function js_help_link($help="", $text="Áûñòðàÿ ïîìîùü")
function js_help_link($help="", $text="Quick Help")
{
return "( <a href='#' onClick=\"window.open('{$this->ipsclass->base_url}&act=quickhelp&id=$help','Ïîìîùü','width=250,height=400,resizable=yes,scrollbars=yes'); return false;\">$text</a> )";
return "( <a href='#' onClick=\"window.open('{$this->ipsclass->base_url}&act=quickhelp&id=$help','Help','width=250,height=400,resizable=yes,scrollbars=yes'); return false;\">$text</a> )";
}
/*-------------------------------------------------------------------------*/
@@ -207,7 +159,7 @@ class admin_skin
function make_page_jump($tp="", $pp="", $ub="" )
{
return "<a href='#' title=\"Ïåðåéòè ê ñòðàíèöå...\" onclick=\"multi_page_jump('$ub',$tp,$pp);\">Pages:</a>";
return "<a href='#' title=\"Jump to a page...\" onclick=\"multi_page_jump('$ub',$tp,$pp);\">Pages:</a>";
}
/*-------------------------------------------------------------------------*/
@@ -225,12 +177,18 @@ class admin_skin
if (is_array($hiddens))
{
foreach ($hiddens as $k => $v)
foreach ($hiddens as $v)
{
$form .= "\n<input type='hidden' name='{$v[0]}' value='{$v[1]}'>";
$form .= "\n<input type='hidden' name='{$v[0]}' value='{$v[1]}' />";
}
}
//-----------------------------------------
// Add in auth key
//-----------------------------------------
$form .= "\n<input type='hidden' name='_admin_auth_key' value='".$this->ipsclass->_admin_auth_key."' />";
return $form;
}
@@ -242,7 +200,7 @@ class admin_skin
{
if (is_array($hiddens))
{
foreach ($hiddens as $k => $v)
foreach ($hiddens as $v)
{
$form .= "\n<input type='hidden' name='{$v[0]}' value='{$v[1]}'>";
}
@@ -266,7 +224,7 @@ class admin_skin
$colspan = " colspan='".$this->td_colspan."' ";
}
$html .= "<tr><td align='center' class='pformstrip'".$colspan."><input type='submit' value='$text'".$js." id='button' accesskey='s'>{$extra}</td></tr>\n";
$html .= "<tr><td align='center' class='tablesubheader'".$colspan."><input type='submit' value='$text'".$js." class='realbutton' accesskey='s'>{$extra}</td></tr>\n";
}
$html .= "</form>";
@@ -283,7 +241,7 @@ class admin_skin
if ($text != "")
{
$html .= "<div class='tableborder'><div align='center' class='pformstrip'><input type='submit' value='$text'".$js." id='button' accesskey='s'></div></div>\n";
$html .= "<div class='tableborder'><div align='center' class='tablesubheader'><input type='submit' value='$text'".$js." class='realbutton' accesskey='s'></div></div>\n";
}
$html .= "</form>";
@@ -358,7 +316,7 @@ class admin_skin
$html = "<select name='$name'".$js." $css class='dropdown'>\n";
foreach ($list as $k => $v)
foreach ($list as $v)
{
$selected = "";
@@ -388,7 +346,7 @@ class admin_skin
//$html = "<select name='$name".'[]'."'".$js." id='dropdown' multiple='multiple' size='$size'>\n";
$html = "<select name='$name"."'".$js." class='dropdown' multiple='multiple' size='$size'>\n";
foreach ($list as $k => $v)
foreach ($list as $v)
{
$selected = "";
@@ -418,29 +376,29 @@ class admin_skin
$y_js = "";
$n_js = "";
if ( $js['yes'] != "" )
if ( isset($js['yes']) AND $js['yes'] != "" )
{
$y_js = $js['yes'];
}
if ( $js['no'] != "" )
if ( isset($js['no']) ANd $js['no'] != "" )
{
$n_js = $js['no'];
}
$yes = "Äà &nbsp; <input type='radio' name='$name' value='1' $y_js id='green'>";
$no = "<input type='radio' name='$name' value='0' $n_js id='red'> &nbsp; Íåò";
$yes = "Yes &nbsp; <input type='radio' name='$name' value='1' $y_js id='green'>";
$no = "<input type='radio' name='$name' value='0' $n_js id='red'> &nbsp; No";
if ($default_val == 1)
{
$yes = "Äà &nbsp; <input type='radio' name='$name' value='1'$y_js checked id='green'>";
$yes = "Yes &nbsp; <input type='radio' name='$name' value='1'$y_js checked id='green'>";
}
else
{
$no = "<input type='radio' name='$name' value='0' checked $n_js id='red'> &nbsp; Íåò";
$no = "<input type='radio' name='$name' value='0' checked $n_js id='red'> &nbsp; No";
}
@@ -472,6 +430,8 @@ class admin_skin
}
}
//-----------------------------------------
//--------------------------------------------------------------------
// SCREEN ELEMENTS
@@ -493,15 +453,17 @@ class admin_skin
function start_table( $title="", $desc="") {
$html = "";
if ($title != "")
{
$this->has_title = 1;
$html .= "<div class='tableborder'>
<div class='maintitle'>$title</div>\n";
<div class='tableheaderalt'>$title</div>\n";
if ( $desc != "" )
{
$html .= "<div class='pformstrip'>$desc</div>\n";
$html .= "<div class='tablesubheader'>$desc</div>\n";
}
}
@@ -516,6 +478,9 @@ class admin_skin
// Auto remove two &nbsp; only headers..
$this->td_header[1][0] = ( isset($this->td_header[1][0]) AND $this->td_header[1][0] ) ? $this->td_header[1][0] : '';
$this->td_header[1][1] = ( isset($this->td_header[1][1]) AND $this->td_header[1][1] ) ? $this->td_header[1][1] : '';
if ( $this->td_header[0][0] == '&nbsp;' && $this->td_header[1][0] == '&nbsp;' && ( ! isset( $this->td_header[2][0] ) ) )
{
$this->td_header[0][0] = '{none}';
@@ -535,7 +500,7 @@ class admin_skin
if ($td[0] != '{none}')
{
$html .= "<td class='titlemedium'".$width."align='center'>{$td[0]}</td>\n";
$html .= "<td class='tablesubheader'".$width."align='center'>{$td[0]}</td>\n";
}
$this->td_colspan++;
@@ -550,7 +515,7 @@ class admin_skin
//-----------------------------------------
function add_standalone_row($text = "", $align='center', $class='pformstrip')
function add_standalone_row($text = "", $align='center', $class='tablesubheader')
{
return "<div class='tableborder'><div align='{$align}' class='{$class}'>{$text}</div></div>\n";
}
@@ -570,7 +535,7 @@ class admin_skin
for ($i = 0; $i < $count ; $i++ )
{
$td_col = $i % 2 ? 'tdrow2' : 'tdrow1';
$td_col = $i % 2 ? 'tablerow2' : 'tablerow1';
if ($css != "")
{
@@ -587,7 +552,7 @@ class admin_skin
}
else
{
if ($this->td_header[$i][1] != "")
if (isset($this->td_header[$i][1]) AND $this->td_header[$i][1] != "")
{
$width = " width='{$this->td_header[$i][1]}' ";
}
@@ -609,7 +574,7 @@ class admin_skin
//-----------------------------------------
function add_td_basic($text="",$align="left",$id="tdrow1", $colspanint=0) {
function add_td_basic($text="",$align="left",$id="tablerow1", $colspanint=0) {
$html = "";
$colspan = "";
@@ -682,6 +647,111 @@ class admin_skin
<div class='tablepad' align='center'>".$this->ipsclass->admin->skin_jump_menu()."</div></div></div>";
}
/*-------------------------------------------------------------------------*/
// Build up page span links
/*-------------------------------------------------------------------------*/
/**
* Build up page span links
*
* @param array Page data
* @return string Parsed page links HTML
* @since 2.0
*/
function build_pagelinks($data)
{
$work = array( 'page_span' => NULL, 'st_dots' => NULL, 'pages' => 0 );
$section = (!isset($data['leave_out']) OR $data['leave_out'] == "") ? 2 : $data['leave_out']; // Number of pages to show per section( either side of current), IE: 1 ... 4 5 [6] 7 8 ... 10
$use_st = (!isset($data['USE_ST']) OR $data['USE_ST'] == "") ? 'st' : $data['USE_ST'];
//-----------------------------------------
// Get the number of pages
//-----------------------------------------
if ( $data['TOTAL_POSS'] > 0 )
{
$work['pages'] = ceil( $data['TOTAL_POSS'] / $data['PER_PAGE'] );
}
$work['pages'] = $work['pages'] ? $work['pages'] : 1;
//-----------------------------------------
// Set up
//-----------------------------------------
$work['total_page'] = $work['pages'];
$work['current_page'] = $data['CUR_ST_VAL'] > 0 ? ($data['CUR_ST_VAL'] / $data['PER_PAGE']) + 1 : 1;
//-----------------------------------------
// Next / Previous page linkie poos
//-----------------------------------------
$previous_link = "";
$next_link = "";
if ( $work['current_page'] > 1 )
{
$start = $data['CUR_ST_VAL'] - $data['PER_PAGE'];
$previous_link = $this->ipsclass->skin_acp_global->pagination_previous_link("{$data['BASE_URL']}&amp;$use_st=$start");
}
if ( $work['current_page'] < $work['pages'] )
{
$start = $data['CUR_ST_VAL'] + $data['PER_PAGE'];
$next_link = $this->ipsclass->skin_acp_global->pagination_next_link("{$data['BASE_URL']}&amp;$use_st=$start");
}
//-----------------------------------------
// Loppy loo
//-----------------------------------------
if ($work['pages'] > 1)
{
$work['first_page'] = $this->ipsclass->skin_acp_global->pagination_make_jump($work['pages']);
for( $i = 0; $i <= $work['pages'] - 1; ++$i )
{
$RealNo = $i * $data['PER_PAGE'];
$PageNo = $i+1;
if ($RealNo == $data['CUR_ST_VAL'])
{
$work['page_span'] .= $this->ipsclass->skin_acp_global->pagination_current_page($PageNo);
}
else
{
if ($PageNo < ($work['current_page'] - $section))
{
$work['st_dots'] = $this->ipsclass->skin_acp_global->pagination_start_dots($data['BASE_URL']);
continue;
}
// If the next page is out of our section range, add some dotty dots!
if ($PageNo > ($work['current_page'] + $section))
{
$work['end_dots'] = $this->ipsclass->skin_acp_global->pagination_end_dots("{$data['BASE_URL']}&amp;$use_st=".($work['pages']-1) * $data['PER_PAGE']);
break;
}
$work['page_span'] .= $this->ipsclass->skin_acp_global->pagination_page_link("{$data['BASE_URL']}&amp;$use_st={$RealNo}",$PageNo);
}
}
$work['return'] = $this->ipsclass->skin_acp_global->pagination_compile($work['first_page'],$previous_link,$work['st_dots'],$work['page_span'],$work['end_dots'],$next_link,$data['TOTAL_POSS'],$data['PER_PAGE'], $data['BASE_URL']);
}
else
{
$work['return'] = $data['L_SINGLE'];
}
return $work['return'];
}
}
+82 -73
View File
@@ -2,27 +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
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $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 $
+---------------------------------------------------------------------------
|
@@ -34,6 +24,11 @@
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_ACP' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}
class admin_template_functions
{
@@ -45,6 +40,7 @@ class admin_template_functions
var $menu_widthchange = "";
var $menu_highchange = "";
var $default_css = "";
var $type = "";
//-----------------------------------------
// Constructor
@@ -72,11 +68,11 @@ class admin_template_functions
//-->
</script>
<div class='tableborder'>
<div class='titlemedium'>
<div class='tablesubheader'>
<table width='100%' cellpadding='0' cellspacing='0' border='0'>
<tr>
<td width='1%' align='left' valign='middle'>
<input type='button' value='Ïëàâàþùåå îêíî' class='realdarkbutton' title='Îòêðûòü ðåäàêòèðîâàíèå ýòîãî øàáëîíà â áîëüøîì îêíå' onclick=\"pop_win('section={$data['section']}&act={$data['act']}&code=floateditor&id={$data['textareaname']}', 'Float', 800, 400)\">&nbsp;
<input type='button' value='Float' class='realdarkbutton' title='Open this template editor in a large window' onclick=\"pop_win('section={$data['section']}&act={$data['act']}&code=floateditor&id={$data['textareaname']}', 'Float', 800, 400)\">&nbsp;
</td>
<td width='95%' align='left' valign='middle'>&nbsp;<b>{$data['title']}</b></td>
<td width='5% align='right' valign='middle' nowrap='nowrap' ><!--TOP.RIGHT--></td>
@@ -85,7 +81,7 @@ class admin_template_functions
</table>
</div>";
$return .= "<div align='center' style='padding:2px;'>".$this->ipsclass->adskin->form_textarea("txt{$data['textareaname']}", $data['textareainput'], $this->ipsclass->vars['tx'], $this->ipsclass->vars['ty'], 'none', "txt{$data['textareaname']}", $this->default_css )."</div>\n";
$return .= "<div align='center' style='padding:2px;'>".$this->ipsclass->adskin->form_textarea("txt{$data['textareaname']}", $data['textareainput'], '', '', 'none', "txt{$data['textareaname']}", $this->default_css )."</div>\n";
$return .= $this->html_build_editor_bottom() . "</div>";
@@ -110,10 +106,10 @@ class admin_template_functions
<table cellspacing='0' width='500' align='center' cellpadding='6' style='background:#EEE;border:2px outset #555;'>
<tr>
<td align='center' valign='top'>
<b>Ðàñøèðåííûé ðåæèì: Ïåðåìåííûå øàáëîíà</b><br />Îñòàâüòå êàê åñòü, åñëè âû íå çíàåòå, êàê ýòî ðàáîòàåò.<br />Èñïîëüçóéòå çàïÿòóþ äëÿ ðàçäåëåíèÿ íåñêîëüêèõ ïåðåìåííûõ.
<b>Advanced: Template Bit Incoming Variables</b><br />Leave alone if unsure. Separate many with a comma.
<br /><input class='textinput' name='funcdata_{$template['suid']}' value='{$template['func_data']}' type='text' size='50' />
<br /><br />
<input type='button' class='realdarkbutton' value='Ñîõðàíèòü è Çàêðûòü' onclick=\"togglediv('dv_{$template['suid']}');\" />
<input type='button' class='realdarkbutton' value='Save and Close' onclick=\"togglediv('dv_{$template['suid']}');\" />
</td>
</tr>
</table>
@@ -121,7 +117,7 @@ class admin_template_functions
$return .= <<<EOF
<div class='tableborder'>
<div class='titlemedium'>
<div class='tablesubheader'>
<table width='100%' cellpadding='0' cellspacing='0' border='0'>
<tr>
<td width='1%' align='left' valign='middle'>{$close_box}</td>
@@ -131,9 +127,9 @@ class admin_template_functions
<td width='75%' align='left' valign='middle'>&nbsp;{$img}<b>{$template['easy_name']}</b></td>
<td width='5% align='right' nowrap='nowrap' valign='middle'>
<input type='hidden' id='edited-{$template['suid']}' name='edited-{$template['suid']}' value='0' />
<input type='submit' name='submit-{$template['suid']}' value='Ñîõðàíèòü øàáëîí' id='sb-t{$template['suid']}' class='realdarkbutton' />
<input type='button' value='Ïëàâàþùåå îêíî' class='realbutton' title='Îòêðûòü ðåäàêòèðîâàíèå ýòîãî øàáëîíà â ïëàâàþùåì îêíå' onclick="pop_win('section=lookandfeel&act=templ&code=floateditor&id={$template['suid']}', 'Ïëàâàþùåå îêíî {$template['suid']}', 800, 400)">
<img id="tmpl-{$template['suid']}" src='{$this->ipsclass->skin_url}/images/filebrowser_action.gif' border='0' alt='Îïöèè' class='ipd' />
<input type='submit' name='submit-{$template['suid']}' value='Save Template Bit' id='sb-t{$template['suid']}' class='realdarkbutton' />
<input type='button' value='Float' class='realbutton' title='Open this template editor in a large window' onclick="pop_win('section=lookandfeel&act=templ&code=floateditor&id={$template['suid']}', 'Float{$template['suid']}', 800, 400)">
<img id="tmpl-{$template['suid']}" src='{$this->ipsclass->skin_acp_url}/images/filebrowser_action.gif' border='0' alt='Options' class='ipd' />
&nbsp;
</td>
</tr>
@@ -151,16 +147,16 @@ EOF;
menu_build_menu(
"tmpl-{$template['suid']}",
new Array(
img_item + " <a href='#' onclick=\"menu_action_close(); toggleview('dv_{$template['suid']}')\"; return false;'>Ðåäàêòèðîâàíèå âõîäÿùèõ ïåðåìåííûõ...</a>",
img_item + " <a href='#' onclick='menu_action_close(); pop_win(\"act=rtempl&code=macro_one&suid={$template['suid']}\", \"MacroWindow\", 400, 200); return false;'>Ïðîâåðêà ìàêðîñîâ...</a>",
img_item + " <a href='#' onclick='menu_action_close(); pop_win(\"act=rtempl&code=compare&suid={$template['suid']}\", \"CompareWindow\", 500,400); return false;'>Ñðàâíèòü âåðñèè...</a>",
img_item + " <a href='#' onclick='menu_action_close(); parent.template_bit_restore(\"{$template['suid']}\"); return false;'>Îáðàòèòü âñå èçìåíåíèÿ...</a>",
img_item + " <a href='#' onclick='menu_action_close(); pop_win(\"act=rtempl&code=preview&suid={$template['suid']}&type=html\", \"OriginalPreview\", 400,400); return false;'>Ïðîñìîòð îðèãèíàëà...</a>"
img_item + " <a href='#' onclick=\"menu_action_close(); toggleview('dv_{$template['suid']}')\"; return false;'>Edit Data Variables...</a>",
img_item + " <a href='#' onclick='menu_action_close(); pop_win(\"act=rtempl&code=macro_one&suid={$template['suid']}\", \"MacroWindow\", 400, 200); return false;'>Macro Look-up...</a>",
img_item + " <a href='#' onclick='menu_action_close(); pop_win(\"act=rtempl&code=compare&suid={$template['suid']}\", \"CompareWindow\", 500,400); return false;'>Compare Versions...</a>",
img_item + " <a href='#' onclick='menu_action_close(); parent.template_bit_restore(\"{$template['suid']}\"); return false;'>Restore Unedited Version...</a>",
img_item + " <a href='#' onclick='menu_action_close(); pop_win(\"act=rtempl&code=preview&suid={$template['suid']}&type=html\", \"OriginalPreview\", 400,400); return false;'>View Original Version...</a>"
) );
</script>
EOF;
$return .= "<div align='center' style='padding:2px;'>".$this->ipsclass->adskin->form_textarea("txt{$template['suid']}", $html, $this->ipsclass->vars['tx'], $this->ipsclass->vars['ty'], 'none', "t{$template['suid']}", $this->default_css, 'onkeypress="parent.template_bit_changed(\'t'.$template['suid'].'\')"' )."</div>\n";
$return .= "<div align='center' style='padding:2px;'>".$this->ipsclass->adskin->form_textarea("txt{$template['suid']}", $html, 60, 5, 'none', "t{$template['suid']}", $this->default_css, 'onkeypress="parent.template_bit_changed(\'t'.$template['suid'].'\')"' )."</div>\n";
$return .= "</div>";
@@ -179,16 +175,16 @@ EOF;
$return .= $this->html_build_editor_top();
$return .= "<div class='tableborder'>
<div class='titlemedium' align='right'>";
<div class='tablesubheader' align='right'>";
if ( $no_buttons == 0 )
{
$return .= "
<input type='button' value='Ïîèñê' class='realbutton' title='Ïîèñê ïî øàáëîíó' onClick='pop_win(\"act=rtempl&code=search&suid={$template['suid']}&type=html\", \"Search\", 500,400)'>
<input type='button' value='Ìàêðîñû' class='realbutton' title='Ïðîâåðêà ìàêðîñîâ ïî ââåäåííîé çàïèñè' onClick='pop_win(\"code=macro_one&suid={$template['suid']}\", \"MacroWindow\", 400, 200)'>
<input type='button' value='Ñðàâíèòü' class='realbutton' title='Ñðàâíèòü èçìåíåííûé âàìè âàðèàíò øàáëîíà ñ ïåðâîíà÷àëüíûì îðèãèíàëîì' onClick='pop_win(\"act=rtempl&code=compare&suid={$template['suid']}\", \"CompareWindow\", 500,400)'>
<input type='button' value='Îáðàòèòü' class='realbutton' title='Îáðàòèòü âñå èçìåíåíèÿ øàáëîíà, òî åñòü ïðèâåñòè åãî ê ïåðâîíà÷àëüíîìó ñòàíäàðòíîìó âèäó' onClick='restore(\"{$template['suid']}\",\"{$this->ipsclass->input['expand']}\")'>
<input type='button' value='Îðèãèíàë' class='realbutton' title='Ïðîñìîòð îðèãèíàëüíîãî ïåðâîíà÷àëüíîãî âàðèàíòà øàáëîíà' onClick='pop_win(\"act=rtempl&code=preview&suid={$template['suid']}&type=html\", \"OriginalPreview\", 400,400)'>
<input type='button' value='Search' class='realbutton' title='Search the templates for a string' onClick='pop_win(\"act=rtempl&code=search&set_id={$this->ipsclass->input['id']}&type=html\", \"Search\", 900,600)'>
<input type='button' value='Macro Look-up' class='realbutton' title='View a macro definition' onClick='pop_win(\"act=rtempl&code=macro_one&suid={$this->ipsclass->input['id']}\", \"MacroWindow\", 400, 200)'>
<input type='button' value='Compare' class='realbutton' title='Compare the edited version to the original' onClick='pop_win(\"act=rtempl&code=compare&suid={$this->ipsclass->input['id']}&pop=1\", \"CompareWindow\", 500,400)'>
<input type='button' value='Restore' class='realbutton' title='Restore the original, unedited template bit' onClick='template_bit_restore(); return false;'>
<input type='button' value='View Original' class='realbutton' title='View the HTML for the unedited template bit' onClick='pop_win(\"act=rtempl&code=preview&suid={$this->ipsclass->input['id']}&type=html\", \"OriginalPreview\", 400,400)'>
";
}
@@ -209,12 +205,25 @@ EOF;
eval(\"opener.document.theform.txt\"+template_id+\".value = document.theform.templatebit.value\");
window.close();
}
function template_bit_restore( )
{
var edit_box_obj = document.theform.templatebit;
if ( template_bit )
{
if ( confirm(\"Are you sure you want to restore the template?\\nALL UNSAVED CHANGES WILL BE LOST!\") )
{
edit_box_obj.value = template_bit;
}
}
}
</script>
";
$return .= $this->html_build_editor_bottom();
$return .= "<br /><div class='tableborder'><div class='catrow2' align='center' style='padding:4px;'><input type='button' onclick='saveandclose()' value='Ñêîïèðîâàòü íàçàä â ñòàíäàðòíîå ïîëå è çàêðûòü îêíî' class='realdarkbutton' /></div></div></form>";
$return .= "<br /><div class='tableborder'><div class='catrow2' align='center' style='padding:4px;'><input type='button' onclick='saveandclose()' value='Copy back to original textarea and close window' class='realdarkbutton' /></div></div></form>";
$this->ipsclass->html = $return;
@@ -236,28 +245,28 @@ EOF;
"</select>";
$this->menu_sizechange = "<select name='sizechange' class='smalldropdown'>".
"<option value='8pt'>8 ïóíêòîâ</option>".
"<option value='9pt'>9 ïóíêòîâ</option>".
"<option value='10pt'>10 ïóíêòîâ</option>".
"<option value='11pt'>11 ïóíêòîâ</option>".
"<option value='12pt'>12 ïóíêòîâ</option>".
"<option value='8pt'>8pt</option>".
"<option value='9pt'>9pt</option>".
"<option value='10pt'>10pt</option>".
"<option value='11pt'>11pt</option>".
"<option value='12pt'>12pt</option>".
"</select>";
$this->menu_backchange = "<select name='backchange' class='smalldropdown'>".
"<option value='black'>×åðíûé</option>".
"<option value='white'>Áåëûé</option>".
"<option value='#EEEEEE'>Ñâåòëîñåðûé</option>".
"<option value='gray'>Ñåðûé</option>".
"<option value='black'>Black</option>".
"<option value='white'>White</option>".
"<option value='#EEEEEE'>Light Gray</option>".
"<option value='gray'>Gray</option>".
"</select>";
$this->menu_fontcolor = "<select name='fontcolor' class='smalldropdown'>".
"<option value='black'>×åðíûé</option>".
"<option value='white'>Áåëûé</option>".
"<option value='blue'>Ñèíèé</option>".
"<option value='lightgreen'>Ñâåòëîçåëåíûé</option>".
"<option value='green'>Çåëåíûé</option>".
"<option value='darkgreen'>Òåìíîçåëåíûé</option>".
"<option value='gray'>Ñåðûé</option>".
"<option value='black'>Black</option>".
"<option value='white'>White</option>".
"<option value='blue'>Blue</option>".
"<option value='lightgreen'>Light Green</option>".
"<option value='green'>Green</option>".
"<option value='darkgreen'>Dark Green</option>".
"<option value='gray'>Gray</option>".
"</select>";
$this->menu_widthchange = "<select name='widthchange' class='smalldropdown'>".
@@ -276,22 +285,22 @@ EOF;
if ( $this->type != 'single' AND $this->type != 'multiple' )
{
$this->menu_highchange = "<select name='highchange' class='smalldropdown'>".
"<option value='50px'>50 ïèêñåëåé</option>".
"<option value='100px'>100 ïèêñåëåé</option>".
"<option value='200px'>200 ïèêñåëåé</option>".
"<option value='300px'>300 ïèêñåëåé</option>".
"<option value='400px'>400 ïèêñåëåé</option>".
"<option value='500px'>500 ïèêñåëåé</option>".
"<option value='600px'>600 ïèêñåëåé</option>".
"<option value='700px'>700 ïèêñåëåé</option>".
"<option value='800px'>800 ïèêñåëåé</option>".
"<option value='900px'>900 ïèêñåëåé</option>".
"<option value='1000px'>1000 ïèêñåëåé</option>".
"<option value='50px'>50px</option>".
"<option value='100px'>100px</option>".
"<option value='200px'>200px</option>".
"<option value='300px'>300px</option>".
"<option value='400px'>400px</option>".
"<option value='500px'>500px</option>".
"<option value='600px'>600px</option>".
"<option value='700px'>700px</option>".
"<option value='800px'>800px</option>".
"<option value='900px'>900px</option>".
"<option value='1000px'>1000px</option>".
"</select>";
}
else
{
$this->menu_highchange = "<select name='highchange' class='smalldropdown' style='color:gray'><option value='-'>Íåäîñòóïíî</option></span>";
$this->menu_highchange = "<select name='highchange' class='smalldropdown' style='color:gray'><option value='-'>N/A</option></span>";
}
if ( $cookie = $this->ipsclass->my_getcookie( 'acpeditorprefs' ) )
@@ -335,7 +344,7 @@ EOF;
$this->menu_highchange = preg_replace( "/(option value='".preg_quote($height)."')/" , "\\1 selected='selected'", $this->menu_highchange );
$this->editor_prefs_dropdown = "<div class='fauxbutton' style='padding:4px;color:black;white-space:nowrap;font-weight:bold;float:left' id='tmpl-editor-prefs'>Íàñòðîéêè ðåäàêòîðà <img src='{$this->ipsclass->skin_url}/images/icon_open.gif' border='0' style='vertical-align:top' /></div>";
$this->editor_prefs_dropdown = "<div class='fauxbutton' style='padding:4px;color:black;white-space:nowrap;font-weight:bold;float:left' id='tmpl-editor-prefs'>Editor Preferences <img src='{$this->ipsclass->skin_acp_url}/images/icon_open.gif' border='0' style='vertical-align:top' /></div>";
}
@@ -353,7 +362,7 @@ EOF;
return <<<EOF
<div class='tableborder'>
<div class='maintitle' align='left' style='height:30px'>
<div class='tableheaderalt' align='left' style='height:30px'>
<div style='float:right'>{$close_box} <!--TOPRIGHT--></div>
<div>{$this->editor_prefs_dropdown}</div>
@@ -370,32 +379,32 @@ EOF;
'tmpl-editor-prefs',
new Array( "<table cellpadding='4' cellspacing='0' width='200' border='0'>"+
"<tr>"+
"<td nowrap='nowrap'>Øðèôò</td>"+
"<td nowrap='nowrap'>Font Family</td>"+
"<td width='100%'>{$this->menu_fontchange}</td>"+
"</tr>"+
"<tr>"+
"<td nowrap='nowrap'>Ðàçìåð øðèôòà</td>"+
"<td nowrap='nowrap'>Font Size</td>"+
"<td width='100%'>{$this->menu_sizechange}</td>"+
"</tr>"+
"<tr>"+
"<td nowrap='nowrap'>Öâåò øðèôòà</td>"+
"<td nowrap='nowrap'>Font Color</td>"+
"<td width='100%'>{$this->menu_fontcolor}</td>"+
"</tr>"+
"<tr>"+
"<td nowrap='nowrap'>Ôîí</td>"+
"<td nowrap='nowrap'>Background</td>"+
"<td width='100%'>{$this->menu_backchange}</td>"+
"</tr>"+
"<tr>"+
"<td nowrap='nowrap'>Øèðèíà ðåäàêòîðà</td>"+
"<td nowrap='nowrap'>Area Width</td>"+
"<td width='100%'>{$this->menu_widthchange}</td>"+
"</tr>"+
"<tr>"+
"<td nowrap='nowrap'>Âûñîòà ðåäàêòîðà</td>"+
"<td nowrap='nowrap'>Area Height</td>"+
"<td width='100%'>{$this->menu_highchange}</td>"+
"</tr>"+
"<tr>"+
"<td colspan='2' align='center'>"+
"<input type='button' value='Èçìåíèòü!' class='realbutton' onclick=\"menu_action_close(); changefont();\" />"+
"<input type='button' value='Change' class='realbutton' onclick=\"menu_action_close(); changefont();\" />"+
"</td>"+
"</tr>"+
"</table>"
+110 -40
View File
@@ -2,28 +2,18 @@
/*
+--------------------------------------------------------------------------
| 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
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2006-01-30 18:53:19 +0000 (Mon, 30 Jan 2006) $
| > $Revision: 127 $
| > $Author: bfarber $
| > $Date: 2006-09-22 11:28:54 +0100 (Fri, 22 Sep 2006) $
| > $Revision: 567 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
| > Board index functions module
@@ -37,7 +27,7 @@
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
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();
}
@@ -101,7 +91,8 @@ class func_boardstats
if ( $this->ipsclass->member['id'] )
{
$rows = array( $ar_time => array( 'login_type' => substr($this->ipsclass->member['login_anonymous'],0, 1),
$rows = array( $ar_time.'.'.md5(microtime()) => array( 'id' => 0,
'login_type' => substr($this->ipsclass->member['login_anonymous'],0, 1),
'running_time' => $ar_time,
'member_id' => $this->ipsclass->member['id'],
'member_name' => $this->ipsclass->member['members_display_name'],
@@ -128,6 +119,20 @@ class func_boardstats
krsort( $rows );
//-----------------------------------------
// Is this a root admin in disguise?
// Is that kinda like a diamond in the rough?
//-----------------------------------------
$our_mgroups = array();
if( isset($this->ipsclass->member['mgroup_others']) AND $this->ipsclass->member['mgroup_others'] )
{
$our_mgroups = explode( ",", $this->ipsclass->clean_perm_string( $this->ipsclass->member['mgroup_others'] ) );
}
$our_mgroups[] = $this->ipsclass->member['mgroup'];
//-----------------------------------------
// cache all printed members so we
// don't double print them
@@ -155,7 +160,7 @@ class func_boardstats
{
if ( $this->ipsclass->vars['spider_anon'] )
{
if ( $this->ipsclass->member['mgroup'] == $this->ipsclass->vars['admin_group'] )
if ( in_array( $this->ipsclass->vars['admin_group'], $our_mgroups ) )
{
$active['NAMES'] .= "{$result['member_name']}*{$this->sep_char} \n";
}
@@ -195,15 +200,14 @@ class func_boardstats
if ( empty( $cached[ $result['member_id'] ] ) )
{
$cached[ $result['member_id'] ] = 1;
$result['prefix'] = $this->ipsclass->cache['group_cache'][ $result['member_group'] ]['prefix'];
$result['suffix'] = $this->ipsclass->cache['group_cache'][ $result['member_group'] ]['suffix'];
$result['member_name'] = $this->ipsclass->make_name_formatted( $result['member_name'], $result['member_group'] );
if ($result['login_type'])
{
if ( ($this->ipsclass->member['mgroup'] == $this->ipsclass->vars['admin_group']) and ($this->ipsclass->vars['disable_admin_anon'] != 1) )
if ( (in_array( $this->ipsclass->vars['admin_group'], $our_mgroups )) and ($this->ipsclass->vars['disable_admin_anon'] != 1) )
{
$active['NAMES'] .= "<a href='{$this->ipsclass->base_url}showuser={$result['member_id']}' title='$last_date'>{$result['prefix']}{$result['member_name']}{$result['suffix']}</a>*{$this->sep_char} \n";
$active['NAMES'] .= "<a href='{$this->ipsclass->base_url}showuser={$result['member_id']}' title='$last_date'>{$result['member_name']}</a>*{$this->sep_char} \n";
$active['ANON']++;
}
else
@@ -214,7 +218,7 @@ class func_boardstats
else
{
$active['MEMBERS']++;
$active['NAMES'] .= "<a href='{$this->ipsclass->base_url}showuser={$result['member_id']}' title='$last_date'>{$result['prefix']}{$result['member_name']}{$result['suffix']}</a>{$this->sep_char} \n";
$active['NAMES'] .= "<a href='{$this->ipsclass->base_url}showuser={$result['member_id']}' title='$last_date'>{$result['member_name']}</a>{$this->sep_char} \n";
}
}
}
@@ -250,6 +254,8 @@ class func_boardstats
function show_calendar_events()
{
$stats_html = "";
if ($this->ipsclass->vars['show_birthdays'] or $this->ipsclass->vars['show_calendar'] )
{
$a = explode( ',', gmdate( 'Y,n,j,G,i,s', time() + $this->ipsclass->get_time_offset() ) );
@@ -266,12 +272,19 @@ class func_boardstats
{
if ( is_array($this->ipsclass->cache['birthdays']) AND count( $this->ipsclass->cache['birthdays'] ) )
{
foreach( $this->ipsclass->cache['birthdays'] as $id => $u )
foreach( $this->ipsclass->cache['birthdays'] as $u )
{
if ( $u['bday_day'] == $day and $u['bday_month'] == $month )
{
$users[] = $u;
}
else if( $day == 28 && $month == 2 && !date("L") )
{
if ( $u['bday_day'] == "29" and $u['bday_month'] == $month )
{
$users[] = $u;
}
}
}
}
@@ -279,7 +292,7 @@ class func_boardstats
// Spin and print...
//-----------------------------------------
foreach ( $users as $id => $user )
foreach ( $users as $user )
{
$birthstring .= "<a href='{$this->ipsclass->base_url}showuser={$user['id']}'>{$user['members_display_name']}</a>";
@@ -332,15 +345,36 @@ class func_boardstats
$events = array();
$show_events = array();
$member_permission_groups[] = $this->ipsclass->member['mgroup'];
if( isset($this->ipsclass->member['mgroup_others']) AND $this->ipsclass->member['mgroup_others'] )
{
$this->ipsclass->member['mgroup_others'] = $this->ipsclass->clean_perm_string($this->ipsclass->member['mgroup_others']);
$mgroup_others = explode( ",", $this->ipsclass->member['mgroup_others'] );
if( count($mgroup_others) )
{
foreach( $mgroup_others as $mgroup )
{
if( $mgroup )
{
$member_permission_groups[] = $mgroup;
}
}
}
}
if ( is_array($this->ipsclass->cache['calendar']) AND count( $this->ipsclass->cache['calendar'] ) )
{
foreach( $this->ipsclass->cache['calendar'] as $id => $u )
foreach( $this->ipsclass->cache['calendar'] as $u )
{
$set_offset = 0;
if( $u['event_timeset'] && !($u['event_recurring'] == 0 AND $u['event_unix_to']) )
{
$set_offset = $this->ipsclass->member['time_offset'] * 3600;
$set_offset = isset($this->ipsclass->member['time_offset']) ? $this->ipsclass->member['time_offset'] * 3600 : 0;
}
$u['_unix_from'] = $u['event_unix_from'] - $set_offset;
$u['_unix_to'] = $u['event_unix_to'] - $set_offset;
@@ -357,18 +391,54 @@ class func_boardstats
// Got perms?
//-----------------------------------------
if ( $this->ipsclass->check_perms( $u['event_perms'] ) != TRUE )
if ( $u['event_perms'] != "*" )
{
continue;
$event_perms = explode( ",", $this->ipsclass->clean_perm_string( $u['event_perms'] ) );
$check = 0;
if( count($event_perms) )
{
foreach( $event_perms as $mgroup_perm )
{
if( in_array( $mgroup_perm, $member_permission_groups ) )
{
$check = 1;
}
}
}
if( !$check )
{
continue;
}
}
//-----------------------------------------
// Got calendar perms?
//-----------------------------------------
if ( $this->ipsclass->check_perms( $u['_perm_read'] ) != TRUE )
if ( $u['_perm_read'] != "*" )
{
continue;
$read_perms = explode( ",", $this->ipsclass->clean_perm_string( $u['_perm_read'] ) );
$check = 0;
if( count($read_perms) )
{
foreach( $read_perms as $mgroup_perm )
{
if( in_array( $mgroup_perm, $member_permission_groups ) )
{
$check = 1;
}
}
}
if( !$check )
{
continue;
}
}
//-----------------------------------------
@@ -376,10 +446,10 @@ class func_boardstats
//-----------------------------------------
if ( $u['event_recurring'] == 0 AND ( ( $u['event_unix_from'] >= $our_unix AND $u['event_unix_from'] <= $max_date )
OR ( $u['event_unix_to'] = 0 AND $u['event_unix_from'] >= $our_unix AND $u['event_unix_from'] <= $max_date ) ) )
OR ( $u['event_unix_to'] == 0 AND $u['event_unix_from'] >= $our_unix AND $u['event_unix_from'] <= $max_date ) ) )
{
$u['event_activetime'] = $u['_unix_from'];
$events[$u['event_unix_from'].$u['event_id']] = $u;
$events[ str_pad( $u['event_unix_from'].$u['event_id'], 15, "0" ) ] = $u;
}
elseif( $u['event_recurring'] > 0 )
{
@@ -390,7 +460,7 @@ class func_boardstats
if( $cust_range_s >= $our_unix AND $cust_range_s <= $max_date )
{
$u['event_activetime'] = $cust_range_s;
$events[$cust_range_s.$u['event_id']] = $u;
$events[ str_pad( $cust_range_s.$u['event_id'], 15, "0" ) ] = $u;
}
if( $u['event_recurring'] == "1" )
@@ -416,16 +486,14 @@ class func_boardstats
ksort($events);
foreach( $events as $e => $event )
foreach( $events as $event )
{
//-----------------------------------------
// Recurring?
//-----------------------------------------
$c_time = '';
//if ( ! $event['event_recurring'] )
//{
$c_time = gmdate( 'j-F-y', $event['event_activetime'] );
//}
$c_time = gmdate( 'j-F-y', $event['event_activetime'] );
$show_events[] = "<a href='{$this->ipsclass->base_url}act=calendar&amp;code=showevent&amp;calendar_id={$event['event_calendar_id']}&amp;event_id={$event['event_id']}' title='$c_time'>".$event['event_title']."</a>";
}
@@ -459,6 +527,8 @@ class func_boardstats
function show_totals()
{
$stats_html = "";
if ($this->ipsclass->vars['show_totals'])
{
if ( ! is_array( $this->ipsclass->cache['stats'] ) )
+41 -24
View File
@@ -2,28 +2,18 @@
/*
+--------------------------------------------------------------------------
| 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
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2005-10-24 22:17:00 +0100 (Mon, 24 Oct 2005) $
| > $Revision: 64 $
| > $Author: bfarber $
| > $Date: 2006-09-22 11:28:54 +0100 (Fri, 22 Sep 2006) $
| > $Revision: 567 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
| > IPChat functions
@@ -108,26 +98,53 @@ class func_chat
}
}
//-----------------------------------------
// Is this a root admin in disguise?
// Is that kinda like a diamond in the rough?
//-----------------------------------------
$our_mgroups = array();
if( $this->ipsclass->member['mgroup_others'] )
{
$our_mgroups = explode( ",", $this->ipsclass->clean_perm_string( $this->ipsclass->member['mgroup_others'] ) );
}
$our_mgroups[] = $this->ipsclass->member['mgroup'];
//-----------------------------------------
// Got owt?
//-----------------------------------------
if ( count($to_load) )
{
$this->ipsclass->DB->build_query( array( 'select' => 'id, members_display_name, mgroup',
'from' => 'members',
'where' => "id IN(".implode(",",$to_load).")",
'order' => 'members_display_name' ) );
$this->ipsclass->DB->build_query( array( 'select' => 'm.id, m.members_display_name, m.mgroup',
'from' => array( 'members' => 'm' ),
'where' => "m.id IN(".implode(",",$to_load).")",
'add_join' => array( 0 => array( 'select' => 's.login_type',
'from' => array( 'sessions' => 's' ),
'where' => 's.member_id=m.id',
'type' => 'left' ) ),
'order' => 'm.members_display_name' ) );
$this->ipsclass->DB->exec_query();
while ( $m = $this->ipsclass->DB->fetch_row() )
{
$m['prefix'] = $this->ipsclass->cache['group_cache'][ $m['mgroup'] ]['prefix'];
$m['suffix'] = $this->ipsclass->cache['group_cache'][ $m['mgroup'] ]['suffix'];
$member_ids[] = "<a href=\"{$this->ipsclass->base_url}showuser={$m['id']}\">{$m['prefix']}{$m['members_display_name']}{$m['suffix']}</a>";
$m['members_display_name'] = $this->ipsclass->make_name_formatted( $m['members_display_name'], $m['mgroup'] );
if( $m['login_type'] )
{
if ( (in_array( $this->ipsclass->vars['admin_group'], $our_mgroups )) and ($this->ipsclass->vars['disable_admin_anon'] != 1) )
{
$member_ids[] = "<a href=\"{$this->ipsclass->base_url}showuser={$m['id']}\">{$m['members_display_name']}</a>";
}
}
else
{
$member_ids[] = "<a href=\"{$this->ipsclass->base_url}showuser={$m['id']}\">{$m['members_display_name']}</a>";
}
}
}
}
//-----------------------------------------
// Got owt?
+14 -34
View File
@@ -2,27 +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
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2005-10-10 14:08:54 +0100 (Mon, 10 Oct 2005) $
| > $Revision: 23 $
| > $Date: 2006-10-13 15:14:01 +0100 (Fri, 13 Oct 2006) $
| > $Revision: 641 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
@@ -50,8 +40,6 @@ class chat_functions
function chat_functions()
{
global $DB, $std, $ibforums;
$this->server = str_replace( 'http://', '', $this->ipsclass->vars['chat_server_addr'] );
}
@@ -74,8 +62,6 @@ class chat_functions
function get_online_list()
{
global $DB, $std, $ibforums;
if ( ! $this->ipsclass->vars['chat_who_on'] )
{
return;
@@ -85,9 +71,7 @@ class chat_functions
// Get details from the DB
//-----------------------------------------
$this->ipsclass->DB->query("SELECT * FROM ibf_cache_store WHERE cs_key='chatstat'");
$row = $this->ipsclass->DB->fetch_row();
$row = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*', 'from' => 'cache_store', 'where' => "cs_key='chatstat'" ) );
list( $hits, $time ) = explode( '&', $row['cs_extra'] );
@@ -124,13 +108,17 @@ class chat_functions
if ( count($new) > 0 )
{
$this->ipsclass->DB->query("SELECT m.id, m.name, m.mgroup FROM ibf_members m
WHERE lower(name) IN (\"".$name_string."\") ORDER BY m.name");
$this->ipsclass->DB->build_query( array( 'select' => 'id, members_display_name, mgroup',
'from' => 'members',
'where' => "members_l_username IN (\"".$name_string."\")",
'order' => 'members_display_name' ) );
$this->ipsclass->DB->exec_query
while ( $m = $this->ipsclass->DB->fetch_row() )
{
$g = $this->ipsclass->cache['group_cache'][ $m['mgroup'] ];
$member_ids[] = "<a href=\"{$this->ipsclass->vars['board_url']}/index.{$this->ipsclass->vars['php_ext']}?showuser={$m['id']}\">{$g['prefix']}{$m['name']}{$g['suffix']}</a>";
$m['members_display_name'] = $this->ipsclass->make_name_formatted( $m['members_display_name'], $m['mgroup'] );
$member_ids[] = "<a href=\"{$this->ipsclass->vars['board_url']}/index.{$this->ipsclass->vars['php_ext']}?showuser={$m['id']}\">{$m['members_display_name']}</a>";
}
$final = implode( ",\n", $member_ids );
@@ -138,7 +126,7 @@ class chat_functions
$final .= '|&|'.intval(count($member_ids));
}
$this->ipsclass->DB->query("UPDATE ibf_cache_store SET cs_value='".addslashes($final)."', cs_extra='{$hits_left}&{$time_is_running_out}' WHERE cs_key='chatstat'");
$this->ipsclass->DB->do_update( 'cache_store', array( 'cs_value' => addslashes($final), 'cs_extra' => "{$hits_left}&{$time_is_running_out}" ), 'where' => "cs_key='chatstat'" );
$row['cs_value'] = $final;
}
@@ -173,13 +161,5 @@ class chat_functions
return $this->html;
}
}
?>
+31 -27
View File
@@ -2,27 +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
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $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 $
+---------------------------------------------------------------------------
|
@@ -93,6 +83,12 @@ class func_digest
$this->ipsclass->DB->load_cache_file( $this->root_path.'sources/sql/'.SQL_DRIVER.'_extra_queries.php', 'sql_extra_queries' );
//-----------------------------------------
// Get some lang bits
//-----------------------------------------
$this->ipsclass->load_language('lang_emails');
//-----------------------------------------
// Load the email libby
//-----------------------------------------
@@ -194,7 +190,7 @@ class func_digest
// Process
//-----------------------------------------
$main_output .= "Topic: $topic_title (Forum: $forum_name)\n"
$main_output .= "{$this->ipsclass->lang['topic_langbit']}: $topic_title ({$this->ipsclass->lang['forum_langbit']}: $forum_name)\n"
. "=====================================\n"
. $post_output
. "\n=====================================\n";
@@ -203,6 +199,7 @@ class func_digest
}
else
{
$others_posted = 1;
$main_output = $cached[ $t['tid'] ];
}
@@ -220,7 +217,7 @@ class func_digest
'TOPIC_ID' => $t['tid'],
'FORUM_ID' => $t['forum_id'],
'TITLE' => $topic_title,
'NAME' => $t['name'],
'NAME' => $t['members_display_name'],
'CONTENT' => $main_output,
) );
@@ -238,7 +235,7 @@ class func_digest
// Update cache with remaning email count
//-----------------------------------------
$this->ipsclass->DB->do_update( 'cache_store', array( 'cs_array' => 1, 'cs_value' => addslashes(serialize($this->ipsclass->cache['systemvars'])) ), "cs_key='systemvars'" );
$this->ipsclass->update_cache( array( 'array' => 1, 'name' => 'systemvars', 'donow' => 1, 'deletefirst' => 0 ) );
}
/*-------------------------------------------------------------------------*/
@@ -270,7 +267,7 @@ class func_digest
$main_output = "";
$others_posted = 0;
if ( ! $cached[ $t['forum_id'] ] )
if ( !isset($cached[ $t['forum_id'] ]) OR !$cached[ $t['forum_id'] ] )
{
$forum_name = $this->ipsclass->cache['forum_cache'][ $t['forum_id'] ]['name'];
@@ -288,22 +285,28 @@ class func_digest
while( $p = $this->ipsclass->DB->fetch_row( $topic_query ) )
{
$this->ipsclass->DB->cache_add_query( 'digest_get_forums_topics_posts', array(
'tid' => $p['tid'],
), 'sql_extra_queries' );
$post_query = $this->ipsclass->DB->cache_exec_query();
$post = $this->ipsclass->DB->fetch_row();
//-----------------------------------------
// Do we have other posters?
//-----------------------------------------
if ( $t['member_id'] != $p['starter_id'] )
if ( $t['member_id'] != $post['author_id'] )
{
$others_posted = 1;
}
$post_author = $p['author_name'];
$post_date = $this->ipsclass->get_date( $p['post_date'], 'SHORT' );
$post_content = $p['post'];
$post_author = $post['author_name'];
$post_date = $this->ipsclass->get_date( $post['post_date'], 'SHORT' );
$post_content = $post['post'];
$topic_title = $p['title'];
$post_output .= "\n-------------------------------------------\n"
. "Topic: {$topic_title} ({$post_author} -- {$post_date})"
. "{$this->ipsclass->lang['topic_langbit']}: {$topic_title} ({$post_author} -- {$post_date})"
. "\n............................................\n"
. "{$post_content}\n\n";
}
@@ -312,7 +315,7 @@ class func_digest
// Process
//-----------------------------------------
$main_output .= "Forum: $forum_name\n"
$main_output .= "{$this->ipsclass->lang['forum_langbit']}: $forum_name\n"
. "=====================================\n"
. $post_output
. "\n=====================================\n";
@@ -321,6 +324,7 @@ class func_digest
}
else
{
$others_posted = 1;
$main_output = $cached[ $t['forum_id'] ];
}
@@ -332,11 +336,11 @@ class func_digest
// Send email...
//-----------------------------------------
$this->email->get_template( $subject, $data['language']);
$this->email->get_template( $subject, $t['language']);
$this->email->build_message( array(
'FORUM_ID' => $t['forum_id'],
'NAME' => $forum_name,
'NAME' => $t['members_display_name'],
'CONTENT' => $main_output,
) );
@@ -354,7 +358,7 @@ class func_digest
// Update cache with remaning email count
//-----------------------------------------
$this->ipsclass->DB->do_update( 'cache_store', array( 'cs_array' => 1, 'cs_value' => addslashes(serialize($this->ipsclass->cache['systemvars'])) ), "cs_key='systemvars'" );
$this->ipsclass->update_cache( array( 'array' => 1, 'name' => 'systemvars', 'donow' => 1, 'deletefirst' => 0 ) );
}
+140 -54
View File
@@ -1,24 +1,15 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board 2.1.7
| =============================================
| Invision Power Board
| ========================================
| by Matthew Mecham
| (c) 2001 - 2005 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| (c) 2001 - 2004 Invision Power Services
| http://www.invisionboard.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
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
| Email: matt@ibforums.com
| Licence Info: http://www.invisionpower.com
+---------------------------------------------------------------------------
|
| > Moderator Core Functions
@@ -32,32 +23,37 @@
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}
class func_mod
{
var $ipsclass;
var $topic = "";
var $forum = "";
var $error = "";
var $auto_update = FALSE;
var $stm = "";
var $upload_dir = "./uploads";
var $moderator = "";
//-----------------------------------------
// @modfunctions: constructor
// -----------
// Accepts: NOTHING
// Returns: NOTHING (TRUE)
//-----------------------------------------
var $topic = "";
var $forum = "";
var $error = "";
var $auto_update = FALSE;
var $stm = "";
var $upload_dir = "";
var $moderator = "";
//-----------------------------------------
function func_mod()
{
$this->error = "";
$this->upload_dir = $this->ipsclass->vars['upload_dir'];
return TRUE;
}
@@ -70,6 +66,8 @@ class func_mod
function init($forum="", $topic="", $moderator="")
{
$this->upload_dir = $this->ipsclass->vars['upload_dir'];
$this->forum = $forum;
if ( is_array($topic) )
@@ -103,6 +101,7 @@ class func_mod
if ( is_array( $id ) )
{
// Better safe than sorry - this should have already been done though
$id = $this->ipsclass->clean_int_array( $id );
if ( count($id) > 0 )
@@ -143,7 +142,7 @@ class func_mod
// Is there an attachment to this post?
//-----------------------------------------
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'attachments', 'where' => "attach_pid".$pid ) );
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'attachments', 'where' => "attach_rel_module='post' AND attach_rel_id".$pid ) );
$this->ipsclass->DB->simple_exec();
$attach_ids = array();
@@ -176,7 +175,7 @@ class func_mod
$postlib = new class_post();
$postlib->ipsclass =& $this->ipsclass;
foreach( $attach_tid as $apid => $tid )
foreach( $attach_tid as $tid )
{
$postlib->pf_recount_topic_attachments($tid);
}
@@ -205,7 +204,7 @@ class func_mod
$this->rebuild_topic($tid);
}
$this->add_moderate_log("", "", "", $pid, "Óäàëåííûå ñîîáùåíèÿ ($pid)");
$this->add_moderate_log("", "", "", $pid, "Deleted posts ($pid)");
return TRUE;
}
@@ -221,6 +220,16 @@ class func_mod
{
$tid = intval($tid);
if ( $this->ipsclass->vars['post_order_column'] != 'post_date' )
{
$this->ipsclass->vars['post_order_column'] = 'pid';
}
if ( $this->ipsclass->vars['post_order_sort'] != 'desc' )
{
$this->ipsclass->vars['post_order_sort'] = 'asc';
}
//-----------------------------------------
// Get the correct number of replies
//-----------------------------------------
@@ -247,11 +256,13 @@ class func_mod
// Get last post info
//-----------------------------------------
$this->ipsclass->DB->cache_add_query( 'mod_func_get_last_post', array( 'tid' => $tid ) );
$this->ipsclass->DB->cache_add_query( 'mod_func_get_last_post', array( 'tid' => $tid, 'orderby' => $this->ipsclass->vars['post_order_column'] ) );
$this->ipsclass->DB->cache_exec_query();
$last_post = $this->ipsclass->DB->fetch_row();
$last_poster_name = $last_post['members_display_name'] ? $last_post['members_display_name'] : $last_post['author_name'];
//-----------------------------------------
// Get first post info
//-----------------------------------------
@@ -259,7 +270,7 @@ class func_mod
$this->ipsclass->DB->build_query( array( 'select' => 'p.post_date, p.author_id, p.author_name, p.pid',
'from' => array( 'posts' => 'p' ),
'where' => "p.topic_id=$tid",
'order' => 'p.pid ASC',
'order' => "p.{$this->ipsclass->vars['post_order_column']} ASC",
'limit' => array(0,1),
'add_join' => array( 0 => array( 'select' => 'm.id, m.members_display_name',
'from' => array( 'members' => 'm' ),
@@ -271,6 +282,8 @@ class func_mod
$first_post = $this->ipsclass->DB->fetch_row();
$first_poster_name = $first_post['members_display_name'] ? $first_post['members_display_name'] : $first_post['author_name'];
//-----------------------------------------
// Get number of attachments
//-----------------------------------------
@@ -284,13 +297,16 @@ class func_mod
// Update topic
//-----------------------------------------
$this->ipsclass->DB->do_update( 'topics', array( 'last_post' => $last_post['post_date'],
'last_poster_id' => $last_post['author_id'],
'last_poster_name' => $last_post['members_display_name'] ? $last_post['members_display_name'] : $last_post['author_name'],
$this->ipsclass->DB->force_data_type = array( 'starter_name' => 'string',
'last_poster_name' => 'string' );
$this->ipsclass->DB->do_update( 'topics', array( 'last_post' => $last_post['post_date'] ? $last_post['post_date'] : $first_post['post_date'],
'last_poster_id' => $last_post['author_id'] ? $last_post['author_id'] : $first_post['author_id'],
'last_poster_name' => $last_poster_name ? $last_poster_name : $first_poster_name,
'topic_queuedposts' => $qpcount,
'posts' => $pcount,
'starter_id' => $first_post['author_id'],
'starter_name' => $first_post['members_display_name'] ? $first_post['members_display_name'] : $first_post['author_name'],
'starter_name' => $first_poster_name,
'start_date' => $first_post['post_date'],
'topic_firstpost' => $first_post['pid'],
'topic_hasattach' => intval($attach['count'])
@@ -300,7 +316,7 @@ class func_mod
// Update first post
//-----------------------------------------
if ( $first_post['new_topic'] != 1 and $first_post['pid'] )
if ( (!isset($first_post['new_topic']) OR $first_post['new_topic'] != 1) and $first_post['pid'] )
{
$this->ipsclass->DB->do_shutdown_update( 'posts', array( 'new_topic' => 0 ), 'topic_id='.$tid );
$this->ipsclass->DB->do_shutdown_update( 'posts', array( 'new_topic' => 1 ), 'pid='.$first_post['pid'] );
@@ -327,9 +343,27 @@ class func_mod
'last_poster_name' => $tt['last_poster_name'] ? $tt['last_poster_name'] : "",
'last_poster_id' => $tt['last_poster_id'] ? $tt['last_poster_id'] : "",
);
$this->ipsclass->DB->force_data_type = array( 'last_poster_name' => 'string',
'last_title' => 'string' );
$this->ipsclass->DB->do_update( 'forums', $dbs, "id=".intval($this->forum['id']) );
if ( $this->ipsclass->forums->forums_by_id[ $this->forum['id'] ]['newest_id'] == $tid )
{
$sort_key = $this->ipsclass->forums->forums_by_id[ $this->forum['id'] ]['sort_key'];
$tt = $this->ipsclass->DB->simple_exec_query( array( 'select' => 'title, tid',
'from' => 'topics',
'where' => 'forum_id='.$this->forum['id'].' and approved=1',
'order' => $sort_key.' desc',
'limit' => array( 0,1 )
) );
$dbs['newest_id'] = $tt['tid'] ? $tt['tid'] : "";
$dbs['newest_title'] = $tt['title'] ? $tt['title'] : "";
}
//-----------------------------------------
// Update forum cache
//-----------------------------------------
@@ -411,6 +445,9 @@ class func_mod
$db_string = $this->ipsclass->DB->compile_db_update_string( $ta );
$this->ipsclass->DB->force_data_type = array( 'last_poster_name' => 'string' );
$this->ipsclass->DB->simple_exec_query( array( 'update' => 'topics', 'set' => $db_string.", posts=posts+1", 'where' => 'tid='.$tid ) );
$add_posts++;
@@ -552,6 +589,8 @@ class func_mod
if ( is_array( $id ) )
{
$id = $this->ipsclass->clean_int_array( $id );
if ( count($id) > 0 )
{
$tid = " IN(".implode(",",$id).")";
@@ -585,6 +624,30 @@ class func_mod
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'voters', 'where' => "tid".$tid ) );
//-----------------------------------------
// Remove subscriptions to this topic
//-----------------------------------------
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'tracker', 'where' => "topic_id".$tid ) );
//-----------------------------------------
// Remove ratings to this topic
//-----------------------------------------
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'topic_ratings', 'where' => "rating_tid".$tid ) );
//-----------------------------------------
// Remove topics read markers for this topic
//-----------------------------------------
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'topics_read', 'where' => "read_tid".$tid ) );
//-----------------------------------------
// Remove stored views for this topic
//-----------------------------------------
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'topic_views', 'where' => "views_tid".$tid ) );
//-----------------------------------------
// Remove polls assigned to this topic
//-----------------------------------------
@@ -609,7 +672,7 @@ class func_mod
if ( count( $posts ) )
{
$this->ipsclass->DB->simple_construct( array( "select" => '*', 'from' => 'attachments', 'where' => "attach_pid IN (".implode(",",$posts).")" ) );
$this->ipsclass->DB->simple_construct( array( "select" => '*', 'from' => 'attachments', 'where' => "attach_rel_module='post' AND attach_rel_id IN (".implode(",",$posts).")" ) );
$o = $this->ipsclass->DB->simple_exec();
while ( $killmeh = $this->ipsclass->DB->fetch_row( $o ) )
@@ -674,6 +737,8 @@ class func_mod
if ( is_array( $topics ) )
{
$topics = $this->ipsclass->clean_int_array( $topics );
if ( count($topics) > 0 )
{
$tid = " IN(".implode(",",$topics).")";
@@ -716,6 +781,10 @@ class func_mod
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'topics', 'where' => "tid".$tid ) );
$oq = $this->ipsclass->DB->simple_exec();
$this->ipsclass->DB->force_data_type = array( 'title' => 'string',
'starter_name' => 'string',
'last_poster_name' => 'string' );
while ( $row = $this->ipsclass->DB->fetch_row($oq) )
{
$this->ipsclass->DB->do_insert( 'topics', array (
@@ -888,6 +957,17 @@ class func_mod
$last_post = $this->ipsclass->DB->fetch_row();
$sort_key = $this->ipsclass->cache['forum_cache'][ $fid ]['sort_key'] ?
$this->ipsclass->cache['forum_cache'][ $fid ]['sort_key'] : 'last_post';
$newest_topic = $this->ipsclass->DB->simple_exec_query( array( 'select' => 'title, tid',
'from' => 'topics',
'where' => 'forum_id='.$fid.' and approved=1',
'order' => $sort_key.' desc',
'limit' => array( 0,1 )
) );
//-----------------------------------------
// Reset this forums stats
//-----------------------------------------
@@ -902,12 +982,17 @@ class func_mod
'posts' => intval($posts['replies']),
'queued_topics' => intval($queued_topics['count']),
'queued_posts' => intval($queued_posts['replies']),
'newest_id' => $newest_topic['tid'],
'newest_title' => $newest_topic['title'],
);
if ( $this->ipsclass->forums->forum_by_id[ $fid ]['_update_deletion'] )
if ( isset($this->ipsclass->forums->forum_by_id[ $fid ]['_update_deletion']) AND $this->ipsclass->forums->forum_by_id[ $fid ]['_update_deletion'] )
{
$dbs['forum_last_deletion'] = time();
}
$this->ipsclass->DB->force_data_type = array( 'last_poster_name' => 'string',
'last_title' => 'string' );
$this->ipsclass->DB->do_update( 'forums', $dbs, "id=".$fid );
@@ -956,7 +1041,7 @@ class func_mod
$final_array = array();
foreach( $this->stm as $idx => $real_array )
foreach( $this->stm as $real_array )
{
foreach( $real_array as $k => $v )
{
@@ -968,6 +1053,8 @@ class func_mod
if ( is_array($id) )
{
$id = $this->ipsclass->clean_int_array( $id );
if ( count($id) > 0 )
{
$this->ipsclass->DB->simple_exec_query( array( 'update' => 'topics', 'set' => $db_string, 'where' => "tid IN(".implode( ",", $id ).")" ) );
@@ -1125,7 +1212,9 @@ class func_mod
function sql_prune_create( $forum_id, $starter_id="", $topic_state="", $post_min="", $date_exp="", $ignore_pin="", $pergo=0, $limit=0 )
{
$sql = "SELECT tid FROM ibf_topics WHERE approved=1 and forum_id=".intval($forum_id);
$this->ipsclass->DB->build_query( array( 'select' => 'tid', 'from' => 'topics', 'where' => 'approved=1 and forum_id='.intval($forum_id) ) );
$sql = $this->ipsclass->DB->cur_query;
if ( intval($date_exp) )
{
@@ -1222,6 +1311,11 @@ class func_mod
function add_moderate_log($fid, $tid, $pid, $t_title, $mod_title='Unknown')
{
$this->ipsclass->DB->force_data_type = array( 'member_name' => 'string' );
$qstring = $this->ipsclass->my_getenv('QUERY_STRING');
$qstring = htmlentities( strip_tags( str_replace( '\\', '', $qstring ) ) );
$this->ipsclass->DB->do_insert( 'moderator_logs', array (
'forum_id' => $fid,
'topic_id' => $tid,
@@ -1229,11 +1323,11 @@ class func_mod
'member_id' => $this->ipsclass->member['id'],
'member_name' => $this->ipsclass->member['members_display_name'],
'ip_address' => $this->ipsclass->input['IP_ADDRESS'],
'http_referer'=> $_SERVER['HTTP_REFERER'],
'http_referer'=> $this->ipsclass->my_getenv('HTTP_REFERER'),
'ctime' => time(),
'topic_title' => $t_title,
'action' => $mod_title,
'query_string'=> $_SERVER['QUERY_STRING'],
'query_string'=> $qstring,
) );
return TRUE;
}
@@ -1241,12 +1335,4 @@ class func_mod
}
?>
+399 -116
View File
@@ -2,27 +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
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2005-12-06 17:36:43 +0000 (Tue, 06 Dec 2005) $
| > $Revision: 94 $
| > $Date: 2006-10-12 17:58:40 +0100 (Thu, 12 Oct 2006) $
| > $Revision: 633 $
| > $Author: bfarber $
+---------------------------------------------------------------------------
|
@@ -38,7 +28,7 @@
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
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();
}
@@ -57,8 +47,13 @@ class func_msg
var $redirect_url = "";
var $redirect_lang= "";
var $jump_html = "";
var $vid = "";
var $force_pm = 0;
var $member = array();
function register_class( &$class )
{
$this->class = &$class;
@@ -75,7 +70,7 @@ class func_msg
//-----------------------------------------
require_once( ROOT_PATH.'sources/classes/post/class_post.php' );
$this->postlib = new class_post();
$this->postlib = new class_post();
$this->postlib->ipsclass =& $this->ipsclass;
$this->postlib->load_classes();
@@ -90,17 +85,164 @@ class func_msg
$this->postlib->can_upload = $this->can_upload;
}
/*-------------------------------------------------------------------------*/
// Generate the UserCP menu
/*-------------------------------------------------------------------------*/
function ucp_generate_menu()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$menu_html = "";
$component_html = "";
$folder_links = "";
//-----------------------------------------
// Get all member info..
//-----------------------------------------
$this->ipsclass->DB->cache_add_query( 'generic_get_all_member', array( 'mid' => $this->ipsclass->member['id'] ) );
$this->ipsclass->DB->cache_exec_query();
if ( ! $member = $this->ipsclass->DB->fetch_row() )
{
$this->ipsclass->DB->do_insert( 'member_extra', array( 'id' => $this->ipsclass->member['id'] ) );
}
else
{
$this->ipsclass->member = array_merge( $member, $this->ipsclass->member );
}
//-----------------------------------------
// Get enabled components
//-----------------------------------------
if ( is_array( $this->ipsclass->cache['components'] ) and count( $this->ipsclass->cache['components'] ) )
{
foreach( $this->ipsclass->cache['components'] as $data )
{
$file = ROOT_PATH.'sources/components_ucp/'.$data['com_filename'].'.php';
if ( file_exists( $file ) )
{
require_once( $file );
$name = 'components_ucp_'.$data['com_filename'];
$tmp = new $name();
$tmp->ipsclass =& $this->ipsclass;
$component_html .= $tmp->ucp_build_menu();
unset($tmp);
}
}
}
//-----------------------------------------
// Print the top button menu
//-----------------------------------------
$menu_html = $this->ipsclass->compiled_templates['skin_msg']->Menu_bar( $component_html );
//-----------------------------------------
// Messenger
//-----------------------------------------
if ( $this->ipsclass->member['g_use_pm'] )
{
//-----------------------------------------
// Do a little set up, do a litle dance, get
// down tonight! *boogie*
//-----------------------------------------
$this->jump_html = "<select name='VID' class='forminput'>\n";
$this->ipsclass->member['dir_data'] = array();
//-----------------------------------------
// Do we have VID?
// No, it's just the way we walk! Haha, etc.
//-----------------------------------------
if ( isset($this->ipsclass->input['VID']) AND $this->ipsclass->input['VID'] )
{
$this->vid = $this->ipsclass->input['VID'];
}
else
{
$this->vid = 'in';
}
//-----------------------------------------
// Print folder links
//-----------------------------------------
if ( ! $this->ipsclass->member['vdirs'] )
{
$this->ipsclass->member['vdirs'] = "in:Inbox|sent:Sent Items";
}
foreach( explode( "|", $this->ipsclass->member['vdirs'] ) as $dir )
{
list ($id , $data) = explode( ":", $dir );
list ($real, $count) = explode( ";", $data );
if ( ! $id )
{
continue;
}
$this->ipsclass->member['dir_data'][$id] = array( 'id' => $id, 'real' => $real, 'count' => $count );
if ($this->vid == $id)
{
$this->ipsclass->member['current_dir'] = $real;
$this->ipsclass->member['current_id'] = $id;
$this->jump_html .= "<option value='$id' selected='selected'>$real</option>\n";
}
else
{
$this->jump_html .= "<option value='$id'>$real</option>\n";
}
if ( $count )
{
$real .= " ({$count})";
}
$folder_links .= $this->ipsclass->compiled_templates['skin_msg']->menu_bar_msg_folder_link($id, $real);
}
if ( $folder_links != "" )
{
$menu_html = str_replace( "<!--IBF.FOLDER_LINKS-->", $folder_links, $menu_html );
}
}
$this->jump_html .= "<!--EXTRA--></select>\n\n";
return $menu_html;
}
/*-------------------------------------------------------------------------*/
// Send form stuff
/*-------------------------------------------------------------------------*/
function send_form($preview=0, $errors="")
{
//-----------------------------------------
// INIT
//-----------------------------------------
$_msg_id = 0;
$this->form_mid = intval($this->ipsclass->input['MID']);
$this->form_orig_id = intval($this->ipsclass->input['MSID']);
$_POST['Post-NS'] = $_POST['Post'];
$_POST['Post'] = $this->ipsclass->remove_tags( $this->ipsclass->txt_raw2form( $_POST['Post'] ) );
$_POST['Post-NS'] = isset($_POST['Post']) ? $_POST['Post'] : '';
$_POST['Post'] = $this->ipsclass->remove_tags( $this->ipsclass->txt_raw2form( isset($_POST['Post']) ? $_POST['Post'] : '' ) );
//-----------------------------------------
// Fix up errors
@@ -116,7 +258,7 @@ class func_msg
{
$this->postlib->parser->parse_html = $this->ipsclass->vars['msg_allow_html'];
$this->postlib->parser->parse_nl2br = 1;
$this->postlib->parser->parse_smilies = 1;//intval($this->ipsclass->input['enableemo']);
$this->postlib->parser->parse_smilies = 1;
$this->postlib->parser->parse_bbcode = $this->ipsclass->vars['msg_allow_code'];
$old_msg = $this->postlib->han_editor->process_raw_post( 'Post-NS' );
@@ -125,8 +267,10 @@ class func_msg
$this->output .= $this->ipsclass->compiled_templates['skin_msg']->preview($old_msg);
}
if ($errors != "")
if ( $errors != "" OR $this->postlib->parser->error != "" )
{
$errors = $errors ? $errors : $this->ipsclass->lang[$this->postlib->parser->error];
$this->output .= $this->ipsclass->compiled_templates['skin_msg']->pm_errors($errors);
$preview = 1;
}
@@ -145,38 +289,38 @@ class func_msg
// Did we come from a button with a user ID?
//-----------------------------------------
if ( $this->form_mid )
{
if ( $this->form_mid )
{
$this->ipsclass->DB->simple_construct( array( 'select' => 'members_display_name, name, id', 'from' => 'members', 'where' => "id=".$this->form_mid ) );
$this->ipsclass->DB->simple_exec();
$name = $this->ipsclass->DB->fetch_row();
if ($this->ipsclass->input['fwd'] != 1)
if ($name['id'])
{
if ($name['id'])
{
$name_to_enter = $name['members_display_name'];
}
$name_to_enter = $name['members_display_name'];
}
}
else
{
$name_to_enter = $this->ipsclass->input['entered_name'];
$name_to_enter = isset($this->ipsclass->input['entered_name']) ? $this->ipsclass->input['entered_name'] : '';
}
//-----------------------------------------
// Are we quoting an old message?
//-----------------------------------------
$footer_defaults = array( 'add_sent' => '', 'add_tracking' => '' );
if ( $preview or $this->class->show_form )
{
$old_message = $_POST['Post-NS'];
$old_title = preg_replace( "/'/", "&#39;", $this->ipsclass->txt_stripslashes($_POST['msg_title']) );
$old_title = str_replace( "'", "&#39;", str_replace( '"', '&#34;', $this->ipsclass->txt_stripslashes($_POST['msg_title']) ) );
// If we preview and check these boxes, they should default to checked
$footer_defaults = array(
'add_sent' => $this->ipsclass->input['add_sent'] == 'yes' ? "checked='checked' " : "",
'add_tracking' => $this->ipsclass->input['add_tracking'] == '1' ? "checked='checked' " : "",
'add_sent' => isset($this->ipsclass->input['add_sent']) AND $this->ipsclass->input['add_sent'] == 'yes' ? "checked='checked' " : "",
'add_tracking' => isset($this->ipsclass->input['add_tracking']) AND $this->ipsclass->input['add_tracking'] == '1' ? "checked='checked' " : "",
);
}
else if ( $this->form_orig_id )
@@ -186,7 +330,12 @@ class func_msg
$old_msg = $this->ipsclass->DB->fetch_row();
if ($old_msg['mt_title'])
if( $old_msg['from_id'] )
{
$name_to_enter = $old_msg['from_name'];
}
if ( $old_msg['mt_title'] )
{
if ( $this->class->edit_saved )
{
@@ -197,8 +346,9 @@ class func_msg
$old_addsent = $old_msg['mt_addtosent'];
$old_title = $old_msg['mt_title'];
$old_message = $this->postlib->parser->bad_words( $this->ipsclass->my_br2nl( $old_msg['msg_post'] ) );
$_msg_id = $old_msg['mt_msg_id'];
if( $this->postlib->han_editor->method == 'rte' )
if ( $this->postlib->han_editor->method == 'rte' )
{
$_POST['tmp_for_msg_edit'] = $old_message;
@@ -208,10 +358,10 @@ class func_msg
unset($_POST['tmp_for_msg_edit']);
}
$this->class->post_key = $old_msg['msg_post_key'];
$this->ipsclass->input['OID']= $old_msg['mt_id'];
$this->class->post_key = $old_msg['msg_post_key'];
$this->ipsclass->input['OID'] = $old_msg['mt_id'];
}
else if ($this->ipsclass->input['fwd'] == 1)
else if ( isset($this->ipsclass->input['fwd']) AND $this->ipsclass->input['fwd'] == 1 )
{
$old_title = "Fwd:".$old_msg['mt_title'];
$old_title = preg_replace( "/^(?:Fwd\:){1,}/i", "Fwd:", $old_title );
@@ -228,8 +378,8 @@ class func_msg
}
$footer_defaults = array(
'add_sent' => $old_addsent == '1' ? "checked='checked' " : "",
'add_tracking' => $old_track == '1' ? "checked='checked' " : "",
'add_sent' => isset($old_addsent) AND $old_addsent == '1' ? "checked='checked' " : "",
'add_tracking' => isset($old_track) AND $old_track == '1' ? "checked='checked' " : "",
);
}
@@ -247,24 +397,24 @@ class func_msg
//-----------------------------------------
$this->output .= $this->ipsclass->compiled_templates['skin_msg']->Send_form( array (
'CONTACTS' => $contacts,
'MEMBER' => $this->member,
'N_ENTER' => $name_to_enter,
'O_TITLE' => $old_title,
'OID' => $this->ipsclass->input['OID'], // Old unsent msg id for restoring saved msg - used to delete saved when sent
'post_key' => $this->class->post_key,
'form_extra'=> $this->form_extra,
'upload' => $this->hidden_field,
'CONTACTS' => $contacts,
'MEMBER' => $this->member,
'N_ENTER' => $name_to_enter,
'O_TITLE' => $old_title,
'OID' => isset($this->ipsclass->input['OID']) ? $this->ipsclass->input['OID'] : 0, // Old unsent msg id for restoring saved msg - used to delete saved when sent
'attach_post_key' => $this->class->post_key,
'form_extra' => $this->form_extra,
'upload' => $this->hidden_field,
) );
$this->ipsclass->lang['the_max_length'] = $this->ipsclass->vars['max_post_length'] * 1024;
//-----------------------------------------
// Show editor HTML
// Remove side panel
//-----------------------------------------
$this->postlib->han_editor->ed_width = $this->ipsclass->vars['rte_pm_width'] ? $this->ipsclass->vars['rte_pm_width'] : $this->ipsclass->vars['rte_width'];
$this->postlib->han_editor->remove_side_panel = 1;
//-----------------------------------------
// Is this RTE? If so, convert BBCode
@@ -272,6 +422,11 @@ class func_msg
if ( $this->postlib->han_editor->method == 'rte' AND $old_message )
{
if ( $errors or $preview )
{
$old_message = stripslashes( $old_message );
}
$old_message = $this->postlib->parser->convert_ipb_html_to_html( $old_message );
}
else if ( $old_message )
@@ -285,19 +440,15 @@ class func_msg
// Show upload stuff?
//-----------------------------------------
if ($this->can_upload)
if ( $this->can_upload )
{
$this->output .= $this->postlib->html_build_uploads($this->class->post_key,'msg');
$upload_field = $this->ipsclass->compiled_templates['skin_post']->Upload_field( $this->class->post_key, 'msg', $_msg_id );
$this->output = str_replace( '<!--UPLOAD FIELD-->', $upload_field, $this->output );
}
$this->output .= $this->ipsclass->compiled_templates['skin_msg']->send_form_footer( $footer_defaults );
//-----------------------------------------
// Add in the smilies box
//-----------------------------------------
$this->output = $this->postlib->html_add_smilie_box($this->output);
$this->class->page_title = $this->ipsclass->lang['t_welcome'];
$this->class->nav = array( "<a href='".$this->ipsclass->base_url."act=UserCP&amp;CODE=00'>".$this->ipsclass->lang['t_title']."</a>" );
@@ -305,18 +456,21 @@ class func_msg
// Do we have permission to mass PM peeps?
//-----------------------------------------
$cc_box = "";
$cc_formbox = "";
if ($this->ipsclass->member['g_max_mass_pm'] > 0)
{
$this->ipsclass->lang['carbon_copy_desc'] = sprintf( $this->ipsclass->lang['carbon_copy_desc'], $this->ipsclass->member['g_max_mass_pm'] );
if ( isset($_POST['carbon_copy']) or $cc_text )
if ( isset($_POST['carbon_copy']) or isset($cc_text) )
{
$cc_text = $cc_text ? $cc_text : $this->ipsclass->txt_htmlspecialchars($_POST['carbon_copy']);
$cc_text = isset($cc_text) ? $cc_text : $this->ipsclass->txt_htmlspecialchars($_POST['carbon_copy']);
$cc_box = preg_replace( "#</textarea>#i", "", $this->ipsclass->txt_stripslashes($cc_text) );
$cc_box = str_replace( "</textarea>", "", $this->ipsclass->txt_stripslashes($cc_text) );
}
if ( intval($this->ipsclass->input['mt_hide_cc']) == 1 or ( isset($cc_hide) AND $cc_hide == 1 ) )
if ( ( isset($this->ipsclass->input['mt_hide_cc']) AND intval($this->ipsclass->input['mt_hide_cc']) == 1 ) or ( isset($cc_hide) AND $cc_hide == 1 ) )
{
$cc_formbox = $cc_hide ? $cc_hide : intval($this->ipsclass->input['mt_hide_cc']);
@@ -333,25 +487,51 @@ class func_msg
function build_contact_list()
{
$contacts = "";
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'contacts', 'where' => "member_id=".$this->ipsclass->member['id'], 'order' => "contact_name") );
$this->ipsclass->DB->simple_exec();
if ( $this->ipsclass->DB->get_num_rows() )
{
$contacts = "<select name='from_contact' class='forminput'><option value='-'>".$this->ipsclass->lang['other']."</option>\n<option value='-'>--------------------</option>\n";
while ( $entry = $this->ipsclass->DB->fetch_row() )
{
$selected = ( $this->ipsclass->input['from_contact'] == $entry['contact_id'] ) ? ' selected="selected"' : '';
$contacts .= "<option value='".$entry['contact_id']."'{$selected}>".$entry['contact_name']."</option>\n";
}
$contacts .= "</select>\n";
}
else
//-----------------------------------------
// INIT
//-----------------------------------------
$contacts = "";
$from_contact = $this->ipsclass->input['from_contact'] ? intval($this->ipsclass->input['from_contact']) : intval($this->ipsclass->input['MID']);
$member_id = intval( $this->ipsclass->member['id'] );
//-----------------------------------------
// Get 'em.
//-----------------------------------------
$this->ipsclass->DB->build_query( array( 'select' => 'pf.*',
'from' => array( 'profile_friends' => 'pf' ),
'where' => 'pf.friends_member_id='.$member_id. ' AND pf.friends_approved=1',
'order' => 'm.members_display_name ASC',
'limit' => array( 0, 10 ),
'add_join' => array( 0 => array( 'select' => 'm.*',
'from' => array( 'members' => 'm' ),
'where' => 'm.id=pf.friends_friend_id',
'type' => 'left' ),
1 => array( 'select' => 'pp.*',
'from' => array( 'profile_portal' => 'pp' ),
'where' => 'pp.pp_member_id=m.id',
'type' => 'left' ),
2 => array( 'select' => 'me.*',
'from' => array( 'member_extra' => 'me' ),
'where' => 'me.id=pf.friends_friend_id',
'type' => 'left' ) ) ) );
$this->ipsclass->DB->exec_query();
if ( $this->ipsclass->DB->get_num_rows() )
{
$contacts = "<select name='from_contact' class='forminput'><option value='-'>".$this->ipsclass->lang['other']."</option>\n<option value='-'>--------------------</option>\n";
while( $row = $this->ipsclass->DB->fetch_row() )
{
$selected = ( $from_contact == $row['friends_friend_id'] ) ? ' selected="selected"' : '';
$contacts .= "<option value='".$row['friends_friend_id']."'{$selected}>".$row['members_display_name']."</option>\n";
}
$contacts .= "</select>\n";
}
else
{
$contacts = $this->ipsclass->lang['address_list_empty'];
}
@@ -452,7 +632,9 @@ class func_msg
$this->ipsclass->DB->simple_construct( array( 'delete' => 'message_text', 'where' => "msg_id IN (".implode( ',',$deleted_ids ).")") );
$this->ipsclass->DB->simple_exec();
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'attachments', 'where' => "attach_msg IN (".implode( ',',$deleted_ids ).")") );
$this->ipsclass->DB->simple_construct( array( 'select' => '*',
'from' => 'attachments',
'where' => "attach_rel_module='msg' AND attach_rel_id IN (".implode( ',',$deleted_ids ).")") );
$this->ipsclass->DB->simple_exec();
while ( $a = $this->ipsclass->DB->fetch_row() )
@@ -517,6 +699,16 @@ class func_msg
$this->add_sent = $opts['add_sent'];
$this->hide_cc = $opts['hide_cc'];
$testing_parse = $this->postlib->parser->pre_db_parse( $this->msg_post );
if( $this->postlib->parser->error != "" )
{
$this->error = $this->ipsclass->lang[$this->postlib->parser->error];
return;
}
unset($testing_parse);
//-----------------------------------------
// Are we simply saving this for later?
//-----------------------------------------
@@ -538,6 +730,30 @@ class func_msg
$this->ipsclass->DB->simple_exec();
$to_msg_stats = $this->ipsclass->DB->fetch_row();
// Are they in a secondary group that can use pm?
if ( $to_msg_stats['mgroup_others'] && ! $to_msg_stats['g_use_pm'] )
{
$groups_id = explode( ',', $to_msg_stats['mgroup_others'] );
if ( count( $groups_id ) )
{
foreach( $groups_id as $pid )
{
if ( ! $this->ipsclass->cache['group_cache'][ $pid ]['g_id'] )
{
continue;
}
if ( $this->ipsclass->cache['group_cache'][ $pid ]['g_use_pm'] )
{
$to_msg_stats['g_use_pm'] = 1;
break;
}
}
}
}
if ( $to_msg_stats['g_use_pm'] != 1 OR $to_msg_stats['members_disable_pm'] )
{
@@ -555,8 +771,40 @@ class func_msg
if ( (($to_msg_stats['msg_total']) >= $to_msg_stats['g_max_messages']) and ($to_msg_stats['g_max_messages'] > 0) )
{
$this->error = $this->ipsclass->lang['no_usepm_member'];
return;
if ( $this->ipsclass->vars['override_inbox_full'] )
{
$override = array();
$override = explode( ",", $this->ipsclass->vars['override_inbox_full'] );
$do_override = 0;
$my_groups = array( $this->ipsclass->member['mgroup'] );
if( $this->ipsclass->member['mgroup_others'] )
{
$my_other_groups = explode( ",", $this->ipsclass->member['mgroup_others'] );
$my_groups = array_merge( $my_groups, $my_other_groups );
}
foreach( $my_groups as $member_group )
{
if( in_array( $member_group, $override ) )
{
$do_override = 1;
}
}
if ( $do_override == 0 )
{
$this->error = $this->ipsclass->lang['no_usepm_member_full'];
return;
}
}
else
{
$this->error = $this->ipsclass->lang['no_usepm_member_full'];
return;
}
}
//-----------------------------------------
@@ -570,9 +818,42 @@ class func_msg
if ( (isset($can_msg['contact_id'])) and ($can_msg['allow_msg'] != 1) )
{
$this->ipsclass->input['MID'] = $this->send_to_member['id'];
$this->error = $this->ipsclass->lang['msg_blocked'];
return;
if( $this->ipsclass->vars['unblockable_pm_groups'] )
{
$unblockable = array();
$unblockable = explode( ",", $this->ipsclass->vars['unblockable_pm_groups'] );
$do_override = 0;
$my_groups = array( $this->ipsclass->member['mgroup'] );
if( $this->ipsclass->member['mgroup_others'] )
{
$my_other_groups = explode( ",", $this->ipsclass->member['mgroup_others'] );
$my_groups = array_merge( $my_groups, $my_other_groups );
}
foreach( $my_groups as $member_group )
{
if( in_array( $member_group, $unblockable ) )
{
$do_override = 1;
}
}
if ( $do_override == 0 )
{
$this->ipsclass->input['MID'] = $this->send_to_member['id'];
$this->error = $this->ipsclass->lang['msg_blocked'];
return;
}
}
else
{
$this->ipsclass->input['MID'] = $this->send_to_member['id'];
$this->error = $this->ipsclass->lang['msg_blocked'];
return;
}
}
//-----------------------------------------
@@ -580,9 +861,9 @@ class func_msg
// saved copy?
//-----------------------------------------
if ($this->ipsclass->input['add_sent'] and ($this->ipsclass->member['g_max_messages'] > 0) )
if (isset($this->ipsclass->input['add_sent']) AND $this->ipsclass->input['add_sent'] AND ($this->ipsclass->member['g_max_messages'] > 0) )
{
if ( ($this->msg_stats['msg_total'] + 1) >= $this->ipsclass->member['g_max_messages'] )
if ( ($to_msg_stats['msg_total'] + 1) >= $this->ipsclass->member['g_max_messages'] )
{
$this->error = $this->ipsclass->lang['max_message_from'];
return;
@@ -645,7 +926,7 @@ class func_msg
// Make attachments permanent
//-----------------------------------------
$no_attachments = $this->postlib->pf_make_attachments_permanent( $this->class->post_key, "", "", $msg_id );
$no_attachments = $this->postlib->pf_make_attachments_permanent( $this->class->post_key, $msg_id, 'msg' );
//-----------------------------------------
// If we have an original ID - delete it and 'move'
@@ -680,7 +961,7 @@ class func_msg
// loop....
//-----------------------------------------
foreach ($cc_array as $user_id => $to_member)
foreach ($cc_array as $to_member)
{
//-----------------------------------------
// Sort out tracking and pop us status
@@ -696,18 +977,18 @@ class func_msg
$this->ipsclass->DB->force_data_type = array( 'mt_title' => 'string' );
$this->ipsclass->DB->do_insert( 'message_topics', array(
'mt_msg_id' => $msg_id,
'mt_date' => time(),
'mt_title' => $this->msg_title,
'mt_from_id' => $this->from_member['id'],
'mt_to_id' => $to_member['id'],
'mt_vid_folder' => 'in',
'mt_tracking' => $this->add_tracking,
'mt_addtosent' => $this->add_sent,
'mt_hasattach' => intval($no_attachments),
'mt_owner_id' => $to_member['id'],
'mt_hide_cc' => $this->hide_cc,
) );
'mt_msg_id' => $msg_id,
'mt_date' => time(),
'mt_title' => $this->msg_title,
'mt_from_id' => $this->from_member['id'],
'mt_to_id' => $to_member['id'],
'mt_vid_folder' => 'in',
'mt_tracking' => intval( $this->add_tracking ),
'mt_addtosent' => intval( $this->add_sent ),
'mt_hasattach' => intval($no_attachments),
'mt_owner_id' => $to_member['id'],
'mt_hide_cc' => intval( $this->hide_cc ),
) );
$mt_id = $this->ipsclass->DB->get_insert_id();
@@ -732,7 +1013,7 @@ class func_msg
if ($to_member['email_pm'] == 1)
{
$to_member['language'] = $to_member['language'] == "" ? 'ru' : $to_member['language'];
$to_member['language'] = $to_member['language'] == "" ? 'en' : $to_member['language'];
$this->postlib->email->get_template("pm_notify", $to_member['language']);
@@ -743,10 +1024,10 @@ class func_msg
'LINK' => "?act=Msg&CODE=03&VID=in&MSID=$mt_id",
) );
$this->postlib->email->subject = $this->ipsclass->lang['pm_email_subject'];
$this->postlib->email->to = $to_member['email'];
$this->postlib->email->send_mail();
$this->ipsclass->DB->do_insert( 'mail_queue', array( 'mail_to' => $to_member['email'], 'mail_date' => time(), 'mail_subject' => $this->ipsclass->lang['pm_email_subject'], 'mail_content' => $this->postlib->email->message ) );
$this->ipsclass->cache['systemvars']['mail_queue'] += $count;
$this->ipsclass->update_cache( array( 'array' => 1, 'name' => 'systemvars', 'donow' => 1, 'deletefirst' => 0 ) );
}
}
@@ -785,6 +1066,8 @@ class func_msg
$this->to_by_id = "";
$this->to = "";
#unset($this->postlib);
}
@@ -795,7 +1078,7 @@ class func_msg
function rebuild_dir_count($mid, $vdir, $cur_dir, $new_count, $nosave='save', $extra="")
{
$rebuild = array();
if ( ! $vdir )
{
$this->ipsclass->DB->simple_construct( array( "select" => 'vdirs', 'from' => 'member_extra', 'where' => 'id='.$mid ) );
@@ -803,7 +1086,7 @@ class func_msg
$mem = $this->ipsclass->DB->fetch_row();
$vdir = $mem['vdirs'] ? $mem['vdirs'] : 'in:Âõîäÿùèå;0|sent:Îòïðàâëåííûå;0';
$vdir = $mem['vdirs'] ? $mem['vdirs'] : 'in:Inbox;0|sent:Sent Items;0';
}
foreach( explode( "|", $vdir ) as $dir )
@@ -828,7 +1111,7 @@ class func_msg
$final = implode( '|', $rebuild );
if ( $nosave != 'nosave' )
{
{
$this->ipsclass->DB->simple_construct( array( 'update' => 'member_extra', 'set' => 'vdirs="'.$final.'"', 'where' => 'id='.$mid ) );
$this->ipsclass->DB->simple_exec();
@@ -840,7 +1123,6 @@ class func_msg
}
return $final;
}
@@ -878,13 +1160,14 @@ class func_msg
$cc_array = array();
$cc_users = strtolower(str_replace( '|', '&#124;', $cc_users) );
if ( $cc_users )
{
//-----------------------------------------
// Sort out the array
//-----------------------------------------
$cc_users = str_replace( "<br />", "<br>", $cc_users );
$cc_users = str_replace( "<br><br>", "<br>" , trim($cc_users) );
$cc_users = preg_replace( "/^(<br>){1}/", "" , $cc_users );
$cc_users = preg_replace( "/(<br>){1}$/", "" , $cc_users );
@@ -1028,7 +1311,7 @@ class func_msg
{
$seen = 0;
foreach( $cc_array as $idx => $cc_user )
foreach( $cc_array as $cc_user )
{
$tmp = "'".strtolower($cc_user['name'])."'";
@@ -1058,8 +1341,8 @@ class func_msg
$cc_error = "";
$cc_id_array = array();
foreach($cc_array as $idx => $cc_user)
foreach($cc_array as $cc_user)
{
if ( $cc_user['g_use_pm'] != 1 OR $cc_user['members_disable_pm'] )
{
@@ -1221,7 +1504,7 @@ class func_msg
{
foreach( $groups_id as $pid )
{
if ( ! $this->ipsclass->cache['group_cache'][ $pid ]['g_id'] )
if ( !isset($this->ipsclass->cache['group_cache'][ $pid ]['g_id']) OR !$this->ipsclass->cache['group_cache'][ $pid ]['g_id'] )
{
continue;
}
+16 -25
View File
@@ -2,27 +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
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $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 $
+---------------------------------------------------------------------------
|
@@ -37,7 +27,7 @@
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ.";
print "<h1>Incorrect access</h1>You cannot access this file directly.";
exit();
}
@@ -52,6 +42,7 @@ class func_taskmanager
var $time_now = 0;
var $date_now = array();
var $cron_key = "";
var $date;
/*-------------------------------------------------------------------------*/
//
@@ -72,12 +63,6 @@ class func_taskmanager
$this->root_path = ROOT_PATH;
}
if ( $_REQUEST['ck'] )
{
$this->type = 'cron';
$this->cron_key = addslashes( substr( trim(stripslashes($this->ipsclass->txt_alphanumerical_clean($_REQUEST['ck']))), 0, 32 ) );
}
$this->time_now = time();
$this->date_now['minute'] = intval( gmdate( 'i', $this->time_now ) );
@@ -96,6 +81,12 @@ class func_taskmanager
function run_task()
{
if ( isset( $_REQUEST['ck'] ) AND $_REQUEST['ck'] )
{
$this->type = 'cron';
$this->cron_key = substr( trim(stripslashes($this->ipsclass->txt_alphanumerical_clean($_REQUEST['ck']))), 0, 32 );
}
if ( $this->type == 'internal' )
{
//-----------------------------------------
@@ -194,12 +185,12 @@ class func_taskmanager
function unlock_task($task=array())
{
if ( ! $task['task_id'] )
if ( !isset($task['task_id']) OR !$task['task_id'] )
{
return;
}
$this->ipsclass->DB->do_update( 'task_manager', array( 'task_locked' => 0 ), "task_id=".$task['task_id'] );
$this->ipsclass->DB->do_update( 'task_manager', array( 'task_locked' => 0 ), 'task_id='.$task['task_id'] );
}
/*-------------------------------------------------------------------------*/
@@ -229,7 +220,7 @@ class func_taskmanager
$cache_array['task_next_run'] = $this_task['task_next_run'];
$this->ipsclass->DB->do_update( 'cache_store', array( 'cs_value' => addslashes(serialize($cache_array)) ), "cs_key='systemvars'" );
$this->ipsclass->update_cache( array( 'array' => 1, 'name' => 'systemvars', 'donow' => 1, 'deletefirst' => 0 ) );
}
/*-------------------------------------------------------------------------*/
@@ -442,7 +433,7 @@ class func_taskmanager
$save = array( 'log_title' => $task['task_title'],
'log_date' => time(),
'log_ip' => $_SERVER['REMOTE_ADDR'],
'log_ip' => $this->ipsclass->my_getenv('REMOTE_ADDR'),
'log_desc' => $desc
);
+11 -20
View File
@@ -2,28 +2,18 @@
/*
+--------------------------------------------------------------------------
| 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
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2005-12-01 16:45:12 +0000 (Thu, 01 Dec 2005) $
| > $Revision: 88 $
| > $Author: bfarber $
| > $Date: 2006-10-03 12:14:55 +0100 (Tue, 03 Oct 2006) $
| > $Revision: 596 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
| > Topic display module
@@ -38,7 +28,7 @@
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
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();
}
@@ -53,7 +43,6 @@ class topic_display
var $moderator = array();
var $forum = array();
var $topic = array();
var $mem_titles = array();
var $mod_action = array();
var $poll_html = "";
var $parser = "";
@@ -169,7 +158,7 @@ class topic_display
// Grab the posts we'll need
//-----------------------------------------
$first = intval($this->ipsclass->input['st']);
$first = intval($this->ipsclass->input['st']) >=0 ? intval($this->ipsclass->input['st']) : 0;
$query_type = 'topics_get_posts';
@@ -260,7 +249,7 @@ class topic_display
//-----------------------------------------
// Run query
//-----------------------------------------
$this->lib->topic_view_mode = 'linear';
# We don't need * but if we don't use it, it won't use the correct index
@@ -361,7 +350,7 @@ class topic_display
}
$this->ipsclass->boink_it($this->ipsclass->base_url."act=ST&f={$this->forum['id']}&t={$this->topic['tid']}&view=getlastpost");
$this->ipsclass->boink_it($this->ipsclass->base_url."showtopic={$this->topic['tid']}&view=getlastpost");
}
}
@@ -369,6 +358,8 @@ class topic_display
// Render the page top
//-----------------------------------------
$this->topic['go_new'] = isset($this->topic['go_new']) ? $this->topic['go_new'] : '';
if ( $this->lib->topic_view_mode == 'linearplus' and $this->topic['posts'] > 0 )
{
$this->output .= $this->ipsclass->compiled_templates['skin_topic']->topic_page_top( array( 'TOPIC' => $this->topic, 'FORUM' => $this->forum ), 1 );
+49 -37
View File
@@ -2,28 +2,18 @@
/*
+--------------------------------------------------------------------------
| 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
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2005-12-01 16:45:12 +0000 (Thu, 01 Dec 2005) $
| > $Revision: 88 $
| > $Author: bfarber $
| > $Date: 2006-10-12 12:25:54 +0100 (Thu, 12 Oct 2006) $
| > $Revision: 630 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
| > Topic Outline Display Module wodule wookie, nookie shut up
@@ -38,7 +28,7 @@
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
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();
}
@@ -52,7 +42,6 @@ class topic_display
var $html = "";
var $forum = array();
var $topic = array();
var $mem_titles = array();
var $mod_action = array();
var $poll_html = "";
var $parser = "";
@@ -153,7 +142,7 @@ class topic_display
$query_type = 'topics_get_posts';
$first = intval($this->ipsclass->input['start']);
$first = intval( $this->ipsclass->input['show'] );
$last = $this->ipsclass->vars['threaded_per_page'] ? $this->ipsclass->vars['threaded_per_page'] : 250;
if ( $this->ipsclass->vars['custom_profile_topic'] == 1 )
@@ -174,12 +163,12 @@ class topic_display
}
$this->ipsclass->DB->simple_construct( array (
'select' => 'pid, post_parent',
'from' => 'posts',
'where' => 'topic_id='.$this->topic['tid']. ' and queued != 1',
'order' => 'pid',
'limit' => array( $first, $last )
) );
'select' => 'pid, post_parent',
'from' => 'posts',
'where' => 'topic_id='.$this->topic['tid']. ' and queued != 1',
'order' => 'pid',
'limit' => array( $first, $last )
) );
$this->ipsclass->DB->simple_exec();
@@ -204,11 +193,11 @@ class topic_display
if ( count( $this->pids ) )
{
$this->ipsclass->DB->simple_construct( array (
'select' => 'pid, post, author_id, author_name, post_date, post_title, post_parent, topic_id, icon_id',
'from' => 'posts',
'where' => 'pid IN('.implode(',',$this->pids).')',
'order' => 'pid',
) );
'select' => 'pid, post, author_id, author_name, post_date, post_title, post_parent, topic_id, icon_id',
'from' => 'posts',
'where' => 'pid IN('.implode(',',$this->pids).')',
'order' => 'pid',
) );
$this->ipsclass->DB->simple_exec();
@@ -231,14 +220,19 @@ class topic_display
$this->post_cache[0] = array( 'id' => 1 );
$this->post_cache[$this->topic['topic_firstpost']]['post_title'] = $this->topic['title'];
$this->post_cache[ $this->topic['topic_firstpost'] ]['post_title'] = $this->topic['title'];
//-----------------------------------------
// Are we viewing Posts?
//-----------------------------------------
$post_id = intval( $this->ipsclass->input['pid'] );
$post_id = intval($this->ipsclass->input['pid']);
if ( $post_id && ! in_array( $post_id, $this->pids ) )
{
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files') );
}
$postid_array = array( 1 => $post_id );
if ( $post_id and $post_id != $this->topic['topic_firstpost'] )
@@ -247,7 +241,7 @@ class topic_display
if ( count($parents) )
{
foreach( $parents as $p => $pid )
foreach( $parents as $pid )
{
if ( $pid != $this->topic['topic_firstpost'] )
{
@@ -375,7 +369,7 @@ class topic_display
{
$html .= $this->ipsclass->compiled_templates['skin_topic']->toutline_start_new_parent();
foreach( $this->structured_pids[ $root_id ] as $idx => $pid )
foreach( $this->structured_pids[ $root_id ] as $pid )
{
$html .= $this->render_list_row( $this->post_cache[ $pid ], $dguide );
@@ -466,11 +460,11 @@ class topic_display
if ( strstr( $this->used_post_ids, ','.$post['pid'].',' ) )
{
return $this->ipsclass->compiled_templates['skin_topic']->toutline_show_row_highlight( $post );
return $this->ipsclass->compiled_templates['skin_topic']->toutline_show_row_highlight( $post, $this->ipsclass->input['start'], $this->ipsclass->input['st'] );
}
else
{
return $this->ipsclass->compiled_templates['skin_topic']->toutline_show_row( $post );
return $this->ipsclass->compiled_templates['skin_topic']->toutline_show_row( $post, $this->ipsclass->input['start'], $this->ipsclass->input['st'] );
}
}
@@ -481,6 +475,24 @@ class topic_display
function post_get_parents($root_id, $ids=array())
{
if( in_array( $root_id, $ids ) )
{
$cnt = 0;
foreach( $ids as $id )
{
if( $id == $root_id )
{
$cnt++;
if( $cnt > 1 )
{
return $ids;
}
}
}
}
if ( $this->post_cache[ $root_id ]['post_parent'] )
{
$ids[] = $this->post_cache[ $root_id ]['post_parent'];
@@ -499,7 +511,7 @@ class topic_display
{
if ( is_array($this->structured_pids[ $root_id ]) )
{
foreach( $this->structured_pids[ $root_id ] as $id => $pid )
foreach( $this->structured_pids[ $root_id ] as $pid )
{
$ids[] = $pid;
File diff suppressed because it is too large. Load diff
+1 -15
View File
@@ -1,15 +1 @@
<html>
<head><title>Ошибка &lt; Русская версия Invision Power Board</title></head>
<body>
<h1>Ошибка &lt; Русская версия Invision Power Board</h1>
<hr>
Вы попали на несуществующую страницу!<br>Пожалуйста нажмите на кнопочку &laquo;<b>Назад</b>&raquo;
в вашем браузере для возвращения на предыдущую страницу.
<hr>
<b>Invision Power Board:</b>
<ul>
<li><a href="http://www.bestwarez.ru" title="BestWarez.Ru - Только лучший Варез!">Русская версия</a></li>
<li><a href="http://www.invisionboard.com" title="Official Site">English version</a></li>
</ul>
</body>
</html>
<html> <head><title>Invision Power Board - Bulletin Board System</title></head> <body> <h1>403: Invision Power Board -> Forbidden</h1> <hr> You have reached this Page in error, please use your back button to return to Invision Board. <hr> <a href="http://www.invisionboard.com/">Invision Power Board</a> </body> </html>
+16 -17
View File
@@ -2,27 +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
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $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 $
+---------------------------------------------------------------------------
|
@@ -34,6 +24,11 @@
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}
class post_parser {
@@ -90,6 +85,8 @@ class post_parser {
$ibforums->cache['emoticons'][] = $r;
}
usort( $ibforums->cache['emoticons'] , array( 'post_parser', 'smilie_length_sort' ) );
if ( $load )
{
$std->update_cache( array( 'name' => 'emoticons', 'array' => 1, 'deletefirst' => 1 ) );
@@ -126,6 +123,8 @@ class post_parser {
$ibforums->cache['badwords'][] = $r;
}
usort( $ibforums->cache['emoticons'] , array( 'post_parser', 'word_length_sort' ) );
if ( $load )
{
$std->update_cache( array( 'name' => 'badwords', 'array' => 1, 'deletefirst' => 1 ) );
@@ -860,8 +859,8 @@ class post_parser {
global $ibforums;
$used = array(
'quote' => array( 'title' => 'Öèòàòà', 'css_top' => 'quotetop' , 'css_main' => 'quotemain' ),
'code' => array( 'title' => 'Èñõîäíûé êîä' , 'css_top' => 'codetop' , 'css_main' => 'codemain' ),
'quote' => array( 'title' => 'QUOTE', 'css_top' => 'quotetop' , 'css_main' => 'quotemain' ),
'code' => array( 'title' => 'CODE' , 'css_top' => 'codetop' , 'css_main' => 'codemain' ),
'sql' => array( 'title' => 'SQL' , 'css_top' => 'sqltop' , 'css_main' => 'sqlmain' ),
'html' => array( 'title' => 'HTML' , 'css_top' => 'htmltop' , 'css_main' => 'htmlmain' )
);
@@ -1308,7 +1307,7 @@ class post_parser {
$url = str_replace( " ", "%20", $url );
return "<img src='$url' border='0' alt='îïóáëèêîâàííîå ïîëüçîâàòåëåì èçîáðàæåíèå' />";
return "<img src='$url' border='0' alt='user posted image' />";
}
+69 -69
View File
@@ -2,28 +2,18 @@
/*
+--------------------------------------------------------------------------
| 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
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2006-02-02 17:23:13 +0000 (Thu, 02 Feb 2006) $
| > $Revision: 133 $
| > $Author: bfarber $
| > $Date: 2006-09-22 11:28:54 +0100 (Fri, 22 Sep 2006) $
| > $Revision: 567 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
| > MySQL FULL TEXT Search Library
@@ -34,6 +24,11 @@
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}
class search_lib extends Search
{
@@ -114,8 +109,6 @@ class search_lib extends Search
}
}
//print $check_keywords; exit();
//-----------------------------------------
// Get forums...
//-----------------------------------------
@@ -153,11 +146,16 @@ class search_lib extends Search
// How many results?
//-----------------------------------------
$this->ipsclass->DB->query("SELECT COUNT(*) as dracula
FROM ".SQL_PREFIX."posts p
LEFT JOIN ".SQL_PREFIX."topics t ON (t.tid=p.topic_id)
WHERE t.forum_id IN ($myforums) {$topics_name} {$approved}
AND MATCH(p.post) AGAINST ('$check_keywords' $boolean)");
$this->ipsclass->DB->build_query( array( 'select' => 'COUNT(*) as dracula',
'from' => array( 'posts' => 'p' ),
'add_join' => array( 1 => array( 'type' => 'left',
'from' => array( 'topics' => 't' ),
'where' => 't.tid=p.topic_id',
) ),
'where' => "t.forum_id IN ({$myforums}) {$topics_name} {$approved}
AND MATCH(p.post) AGAINST ('{$check_keywords}' {$boolean})"
) );
$this->ipsclass->DB->exec_query();
$count = $this->ipsclass->DB->fetch_row();
@@ -172,8 +170,8 @@ class search_lib extends Search
// Store it daddy-o!
//-----------------------------------------
$cache = "SELECT MATCH(post) AGAINST ('$check_keywords' $boolean) as score, t.tid, t.posts as topic_posts, t.title as topic_title, t.views, t.forum_id,
p.post, p.author_id, p.author_name, p.post_date, p.pid, p.post_htmlstate,m.*, me.*
$cache = "SELECT MATCH(post) AGAINST ('$check_keywords' $boolean) as score, t.approved, t.tid, t.posts as topic_posts, t.title as topic_title, t.views, t.forum_id,
p.post, p.author_id, p.author_name, p.post_date, p.queued, p.pid, p.post_htmlstate,m.*, me.*
FROM ".SQL_PREFIX."posts p
LEFT JOIN ".SQL_PREFIX."topics t on (p.topic_id=t.tid)
LEFT JOIN ".SQL_PREFIX."members m on (m.id=p.author_id)
@@ -188,19 +186,18 @@ class search_lib extends Search
$unique_id = md5(uniqid(microtime(),1));
$str = $this->ipsclass->DB->compile_db_insert_string( array (
'id' => $unique_id,
'search_date'=> time(),
'topic_id' => '00',
'topic_max' => $count['dracula'],
'member_id' => $this->ipsclass->member['id'],
'ip_address' => $this->ipsclass->input['IP_ADDRESS'],
'post_id' => '00',
'query_cache'=> $cache,
) );
$str = array (
'id' => $unique_id,
'search_date'=> time(),
'topic_id' => '00',
'topic_max' => $count['dracula'],
'member_id' => $this->ipsclass->member['id'],
'ip_address' => $this->ipsclass->input['IP_ADDRESS'],
'post_id' => '00',
'query_cache'=> $cache,
);
$this->ipsclass->DB->query("INSERT INTO ibf_search_results ({$str['FIELD_NAMES']}) VALUES ({$str['FIELD_VALUES']})");
$this->ipsclass->DB->do_insert( "search_results", $str );
$hilight = str_replace( '&quot;', '', $this->ipsclass->input['keywords'] );
$hilight = urlencode(trim(str_replace( '&amp;', '&', $hilight)));
@@ -231,7 +228,8 @@ class search_lib extends Search
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_search_results' ) );
}
$this->ipsclass->DB->query("SELECT * FROM ibf_search_results WHERE id='{$this->unique_id}'");
$this->ipsclass->DB->build_query( array( 'select' => '*', 'from' => 'search_results', 'where' => "id='".$this->unique_id."'" ) );
$this->ipsclass->DB->exec_query();
if ( ! $sr = $this->ipsclass->DB->fetch_row() )
{
@@ -310,7 +308,7 @@ class search_lib extends Search
// Link member's name
if ($row['author_id'])
if ( $row['author_id'] )
{
$row['author_name'] = "<a href='{$this->ipsclass->base_url}act=Profile&amp;MID={$row['author_id']}'>{$row['author_name']}</a>";
}
@@ -328,11 +326,14 @@ class search_lib extends Search
// Fix up quotes..
//-----------------------------------------
$row['class1'] = "row2";
$row['class2'] = "row1";
$row['classposts'] = "row2";
$this->topics->parser->parse_html = ( $this->ipsclass->forums->forum_by_id[$row['forum_id']]['use_html'] and $this->ipsclass->cache['group_cache'][ $row['mgroup'] ]['g_dohtml'] and $row['post_htmlstate'] ) ? 1 : 0;
$this->topics->parser->parse_wordwrap = $this->ipsclass->vars['post_wordwrap'];
$this->topics->parser->parse_nl2br = $row['post_htmlstate'] == 2 ? 1 : 0;
$row['post'] = $this->topics->parser->pre_db_parse( $this->topics->parser->pre_edit_parse( $row['post'] ) );
$row['post'] = $this->topics->parser->pre_display_parse( $row['post'] );
$keywords_array = explode( " ", str_replace( "+", " ", $this->ipsclass->input['highlite'] ) );
@@ -396,7 +397,7 @@ class search_lib extends Search
if( is_array($this->ipsclass->cache['moderators']) AND count($this->ipsclass->cache['moderators']) )
{
foreach( $this->ipsclass->cache['moderators'] as $k => $v )
foreach( $this->ipsclass->cache['moderators'] as $v )
{
if( $v['member_id'] == $this->ipsclass->member['id'] AND $v['post_q'] )
{
@@ -425,17 +426,9 @@ class search_lib extends Search
// Do we have any input?
//-----------------------------------------
//-----------------------------------------
// USING FULL TEXT - Wooohoo!!
//-----------------------------------------
if ($this->ipsclass->input['namesearch'] != "")
{
$name_filter = $this->is->filter_keywords($this->ipsclass->input['namesearch'], 1);
}
$name_filter = (isset($this->ipsclass->input['namesearch']) AND $this->ipsclass->input['namesearch'] != "") ? $this->is->filter_keywords($this->ipsclass->input['namesearch'], 1) : '';
if ($this->ipsclass->input['useridsearch'] != "")
if (isset($this->ipsclass->input['useridsearch']) AND $this->ipsclass->input['useridsearch'] != "")
{
$keywords = $this->is->filter_keywords($this->ipsclass->input['useridsearch']);
$this->is->search_type = 'userid';
@@ -446,6 +439,8 @@ class search_lib extends Search
$this->is->search_type = 'posts';
}
$type = "postonly";
if ( $name_filter != "" AND $this->ipsclass->input['keywords'] != "" )
{
$type = 'joined';
@@ -459,6 +454,8 @@ class search_lib extends Search
$type='nameonly';
}
//-----------------------------------------
// USING FULL TEXT - Wooohoo!!
//-----------------------------------------
if ( $this->is->mysql_version >= 40010 )
@@ -530,7 +527,7 @@ class search_lib extends Search
}
//-----------------------------------------
if ($this->ipsclass->input['search_in'] == 'titles')
{
$this->is->search_in = 'titles';
@@ -588,6 +585,12 @@ class search_lib extends Search
$this->ipsclass->vars['min_search_word'] = 4;
}
$topics_datecut = "";
$posts_datecut = "";
$posts_name = "";
$topics_name = "";
//-----------------------------------------
// Add on the prune days
//-----------------------------------------
@@ -635,13 +638,13 @@ class search_lib extends Search
$name_filter = str_replace( '|', "&#124;", $name_filter );
if ($this->ipsclass->input['exactname'] == 1)
if (isset($this->ipsclass->input['exactname']) AND $this->ipsclass->input['exactname'] == 1)
{
$sql_query = "SELECT id from ibf_members WHERE LOWER(members_display_name)='".$name_filter."'";
$sql_query = "SELECT id from ".SQL_PREFIX."members WHERE members_l_display_name='".$name_filter."'";
}
else
{
$sql_query = "SELECT id from ibf_members WHERE members_display_name like '%".$name_filter."%'";
$sql_query = "SELECT id from ".SQL_PREFIX."members WHERE members_display_name like '%".$name_filter."%'";
}
@@ -673,7 +676,7 @@ class search_lib extends Search
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'search_word_short', 'EXTRA' => $this->ipsclass->vars['min_search_word']) );
}
}
$unique_id = md5(uniqid(microtime(),1));
if ($type != 'nameonly')
@@ -681,16 +684,15 @@ class search_lib extends Search
if ( ! $this->is->topic_search_only )
{
$topics_query = "SELECT t.tid, t.approved, t.forum_id
FROM ibf_topics t
FROM ".SQL_PREFIX."topics t
WHERE $topics_datecut t.forum_id IN ($forums)
$topics_name AND t.approved=1 AND MATCH(title) AGAINST ('".trim($keywords)."' $boolean)";
$topics_name AND MATCH(title) AGAINST ('".trim($keywords)."' $boolean)";
$posts_query = "SELECT p.pid, p.queued, t.approved, t.forum_id
FROM ibf_posts p
LEFT JOIN ibf_topics t ON ( p.topic_id=t.tid )
FROM ".SQL_PREFIX."posts p
LEFT JOIN ".SQL_PREFIX."topics t ON ( p.topic_id=t.tid )
WHERE $posts_datecut t.forum_id IN ($forums)
AND p.queued=0
$posts_name AND MATCH(post) AGAINST ('".trim($keywords)."' $boolean)";
}
else
@@ -700,12 +702,11 @@ class search_lib extends Search
//-----------------------------------------
$posts_query = "SELECT p.pid, p.queued, t.approved, t.forum_id
FROM ibf_posts p
LEFT JOIN ibf_topics t ON ( p.topic_id=t.tid )
FROM ".SQL_PREFIX."posts p
LEFT JOIN ".SQL_PREFIX."topics t ON ( p.topic_id=t.tid )
WHERE
p.topic_id={$this->is->topic_id}
AND $posts_datecut t.forum_id IN ($forums)
AND p.queued=0
$posts_name AND MATCH(post) AGAINST ('".trim($keywords)."' $boolean)";
}
}
@@ -713,15 +714,14 @@ class search_lib extends Search
{
$topics_query = "SELECT t.tid, t.approved, t.forum_id
FROM ibf_topics t
FROM ".SQL_PREFIX."topics t
WHERE $topics_datecut t.forum_id IN ($forums)
$topics_name AND t.approved=1";
$topics_name";
$posts_query = "SELECT p.pid, p.queued, t.approved, t.forum_id
FROM ibf_posts p
LEFT JOIN ibf_topics t ON ( p.topic_id=t.tid )
FROM ".SQL_PREFIX."posts p
LEFT JOIN ".SQL_PREFIX."topics t ON ( p.topic_id=t.tid )
WHERE $posts_datecut t.forum_id IN ($forums)
AND p.queued=0
$posts_name";
}
//print $topics_query."<br />".$posts_query; exit();
@@ -860,7 +860,7 @@ class search_lib extends Search
{
$this->output .= $this->ipsclass->compiled_templates['skin_search']->search_error_page($this->ipsclass->input['keywords']);
$this->ipsclass->print->add_output( $this->output );
$this->ipsclass->print->do_output( array( 'TITLE' => $this->ipsclass->lang['g_simple_title'], 'JS' => 0, NAV => array( $this->ipsclass->lang['g_simple_title'] ) ) );
$this->ipsclass->print->do_output( array( 'TITLE' => $this->ipsclass->lang['g_simple_title'], 'JS' => 0, 'NAV' => array( $this->ipsclass->lang['g_simple_title'] ) ) );
}
}
+35 -38
View File
@@ -2,28 +2,18 @@
/*
+--------------------------------------------------------------------------
| 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
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2006-02-02 17:23:13 +0000 (Thu, 02 Feb 2006) $
| > $Revision: 133 $
| > $Author: bfarber $
| > $Date: 2006-09-22 11:28:54 +0100 (Fri, 22 Sep 2006) $
| > $Revision: 567 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
| > MySQL Manual Search Library
@@ -34,6 +24,11 @@
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}
class search_lib extends Search
{
@@ -62,13 +57,9 @@ class search_lib extends Search
// Do we have any input?
//-----------------------------------------
if ($this->ipsclass->input['namesearch'] != "")
{
$name_filter = $this->is->filter_keywords($this->ipsclass->input['namesearch'], 1);
}
$name_filter = (isset($this->ipsclass->input['namesearch']) AND $this->ipsclass->input['namesearch'] != "") ? $this->is->filter_keywords($this->ipsclass->input['namesearch'], 1) : '';
if ($this->ipsclass->input['useridsearch'] != "")
if (isset($this->ipsclass->input['useridsearch']) AND $this->ipsclass->input['useridsearch'] != "")
{
$keywords = $this->is->filter_keywords($this->ipsclass->input['useridsearch']);
$this->is->search_type = 'userid';
@@ -79,6 +70,8 @@ class search_lib extends Search
$this->is->search_type = 'posts';
}
$type = 'postonly';
if ( $name_filter != "" AND $this->ipsclass->input['keywords'] != "" )
{
$type = 'joined';
@@ -130,7 +123,7 @@ class search_lib extends Search
foreach( array( 'last_post', 'posts', 'starter_name', 'forum_id' ) as $v )
{
if ($this->ipsclass->input['sort_key'] == $v)
if (isset($this->ipsclass->input['sort_key']) AND $this->ipsclass->input['sort_key'] == $v)
{
$this->is->sort_key = $v;
}
@@ -140,7 +133,7 @@ class search_lib extends Search
foreach ( array( 1, 7, 30, 60, 90, 180, 365, 0 ) as $v )
{
if ($this->ipsclass->input['prune'] == $v)
if (isset($this->ipsclass->input['prune']) AND $this->ipsclass->input['prune'] == $v)
{
$this->is->prune = $v;
}
@@ -148,14 +141,14 @@ class search_lib extends Search
//-----------------------------------------
if ($this->ipsclass->input['sort_order'] == 'asc')
if (isset($this->ipsclass->input['sort_order']) AND $this->ipsclass->input['sort_order'] == 'asc')
{
$this->is->sort_order = 'asc';
}
//-----------------------------------------
if ($this->ipsclass->input['result_type'] == 'posts')
if (isset($this->ipsclass->input['result_type']) AND $this->ipsclass->input['result_type'] == 'posts')
{
$this->is->result_type = 'posts';
}
@@ -165,6 +158,11 @@ class search_lib extends Search
$this->ipsclass->vars['min_search_word'] = 4;
}
$topics_datecut = "";
$posts_datecut = "";
$posts_name = "";
$topics_name = "";
//-----------------------------------------
// Add on the prune days
//-----------------------------------------
@@ -202,13 +200,13 @@ class search_lib extends Search
$name_filter = str_replace( '|', "&#124;", $name_filter );
if ($this->ipsclass->input['exactname'] == 1)
if (isset($this->ipsclass->input['exactname']) AND $this->ipsclass->input['exactname'] == 1)
{
$sql_query = "SELECT id from ibf_members WHERE LOWER(members_display_name)='".$name_filter."'";
$sql_query = "SELECT id from ".SQL_PREFIX."members WHERE members_l_display_name='".$name_filter."'";
}
else
{
$sql_query = "SELECT id from ibf_members WHERE members_display_name like '%".$name_filter."%'";
$sql_query = "SELECT id from ".SQL_PREFIX."members WHERE members_display_name like '%".$name_filter."%'";
}
@@ -295,29 +293,28 @@ class search_lib extends Search
}
$topics_query = "SELECT t.tid, t.approved, t.forum_id
FROM ibf_topics t
FROM ".SQL_PREFIX."topics t
WHERE {$topic_filter}{$topics_datecut} t.forum_id IN ($forums)
$topics_name AND t.approved=1 AND ($title_like)";
$topics_name AND ($title_like)";
$posts_query = "SELECT p.pid, p.queued, t.approved, t.forum_id
FROM ibf_posts p
LEFT JOIN ibf_topics t on (t.tid=p.topic_id)
FROM ".SQL_PREFIX."posts p
LEFT JOIN ".SQL_PREFIX."topics t on (t.tid=p.topic_id)
WHERE {$topic_filter}{$posts_datecut} t.forum_id IN ($forums)
AND p.queued=0
$posts_name AND ($post_like)";
}
else
{
$topics_query = "SELECT t.tid, t.approved, t.forum_id
FROM ibf_topics t
FROM ".SQL_PREFIX."topics t
WHERE $topics_datecut t.forum_id IN ($forums)
$topics_name";
$posts_query = "SELECT p.pid, p.queued, t.approved, t.forum_id
FROM ibf_posts p
LEFT JOIN ibf_topics t on (t.tid=p.topic_id)
FROM ".SQL_PREFIX."posts p
LEFT JOIN ".SQL_PREFIX."topics t on (t.tid=p.topic_id)
WHERE $posts_datecut t.forum_id IN ($forums)
AND p.queued=0
$posts_name";
@@ -339,9 +336,9 @@ class search_lib extends Search
$my_invisible_forums_t = array();
$my_invisible_forums_p = array();
if( is_array($this->ipsclass->cache['moderators']) AND count($this->ipsclass->cache['moderators']) )
if( isset($this->ipsclass->cache['moderators']) AND is_array($this->ipsclass->cache['moderators']) AND count($this->ipsclass->cache['moderators']) )
{
foreach( $this->ipsclass->cache['moderators'] as $k => $v )
foreach( $this->ipsclass->cache['moderators'] as $v )
{
if( $v['member_id'] == $this->ipsclass->member['id'] AND $v['post_q'] )
{
+123 -110
View File
@@ -1,189 +1,202 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board
| ========================================
| by Matthew Mecham
| (c) 2001 - 2003 Invision Power Services
| http://www.invisionpower.com
| ========================================
| Web: http://www.invisionboard.com
| Email: matt@invisionpower.com
| Licence Info: http://www.invisionboard.com/?license
+--------------------------------------------------------------------------
*/
$css_names = array(
'BODY' => "Тело web-страницы",
'TABLE, TR, TD' => "Таблица по умолчанию",
'a:link, a:visited, a:active' => "Ссылка по умолчанию",
'a:hover' => "Ссылка по умолчанию при наведении курсора",
'.googlebottom, .googlebottom a:link, .googlebottom a:visited, .googlebottom a:active' => "Результаты простого поиска: темный",
'.googlish, .googlish a:link, .googlish a:visited, .googlish a:active' => "Результаты простого поиска: ссылка на тему",
'.googlesmall, .googlesmall a:link, .googlesmall a:active, .googlesmall a:visited' => "Результаты простого поиска: маленький текст",
'option.sub' => "Форма поиска: меню выбора форумов: цвет подкатегории",
'.caldate' => "Календарь: дата",
'#ucpmenu' => "Личные данные пользователя: цвет меню",
'#ucpcontent' => "Личные данные пользователя: цвет шрифта",
'#logostrip' => "Верхняя часть форума: полоса с логотипом",
'#submenu' => "Верхняя часть форума: полоса с иконками",
'#submenu a:link, #submenu a:visited, #submenu a:active' => "Верхняя часть форума: полоска с иконками: цвет ссылок полосы с иконками",
'#userlinks' => "Верхняя часть форума: меню пользователя",
'.activeuserstrip' => 'Форумы и топики: активные пользователи',
'.pformstrip' => 'Глобально: подзаголовок',
'.pformleft' => 'Глобально: левая колонка',
'.pformleftw' => 'Глобально: ширина левой колонки',
'.pformright' => 'Глобально: правая колонка',
'.post1' => 'Просмотр сообщений: альтернативный цвет #1',
'.post2' => 'Просмотр сообщений: альтернативный цвет #2',
'.postlinksbar' => 'Просмотр сообщений: подписка на тему и другие ссылки',
'.row1' => 'Глобально: альтернативная строка #1',
'.row2' => 'Глобально: альтернативная строка #2',
'.row3' => 'Глобально: альтернативная строка #3',
'.row4' => 'Глобально: альтернативная строка #4',
'.darkrow1' => 'Глобально: альтернативная темная строка #1',
'.darkrow2' => 'Глобально: альтернативная темная строка #2',
'.darkrow3' => 'Глобально: альтернативная темная строка #3',
'.hlight' => 'Персональные сообщения: входящие &#151; выбранная строка',
'.dlight' => 'Персональные сообщения: входящие &#151; невыбранная строка',
'.titlemedium' => 'Глобально: подзаголовок (меньший)',
'.titlemedium a:link, .titlemedium a:visited, .titlemedium a:active' =>'Глобально: ссылки подзаголовка (меньшего)',
'.maintitle' => 'Глобально: заголовок главной таблицы',
'.maintitle a:link, .maintitle a:visited, .maintitle a:active' => 'Глобально: ссылки заголовка главной таблицы',
'.plainborder' => 'Глобально: альтернативная таблица #1',
'.tableborder' => 'Глобально: цвет фона между ячейками таблицы',
'.tablefill' => 'Глобально: альтернативная таблица #2',
'.tablepad' => 'Глобально: альтернативная таблица #3',
'.desc' => 'Просмотр форума: информация о последнем сообщении',
'.signature' => 'Просмотр сообщений: подпись',
'.normalname' => 'Просмотр сообщений: имя пользователя (зарегистрированное)',
'.unreg' => 'Просмотр сообщений: незарегистрированное имя',
'.searchlite' => 'Глобально: цвет подсветки ключевых слов поиска',
'#QUOTE' => 'Блок цитаты',
'#CODE' => 'Блок программного кода',
'BODY' => "Web Page Body",
'TABLE, TR, TD' => "Default table",
'a:link, a:visited, a:active' => "Default link",
'a:hover' => "Default link hover",
'.googlebottom, .googlebottom a:link, .googlebottom a:visited, .googlebottom a:active' => "Simple Search Results: Dark",
'.googlish, .googlish a:link, .googlish a:visited, .googlish a:active' => "Simple Search Results: Topic Link",
'.googlesmall, .googlesmall a:link, .googlesmall a:active, .googlesmall a:visited' => "Simple Search Results: Small Text",
'option.sub' => "Search Form: Select forums box: subcat colour",
'.caldate' => "Calendar: Date",
'#ucpmenu' => "User CP: Menu colour",
'#ucpcontent' => "User CP: Content colour",
'#logostrip' => "Board Header: Logo Strip",
'#submenu' => "Board Header: Icon Strip",
'#submenu a:link, #submenu a:visited, #submenu a:active' => "Board Header: Icon Strip link colours",
'#userlinks' => "Board Header: Member Bar",
'.activeuserstrip' => 'Forums & Topics: Active users bar',
'.tablesubheader' => 'Global: Sub heading',
'.pformleft' => 'Global: left side table cell',
'.pformleftw' => 'Global: left side table cell wide',
'.pformright' => 'Global: right side table cell',
'.post1' => 'Post View: Alt colour #1',
'.post2' => 'Post View: Alt colour #2',
'.postlinksbar' => 'Post View: Track topic, etc links',
'.row1' => 'Global: Alt row #1',
'.row2' => 'Global: Alt row #2',
'.row3' => 'Global: Alt row #3',
'.row4' => 'Global: Alt row #4',
'.darkrow1' => 'Global: Alt dark row #1',
'.darkrow2' => 'Global: Alt dark row #2',
'.darkrow3' => 'Global: Alt dark row #3',
'.hlight' => 'Msgr: Inbox row selected',
'.dlight' => 'Msgr: Inbox row not selected',
'.tablesubheader' => 'Global: Sub heading (minor)',
'.tablesubheader a:link, .tablesubheader a:visited, .tablesubheader a:active' =>'Global: Sub heading (minor) Links',
'.maintitle' => 'Global: Main table heading',
'.maintitle a:link, .maintitle a:visited, .maintitle a:active' => 'Global: Main table heading Links',
'.plainborder' => 'Global: Table alt #1',
'.tableborder' => 'Global: Table cellspacing colour',
'.tablefill' => 'Global: Table alt #2',
'.tablepad' => 'Global: Table alt #3',
'.desc' => 'Forum View: Last post info',
'.signature' => 'Post View: Signature',
'.normalname' => 'Post View: Member name (reg)',
'.unreg' => 'Post View: Unreg name',
'.searchlite' => 'Global: Search highlighting',
'#QUOTE' => 'Quote Box',
'#CODE' => 'Code Box',
);
$skin_names = array(
'skin_boards' => array(
'skin_boards (Главная страница форума) ',
'Элементы главной страницы форума (отображает все форумы и подфорумы), такие, как ссылки на форумы, блок активных пользователей, статистика, именинники и последние события календаря.',
'Board Index',
'Elements for the board index listing (shows you all the forums and is the first page you see when visiting the board) such as
forum link HTML, active user overview HTML, board statistics overview HTML, today\'s birthdays overview HTML',
'act=idx'
),
'skin_buddy' => array(
'skin_buddy (Помощник)',
'Элементы окна &laquo;Помощник&raquo; включая ссылки и форму поиска.',
'MyAssistant',
'Elements for the myAssistant feature, including links and search boxes',
'act=buddy',
),
'skin_calendar'=> array(
'skin_calendar (Календарь)',
'Элементы календаря, включая просмотр самого календаря, дней календаря и конкретных событий.',
'Calendar',
'Elements for the calendar, including calendar view, view events',
'act=calendar'
),
'skin_editors' => array(
'skin_editors (Редактор сообщений)',
'Элементы стандартного и rich text редакторов, используемых для создания сообщений.',
'Post / PM Editor',
'Elements from the standard and rich text editors used when creating a new PM or post.',
'',
),
'skin_emails' => array(
'skin_emails (Контакты пользователя)',
'Элементы различных форм контактов, такие как e-mail и жалоба пользователя на некорректное сообщение.',
'skin_emails' => array(
'Member Contact',
'Elements from various contact methods, such as email form and report post to moderator form',
'',
),
'skin_forum' => array(
'skin_forum (Просмотр конкретного форума)',
'Элементы отображения конкретного форума (список тем и опросов), включая свои правила выбранного форума и т.д.',
'Forum Index',
'Elements for forum view (list all topics in forum). Includes forum log in window, forum rules',
'act=SF&f=1',
),
'skin_global' => array(
'skin_global (Основные HTML фрагменты)',
'Различные глобальные элементы форума &#151; верхняя (логотип с ссылками) и нижняя часть всех страниц форума, промежуточная страница переадресации, страница описания ошибки форума и т.д.',
'All Global HTML',
'Various HTML elements such as board header, redirect page, error page',
),
'skin_help' => array(
'skin_help (Помощь)',
'Элементы раздела &laquo;Помощь&raquo;.',
'skin_help' => array(
'Help',
'Elements for the help screen, including search boxes and view help files',
'act=help'
),
'skin_legends' => array(
'skin_legends (Легенды форума)',
'Элементы различных вспомогательных страниц типа страницы со всеми смайликами, описанием BB кодов форума и т.д.',
'Board Legends',
'Elements for the "view all emoticons" windows, and the "Find User"',
'act=legends'
),
'skin_login' => array(
'skin_login (Вход в форум)',
'Элементы авторизации пользователя для входа на форум.',
'Log In',
'Elements for the log in form',
'act=Login'
),
'skin_mlist' => array(
'skin_mlist (Список пользователей)',
'Все элементы списка всех пользователей форума.',
'Member List',
'Elements for the member list views',
'act=Members'
),
'skin_mod' => array(
'skin_mod (Функции модератора)',
'Элементы для работы модераторов, такие как удаление тему, редактирование тему и т.д.',
'Moderator Function',
'Elements for the moderator tools such as delete topic, edit topic and the moderator CP',
),
'skin_msg' => array(
'skin_msg (Личные сообщения)',
'Элементы личных сообщений, такие как входящие сообщения, написание новых личных сообщений, архивирование и т.д.',
'Messenger',
'Elements for the messenger, such as view inbox, view message, archive messages, etc',
'act=Msg',
),
'skin_online' => array (
'skin_online (Список активных пользователей)',
'Все элементы отображения раздела активных пользователей.',
'Online List',
'Elements for the "Show all online users" link',
'act=Online',
),
'skin_poll' => array (
'skin_poll (Просмотр опросов)',
'Элементы просмотра опросов, включая результаты опроса и т.д.',
'View Poll',
'Elements for the poll view, includes vote form and vote results',
),
'skin_post' => array(
'skin_post (Публикация сообщений)',
'Элементы публикации сообщений, открытие темы и т.д.',
'Post Screen',
'Elements for the post screens such as new topic, reply to topic, quote post, edit post, some messenger new PM sections, some calender new event',
),
'skin_printpage'=> array(
'skin_printpage (Версия темы для печати)',
'Все элементы версии темы для печати.',
'Printable Topic',
'Elements for displaying the "printable topic" page',
),
'skin_profile' => array(
'skin_profile (Просмотр профиля)',
'Элементы просмотра профиля пользователей, данные, фотография и т.д.',
'Profile View',
'Elements for viewing a members profile',
'showuser=1',
),
'skin_register' => array(
'skin_register (Регистрация)',
'Элементы страниц регистрации, активации учетной записи и т.д.',
'Register',
'Elements for the register form, validate account form and COPPA forms',
'act=Reg',
),
'skin_search' => array(
'skin_search (Поиск)',
'Элементы формы поиска и результатыпоиска...',
'Search',
'Elements for the search forum and the results view',
'act=Search',
),
'skin_stats' => array(
'skin_stats (Статистика)',
'Элементы различных функций, таких как вывод администраторов и модераторов форума, активных тем и т.д.',
'Statistics',
'Elements for various functions such as "View Moderating Team", "View todays top 10 posts", "View Active Topics"',
'act=Stats',
),
'skin_topic' => array(
'skin_topic (Просмотр темы)',
'Элементы просмотра темы, такие как просмотр сообщений, прикрепленные файлы, форма быстрого ответа и т.д.',
'Topic View',
'Elements for the topic view screen, such as post view, inline attachment view, etc.',
'showtopic=1'
),
'skin_modcp' => array(
'skin_modcp (Панель управления для модератора)',
'Элементы секций панели управления для модератора.',
'Mod CP',
'Elements for the moderators control panel sections.',
'act=ModCP',
),
'skin_portal' => array(
'skin_portal (Портал)',
'Все элементы портала для IPB.',
'IPB Portal',
'Elements for IPB Portal.',
),
'skin_ucp' => array(
'skin_ucp (Личные данные пользователя)',
'Элементы личных данных пользователя, такие как редактирование профиля, настроек форума, подпись, аватар и т.д.',
'User Control Panel',
'Elements for the user control panel, such as the menu (also used in Messenger Views), edit profile, edit signature, edit avatar, etc.',
'act=UserCP',
),
'skin_subscriptions' => array(
'skin_subscriptions (Менеджер подписок)',
'Элементы менеджера подписок.',
'Subscriptions Manager',
'Elements for the subscription manager.',
)
);
@@ -191,4 +204,4 @@ $skin_names = array(
$bit_names = array();
?>
?>
+26 -24
View File
@@ -2,28 +2,18 @@
/*
+--------------------------------------------------------------------------
| 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
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2005-12-01 16:45:12 +0000 (Thu, 01 Dec 2005) $
| > $Revision: 88 $
| > $Author: bfarber $
| > $Date: 2006-10-03 12:14:55 +0100 (Tue, 03 Oct 2006) $
| > $Revision: 596 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
| > Tar creation and extraction module
@@ -66,6 +56,11 @@
*************************************************************/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}
class tar {
@@ -91,17 +86,17 @@ class tar {
// CONSTRUCTOR: Attempt to guess the current working dir.
//-----------------------------------------
function tar_init() {
function tar_init()
{
$this->ipsclass->load_language('lang_tar');
if ($this_dir = getcwd())
if ( $this_dir == getcwd() )
{
$this->current_dir = $this_dir;
}
else if (isset($_SERVER['DOCUMENT_ROOT']))
else if ( $this->ipsclass->my_getenv( 'DOCUMENT_ROOT' ) )
{
$this->current_dir = $_SERVER['DOCUMENT_ROOT'];
$this->current_dir = $this->ipsclass->my_getenv( 'DOCUMENT_ROOT' );
}
else
{
@@ -316,13 +311,19 @@ class tar {
return;
}
foreach ($in_files as $k => $file) {
foreach ($in_files as $file)
{
//-----------------------------------------
// Stop any potential file traversal issues
//-----------------------------------------
$file['name'] = str_replace( '..', '', $file['name'] );
//-----------------------------------------
// Are we choosing which files to extract?
//-----------------------------------------
if (is_array($files))
if ( is_array($files) )
{
if (! in_array($file['name'], $files) )
{
@@ -341,7 +342,8 @@ class tar {
{
$path_info = explode( "/" , $file['name'] );
$file_name = array_pop($path_info);
} else
}
else
{
$path_info = array();
$file_name = $file['name'];