From: Meik S. <acy...@ph...> - 2009-07-19 11:42:27
|
Author: acydburn Date: Sun Jul 19 11:41:57 2009 New Revision: 9798 Log: QR changes to let the options actually work (we use checkboxes and isset()) Modified: branches/phpBB-3_0_0/phpBB/viewtopic.php Modified: branches/phpBB-3_0_0/phpBB/viewtopic.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/viewtopic.php (original) --- branches/phpBB-3_0_0/phpBB/viewtopic.php Sun Jul 19 11:41:57 2009 *************** *** 1435,1441 **** { $s_first_unread = $first_unread = true; } ! // $postrow = array( --- 1435,1441 ---- { $s_first_unread = $first_unread = true; } ! // $postrow = array( *************** *** 1614,1654 **** // let's set up quick_reply // TODO: introduce a per-forum and a per-user setting ! $s_quick_reply = $user->data['is_registered'] && $config['allow_quick_reply'] && ($topic_data['forum_flags'] & FORUM_FLAG_QUICK_REPLY) && $auth->acl_get('f_reply', $forum_id) ; ! if ($s_can_vote || $s_quick_reply ) { add_form_key('posting'); if ($s_quick_reply) { ! ! $s_attach_sig = $config['allow_sig'] && strlen($user->data['user_sig']) && $user->optionget('attachsig') && $auth->acl_get('f_sigs', $forum_id) && $auth->acl_get('u_sig'); ! $s_smilies = $config['allow_smilies'] && $user->optionget('smilies') && $auth->acl_get('f_smilies', $forum_id); ! $s_bbcode = $config['allow_bbcode'] && $user->optionget('bbcode') && $auth->acl_get('f_bbcode', $forum_id); ! $s_notify = $config['allow_topic_notify'] && $user->data['user_notify']; $qr_hidden_fields = array( ! 'topic_cur_post_id' => $topic_data['topic_last_post_id'], ! 'lastclick' => time(), ! 'topic_id' => $topic_data['topic_id'], ! 'forum_id' => $forum_id, ! 'disable_bbcode' => !$s_bbcode, ! 'disable_smilies' => !$s_smilies, ! 'disable_magic_url' => !$config['allow_post_links'], ! 'attach_sig' => $s_attach_sig, ! 'notify' => $s_notify, ); ! $template->assign_vars(array( ! 'S_QUICK_REPLY' => true, 'U_QR_ACTION' => append_sid("{$phpbb_root_path}posting.$phpEx", "mode=reply&f=$forum_id&t=$topic_id"), 'QR_HIDDEN_FIELDS' => build_hidden_fields($qr_hidden_fields), 'SUBJECT' => 'Re: ' . censor_text($topic_data['topic_title']), - )); } } // now I have the urge to wash my hands :( ! ! // We overwrite $_REQUEST['f'] if there is no forum specified // to be able to display the correct online list. // One downside is that the user currently viewing this topic/post is not taken into account. --- 1614,1657 ---- // let's set up quick_reply // TODO: introduce a per-forum and a per-user setting ! $s_quick_reply = $user->data['is_registered'] && $config['allow_quick_reply'] && ($topic_data['forum_flags'] & FORUM_FLAG_QUICK_REPLY) && $auth->acl_get('f_reply', $forum_id); ! ! if ($s_can_vote || $s_quick_reply) { add_form_key('posting'); + if ($s_quick_reply) { ! $s_attach_sig = $config['allow_sig'] && $user->optionget('attachsig') && $auth->acl_get('f_sigs', $forum_id) && $auth->acl_get('u_sig'); ! $s_smilies = $config['allow_smilies'] && $user->optionget('smilies') && $auth->acl_get('f_smilies', $forum_id); ! $s_bbcode = $config['allow_bbcode'] && $user->optionget('bbcode') && $auth->acl_get('f_bbcode', $forum_id); ! $s_notify = $config['allow_topic_notify'] && $user->data['user_notify']; ! $qr_hidden_fields = array( ! 'topic_cur_post_id' => (int) $topic_data['topic_last_post_id'], ! 'lastclick' => (int) time(), ! 'topic_id' => (int) $topic_data['topic_id'], ! 'forum_id' => (int) $forum_id, ); ! ! // Originally we use checkboxes and check with isset(), so we only provide them if they would be checked ! (!$s_bbcode) ? $qr_hidden_fields['disable_bbcode'] = 1 : true; ! (!$s_smilies) ? $qr_hidden_fields['disable_smilies'] = 1 : true; ! (!$config['allow_post_links']) ? $qr_hidden_fields['disable_magic_url'] = 1 : true; ! ($s_attach_sig) ? $qr_hidden_fields['attach_sig'] = 1 : true; ! ($s_notify) ? $qr_hidden_fields['notify'] = 1 : true; ! $template->assign_vars(array( ! 'S_QUICK_REPLY' => true, 'U_QR_ACTION' => append_sid("{$phpbb_root_path}posting.$phpEx", "mode=reply&f=$forum_id&t=$topic_id"), 'QR_HIDDEN_FIELDS' => build_hidden_fields($qr_hidden_fields), 'SUBJECT' => 'Re: ' . censor_text($topic_data['topic_title']), )); } } // now I have the urge to wash my hands :( ! ! // We overwrite $_REQUEST['f'] if there is no forum specified // to be able to display the correct online list. // One downside is that the user currently viewing this topic/post is not taken into account. |