################################################################################ ## ## Hack Title: phpBB 2.0.15 - 2.0.16 Code Changes ## Hack Version: 1.0.0 ## Hack Author: Complied by Thoul, code by phpBB Group ## Hack Description: All changes in phpBB made between 2.0.15 and 2.0.16. ## ## Compatibility: 2.0.15 ## Installation Level: Moderate ## Installation Time: 30 minutes ## ## Files To Edit: 7 ## admin/admin_ug_auth.php ## admin/pagestart.php ## includes/bbcode.php ## includes/usercp_avatar.php ## includes/usercp_register.php ## modcp.php ## viewtopic.php ## ## Support: http://www.phpbbhacks.com/forums ## ################################################################################ ## ## You downloaded this hack from phpBBHacks.com, ## the #1 source for phpBB related downloads. ## ## Please visit http://www.phpbbhacks.com/forums for support. ## ################################################################################ ## ## This hack is released under the GPL License. ## ################################################################################ ## ## BEFORE ADDING THIS HACK TO YOUR FORUM, please be sure to backup ALL ## affected files. ## ################################################################################ ## ##----------[ PLEASE NOTE ]------------------------------ ## ## 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.16 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. ## ##----------[ OPEN ]------------------------------------- ## admin/admin_ug_auth.php ## ##----------[ FIND ]------------------------------------- ## @reset($auth_user); ## ##----------[ REPLACE WITH ]----------------------------- ## // @reset($auth_user); ## ##----------[ OPEN ]------------------------------------- ## admin/pagestart.php ## ##----------[ PLEASE NOTE ]------------------------------ ## ## Some users may have already made these changes, or possibly removed the ## affected lines from your files, due to problems in accessing the admin ## panel. ## ##----------[ FIND ]------------------------------------- ## redirect(append_sid("login.$phpEx?redirect=admin/", true)); ## ##----------[ REPLACE WITH ]----------------------------- ## redirect(append_sid("login.$phpEx?redirect=admin/index.$phpEx", true)); ## ##----------[ FIND ]------------------------------------- ## redirect(append_sid("login.$phpEx?redirect=admin/&admin=1", true)); ## ##----------[ REPLACE WITH ]----------------------------- ## redirect(append_sid("login.$phpEx?redirect=admin/index.$phpEx&admin=1", true)); ## ##----------[ OPEN ]------------------------------------- ## includes/bbcode.php ## ##----------[ FIND ]------------------------------------- ## $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"; ## ##----------[ REPLACE WITH ]----------------------------- ## $patterns[] = "#\[url=([\w]+?://[^ \"\n\r\t<]*?)\]([^?\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<]*?)\]([^?\n\r\t].*?)\[/url\]#is"; ## ##----------[ OPEN ]------------------------------------- ## includes/usercp_avatar.php ## ##----------[ FIND ]------------------------------------- ## if ( $width <= $board_config['avatar_max_width'] && $height <= $board_config['avatar_max_height'] ) ## ##----------[ REPLACE WITH ]----------------------------- ## if ( $width > 0 && $height > 0 && $width <= $board_config['avatar_max_width'] && $height <= $board_config['avatar_max_height'] ) ## ##----------[ OPEN ]------------------------------------- ## includes/usercp_register.php ## ##----------[ FIND ]------------------------------------- ## $avatar_sql = user_avatar_delete($userdata['user_avatar_type'], $userdata['user_avatar']); } if ( ( !empty($user_avatar_upload) || !empty($user_avatar_name) ) && $board_config['allow_avatar_upload'] ) ## ##----------[ REPLACE WITH ]----------------------------- ## $avatar_sql = user_avatar_delete($userdata['user_avatar_type'], $userdata['user_avatar']); } else if ( ( !empty($user_avatar_upload) || !empty($user_avatar_name) ) && $board_config['allow_avatar_upload'] ) ## ##----------[ OPEN ]------------------------------------- ## modcp.php ## ##----------[ FIND ]------------------------------------- ## $new_forum_id = intval($HTTP_POST_VARS['new_forum']); $old_forum_id = $forum_id; ## ##----------[ AFTER, ADD ]------------------------------- ## $sql = 'SELECT forum_id FROM ' . FORUMS_TABLE . ' WHERE forum_id = ' . $new_forum_id; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not select from forums table', '', __LINE__, __FILE__, $sql); } if (!$db->sql_fetchrow($result)) { message_die(GENERAL_MESSAGE, 'New forum does not exist'); } $db->sql_freeresult($result); ## ##----------[ FIND ]------------------------------------- ## $new_forum_id = intval($HTTP_POST_VARS['new_forum_id']); $topic_time = time(); ## ##----------[ AFTER, ADD ]------------------------------- ## $sql = 'SELECT forum_id FROM ' . FORUMS_TABLE . ' WHERE forum_id = ' . $new_forum_id; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not select from forums table', '', __LINE__, __FILE__, $sql); } if (!$db->sql_fetchrow($result)) { message_die(GENERAL_MESSAGE, 'New forum does not exist'); } $db->sql_freeresult($result); ## ##----------[ OPEN ]------------------------------------- ## viewtopic.php ## ##----------[ FIND ]------------------------------------- ## $message = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@preg_replace('#\b(" . str_replace('\\', '\\\\', $highlight_match) . ")\b#i', '\\\\1', '\\0')", '>' . $message . '<'), 1, -1)); ## ##----------[ REPLACE WITH ]----------------------------- ## $message = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@preg_replace('#\b(" . str_replace('\\', '\\\\', addslashes($highlight_match)) . ")\b#i', '\\\\1', '\\0')", '>' . $message . '<'), 1, -1)); ## ##----------[ SAVE AND CLOSE ALL FILES ]----------------- ## ## End ##