Advertisement:

Navigation

File Edits

./changelog.txt

Operation #1
Find: [Select]
Changes go downward, months go upward. Please scroll to the bottom for a legend.
Changelog started January 1, 2004; Currently at $Revision: 1.1040.2.284 $.
Replace With: [Select]
Changes go downward, months go upward. Please scroll to the bottom for a legend.
Changelog started January 1, 2004; Currently at $Revision: 1.1040.2.310 $.

SMF 1.0.2 February 14, 2005
================================================================================
February 2005:
--------------------------------------------------------------------------------
! Don't use id for login checks, use member. (LogInOut.php)
! Properly censor the first post's subject and show it in the main link, not the matched subject. (Search.php)
! In Invision, usernames should already have entities. (invision_to_smf.php, invision2_to_smf.php)
! Fixed a typo that was causing permission problems for non-administrators. (Profile.php)
! If someone's data isn't loaded yet, they have no permissions; return false instead of generating errors. (Security.php)
! Make the personal messages load faster. (InstantMessage.php)
! You couldn't set the strength for glow to more than 2 without using zeros. (Subs.php)
! Make the "I don't like people to see my full path which can easily be seen in other ways anyway" people happy. (SSI.php, ssi_examples.php)
! Change [quote=...] to [quote="..."] in the vBulletin converters. (vbulletin_to_smf.php, vbulletin3_to_smf.php)
! Fixed missing member ID on login after registration. (Register.php)


January 2005:
--------------------------------------------------------------------------------
! Fixed a minor notice when searching without create temporary. (Search.php)
! Pagination was still a bit wrong in unread topics, etc. (Recent.php)
! Fix handling of slashes in search form filling. (Search.php)
! Upgrader didn't show the error message properly for when agreement.txt was not writable. (upgrade.php)
! phpBB converter now handles code sections and some other bbcode better. (phpbb2_to_smf.php)
! CGI server check for logins, etc. wasn't working with FastCGI. (Load.php)
! Fix "never expire" not being properly checked bug. (LogInOut.php)
! Fixed missing ID_FIRST_MSG when searching without temporary tables. (Search.php)
! Multiple members wouldn't show in the "newest members" rss feed. (News.php)
! If anything goes wrong extracting a file, fail more silently. (Subs-Package.php)
! Recount all forum totals was not properly affecting the last messages on boards. (Admin.php)
! Attachments with "&" and " " characters in them weren't converted properly. (phpbb2_to_smf.php)
! Keep tabs in PHP code blocks properly under PHP 5. (Subs.php)
! Make upgrade.php accept an older language file for minor releases. (upgrade.php)
! Resetting all theme options didn't always set the default registration options right. (Themes.php)
& A few links were using _new instead of _blank. (Errors language files, Help language files, Subs.php, news_readme.html)
! A database error could occur if you tried to create a smiley with a single quote in its name. (ManageSmileys.php)
! Package manager wasn't properly skipping missing files. (Subs-Package.php)
! Minor unimportant but still dumb typo in all converters. (all converters)
! Fixed a notice that could occur when a guest posts. (Post.php)
* Work around dumb server security settings. (Subs.php, ManageMembers.php, ManageMembers template)
! Fix some issues in the YaBB and YaBB SE converters. (yabb_to_smf.php, yabbse_to_smf.php)


./index.php

Operation #1
Find: [Select]
* =========================================================================== *
* Software Version: SMF 1.0.1 *
* Software by: Simple Machines (http://www.simplemachines.org) *
Replace With: [Select]
* =========================================================================== *
* Software Version: SMF 1.0.2 *
* Software by: Simple Machines (http://www.simplemachines.org) *

Operation #2
Find: [Select]

$forum_version = 'SMF 1.0.1';
Replace With: [Select]

$forum_version = 'SMF 1.0.2';

./news_readme.html

Operation #1
Find: [Select]
Copyright (C) 2002-2005 Lewis Media. All Rights Reserved.<br />
Web: <a href="http://www.simplemachines.org/" target="_new">http://www.simplemachines.org/</a><br />
<br />
Replace With: [Select]
Copyright (C) 2002-2005 Lewis Media. All Rights Reserved.<br />
Web: <a href="http://www.simplemachines.org/" target="_blank">http://www.simplemachines.org/</a><br />
<br />

./Sources/InstantMessage.php

Operation #1
Find: [Select]
* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com) *
* =========================================================================== *
* Software Version: SMF 1.0 *
* Software by: Simple Machines (http://www.simplemachines.org) *
* Copyright 2001-2004 by: Lewis Media (http://www.lewismedia.com) *
* Support, News, Updates at: http://www.simplemachines.org *
*******************************************************************************
Replace With: [Select]
* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com) *
* =========================================================================== *
* Software Version: SMF 1.0.2 *
* Software by: Simple Machines (http://www.simplemachines.org) *
* Copyright 2001-2005 by: Lewis Media (http://www.lewismedia.com) *
* Support, News, Updates at: http://www.simplemachines.org *
*******************************************************************************

Operation #2
Find: [Select]
$request = db_query("
SELECT pm.ID_PM, pm.ID_MEMBER_FROM
FROM {$db_prefix}instant_messages AS pm" . ($context['folder'] == 'outbox' && $context['sort_by'] != 'name' ? '' : "
LEFT JOIN {$db_prefix}im_recipients AS pmr ON (pm.ID_PM = pmr.ID_PM)") . ($context['sort_by'] == 'name' ? ("
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = " . ($context['folder'] == 'outbox' ? 'pmr.ID_MEMBER' : 'pm.ID_MEMBER_FROM') . ")") : '') . "
WHERE " . ($context['folder'] == 'outbox' ? "pm.ID_MEMBER_FROM = $ID_MEMBER
AND pm.deletedBySender = 0" : "pmr.ID_MEMBER = $ID_MEMBER
AND pmr.deleted = 0") . "
ORDER BY $_GET[sort] " . ($descending ? ' DESC' : ' ASC') . "
LIMIT $_GET[start], $modSettings[defaultMaxMessages]", __FILE__, __LINE__);
Replace With: [Select]
$request = db_query("
SELECT pm.ID_PM, pm.ID_MEMBER_FROM
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' ? ("
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = " . ($context['folder'] == 'outbox' ? 'pmr.ID_MEMBER' : 'pm.ID_MEMBER_FROM') . ")") : '') . "
WHERE " . ($context['folder'] == 'outbox' ? "pm.ID_MEMBER_FROM = $ID_MEMBER
AND pm.deletedBySender = 0" : "pm.ID_PM = pmr.ID_PM
AND pmr.ID_MEMBER = $ID_MEMBER
AND pmr.deleted = 0") . "
ORDER BY " . ($_GET['sort'] == 'pm.ID_PM' && $context['folder'] != 'outbox' ? 'pmr.ID_PM' : $_GET['sort']) . ($descending ? ' DESC' : ' ASC') . "
LIMIT $_GET[start], $modSettings[defaultMaxMessages]", __FILE__, __LINE__);

./Sources/Admin.php

Operation #1
Find: [Select]
* =========================================================================== *
* Software Version: SMF 1.0.1 *
* Software by: Simple Machines (http://www.simplemachines.org) *
Replace With: [Select]
* =========================================================================== *
* Software Version: SMF 1.0.2 *
* Software by: Simple Machines (http://www.simplemachines.org) *

Operation #2
Find: [Select]
<div style="margin-top: 1ex;"><b>Developers:</b> Unknown W. &quot;[Unknown]&quot; Brackets, Hendrik Jan &quot;Compuart&quot; Visser, Matt &quot;Grudge&quot; Wolf, and Philip &quot;Meriadoc&quot; Renich</div>
<div style="margin-top: 1ex;"><b>Support Specialists:</b>Andrea Hubacher, Alexandre &quot;Ap2&quot; Patenaude, A.M.A, Ben Scott, [darksteel], Douglas &quot;The Bear&quot; Hazard, Horseman, Killer Possum, Mediman, Methonis, Michael &quot;Oldiesmann&quot; Eshom, Omar Bazavilvazo, Osku &quot;Owdy&quot; Uusitupa, Pitti, and Tomer &quot;Lamper&quot; Dean.</div>
<div style="margin-top: 1ex;"><b>Mod Developers:</b> Jack.R.Abbit, Aliencowfarm, Big P., Chris Cromer, Cristi&aacute;n &quot;Anguz&quot; L&aacute;vaque, Daniel Diehl, groundup, James &quot;Cheschire&quot; Yarbro, Jesse &quot;Gobalopper&quot; Reid, Spaceman-Spiff.</div>
Replace With: [Select]
<div style="margin-top: 1ex;"><b>Developers:</b> Unknown W. &quot;[Unknown]&quot; Brackets, Hendrik Jan &quot;Compuart&quot; Visser, Matt &quot;Grudge&quot; Wolf, and Philip &quot;Meriadoc&quot; Renich</div>
<div style="margin-top: 1ex;"><b>Support Specialists:</b> Andrea Hubacher, Alexandre &quot;Ap2&quot; Patenaude, A.M.A, Ben Scott, [darksteel], Douglas &quot;The Bear&quot; Hazard, Horseman, Killer Possum, Mediman, Methonis, Michael &quot;Oldiesmann&quot; Eshom, Omar Bazavilvazo, Osku &quot;Owdy&quot; Uusitupa, Pitti, and Tomer &quot;Lamper&quot; Dean.</div>
<div style="margin-top: 1ex;"><b>Mod Developers:</b> Jack.R.Abbit, Aliencowfarm, Big P., Chris Cromer, Cristi&aacute;n &quot;Anguz&quot; L&aacute;vaque, Daniel Diehl, groundup, James &quot;Cheschire&quot; Yarbro, Jesse &quot;Gobalopper&quot; Reid, Spaceman-Spiff.</div>

Operation #3
Find: [Select]
while ($row = mysql_fetch_assoc($request))
$resort_me[$row['childLevel']] = $row;
mysql_free_result($request);
Replace With: [Select]
while ($row = mysql_fetch_assoc($request))
$resort_me[$row['childLevel']][] = $row;
mysql_free_result($request);

Operation #4
Find: [Select]
$lastMsg = array();
foreach ($resort_me as $row)
{
// The latest message is the latest of the current board and its children.
if (isset($lastMsg[$row['ID_BOARD']]))
$curLastMsg = max($row['localLastMsg'], $lastMsg[$row['ID_BOARD']]);
else
$curLastMsg = $row['localLastMsg'];

// If what is and what should be the latest message differ, an update is necessary.
if ($curLastMsg != $row['ID_LAST_MSG'])
db_query("
UPDATE {$db_prefix}boards
SET ID_LAST_MSG = $curLastMsg
WHERE ID_BOARD = $row[ID_BOARD]
LIMIT 1", __FILE__, __LINE__);

// Parent boards inherit the latest message of their children.
if (isset($lastMsg[$row['ID_PARENT']]))
$lastMsg[$row['ID_PARENT']] = max($row['localLastMsg'], $lastMsg[$row['ID_PARENT']]);
else
$lastMsg[$row['ID_PARENT']] = $row['localLastMsg'];
}
Replace With: [Select]
$lastMsg = array();
foreach ($resort_me as $rows)
foreach ($rows as $row)
{
// The latest message is the latest of the current board and its children.
if (isset($lastMsg[$row['ID_BOARD']]))
$curLastMsg = max($row['localLastMsg'], $lastMsg[$row['ID_BOARD']]);
else
$curLastMsg = $row['localLastMsg'];

// If what is and what should be the latest message differ, an update is necessary.
if ($curLastMsg != $row['ID_LAST_MSG'])
db_query("
UPDATE {$db_prefix}boards
SET ID_LAST_MSG = $curLastMsg
WHERE ID_BOARD = $row[ID_BOARD]
LIMIT 1", __FILE__, __LINE__);

// Parent boards inherit the latest message of their children.
if (isset($lastMsg[$row['ID_PARENT']]))
$lastMsg[$row['ID_PARENT']] = max($row['localLastMsg'], $lastMsg[$row['ID_PARENT']]);
else
$lastMsg[$row['ID_PARENT']] = $row['localLastMsg'];
}

./Sources/Errors.php

Operation #1
Find: [Select]
* =========================================================================== *
* Software Version: SMF 1.0.1 *
* Software by: Simple Machines (http://www.simplemachines.org) *
Replace With: [Select]
* =========================================================================== *
* Software Version: SMF 1.0.2 *
* Software by: Simple Machines (http://www.simplemachines.org) *

Operation #2
Find: [Select]
$message = log_error($error_level . ': ' . $error_string, $file, $line);
Replace With: [Select]
$message = log_error($error_level . ': ' . $error_string, $file, $line);

// Dying on these errors only causes MORE problems (blank pages!)
if ($file == 'Unknown')
return;

./Sources/Load.php

Operation #1
Find: [Select]
* =========================================================================== *
* Software Version: SMF 1.0.1 *
* Software by: Simple Machines (http://www.simplemachines.org) *
Replace With: [Select]
* =========================================================================== *
* Software Version: SMF 1.0.2 *
* Software by: Simple Machines (http://www.simplemachines.org) *

Operation #2
Find: [Select]
'is_apache' => strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false,
'is_cgi' => php_sapi_name() == 'cgi'
);
Replace With: [Select]
'is_apache' => strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false,
'is_cgi' => strpos(php_sapi_name(), 'cgi') !== false,
);

./Sources/LogInOut.php

Operation #1
Find: [Select]
* =========================================================================== *
* Software Version: SMF 1.0.1 *
* Software by: Simple Machines (http://www.simplemachines.org) *
Replace With: [Select]
* =========================================================================== *
* Software Version: SMF 1.0.2 *
* Software by: Simple Machines (http://www.simplemachines.org) *

Operation #2
Find: [Select]
// Strike! You're outta there!
if ($_GET['id'] != $ID_MEMBER)
fatal_lang_error('login_cookie_error', false);
Replace With: [Select]
// Strike! You're outta there!
if ($_GET['member'] != $ID_MEMBER)
fatal_lang_error('login_cookie_error', false);

Operation #3
Find: [Select]
$context['default_password'] = '';
$context['never_expire'] = $modSettings['cookieTime'] == 525600;
$context['login_error'] = &$txt[106];
Replace With: [Select]
$context['default_password'] = '';
$context['never_expire'] = $modSettings['cookieTime'] == 525600 || $modSettings['cookieTime'] == 3153600;
$context['login_error'] = &$txt[106];

Operation #4
Find: [Select]
if (empty($maintenance) || allowedTo('admin_forum'))
redirectexit('action=login2;sa=check;id=' . $ID_MEMBER, true, $context['server']['needs_login_fix']);
else
Replace With: [Select]
if (empty($maintenance) || allowedTo('admin_forum'))
redirectexit('action=login2;sa=check;member=' . $ID_MEMBER, true, $context['server']['needs_login_fix']);
else

./Sources/ManageMembers.php

Operation #1
Find: [Select]
* SMF: Simple Machines Forum *
* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com) *
* =========================================================================== *
* Software Version: SMF 1.0 *
* Software by: Simple Machines (http://www.simplemachines.org) *
* Copyright 2001-2004 by: Lewis Media (http://www.lewismedia.com) *
* Support, News, Updates at: http://www.simplemachines.org *
*******************************************************************************
* This program is free software; you may redistribute it and/or modify it *
Replace With: [Select]
* SMF: Simple Machines Forum *
* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com) *
* =========================================================================== *
* Software Version: SMF 1.0.2 *
* Software by: Simple Machines (http://www.simplemachines.org) *
* Copyright 2001-2005 by: Lewis Media (http://www.lewismedia.com) *
* Support, News, Updates at: http://www.simplemachines.org *
*******************************************************************************
* This program is free software; you may redistribute it and/or modify it *

Operation #2
Find: [Select]
WHERE groupName = '$_POST[group_name]'
LIMIT 1", __FILE__, __LINE__);
if (mysql_num_rows($request) != 0)
redirectexit('action=membergroups');
mysql_free_result($request);

$request = db_query("
Replace With: [Select]
WHERE groupName = '$_POST[group_name]'
LIMIT 1", __FILE__, __LINE__);
if (mysql_num_rows($request) != 0)
redirectexit('action=membergroups;');
mysql_free_result($request);

$request = db_query("

Operation #3
Find: [Select]

// If they have no special access requirements then skip the rest of this.
if (count($boards) == 0)
redirectexit('action=membergroups');

// Now it's the time to sort out which boards this new group has access to.
$result = db_query("
Replace With: [Select]

// If they have no special access requirements then skip the rest of this.
if (count($boards) == 0)
redirectexit('action=membergroups;');

// Now it's the time to sort out which boards this new group has access to.
$result = db_query("

Operation #4
Find: [Select]
}
mysql_free_result($result);

redirectexit('action=membergroups');
}

function DeleteMembergroup()
Replace With: [Select]
}
mysql_free_result($result);

redirectexit('action=membergroups;');
}

function DeleteMembergroup()

Operation #5
Find: [Select]
$_REQUEST['id'] = (int) $_REQUEST['id'];

if ($_REQUEST['id'] <= 4)
redirectexit('action=membergroups');

db_query("
DELETE FROM {$db_prefix}membergroups
Replace With: [Select]
$_REQUEST['id'] = (int) $_REQUEST['id'];

if ($_REQUEST['id'] <= 4)
redirectexit('action=membergroups;');

db_query("
DELETE FROM {$db_prefix}membergroups

Operation #6
Find: [Select]
// Recalculate the post groups, as they likely changed.
updateStats('postgroups');

redirectexit('action=membergroups');
}

function EditMembergroup()
Replace With: [Select]
// Recalculate the post groups, as they likely changed.
updateStats('postgroups');

redirectexit('action=membergroups;');
}

function EditMembergroup()

Operation #7
Find: [Select]
// There might have been some post group changes.
updateStats('postgroups');

redirectexit('action=membergroups');
}

$result = db_query("
Replace With: [Select]
// There might have been some post group changes.
updateStats('postgroups');

redirectexit('action=membergroups;');
}

$result = db_query("

./Sources/ManageSmileys.php

Operation #1
Find: [Select]
* =========================================================================== *
* Software Version: SMF 1.0.1 *
* Software by: Simple Machines (http://www.simplemachines.org) *
Replace With: [Select]
* =========================================================================== *
* Software Version: SMF 1.0.2 *
* Software by: Simple Machines (http://www.simplemachines.org) *

Operation #2
Find: [Select]
if (in_array(strrchr($entry, '.'), array('.jpg', '.gif', '.jpeg', '.png')))
$smileys[strtolower($entry)] = $entry;
}
Replace With: [Select]
if (in_array(strrchr($entry, '.'), array('.jpg', '.gif', '.jpeg', '.png')))
$smileys[strtolower($entry)] = addslashes($entry);
}

Operation #3
Find: [Select]
if (in_array(strrchr($entry, '.'), array('.jpg', '.gif', '.jpeg', '.png')))
$smileys[strtolower($entry)] = $entry;
}
Replace With: [Select]
if (in_array(strrchr($entry, '.'), array('.jpg', '.gif', '.jpeg', '.png')))
$smileys[strtolower($entry)] = addslashes($entry);
}

./Sources/Post.php

Operation #1
Find: [Select]
* =========================================================================== *
* Software Version: SMF 1.0.1 *
* Software by: Simple Machines (http://www.simplemachines.org) *
Replace With: [Select]
* =========================================================================== *
* Software Version: SMF 1.0.2 *
* Software by: Simple Machines (http://www.simplemachines.org) *

Operation #2
Find: [Select]
// If user is a guest, make sure the chosen name isn't taken.
if (isReservedName($_POST['guestname']) && $_POST['guestname'] != $row['posterName'])
$post_errors[] = 'bad_name';
Replace With: [Select]
// If user is a guest, make sure the chosen name isn't taken.
if (isReservedName($_POST['guestname']) && (!isset($row['posterName']) || $_POST['guestname'] != $row['posterName']))
$post_errors[] = 'bad_name';

Operation #3
Find: [Select]
$request = db_query("
SELECT COUNT(ID_ATTACH), SUM(size)
FROM {$db_prefix}attachments
WHERE ID_MSG = $_REQUEST[msg]", __FILE__, __LINE__);
list ($quantity, $total_size) = mysql_fetch_row($request);
Replace With: [Select]
$request = db_query("
SELECT COUNT(ID_ATTACH), SUM(size)
FROM {$db_prefix}attachments
WHERE ID_MSG = $_REQUEST[msg]", __FILE__, __LINE__);
list ($quantity, $total_size) = mysql_fetch_row($request);

./Sources/Profile.php

Operation #1
Find: [Select]
* =========================================================================== *
* Software Version: SMF 1.0.1 *
* Software by: Simple Machines (http://www.simplemachines.org) *
Replace With: [Select]
* =========================================================================== *
* Software Version: SMF 1.0.2 *
* Software by: Simple Machines (http://www.simplemachines.org) *

Operation #2
Find: [Select]
'account' => array(array('manage_membergroups', 'profile_identity_any', 'profile_identity_own'), array('manage_membergroups', 'profile_identity_any')),
'forumProfile' => array(array('profile_exta_any', 'profile_extra_own'), array('profile_extra_any')),
'theme' => array(array('profile_exta_any', 'profile_extra_own'), array('profile_extra_any')),
'notification' => array(array('profile_exta_any', 'profile_extra_own'), array('profile_extra_any')),
'pmprefs' => array(array('profile_exta_any', 'profile_extra_own'), array('profile_extra_any')),
'deleteAccount' => array(array('profile_remove_any', 'profile_remove_own'), array('profile_remove_any')),
Replace With: [Select]
'account' => array(array('manage_membergroups', 'profile_identity_any', 'profile_identity_own'), array('manage_membergroups', 'profile_identity_any')),
'forumProfile' => array(array('profile_extra_any', 'profile_extra_own'), array('profile_extra_any')),
'theme' => array(array('profile_extra_any', 'profile_extra_own'), array('profile_extra_any')),
'notification' => array(array('profile_extra_any', 'profile_extra_own'), array('profile_extra_any')),
'pmprefs' => array(array('profile_extra_any', 'profile_extra_own'), array('profile_extra_any')),
'deleteAccount' => array(array('profile_remove_any', 'profile_remove_own'), array('profile_remove_any')),

Operation #3
Find: [Select]
'account' => array(array('manage_membergroups', 'profile_identity_any', 'profile_identity_own'), array('manage_membergroups', 'profile_identity_any'), 'post', true),
'forumProfile' => array(array('profile_exta_any', 'profile_extra_own'), array('profile_extra_any'), 'post'),
'theme' => array(array('profile_exta_any', 'profile_extra_own'), array('profile_extra_any'), 'post'),
'notification' => array(array('profile_exta_any', 'profile_extra_own'), array('profile_extra_any'), 'post'),
'pmprefs' => array(array('profile_exta_any', 'profile_extra_own'), array('profile_extra_any'), 'post'),
'deleteAccount' => array(array('profile_remove_any', 'profile_remove_own'), array('profile_remove_any'), 'post', true),
Replace With: [Select]
'account' => array(array('manage_membergroups', 'profile_identity_any', 'profile_identity_own'), array('manage_membergroups', 'profile_identity_any'), 'post', true),
'forumProfile' => array(array('profile_extra_any', 'profile_extra_own'), array('profile_extra_any'), 'post'),
'theme' => array(array('profile_extra_any', 'profile_extra_own'), array('profile_extra_any'), 'post'),
'notification' => array(array('profile_extra_any', 'profile_extra_own'), array('profile_extra_any'), 'post'),
'pmprefs' => array(array('profile_extra_any', 'profile_extra_own'), array('profile_extra_any'), 'post'),
'deleteAccount' => array(array('profile_remove_any', 'profile_remove_own'), array('profile_remove_any'), 'post', true),

./Sources/Recent.php

Operation #1
Find: [Select]
* =========================================================================== *
* Software Version: SMF 1.0.1 *
* Software by: Simple Machines (http://www.simplemachines.org) *
Replace With: [Select]
* =========================================================================== *
* Software Version: SMF 1.0.2 *
* Software by: Simple Machines (http://www.simplemachines.org) *

Operation #2
Find: [Select]
// Make sure the starting place makes sense and construct the page index.
$context['page_index'] = constructPageIndex($scripturl . '?action=' . $_REQUEST['action'] . ($context['showing_all_topics'] ? ';all' : '') . (empty($board) ? '' : ';board=' . $board . '.0'), $_REQUEST['start'], $num_topics, $modSettings['defaultMaxTopics']);
$context['current_page'] = (int) $_REQUEST['start'] / $modSettings['defaultMaxTopics'];
Replace With: [Select]
// Make sure the starting place makes sense and construct the page index.
if (empty($board))
$context['page_index'] = constructPageIndex($scripturl . '?action=' . $_REQUEST['action'] . ($context['showing_all_topics'] ? ';all' : ''), $_REQUEST['start'], $num_topics, $modSettings['defaultMaxTopics']);
else
$context['page_index'] = constructPageIndex($scripturl . '?action=' . $_REQUEST['action'] . ($context['showing_all_topics'] ? ';all' : '') . ';board=' . $board, $_REQUEST['start'], $num_topics, $modSettings['defaultMaxTopics'], true);
$context['current_page'] = (int) $_REQUEST['start'] / $modSettings['defaultMaxTopics'];

Operation #3
Find: [Select]
// Make sure the starting place makes sense and construct the page index.
$context['page_index'] = constructPageIndex($scripturl . '?action=' . $_REQUEST['action'] . (empty($board) ? '' : ';board=' . $board . '.0'), $_REQUEST['start'], $num_topics, $modSettings['defaultMaxTopics']);
$context['current_page'] = (int) $_REQUEST['start'] / $modSettings['defaultMaxTopics'];
Replace With: [Select]
// Make sure the starting place makes sense and construct the page index.
if (empty($board))
$context['page_index'] = constructPageIndex($scripturl . '?action=' . $_REQUEST['action'], $_REQUEST['start'], $num_topics, $modSettings['defaultMaxTopics']);
else
$context['page_index'] = constructPageIndex($scripturl . '?action=' . $_REQUEST['action'] . ';board=' . $board, $_REQUEST['start'], $num_topics, $modSettings['defaultMaxTopics'], true);
$context['current_page'] = (int) $_REQUEST['start'] / $modSettings['defaultMaxTopics'];

./Sources/Search.php

Operation #1
Find: [Select]
* =========================================================================== *
* Software Version: SMF 1.0.1 *
* Software by: Simple Machines (http://www.simplemachines.org) *
Replace With: [Select]
* =========================================================================== *
* Software Version: SMF 1.0.2 *
* Software by: Simple Machines (http://www.simplemachines.org) *

Operation #2
Find: [Select]

// Find all the boards this user is allowed to see.
Replace With: [Select]

if (isset($context['search_params']['search']))
$context['search_params']['search'] = htmlspecialchars($context['search_params']['search']);
if (isset($context['search_params']['userspec']))
$context['search_params']['userspec'] = htmlspecialchars(stripslashes($context['search_params']['userspec']));

// Find all the boards this user is allowed to see.

Operation #3
Find: [Select]
$request = db_query("
SELECT m.ID_TOPIC AS ID_TOPIC, m.ID_MSG, t.numReplies, 1 AS is_subject
FROM {$db_prefix}topics AS t, {$db_prefix}messages AS m
Replace With: [Select]
$request = db_query("
SELECT m.ID_TOPIC AS ID_TOPIC, t.ID_FIRST_MSG, t.numReplies, 1 AS is_subject
FROM {$db_prefix}topics AS t, {$db_prefix}messages AS m

Operation #4
Find: [Select]
$sort[$ID_MSG] = $search_params['sort'] == 'relevance' ? $relevance : ($search_params['sort'] == 'numReplies' ? $matchingTopics[$row['ID_TOPIC']]['numReplies'] : $ID_MSG);
$tmp[$ID_MSG] .= "($modSettings[search_pointer], $row[ID_TOPIC], $relevance, $ID_MSG, $row[numMsg])";
}
Replace With: [Select]
$sort[$ID_MSG] = $search_params['sort'] == 'relevance' ? $relevance : ($search_params['sort'] == 'numReplies' ? $matchingTopics[$row['ID_TOPIC']]['numReplies'] : $ID_MSG);
$tmp[$ID_MSG] = (isset($tmp[$ID_MSG]) ? $tmp[$ID_MSG] : '') . '(' . (int) $modSettings['search_pointer'] . ', ' . (int) $row['ID_TOPIC'] . ', ' . (int) $relevance . ', ' . (int) $ID_MSG . ', ' . (int) $row['numMsg'] . '),';
}

Operation #5
Find: [Select]
foreach ($sort as $ID_MSG => $value)
$insertRows[$ID_MSG] = $tmp[$ID_MSG];
unset($tmp);
Replace With: [Select]
foreach ($sort as $ID_MSG => $value)
$insertRows[$ID_MSG] = substr($tmp[$ID_MSG], 0, -1);
unset($tmp);

Operation #6
Find: [Select]
// Insert the matching topics into the cache.
db_query("
INSERT INTO {$db_prefix}log_search
(ID_SEARCH, ID_TOPIC, relevance, ID_MSG, num_matches)
VALUES " . implode(', ', $insertRows), __FILE__, __LINE__);
}
Replace With: [Select]
// Insert the matching topics into the cache.
if (!empty($insertRows))
db_query("
INSERT INTO {$db_prefix}log_search
(ID_SEARCH, ID_TOPIC, relevance, ID_MSG, num_matches)
VALUES " . implode(', ', $insertRows), __FILE__, __LINE__);
}

Operation #7
Find: [Select]
$message['subject'] = $message['subject'] != '' ? $message['subject'] : $txt[24];
Replace With: [Select]
$message['subject'] = $message['subject'] != '' ? $message['subject'] : $txt[24];
$message['first_subject'] = $message['first_subject'] != '' ? $message['first_subject'] : $txt[24];

Operation #8
Find: [Select]

// Shorten this message if necessary.
Replace With: [Select]

censorText($message['first_subject']);

// Shorten this message if necessary.

Operation #9
Find: [Select]
'href' => $scripturl . '?topic=' . $message['ID_TOPIC'] . '.0',
'link' => '<a href="' . $scripturl . '?topic=' . $message['ID_TOPIC'] . '.0">' . $message['subject'] . '</a>',
'icon' => $message['icon'],
Replace With: [Select]
'href' => $scripturl . '?topic=' . $message['ID_TOPIC'] . '.0',
'link' => '<a href="' . $scripturl . '?topic=' . $message['ID_TOPIC'] . '.0">' . $message['first_subject'] . '</a>',
'icon' => $message['icon'],

./Sources/Subs-Package.php

Operation #1
Find: [Select]
* =========================================================================== *
* Software Version: SMF 1.0.1 *
* Software by: Simple Machines (http://www.simplemachines.org) *
Replace With: [Select]
* =========================================================================== *
* Software Version: SMF 1.0.2 *
* Software by: Simple Machines (http://www.simplemachines.org) *

Operation #2
Find: [Select]
$crc = unpack('Vcrc32/Visize', substr($data, strlen($data) - 8, 8));
$data = gzinflate(substr($data, $offset, strlen($data) - 8 - $offset));
Replace With: [Select]
$crc = unpack('Vcrc32/Visize', substr($data, strlen($data) - 8, 8));
$data = @gzinflate(substr($data, $offset, strlen($data) - 8 - $offset));

Operation #3
Find: [Select]
// Skip the file if it doesn't exist.
elseif ($file->exists('@error') && trim($file->fetch('@error')) == 'skip')
continue;
Replace With: [Select]
// Skip the file if it doesn't exist.
elseif (!file_exists($working_file) && $file->exists('@error') && trim($file->fetch('@error')) == 'skip')
continue;

./Sources/Subs.php

Operation #1
Find: [Select]
* =========================================================================== *
* Software Version: SMF 1.0.1 *
* Software by: Simple Machines (http://www.simplemachines.org) *
Replace With: [Select]
* =========================================================================== *
* Software Version: SMF 1.0.2 *
* Software by: Simple Machines (http://www.simplemachines.org) *

Operation #2
Find: [Select]
// GLOWING or /shadowed/ text.
$codefromcache[] = '~\[glow=([#\w]{3,12}),([012]\d{0,2})(,[^]]+)?\](.+?)\[/glow\]~i';
$codetocache[] = isset($disabled['glow']) ? '$4' : '<table border="0" cellpadding="0" cellspacing="0" style="display: inline; vertical-align: middle; font: inherit;"><tr><td style="filter: Glow(color=$1, strength=$2); font: inherit;">$4</td></tr></table> ';
Replace With: [Select]
// GLOWING or /shadowed/ text.
$codefromcache[] = '~\[glow=([#\w]{3,12}),([012]\d{1,2}|\d{1,2})(,[^]]+)?\](.+?)\[/glow\]~i';
$codetocache[] = isset($disabled['glow']) ? '$4' : '<table border="0" cellpadding="0" cellspacing="0" style="display: inline; vertical-align: middle; font: inherit;"><tr><td style="filter: Glow(color=$1, strength=$2); font: inherit;">$4</td></tr></table> ';

Operation #3
Find: [Select]
if (empty($modSettings['enableEmbeddedFlash']) || isset($disabled['flash']))
$codetocache[] = isset($disabled['url']) ? '$3' : '<a href="$3" target="_new">$3</a>';
else
Replace With: [Select]
if (empty($modSettings['enableEmbeddedFlash']) || isset($disabled['flash']))
$codetocache[] = isset($disabled['url']) ? '$3' : '<a href="$3" target="_blank">$3</a>';
else

Operation #4
Find: [Select]
// Yes, I know this is kludging it, but this is the best way to preserve tabs from PHP :P.
$buffer = preg_replace('~SMF_TAB(</font><font color="[^"]*?">)?\(\);~', "<pre style=\"display: inline;\">\t</pre>", $buffer);
Replace With: [Select]
// Yes, I know this is kludging it, but this is the best way to preserve tabs from PHP :P.
$buffer = preg_replace('~SMF_TAB(</(font|span)><(font color|span style)="[^"]*?">)?\(\);~', "<pre style=\"display: inline;\">\t</pre>", $buffer);

Operation #5
Find: [Select]
if (allowedTo('manage_membergroups'))
$context['admin_areas']['members']['areas']['edit_groups'] = '<a href="' . $scripturl . '?action=membergroups">' . $txt[8] . '</a>';
Replace With: [Select]
if (allowedTo('manage_membergroups'))
$context['admin_areas']['members']['areas']['edit_groups'] = '<a href="' . $scripturl . '?action=membergroups;">' . $txt[8] . '</a>';

Operation #6
Find: [Select]
Template: <i>' . $context['template'] . '</i>' . (isset($context['sub_template']) ? ' (<i>' . $context['sub_template'] . '</i>)' : '') . '.<br />' : ''), '
<a href="', $scripturl, '?action=viewquery" target="_new">Queries used: ', $db_count, '</a>.<br />
<br />';
Replace With: [Select]
Template: <i>' . $context['template'] . '</i>' . (isset($context['sub_template']) ? ' (<i>' . $context['sub_template'] . '</i>)' : '') . '.<br />' : ''), '
<a href="', $scripturl, '?action=viewquery" target="_blank">Queries used: ', $db_count, '</a>.<br />
<br />';

Operation #7
Find: [Select]
echo '
<b>', substr(trim($qq['q']), 0, 6) == 'SELECT' ? '<a href="' . $scripturl . '?action=viewquery;qq=' . ($q + 1) . '#qq' . $q . '" target="_new">' : '', nl2br(str_replace("\t", '&nbsp;&nbsp;&nbsp;', ltrim($qq['q'], "\n\r"))) . '</a></b> in <i>' . $qq['f'] . '</i> line <i>' . $qq['l'] . '</i>, which took ' . $qq['t'] . ' seconds.<br />
<br />';
Replace With: [Select]
echo '
<b>', substr(trim($qq['q']), 0, 6) == 'SELECT' ? '<a href="' . $scripturl . '?action=viewquery;qq=' . ($q + 1) . '#qq' . $q . '" target="_blank">' : '', nl2br(str_replace("\t", '&nbsp;&nbsp;&nbsp;', ltrim($qq['q'], "\n\r"))) . '</a></b> in <i>' . $qq['f'] . '</i> line <i>' . $qq['l'] . '</i>, which took ' . $qq['t'] . ' seconds.<br />
<br />';

./Sources/Themes.php

Operation #1
Find: [Select]
* =========================================================================== *
* Software Version: SMF 1.0.1 *
* Software by: Simple Machines (http://www.simplemachines.org) *
Replace With: [Select]
* =========================================================================== *
* Software Version: SMF 1.0.2 *
* Software by: Simple Machines (http://www.simplemachines.org) *

Operation #2
Find: [Select]
(ID_MEMBER, ID_THEME, variable, value)
VALUES (-1, $_GET[id], '$opt', '" . (is_array($val) ? implode(',', $val) : $val) . "')", __FILE__, __LINE__);
Replace With: [Select]
(ID_MEMBER, ID_THEME, variable, value)
VALUES (-1, 1, '$opt', '" . (is_array($val) ? implode(',', $val) : $val) . "')", __FILE__, __LINE__);

./ssi_examples.php

Operation #1
Find: [Select]
<div style="font-family: monospace;">
&lt;?php require(&quot;<?php echo addslashes(realpath($boarddir . '/SSI.php')); ?>&quot;); ?&gt;
</div>
Replace With: [Select]
<div style="font-family: monospace;">
&lt;?php require(&quot;<?php echo addslashes($user_info['is_admin'] ? realpath($boarddir . '/SSI.php') : 'SSI.php'); ?>&quot;); ?&gt;
</div>

./Themes/default/languages/Errors.english.php

Operation #1
Find: [Select]
$txt['package_no_file'] = 'Unable to find package file!';
$txt['packageget_unable'] = 'Unable to connect to the server. Please try using <a href="%s" target="_new">this URL</a> instead.';
$txt['not_on_simplemachines'] = 'Sorry, packages can only be downloaded like this from the simplemachines.org server.';
Replace With: [Select]
$txt['package_no_file'] = 'Unable to find package file!';
$txt['packageget_unable'] = 'Unable to connect to the server. Please try using <a href="%s" target="_blank">this URL</a> instead.';
$txt['not_on_simplemachines'] = 'Sorry, packages can only be downloaded like this from the simplemachines.org server.';

./Sources/Security.php

Operation #1
Find: [Select]
* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com) *
* =========================================================================== *
* Software Version: SMF 1.0 *
* Software by: Simple Machines (http://www.simplemachines.org) *
* Copyright 2001-2004 by: Lewis Media (http://www.lewismedia.com) *
* Support, News, Updates at: http://www.simplemachines.org *
*******************************************************************************
Replace With: [Select]
* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com) *
* =========================================================================== *
* Software Version: SMF 1.0.2 *
* Software by: Simple Machines (http://www.simplemachines.org) *
* Copyright 2001-2005 by: Lewis Media (http://www.lewismedia.com) *
* Support, News, Updates at: http://www.simplemachines.org *
*******************************************************************************

Operation #2
Find: [Select]
if (empty($permission))
return true;

// Administrators are supermen :P.
Replace With: [Select]
if (empty($permission))
return true;

// You're never allowed to do something if your data hasn't been loaded yet!
if (empty($user_info))
return false;

// Administrators are supermen :P.

./Sources/News.php

Operation #1
Find: [Select]
* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com) *
* =========================================================================== *
* Software Version: SMF 1.0 *
* Software by: Simple Machines (http://www.simplemachines.org) *
* Copyright 2001-2004 by: Lewis Media (http://www.lewismedia.com) *
* Support, News, Updates at: http://www.simplemachines.org *
*******************************************************************************
Replace With: [Select]
* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com) *
* =========================================================================== *
* Software Version: SMF 1.0.2 *
* Software by: Simple Machines (http://www.simplemachines.org) *
* Copyright 2001-2005 by: Lewis Media (http://www.lewismedia.com) *
* Support, News, Updates at: http://www.simplemachines.org *
*******************************************************************************

Operation #2
Find: [Select]
$data['item'] = array(
Replace With: [Select]
$data[] = array(