phpBB 2.0.14 to phpBB 2.0.15 Code Changes
These are the code changes introduced between phpBB 2.0.14 and phpBB 2.0.15. If you have installed many hacks on a forum, but wish to update it, these may help you. It is often easier to apply code changes such as these instead of replacing and rehacking your current files.
These code changes use the following instruction labels:
filename - The name of a file to be edited. Equivalent to an OPEN action in a hack or modification.
FIND - This indicates lines of code you should locate. Changes will be made in reference to this code.
REPLACE WITH - This code should completely replace the code in the preceding FIND instruction.
AFTER, ADD - The code in this instruction should be added on a new line after the last line of code in the preceding FIND instruction.
BEFORE, ADD - The code in this instruction should be added on a new line before the first line of code in the preceding FIND instruction.
FIND AND DELETE - Locate the code in this instruction as with a FIND statement, and then delete the code.
Once you have completed the code changes, create an install/ directory in your forum's root directory, and upload the update_to_latest.php file that comes in any phpBB 2.0.15 download to the install/ directory. Run update_to_latest.php by opening it via your web browser, just as you would a normal forum page. Afterward, delete the file and the install/ directory so that your forum is accessible again.
Now, onward to the file changes!
FIND
{
list($cat_id) = each($HTTP_POST_VARS['addforum']);
FIND
$smile_url = trim($smile_url);
$smile_emotion = trim($smile_emotion);
FIND
{
message_die(GENERAL_ERROR, "Couldn't update user level", "", __LINE__, __FILE__, $sql);
}
$sql = 'SELECT user_id FROM ' . USER_GROUP_TABLE . "
WHERE group_id = $group_id";
$result = $db->sql_query($sql);
$group_user = array();
while ($row = $db->sql_fetchrow($result))
{
$group_user[$row['user_id']] = $row['user_id'];
}
$db->sql_freeresult($result);
$sql = "SELECT ug.user_id, COUNT(auth_mod) AS is_auth_mod
FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug
WHERE ug.user_id IN (" . implode(', ', $group_user) . ")
AND aa.group_id = ug.group_id
AND aa.auth_mod = 1
GROUP BY ug.user_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR,
'Could not obtain moderator status', '', __LINE__, __FILE__, $sql);
}
while ($row = $db->sql_fetchrow($result))
{
if ($row['is_auth_mod'])
{
unset($group_user[$row['user_id']]);
}
}
$db->sql_freeresult($result);
if (sizeof($group_user))
{
$sql = "UPDATE " . USERS_TABLE . "
SET user_level = " . USER . "
WHERE user_id IN (" . implode(', ', $group_user) . ")";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update user level', '',
__LINE__, __FILE__, $sql);
FIND
redirect("index.$phpEx?sid=" . $userdata['session_id']);
if (!$userdata['session_admin'])
{
redirect(append_sid("login.$phpEx?redirect=admin/&admin=1", true));
FIND AND DELETE
FIND
FIND
$session_id = session_begin($row['user_id'], $user_ip,
PAGE_INDEX, FALSE, $autologin, $admin);
// user not already logged in
//
if( !$userdata['session_logged_in'] )
// user not already logged in
//
if( !$userdata['session_logged_in'] ||
(isset($HTTP_GET_VARS['admin']) &&
$userdata['session_logged_in'] && $userdata['user_level'] ==
ADMIN))
'L_ENTER_PASSWORD' => (isset($HTTP_GET_VARS['admin'])) ? $lang['Admin_reauthenticate'] : $lang['Enter_password'],
FIND
$message = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@preg_replace('#\b(" . str_replace('\\', '\\\\', $highlight_match) . ")\b#i', '<span style=\"color:#" . $theme['fontcolor3'] . "\"><b>\\\\1</b></span>', '\\0')", '>' . $message . '<'), 1, -1));
FIND
// This is important; bbencode_quote(), bbencode_list(), and bbencode_code() all depend on it.
$patterns[] = "#\[url=([\w]+?://[^ \"\n\r\t<]*?)\](.*?)\[/url\]#is";
$replacements[] = $bbcode_tpl['url3'];
// [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix).
$patterns[] = "#\[url=((www|ftp)\.[^ \"\n\r\t<]*?)\](.*?)\[/url\]#is";
$replacements[] = $bbcode_tpl['url4'];
$patterns[] = "#\[url=([\w]+?://[^ \"\n\r\t<]*?)\]([^?].*?)\[/url\]#i";
$replacements[] = $bbcode_tpl['url3'];
// [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix).
$patterns[] = "#\[url=((www|ftp)\.[^ \"\n\r\t<]*?)\]([^?].*?)\[/url\]#i";
$replacements[] = $bbcode_tpl['url4'];
{
FIND
mt_srand((float) $sec + ((float) $usec * 100000));
$session_id = md5(uniqid(mt_rand(), true));
(session_id, session_user_id, session_start, session_time, session_ip, session_page, session_logged_in)
VALUES ('$session_id', $user_id, $current_time, $current_time, '$user_ip', $page_id, $login)";
(session_id,
session_user_id, session_start, session_time, session_ip, session_page,
session_logged_in, session_admin)
VALUES ('$session_id',
$user_id, $current_time, $current_time, '$user_ip', $page_id, $login,
$admin)";
SET user_session_time = $current_time, user_session_page = $page_id, user_lastvisit = $last_visit
WHERE user_id = $user_id";
if ( !$db->sql_query($sql) )
{
message_die(CRITICAL_ERROR,
'Error updating last visit time', '', __LINE__, __FILE__, $sql);
{
$sql = "UPDATE " . USERS_TABLE . "
SET user_session_time =
$current_time, user_session_page = $page_id, user_lastvisit =
$last_visit
WHERE user_id = $user_id";
if ( !$db->sql_query($sql) )
{
message_die(CRITICAL_ERROR, 'Error updating last visit time', '',
__LINE__, __FILE__, $sql);
}
&& $sessionmethod == SESSION_METHOD_COOKIE ) ? $auto_login_key : '';
SET session_time = $current_time, session_page = $thispage_id
$update_admin = (!defined('IN_ADMIN') && $current_time - $userdata['session_time'] > ($board_config['session_length']+60)) ? ', session_admin = 0' : '';
$sql = "UPDATE " . SESSIONS_TABLE . "
SET session_time = $current_time, session_page =
$thispage_id$update_admin
SET user_session_time = $current_time, user_session_page = $thispage_id
SET user_session_time = $current_time, user_session_page = $thispage_id
$sql = "DELETE FROM " . SESSIONS_TABLE . "
$sql = "DELETE FROM " . SESSIONS_TABLE . "
FIND
FIND
{
if (strtolower($username) != strtolower($userdata['username']))
{
if (strtolower($username) != strtolower($userdata['username']) || $mode == 'register')
FIND
if (!$profiledata)
{
message_die(GENERAL_MESSAGE, $lang['No_user_id_specified']);
}
FIND
$lang['Admin_reauthenticate'] = 'To administer the board you must re-authenticate yourself.';
- admin/admin_forums.php
- admin/admin_smilies.php
- includes/functions_selects.php
- includes/template.php
- includes/topic_review.php
- posting.php
- privmsg.php
- viewonline.php
- viewtopic.php
FIND
Compiled by your friendly neighborhood Thoul from the phpBB 2.0.14 - 2.0.15 files.
