aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2003-10-28 21:23:49 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2003-10-28 21:23:49 +0000
commited58e166f5463e616ca0025623774f2cfb9c04e9 (patch)
treed065483927ff1844f5a9ac152d2b0fe55e7580a6
parentedbe99feb66b67eaa1a0a29b093dbdf56bd789fb (diff)
downloadforums-ed58e166f5463e616ca0025623774f2cfb9c04e9.tar
forums-ed58e166f5463e616ca0025623774f2cfb9c04e9.tar.gz
forums-ed58e166f5463e616ca0025623774f2cfb9c04e9.tar.bz2
forums-ed58e166f5463e616ca0025623774f2cfb9c04e9.tar.xz
forums-ed58e166f5463e616ca0025623774f2cfb9c04e9.zip
fix "not able to reply to announcements" and wrong notify checkbox status.
git-svn-id: file:///svn/phpbb/trunk@4627 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/adm/admin_attachments.php31
-rw-r--r--phpBB/install/schemas/mysql_schema.sql3
-rw-r--r--phpBB/posting.php25
3 files changed, 23 insertions, 36 deletions
diff --git a/phpBB/adm/admin_attachments.php b/phpBB/adm/admin_attachments.php
index bb61a592ef..79dadc168b 100644
--- a/phpBB/adm/admin_attachments.php
+++ b/phpBB/adm/admin_attachments.php
@@ -86,7 +86,7 @@ while ($row = $db->sql_fetchrow($result))
if ($old_size != $new_size)
{
- // check for similar value of old_size in Extension Groups. If so, update these values.
+ // check fir similar value of old_size in Extension Groups. If so, update these values.
$sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . "
SET max_filesize = $new_size
WHERE max_filesize = $old_size";
@@ -520,32 +520,17 @@ $select_size_mode = size_select('size', $size);
$select_quota_size_mode = size_select('quota_size', $quota_size);
$select_pm_size_mode = size_select('pm_size', $pm_size);
+$s_select_mode = '<select name="mode">';
+foreach ($modes as $_mode)
+{
+ $s_select_mode .= '<option value="' . $_mode . '"' . (($mode == $_mode) ? ' selected="selected"' : '') . '>' . $user->lang['ATTACH_' . strtoupper($_mode) . '_URL'] . '</option>';
+}
+$s_select_mode .= '</select>';
?>
<form name="attachments" method="post" action="admin_attachments.<?php echo "$phpEx$SID&amp;mode=$mode"; ?>">
<table cellspacing="1" cellpadding="0" border="0" align="center" width="99%">
<tr>
- <td align="right"> &nbsp;&nbsp;
-<?php
- for ($i = 0; $i < count($modes); $i++)
- {
- if ($i != 0)
- {
- ?> | <?php
- }
-
- if ($mode != $modes[$i])
- {
- ?><a href="admin_attachments.<?php echo "$phpEx$SID&amp;mode=" . $modes[$i]; ?>"><?php
- }
-
- echo $user->lang['ATTACH_' . strtoupper($modes[$i]) . '_URL'];
-
- if ($mode != $modes[$i])
- {
- ?></a><?php
- }
- }
-?> </td>
+ <td align="right"><?php echo $s_select_mode; ?> &nbsp; <input type="submit" name="select_mode" class="btnlite" value="<?php echo $user->lang['SELECT']; ?>" /></td>
</tr>
</table>
<?php
diff --git a/phpBB/install/schemas/mysql_schema.sql b/phpBB/install/schemas/mysql_schema.sql
index 04c49dac10..03a63b73e0 100644
--- a/phpBB/install/schemas/mysql_schema.sql
+++ b/phpBB/install/schemas/mysql_schema.sql
@@ -250,7 +250,7 @@ CREATE TABLE phpbb_groups (
group_display tinyint(1) DEFAULT '0' NOT NULL,
group_avatar varchar(100) DEFAULT '' NOT NULL,
group_avatar_type tinyint(4) DEFAULT '0' NOT NULL,
- group_avatar_width tinyint(4 UNSIGNED DEFAULT '0' NOT NULL,
+ group_avatar_width tinyint(4) UNSIGNED DEFAULT '0' NOT NULL,
group_avatar_height tinyint(4) UNSIGNED DEFAULT '0' NOT NULL,
group_rank smallint(5) DEFAULT '-1' NOT NULL,
group_colour varchar(6) DEFAULT '' NOT NULL,
@@ -729,6 +729,7 @@ CREATE TABLE phpbb_users (
user_sortby_type varchar(1) DEFAULT '' NOT NULL,
user_sortby_dir varchar(1) DEFAULT '' NOT NULL,
user_show_days tinyint(1) DEFAULT '' NOT NULL,
+ user_notify tinyint(1) DEFAULT '0' NOT NULL,
user_notify_pm tinyint(1) DEFAULT '1' NOT NULL,
user_notify_type tinyint(4) DEFAULT '0' NOT NULL,
user_allow_pm tinyint(1) DEFAULT '1' NOT NULL,
diff --git a/phpBB/posting.php b/phpBB/posting.php
index b39f265507..aede56df5a 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -159,7 +159,7 @@ if ($sql)
$db->sql_freeresult($result);
}
- $message_parser = new parse_message(0); // <- TODO: add constant (MSG_POST/MSG_PM)
+ $message_parser = new parse_message(0);
$message_parser->filename_data['filecomment'] = preg_replace('#&amp;(\#[0-9]+;)#', '&\1', request_var('filecomment', ''));
@@ -241,14 +241,13 @@ if ($mode != 'post' && $user->data['user_id'] != ANONYMOUS)
FROM ' . TOPICS_WATCH_TABLE . '
WHERE topic_id = ' . $topic_id . '
AND user_id = ' . $user->data['user_id'];
- $result = $db->sql_query($sql);
-
+ $result = $db->sql_query_limit($sql, 1);
$notify_set = ($db->sql_fetchrow($result)) ? 1 : 0;
$db->sql_freeresult($result);
}
else
{
- $notify_set = -1;
+ $notify_set = 0;
}
@@ -414,7 +413,7 @@ else if ($mode == 'bump')
markread('post', $forum_id, $topic_id, $current_time);
- add_log('mod', $forum_id, $topic_id, 'LOGM_BUMP');
+ add_log('mod', $forum_id, $topic_id, sprintf('LOGM_BUMP', $topic_title));
meta_refresh(3, "viewtopic.$phpEx$SID&amp;f=$forum_id&amp;t=$topic_id&amp;p=$topic_last_post_id#$topic_last_post_id");
@@ -504,7 +503,6 @@ if ($submit || $preview || $refresh)
$poll_delete = (isset($_POST['poll_delete'])) ? TRUE : FALSE;
-
// Faster than crc32
$check_value = (($preview || $refresh) && isset($_POST['status_switch'])) ? (int) $_POST['status_switch'] : (($enable_html+1) << 16) + (($enable_bbcode+1) << 8) + (($enable_smilies+1) << 4) + (($enable_urls+1) << 2) + (($enable_sig+1) << 1);
$status_switch = (isset($_POST['status_switch']) && (int) $_POST['status_switch'] != $check_value) ? TRUE : FALSE;
@@ -634,7 +632,7 @@ if ($submit || $preview || $refresh)
$poll_title = $poll['poll_title'];
// Check topic type
- if ($topic_type != POST_NORMAL)
+ if ($topic_type != POST_NORMAL && ($mode == 'post' || ($mode == 'edit' && $topic_first_post_id == $post_id)))
{
switch ($topic_type)
{
@@ -651,7 +649,7 @@ if ($submit || $preview || $refresh)
if (!$auth->acl_get($auth_option, $forum_id))
{
- $error[] = $user->lang['CANNOT_POST_' . strtoupper($auth_option)];
+ $error[] = $user->lang['CANNOT_POST_' . str_replace('F_', '', strtoupper($auth_option))];
}
}
@@ -938,7 +936,7 @@ $bbcode_checked = (isset($enable_bbcode)) ? !$enable_bbcode : (($config['allow_
$smilies_checked = (isset($enable_smilies)) ? !$enable_smilies : (($config['allow_smilies']) ? !$user->optionget('smile') : 1);
$urls_checked = (isset($enable_urls)) ? !$enable_urls : 0;
$sig_checked = $enable_sig;
-$notify_checked = (isset($notify)) ? $notify : (($notify_set == -1) ? (($user->data['user_id'] != ANONYMOUS) ? $user->data['user_notify'] : 0) : $notify_set);
+$notify_checked = (isset($notify)) ? $notify : ((!$notify_set) ? (($user->data['user_id'] != ANONYMOUS) ? $user->data['user_notify'] : 0) : 1);
$lock_topic_checked = (isset($topic_lock)) ? $topic_lock : (($topic_status == ITEM_LOCKED) ? 1 : 0);
$lock_post_checked = (isset($post_lock)) ? $post_lock : $post_edit_locked;
@@ -1321,7 +1319,10 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
}
unset($email_list_ary);
- $messenger->queue->save();
+ if (!empty($messenger->queue))
+ {
+ $messenger->queue->save();
+ }
}
// Handle the DB updates
@@ -2081,13 +2082,13 @@ function submit_post($mode, $message, $subject, $username, $topic_type, $bbcode_
$db->sql_transaction('commit');
// Topic Notification
- if (($data['notify_set'] == 0 || $data['notify_set'] == -1) && $data['notify'])
+ if (!$data['notify_set'] && $data['notify'])
{
$sql = 'INSERT INTO ' . TOPICS_WATCH_TABLE . ' (user_id, topic_id)
VALUES (' . $user->data['user_id'] . ', ' . $data['topic_id'] . ')';
$db->sql_query($sql);
}
- else if ($data['notify_set'] == 1 && !$data['notify'])
+ else if ($data['notify_set'] && !$data['notify'])
{
$sql = 'DELETE FROM ' . TOPICS_WATCH_TABLE . '
WHERE user_id = ' . $user->data['user_id'] . '