diff --git a/phpBB/groupcp.php b/phpBB/groupcp.php
index 830e851083..a51537b5b5 100644
--- a/phpBB/groupcp.php
+++ b/phpBB/groupcp.php
@@ -75,7 +75,8 @@ if( isset($HTTP_POST_VARS['groupstatus']) && $group_id )
{
if( !$userdata['session_logged_in'] )
{
- header('Location: ' . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true));
+ $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
+ header($header_location . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true));
}
$sql = "SELECT group_moderator
@@ -127,7 +128,8 @@ else if( isset($HTTP_POST_VARS['joingroup']) && $group_id )
//
if( !$userdata['session_logged_in'] )
{
- header("Location: " . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true));
+ $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
+ header($header_location . ppend_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true));
}
$sql = "SELECT ug.user_id, g.group_type
@@ -231,12 +233,14 @@ else if( isset($HTTP_POST_VARS['unsub']) || isset($HTTP_POST_VARS['unsubpending'
//
if( $cancel )
{
- header("Location: " . append_sid("groupcp.$phpEx", true));
+ $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
+ header($header_location . ppend_sid("groupcp.$phpEx", true));
}
if( !$userdata['session_logged_in'] )
{
- header("Location: " . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true));
+ $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
+ header($header_location . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true));
}
if( $confirm )
@@ -320,7 +324,8 @@ else if( $group_id )
{
if( !$userdata['session_logged_in'] )
{
- header("Location: " . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true));
+ $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
+ header($header_location . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true));
}
}
@@ -381,7 +386,8 @@ else if( $group_id )
{
if( !$userdata['session_logged_in'] )
{
- header("Location: " . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true));
+ $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
+ header($header_location . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true));
}
if( !$is_moderator )
@@ -1195,14 +1201,14 @@ else
ORDER BY g.group_name, ug.user_id";
if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Error getting group information", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Error getting group information', '', __LINE__, __FILE__, $sql);
}
if ( $row = $db->sql_fetchrow($result) )
{
$in_group = array();
- $s_member_groups_opt = "";
- $s_pending_groups_opt = "";
+ $s_member_groups_opt = '';
+ $s_pending_groups_opt = '';
do
{
@@ -1245,71 +1251,78 @@ else
$s_group_list_opt .='';
}
}
- $s_group_list = '";
+ $s_group_list = '';
- //
- // Load and process templates
- //
- include($phpbb_root_path . 'includes/page_header.'.$phpEx);
-
- $template->set_filenames(array(
- 'user' => 'groupcp_user_body.tpl',
- 'jumpbox' => 'jumpbox.tpl')
- );
-
- $jumpbox = make_jumpbox();
- $template->assign_vars(array(
- 'L_GO' => $lang['Go'],
- 'L_JUMP_TO' => $lang['Jump_to'],
- 'L_SELECT_FORUM' => $lang['Select_forum'],
-
- 'S_JUMPBOX_LIST' => $jumpbox,
- 'S_JUMPBOX_ACTION' => append_sid("viewforum.$phpEx"))
- );
- $template->assign_var_from_handle('JUMPBOX', 'jumpbox');
-
- if ( $s_pending_groups_opt != '' || $s_member_groups_opt != '' )
+ if ( $s_group_list_opt != '' || $s_pending_groups_opt != '' || $s_member_groups_opt != '' )
{
- $template->assign_block_vars('groups_joined', array() );
- }
+ //
+ // Load and process templates
+ //
+ include($phpbb_root_path . 'includes/page_header.'.$phpEx);
- if ( $s_member_groups_opt != '' )
+ $template->set_filenames(array(
+ 'user' => 'groupcp_user_body.tpl',
+ 'jumpbox' => 'jumpbox.tpl')
+ );
+
+ $jumpbox = make_jumpbox();
+ $template->assign_vars(array(
+ 'L_GO' => $lang['Go'],
+ 'L_JUMP_TO' => $lang['Jump_to'],
+ 'L_SELECT_FORUM' => $lang['Select_forum'],
+
+ 'S_JUMPBOX_LIST' => $jumpbox,
+ 'S_JUMPBOX_ACTION' => append_sid("viewforum.$phpEx"))
+ );
+ $template->assign_var_from_handle('JUMPBOX', 'jumpbox');
+
+ if ( $s_pending_groups_opt != '' || $s_member_groups_opt != '' )
+ {
+ $template->assign_block_vars('groups_joined', array() );
+ }
+
+ if ( $s_member_groups_opt != '' )
+ {
+ $template->assign_block_vars('groups_joined.groups_member', array() );
+ }
+
+ if ( $s_pending_groups_opt != '' )
+ {
+ $template->assign_block_vars('groups_joined.groups_pending', array() );
+ }
+
+ if ( $s_group_list_opt != '' )
+ {
+ $template->assign_block_vars('groups_remaining', array() );
+ }
+
+ $s_hidden_fields = '';
+
+ $template->assign_vars(array(
+ 'L_GROUP_MEMBERSHIP_DETAILS' => $lang['Group_member_details'],
+ 'L_JOIN_A_GROUP' => $lang['Group_member_join'],
+ 'L_YOU_BELONG_GROUPS' => $lang['Current_memberships'],
+ 'L_SELECT_A_GROUP' => $lang['Non_member_groups'],
+ 'L_PENDING_GROUPS' => $lang['Memberships_pending'],
+ 'L_SUBSCRIBE' => $lang['Subscribe'],
+ 'L_UNSUBSCRIBE' => $lang['Unsubscribe'],
+ 'L_VIEW_INFORMATION' => $lang['View_Information'],
+
+ 'S_USERGROUP_ACTION' => append_sid("groupcp.$phpEx"),
+ 'S_HIDDEN_FIELDS' => $s_hidden_fields,
+
+ 'GROUP_LIST_SELECT' => $s_group_list,
+ 'GROUP_PENDING_SELECT' => $s_pending_groups,
+ 'GROUP_MEMBER_SELECT' => $s_member_groups)
+ );
+
+ $template->pparse('user');
+ }
+ else
{
- $template->assign_block_vars('groups_joined.groups_member', array() );
+ message_die(GENERAL_MESSAGE, $lang['No_groups_exist']);
}
- if ( $s_pending_groups_opt != '' )
- {
- $template->assign_block_vars('groups_joined.groups_pending', array() );
- }
-
- if ( $s_group_list_opt != '' )
- {
- $template->assign_block_vars('groups_remaining', array() );
- }
-
- $s_hidden_fields = '';
-
- $template->assign_vars(array(
- 'L_GROUP_MEMBERSHIP_DETAILS' => $lang['Group_member_details'],
- 'L_JOIN_A_GROUP' => $lang['Group_member_join'],
- 'L_YOU_BELONG_GROUPS' => $lang['Current_memberships'],
- 'L_SELECT_A_GROUP' => $lang['Non_member_groups'],
- 'L_PENDING_GROUPS' => $lang['Memberships_pending'],
- 'L_SUBSCRIBE' => $lang['Subscribe'],
- 'L_UNSUBSCRIBE' => $lang['Unsubscribe'],
- 'L_VIEW_INFORMATION' => $lang['View_Information'],
-
- 'S_USERGROUP_ACTION' => append_sid("groupcp.$phpEx"),
- 'S_HIDDEN_FIELDS' => $s_hidden_fields,
-
- 'GROUP_LIST_SELECT' => $s_group_list,
- 'GROUP_PENDING_SELECT' => $s_pending_groups,
- 'GROUP_MEMBER_SELECT' => $s_member_groups)
- );
-
- $template->pparse('user');
-
}
//
diff --git a/phpBB/privmsg.php b/phpBB/privmsg.php
index 2edb6edc7c..879f2ae04e 100644
--- a/phpBB/privmsg.php
+++ b/phpBB/privmsg.php
@@ -38,8 +38,8 @@ if( !empty($board_config['privmsg_disable']) )
//
// Var definitions
//
-$html_entities_match = array("#", "#<#", "#>#");
-$html_entities_replace = array("&", "<", ">");
+$html_entities_match = array('#', '#<#', '#>#');
+$html_entities_replace = array('&', '<', '>');
//
// Parameters
@@ -61,14 +61,14 @@ if( isset($HTTP_POST_VARS['folder']) || isset($HTTP_GET_VARS['folder']) )
{
$folder = ( isset($HTTP_POST_VARS['folder']) ) ? $HTTP_POST_VARS['folder'] : $HTTP_GET_VARS['folder'];
- if( $folder != "inbox" && $folder != "outbox" && $folder != "sentbox" && $folder != "savebox" )
+ if( $folder != 'inbox' && $folder != 'outbox' && $folder != 'sentbox' && $folder != 'savebox' )
{
- $folder = "inbox";
+ $folder = 'inbox';
}
}
else
{
- $folder = "inbox";
+ $folder = 'inbox';
}
//
@@ -76,7 +76,7 @@ else
//
if( $cancel )
{
- header("Location: " . append_sid("privmsg.$phpEx?folder=$folder", true));
+ header('Location: ' . append_sid("privmsg.$phpEx?folder=$folder", true));
}
//
@@ -183,7 +183,8 @@ else if( $mode == "read" )
if( !$userdata['session_logged_in'] )
{
- header("Location: " . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=$folder&mode=$mode&" . POST_POST_URL . "=$privmsgs_id", true));
+ $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
+ header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=$folder&mode=$mode&" . POST_POST_URL . "=$privmsgs_id", true));
}
if( $folder )
@@ -256,7 +257,8 @@ else if( $mode == "read" )
//
if( !( $privmsg = $db->sql_fetchrow($pm_status) ) )
{
- header("Location: " . append_sid("privmsg.$phpEx?folder=$folder", true));
+ $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
+ header($header_location . append_sid("privmsg.$phpEx?folder=$folder", true));
}
$privmsg_id = $privmsg['privmsgs_id'];
@@ -588,7 +590,8 @@ else if( ( $delete && $mark_list ) || $delete_all )
{
if(!$userdata['session_logged_in'])
{
- header("Location: " . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=inbox", true));
+ $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
+ header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=inbox", true));
}
if( isset($mark_list) && !is_array($mark_list) )
{
@@ -783,7 +786,8 @@ else if( $save && $mark_list && $folder != "savebox" && $folder != "outbox")
{
if( !$userdata['session_logged_in'] )
{
- header("Location: " . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=inbox", true));
+ $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
+ header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=inbox", true));
}
//
@@ -875,7 +879,8 @@ else if( $submit || $refresh || $mode != "" )
if(!$userdata['session_logged_in'])
{
$user_id = ( isset($HTTP_GET_VARS[POST_USERS_URL]) ) ? "&" . POST_USERS_URL . "=" . $HTTP_GET_VARS[POST_USERS_URL] : "";
- header("Location: " . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=$folder&mode=$mode" . $user_id, true));
+ $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
+ header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=$folder&mode=$mode" . $user_id, true));
}
//
@@ -1272,13 +1277,12 @@ else if( $submit || $refresh || $mode != "" )
{
message_die(GENERAL_ERROR, "Could not obtain private message for editing.", "", __LINE__, __FILE__, $sql);
}
- if(!$db->sql_numrows($pm_edit_status))
+ if ( !($privmsg = $db->sql_fetchrow($pm_edit_status)) )
{
- header("Location: " . append_sid("privmsg.$phpEx?folder=$folder", true));
+ $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
+ header($header_location . append_sid("privmsg.$phpEx?folder=$folder", true));
}
- $privmsg = $db->sql_fetchrow($pm_edit_status);
-
$privmsg_subject = $privmsg['privmsgs_subject'];
$privmsg_message = $privmsg['privmsgs_text'];
$privmsg_bbcode_uid = $privmsg['privmsgs_bbcode_uid'];
@@ -1312,11 +1316,11 @@ else if( $submit || $refresh || $mode != "" )
message_die(GENERAL_ERROR, "Could not obtain private message for editing.", "", __LINE__, __FILE__, $sql);
}
- if( !$db->sql_numrows($pm_reply_status) )
+ if( !($privmsg = $db->sql_fetchrow($pm_reply_status)) )
{
- header("Location: " . append_sid("privmsg.$phpEx?folder=$folder", true));
+ $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
+ header($header_location . append_sid("privmsg.$phpEx?folder=$folder", true));
}
- $privmsg = $db->sql_fetchrow($pm_reply_status);
$privmsg_subject = ( ( !preg_match("/^Re:/", $privmsg['privmsgs_subject']) ) ? "Re: " : "" ) . $privmsg['privmsgs_subject'];
@@ -1668,7 +1672,8 @@ else if( $submit || $refresh || $mode != "" )
//
if( !$userdata['session_logged_in'] )
{
- header("Location: " . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=inbox", true));
+ $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
+ header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=inbox", true));
}
//
diff --git a/phpBB/profile.php b/phpBB/profile.php
index 25965087de..213807a49f 100644
--- a/phpBB/profile.php
+++ b/phpBB/profile.php
@@ -83,7 +83,8 @@ if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
{
if ( !$userdata['session_logged_in'] && $mode == 'editprofile' )
{
- header("Location: " . append_sid("login.$phpEx?redirect=profile.$phpEx&mode=editprofile", true));
+ $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
+ header($header_location . append_sid("login.$phpEx?redirect=profile.$phpEx&mode=editprofile", true));
exit;
}
@@ -108,7 +109,8 @@ if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
}
else
{
- header("Location: " . append_sid("index.$phpEx", true));
+ $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
+ header($header_location . append_sid("index.$phpEx", true));
exit;
}
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 6cb2c8bca9..3934984526 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -21,7 +21,7 @@
***************************************************************************/
define('IN_PHPBB', true);
-$phpbb_root_path = "./";
+$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
@@ -29,16 +29,16 @@ include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
//
// Start initial var setup
//
-if(isset($HTTP_GET_VARS[POST_TOPIC_URL]))
+if ( isset($HTTP_GET_VARS[POST_TOPIC_URL]) )
{
$topic_id = intval($HTTP_GET_VARS[POST_TOPIC_URL]);
}
-else if(isset($HTTP_GET_VARS['topic']))
+else if ( isset($HTTP_GET_VARS['topic']) )
{
$topic_id = intval($HTTP_GET_VARS['topic']);
}
-if(isset($HTTP_GET_VARS[POST_POST_URL]))
+if ( isset($HTTP_GET_VARS[POST_POST_URL]))
{
$post_id = intval($HTTP_GET_VARS[POST_POST_URL]);
}
@@ -104,7 +104,7 @@ if ( isset($HTTP_GET_VARS['view']) && empty($HTTP_GET_VARS[POST_POST_URL]) )
exit;
}
}
- else if( $HTTP_GET_VARS['view'] == 'next' || $HTTP_GET_VARS['view'] == 'previous' )
+ else if ( $HTTP_GET_VARS['view'] == 'next' || $HTTP_GET_VARS['view'] == 'previous' )
{
$sql_condition = ( $HTTP_GET_VARS['view'] == 'next' ) ? '>' : '<';
$sql_ordering = ( $HTTP_GET_VARS['view'] == 'next' ) ? 'ASC' : 'DESC';
@@ -121,7 +121,7 @@ if ( isset($HTTP_GET_VARS['view']) && empty($HTTP_GET_VARS[POST_POST_URL]) )
LIMIT 1";
if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Couldn't obtain newer/older topic information", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, "Could not obtain newer/older topic information", '', __LINE__, __FILE__, $sql);
}
if ( !($row = $db->sql_fetchrow($result)) )
@@ -158,12 +158,12 @@ $sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.top
WHERE $join_sql
AND f.forum_id = t.forum_id
$order_sql";
-if( !($result = $db->sql_query($sql)) )
+if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Couldn't obtain topic information", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, "Could not obtain topic information", '', __LINE__, __FILE__, $sql);
}
-if( !($forum_row = $db->sql_fetchrow($result)) )
+if ( !($forum_row = $db->sql_fetchrow($result)) )
{
message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
}
@@ -190,8 +190,9 @@ if( !$is_auth['auth_view'] || !$is_auth['auth_read'] )
if ( !$userdata['session_logged_in'] )
{
$redirect = ( isset($post_id) ) ? POST_POST_URL . "=$post_id" : POST_TOPIC_URL . "=$topic_id";
- $redirect .= ( isset($start) ) ? "&start=$start" : "";
- header("Location: " . append_sid("login.$phpEx?redirect=viewtopic.$phpEx&$redirect", true));
+ $redirect .= ( isset($start) ) ? "&start=$start" : '';
+ $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
+ header($header_location . append_sid("login.$phpEx?redirect=viewtopic.$phpEx&$redirect", true));
}
$message = ( !$is_auth['auth_view'] ) ? $lang['Topic_post_not_exist'] : sprintf($lang['Sorry_auth_read'], $is_auth['auth_read_type']);
@@ -225,29 +226,29 @@ if( $userdata['session_logged_in'] )
AND user_id = " . $userdata['user_id'];
if( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Couldn't obtain topic watch information", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, "Could not obtain topic watch information", '', __LINE__, __FILE__, $sql);
}
- if( $row = $db->sql_fetchrow($result) )
+ if ( $row = $db->sql_fetchrow($result) )
{
- if( isset($HTTP_GET_VARS['unwatch']) )
+ if ( isset($HTTP_GET_VARS['unwatch']) )
{
- if( $HTTP_GET_VARS['unwatch'] == "topic" )
+ if ( $HTTP_GET_VARS['unwatch'] == 'topic' )
{
$is_watching_topic = 0;
- $sql_priority = (SQL_LAYER == "mysql") ? "LOW_PRIORITY" : "";
+ $sql_priority = (SQL_LAYER == "mysql") ? "LOW_PRIORITY" : '';
$sql = "DELETE $sql_priority FROM " . TOPICS_WATCH_TABLE . "
WHERE topic_id = $topic_id
AND user_id = " . $userdata['user_id'];
- if( !$result = $db->sql_query($sql) )
+ if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Couldn't delete topic watch information", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, "Could not delete topic watch information", '', __LINE__, __FILE__, $sql);
}
}
$template->assign_vars(array(
- "META" => '')
+ 'META' => '')
);
$message = $lang['No_longer_watching'] . '
' . sprintf($lang['Click_return_topic'], '', '');
@@ -257,39 +258,39 @@ if( $userdata['session_logged_in'] )
{
$is_watching_topic = TRUE;
- if( $row['notify_status'] )
+ if ( $row['notify_status'] )
{
- $sql_priority = (SQL_LAYER == "mysql") ? "LOW_PRIORITY" : "";
+ $sql_priority = (SQL_LAYER == "mysql") ? "LOW_PRIORITY" : '';
$sql = "UPDATE $sql_priority " . TOPICS_WATCH_TABLE . "
SET notify_status = 0
WHERE topic_id = $topic_id
AND user_id = " . $userdata['user_id'];
- if( !$result = $db->sql_query($sql) )
+ if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Couldn't update topic watch information", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, "Could not update topic watch information", '', __LINE__, __FILE__, $sql);
}
}
}
}
else
{
- if( isset($HTTP_GET_VARS['watch']) )
+ if ( isset($HTTP_GET_VARS['watch']) )
{
- if( $HTTP_GET_VARS['watch'] == "topic" )
+ if ( $HTTP_GET_VARS['watch'] == 'topic' )
{
$is_watching_topic = TRUE;
- $sql_priority = (SQL_LAYER == "mysql") ? "LOW_PRIORITY" : "";
+ $sql_priority = (SQL_LAYER == "mysql") ? "LOW_PRIORITY" : '';
$sql = "INSERT $sql_priority INTO " . TOPICS_WATCH_TABLE . " (user_id, topic_id, notify_status)
VALUES (" . $userdata['user_id'] . ", $topic_id, 0)";
- if( !$result = $db->sql_query($sql) )
+ if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Couldn't insert topic watch information", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, "Could not insert topic watch information", '', __LINE__, __FILE__, $sql);
}
}
$template->assign_vars(array(
- "META" => '')
+ 'META' => '')
);
$message = $lang['You_are_watching'] . '
' . sprintf($lang['Click_return_topic'], '', '');
@@ -303,11 +304,12 @@ if( $userdata['session_logged_in'] )
}
else
{
- if( isset($HTTP_GET_VARS['unwatch']) )
+ if ( isset($HTTP_GET_VARS['unwatch']) )
{
- if( $HTTP_GET_VARS['unwatch'] == "topic" )
+ if ( $HTTP_GET_VARS['unwatch'] == 'topic' )
{
- header("Location: " . append_sid("login.$phpEx?redirect=viewtopic.$phpEx&" . POST_TOPIC_URL . "=$topic_id&unwatch=topic", true));
+ $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
+ header($header_location . append_sid("login.$phpEx?redirect=viewtopic.$phpEx&" . POST_TOPIC_URL . "=$topic_id&unwatch=topic", true));
}
}
else
@@ -334,16 +336,16 @@ if( !empty($HTTP_POST_VARS['postdays']) || !empty($HTTP_GET_VARS['postdays']) )
FROM " . POSTS_TABLE . "
WHERE topic_id = $topic_id
AND post_time >= $min_post_time";
- if(!$result = $db->sql_query($sql))
+ if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Couldn't obtain limited topics count information", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, "Could not obtain limited topics count information", '', __LINE__, __FILE__, $sql);
}
$total_replies = ( $row = $db->sql_fetchrow($result) ) ? $row['num_posts'] : 0;
$limit_posts_time = "AND p.post_time >= $min_post_time ";
- if(!empty($HTTP_POST_VARS['postdays']))
+ if ( !empty($HTTP_POST_VARS['postdays']))
{
$start = 0;
}
@@ -352,7 +354,7 @@ else
{
$total_replies = $forum_row['topic_replies'] + 1;
- $limit_posts_time = "";
+ $limit_posts_time = '';
$post_days = 0;
}
@@ -367,19 +369,19 @@ $select_post_days .= '';
//
// Decide how to order the post display
//
-if(!empty($HTTP_POST_VARS['postorder']) || !empty($HTTP_GET_VARS['postorder']))
+if ( !empty($HTTP_POST_VARS['postorder']) || !empty($HTTP_GET_VARS['postorder']) )
{
$post_order = (!empty($HTTP_POST_VARS['postorder'])) ? $HTTP_POST_VARS['postorder'] : $HTTP_GET_VARS['postorder'];
$post_time_order = ($post_order == "asc") ? "ASC" : "DESC";
}
else
{
- $post_order = "asc";
- $post_time_order = "ASC";
+ $post_order = 'asc';
+ $post_time_order = 'ASC';
}
$select_post_order = '