################################################################################
##
## Hack Title: phpBB 2.0.13 - 2.0.14 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.13 and 2.0.14.
##
## Compatibility: 2.0.13
## Installation Level: Moderate
## Installation Time: 30 minutes
##
## Files To Edit: 11
## modcp.php
## privmsg.php
## search.php
## viewtopic.php
## admin/admin_styles.php
## admin/page_footer_admin.php
## admin/page_header_admin.php
## db/postgres7.php
## includes/page_header.php
## includes/sessions.php
## templates/subSilver/login_body.tpl
##
## 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.14 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.
##
##----------[ PLEASE NOTE ]------------------------------
##
## The file db/oracle.php has been removed in phpBB 2.0.14. Please delete it
## from your forum's web space.
##
##----------[ OPEN ]-------------------------------------
##
modcp.php
##
##----------[ FIND ]-------------------------------------
##
$forum_topics = ( $topic_row['forum_topics'] == 0 ) ? 1 : $topic_row['forum_topics'];
$forum_id = $topic_row['forum_id'];
$forum_name = $topic_row['forum_name'];
##
##----------[ BEFORE, ADD ]------------------------------
##
if (!$topic_row)
{
message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
}
##
##----------[ FIND ]-------------------------------------
##
$forum_topics = ( $topic_row['forum_topics'] == 0 ) ? 1 : $topic_row['forum_topics'];
$forum_name = $topic_row['forum_name'];
##
##----------[ BEFORE, ADD ]------------------------------
##
if (!$topic_row)
{
message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
}
##
##----------[ OPEN ]-------------------------------------
##
privmsg.php
##
##----------[ FIND ]-------------------------------------
##
if ( !$board_config['allow_html'] )
{
if ( $user_sig != '' && $privmsg['privmsgs_enable_sig'] && $userdata['user_allowhtml'] )
##
##----------[ REPLACE WITH ]-----------------------------
##
if ( !$board_config['allow_html'] || !$userdata['user_allowhtml'])
{
if ( $user_sig != '')
##
##----------[ FIND ]-------------------------------------
##
if ( !$html_on )
{
if ( $user_sig != '' || !$userdata['user_allowhtml'] )
##
##----------[ REPLACE WITH ]-----------------------------
##
if ( !$html_on || !$board_config['allow_html'] || !$userdata['user_allowhtml'] )
{
if ( $user_sig != '' )
##
##----------[ OPEN ]-------------------------------------
##
search.php
##
##----------[ FIND ]-------------------------------------
##
$search_author = str_replace('*', '%', trim($search_author));
##
##----------[ BEFORE, ADD ]------------------------------
##
if (preg_match('#^[\*%]+$#', trim($search_author)) || preg_match('#^[^\*]{1,2}$#', str_replace(array('*', '%'), '', trim($search_author))))
{
$search_author = '';
}
##
##----------[ FIND ]-------------------------------------
##
for($i = 0; $i < count($split_search); $i++)
{
##
##----------[ AFTER, ADD ]-------------------------------
##
if (preg_match('#^[\*%]+$#', trim($split_search[$i])) || preg_match('#^[^\*]{1,2}$#', str_replace(array('*', '%'), '', trim($split_search[$i]))))
{
$split_search[$i] = '';
continue;
}
##
##----------[ FIND ]-------------------------------------
##
if ( $search_author != '' )
{
##
##----------[ AFTER, ADD ]-------------------------------
##
if (preg_match('#^[\*%]+$#', trim($search_author)) || preg_match('#^[^\*]{1,2}$#', str_replace(array('*', '%'), '', trim($search_author))))
{
$search_author = '';
}
##
##----------[ OPEN ]-------------------------------------
##
viewtopic.php
##
##----------[ FIND ]-------------------------------------
##
if ( !$board_config['allow_html'] )
{
if ( $user_sig != '' && $userdata['user_allowhtml'] )
##
##----------[ REPLACE WITH ]-----------------------------
##
if ( !$board_config['allow_html'] || !$userdata['user_allowhtml'])
{
if ( $user_sig != '' )
##
##----------[ FIND ]-------------------------------------
##
$user_sig = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $user_sig . '<'), 1, -1));
##
##----------[ REPLACE WITH ]-----------------------------
##
$user_sig = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $user_sig . '<'), 1, -1));
##
##----------[ FIND ]-------------------------------------
##
$message = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $message . '<'), 1, -1));
##
##----------[ REPLACE WITH ]-----------------------------
##
$message = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $message . '<'), 1, -1));
##
##----------[ OPEN ]-------------------------------------
##
admin/admin_styles.php
##
##----------[ FIND ]-------------------------------------
##
include($phpbb_root_path. "templates/" . $install_to . "/theme_info.cfg");
##
##----------[ REPLACE WITH ]-----------------------------
##
include($phpbb_root_path. "templates/" . basename($install_to) . "/theme_info.cfg");
##
##----------[ FIND ]-------------------------------------
##
$fp = @fopen($phpbb_root_path . 'templates/' . $template_name . '/theme_info.cfg', 'w');
##
##----------[ REPLACE WITH ]-----------------------------
##
$fp = @fopen($phpbb_root_path . 'templates/' . basename($template_name) . '/theme_info.cfg', 'w');
##
##----------[ OPEN ]-------------------------------------
##
admin/page_footer_admin.php
##
##----------[ FIND ]-------------------------------------
##
'PHPBB_VERSION' => '2' . $board_config['version'],
##
##----------[ REPLACE WITH ]-----------------------------
##
'PHPBB_VERSION' => ($userdata['user_level'] == ADMIN && $userdata['user_id'] != ANONYMOUS) ? '2' . $board_config['version'] : '',
##
##----------[ OPEN ]-------------------------------------
##
admin/page_header_admin.php
##
##----------[ FIND ]-------------------------------------
##
$useragent = (isset($_SERVER["HTTP_USER_AGENT"]) ) ? $_SERVER["HTTP_USER_AGENT"] : $HTTP_USER_AGENT;
##
##----------[ REPLACE WITH ]-----------------------------
##
$useragent = (isset($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) ? $HTTP_SERVER_VARS['HTTP_USER_AGENT'] : getenv('HTTP_USER_AGENT');
##
##----------[ OPEN ]-------------------------------------
##
db/postgres7.php
##
##----------[ FIND ]-------------------------------------
##
$query = preg_replace("/LIMIT ([0-9]+),([ 0-9]+)/", "LIMIT \\2 OFFSET \\1", $query);
##
##----------[ AFTER, ADD ]-------------------------------
##
$query = preg_replace('#(.*WHERE.*)(username|user_email|ban_email) = \'(.*)\'#ise', "\"\\1LOWER(\\2) = '\" . strtolower('\\3') . \"'\"", $query);
##
##----------[ OPEN ]-------------------------------------
##
includes/page_header.php
##
##----------[ FIND ]-------------------------------------
##
$useragent = (isset($_SERVER["HTTP_USER_AGENT"]) ) ? $_SERVER["HTTP_USER_AGENT"] : $HTTP_USER_AGENT;
##
##----------[ REPLACE WITH ]-----------------------------
##
$useragent = (isset($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) ? $HTTP_SERVER_VARS['HTTP_USER_AGENT'] : getenv('HTTP_USER_AGENT');
##
##----------[ FIND ]-------------------------------------
##
if (!empty($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache/2'))
##
##----------[ REPLACE WITH ]-----------------------------
##
if (!empty($HTTP_SERVER_VARS['SERVER_SOFTWARE']) && strstr($HTTP_SERVER_VARS['SERVER_SOFTWARE'], 'Apache/2'))
##
##----------[ OPEN ]-------------------------------------
##
includes/sessions.php
##
##----------[ FIND ]-------------------------------------
##
$last_visit = 0;
$current_time = time();
$expiry_time = $current_time - $board_config['session_length'];
##
##----------[ BEFORE, ADD ]------------------------------
##
$page_id = (int) $page_id;
##
##----------[ FIND ]-------------------------------------
##
// No match; don't login, set as anonymous user
$login = 0;
$enable_autologin = 0;
$user_id = $userdata['user_id'] = ANONYMOUS;
##
##----------[ AFTER, ADD ]-------------------------------
##
$sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id = ' . ANONYMOUS;
$result = $db->sql_query($sql);
$userdata = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
##
##----------[ FIND ]-------------------------------------
##
// Autologin is not set. Don't login, set as anonymous user
$login = 0;
$enable_autologin = 0;
$user_id = $userdata['user_id'] = ANONYMOUS;
##
##----------[ AFTER, ADD ]-------------------------------
##
$sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id = ' . ANONYMOUS;
$result = $db->sql_query($sql);
$userdata = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
##
##----------[ FIND ]-------------------------------------
##
{
$session_id = '';
}
//
// Does a session exist?
##
##----------[ REPLACE WITH ]-----------------------------
##
{
$session_id = '';
}
$thispage_id = (int) $thispage_id;
//
// Does a session exist?
##
##----------[ OPEN ]-------------------------------------
##
templates/subSilver/login_body.tpl
##
##----------[ FIND ]-------------------------------------
##
##
##----------[ REPLACE WITH ]-----------------------------
##
##
##----------[ FIND ]-------------------------------------
##
##
##----------[ REPLACE WITH ]-----------------------------
##
##
##----------[ SAVE AND CLOSE ALL FILES ]-----------------
##
## End
##