Version 2.2.0 RC-1
This commit is contained in:
1 parent
f73f8bff6d
commit
22f1b963ee
1034 files changed
+178610
-70897
No files matched your search
@@ -0,0 +1,2 @@
|
||||
<html>
|
||||
</html>
|
||||
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
|
||||
# Nothing of interest!
|
||||
|
||||
// $SQL[] = "";
|
||||
|
||||
$SQL[] = "TRUNCATE TABLE ibf_search_results;";
|
||||
|
||||
$SQL[] ="ALTER TABLE ibf_conf_settings_titles ADD conf_title_module varchar(200) NOT NULL default '';";
|
||||
$SQL[] ="ALTER TABLE ibf_conf_settings_titles change conf_title_desc conf_title_desc TEXT NOT NULL default '';";
|
||||
|
||||
$SQL[] ="ALTER TABLE ibf_conf_settings change conf_value conf_value text NOT NULL default '';";
|
||||
$SQL[] ="ALTER TABLE ibf_conf_settings change conf_default conf_default text NOT NULL default '';";
|
||||
$SQL[] ="ALTER TABLE ibf_conf_settings change conf_extra conf_extra text NOT NULL default '';";
|
||||
$SQL[] ="ALTER TABLE ibf_conf_settings change conf_evalphp conf_evalphp text NOT NULL default '';";
|
||||
|
||||
$SQL[] = "CREATE TABLE ibf_converge_local (
|
||||
converge_api_code VARCHAR(32) NOT NULL default '',
|
||||
converge_product_id INT(10) NOT NULL default '0',
|
||||
converge_added INT(10) NOT NULL default '0',
|
||||
converge_ip_address VARCHAR(16) NOT NULL default '',
|
||||
converge_url VARCHAR(255) NOT NULL default '',
|
||||
converge_active INT(1) NOT NULL default '0',
|
||||
converge_http_user VARCHAR(255) NOT NULL default '',
|
||||
converge_http_pass VARCHAR(255) NOT NULL default '',
|
||||
PRIMARY KEY (converge_api_code ),
|
||||
KEY converge_active (converge_active)
|
||||
);";
|
||||
|
||||
$SQL[] = "CREATE TABLE ibf_admin_login_logs (
|
||||
admin_id INT(10) NOT NULL auto_increment,
|
||||
admin_ip_address VARCHAR(16) NOT NULL default '0.0.0.0',
|
||||
admin_username VARCHAR(40) NOT NULL default '',
|
||||
admin_time INT(10) UNSIGNED NOT NULL default '0',
|
||||
admin_success INT(1) UNSIGNED NOT NULL default '0',
|
||||
admin_post_details TEXT NOT NULL default '',
|
||||
PRIMARY KEY (admin_id),
|
||||
KEY admin_ip_address (admin_ip_address),
|
||||
KEY admin_time (admin_time)
|
||||
);";
|
||||
|
||||
$SQL[] = "CREATE TABLE ibf_profile_friends (
|
||||
friends_id INT(10) NOT NULL auto_increment,
|
||||
friends_member_id INT(10) UNSIGNED NOT NULL default '0',
|
||||
friends_friend_id INT(10) UNSIGNED NOT NULL default '0',
|
||||
friends_approved TINYINT(1) NOT NULL default '0',
|
||||
friends_added INT(10) UNSIGNED NOT NULL default '0',
|
||||
PRIMARY KEY( friends_id ),
|
||||
KEY my_friends ( friends_member_id, friends_friend_id ),
|
||||
KEY friends_member_id ( friends_member_id )
|
||||
);";
|
||||
|
||||
$SQL[] = "CREATE TABLE ibf_profile_comments (
|
||||
comment_id INT(10) NOT NULL auto_increment,
|
||||
comment_for_member_id INT(10) UNSIGNED NOT NULL default '0',
|
||||
comment_by_member_id INT(10) UNSIGNED NOT NULL default '0',
|
||||
comment_date INT(10) UNSIGNED NOT NULL default '0',
|
||||
comment_ip_address VARCHAR(16) NOT NULL default '0',
|
||||
comment_content TEXT NOT NULL default '',
|
||||
comment_approved TINYINT(1) NOT NULL default '0',
|
||||
PRIMARY KEY( comment_id ),
|
||||
KEY my_comments( comment_for_member_id )
|
||||
);";
|
||||
|
||||
$SQL[] = "CREATE TABLE ibf_profile_ratings (
|
||||
rating_id INT(10) NOT NULL auto_increment,
|
||||
rating_for_member_id INT(10) NOT NULL default '0',
|
||||
rating_by_member_id INT(10) NOT NULL default '0',
|
||||
rating_added INT(10) NOT NULL default '0',
|
||||
rating_ip_address VARCHAR(16) NOT NULL default '',
|
||||
rating_value INT(2) NOT NULL default '0',
|
||||
PRIMARY KEY ( rating_id ),
|
||||
KEY rating_for_member_id ( rating_for_member_id )
|
||||
);";
|
||||
|
||||
|
||||
$SQL[] = "CREATE TABLE ibf_profile_portal (
|
||||
pp_member_id INT(10) NOT NULL default '0',
|
||||
pp_profile_update INT(10) UNSIGNED NOT NULL default '0',
|
||||
pp_bio_content TEXT NOT NULL default '',
|
||||
pp_last_visitors TEXT NOT NULL default '',
|
||||
pp_comment_count INT(10) UNSIGNED NOT NULL default '0',
|
||||
pp_rating_hits INT(10) UNSIGNED NOT NULL default '0',
|
||||
pp_rating_value INT(10) UNSIGNED NOT NULL default '0',
|
||||
pp_rating_real INT(10) UNSIGNED NOT NULL default '0',
|
||||
pp_friend_count INT(5) UNSIGNED NOT NULL default '0',
|
||||
pp_main_photo VARCHAR(255) NOT NULL default '',
|
||||
pp_main_width INT(5) UNSIGNED NOT NULL default '0',
|
||||
pp_main_height INT(5) UNSIGNED NOT NULL default '0',
|
||||
pp_thumb_photo VARCHAR(255) NOT NULL default '',
|
||||
pp_thumb_width INT(5) UNSIGNED NOT NULL default '0',
|
||||
pp_thumb_height INT(5) UNSIGNED NOT NULL default '0',
|
||||
pp_gender VARCHAR(10) NOT NULL default '',
|
||||
pp_setting_notify_comments VARCHAR(10) NOT NULL default 'email',
|
||||
pp_setting_notify_friend VARCHAR(10) NOT NULL default 'email',
|
||||
pp_setting_moderate_comments TINYINT(1) NOT NULL default '0',
|
||||
pp_setting_moderate_friends TINYINT(1) NOT NULL default '0',
|
||||
pp_setting_count_friends INT(2) NOT NULL default '0',
|
||||
pp_setting_count_comments INT(2) NOT NULL default '0',
|
||||
pp_setting_count_visitors INT(2) NOT NULL default '0',
|
||||
pp_profile_views INT(10) NOT NULL default '0',
|
||||
PRIMARY KEY ( pp_member_id )
|
||||
);";
|
||||
|
||||
$SQL[] = "CREATE TABLE ibf_profile_portal_views (
|
||||
views_member_id int(10) NOT NULL default '0'
|
||||
);";
|
||||
|
||||
$SQL[] = "DROP TABLE ibf_calendar_events;";
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
# Nothing of interest!
|
||||
|
||||
$SQL[]="ALTER TABLE ibf_members ADD members_profile_views INT(10) UNSIGNED NOT NULL default '0';";
|
||||
$SQL[]="ALTER TABLE ibf_members ADD member_login_key_expire INT(10) NOT NULL default '0' AFTER member_login_key;";
|
||||
|
||||
$SQL[]="alter table ibf_members ADD members_l_display_name VARCHAR(255) NOT NULL default '0';";
|
||||
$SQL[]="alter table ibf_members ADD members_l_username VARCHAR(255) NOT NULL default '0';";
|
||||
$SQL[]="alter table ibf_members DROP INDEX name;";
|
||||
$SQL[]="alter table ibf_members DROP INDEX members_display_name;";
|
||||
$SQL[]="alter table ibf_member_extra change interests interests text NOT NULL default '';";
|
||||
$SQL[]="alter table ibf_members change ignored_users ignored_users text NOT NULL default '';";
|
||||
$SQL[]="alter table ibf_members change members_markers members_markers text NOT NULL default '';";
|
||||
$SQL[]="ALTER TABLE ibf_members DROP legacy_password;";
|
||||
|
||||
$SQL[]="ALTER TABLE ibf_members ADD INDEX members_l_display_name (members_l_display_name), ADD INDEX members_l_username (members_l_username);";
|
||||
|
||||
$SQL[]="ALTER TABLE ibf_members ADD failed_logins TEXT;";
|
||||
$SQL[]="ALTER TABLE ibf_members ADD failed_login_count SMALLINT( 3 ) DEFAULT '0' NOT NULL;";
|
||||
|
||||
$SQL[]="ALTER TABLE ibf_members_partial ADD partial_email_ok INT(1) NOT NULL default '0';";
|
||||
|
||||
$SQL[] ="ALTER TABLE ibf_attachments ADD attach_rel_id INT(10) NOT NULL default '0',
|
||||
ADD attach_rel_module VARCHAR(100) NOT NULL default '0';";
|
||||
|
||||
$SQL[] ="ALTER TABLE ibf_attachments add attach_img_width INT(5) NOT NULL default '0',
|
||||
add attach_img_height INT(5) NOT NULL default '0';";
|
||||
|
||||
$SQL[] ="ALTER TABLE ibf_attachments DROP INDEX attach_mid_size,
|
||||
DROP INDEX attach_pid,
|
||||
DROP INDEX attach_msg,
|
||||
ADD INDEX attach_pid (attach_rel_id),
|
||||
ADD INDEX attach_mid_size (attach_member_id,attach_rel_module, attach_filesize),
|
||||
ADD INDEX attach_where (attach_rel_module, attach_rel_id);";
|
||||
?>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
# Nothing of interest!
|
||||
|
||||
$SQL[]="ALTER TABLE ibf_posts DROP INDEX topic_id, ADD INDEX topic_id ( topic_id , queued , pid , post_date );";
|
||||
$SQL[]="ALTER TABLE ibf_posts ADD INDEX post_key (post_key), ADD INDEX ip_address (ip_address);";
|
||||
$SQL[]="ALTER TABLE ibf_posts ADD post_edit_reason VARCHAR(255) NOT NULL default '';";
|
||||
$SQL[]="ALTER TABLE ibf_posts CHANGE post post MEDIUMTEXT NOT NULL DEFAULT '';";
|
||||
$SQL[]="ALTER TABLE ibf_topics ADD INDEX starter_id (starter_id, forum_id, approved);";
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
# Nothing of interest!
|
||||
|
||||
$SQL[] ="ALTER TABLE ibf_groups DROP g_calendar_post;";
|
||||
|
||||
$SQL[] ="ALTER TABLE ibf_validating ADD prev_email VARCHAR(150) NOT NULL DEFAULT '0';";
|
||||
|
||||
$SQL[] ="ALTER TABLE ibf_forums CHANGE position position INT(5) UNSIGNED default '0';";
|
||||
$SQL[] ="ALTER TABLE ibf_forums ADD newest_title VARCHAR( 128 ) NOT NULL default '' , ADD newest_id INT( 10 ) NOT NULL default '0' ;";
|
||||
$SQL[] ="ALTER TABLE ibf_forums ADD password_override VARCHAR( 255 ) AFTER password;";
|
||||
|
||||
|
||||
$SQL[] ="ALTER TABLE ibf_search_results CHANGE topic_id topic_id text NOT NULL default '';";
|
||||
$SQL[] ="ALTER TABLE ibf_search_results CHANGE post_id post_id text NOT NULL default '';";
|
||||
$SQL[] ="ALTER TABLE ibf_search_results CHANGE query_cache query_cache text NOT NULL default '';";
|
||||
|
||||
$SQL[] ="ALTER TABLE ibf_cache_store change cs_value cs_value mediumtext NOT NULL default '';";
|
||||
|
||||
$SQL[] ="ALTER TABLE ibf_login_methods ADD login_user_id VARCHAR(255) NOT NULL default 'username';";
|
||||
$SQL[] ="ALTER TABLE ibf_login_methods ADD login_logout_url VARCHAR(255) NOT NULL default '';";
|
||||
$SQL[] ="ALTER TABLE ibf_login_methods ADD login_login_url VARCHAR(255) NOT NULL default '';";
|
||||
|
||||
$SQL[] ="ALTER TABLE ibf_sessions CHANGE id id VARCHAR(60) DEFAULT '0' NOT NULL;";
|
||||
|
||||
$SQL[] ="ALTER TABLE ibf_voters ADD INDEX ( tid );";
|
||||
|
||||
$SQL[] ="ALTER TABLE ibf_faq ADD position SMALLINT( 3 ) DEFAULT '0' NOT NULL;";
|
||||
|
||||
$SQL[] ="ALTER TABLE ibf_polls ADD poll_only TINYINT( 1 ) DEFAULT '0' NOT NULL;";
|
||||
|
||||
# UPDATES
|
||||
$SQL[] ="UPDATE ibf_subscription_methods SET submethod_desc='All major credit cards accepted. See <a href=\"https://www.paypal.com\" target=\"_blank\">PayPal</a> for more information.' WHERE LOWER(submethod_name)='paypal';";
|
||||
|
||||
$SQL[] ="UPDATE ibf_groups SET g_photo_max_vars='100:150:150';";
|
||||
|
||||
$SQL[] ="UPDATE ibf_attachments SET attach_rel_id=attach_pid, attach_rel_module='post' where attach_pid > 0;";
|
||||
$SQL[] ="UPDATE ibf_attachments SET attach_rel_id=attach_msg, attach_rel_module='msg' where attach_msg > 0;";
|
||||
|
||||
$SQL[] ="UPDATE ibf_login_methods SET login_settings = '1', login_installed = '1' WHERE login_folder_name='ldap';";
|
||||
$SQL[] ="UPDATE ibf_login_methods SET login_settings = '1', login_installed = '1' WHERE login_folder_name='external';";
|
||||
|
||||
$SQL[] ="INSERT INTO ibf_login_methods (login_title, login_description, login_folder_name, login_maintain_url, login_register_url, login_type, login_alt_login_html, login_date, login_settings, login_enabled, login_safemode, login_installed, login_replace_form, login_allow_create) VALUES ('IP.Converge', 'Internal Use Only', 'ipconverge', '', '', 'passthrough', '', 0, 0, 0, 1, 1, 0, 1);";
|
||||
$SQL[] ="UPDATE ibf_forums SET permission_showtopic=1 WHERE parent_id='-1';";
|
||||
|
||||
# MEMBERS
|
||||
$SQL[] = "UPDATE ibf_members SET members_l_display_name=LOWER(members_display_name);";
|
||||
$SQL[] = "UPDATE ibf_members SET members_l_username=LOWER(name);";
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,492 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2004 Invision Power Services
|
||||
| http://www.invisionpower.com
|
||||
| ========================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| Email: matt@invisionpower.com
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > IPB UPGRADE MODULE:: IPB 2.0.2 -> IPB 2.0.3
|
||||
| > Script written by Matt Mecham
|
||||
| > Date started: 23rd April 2004
|
||||
| > "So what, pop is dead - it's no great loss.
|
||||
So many facelifts, it's face flew off"
|
||||
+--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class version_upgrade
|
||||
{
|
||||
var $install;
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// CONSTRUCTOR
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function version_upgrade( & $install )
|
||||
{
|
||||
$this->install = & $install;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Auto run..
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function auto_run()
|
||||
{
|
||||
//--------------------------------
|
||||
// What are we doing?
|
||||
//--------------------------------
|
||||
|
||||
switch( $this->install->saved_data['workact'] )
|
||||
{
|
||||
case 'sql':
|
||||
$this->upgrade_sql(1);
|
||||
break;
|
||||
case 'sql1':
|
||||
$this->upgrade_sql(1);
|
||||
break;
|
||||
case 'sql2':
|
||||
$this->upgrade_sql(2);
|
||||
break;
|
||||
case 'sql3':
|
||||
$this->upgrade_sql(3);
|
||||
break;
|
||||
case 'sql4':
|
||||
$this->upgrade_sql(4);
|
||||
break;
|
||||
case 'forums':
|
||||
$this->update_forums();
|
||||
break;
|
||||
case 'finish':
|
||||
$this->finish_up();
|
||||
break;
|
||||
case 'skin':
|
||||
$this->add_skin();
|
||||
break;
|
||||
case 'update_template_bits':
|
||||
$this->update_template_bits();
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->upgrade_sql(1);
|
||||
break;
|
||||
}
|
||||
|
||||
if ( $this->install->saved_data['workact'] )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// SQL: 0
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function upgrade_sql( $id=1 )
|
||||
{
|
||||
$man = 0; // Manual upgrade ? intval( $this->install->ipsclass->input['man'] );
|
||||
$cnt = 0;
|
||||
$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->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;
|
||||
}
|
||||
else
|
||||
{
|
||||
$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;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->install->saved_data['workact'] = 'forums';
|
||||
}
|
||||
|
||||
if ( $this->install->saved_data['man'] AND $output )
|
||||
{
|
||||
$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()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// 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'];
|
||||
$fr['sub_can_post'] = $f['sub_can_post'];
|
||||
$fr['name'] = $f['name'];
|
||||
$fr['parent_id'] = $f['parent_id'];
|
||||
$fr['show_perms'] = $perms['show_perms'];
|
||||
$fr['skin_id'] = $f['skin_id'];
|
||||
$fr['permission_showtopic'] = $f['permission_showtopic'];
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach( $f as $k => $v )
|
||||
{
|
||||
if ( in_array( $k, $ignore_me ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $v != "" )
|
||||
{
|
||||
$fr[ $k ] = $v;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$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'],
|
||||
'read_perms' => $fr['read_perms'],
|
||||
'upload_perms' => $fr['upload_perms'],
|
||||
'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 = "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',
|
||||
'order' => 'suid ASC',
|
||||
'limit' => array( $start, $lend ) ) );
|
||||
|
||||
$o = $this->install->ipsclass->DB->exec_query();
|
||||
|
||||
//-----------------------------------------
|
||||
// Do it...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->install->ipsclass->DB->get_num_rows($o) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// 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++;
|
||||
$this->install->ipsclass->DB->do_update( 'skin_templates', array( 'section_content' => $section_content ), 'suid=' . $row['suid'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$done = 1;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Done?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $done )
|
||||
{
|
||||
$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;
|
||||
}
|
||||
else
|
||||
{
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
||||
$test = $this->install->ipsclass->DB->build_and_exec_query( array( 'select' => 'count(*) as rows',
|
||||
'from' => 'cache_store',
|
||||
'where' => "cs_key='calendars'"
|
||||
) );
|
||||
|
||||
if ( ! $test['rows'] )
|
||||
{
|
||||
$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 = "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 2.2.0 Default',
|
||||
'set_image_dir' => 1,
|
||||
'set_hidden' => 0,
|
||||
'set_default' => 1,
|
||||
'set_css_method' => 0,
|
||||
'set_skin_set_parent' => -1,
|
||||
'set_author_email' => '',
|
||||
'set_author_name' => 'IPB 2.2.0 Default',
|
||||
'set_author_url' => '',
|
||||
'set_cache_css' => $CSS,
|
||||
'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" );
|
||||
|
||||
//-----------------------------------------
|
||||
// Remove member's choice
|
||||
//-----------------------------------------
|
||||
|
||||
$this->install->ipsclass->DB->do_update( 'members', array( 'skin' => '' ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Done...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->install->message = "2.2.0 skin created...";
|
||||
unset($this->install->saved_data['workact']);
|
||||
unset($this->install->saved_data['vid']);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
Reference in new issue
Block a user