|
From: Paul S. O. <ps...@us...> - 2001-10-16 16:37:47
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv30414
Modified Files:
viewforum.php posting.php
Log Message:
Fix a few things left over from old global announce stuff
Index: viewforum.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/viewforum.php,v
retrieving revision 1.93
retrieving revision 1.94
diff -C2 -r1.93 -r1.94
*** viewforum.php 2001/10/16 13:09:45 1.93
--- viewforum.php 2001/10/16 16:21:23 1.94
***************
*** 303,307 ****
AND p.post_id = t.topic_last_post_id
AND p.poster_id = u2.user_id
! AND t.topic_type = " . POST_ANNOUNCE . "
ORDER BY p.post_time DESC";
if(!$ta_result = $db->sql_query($sql))
--- 303,307 ----
AND p.post_id = t.topic_last_post_id
AND p.poster_id = u2.user_id
! AND t.topic_type = " . POST_ANNOUNCE . "
ORDER BY p.post_time DESC";
if(!$ta_result = $db->sql_query($sql))
Index: posting.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/posting.php,v
retrieving revision 1.82
retrieving revision 1.83
diff -C2 -r1.82 -r1.83
*** posting.php 2001/10/16 13:09:23 1.82
--- posting.php 2001/10/16 16:21:23 1.83
***************
*** 526,534 ****
if( isset($HTTP_POST_VARS['topictype']) )
{
! if($HTTP_POST_VARS['topictype'] == "announce")
{
$topic_type = POST_ANNOUNCE;
}
! else if($HTTP_POST_VARS['topictype'] == "sticky")
{
$topic_type = POST_STICKY;
--- 526,538 ----
if( isset($HTTP_POST_VARS['topictype']) )
{
! if( $HTTP_POST_VARS['topictype'] == "global" )
{
+ $topic_type = POST_ANNOUNCE_GLOBAL;
+ }
+ else if( $HTTP_POST_VARS['topictype'] == "announce" )
+ {
$topic_type = POST_ANNOUNCE;
}
! else if( $HTTP_POST_VARS['topictype'] == "sticky" )
{
$topic_type = POST_STICKY;
***************
*** 551,555 ****
{
case 'newtopic':
! if( $topic_type == POST_ANNOUNCE )
{
$is_auth_type = "auth_announce";
--- 555,559 ----
{
case 'newtopic':
! if( $topic_type == POST_ANNOUNCE || $topic_type == POST_GLOBAL_ANNOUNCE )
{
$is_auth_type = "auth_announce";
***************
*** 639,642 ****
--- 643,651 ----
message_die(GENERAL_MESSAGE, $message);
}
+ else if( $topic_type == POST_GLOBAL_ANNOUNCE && $userdata['user_level'] != ADMIN )
+ {
+ $message = $lang['Sorry_auth'] . $lang['Administrators'] . $auth_string . $lang['this_forum'];
+ message_die(GENERAL_MESSAGE, $message);
+ }
//
// End Auth
***************
*** 934,953 ****
}
! $sqlquery = "SELECT topic_type FROM " . TOPICS_TABLE . "
! WHERE topic_id = $topic_id";
! if($result = $db->sql_query($sqlquery))
! {
! $topic_row = $db->sql_fetchrow($result);
! $topic_type = intval($topic_row['topic_type']);
! }
! else
! {
! message_die(GENERAL_ERROR, "Could not query topics table.", __LINE__, __FILE__, $sqlquery, "");
! }
! if($topic_type != POST_ANNOUNCE)
{
! $sql .= " WHERE forum_id = $forum_id";
}
!
if($db->sql_query($sql))
{
--- 943,951 ----
}
! /* if( $topic_type != POST_GLOBAL_ANNOUNCE )
{
! $sql .= " WHERE forum_id = $forum_id";
}
! */
if($db->sql_query($sql))
{
***************
*** 2256,2259 ****
--- 2254,2267 ----
$template->assign_block_vars("type_toggle", array());
+ if( $userdata['user_level'] == ADMIN )
+ {
+ $global_announce_toggle = '<input type="radio" name="topictype" value="announce"';
+ if( $topic_type == POST_GLOBAL_ANNOUNCE )
+ {
+ $global_announce_toggle .= ' checked="checked"';
+ }
+ $global_announce_toggle .= ' /> ' . $lang['Post_Global_Announcement'] . ' ';
+ }
+
if( $is_auth['auth_announce'] )
{
***************
*** 2283,2287 ****
$topic_type_toggle .= ' checked="checked"';
}
! $topic_type_toggle .= ' /> ' . $lang['Post_Normal'] . ' ' . $sticky_toggle . $announce_toggle;
}
}
--- 2291,2295 ----
$topic_type_toggle .= ' checked="checked"';
}
! $topic_type_toggle .= ' /> ' . $lang['Post_Normal'] . ' ' . $sticky_toggle . $announce_toggle . $global_announce_toggle;
}
}
|