MyBB Community Forums

Full Version: Major Faulty [Reward for help included]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
No problem, I look forward to seeing you tomorrow Big Grin

Here is the logout stuff you need to do:

http://community.mybboard.net/showthread...#pid170140
I'm back. I did some research around the forum. So fortunetly, I managed to come up with a theory on what is wrong with my board. I haven't actually updated. I'm running a 1.2.12 Version of MYBB on a 1.2.9 version DB. I would have thought they were compatible and this is probably where I went wrong.

So after finding this out I decided that the best thing to do would be to run the upgrade script (to update and sync the DB), which is what I did. But then it jsut took me where I started with. I got this huge error which I'm posting shortly, and then my board goes offline saying it isn't installed. That means I'll have to restart again. But I don't really get why I cant update. Here is the error:

set_path(MYBB_ROOT.'install/resources/'); $lang->load('language'); // If there's a custom admin dir, use it. // Legacy for those boards trying to upgrade from an older version if(isset($config['admindir'])) { require_once MYBB_ROOT.$config['admindir']."/adminfunctions.php"; } // Current else if(isset($config['admin_dir'])) { require_once MYBB_ROOT.$config['admin_dir']."/adminfunctions.php"; } // No custom set else { require_once MYBB_ROOT."admin/adminfunctions.php"; } // Include the necessary contants for installation $grouppermignore = array("gid", "type", "title", "description", "namestyle", "usertitle", "stars", "starimage", "image"); $groupzerogreater = array("pmquota", "maxreputationsday", "attachquota"); $displaygroupfields = array("title", "description", "namestyle", "usertitle", "stars", "starimage", "image"); $fpermfields = array("canview", "candlattachments", "canpostthreads", "canpostreplys", "canpostattachments", "canratethreads", "caneditposts", "candeleteposts", "candeletethreads", "caneditattachments", "canpostpolls", "canvotepolls", "cansearch"); // Include the installation resources require_once INSTALL_ROOT."/resources/output.php"; $output = new installerOutput; $output->script = "upgrade.php"; $output->title = "MyBB Upgrade Wizard"; $db = new databaseEngine; // Connect to Database define("TABLE_PREFIX", $config['table_prefix']); $db->connect($config['hostname'], $config['username'], $config['password']); $db->select_db($config['database']); if(file_exists("lock")) { $output->print_error($lang->locked); } else { $output->steps = array($lang->upgrade); if(!$mybb->input['action'] || $mybb->input['action'] == "intro") { if($db->table_exists(TABLE_PREFIX."datacache")) { require_once MYBB_ROOT."inc/class_datacache.php"; $cache = new datacache; $plugins = $cache->read('plugins', true); if(!empty($plugins['active'])) { $lang->upgrade_welcome = "
Warning: 
There are still ".count($plugins['active'])." plugin(s) active. Active plugins can sometimes cause problems during an upgrade procedure.

".$lang->upgrade_welcome; } } $output->print_header(); $db->query("DROP TABLE IF EXISTS ".TABLE_PREFIX."upgrade_data"); $db->query("CREATE TABLE ".TABLE_PREFIX."upgrade_data ( title varchar(30) NOT NULL, contents text NOT NULL, PRIMARY KEY(title) );"); $dh = opendir(INSTALL_ROOT."/resources"); while(($file = readdir($dh)) !== false) { if(preg_match("#upgrade([0-9]+).php$#i", $file, $match)) { $upgradescripts[$match[1]] = $file; } } closedir($dh); foreach($upgradescripts as $key => $file) { $upgradescript = file_get_contents(INSTALL_ROOT."/resources/$file"); preg_match("#Upgrade Script:(.*)#i", $upgradescript, $verinfo); preg_match("#upgrade([0-9]+).php$#i", $file, $keynum); if(trim($verinfo[1])) { if(!$upgradescripts[$key+1]) { $vers .= "$verinfo[1]\n"; } else { $vers .= "$verinfo[1]\n"; } } } unset($upgradescripts); unset($upgradescript); $output->print_contents(sprintf($lang->upgrade_welcome, $mybb->version)."
 "); $output->print_footer("doupgrade"); } elseif($mybb->input['action'] == "doupgrade") { add_upgrade_store("startscript", $mybb->input['from']); $runfunction = next_function($mybb->input['from']); } $currentscript = get_upgrade_store("currentscript"); $system_upgrade_detail = get_upgrade_store("upgradedetail"); if($mybb->input['action'] == "templates") { $runfunction = "upgradethemes"; } elseif($mybb->input['action'] == "rebuildsettings") { $runfunction = "buildsettings"; } elseif($mybb->input['action'] == "buildcaches") { $runfunction = "buildcaches"; } elseif($mybb->input['action'] == "finished") { $runfunction = "upgradedone"; } else // Busy running modules, come back later { $bits = explode("_", $mybb->input['action'], 2); if($bits[1]) // We're still running a module { $from = $bits[0]; $runfunction = next_function($bits[0], $bits[1]); } } // Fetch current script we're in if(function_exists($runfunction)) { $runfunction(); } } function upgradethemes() { global $output, $db, $system_upgrade_detail, $lang; $output->print_header($lang->upgrade_templates_reverted); if($system_upgrade_detail['revert_all_templates'] > 0) { $db->query("DROP TABLE IF EXISTS ".TABLE_PREFIX."templates;"); $db->query("CREATE TABLE ".TABLE_PREFIX."templates ( tid int unsigned NOT NULL auto_increment, title varchar(120) NOT NULL default '', template text NOT NULL, sid int(10) NOT NULL default '0', version int unsigned NOT NULL default '0', status varchar(10) NOT NULL default '', dateline int(10) NOT NULL default '0', PRIMARY KEY (tid) ) TYPE=MyISAM;"); } if($system_upgrade_detail['revert_all_themes'] > 0) { $db->query("DROP TABLE IF EXISTS ".TABLE_PREFIX."themes"); $db->query("CREATE TABLE ".TABLE_PREFIX."themes ( tid smallint unsigned NOT NULL auto_increment, name varchar(100) NOT NULL default '', pid smallint unsigned NOT NULL default '0', def smallint(1) NOT NULL default '0', css text NOT NULL, cssbits text NOT NULL, themebits text NOT NULL, extracss text NOT NULL, allowedgroups text NOT NULL, csscached bigint(30) NOT NULL default '0', PRIMARY KEY (tid) ) TYPE=MyISAM;"); $insert_array = array( 'name' => 'MyBB Master Style', 'pid' => 0, 'css' => '', 'cssbits' => '', 'themebits' => '', 'extracss' => '', 'allowedgroups' => '' ); $db->insert_query(TABLE_PREFIX."themes", $insert_array); $insert_array = array( 'name' => 'MyBB Default', 'pid' => 1, 'def' => 1, 'css' => '', 'cssbits' => '', 'themebits' => '', 'extracss' => '', 'allowedgroups' => '' ); $db->insert_query(TABLE_PREFIX."themes", $insert_array); $sid = $db->insert_id(); $db->query("UPDATE ".TABLE_PREFIX."users SET style='$sid'"); $db->query("UPDATE ".TABLE_PREFIX."forums SET style='0'"); $db->query("DROP TABLE IF EXISTS ".TABLE_PREFIX."templatesets;"); $db->query("CREATE TABLE ".TABLE_PREFIX."templatesets ( sid smallint unsigned NOT NULL auto_increment, title varchar(120) NOT NULL default '', PRIMARY KEY (sid) ) TYPE=MyISAM;"); $db->query("INSERT INTO ".TABLE_PREFIX."templatesets (title) VALUES ('Default Templates')"); } $sid = -2; $arr = @file(INSTALL_ROOT."/resources/mybb_theme.xml"); $contents = @implode("", $arr); $parser = new XMLParser($contents); $tree = $parser->get_tree(); $theme = $tree['theme']; $css = kill_tags($theme['cssbits']); $themebits = kill_tags($theme['themebits']); $templates = $theme['templates']['template']; $themebits['templateset'] = 1; $newcount = 0; foreach($templates as $template) { $templatename = $template['attributes']['name']; $templateversion = intval($template['attributes']['version']); $templatevalue = $db->escape_string($template['value']); $time = time(); $query = $db->query("SELECT tid FROM ".TABLE_PREFIX."templates WHERE sid='-2' AND title='$templatename'"); $oldtemp = $db->fetch_array($query); if($oldtemp['tid']) { $db->query("UPDATE ".TABLE_PREFIX."templates SET template='$templatevalue', version='$templateversion', dateline='$time' WHERE title='$templatename' AND sid='-2'"); } else { $db->query("INSERT INTO ".TABLE_PREFIX."templates (title,template,sid,version,status,dateline) VALUES ('$templatename','$templatevalue','$sid','$templateversion','','$time')"); $newcount++; } } update_theme(1, 0, $themebits, $css, 0); $output->print_contents($lang->upgrade_templates_reverted_success); $output->print_footer("rebuildsettings"); } function buildsettings() { global $db, $output, $system_upgrade_detail, $lang; if(!is_writable(MYBB_ROOT."inc/settings.php")) { $output->print_header("Rebuilding Settings"); echo "
Error: Unable to open inc/settings.php
Before the upgrade process can continue, you need to changes the permissions of inc/settings.php so it is writable.
"; $output->print_footer("rebuildsettings"); exit; } $synccount = sync_settings($system_upgrade_detail['revert_all_settings']); $output->print_header($lang->upgrade_settings_sync); $output->print_contents(sprintf($lang->upgrade_settings_sync_success, $synccount[1], $synccount[0])); $output->print_footer("buildcaches"); } function buildcaches() { global $db, $output, $cache, $lang; $output->print_header($lang->upgrade_datacache_building); $contents .= $lang->upgrade_building_datacache; require_once MYBB_ROOT."inc/class_datacache.php"; $cache = new datacache; $cache->updateversion(); $cache->updateattachtypes(); $cache->updatesmilies(); $cache->updatebadwords(); $cache->updateusergroups(); $cache->updateforumpermissions(); $cache->updatestats(); $cache->updatemoderators(); $cache->updateforums(); $cache->updateusertitles(); $cache->updatereportedposts(); $cache->updatemycode(); $cache->updateposticons(); $cache->updateupdate_check(); $contents .= $lang->done."
"; $output->print_contents("$contents
".$lang->upgrade_continue."
"); $output->print_footer("finished"); } function upgradedone() { global $db, $output, $mybb, $lang, $config; $output->print_header("Upgrade Complete"); if(is_writable("./")) { $lock = @fopen("./lock", "w"); $written = @fwrite($lock, "1"); @fclose($lock); if($written) { $lock_note = sprintf($lang->upgrade_locked, $config['admin_dir']); } } if(!$written) { $lock_note = "
".$lang->upgrade_removedir."
"; } $output->print_contents(sprintf($lang->upgrade_congrats, $mybb->version, $lock_note)); $output->print_footer(); } function whatsnext() { global $output, $db, $system_upgrade_detail, $lang; if($system_upgrade_detail['revert_all_templates'] > 0) { $output->print_header($lang->upgrade_template_reversion); $output->print_contents($lang->upgrade_template_reversion_success); $output->print_footer("templates"); } else { upgradethemes(); } } function next_function($from, $func="dbchanges") { global $oldvers, $system_upgrade_detail, $currentscript; load_module("upgrade".$from.".php"); if(function_exists("upgrade".$from."_".$func)) { $function = "upgrade".$from."_".$func; } else { $from = $from+1; if(file_exists(INSTALL_ROOT."/resources/upgrade".$from.".php")) { $function = next_function($from); } } if(!$function) { $function = "whatsnext"; } return $function; } function load_module($module) { global $system_upgrade_detail, $currentscript; require_once INSTALL_ROOT."/resources/".$module; if($currentscript != $module) { foreach($upgrade_detail as $key => $val) { if(!$system_upgrade_detail[$key] || $val > $system_upgrade_detail[$key]) { $system_upgrade_detail[$key] = $val; } } add_upgrade_store("upgradedetail", $system_upgrade_detail); add_upgrade_store("currentscript", $module); } } function get_upgrade_store($title) { global $db; $query = $db->query("SELECT * FROM ".TABLE_PREFIX."upgrade_data WHERE title='".$db->escape_string($title)."'"); $data = $db->fetch_array($query); return unserialize($data['contents']); } function add_upgrade_store($title, $contents) { global $db; $db->query("REPLACE INTO ".TABLE_PREFIX."upgrade_data (title,contents) VALUES ('".$db->escape_string($title)."', '".$db->escape_string(serialize($contents))."')"); } function sync_settings($redo=0) { global $db; $settingcount = $groupcount = 0; if($redo == 2) { $db->query("DROP TABLE IF EXISTS ".TABLE_PREFIX."settinggroups"); $db->query("CREATE TABLE ".TABLE_PREFIX."settinggroups ( gid smallint unsigned NOT NULL auto_increment, name varchar(100) NOT NULL default '', title varchar(220) NOT NULL default '', description text NOT NULL, disporder smallint unsigned NOT NULL default '0', isdefault char(3) NOT NULL default '', PRIMARY KEY (gid) ) TYPE=MyISAM;"); $db->query("DROP TABLE IF EXISTS ".TABLE_PREFIX."settings"); $db->query("CREATE TABLE ".TABLE_PREFIX."settings ( sid smallint(6) NOT NULL auto_increment, name varchar(120) NOT NULL default '', title varchar(120) NOT NULL default '', description text NOT NULL, optionscode text NOT NULL, value text NOT NULL, disporder smallint(6) NOT NULL default '0', gid smallint(6) NOT NULL default '0', PRIMARY KEY (sid) ) TYPE=MyISAM;"); } else { $query = $db->query("SELECT name FROM ".TABLE_PREFIX."settings"); while($setting = $db->fetch_array($query)) { $settings[$setting['name']] = 1; } $query = $db->query("SELECT name,title,gid FROM ".TABLE_PREFIX."settinggroups"); while($group = $db->fetch_array($query)) { $settinggroups[$group['name']] = $group['gid']; } } $settings_xml = file_get_contents(INSTALL_ROOT."/resources/settings.xml"); $parser = new XMLParser($settings_xml); $parser->collapse_dups = 0; $tree = $parser->get_tree(); foreach($tree['settings'][0]['settinggroup'] as $settinggroup) { $groupdata = array( "name" => $db->escape_string($settinggroup['attributes']['name']), "title" => $db->escape_string($settinggroup['attributes']['title']), "description" => $db->escape_string($settinggroup['attributes']['description']), "disporder" => intval($settinggroup['attributes']['disporder']), "isdefault" => $settinggroup['attributes']['isdefault'] ); if(!$settinggroups[$settinggroup['attributes']['name']] || $redo == 2) { $db->insert_query(TABLE_PREFIX."settinggroups", $groupdata); $gid = $db->insert_id(); $groupcount++; } else { $gid = $settinggroups[$settinggroup['attributes']['name']]; $db->update_query(TABLE_PREFIX."settinggroups", $groupdata, "gid='{$gid}'"); } if(!$gid) { continue; } foreach($settinggroup['setting'] as $setting) { $settingdata = array( "name" => $db->escape_string($setting['attributes']['name']), "title" => $db->escape_string($setting['title'][0]['value']), "description" => $db->escape_string($setting['description'][0]['value']), "optionscode" => $db->escape_string($setting['optionscode'][0]['value']), "disporder" => intval($setting['disporder'][0]['value']), "gid" => $gid ); if(!$settings[$setting['attributes']['name']] || $redo == 2) { $settingdata['value'] = $db->escape_string($setting['settingvalue'][0]['value']); $db->insert_query(TABLE_PREFIX."settings", $settingdata); $settingcount++; } else { $name = $db->escape_string($setting['attributes']['name']); $db->update_query(TABLE_PREFIX."settings", $settingdata, "name='{$name}'"); } } } if($redo >= 1) { require MYBB_ROOT."inc/settings.php"; foreach($settings as $key => $val) { $db->update_query(TABLE_PREFIX."settings", array('value' => $db->escape_string($val)), "name='$key'"); } } unset($settings); $query = $db->simple_select(TABLE_PREFIX."settings", "*", "", array('order_by' => 'title')); while($setting = $db->fetch_array($query)) { $setting['value'] = str_replace("\"", "\\\"", $setting['value']); $settings .= "\$settings['{$setting['name']}'] = \"".$setting['value']."\";\n"; } $settings = ""; $file = fopen(MYBB_ROOT."inc/settings.php", "w"); fwrite($file, $settings); fclose($file); return array($groupcount, $settingcount); } function write_settings() { global $db; $query = $db->query('SELECT * FROM '.TABLE_PREFIX.'settings ORDER BY title ASC'); while($setting = $db->fetch_array($query)) { $setting['value'] = $db->escape_string($setting['value']); $settings .= "\$settings['{$setting['name']}'] = \"{$setting['value']}\";\n"; } if(!empty($settings)) { $settings = ""; $file = fopen(MYBB_ROOT."inc/settings.php", "w"); fwrite($file, $settings); fclose($file); } } ?>

Ok in response to the error let me tell you that the following files are with CHMOD 777 alreayd, even though the error says they aren't:

- config.php
- settings. php

Could I just get a general comment from someone from support plz? Maybe some instructions? I've been waiting for some full authentic supportive response for some good tiem now. XD

~Kindest Regards
Ok, so the thing is, I'de rather have a functioning board which out-dated then not having one. I got a community to feed and this has taken too much offline time.

I"m just going to reinstall an outdated versiion and hope there are no errors!

~Regards
I'll ask a member of MyBB Team to help us out.
There were no database changes from 1.2.9 to 1.2.12 that I am aware of, so unless your 1.2.9 database was faulty to begin with it should not be faulty in the current release.

When you install 1.2.12 fresh, does everything work perfectly?
And in regardsw to the error log posted above? About Updating?

PS: The errors were fixed by resetting the templates which had missing paths.
You say in this thread that your last database backup was done using 1.2.9 - is it possible for you to reinstall that? (Just put the files in place, set the config.php file and you should be right) and from then try the upgrade script (after uploading the full 1.2.12 package from the website).

If I understand correctly and there are no existing errors, that will work. To obtain the full 1.2.9 package, go here:
http://mybboard.net/download/54.zip
I've done that. And I'de rather not stink up my forum again.

Upgrading causes the error stated above.
Which error, the one that is just a page of PHP code because that looks to me like your servers PHP parser is messing up.

As for the error in your screenshot, you can get that if you have directory listings off but don't have a valid index file in a directory. Was that the case before (someone could have accidentally removed index.php)?
MrDoom Wrote:Which error, the one that is just a page of PHP code because that looks to me like your servers PHP parser is messing up.

As for the error in your screenshot, you can get that if you have directory listings off but don't have a valid index file in a directory. Was that the case before (someone could have accidentally removed index.php)?

I aint sure. I'll find out and tell you in a few...
Pages: 1 2 3