Ejemplo n.º 1
0
         $selected = $blog_data['blog_cat_id'] == $row['cat_id'] ? ' selected="selected"' : '';
         $template->assign_block_vars('cat', array('CAT_OPTIONS' => '<option value="' . $row['cat_id'] . '"' . $selected . '>' . utf8_normalize_nfc($row['cat_title']) . '</option>'));
     }
     decode_message($blog_data['blog_text'], $blog_data['bbcode_uid']);
     $template->assign_vars(array('TITLE' => $blog_data['blog_title'], 'TAGS' => $blog_data['blog_tags'], 'DESC' => $blog_data['blog_desc'], 'MESSAGE' => $blog_data['blog_text'], 'ALLOW_CMNT' => $blog_data['blog_allow_cmnt'] ? 'checked="checked"' : '', 'S_POSTER_ID_HIDDEN' => $user->data['user_id'], 'S_BBCODE_ALLOWED' => $bbcode, 'S_SMILIES_ALLOWED' => $emote, 'U_ACTION' => append_sid("{$phpbb_root_path}blog.{$phpEx}", array($act_name => 'edit_blog', 'id' => $blog_data['blog_id']))));
     page_header($user->lang('BLOG'));
     $template->assign_var('S_ACTION', 'edit');
     $template->set_filenames(array('body' => 'blog_post_edit_body.html'));
     page_footer();
     break;
 case 'delete_blog':
     if (!$blog_id) {
         trigger_error($user->lang['INVALID_BLOG_ID']);
     }
     if (confirm_box(true)) {
         blog::delete_blog($blog_id);
         $u_action = append_sid("{$phpbb_root_path}blog.{$phpEx}");
         meta_refresh('3', $u_action);
         trigger_error($user->lang['GENERIC_SUCCESS'] . '<BR /><BR /><a href="' . $u_action . '">' . $user->lang['RETURN'] . '</a>');
     } else {
         $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