Update to SMF 1.1.1 - Installation Instructions for 1.1

Update to SMF 1.1.1
This patch file will update your forum to SMF 1.1.1.

File Edits ALT + Click to collapse all the operations

./changelog.txt

Find: Select
SMF 1.1 December 02, 2006
================================================================================
Replace With: Select
SMF 1.1.1 December 17, 2006
================================================================================
December 2006
--------------------------------------------------------------------------------
! Fixed multi-language support for Mambo/Joomla bridge login module on non-forum pages. (Mambo/Joomla bridge/mod_smf_login.php)
+ Added register mambot to Mambo 4.6 bridge so that users who register in Mambo are auto-created in SMF. (Mambo 4.6 bridge/SMF_register.php, SMF_register.xml)
! Fixed bridge registration so that it uses Mambo 4.6's new language method. (Mambo 4.6 bridge/smf_registration.html.php)
! The regular expression used for parsing '/me'-lines didn't work properly in older PHP versions. (Subs-Post.php)
! Fixed usage of array before it was declared (Load.php)
! Mambo/Joomla bridge config should go to main admin page if "Cancel" is clicked (Mambo/Joomla bridge/admin.smf.php)
! Fixed a missing global (Mambo 4.6 bridge/smf.php)
+ Changed the SEF handling in the bridge for use with third party Joomla SEF components (Mambo/Joomla bridge/smf.php)
+ Added Kindred's enhancements to the bridged whos online (Mambo/Joomla bridge/smf.php, smf_integration_arrays.php)
! Deleting a member in SMF deleted in Joomla, but not in Joomla's ACL (Mambo/Joomla bridge/smf.php)
! Bridge login module didn't handle language variables correctly. (Mambo/Joomla bridge/mod_smf_login.php)
! Some dates in the installation script were not MySQL STRICT compatible. (install-1.1.sql)
! Log the ban check IP in messages. (Subs-Post.php)
! It was possible for files to be sent with the wrong mime type - reported by Jessica Hope and rotwang. (Display.php)
* Search template looked a little odd on IE. (Search template)
* In prune boards the checkbox for stickies would toggle with the board selection. (Admin template)
! Send annoucements in slightly smaller chunks. (Post.php)
! Make it impossible to make guests too much like administrators. (ManagePermissions.php)
! Aposthophes in smiley directories would cause a SQL error. (ManageSmileys.php)
! Fixed labelling personal messages not being restricted to the current member. (PersonalMessage.php)
! In rare cases search didn't return any results, while it should have. (Search.php)


SMF 1.1 December 02, 2006
================================================================================

./index.php

Find: Select
$forum_version = 'SMF 1.1';
Replace With: Select
$forum_version = 'SMF 1.1.1';
Find: Select
* Software Version: SMF 1.1 *
Replace With: Select
* Software Version: SMF 1.1.1 *

./Sources/Subs-Post.php

Find: Select
$posterOptions['ip'] = empty($posterOptions['ip']) ? $user_info['ip'] : $posterOptions['ip'];
Replace With: Select
$posterOptions['ip'] = empty($posterOptions['ip']) ? $user_info['ip2'] : $posterOptions['ip'];
Find: Select
if (strpos($user_info['name'], '[') !== false || strpos($user_info['name'], ']') !== false || strpos($user_info['name'], '\'') !== false || strpos($user_info['name'], '"') !== false)
$parts[$i] = preg_replace('~(?:\A|\n)/me(?: | )([^\n\z]*)~i', '[me="' . $user_info['name'] . '"]$1[/me]', $parts[$i]);
else
$parts[$i] = preg_replace('~(?:\A|\n)/me(?: | )([^\n\z]*)~i', '[me=' . $user_info['name'] . ']$1[/me]', $parts[$i]);
Replace With: Select
if (strpos($user_info['name'], '[') !== false || strpos($user_info['name'], ']') !== false || strpos($user_info['name'], '\'') !== false || strpos($user_info['name'], '"') !== false)
$parts[$i] = preg_replace('~(?:\A|\n)/me(?: | )([^\n\z]*)~i', '[me="' . $user_info['name'] . '"]$1[/me]', $parts[$i]);
else
$parts[$i] = preg_replace('~(?:\A|\n)/me(?: | )([^\n\z]*)~i', '[me=' . $user_info['name'] . ']$1[/me]', $parts[$i]);
Find: Select
* Software Version: SMF 1.1 *
Replace With: Select
* Software Version: SMF 1.1.1 *

./Sources/Load.php

Find: Select
$space_chars = $utf8 ? ($context['server']['complex_preg_chars'] ? '\x{C2A0}\x{E28080}-\x{E2808F}\x{E280AF}\x{E2809F}\x{E38080}\x{EFBBBF}' : sprintf('%c%c%c%c%c-%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c', 0xC2, 0xA0, 0xE2, 0x80, 0x80, 0xE2, 0x80, 0x8F, 0xE2, 0x80, 0xAF, 0xE2, 0x80, 0x9F, 0xE3, 0x80, 0x80, 0xEF, 0xBB, 0xBF)) : '\xA0';
Replace With: Select
$space_chars = $utf8 ? (@version_compare(PHP_VERSION, '4.3.3') != -1 ? '\x{C2A0}\x{E28080}-\x{E2808F}\x{E280AF}\x{E2809F}\x{E38080}\x{EFBBBF}' : sprintf('%c%c%c%c%c-%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c', 0xC2, 0xA0, 0xE2, 0x80, 0x80, 0xE2, 0x80, 0x8F, 0xE2, 0x80, 0xAF, 0xE2, 0x80, 0x9F, 0xE3, 0x80, 0x80, 0xEF, 0xBB, 0xBF)) : '\xA0';
Find: Select
* Software Version: SMF 1.1 *
Replace With: Select
* Software Version: SMF 1.1.1 *

./Sources/Display.php

Find: Select
if (!isset($_REQUEST['image']))
{
header('Content-Disposition: attachment; filename="' . $real_filename . '"');
header('Content-Type: application/octet-stream');
}

if (filesize($filename) != 0)
{
$size = @getimagesize($filename);
if (!empty($size) && $size[2] > 0 && $size[2] < 4)
header('Content-Type: image/' . ($size[2] != 1 ? ($size[2] != 2 ? 'png' : 'jpeg') : 'gif'));
// Errr, it's an image.... what kind? A... gif? Yeah that's it, gif! Like JIF, the peanut butter.
elseif (isset($_REQUEST['image']))
header('Content-Type: image/gif');
}
Replace With: Select
if (filesize($filename) != 0)
{
$size = @getimagesize($filename);
if (!empty($size))
{
// What headers are valid?
$validTypes = array(
1 => 'gif',
2 => 'jpeg',
3 => 'png',
5 => 'psd',
6 => 'bmp',
7 => 'tiff',
8 => 'tiff',
9 => 'jpeg',
14 => 'iff',
);

// Do we have a mime type we can simpy use?
if (!empty($size['mime']))
header('Content-Type: ' . $size['mime']);
elseif (isset($validTypes[$size[2]]))
header('Content-Type: image/' . $validTypes[$size[2]]);
// Otherwise - let's think safety first... it might not be an image...
elseif (isset($_REQUEST['image']))
unset($_REQUEST['image']);
}
// Once again - safe!
elseif (isset($_REQUEST['image']))
unset($_REQUEST['image']);
}

if (!isset($_REQUEST['image']))
{
header('Content-Disposition: attachment; filename="' . $real_filename . '"');
header('Content-Type: application/octet-stream');
}
Find: Select
* Software Version: SMF 1.1 *
Replace With: Select
* Software Version: SMF 1.1.1 *

./Themes/default/Search.template.php

Find: Select
<div style="width: 50%;">
Replace With: Select
<div style="width: 45%;">
Find: Select
<div style="text-align: left; width: 50%; float: right; margin-right: 2ex;">
Replace With: Select
<div style="text-align: left; width: 45%; float: right; margin-right: 2ex;">
Find: Select
// Version: 1.1; Search
Replace With: Select
// Version: 1.1.1; Search

./Themes/default/Admin.template.php

Find: Select
if (document.forms.rotForm.elements[i].type.toLowerCase() == "checkbox")
Replace With: Select
if (document.forms.rotForm.elements[i].type.toLowerCase() == "checkbox" && document.forms.rotForm.elements[i].id != "delete_old_not_sticky")
Find: Select
// Version: 1.1; Admin
Replace With: Select
// Version: 1.1.1; Admin

./Sources/Post.php

Find: Select
$chunkSize = 75;
Replace With: Select
$chunkSize = 50;
Find: Select
* Software Version: SMF 1.1 *
Replace With: Select
* Software Version: SMF 1.1.1 *

./Sources/ManagePermissions.php

Find: Select
}

redirectexit('action=permissions;boardid=' . $_REQUEST['boardid']);
Replace With: Select
}

// Don't allow guests to have certain permissions.
db_query("
DELETE FROM {$db_prefix}permissions
WHERE ID_GROUP = -1 AND
(permission = 'manage_membergroups'
OR permission = 'manage_permissions'
OR permission = 'admin_forum')", __FILE__, __LINE__);

redirectexit('action=permissions;boardid=' . $_REQUEST['boardid']);
Find: Select
* Software Version: SMF 1.1 *
Replace With: Select
* Software Version: SMF 1.1.1 *

./Sources/ManageSmileys.php

Find: Select
'smiley_sets_known' => implode(',', $set_paths),
'smiley_sets_names' => implode("\n", $set_names),
'smiley_sets_default' => in_array($modSettings['smiley_sets_default'], $set_paths) ? $modSettings['smiley_sets_default'] : $set_paths[0],
Replace With: Select
'smiley_sets_known' => addslashes(implode(',', $set_paths)),
'smiley_sets_names' => addslashes(implode("\n", $set_names)),
'smiley_sets_default' => addslashes(in_array($modSettings['smiley_sets_default'], $set_paths) ? $modSettings['smiley_sets_default'] : $set_paths[0]),
Find: Select
'smiley_sets_known' => $modSettings['smiley_sets_known'] . ',' . $_POST['smiley_sets_path'],
'smiley_sets_names' => $modSettings['smiley_sets_names'] . "\n" . $_POST['smiley_sets_name'],
'smiley_sets_default' => empty($_POST['smiley_sets_default']) ? $modSettings['smiley_sets_default'] : $_POST['smiley_sets_path'],
Replace With: Select
'smiley_sets_known' => addslashes($modSettings['smiley_sets_known']) . ',' . $_POST['smiley_sets_path'],
'smiley_sets_names' => addslashes($modSettings['smiley_sets_names']) . "\n" . $_POST['smiley_sets_name'],
'smiley_sets_default' => empty($_POST['smiley_sets_default']) ? addslashes($modSettings['smiley_sets_default']) : $_POST['smiley_sets_path'],
Find: Select
$set_paths[$_POST['set']] = $_POST['smiley_sets_path'];
$set_names[$_POST['set']] = $_POST['smiley_sets_name'];
updateSettings(array(
'smiley_sets_known' => implode(',', $set_paths),
'smiley_sets_names' => implode("\n", $set_names),
'smiley_sets_default' => empty($_POST['smiley_sets_default']) ? $modSettings['smiley_sets_default'] : $_POST['smiley_sets_path']
Replace With: Select
$set_paths[$_POST['set']] = stripslashes($_POST['smiley_sets_path']);
$set_names[$_POST['set']] = stripslashes($_POST['smiley_sets_name']);
updateSettings(array(
'smiley_sets_known' => addslashes(implode(',', $set_paths)),
'smiley_sets_names' => addslashes(implode("\n", $set_names)),
'smiley_sets_default' => empty($_POST['smiley_sets_default']) ? addslashes($modSettings['smiley_sets_default']) : $_POST['smiley_sets_path']
Find: Select
'smiley_sets_known' => $modSettings['smiley_sets_known'] . ',' . $name,
'smiley_sets_names' => $modSettings['smiley_sets_names'] . "\n" . strtok(basename(isset($_FILES['set_gz']) ? $_FILES['set_gz']['name'] : $_REQUEST['set_gz']), '.')
Replace With: Select
'smiley_sets_known' => addslashes($modSettings['smiley_sets_known'] . ',' . $name),
'smiley_sets_names' => addslashes($modSettings['smiley_sets_names'] . "\n" . strtok(basename(isset($_FILES['set_gz']) ? $_FILES['set_gz']['name'] : $_REQUEST['set_gz']), '.'))
Find: Select
* Software Version: SMF 1.1 *
Replace With: Select
* Software Version: SMF 1.1.1 *

./Sources/PersonalMessage.php

Find: Select
WHERE FIND_IN_SET('" . implode("', labels) OR FIND_IN_SET('", $searchArray) . "', labels)", __FILE__, __LINE__);
Replace With: Select
WHERE FIND_IN_SET('" . implode("', labels) OR FIND_IN_SET('", $searchArray) . "', labels)
AND ID_MEMBER = $ID_MEMBER", __FILE__, __LINE__);
Find: Select
* Software Version: SMF 1.1 *
Replace With: Select
* Software Version: SMF 1.1.1 *

./Sources/Search.php

Find: Select
else
$_SESSION['search_cache']['num_results'] = 0;
Replace With: Select
elseif ($_SESSION['search_cache']['num_results'] === -1)
$_SESSION['search_cache']['num_results'] = 0;
Find: Select
* Software Version: SMF 1.1 *
Replace With: Select
* Software Version: SMF 1.1.1 *
Advertisement: