aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/posting.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-06-11 00:12:42 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-06-11 00:12:42 +0000
commit13a02f6cc5bcdb0654642135b2981633ac3996b5 (patch)
tree50e01ff1d2a73834c26fb72d229d46b02ec3da52 /phpBB/posting.php
parent056ab23bb65aea43aeb0918e7d7992a8987890a8 (diff)
downloadforums-13a02f6cc5bcdb0654642135b2981633ac3996b5.tar
forums-13a02f6cc5bcdb0654642135b2981633ac3996b5.tar.gz
forums-13a02f6cc5bcdb0654642135b2981633ac3996b5.tar.bz2
forums-13a02f6cc5bcdb0654642135b2981633ac3996b5.tar.xz
forums-13a02f6cc5bcdb0654642135b2981633ac3996b5.zip
my round of bug fixes
git-svn-id: file:///svn/phpbb/trunk@7749 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/posting.php')
-rw-r--r--phpBB/posting.php24
1 files changed, 20 insertions, 4 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php
index eb6483ffd3..7524ef41a5 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -975,11 +975,22 @@ if ($submit || $preview || $refresh)
unset($message_parser);
$redirect_url = submit_post($mode, $post_data['post_subject'], $post_data['username'], $post_data['topic_type'], $poll, $data, $update_message);
+ $post_need_approval = (!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) ? true : false;
- meta_refresh(3, $redirect_url);
+ // If the post need approval we will wait a lot longer.
+ if ($post_need_approval)
+ {
+ meta_refresh(10, $redirect_url);
+ $message = ($mode == 'edit') ? $user->lang['POST_EDITED_MOD'] : $user->lang['POST_STORED_MOD'];
+ }
+ else
+ {
+ meta_refresh(3, $redirect_url);
+
+ $message = ($mode == 'edit') ? 'POST_EDITED' : 'POST_STORED';
+ $message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['VIEW_MESSAGE'], '<a href="' . $redirect_url . '">', '</a>');
+ }
- $message = (!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) ? (($mode == 'edit') ? 'POST_EDITED_MOD' : 'POST_STORED_MOD') : (($mode == 'edit') ? 'POST_EDITED' : 'POST_STORED');
- $message = $user->lang[$message] . (($auth->acl_get('f_noapprove', $data['forum_id']) || $auth->acl_get('m_approve', $data['forum_id'])) ? '<br /><br />' . sprintf($user->lang['VIEW_MESSAGE'], '<a href="' . $redirect_url . '">', '</a>') : '');
$message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $data['forum_id']) . '">', '</a>');
trigger_error($message);
}
@@ -1026,13 +1037,18 @@ if (!sizeof($error) && $preview)
$parse_poll->format_display($post_data['enable_bbcode'], $post_data['enable_urls'], $post_data['enable_smilies']);
+ if ($post_data['poll_length'])
+ {
+ $poll_end = ($post_data['poll_length'] * 86400) + (($post_data['poll_start']) ? $post_data['poll_start'] : time());
+ }
+
$template->assign_vars(array(
'S_HAS_POLL_OPTIONS' => (sizeof($post_data['poll_options'])),
'S_IS_MULTI_CHOICE' => ($post_data['poll_max_options'] > 1) ? true : false,
'POLL_QUESTION' => $parse_poll->message,
- 'L_POLL_LENGTH' => ($post_data['poll_length']) ? sprintf($user->lang['POLL_RUN_TILL'], $user->format_date($post_data['poll_length'] + $post_data['poll_start'])) : '',
+ 'L_POLL_LENGTH' => ($post_data['poll_length']) ? sprintf($user->lang['POLL_RUN_TILL'], $user->format_date($poll_end)) : '',
'L_MAX_VOTES' => ($post_data['poll_max_options'] == 1) ? $user->lang['MAX_OPTION_SELECT'] : sprintf($user->lang['MAX_OPTIONS_SELECT'], $post_data['poll_max_options']))
);