MyBB Community Forums

Full Version: Upgraded mybb - forums broke
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I upgraded my forum from mybb 1.2.6 to 1.2.7. It now has a huge line of code across all the pages, except the index.php page which doesnt load.

ase contact the MyBB Group for support. MyBB Website"; } include MYBB_ROOT."inc/generic_error.php"; if($halt) { exit; } } function __destruct() { // Run shutdown function if(function_exists("run_shutdown")) { run_shutdown(); } } } ?> // If so, then we need to work out if they can try to login again // Some maths to work out how long they have left and display it to them $now = time(); $secondsleft = ($mybb->settings['failedlogintime'] * 60 + (empty($_COOKIE['failedlogin']) ? $now : $_COOKIE['failedlogin'])) - $now; $hoursleft = floor($secondsleft / 3600); $minsleft = floor(($secondsleft / 60) % 60); $secsleft = floor($secondsleft % 60); //This value will be empty the first time the user doesn't login in, set it if(empty($failedlogin)) { my_setcookie('failedlogin', $now); if($fatal) { error(sprintf($lang->failed_login_wait, $hoursleft, $minsleft, $secsleft)); } return false; } // Work out if the user has waited long enough before letting them login again if($_COOKIE['failedlogin'] < $now - $mybb->settings['failedlogintime'] * 60) { my_setcookie('loginattempts', 1); my_unsetcookie('failedlogin'); $db->query("UPDATE ".TABLE_PREFIX."sessions SET loginattempts = 1 WHERE sid = '{$session->sid}'"); return 1; } // Not waited long enough else { if($fatal) { error(sprintf($lang->failed_login_wait, $hoursleft, $minsleft, $secsleft)); } return false; } } // User can attempt another login return $loginattempts; } /** * Validates the format of an email address. * * @param string The string to check. * @return boolean True when valid, false when invalid. */ function validate_email_format($email) { if(!preg_match("/^(.+)@[a-zA-Z0-9-]+\.[a-zA-Z0-9.-]+$/si", $email) || strpos($email, ' ') !== false) { return false; } else { return true; } } /** * Rebuilds settings.php * */ function rebuildsettings() { global $db, $mybb; if(!file_exists(MYBB_ROOT."inc/settings.php")) { $mode = "x"; } else { $mode = "w"; } $options = array( "order_by" => "title", "order_dir" => "ASC" ); $query = $db->simple_select(TABLE_PREFIX."settings", "value, name", "", $options); while($setting = $db->fetch_array($query)) { $mybb->settings[$setting['name']] = $setting['value']; $setting['value'] = addcslashes($setting['value'], '\\"$'); $settings .= "\$settings['{$setting['name']}'] = \"{$setting['value']}\";\n"; } $settings = "<"."?php\n/*********************************\ \n DO NOT EDIT THIS FILE, PLEASE USE\n THE SETTINGS EDITOR\n\*********************************/\n\n$settings\n?".">"; $file = @fopen(MYBB_ROOT."inc/settings.php", $mode); @fwrite($file, $settings); @fclose($file); $GLOBALS['settings'] = &$mybb->settings; } /** * Converts a decimal reference of a character to its UTF-8 equivilant * (Code by Anne van Kesteren, http://annevankesteren.nl/2005/05/character-references) * * @param string Decimal value of a character reference */ function dec_to_utf8($src) { $dest = ''; if($src < 0) { return false; } elseif($src <= 0x007f) { $dest .= chr($src); } elseif($src <= 0x07ff) { $dest .= chr(0xc0 | ($src >> 6)); $dest .= chr(0x80 | ($src & 0x003f)); } elseif($src <= 0xffff) { $dest .= chr(0xe0 | ($src >> 12)); $dest .= chr(0x80 | (($src >> 6) & 0x003f)); $dest .= chr(0x80 | ($src & 0x003f)); } elseif($src <= 0x10ffff) { $dest .= chr(0xf0 | ($src >> 18)); $dest .= chr(0x80 | (($src >> 12) & 0x3f)); $dest .= chr(0x80 | (($src >> 6) & 0x3f)); $dest .= chr(0x80 | ($src & 0x3f)); } else { // out of range return false; } return $dest; } /** * Return a list of banned usernames. * * @return array The array of banned usernames. */ function get_banned_usernames() { global $mybb; $banned_usernames = explode(",", $mybb->settings['bannedusernames']); $banned_usernames = array_map("trim", $banned_usernames); $banned_usernames = array_map("strtolower", $banned_usernames); return $banned_usernames; } /** * Checks if a username has been disallowed for registration/use. * * @param string The username * @return boolean True if banned, false if not banned */ function is_banned_username($username) { $banned_usernames = get_banned_usernames(); if(in_array(strtolower($username), $banned_usernames)) { return true; } else { return false; } } /** * Return a list of banned email addresses. * * @return array The array of banned email addresses. */ function get_banned_emails() { global $mybb; $banned_emails = explode(",", $mybb->settings['bannedemails']); $banned_emails = array_map("trim", $banned_emails); $banned_emails = array_map("strtolower", $banned_emails); return $banned_emails; } /** * Check if a specific email address has been banned. * * @param string The email address. * @return boolean True if banned, false if not banned */ function is_banned_email($email) { $banned_emails = get_banned_emails(); $email = strtolower($email); foreach($banned_emails as $banned_email) { if($banned_email != "" && strpos($email, $banned_email) !== false) { return true; } } return false; } /** * Return a list of banned IP addresses. * * @return array The array of banned IP addresses. */ function get_banned_ips() { global $mybb; $banned_ips = explode(",", $mybb->settings['bannedips']); $banned_ips = array_map("trim", $banned_ips); return $banned_ips; } /** * Checks if a specific IP address has been banned. * * @param string The IP address. * @return boolean True if banned, false if not banned. */ function is_banned_ip($ip_address) { $banned_ips = get_banned_ips(); foreach($banned_ips as $banned_ip) { if($banned_ip != "" && strpos($ip_address, $banned_ip) !== false) { return true; } } return false; } /** * Below are compatibility functions which replicate functions in newer versions of PHP. * * This allows MyBB to continue working on older installations of PHP without these functions. */ if(!function_exists("stripos")) { function stripos($haystack, $needle, $offset=0) { return strpos(strtoupper($haystack), strtoupper($needle), $offset); } } if(!function_exists("file_get_contents")) { function file_get_contents($file) { $handle = @fopen($file, "rb"); if($handle) { while(!@feof($handle)) { $contents .= @fread($handle, 8192); } return $contents; } return false; } } ?>; } return false; } /** * Returns whether or not this database engine supports boolean fulltext matching. * * @param string The table to be checked. * @return boolean True or false if supported or not. */ function supports_fulltext_boolean($table) { $version = $this->get_version(); $supports_fulltext = $this->supports_fulltext($table); if($version >= '4.0.1' && $supports_fulltext == true) { return true; } return false; } /** * Creates a fulltext index on the specified column in the specified table with optional index name. * * @param string The name of the table. * @param string Name of the column to be indexed. * @param string The index name, optional. */ function create_fulltext_index($table, $column, $name="") { $this->query(" ALTER TABLE $table ADD FULLTEXT $name ($column) "); } /** * Drop an index with the specified name from the specified table * * @param string The name of the table. * @param string The name of the index. */ function drop_index($table, $name) { $this->query(" ALTER TABLE $table DROP INDEX $name "); } } ?> * @return string The parsed contents. */ function parse($contents) { $contents = preg_replace("##e", "\$this->$1", $contents); return $contents; } } ?>://|/)#i", $url)) { return "url(../{$url})"; } else { return "url({$url})"; } } /** * Build a checkbox list of usergroups * * @param string The unique identifier for this list, e.g. "additionalgroups". * @param array Optional array of preselected groups. * @param string Optional SQL where limiter * @return string Completed list of checkboxes */ function make_usergroup_checkbox_code($name, $checked_groups='', $where='') { global $db; if(!is_array($checked_groups)) { $checked_groups = array($checked_groups); } $options = array( 'order_by' => 'title', 'order_dir' => 'ASC' ); $query = $db->simple_select(TABLE_PREFIX."usergroups", "gid, title", $where, $options); while($usergroup = $db->fetch_array($query)) { $checked = ''; if(in_array($usergroup['gid'], $checked_groups)) { $checked = ' checked="checked"'; } $groups[] = " {$usergroup['title']}"; } $groups = implode('
', $groups); return $groups; } /** * Checks if a certain user ID is in the list of super administrators * * @param int The user ID to be checked * @return boolean true when the user is a super admin, false when not */ function is_super_admin($uid) { global $config; $config['super_admins'] = str_replace(" ", "", $config['super_admins']); if(strpos(",{$config['super_admins']},", ",{$uid},") === false) { return false; } else { return true; } } /** * Makes a parent list for forums * * @param int The forum ID * @param string The separator of the parent forum IDs * @return string The generated parent list */ function makeparentlist($fid, $navsep=",") { global $pforumcache, $db; if(!$pforumcache) { $options = array( "order_by" => "disporder, pid" ); $query = $db->simple_select(TABLE_PREFIX."forums", "name, fid, pid", "", $options); while($forum = $db->fetch_array($query)) { $pforumcache[$forum[fid]][$forum[pid]] = $forum; } } reset($pforumcache); reset($pforumcache[$fid]); foreach($pforumcache[$fid] as $key => $forum) { if($fid == $forum['fid']) { if($pforumcache[$forum['pid']]) { $navigation = makeparentlist($forum['pid'], $navsep) . $navigation; } if($navigation) { $navigation .= $navsep; } $navigation .= $forum['fid']; } } return $navigation; } ?>


Please help Sad
Looks like your files didn't upload properly. Re upload everything except inc/settings.php and inc/config.php
Reuploaded, everything works. Much appreciated dude, thank you.

Does it matter what mode I use to upload? I've been making my backups/uploading using Binary mode, as the other script I run uses ioncube, which wont work if it is uploaded using ASCII.
Images should be uploaded in binary, while others (text etc) should be uploaded via ASCII. Sometimes it doesn't matter, but usually thats how it works.
.php should be uploaded in Text/ASCII mode since...well...it's text.
Ok thanks Smile