Update to SMF 1.0.6 - Installation Instructions for 1.0.5

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

File Edits ALT + Click to collapse all the operations

./SSI.php

Find: Select
* Software Version: SMF 1.0.3 *
Replace With: Select
* Software Version: SMF 1.0.6 *
Find: Select
krsort($return['users']);

if (!empty($return['users']))
$return['users'][array_pop(array_keys($return['users']))]['is_last'] = true;
Replace With: Select
if (!empty($return['users']))
{
krsort($return['users']);
$userlist = array_keys($return['users']);
$return['users'][$userlist[count($userlist) - 1]]['is_last'] = true;
}

./changelog.txt

Find: Select
SMF 1.0.4 June 7, 2005
================================================================================
June 2005:
--------------------------------------------------------------------------------
Add Before: Select
SMF 1.0.6 15 January 2006
================================================================================
December 2005:
--------------------------------------------------------------------------------
! Added PHP 4.4.0 Compatibility Fix. (Subs.php)
! Added MySQL 5.0.12 Compatibility Fix. (Numerous Files)
! Added additional checks to the database query function to reduce the risk of SQL injections. (Subs.php)


November 2005:
--------------------------------------------------------------------------------
! The IPB 2 converter didn't convert all members if the same email address was used twice. (invision2_to_smf.php)
! The YaBB converter didn't convert attachments properly. (yabb_to_smf.php)


October 2005:
--------------------------------------------------------------------------------
! Fixed a PHP 5.0.5 compatibility issue causing ssi_whosOnline() to malfunction. (SSI.php)


July 2005:
--------------------------------------------------------------------------------
! Finally fixed the nasty bug that was removing theme options. (Profile.php)
! Increase the strictness of the icon filename check. (Post.php)
! Make sure to check the moderator's session on lock/sticky. (LockTopic.php)
! Remove some package servers from the default list. (server.list)

./index.php

Find: Select
* Software Version: SMF 1.0.5 *
Replace With: Select
* Software Version: SMF 1.0.6 *
Find: Select
$forum_version = 'SMF 1.0.5';
Replace With: Select
$forum_version = 'SMF 1.0.6';

./Sources/LockTopic.php

Find: Select
* Software Version: SMF 1.0 *
Replace With: Select
* Software Version: SMF 1.0.6 *
Find: Select
// Just quit if there's no topic to lock.
if (empty($topic))
fatal_lang_error(472, false);
Add After: Select

checkSession('get');
Find: Select
// Make sure the user can sticky it, and they are stickying *something*.
isAllowedTo('make_sticky');
Add After: Select

checkSession('get');

./Sources/ManageMembers.php

Find: Select
* Software Version: SMF 1.0.5 *
Replace With: Select
* Software Version: SMF 1.0.6 *
Find: Select
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER=ban.ID_MEMBER)
Replace With: Select
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = ban.ID_MEMBER)

./Sources/Memberlist.php

Find: Select
* Software Version: SMF 1.0 *
Replace With: Select
* Software Version: SMF 1.0.6 *
Find: Select
if (!is_numeric($_REQUEST['start']))
{
Add After: Select
$_REQUEST['start'] = strtolower(substr($_REQUEST['start'], 0, 1));

if (preg_match('~([\da-z])~', $_REQUEST['start'], $match) == false)
fatal_error('Hacker?', false);
Find: Select
WHERE LOWER(SUBSTRING(realName, 1, 1)) < '" . strtolower($_REQUEST['start']) . "'", __FILE__, __LINE__);
Replace With: Select
WHERE LOWER(SUBSTRING(realName, 1, 1)) < '$_REQUEST[start]'", __FILE__, __LINE__);

./Sources/Post.php

Find: Select
* Software Version: SMF 1.0.5 *
Replace With: Select
* Software Version: SMF 1.0.6 *
Find: Select
$context['icon'] = $_REQUEST['icon'];
Replace With: Select
$context['icon'] = preg_replace('~[\./\\\\*:"<>]~', '', $_REQUEST['icon']);
Find: Select
$_POST['icon'] = preg_replace('~[./\\*:]~', '', $_POST['icon']);
Replace With: Select
$_POST['icon'] = preg_replace('~[\./\\\\*:"<>]~', '', $_POST['icon']);

./Sources/Profile.php

Find: Select
* Software Version: SMF 1.0.5 *
Replace With: Select
* Software Version: SMF 1.0.6 *
Find: Select
AND variable IN ('" . implode("', '", $erase_options) . "')", __FILE__, __LINE__);
Replace With: Select
AND variable IN ('" . implode("', '", $erase_options) . "')
AND ID_MEMBER = $memID", __FILE__, __LINE__);

./Sources/Subs.php

Find: Select
* Software Version: SMF 1.0.4 *
Replace With: Select
* Software Version: SMF 1.0.6 *
Find: Select
global $db_cache, $db_count, $db_connection;
Replace With: Select
global $db_cache, $db_count, $db_connection, $modSettings;
Find: Select
$st = explode(' ', microtime());
}
Add After: Select

// First, we clean strings out of the query, reduce whitespace, lowercase, and trim - so we can check it over.
if (empty($modSettings['disableQueryCheck']))
{
$clean = '';
$old_pos = 0;
$pos = -1;
while (true)
{
$pos = strpos($db_string, '\'', $pos + 1);
if ($pos === false)
break;
$clean .= substr($db_string, $old_pos, $pos - $old_pos);

while (true)
{
$pos1 = strpos($db_string, '\'', $pos + 1);
$pos2 = strpos($db_string, '\\', $pos + 1);
if ($pos1 === false)
break;
elseif ($pos2 == false || $pos2 > $pos1)
{
$pos = $pos1;
break;
}

$pos = $pos2 + 1;
}
$clean .= '%s';

$old_pos = $pos + 1;
}
$clean .= substr($db_string, $old_pos);
$clean = trim(strtolower(preg_replace(array('~\s+~s', '~/\*!40001 SQL_NO_CACHE \*/~', '~/\*!40000 USE INDEX \([A-Za-z\_]+?\) \*/~'), array(' ', '', ''), $clean)));

// We don't use UNION in SMF, at least so far. But it's useful for injections.
if (strpos($clean, 'union') !== false && preg_match('~(^|[^a-z])union($|[^[a-z])~s', $clean) != 0)
$fail = true;
// Comments? We don't use comments in our queries, we leave 'em outside!
elseif (strpos($clean, '/*') > 2 || strpos($clean, '--') !== false)
$fail = true;
// Trying to change passwords, slow us down, or something?
elseif (strpos($clean, 'set password') !== false && preg_match('~(^|[^a-z])set password($|[^[a-z])~s', $clean) != 0)
$fail = true;
elseif (strpos($clean, 'benchmark') !== false && preg_match('~(^|[^a-z])benchmark($|[^[a-z])~s', $clean) != 0)
$fail = true;
// Sub selects? We don't use those either.
elseif (preg_match('~\([^)]*?select~s', $clean) != 0)
$fail = true;

if (!empty($fail))
{
log_error('Hacking attempt...' . "\n" . $db_string, $file, $line);
fatal_error('Hacking attempt...', false);
}
}
Find: Select
// A named email address. [[email protected]]me[/email] And, you can't have []s in your email, I should know.
'~\[email=(.+?)\](.+?)\[/email\]~ie' => isset($disabled['email']) ? '"$2 ($1)"' : '"<a href=\"mailto:" . strtr("$1", array("\"" => "&quot;", "]" => "", "[" => "")) . "\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\])~i", "", strtr("$2", array("@" => "&#64;"))) . "</a>"',
// An image. Width and height can be are optional.
'~\[img(\s+width=([\d]+))?(\s+height=([\d]+))?\s*\](?:<br />)*(.+?)(?:<br />)*\[/img\]~ie' => isset($disabled['img']) ? 'preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$5", array("@" => "&#64;")))' : '"<img src=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$5", array("@" => "&#64;", "\"" => "&quot;"))) . "\" alt=\"\"" . ("$2" != "" ? " width=\"$2\"" : "") . ("$4" != "" ? " height=\"$4\"" : "") . " border=\"0\" />"',
// Find an inside link. (named?) ie. [iurl]www.simplemachines.org[/iurl]
'~\[iurl=(.+?)\](.+?)\[/iurl\]~ie' => isset($disabled['iurl']) ? (!isset($disabled['url']) ? '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\" target=\"_blank\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$2", array("@" => "&#64;"))) . "</a>"' : 'preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", "$2") . " ($1)"') : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$2", array("@" => "&#64;"))) . "</a>"',
'~\[iurl\](.+?)\[/iurl\]~ie' => isset($disabled['iurl']) ? (!isset($disabled['url']) ? '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\" target=\"_blank\">$1</a>"' : '"$1"') : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\">$1</a>"',
// FTP link. Named...? [ftp=upload.sourceforge.net]Sourceforge[/ftp]
'~\[ftp\](.+?)\[/ftp\]~ie' => isset($disabled['ftp']) ? 'preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", "$1")' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\" target=\"_blank\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array("@" => "&#64;"))) . "</a>"',
'~\[ftp=(.+?)\](.+?)\[/ftp\]~ie' => isset($disabled['ftp']) ? 'preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", "$2") . " ($1)"' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\" target=\"_blank\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$2", array("@" => "&#64;"))) . "</a>"',
// Find a (named?) URL... [url]www.simplemachines.org[/url] or [url=www.simplemachines.org]SMF[/url]
'~\[url=([^:\]]+?)\]([^\]]*?\[url(?:=[^\]]+?)?\].+?\[/url\].*?)\[/url\]~ie' => isset($disabled['url']) ? 'preg_replace("~(\[url.*?\]|\[/url\])~i", "", "$2") . " ($1)"' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\" target=\"_blank\">" . preg_replace("~(\[url.*?\]|\[/url\])~i", "", strtr("$2", array("@" => "&#64;"))) . "</a>"',
'~\[url=(.+?)\](.+?)\[/url\]~ie' => isset($disabled['url']) ? '"$2 ($1)"' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\" target=\"_blank\">" . strtr("$2", array("@" => "&#64;")) . "</a>"',
'~\[url\](?:<br />)*(.+?)(?:<br />)*\[/url\]~ie' => isset($disabled['url']) ? '"$1"' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\" target=\"_blank\">$1</a>"',
Replace With: Select
// A named email address. [[email protected]]me[/email] And, you can't have []s in your email, I should know.
'~\[email=([^<">]+?)\](.+?)\[/email\]~ie' => isset($disabled['email']) ? '"$2 ($1)"' : '"<a href=\"mailto:" . strtr("$1", array("\"" => "&quot;", "]" => "", "[" => "")) . "\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\])~i", "", strtr("$2", array("@" => "&#64;"))) . "</a>"',
// An image. Width and height can be are optional.
'~\[img(\s+width=([\d]+))?(\s+height=([\d]+))?\s*\](?:<br />)*([^<">]+?)(?:<br />)*\[/img\]~ie' => isset($disabled['img']) ? 'preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$5", array("@" => "&#64;")))' : '"<img src=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[flash.*?\]|\[/flash\]\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$5", array("@" => "&#64;", "\"" => "&quot;"))) . "\" alt=\"\"" . ("$2" != "" ? " width=\"$2\"" : "") . ("$4" != "" ? " height=\"$4\"" : "") . " border=\"0\" />"',
// Find an inside link. (named?) ie. [iurl]www.simplemachines.org[/iurl]
'~\[iurl=([^<">]+?)\](.+?)\[/iurl\]~ie' => isset($disabled['iurl']) ? (!isset($disabled['url']) ? '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\" target=\"_blank\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[flash.*?\]|\[/flash\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$2", array("@" => "&#64;"))) . "</a>"' : 'preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", "$2") . " ($1)"') : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$2", array("@" => "&#64;"))) . "</a>"',
'~\[iurl\]([^<">]+?)\[/iurl\]~ie' => isset($disabled['iurl']) ? (!isset($disabled['url']) ? '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\" target=\"_blank\">$1</a>"' : '"$1"') : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\">$1</a>"',
// FTP link. Named...? [ftp=upload.sourceforge.net]Sourceforge[/ftp]
'~\[ftp\]([^<">]+?)\[/ftp\]~ie' => isset($disabled['ftp']) ? 'preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", "$1")' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\" target=\"_blank\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array("@" => "&#64;"))) . "</a>"',
'~\[ftp=([^<">]+?)\](.+?)\[/ftp\]~ie' => isset($disabled['ftp']) ? 'preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", "$2") . " ($1)"' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\" target=\"_blank\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$2", array("@" => "&#64;"))) . "</a>"',
// Find a (named?) URL... [url]www.simplemachines.org[/url] or [url=www.simplemachines.org]SMF[/url]
'~\[url=([^:\]<">]+?)\]([^\]]*?\[url(?:=[^\]<">]+?)?\][^<">]+?\[/url\].*?)\[/url\]~ie' => isset($disabled['url']) ? 'preg_replace("~(\[url.*?\]|\[/url\])~i", "", "$2") . " ($1)"' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\" target=\"_blank\">" . preg_replace("~(\[url.*?\]|\[/url\])~i", "", strtr("$2", array("@" => "&#64;"))) . "</a>"',
'~\[url=([^<">]+?)\](.+?)\[/url\]~ie' => isset($disabled['url']) ? '"$2 ($1)"' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\" target=\"_blank\">" . strtr("$2", array("@" => "&#64;")) . "</a>"',
'~\[url\](?:<br />)*([^<">]+?)(?:<br />)*\[/url\]~ie' => isset($disabled['url']) ? '"$1"' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\" target=\"_blank\">$1</a>"',

./Sources/BoardIndex.php

This operation isn't vital to the installation of this mod.
Find: Select

FROM {$db_prefix}categories AS c, {$db_prefix}boards AS b
Replace With: Select

FROM ({$db_prefix}categories AS c, {$db_prefix}boards AS b)

./Sources/Display.php

This operation isn't vital to the installation of this mod.
Find: Select

FROM {$db_prefix}topics AS t, {$db_prefix}messages AS ms
Replace With: Select

FROM ({$db_prefix}topics AS t, {$db_prefix}messages AS ms)
This operation isn't vital to the installation of this mod.
Find: Select

FROM {$db_prefix}topics AS t, {$db_prefix}messages AS m
Replace With: Select

FROM ({$db_prefix}topics AS t, {$db_prefix}messages AS m)

./Sources/InstantMessage.php

This operation isn't vital to the installation of this mod.
Find: Select

FROM {$db_prefix}instant_messages AS pm" . ($context['folder'] == 'outbox' ? '' : ", {$db_prefix}im_recipients AS pmr") . "
Replace With: Select

FROM ({$db_prefix}instant_messages AS pm" . ($context['folder'] == 'outbox' ? '' : ", {$db_prefix}im_recipients AS pmr") . ")
This operation isn't vital to the installation of this mod.
Find: Select

FROM {$db_prefix}instant_messages AS pm" . ($context['folder'] == 'outbox' ? ($context['sort_by'] == 'name' ? "
LEFT JOIN {$db_prefix}im_recipients AS pmr ON (pmr.ID_PM = pm.ID_PM)" : '') : ", {$db_prefix}im_recipients AS pmr") . ($context['sort_by'] == 'name' ? ("
Replace With: Select

FROM ({$db_prefix}instant_messages AS pm" . ($context['folder'] == 'outbox' ? ')' . ($context['sort_by'] == 'name' ? "
LEFT JOIN {$db_prefix}im_recipients AS pmr ON (pmr.ID_PM = pm.ID_PM)" : '') : ", {$db_prefix}im_recipients AS pmr)") . ($context['sort_by'] == 'name' ? ("

./Sources/Load.php

This operation isn't vital to the installation of this mod.
Find: Select

FROM {$db_prefix}boards AS b" . (!empty($topic) ? ", {$db_prefix}topics AS t" : '') . "
Replace With: Select

FROM ({$db_prefix}boards AS b" . (!empty($topic) ? ", {$db_prefix}topics AS t" : '') . ")

./Sources/ManageAttachments.php

This operation isn't vital to the installation of this mod.
Find: Select

FROM {$db_prefix}attachments AS a, {$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}messages AS mf
Replace With: Select

FROM ({$db_prefix}attachments AS a, {$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}messages AS mf)

./Sources/ManagePermissions.php

This operation isn't vital to the installation of this mod.
Find: Select

FROM {$db_prefix}boards AS b, {$db_prefix}categories AS c
Replace With: Select

FROM ({$db_prefix}boards AS b, {$db_prefix}categories AS c)

./Sources/MessageIndex.php

This operation isn't vital to the installation of this mod.
Find: Select

FROM {$db_prefix}topics AS t, {$db_prefix}messages AS ml, {$db_prefix}messages AS mf
Replace With: Select

FROM ({$db_prefix}topics AS t, {$db_prefix}messages AS ml, {$db_prefix}messages AS mf)

./Sources/MoveTopic.php

This operation isn't vital to the installation of this mod.
Find: Select

FROM {$db_prefix}topics AS t, {$db_prefix}log_mark_read AS lmr
Replace With: Select

FROM ({$db_prefix}topics AS t, {$db_prefix}log_mark_read AS lmr)

./Sources/News.php

This operation isn't vital to the installation of this mod.
Find: Select

FROM {$db_prefix}topics AS t, {$db_prefix}messages AS m, {$db_prefix}boards AS b
Replace With: Select

FROM ({$db_prefix}topics AS t, {$db_prefix}messages AS m, {$db_prefix}boards AS b)
This operation isn't vital to the installation of this mod.
Find: Select

FROM {$db_prefix}messages AS m, {$db_prefix}messages AS mf, {$db_prefix}topics AS t, {$db_prefix}boards AS b
Replace With: Select

FROM ({$db_prefix}messages AS m, {$db_prefix}messages AS mf, {$db_prefix}topics AS t, {$db_prefix}boards AS b)

./Sources/Poll.php

This operation isn't vital to the installation of this mod.
Find: Select

FROM {$db_prefix}polls AS p, {$db_prefix}topics AS t
Replace With: Select

FROM ({$db_prefix}polls AS p, {$db_prefix}topics AS t)

./Sources/Recent.php

This operation isn't vital to the installation of this mod.
Find: Select

FROM {$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b
Replace With: Select

FROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b)
This operation isn't vital to the installation of this mod.
Find: Select

FROM {$db_prefix}messages AS m, {$db_prefix}messages AS m2, {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}categories AS c
Replace With: Select

FROM ({$db_prefix}messages AS m, {$db_prefix}messages AS m2, {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}categories AS c)
This operation isn't vital to the installation of this mod.
Find: Select

FROM {$db_prefix}messages AS ml, {$db_prefix}topics AS t, {$db_prefix}boards AS b
Replace With: Select

FROM ({$db_prefix}messages AS ml, {$db_prefix}topics AS t, {$db_prefix}boards AS b)
This operation isn't vital to the installation of this mod.
Find: Select

$min_message = (int) $min_message;

$request = db_query("
SELECT $select_clause
FROM {$db_prefix}messages AS ms, {$db_prefix}messages AS ml, {$db_prefix}topics AS t, {$db_prefix}boards AS b
Replace With: Select

$min_message = (int) $min_message;

$request = db_query("
SELECT $select_clause
FROM ({$db_prefix}messages AS ms, {$db_prefix}messages AS ml, {$db_prefix}topics AS t, {$db_prefix}boards AS b)
This operation isn't vital to the installation of this mod.
Find: Select

SELECT COUNT(DISTINCT t.ID_TOPIC), MIN(t.ID_LAST_MSG)
FROM {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ml, {$db_prefix}messages AS m
Replace With: Select

SELECT COUNT(DISTINCT t.ID_TOPIC), MIN(t.ID_LAST_MSG)
FROM ({$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ml, {$db_prefix}messages AS m)
This operation isn't vital to the installation of this mod.
Find: Select

SELECT DISTINCT t.ID_TOPIC
FROM {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ml, {$db_prefix}messages AS m
Replace With: Select

SELECT DISTINCT t.ID_TOPIC
FROM ({$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ml, {$db_prefix}messages AS m)
This operation isn't vital to the installation of this mod.
Find: Select

return;
}

$request = db_query("
SELECT $select_clause
FROM {$db_prefix}messages AS ms, {$db_prefix}messages AS ml, {$db_prefix}topics AS t, {$db_prefix}boards AS b
Replace With: Select

return;
}

$request = db_query("
SELECT $select_clause
FROM ({$db_prefix}messages AS ms, {$db_prefix}messages AS ml, {$db_prefix}topics AS t, {$db_prefix}boards AS b)

./Sources/Search.php

This operation isn't vital to the installation of this mod.
Find: Select

FROM {$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}categories AS c, {$db_prefix}messages AS first_m, {$db_prefix}messages AS last_m
Replace With: Select

FROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}categories AS c, {$db_prefix}messages AS first_m, {$db_prefix}messages AS last_m)

./Sources/SplitTopics.php

This operation isn't vital to the installation of this mod.
Find: Select

FROM {$db_prefix}topics AS t, {$db_prefix}messages AS m, {$db_prefix}messages AS m2
Replace With: Select

FROM ({$db_prefix}topics AS t, {$db_prefix}messages AS m, {$db_prefix}messages AS m2)
This operation isn't vital to the installation of this mod.
Find: Select

FROM {$db_prefix}topics AS t, {$db_prefix}messages AS m1, {$db_prefix}messages AS m2
Replace With: Select

FROM ({$db_prefix}topics AS t, {$db_prefix}messages AS m1, {$db_prefix}messages AS m2)
Advertisement: