示例#1
0
         $s_hidden_fields = build_hidden_fields(array('submit' => true, 'blog_id' => $blog_id));
         confirm_box(false, 'CONF_DEL_POST', $s_hidden_fields);
         trigger_error($user->lang['GENERIC_ERROR']);
     }
     break;
     // These cases use almost the same code with only some extra stuff for the latter case
 // These cases use almost the same code with only some extra stuff for the latter case
 case 'post_comment':
 case 'edit_comment':
     $cid = request_var('cid', 0);
     // we only need to check for comment managing and content data if we are editing a comment
     if ($action == 'edit_comment') {
         if (!$auth->acl_get('a_blog_manage') && !$auth->acl_get('u_blog_comment_manage')) {
             trigger_error($user->lang['UNAUTHED']);
         } else {
             if (!($comment_data = blog::get_comment_data($cid))) {
                 trigger_error($user->lang['INVALID_CMNT_ID'] . '<BR /><BR /><a href="' . append_sid("{$phpbb_root_path}blog.{$phpEx}") . '">' . $user->lang['RETURN'] . '</a>');
             }
         }
     }
     if (!empty($_POST['submit'])) {
         $id = $action == 'edit_comment' ? $comment_data['cmnt_blog_id'] : request_var('id', 0);
         $approved = $auth->acl_get('u_blog_approved') ? true : false;
         $data = array('cmnt_text' => utf8_normalize_nfc(request_var('message', '', true)), 'cmnt_blog_id' => $id, 'cmnt_poster_id' => $user->data['user_id'], 'cmnt_approved' => $approved, 'enable_bbcode' => $config['blog_bbcode_on'] && $auth->acl_get('u_blog_bbcode'), 'enable_smilies' => $config['blog_emote_on'] && $auth->acl_get('u_block_emote'));
         $mode = $action == 'post_comment' ? 'new' : 'update';
         $comment = blog::submit_comment($mode, $id, $data, $cid);
         $message = $approved ? $user->lang['CMNTSUCCESS'] : $user->lang['RETURN'];
         $submessage = $approved ? $user->lang['RETURN_CMNT'] : $user->lang['RETURN'];
         $u_action = append_sid("{$phpbb_root_path}blog.{$phpEx}", array($act_name => 'view', 'id' => $id)) . '#comment' . $comment;
         meta_refresh('3', $u_action);
         trigger_error($message . '<BR /><BR /><a href="' . $u_action . '">' . $submessage . '</a>');