################################################################################
##
## Hack Title: phpBB 2.0.16 - 2.0.17 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.16 and 2.0.17.
##
## Compatibility: 2.0.16
## Installation Level: Moderate
## Installation Time: 30 minutes
##
## Files To Edit: 11
## privmsg.php
## viewtopic.php
## admin/admin_ug_auth.php
## admin/admin_users.php
## includes/bbcode.php
## includes/functions.php
## includes/functions_validate.php
## includes/usercp_activate.php
## includes/usercp_avatar.php
## includes/usercp_viewprofile.php
## templates/subSilver/faq_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.17 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 ]-------------------------------------
##
privmsg.php
##
##----------[ FIND ]-------------------------------------
##
if ( $delete_all )
{
switch($folder)
{
case 'inbox':
$delete_type = "privmsgs_to_userid = " . $userdata['user_id'] . " AND (
privmsgs_type = " . PRIVMSGS_READ_MAIL . " OR privmsgs_type = " . PRIVMSGS_NEW_MAIL . " OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " )";
break;
case 'outbox':
$delete_type = "privmsgs_from_userid = " . $userdata['user_id'] . " AND ( privmsgs_type = " . PRIVMSGS_NEW_MAIL . " OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " )";
break;
case 'sentbox':
$delete_type = "privmsgs_from_userid = " . $userdata['user_id'] . " AND privmsgs_type = " . PRIVMSGS_SENT_MAIL;
break;
case 'savebox':
$delete_type = "( ( privmsgs_from_userid = " . $userdata['user_id'] . "
AND privmsgs_type = " . PRIVMSGS_SAVED_OUT_MAIL . " )
OR ( privmsgs_to_userid = " . $userdata['user_id'] . "
AND privmsgs_type = " . PRIVMSGS_SAVED_IN_MAIL . " ) )";
break;
}
$sql = "SELECT privmsgs_id
FROM " . PRIVMSGS_TABLE . "
WHERE $delete_type";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain id list to delete all messages', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
$mark_list[] = $row['privmsgs_id'];
}
unset($delete_type);
}
if ( count($mark_list) )
##
##----------[ REPLACE WITH ]-----------------------------
##
$delete_sql_id = '';
if (!$delete_all)
{
for ($i = 0; $i < count($mark_list); $i++)
{
$delete_sql_id .= (($delete_sql_id != '') ? ', ' : '') . intval($mark_list[$i]);
}
$delete_sql_id = "AND privmsgs_id IN ($delete_sql_id)";
}
switch($folder)
{
case 'inbox':
$delete_type = "privmsgs_to_userid = " . $userdata['user_id'] . " AND (
privmsgs_type = " . PRIVMSGS_READ_MAIL . " OR privmsgs_type = " . PRIVMSGS_NEW_MAIL . " OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " )";
break;
case 'outbox':
$delete_type = "privmsgs_from_userid = " . $userdata['user_id'] . " AND ( privmsgs_type = " . PRIVMSGS_NEW_MAIL . " OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " )";
break;
case 'sentbox':
$delete_type = "privmsgs_from_userid = " . $userdata['user_id'] . " AND privmsgs_type = " . PRIVMSGS_SENT_MAIL;
break;
case 'savebox':
$delete_type = "( ( privmsgs_from_userid = " . $userdata['user_id'] . "
AND privmsgs_type = " . PRIVMSGS_SAVED_OUT_MAIL . " )
OR ( privmsgs_to_userid = " . $userdata['user_id'] . "
AND privmsgs_type = " . PRIVMSGS_SAVED_IN_MAIL . " ) )";
break;
}
$sql = "SELECT privmsgs_id
FROM " . PRIVMSGS_TABLE . "
WHERE $delete_type $delete_sql_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain id list to delete messages', '', __LINE__, __FILE__, $sql);
}
$mark_list = array();
while ( $row = $db->sql_fetchrow($result) )
{
$mark_list[] = $row['privmsgs_id'];
}
unset($delete_type);
if ( count($mark_list) )
##
##----------[ FIND ]-------------------------------------
##
$mode = 'reply';
}
}
##
##----------[ AFTER, ADD ]-------------------------------
##
else
{
$privmsg_subject = $privmsg_message = '';
}
##
##----------[ FIND ]-------------------------------------
##
$l_box_size_status = '';
break;
}
##
##----------[ AFTER, ADD ]-------------------------------
##
}
else
{
$inbox_limit_img_length = $inbox_limit_pct = $l_box_size_status = '';
##
##----------[ OPEN ]-------------------------------------
##
viewtopic.php
##
##----------[ FIND ]-------------------------------------
##
$search_img = '';
$search = '' . $lang['Search_user_posts'] . '';
##
##----------[ REPLACE WITH ]-----------------------------
##
$search_img = '
';
$search = '' . sprintf($lang['Search_user_posts'], $postrow[$i]['username']) . '';
##
##----------[ OPEN ]-------------------------------------
##
admin/admin_ug_auth.php
##
##----------[ FIND ]-------------------------------------
##
FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . USERS_TABLE . " u
WHERE ug.group_id = aa.group_id
AND u.user_id = ug.user_id
##
##----------[ AFTER, ADD ]-------------------------------
##
AND ug.user_pending = 0
##
##----------[ FIND ]-------------------------------------
##
//
// Front end
//
$sql = "SELECT *
FROM " . FORUMS_TABLE . " f
ORDER BY forum_order";
##
##----------[ REPLACE WITH ]-----------------------------
##
//
// Front end
//
$sql = "SELECT f.*
FROM " . FORUMS_TABLE . " f, " . CATEGORIES_TABLE . " c
WHERE f.cat_id = c.cat_id
ORDER BY c.cat_order, f.forum_order ASC";
##
##----------[ FIND ]-------------------------------------
##
$sql = "SELECT u.user_id, u.username, u.user_level, g.group_id, g.group_name, g.group_single_user FROM " . USERS_TABLE . " u, " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug WHERE ";
##
##----------[ REPLACE WITH ]-----------------------------
##
$sql = "SELECT u.user_id, u.username, u.user_level, g.group_id, g.group_name, g.group_single_user, ug.user_pending FROM " . USERS_TABLE . " u, " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug WHERE ";
##
##----------[ FIND ]-------------------------------------
##
$t_usergroup_list = '';
for($i = 0; $i < count($ug_info); $i++)
{
$ug = ( $mode == 'user' ) ? 'group&' . POST_GROUPS_URL : 'user&' . POST_USERS_URL;
$t_usergroup_list .= ( ( $t_usergroup_list != '' ) ? ', ' : '' ) . '' . $name[$i] . '';
}
}
else
##
##----------[ REPLACE WITH ]-----------------------------
##
$t_usergroup_list = $t_pending_list = '';
for($i = 0; $i < count($ug_info); $i++)
{
$ug = ( $mode == 'user' ) ? 'group&' . POST_GROUPS_URL : 'user&' . POST_USERS_URL;
if (!$ug_info[$i]['user_pending'])
{
$t_usergroup_list .= ( ( $t_usergroup_list != '' ) ? ', ' : '' ) . '' . $name[$i] . '';
}
else
{
$t_pending_list .= ( ( $t_pending_list != '' ) ? ', ' : '' ) . '' . $name[$i] . '';
}
}
}
else
##
##----------[ FIND ]-------------------------------------
##
'GROUP_MEMBERSHIP' => $lang['Usergroup_members'] . ' : ' . $t_usergroup_list)
##
##----------[ REPLACE WITH ]-----------------------------
##
'GROUP_MEMBERSHIP' => $lang['Usergroup_members'] . ' : ' . $t_usergroup_list . '
' . $lang['Pending_members'] . ' : ' . $t_pending_list)
##
##----------[ OPEN ]-------------------------------------
##
admin/admin_users.php
##
##----------[ FIND ]-------------------------------------
##
SET poster_id = " . DELETED . ", post_username = '$username'
##
##----------[ REPLACE WITH ]-----------------------------
##
SET poster_id = " . DELETED . ", post_username = '" . str_replace("\\'", "''", addslashes($this_userdata['username'])) . "'
##
##----------[ OPEN ]-------------------------------------
##
includes/bbcode.php
##
##----------[ FIND ]-------------------------------------
##
$replacements[] = $bbcode_tpl['img'];
// matches a [url]xxxx://www.phpbb.com[/url] code..
$patterns[] = "#\[url\]([\w]+?://[^ \"\n\r\t<]*?)\[/url\]#is";
$replacements[] = $bbcode_tpl['url1'];
// [url]www.phpbb.com[/url] code.. (no xxxx:// prefix).
$patterns[] = "#\[url\]((www|ftp)\.[^ \"\n\r\t<]*?)\[/url\]#is";
$replacements[] = $bbcode_tpl['url2'];
// [url=xxxx://www.phpbb.com]phpBB[/url] code..
$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";
##
##----------[ REPLACE WITH ]-----------------------------
##
$replacements[] = $bbcode_tpl['img'];
// matches a [url]xxxx://www.phpbb.com[/url] code..
$patterns[] = "#\[url\]([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*?)\[/url\]#is";
$replacements[] = $bbcode_tpl['url1'];
// [url]www.phpbb.com[/url] code.. (no xxxx:// prefix).
$patterns[] = "#\[url\]((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*?)\[/url\]#is";
$replacements[] = $bbcode_tpl['url2'];
// [url=xxxx://www.phpbb.com]phpBB[/url] code..
$patterns[] = "#\[url=([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*?)\]([^?\n\r\t].*?)\[/url\]#is";
$replacements[] = $bbcode_tpl['url3'];
// [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix).
$patterns[] = "#\[url=((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*?)\]([^?\n\r\t].*?)\[/url\]#is";
##
##----------[ FIND ]-------------------------------------
##
$ret = preg_replace("#(^|[\n ])([\w]+?://[^ \"\n\r\t<]*)#is", "\\1\\2", $ret);
// matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing
// Must contain at least 2 dots. xxxx contains either alphanum, or "-"
// zzzz is optional.. will contain everything up to the first space, newline,
// comma, double quote or <.
$ret = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r<]*)#is", "\\1\\2", $ret);
##
##----------[ REPLACE WITH ]-----------------------------
##
$ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1\\2", $ret);
// matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing
// Must contain at least 2 dots. xxxx contains either alphanum, or "-"
// zzzz is optional.. will contain everything up to the first space, newline,
// comma, double quote or <.
$ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1\\2", $ret);
##
##----------[ OPEN ]-------------------------------------
##
includes/functions.php
##
##----------[ FIND ]-------------------------------------
##
if (intval($user) == 0 || $force_str)
##
##----------[ REPLACE WITH ]-----------------------------
##
if (!is_numeric($user) || $force_str)
##
##----------[ FIND ]-------------------------------------
##
define(HAS_DIED, 1);
##
##----------[ REPLACE WITH ]-----------------------------
##
define('HAS_DIED', 1);
##
##----------[ OPEN ]-------------------------------------
##
includes/functions_validate.php
##
##----------[ FIND ]-------------------------------------
##
$username = preg_replace('#\s+#', ' ', $username);
// Limit username length
$username = substr(str_replace("\'", "'", $username), 0, 25);
$username = str_replace("'", "''", $username);
$sql = "SELECT username
##
##----------[ REPLACE WITH ]-----------------------------
##
// Remove doubled up spaces
$username = preg_replace('#\s+#', ' ', trim($username));
$username = phpbb_clean_username($username);
$sql = "SELECT username
##
##----------[ OPEN ]-------------------------------------
##
includes/usercp_activate.php
##
##----------[ FIND ]-------------------------------------
##
else if ((trim($row['user_actkey']) == trim($HTTP_GET_VARS['act_key'])) && (trim($row['user_actkey']) != ''))
{
##
##----------[ AFTER, ADD ]-------------------------------
##
if (intval($board_config['require_activation']) == USER_ACTIVATION_ADMIN && $userdata['user_level'] != ADMIN)
{
message_die(GENERAL_MESSAGE, $lang['Not_Authorised']);
}
##
##----------[ OPEN ]-------------------------------------
##
includes/usercp_avatar.php
##
##----------[ FIND ]-------------------------------------
##
function user_avatar_url($mode, &$error, &$error_msg, $avatar_filename)
{
##
##----------[ AFTER, ADD ]-------------------------------
##
global $lang;
##
##----------[ OPEN ]-------------------------------------
##
includes/usercp_viewprofile.php
##
##----------[ FIND ]-------------------------------------
##
$search_img = '';
$search = '' . $lang['Search_user_posts'] . '';
##
##----------[ REPLACE WITH ]-----------------------------
##
$search_img = '
';
$search = '' . sprintf($lang['Search_user_posts'], $profiledata['username']) . '';
##
##----------[ OPEN ]-------------------------------------
##
templates/subSilver/faq_body.tpl
##
##----------[ FIND ]-------------------------------------
##