aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordougk_ff7 <dougk_ff7@users.sourceforge.net>2001-10-16 13:10:09 +0000
committerdougk_ff7 <dougk_ff7@users.sourceforge.net>2001-10-16 13:10:09 +0000
commitfd20e68b5e2226d00cd4097010bc25eb46477f5f (patch)
treef7f6f39eb71ef2348de02b773a63b9aa59007972
parenta4858256ff68ec2be9e2ee19fd44c7d29be299e2 (diff)
downloadforums-fd20e68b5e2226d00cd4097010bc25eb46477f5f.tar
forums-fd20e68b5e2226d00cd4097010bc25eb46477f5f.tar.gz
forums-fd20e68b5e2226d00cd4097010bc25eb46477f5f.tar.bz2
forums-fd20e68b5e2226d00cd4097010bc25eb46477f5f.tar.xz
forums-fd20e68b5e2226d00cd4097010bc25eb46477f5f.zip
More changes for global announcements. They no longer require the mode to be set (it works without), posting.php has been updated to reflect replies to announcements in ALL forums, and a admin page for announcements (global) has been added, although it can only link to pages with the true forum and auth permissions. A more refined version will be coming soon
git-svn-id: file:///svn/phpbb/trunk@1222 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/admin/admin_announce.php41
-rw-r--r--phpBB/posting.php19
-rw-r--r--phpBB/viewforum.php25
-rw-r--r--phpBB/viewtopic.php23
4 files changed, 67 insertions, 41 deletions
diff --git a/phpBB/admin/admin_announce.php b/phpBB/admin/admin_announce.php
new file mode 100644
index 0000000000..605723bf85
--- /dev/null
+++ b/phpBB/admin/admin_announce.php
@@ -0,0 +1,41 @@
+<?php
+/***************************************************************************
+ * admin_announce.php
+ * -------------------
+ * begin : Saturday, Feb 13, 2001
+ * copyright : (C) 2001 The phpBB Group
+ * email : support@phpbb.com
+ *
+ * $Id$
+ *
+ *
+ ***************************************************************************/
+
+/***************************************************************************
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ ***************************************************************************/
+
+define("IN_ADMIN", true);
+
+if($setmodules == 1)
+{
+ $filename = basename(__FILE__);
+ $module['General']['Announcements'] = $filename;
+
+ return;
+}
+
+//
+// Load default header
+//
+$phpbb_root_dir = "./../";
+$no_page_header = TRUE;
+require('pagestart.inc');
+
+message_die(GENERAL_MESSAGE, "Announcements are not yet implemented. Click <a href=\"" . append_sid("admin_forumauth." . $phpEx . "?f=-1&submit=submit") . "\">here</a> to view the global announcement permissions. Click <a href=\"" . append_sid("./../viewforum." . $phpEx . "?f=-1") . "\">here</a> to view the global announcments forum separately.", __LINE__, __FILE__, "", "");
+?> \ No newline at end of file
diff --git a/phpBB/posting.php b/phpBB/posting.php
index c093d3a974..aa702482ad 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -925,15 +925,30 @@ if( ( $submit || $confirm || $mode == "delete" ) && !$error )
$sql .= " WHERE topic_id = $new_topic_id";
if($db->sql_query($sql))
- {
+ {
$sql = "UPDATE " . FORUMS_TABLE . "
SET forum_last_post_id = $new_post_id, forum_posts = forum_posts + 1";
if($mode == "newtopic")
{
$sql .= ", forum_topics = forum_topics + 1";
}
+
+ $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))
{
$sql = "UPDATE " . USERS_TABLE . "
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index ee8b398f08..975787b547 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -435,18 +435,14 @@ if($total_topics)
if($topic_type == POST_ANNOUNCE)
{
$topic_type = $lang['Topic_Announcement'] . " ";
- $is_announcement = TRUE;
}
else if($topic_type == POST_STICKY)
{
$topic_type = $lang['Topic_Sticky'] . " ";
- $is_announcement = FALSE;
}
else
{
- $topic_type = "";
- $is_announcement = FALSE;
- }
+ $topic_type = ""; }
if( $topic_rowset[$i]['topic_vote'] )
{
@@ -556,14 +552,8 @@ if($total_topics)
}
}
}
- if($is_announcement == TRUE)
- {
- $view_topic_url = append_sid("viewtopic.$phpEx?mode=viewannounce&". POST_FORUM_URL . "=" . $forum_id . "&" . POST_TOPIC_URL . "=$topic_id");
- }
- else
- {
- $view_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");
- }
+
+ $view_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");
$topic_poster = $topic_rowset[$i]['username'];
$topic_poster_profile_url = append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $topic_rowset[$i]['user_id']);
@@ -572,14 +562,7 @@ if($total_topics)
$last_post = $last_post_time . "<br />" . $lang['by'] . " ";
$last_post .= ( $topic_rowset[$i]['id2'] == ANONYMOUS ) ? $topic_rowset[$i]['user2'] . " " : "<a href=\"" . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $topic_rowset[$i]['id2']) . "\">" . $topic_rowset[$i]['user2'] . "</a> ";
- if($is_announcement == TRUE)
- {
- $last_post .= "<a href=\"" . append_sid("viewtopic.$phpEx?mode=viewannounce&" . POST_FORUM_URL . "=" . $forum_id . "&" . POST_POST_URL . "=" . $topic_rowset[$i]['topic_last_post_id']) . "#" . $topic_rowset[$i]['topic_last_post_id'] . "\"><img src=\"" . $images['icon_latest_reply'] . "\" border=\"0\" alt=\"" . $lang['View_latest_post'] . "\" /></a>";
- }
- else
- {
- $last_post .= "<a href=\"" . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $topic_rowset[$i]['topic_last_post_id']) . "#" . $topic_rowset[$i]['topic_last_post_id'] . "\"><img src=\"" . $images['icon_latest_reply'] . "\" border=\"0\" alt=\"" . $lang['View_latest_post'] . "\" /></a>";
- }
+ $last_post .= "<a href=\"" . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $topic_rowset[$i]['topic_last_post_id']) . "#" . $topic_rowset[$i]['topic_last_post_id'] . "\"><img src=\"" . $images['icon_latest_reply'] . "\" border=\"0\" alt=\"" . $lang['View_latest_post'] . "\" /></a>";
$views = $topic_rowset[$i]['topic_views'];
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index bc1c0d6c43..700366eb33 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -147,24 +147,11 @@ $count_sql = (!isset($post_id)) ? "" : ", COUNT(p2.post_id) AS prev_posts";
$order_sql = (!isset($post_id)) ? "" : "GROUP BY p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments ORDER BY p.post_id ASC";
-if( $mode=="viewannounce" )
-{
- $sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments" . $count_sql . "
- FROM $join_sql_table " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f
- WHERE $join_sql AND
- t.topic_type = " . POST_ANNOUNCE . " AND
- (f.forum_id = " . $forum_id . "
- OR f.forum_id = -1)
- $order_sql";
-}
-else
-{
- $sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments" . $count_sql . "
- FROM $join_sql_table " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f
- WHERE $join_sql
- AND f.forum_id = t.forum_id
- $order_sql";
-}
+$sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments" . $count_sql . "
+ FROM $join_sql_table " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f
+ WHERE $join_sql
+ AND f.forum_id = t.forum_id
+ $order_sql";
if(!$result = $db->sql_query($sql))
{