|
From: Paul S. O. <ps...@us...> - 2002-02-12 17:04:14
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv9206
Modified Files:
viewtopic.php
Log Message:
Minor update to topic notification which should put an end to a rare bug
Index: viewtopic.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/viewtopic.php,v
retrieving revision 1.176
retrieving revision 1.177
diff -C2 -r1.176 -r1.177
*** viewtopic.php 11 Feb 2002 13:00:08 -0000 1.176
--- viewtopic.php 12 Feb 2002 17:04:11 -0000 1.177
***************
*** 216,225 ****
//
! // Is user watching this thread? This could potentially
! // be combined into the above query but the LEFT JOIN causes
! // a number of problems which will probably end up in this
! // solution being practically as fast and certainly simpler!
//
! if( $userdata['user_id'] != ANONYMOUS )
{
$can_watch_topic = TRUE;
--- 216,222 ----
//
! // Is user watching this thread?
//
! if( $userdata['session_logged_in'] )
{
$can_watch_topic = TRUE;
***************
*** 229,237 ****
WHERE topic_id = $topic_id
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);
}
! else if( $db->sql_numrows($result) )
{
if( isset($HTTP_GET_VARS['unwatch']) )
--- 226,235 ----
WHERE topic_id = $topic_id
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);
}
!
! if( $row = $db->sql_fetchrow($result) )
{
if( isset($HTTP_GET_VARS['unwatch']) )
***************
*** 255,259 ****
);
! $message = $lang['No_longer_watching']. "<br /><br />" . sprintf($lang['Click_return_topic'], "<a href=\"" . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&start=$start") . "\">", "</a>");
message_die(GENERAL_MESSAGE, $message);
}
--- 253,257 ----
);
! $message = $lang['No_longer_watching'] . '<br /><br />' . sprintf($lang['Click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&start=$start") . '">', '</a>');
message_die(GENERAL_MESSAGE, $message);
}
***************
*** 262,268 ****
$is_watching_topic = TRUE;
! $watch_data = $db->sql_fetchrow($result);
!
! if( $watch_data['notify_status'] )
{
$sql_priority = (SQL_LAYER == "mysql") ? "LOW_PRIORITY" : "";
--- 260,264 ----
$is_watching_topic = TRUE;
! if( $row['notify_status'] )
{
$sql_priority = (SQL_LAYER == "mysql") ? "LOW_PRIORITY" : "";
***************
*** 299,303 ****
);
! $message = $lang['You_are_watching']. "<br /><br />" . sprintf($lang['Click_return_topic'], "<a href=\"" . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&start=$start") . "\">", "</a>");
message_die(GENERAL_MESSAGE, $message);
}
--- 295,299 ----
);
! $message = $lang['You_are_watching'] . '<br /><br />' . sprintf($lang['Click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&start=$start") . '">', '</a>');
message_die(GENERAL_MESSAGE, $message);
}
***************
*** 363,373 ****
}
! $select_post_days = "<select name=\"postdays\">";
for($i = 0; $i < count($previous_days); $i++)
{
$selected = ($post_days == $previous_days[$i]) ? ' selected="selected"' : '';
! $select_post_days .= "<option value=\"" . $previous_days[$i] . "\"$selected>" . $previous_days_text[$i] . "</option>";
}
! $select_post_days .= "</select>";
//
--- 359,369 ----
}
! $select_post_days = '<select name="postdays">';
for($i = 0; $i < count($previous_days); $i++)
{
$selected = ($post_days == $previous_days[$i]) ? ' selected="selected"' : '';
! $select_post_days .= '<option value="' . $previous_days[$i] . '"' . $selected . '>' . $previous_days_text[$i] . '</option>';
}
! $select_post_days .= '</select>';
//
***************
*** 385,398 ****
}
! $select_post_order = "<select name=\"postorder\">";
if($post_time_order == "ASC")
{
! $select_post_order .= "<option value=\"asc\" selected=\"selected\">" . $lang['Oldest_First'] . "</option><option value=\"desc\">" . $lang['Newest_First'] . "</option>";
}
else
{
! $select_post_order .= "<option value=\"asc\">" . $lang['Oldest_First'] . "</option><option value=\"desc\" selected=\"selected\">" . $lang['Newest_First'] . "</option>";
}
! $select_post_order .= "</select>";
//
--- 381,394 ----
}
! $select_post_order = '<select name="postorder">';
if($post_time_order == "ASC")
{
! $select_post_order .= '<option value="asc" selected="selected">' . $lang['Oldest_First'] . '</option><option value="desc">' . $lang['Newest_First'] . '</option>';
}
else
{
! $select_post_order .= '<option value="asc">' . $lang['Oldest_First'] . '</option><option value="desc" selected="selected">' . $lang['Newest_First'] . '</option>';
}
! $select_post_order .= '</select>';
//
|