diff --git a/phpBB/db/mysql_basic.sql b/phpBB/db/mysql_basic.sql
index 1299c3611b..77792733f8 100644
--- a/phpBB/db/mysql_basic.sql
+++ b/phpBB/db/mysql_basic.sql
@@ -38,7 +38,7 @@ INSERT INTO phpbb_auth_forums (forum_id, auth_view, auth_read, auth_post, auth_r
INSERT INTO phpbb_auth_access (group_id, forum_id, auth_view, auth_read, auth_post, auth_reply, auth_edit, auth_delete, auth_announce, auth_sticky, auth_votecreate, auth_vote, auth_mod) VALUES (2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1);
# -- Demo Topic
-INSERT INTO phpbb_topics VALUES(1, 1, 'Demo Topic', 1, NOW(), 0, 0, 0, 0, 1);
+INSERT INTO phpbb_topics VALUES(1, 1, 'Demo Topic', 1, NOW(), 0, 0, 0, 0, 0, 1);
# -- Demo Post
INSERT INTO phpbb_posts VALUES(1, 1, 1, 1, NOW(), '127.0.0.1' , LEFT(MD5('42'), 10));
diff --git a/phpBB/db/mysql_schema.sql b/phpBB/db/mysql_schema.sql
index fb2897a4aa..bf6ea64c2c 100644
--- a/phpBB/db/mysql_schema.sql
+++ b/phpBB/db/mysql_schema.sql
@@ -18,10 +18,10 @@ CREATE TABLE phpbb_auth_access (
auth_reply tinyint(1) DEFAULT '0' NOT NULL,
auth_edit tinyint(1) DEFAULT '0' NOT NULL,
auth_delete tinyint(1) DEFAULT '0' NOT NULL,
- auth_announce tinyint(1) DEFAULT '0' NOT NULL,
- auth_sticky tinyint(1) DEFAULT '0' NOT NULL,
- auth_votecreate tinyint(1) DEFAULT '0' NOT NULL,
- auth_attachments tinyint(1) DEFAULT '0' NOT NULL,
+ auth_announce tinyint(1) DEFAULT '0' NOT NULL,
+ auth_sticky tinyint(1) DEFAULT '0' NOT NULL,
+ auth_votecreate tinyint(1) DEFAULT '0' NOT NULL,
+ auth_attachments tinyint(1) DEFAULT '0' NOT NULL,
auth_vote tinyint(1) DEFAULT '0' NOT NULL,
auth_mod tinyint(1) DEFAULT '0' NOT NULL,
auth_admin tinyint(1) DEFAULT '0' NOT NULL
@@ -40,10 +40,10 @@ CREATE TABLE phpbb_auth_forums (
auth_reply tinyint(4) DEFAULT '0' NOT NULL,
auth_edit tinyint(4) DEFAULT '0' NOT NULL,
auth_delete tinyint(4) DEFAULT '0' NOT NULL,
- auth_announce tinyint(4) DEFAULT '0' NOT NULL,
- auth_sticky tinyint(4) DEFAULT '0' NOT NULL,
+ auth_announce tinyint(4) DEFAULT '0' NOT NULL,
+ auth_sticky tinyint(4) DEFAULT '0' NOT NULL,
auth_votecreate tinyint(4) DEFAULT '0' NOT NULL,
- auth_vote tinyint(4) DEFAULT '0' NOT NULL,
+ auth_vote tinyint(4) DEFAULT '0' NOT NULL,
auth_attachments tinyint(4) DEFAULT '0' NOT NULL
);
@@ -125,7 +125,7 @@ CREATE TABLE phpbb_config (
email_from varchar(100),
flood_interval int(4) NOT NULL,
avatar_filesize int(11) DEFAULT '6144' NOT NULL,
- avatar_path varchar(255) DEFAULT 'images/avatars' NOT NULL,
+ avatar_path varchar(255) DEFAULT 'images/avatars' NOT NULL,
default_theme int(11) DEFAULT '1' NOT NULL,
default_lang varchar(255),
default_dateformat varchar(14) DEFAULT 'd M Y H:i' NOT NULL,
@@ -273,8 +273,8 @@ CREATE TABLE phpbb_session (
session_id char(32) DEFAULT '' NOT NULL,
session_user_id int(11) DEFAULT '0' NOT NULL,
session_start int(11) DEFAULT '0' NOT NULL,
- session_time int(11) DEFAULT '0' NOT NULL,
- session_last_visit int(11) DEFAULT '0' NOT NULL,
+ session_time int(11) DEFAULT '0' NOT NULL,
+ session_last_visit int(11) DEFAULT '0' NOT NULL,
session_ip char(8) DEFAULT '0' NOT NULL,
session_page int(11) DEFAULT '0' NOT NULL,
session_logged_in tinyint(1) DEFAULT '0' NOT NULL,
@@ -407,6 +407,7 @@ CREATE TABLE phpbb_topics (
topic_views int(10) DEFAULT '0' NOT NULL,
topic_replies int(11) DEFAULT '0' NOT NULL,
topic_status tinyint(3) DEFAULT '0' NOT NULL,
+ topic_type tinyint(3) DEFAULT '0' NOT NULL,
topic_notify tinyint(3) DEFAULT '0',
topic_last_post_id int(11) DEFAULT '0' NOT NULL,
PRIMARY KEY (topic_id),
diff --git a/phpBB/db/postgres_schema.sql b/phpBB/db/postgres_schema.sql
index 5863deac54..06e79697af 100644
--- a/phpBB/db/postgres_schema.sql
+++ b/phpBB/db/postgres_schema.sql
@@ -34,7 +34,7 @@ CREATE TABLE phpbb_auth_forums (
auth_announce int2 DEFAULT '0' NOT NULL,
auth_sticky int2 DEFAULT '0' NOT NULL,
auth_votecreate int2 DEFAULT '0' NOT NULL,
- auth_vote int2 DEFAULT '0' NOT NULL,
+ auth_vote int2 DEFAULT '0' NOT NULL,
auth_attachments int2 DEFAULT '0' NOT NULL
);
@@ -53,8 +53,8 @@ CREATE TABLE phpbb_auth_access (
auth_delete int2 DEFAULT '0' NOT NULL,
auth_announce int2 DEFAULT '0' NOT NULL,
auth_sticky int2 DEFAULT '0' NOT NULL,
- auth_votecreate int2 DEFAULT '0' NOT NULL,
- auth_attachments int2 DEFAULT '0' NOT NULL,
+ auth_votecreate int2 DEFAULT '0' NOT NULL,
+ auth_attachments int2 DEFAULT '0' NOT NULL,
auth_vote int2 DEFAULT '0' NOT NULL,
auth_mod int2 DEFAULT '0' NOT NULL,
auth_admin int2 DEFAULT '0' NOT NULL
@@ -141,7 +141,7 @@ CREATE TABLE phpbb_config (
system_timezone int4 NOT NULL,
sys_template varchar(50) NOT NULL,
avatar_filesize int4 DEFAULT '6144' NOT NULL,
- avatar_path varchar(255) DEFAULT 'images/avatars' NOT NULL,
+ avatar_path varchar(255) DEFAULT 'images/avatars' NOT NULL,
override_themes int2 NOT NULL,
flood_interval int NOT NULL,
selected int2 NOT NULL,
@@ -286,8 +286,8 @@ CREATE TABLE phpbb_session (
session_id char(32) DEFAULT '0' NOT NULL,
session_user_id int4 DEFAULT '0' NOT NULL,
session_start int4 DEFAULT '0' NOT NULL,
- session_time int4 DEFAULT '0' NOT NULL,
- session_last_visit int4 DEFAULT '0' NOT NULL,
+ session_time int4 DEFAULT '0' NOT NULL,
+ session_last_visit int4 DEFAULT '0' NOT NULL,
session_ip char(8) DEFAULT '0' NOT NULL,
session_page int4 DEFAULT '0' NOT NULL,
session_logged_in int2 DEFAULT '0' NOT NULL,
@@ -404,6 +404,7 @@ CREATE TABLE phpbb_topics (
topic_replies int4 DEFAULT '0' NOT NULL,
forum_id int4 DEFAULT '0' NOT NULL,
topic_status int2 DEFAULT '0' NOT NULL,
+ topic_type int2 DEFAULT '0' NOT NULL,
topic_notify int2 DEFAULT '0',
topic_last_post_id int4 DEFAULT '0' NOT NULL,
CONSTRAINT phpbb_topics_pkey PRIMARY KEY (topic_id)
diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php
index 5f82d4f2a8..5dbe9960f7 100644
--- a/phpBB/includes/constants.php
+++ b/phpBB/includes/constants.php
@@ -40,6 +40,13 @@ define(ADMIN, 1);
define(UNLOCKED, 0);
define(LOCKED, 1);
+// Topic types
+define(NORMAL, 0);
+define(STICKY, 1);
+define(ANNOUCE, 2);
+define(GLOB_ANNOUNCE, 3);
+
+
// Ban time types
define(SECONDS, 1);
define(MINUTES, 2);
diff --git a/phpBB/language/lang_english.php b/phpBB/language/lang_english.php
index 44e6322d13..18d057c021 100755
--- a/phpBB/language/lang_english.php
+++ b/phpBB/language/lang_english.php
@@ -126,6 +126,8 @@ $lang['Forum_Index'] = "Forum Index";
//
// Viewforum
//
+$lang['Annoucement'] = "Annoucement:";
+$lang['Sticky'] = "Sticky:";
//
// Viewtopic
@@ -140,6 +142,9 @@ $lang['Empty_subj'] = "You must specifiy a subject when posting a new topic.";
$lang['Empty_msg'] = "You must enter a message when posting!";
$lang['Postnew'] = "Post New Topic";
$lang['Post_new_in'] = "Post New Topic in:"; // Followed by forum name
+$lang['Post_Annoucement'] = "Post as an annoucement";
+$lang['Post_Sticky'] = "Stick this topic";
+$lang['Annouce_and_sticky'] = "You cannot post a topic that is both an annoucement and a sticky topic";
//
diff --git a/phpBB/posting.php b/phpBB/posting.php
index d998720ca4..d52e238c10 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -90,11 +90,27 @@ init_userprefs($userdata);
switch($mode)
{
case 'newtopic':
- $auth_type = AUTH_POST;
- $is_auth_type = "auth_post";
- $error_string = "post new topics";
+ if(isset($HTTP_POST_VARS['annouce']))
+ {
+ $auth_type = AUTH_ANNOUCE;
+ $is_auth_type = "auth_announce";
+ $error_string = "post annoucements";
+ }
+ else if(isset($HTTP_POST_VARS['sticky']))
+ {
+ $auth_type = AUTH_STICKY;
+ $is_auth_type = "auth_sticky";
+ $error_string = "post sticky topics";
+ }
+ else
+ {
+ $auth_type = AUTH_ALL;
+ $is_auth_type = "auth_post";
+ $error_string = "post new topics";
+ }
break;
case 'reply':
+
$auth_type = AUTH_REPLY;
$is_auth_type = "auth_reply";
$error_string = "reply to topics";
@@ -110,8 +126,8 @@ switch($mode)
$error_string = "delete topics";
break;
default:
- $auth_type = AUTH_POST;
- $is_auth_type = "auth_post";
+ $auth_type = AUTH_ALL;
+ $is_auth_type = "auth_all";
$error_string = "post new topics";
break;
}
@@ -153,6 +169,21 @@ $disable_bbcode = (isset($HTTP_POST_VARS['disable_bbcode'])) ? $HTTP_POST_VARS['
$disable_smilies = (isset($HTTP_POST_VARS['disable_smile'])) ? $HTTP_POST_VARS['disable_smile'] : !$userdata['user_allowsmile'];
$attach_sig = (isset($HTTP_POST_VARS['attach_sig'])) ? $HTTP_POST_VARS['attach_sig'] : $userdata['user_attachsig'];
$notify = (isset($HTTP_POST_VARS['notify'])) ? $HTTP_POST_VARS['notify'] : $userdata["always_notify"];
+$annouce = (isset($HTTP_POST_VARS['annouce'])) ? $HTTP_POST_VARS['annouce'] : "";
+$sticky = (isset($HTTP_POST_VARS['sticky'])) ? $HTTP_POST_VARS['sticky'] : "";
+
+if($annouce)
+{
+ $topic_type = ANNOUCE;
+}
+else if($sticky)
+{
+ $topic_type = STICKY;
+}
+else
+{
+ $topic_type = NORMAL;
+}
//
// Prepare our message and subject on a 'submit'
@@ -195,6 +226,17 @@ if(isset($HTTP_POST_VARS['submit']))
$error_msg .= $lang['Empty_subj'];
}
+ // You can't make it both an annoumcement and a stick topic
+ if($annouce && $sticky)
+ {
+ $error = TRUE;
+ if(isset($error_msg))
+ {
+ $error_msg .= "
";
+ }
+ $error_msg .= $lang['Annouce_and_sticky'];
+ }
+
if(!empty($HTTP_POST_VARS['message']))
{
if(!$error)
@@ -274,8 +316,8 @@ switch($mode)
{
$topic_time = get_gmt_ts();
$topic_notify = ($HTTP_POST_VARS['notify']) ? $HTTP_POST_VARS['notify'] : 0;
- $sql = "INSERT INTO ".TOPICS_TABLE." (topic_title, topic_poster, topic_time, forum_id, topic_notify, topic_status)
- VALUES ('$subject', ".$userdata['user_id'].", ".$topic_time.", $forum_id, $topic_notify, ".UNLOCKED.")";
+ $sql = "INSERT INTO ".TOPICS_TABLE." (topic_title, topic_poster, topic_time, forum_id, topic_notify, topic_status, topic_type)
+ VALUES ('$subject', ".$userdata['user_id'].", ".$topic_time.", $forum_id, $topic_notify, ".UNLOCKED.", ".$topic_type.")";
if($db->sql_query($sql))
{
@@ -807,20 +849,6 @@ if($error)
}
$forum_info = $db->sql_fetchrow($result);
$forum_name = stripslashes($forum_info['forum_name']);
- $forum_access = $forum_info['forum_access'];
-
- if($forum_access == ANONALLOWED)
- {
- $about_posting = "$l_anonusers $l_inthisforum $l_anonhint";
- }
- if($forum_access == REGONLY)
- {
- $about_posting = "$l_regusers $l_inthisforum";
- }
- if($forum_access == MODONLY)
- {
- $about_posting = "$l_modusers $l_inthisforum";
- }
$template->set_filenames(array(
"body" => "posting_body.tpl",
@@ -905,6 +933,31 @@ if($error)
}
$sig_toggle .= "> $l_attachsig";
+ if($mode == 'newtopic')
+ {
+ if($is_auth['auth_announce'])
+ {
+ $annouce_toggle = '";
$template->assign_vars(array(
- "L_ABOUT_POST" => $l_aboutpost,
"L_SUBJECT" => $l_subject,
"L_MESSAGE_BODY" => $l_body,
"L_OPTIONS" => $l_options,
@@ -931,7 +983,6 @@ if($error)
"L_SUBMIT" => $l_submit,
"L_CANCEL" => $l_cancelpost,
- "ABOUT_POSTING" => $about_posting,
"USERNAME_INPUT" => $username_input,
"PASSWORD_INPUT" => $password_input,
"SUBJECT_INPUT" => $subject_input,
@@ -940,6 +991,8 @@ if($error)
"HTML_TOGGLE" => $html_toggle,
"SMILE_TOGGLE" => $smile_toggle,
"SIG_TOGGLE" => $sig_toggle,
+ "ANNOUNCE_TOGGLE" => $annouce_toggle,
+ "STICKY_TOGGLE" => $sticky_toggle,
"NOTIFY_TOGGLE" => $notify_toggle,
"BBCODE_TOGGLE" => $bbcode_toggle,
"BBCODE_STATUS" => $bbcode_status,
diff --git a/phpBB/templates/Default/viewforum_body.tpl b/phpBB/templates/Default/viewforum_body.tpl
index f96cf44cd6..38b68b1528 100644
--- a/phpBB/templates/Default/viewforum_body.tpl
+++ b/phpBB/templates/Default/viewforum_body.tpl
@@ -42,7 +42,7 @@