Version 2.3.6

This commit is contained in:
Neo committed 2025-12-19 00:26:08 -08:00
1 parent a3bb603c96
commit 19b38c7c74
764 files changed
+143731 -118164

No files matched your search

@@ -23,23 +23,23 @@
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();
}
class version_upgrade
{
var $install;
/*-------------------------------------------------------------------------*/
// CONSTRUCTOR
/*-------------------------------------------------------------------------*/
function version_upgrade( & $install )
{
$this->install = & $install;
}
/*-------------------------------------------------------------------------*/
// Auto run..
/*-------------------------------------------------------------------------*/
@@ -79,12 +79,12 @@ class version_upgrade
case 'update_template_bits':
$this->update_template_bits();
break;
default:
$this->upgrade_sql(1);
break;
}
if ( $this->install->saved_data['workact'] )
{
return false;
@@ -94,12 +94,12 @@ class version_upgrade
return true;
}
}
/*-------------------------------------------------------------------------*/
// SQL: 0
/*-------------------------------------------------------------------------*/
function upgrade_sql( $id=1 )
{
$man = 0; // Manual upgrade ? intval( $this->install->ipsclass->input['man'] );
@@ -107,40 +107,40 @@ class version_upgrade
$SQL = array();
$file = '_updates_'.$id.'.php';
$output = "";
if ( file_exists( ROOT_PATH . 'upgrade/installfiles/upg_22005/' . strtolower($this->install->ipsclass->vars['sql_driver']) . $file ) )
{
require_once( ROOT_PATH . 'upgrade/installfiles/upg_22005/' . strtolower($this->install->ipsclass->vars['sql_driver']) . $file );
$this->install->error = array();
$this->sqlcount = 0;
$output = "";
$this->install->ipsclass->DB->return_die = 1;
foreach( $SQL as $query )
{
$this->install->ipsclass->DB->allow_sub_select = 1;
$this->install->ipsclass->DB->error = '';
$query = str_replace( "<%time%>", time(), $query );
if( $this->install->ipsclass->vars['mysql_tbl_type'] )
{
if( preg_match( "/^create table(.+?)/i", $query ) )
{
$query = preg_replace( "/^(.+?)\);$/is", "\\1) TYPE={$this->install->ipsclass->vars['mysql_tbl_type']};", $query );
}
}
}
if ( $this->install->saved_data['man'] )
{
$output .= preg_replace("/\sibf_(\S+?)([\s\.,]|$)/", " ".$this->install->ipsclass->DB->obj['sql_tbl_prefix']."\\1\\2", preg_replace( "/\s{1,}/", " ", $query ) )."\n\n";
}
else
{
{
$this->install->ipsclass->DB->query( $query );
if ( $this->install->ipsclass->DB->error )
{
$this->install->error[] = $query."<br /><br />".$this->install->ipsclass->DB->error;
@@ -151,77 +151,77 @@ class version_upgrade
}
}
}
$this->install->message = "Âûïîëíåíî $this->sqlcount çàïðîñîâ...";
$this->install->message = "$this->sqlcount queries run....";
}
//--------------------------------
// Next page...
//--------------------------------
$this->install->saved_data['st'] = 0;
if ( $id != 4 )
{
$nextid = $id + 1;
$this->install->saved_data['workact'] = 'sql'.$nextid;
$this->install->saved_data['workact'] = 'sql'.$nextid;
}
else
{
$this->install->saved_data['workact'] = 'forums';
$this->install->saved_data['workact'] = 'forums';
}
if ( $this->install->saved_data['man'] AND $output )
{
$this->install->message .= "<br /><br /><h3><b>Äëÿ ïðîäîëæåíèÿ îáíîâëåíèÿ íåîáõîäèìî âûïîëíèòü ñëåäóþùèå MySQL çàïðîñû:</b></h3><br /><div class='eula'>".nl2br(htmlspecialchars($output)).'</div>';
$this->install->message .= "<br /><br /><h3><b>Please run these queries in your MySQL database before continuing..</b></h3><br />".nl2br(htmlspecialchars($output));
$this->install->do_man = 1;
}
}
}
}
/*-------------------------------------------------------------------------*/
// Update forums
/*-------------------------------------------------------------------------*/
function update_forums()
{
//-----------------------------------------
// Update latest news...
//-----------------------------------------
$this->install->ipsclass->DB->simple_update( "forums", "newest_title=last_title, newest_id=last_id" );
$this->install->ipsclass->DB->exec_query();
//-----------------------------------------
// INIT
//-----------------------------------------
$ignore_me = array( 'redirect_url', 'redirect_loc', 'rules_text', 'permission_custom_error', 'notify_modq_emails' );
if ( isset($this->install->ipsclass->vars['forum_cache_minimum']) AND $this->install->ipsclass->vars['forum_cache_minimum'] )
{
$ignore_me[] = 'description';
$ignore_me[] = 'rules_title';
}
$this->install->ipsclass->cache['forum_cache'] = array();
$this->install->ipsclass->DB->simple_construct( array( 'select' => '*',
'from' => 'forums',
'order' => 'parent_id, position'
) );
$o = $this->install->ipsclass->DB->simple_exec();
while( $f = $this->install->ipsclass->DB->fetch_row( $o ) )
{
$fr = array();
$perms = unserialize(stripslashes($f['permission_array']));
//-----------------------------------------
// Stuff we don't need...
//-----------------------------------------
if ( $f['parent_id'] == -1 )
{
$fr['id'] = $f['id'];
@@ -248,19 +248,19 @@ class version_upgrade
}
}
}
$fr['read_perms'] = isset($perms['read_perms']) ? $perms['read_perms'] : '';
$fr['reply_perms'] = isset($perms['reply_perms']) ? $perms['reply_perms'] : '';
$fr['start_perms'] = isset($perms['start_perms']) ? $perms['start_perms'] : '';
$fr['upload_perms'] = isset($perms['upload_perms']) ? $perms['upload_perms'] : '';
$fr['download_perms'] = $perms['upload_perms'];
$fr['show_perms'] = isset($perms['show_perms']) ? $perms['show_perms'] : '';
unset($fr['permission_array']);
}
$this->install->ipsclass->cache['forum_cache'][ $fr['id'] ] = $fr;
$perm_array = addslashes(serialize(array(
'start_perms' => $fr['start_perms'],
'reply_perms' => $fr['reply_perms'],
@@ -269,58 +269,58 @@ class version_upgrade
'download_perms' => $fr['download_perms'],
'show_perms' => $fr['show_perms']
) ) );
//-----------------------------------------
// Add to save array
//-----------------------------------------
$this->install->ipsclass->DB->do_update( 'forums', array( 'permission_array' => $perm_array ), 'id='.$fr['id'] );
}
$this->install->ipsclass->update_cache( array( 'name' => 'forum_cache', 'array' => 1, 'deletefirst' => 1, 'donow' => 0 ) );
$this->install->message = "Äîáàâëåíû ïðàâà íà ñêà÷èâàíèå â ôîðóìàõ, ïåðåõîäèì ê îáíîâëåíèþ HTML-ëîãèêè â øàáëîíàõ...";
$this->install->message = "Download permissions added, Converting template bit HTML logic...";
$this->install->saved_data['workact'] = 'update_template_bits';
}
/*-------------------------------------------------------------------------*/
// Update template bits
/*-------------------------------------------------------------------------*/
function update_template_bits()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$updated = 0;
$_bits = array();
$start = $this->install->saved_data['st'];
$lend = 25;
$end = $start + $lend;
$done = 0;
//-----------------------------------------
// Get API class
//-----------------------------------------
require_once( ROOT_PATH . 'sources/api/api_skins.php' );
$api = new api_skins;
$api->ipsclass =& $this->ipsclass;
//-----------------------------------------
// OK..
//-----------------------------------------
$this->install->ipsclass->DB->build_query( array( 'select' => '*',
'from' => 'skin_templates',
'where' => 'set_id > 1',
'order' => 'suid ASC',
'limit' => array( $start, $lend ) ) );
$o = $this->install->ipsclass->DB->exec_query();
//-----------------------------------------
// Do it...
//-----------------------------------------
@@ -330,13 +330,13 @@ class version_upgrade
//-----------------------------------------
// Got some to convert!
//-----------------------------------------
while( $row = $this->install->ipsclass->DB->fetch_row( $o ) )
{
if ( preg_match( "#ipb\.|<if|<else#", $row['section_content'] ) )
{
$section_content = $api->skin_update_template_bit( $row['section_content'] );
if ( $section_content AND $section_content != $row['section_content'] )
{
$updated++;
@@ -349,76 +349,76 @@ class version_upgrade
{
$done = 1;
}
//-----------------------------------------
// Done?
//-----------------------------------------
if ( ! $done )
{
$this->install->message = "Ïðîâåðåíû øàáëîíû ñ $start ïî $end. Îáíîâëåíî: $updated...";
$this->install->saved_data['workact'] = 'update_template_bits';
$this->install->message = "Template bits: $start to $end completed. $updated updated...";
$this->install->saved_data['workact'] = 'update_template_bits';
$this->install->saved_data['st'] = $end;
return FALSE;
return FALSE;
}
else
{
$this->install->message = "Øàáëîíû îáíîâëåíû, ïåðåõîäèì ê óäàëåíèþ âðåìåííûõ äàííûõ...";
$this->install->saved_data['workact'] = 'finish';
return FALSE;
$this->install->message = "Template bits updated, finishing up...";
$this->install->saved_data['workact'] = 'finish';
return FALSE;
}
}
/*-------------------------------------------------------------------------*/
// Update forums
/*-------------------------------------------------------------------------*/
function finish_up()
{
//-----------------------------------------
// Has gallery?
//-----------------------------------------
$this->install->ipsclass->DB->return_die = 1;
$this->install->ipsclass->DB->error = '';
$table = 'members';
if ( ! $this->install->ipsclass->DB->field_exists( 'has_gallery', $table ) )
{
$this->install->ipsclass->DB->sql_add_field( 'members', 'has_gallery', 'INT(1)', '0' );
if ( $this->install->ipsclass->DB->error )
{
$this->install->error[] = "ALTER TABLE {$this->install->ipsclass->DB->obj['sql_tbl_prefix']}members ADD has_gallery INT(1) default 0<br /><br />".$this->install->ipsclass->DB->error;
}
}
if( $this->install->ipsclass->vars['conv_configured'] != 1 OR $this->install->ipsclass->vars['conv_chosen'] == "" )
{
if( $this->install->ipsclass->DB->field_exists( "legacy_password", "members" ) )
{
$this->install->ipsclass->DB->sql_drop_field( 'members', 'legacy_password' );
if ( $this->install->ipsclass->DB->error )
{
$this->install->error[] = "ALTER TABLE {$this->install->ipsclass->DB->obj['sql_tbl_prefix']}members DROP legacy_password<br /><br />".$this->install->ipsclass->DB->error;
}
}
}
$value = $this->install->ipsclass->DB->build_and_exec_query( array( 'select' => 'conf_value,conf_default', 'from' => 'conf_settings', 'where' => "conf_key='converge_login_method'" ) );
if( !$value['conf_value'] )
{
$value['conf_value'] = $value['conf_default'];
}
if( $value['conf_value'] )
{
$this->install->saved_data['ipbli_usertype'] = $value['conf_value'];
}
$test = $this->install->ipsclass->DB->build_and_exec_query( array( 'select' => 'count(*) as numrows',
'from' => 'cache_store',
'where' => "cs_key='calendars'"
@@ -428,59 +428,59 @@ class version_upgrade
{
$this->install->ipsclass->DB->do_insert( 'cache_store', array( 'cs_key' => 'calendars' ) );
}
//-----------------------------------------
// Rebuild group caches.
//-----------------------------------------
require_once( ROOT_PATH . 'sources/action_admin/groups.php' );
$groups = new ad_groups();
$groups->ipsclass =& $this->install->ipsclass;
$groups->rebuild_group_cache();
$this->install->message = "Óäàëåíèå âðåìåííûõ äàííûõ ìàñòåðà çàâåðøåíî, ïåðåõîäèì ê ñîçäàíèþ ãëàâíîãî ñòèëÿ IPB 2.2.0...";
$this->install->message = "Clean up performed, Creating new IPB 2.2.0 skin...";
$this->install->saved_data['workact'] = 'skin';
}
/*-------------------------------------------------------------------------*/
// Add new skin
/*-------------------------------------------------------------------------*/
function add_skin()
{
//-----------------------------------------
// Get default wrapper
//-----------------------------------------
$xml = new class_xml();
$xml->lite_parser = 1;
$content = implode( "", file( ROOT_PATH . 'resources/skinsets.xml' ) );
$xml->xml_parse_document( $content );
//-----------------------------------------
// Get CSS and WRAPPER
//-----------------------------------------
$CSS = $xml->xml_array['export']['group']['row'][0]['set_css']['VALUE'];
$WRAPPER = $xml->xml_array['export']['group']['row'][0]['set_cache_wrapper']['VALUE'];
//-----------------------------------------
// Turn off all other skins
//-----------------------------------------
$this->install->ipsclass->DB->do_update( 'skin_sets', array( 'set_default' => 0 ) );
//-----------------------------------------
// Insert new skin...
//-----------------------------------------
$this->install->ipsclass->DB->return_die = 1;
$this->install->ipsclass->DB->allow_sub_select = 1;
$this->install->ipsclass->DB->do_insert( 'skin_sets', array(
'set_name' => 'IPB Ãëàâíûé ñòèëü',
'set_name' => 'IPB 2.2.0 Default',
'set_image_dir' => 1,
'set_hidden' => 0,
'set_default' => 1,
@@ -493,41 +493,41 @@ class version_upgrade
'set_cache_wrapper' => $WRAPPER,
'set_emoticon_folder' => 'default',
) );
$this->install->saved_data['new_skin'] = $this->install->ipsclass->DB->get_insert_id();
//-----------------------------------------
// Update parent skin's CSS
//-----------------------------------------
$this->install->ipsclass->DB->return_die = 1;
$this->install->ipsclass->DB->allow_sub_select = 1;
$this->install->ipsclass->DB->do_update( 'skin_sets', array(
'set_cache_css' => $CSS,
'set_css' => $CSS,
'set_cache_wrapper' => $WRAPPER,
'set_wrapper' => $WRAPPER,
), "set_skin_set_id=1" );
), "set_skin_set_id=1" );
//-----------------------------------------
// Remove member's choice
//-----------------------------------------
$this->install->ipsclass->DB->do_update( 'members', array( 'skin' => '' ) );
$this->install->ipsclass->DB->do_update( 'members', array( 'skin' => '' ) );
//-----------------------------------------
// Done...
//-----------------------------------------
$this->install->message = "Ãëàâíûé ñòèëü IPB 2.2.0 ñîçäàí...";
$this->install->message = "2.2.0 skin created...";
unset($this->install->saved_data['workact']);
unset($this->install->saved_data['vid']);
return TRUE;
return TRUE;
}
}
?>