Update to SMF 2.0.4 - Installation Instructions for 2.0.3

Update to SMF 2.0.4

File Edits ALT + Click to collapse all the operations

./Sources/Register.php

Find: Select
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0
Replace With: Select
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.4
Find: Select
if (isset($_POST['new_email'], $_REQUEST['passwd']) && sha1(strtolower($row['member_name']) . $_REQUEST['passwd']) == $row['passwd'])
Replace With: Select
if (isset($_POST['new_email'], $_REQUEST['passwd']) && sha1(strtolower($row['member_name']) . $_REQUEST['passwd']) == $row['passwd'] && ($row['is_activated'] == 0 || $row['is_activated'] == 2))

./Sources/ManageErrors.php

Find: Select
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0
Replace With: Select
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.4
Find: Select
global $context, $txt, $boarddir, $sourcedir;
// Check for the administrative permission to do this.
isAllowedTo('admin_forum');

// decode the file and get the line
$file = base64_decode($_REQUEST['file']);
$line = isset($_REQUEST['line']) ? (int) $_REQUEST['line'] : 0;

// Make sure the file we are looking for is one they are allowed to look at
if (!is_readable($file) || (strpos($file, '../') !== false && ( strpos($file, $boarddir) === false || strpos($file, $sourcedir) === false)))
Replace With: Select
global $context, $txt, $boarddir, $sourcedir, $cachedir;
// Check for the administrative permission to do this.
isAllowedTo('admin_forum');

// Decode the file and get the line
$file = realpath(base64_decode($_REQUEST['file']));
$real_board = realpath($boarddir);
$real_source = realpath($sourcedir);
$real_cache = realpath($cachedir);
$basename = strtolower(basename($file));
$ext = strrchr($basename, '.');
$line = isset($_REQUEST['line']) ? (int) $_REQUEST['line'] : 0;

// Make sure the file we are looking for is one they are allowed to look at
if ($ext != '.php' || (strpos($file, $real_board) === false && strpos($file, $real_source) === false) || ($basename == 'settings.php' || $basename == 'settings_bak.php') || strpos($file, $real_cache) !== false || !is_readable($file))

./Sources/Themes.php

Find: Select
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0
Replace With: Select
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.4
Find: Select
list ($theme_dir, $context['theme_id']) = $smcFunc['db_fetch_row']($request);
$smcFunc['db_free_result']($request);
Replace With: Select
list ($theme_dir, $context['theme_id']) = $smcFunc['db_fetch_row']($request);
$smcFunc['db_free_result']($request);

if (!file_exists($theme_dir . '/index.template.php') && !file_exists($theme_dir . '/css/index.css'))
fatal_lang_error('theme_edit_missing', false);

./Sources/ManageServer.php

Find: Select
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0
Replace With: Select
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.4
Find: Select
if ($_POST['def_language'] != $language)
Replace With: Select
getLanguages(true, false);
$lang_exists = false;
foreach ($context['languages'] as $lang)
{
if ($_POST['def_language'] == $lang['filename'])
{
$lang_exists = true;
break;
}
}

if ($_POST['def_language'] != $language && $lang_exists)

./SSI.php

Find: Select
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.3
Replace With: Select
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.4
Find: Select
function ssi_fetchPosts($post_ids, $override_permissions = false, $output_method = 'echo')
{
global $user_info, $modSettings;
Replace With: Select
function ssi_fetchPosts($post_ids = array(), $override_permissions = false, $output_method = 'echo')
{
global $user_info, $modSettings;

if (empty($post_ids))
return;
Find: Select
function ssi_fetchMember($member_ids, $output_method = 'echo')
{
Replace With: Select
function ssi_fetchMember($member_ids = array(), $output_method = 'echo')
{
if (empty($member_ids))
return;
Find: Select
function ssi_fetchGroupMembers($group_id, $output_method = 'echo')
{
Replace With: Select
function ssi_fetchGroupMembers($group_id = null, $output_method = 'echo')
{
if ($group_id === null)
return;
Find: Select
function ssi_queryMembers($query_where, $query_where_params = array(), $query_limit = '', $query_order = 'id_member DESC', $output_method = 'echo')
{
global $context, $settings, $scripturl, $txt, $db_prefix, $user_info;
global $modSettings, $smcFunc, $memberContext;
Replace With: Select
function ssi_queryMembers($query_where = null, $query_where_params = array(), $query_limit = '', $query_order = 'id_member DESC', $output_method = 'echo')
{
global $context, $settings, $scripturl, $txt, $db_prefix, $user_info;
global $modSettings, $smcFunc, $memberContext;

if ($query_where === null)
return;
Find: Select
global $scripturl, $modSettings, $user_info;
Replace With: Select
global $scripturl, $modSettings, $user_info;

if (empty($modSettings['cal_enabled']) || !allowedTo('calendar_view') || !allowedTo('profile_view_any'))
return;
Find: Select
$eventOptions = array(
'include_holidays' => true,
Replace With: Select
if (empty($modSettings['cal_enabled']) || !allowedTo('calendar_view'))
return;

$eventOptions = array(
'include_holidays' => true,
Find: Select
$eventOptions = array(
'include_events' => true,
Replace With: Select
if (empty($modSettings['cal_enabled']) || !allowedTo('calendar_view'))
return;

$eventOptions = array(
'include_events' => true,
Find: Select
global $modSettings, $txt, $scripturl, $user_info;

$eventOptions = array(
'include_birthdays' => true,
Replace With: Select
global $modSettings, $txt, $scripturl, $user_info;

$eventOptions = array(
'include_birthdays' => allowedTo('profile_view_any'),
Find: Select
global $db_prefix, $user_info, $scripturl, $modSettings, $txt, $context, $smcFunc;
Replace With: Select
global $db_prefix, $user_info, $scripturl, $modSettings, $txt, $context, $smcFunc;

if (empty($modSettings['cal_enabled']) || !allowedTo('calendar_view'))
return;

./Themes/default/languages/index.english.php

This operation isn't vital to the installation of this mod.
Find: Select
// Version: 2.0; index
Replace With: Select
// Version: 2.0.4; index
This operation isn't vital to the installation of this mod.
Find: Select
<a href="http://www.simplemachines.org/about/smf/license.php" title="License" target="_blank" class="new_win">SMF &copy; 2011</a>, <a href="http://www.simplemachines.org" title="Simple Machines" target="_blank" class="new_win">Simple Machines</a>';
Replace With: Select
<a href="http://www.simplemachines.org/about/smf/license.php" title="License" target="_blank" class="new_win">SMF &copy; 2013</a>, <a href="http://www.simplemachines.org" title="Simple Machines" target="_blank" class="new_win">Simple Machines</a>';

./index.php

Find: Select
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.3
Replace With: Select
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.4
Find: Select
$forum_version = 'SMF 2.0.3';
Replace With: Select
$forum_version = 'SMF 2.0.4';

./Sources/LogInOut.php

Find: Select
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0
Replace With: Select
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.4
Find: Select
// Timestamp invalid or non-existent?
if (empty($number_tries) || $time_stamp < (time() - 10))
{
// If it wasn't *that* long ago, don't give them another five goes.
$number_tries = !empty($number_tries) && $time_stamp < (time() - 20) ? 2 : 0;
$time_stamp = time();
}
Replace With: Select
// Timestamp or number of tries invalid?
if (empty($number_tries) || empty($time_stamp))
{
$number_tries = 0;
$time_stamp = time();
}

// They've failed logging in already
if (!empty($number_tries))
{
// Give them less chances if they failed before
$number_tries = $time_stamp < time() - 20 ? 2 : $number_tries;

// They are trying too fast, make them wait longer
if ($time_stamp < time() - 10)
$time_stamp = time();
}

./Sources/Errors.php

Find: Select
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0
Replace With: Select
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.4
Find: Select
function show_db_error($loadavg = false)
{
global $sourcedir, $mbname, $maintenance, $mtitle, $mmessage, $modSettings;
global $db_connection, $webmaster_email, $db_last_error, $db_error_send, $smcFunc;
Add After: Select


// Just check we're not in any buffers, just in case.
for ($i = ob_get_level(); $i > 0; $i--)
@ob_end_clean();

./Sources/Subs-Db-mysql.php

Find: Select
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0
Replace With: Select
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.4
Find: Select
list ($values, $connection) = $db_callback;
Add After: Select


if (!is_resource($connection))
db_fatal_error();

./Sources/Subs-Db-postgresql.php

Find: Select
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0
Replace With: Select
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.4
Find: Select
list ($values, $connection) = $db_callback;
Add After: Select


if (!is_resource($connection))
db_fatal_error();

./Sources/Reminder.php

Find: Select
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0
Replace With: Select
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.4
Find: Select
if (empty($_POST['code']) || substr($realCode, 0, 10) != substr(md5($_POST['code']), 0, 10))
Replace With: Select
if (empty($_POST['code']) || substr($realCode, 0, 10) !== substr(md5($_POST['code']), 0, 10))
Advertisement: