trigger_error('REPLY_NOT_EXIST'); } // Was Cancel pressed? If so then redirect to the appropriate page if ($cancel) { blog_meta_refresh(0, $blog_urls['view_reply'], true); } // Add the language Variables for posting $user->add_lang('posting'); // check to see if editing this message is locked, or if the one editing it has mod powers if (blog_data::$reply[$reply_id]['reply_edit_locked'] && !$auth->acl_get('m_blogreplyedit')) { trigger_error('REPLY_EDIT_LOCKED'); } // Setup the page header and sent the title of the page that will go into the browser header page_header($user->lang['DELETE_REPLY']); // Generate the breadcrumbs generate_blog_breadcrumbs($user->lang['DELETE_REPLY']); blog_plugins::plugin_do('reply_delete'); $display_vars = array(); if ($auth->acl_get('a_blogdelete') && blog_data::$reply[$reply_id]['reply_deleted'] == 0) { $display_vars = array('legend1' => $user->lang['HARD_DELETE'], 'hard_delete' => array('lang' => 'HARD_DELETE', 'validate' => 'bool', 'type' => 'checkbox', 'default' => false, 'explain' => true)); } blog_plugins::plugin_do_ref('blog_delete', $display_vars); include "{$phpbb_root_path}blog/includes/functions_confirm.{$phpEx}"; $settings = blog_confirm('DELETE_REPLY', 'DELETE_REPLY_CONFIRM', $display_vars, 'yes/no'); if (is_array($settings)) { blog_plugins::plugin_do('reply_delete_confirm'); // if it has already been soft deleted if ((isset($settings['hard_delete']) && $settings['hard_delete'] || blog_data::$reply[$reply_id]['reply_deleted'] != 0) && $auth->acl_get('a_blogreplydelete')) { // If it has not been soft deleted we need to do a few more things... if (blog_data::$reply[$reply_id]['reply_deleted'] == 0) { // Remove the search index
exit; } // If they did not include the $blog_id give them an error... if ($blog_id == 0) { trigger_error('BLOG_NOT_EXIST'); } // Add the language Variables for posting $user->add_lang('posting'); // check to see if editing this message is locked, or if the one editing it has mod powers if (blog_data::$blog[$blog_id]['blog_edit_locked'] && !$auth->acl_get('m_blogedit')) { trigger_error('BLOG_EDIT_LOCKED'); } // Setup the page header and sent the title of the page that will go into the browser header page_header($user->lang['EDIT_BLOG']); // Generate the breadcrumbs generate_blog_breadcrumbs($user->lang['EDIT_BLOG']); // Posting permissions $post_options = new post_options(); blog_plugins::plugin_do('blog_edit_start'); $category_ary = request_var('category', array(0)); // Polls $blog_data->get_polls($blog_id); $poll_option_text = $original_poll_text = ''; $poll_options = array(); foreach (blog_data::$blog[$blog_id]['poll_options'] as $row) { $poll_option_text .= $row['poll_option_text'] . "\n"; $poll_options[] = $row['poll_option_text']; } decode_message($poll_option_text, blog_data::$blog[$blog_id]['bbcode_uid']); $original_poll_text = $poll_option_text; if ($submit || $preview || $refresh) {
$blog_ids[] = $row['blog_id']; } $db->sql_freeresult($result); $total = sizeof($users); $last_blogs = array(); if (sizeof($blog_ids)) { $sql = 'SELECT * FROM ' . BLOGS_TABLE . ' WHERE ' . $db->sql_in_set('blog_id', $blog_ids); $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $last_blogs[$row['blog_id']] = $row; } $db->sql_freeresult($result); } gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param); $pagination = generate_blog_pagination($blog_urls['start_zero'], $total, $limit, $start, false); generate_blog_breadcrumbs($user->lang['USERLIST']); // Generate the left menu generate_menu(); page_header($user->lang['BLOG'] . ' ' . $user->lang['USERLIST']); // Output some data $template->assign_vars(array('FOLDER_IMG' => $user->img('forum_read', ''), 'FORUM_FOLDER_IMG_SRC' => $user->img('forum_read', '', false, '', 'src'), 'PAGINATION' => $pagination, 'PAGE_NUMBER' => on_page($total, $limit, $start), 'TOTAL_POSTS' => $total == 1 ? $user->lang['ONE_BLOG'] : sprintf($user->lang['CNT_BLOGS'], $total), 'S_SORT' => true, 'S_SELECT_SORT_DIR' => $s_sort_dir, 'S_SELECT_SORT_KEY' => $s_sort_key, 'S_SELECT_SORT_DAYS' => $s_limit_days)); unset($pagination); $i = -1; foreach ($users as $row) { $i++; if ($i < $start) { continue; } else { if ($i >= $start + $limit) { break; }
$category_list = get_blog_categories('category_id'); if (!isset($category_list[$category_id])) { trigger_error('NO_CATEGORY'); } } else { // Generate the left menu generate_menu($user_id); } // if the blog was deleted and the person trying to view the blog is not a moderator that can view deleted blogs, give them a nice error. :P if (blog_data::$blog[$blog_id]['blog_deleted'] != 0 && blog_data::$blog[$blog_id]['blog_deleted'] != $user->data['user_id'] && !$auth->acl_get('m_blogdelete') && !$auth->acl_get('a_blogdelete')) { trigger_error('BLOG_NOT_EXIST'); } // Add the language Variables for viewtopic $user->add_lang('viewtopic'); // Generate the breadcrumbs, setup the page header, and setup some variables we will use... generate_blog_breadcrumbs(); page_header(blog_data::$blog[$blog_id]['blog_subject']); $sort_days = request_var('st', !empty($user->data['user_post_show_days']) ? $user->data['user_post_show_days'] : 0); $sort_key = request_var('sk', 't'); $sort_dir = request_var('sd', 'a'); $limit_days = array(0 => $user->lang['ALL_POSTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']); $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = ''; $order_dir = $sort_dir == 'a' ? 'ASC' : 'DESC'; $sort_by_text = array('t' => $user->lang['POST_TIME']); $sort_by_sql = array('t' => 'blog_time'); $total_replies = $blog_data->get_reply_data('reply_count', $blog_id, array('sort_days' => $sort_days)); // Get the reply data if we need to if ($total_replies > 0) { $reply_ids = $blog_data->get_reply_data('blog', $blog_id, array('start' => $start, 'limit' => $limit, 'order_dir' => $order_dir, 'sort_days' => $sort_days)); $blog_data->get_user_data(false, true); update_edit_delete('reply');
exit; } // If they did not include the $blog_id give them an error... if ($blog_id == 0) { trigger_error('BLOG_NOT_EXIST'); } // Was Cancel pressed? If so then redirect to the appropriate page if ($cancel) { blog_meta_refresh(0, $blog_urls['view_blog'], true); } // Add the language Variables for posting $user->add_lang('posting'); // Setup the page header and sent the title of the page that will go into the browser header page_header($user->lang['APPROVE_BLOG']); // Generate the breadcrumbs generate_blog_breadcrumbs($user->lang['APPROVE_BLOG']); blog_plugins::plugin_do('blog_approve'); if (blog_data::$blog[$blog_id]['blog_approved'] == 0) { if (confirm_box(true)) { blog_plugins::plugin_do('blog_approve_confirm'); $sql = 'UPDATE ' . BLOGS_TABLE . ' SET blog_approved = 1 WHERE blog_id = ' . intval($blog_id); $db->sql_query($sql); // Update the blog_count for the user $sql = 'UPDATE ' . USERS_TABLE . ' SET blog_count = blog_count + 1 WHERE user_id = ' . intval($user_id); $db->sql_query($sql); set_config('num_blogs', ++$config['num_blogs'], true); // Update the blog_count for all the categories it is in. $category_ids = array(); $sql = 'SELECT category_id FROM ' . BLOGS_IN_CATEGORIES_TABLE . ' WHERE blog_id = ' . intval($blog_id);
<?php /** * * @package phpBB3 User Blog * @version $Id: search.php 485 2008-08-15 23:33:57Z exreaction@gmail.com $ * @copyright (c) 2008 EXreaction * @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ if (!defined('IN_PHPBB')) { exit; } // Generate the breadcrumbs generate_blog_breadcrumbs($user->lang['SEARCH_BLOGS'], blog_url(false, false, false, array('page' => 'search'))); page_header($user->lang['SEARCH_BLOGS']); $user->add_lang(array('search', 'mods/blog/view')); // Is user able to search? Has search been disabled? if (!$auth->acl_get('u_search') || !$auth->acl_getf_global('f_search') || !$config['load_search']) { $template->assign_var('S_NO_SEARCH', true); trigger_error('NO_SEARCH'); } // Check search load limit if ($user->load && $config['limit_search_load'] && $user->load > doubleval($config['limit_search_load'])) { $template->assign_var('S_NO_SEARCH', true); trigger_error('NO_SEARCH_TIME'); } $keywords = request_var('keywords', '', true); $author = request_var('author', '', true); $terms = request_var('terms', 'all'); $sf = request_var('sf', '');
* @version $Id: unsubscribe.php 485 2008-08-15 23:33:57Z exreaction@gmail.com $ * @copyright (c) 2008 EXreaction * @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ if (!defined('IN_PHPBB')) { exit; } if (!$config['user_blog_subscription_enabled']) { blog_meta_refresh(0, $blog_urls['main'], true); } $subscribe_mode = request_var('post', '', true); // generate the header page_header($user->lang['UNSUBSCRIBE']); // Generate the breadcrumbs generate_blog_breadcrumbs($user->lang['UNSUBSCRIBE']); blog_plugins::plugin_do('unsubscribe_start'); if ($blog_id != 0) { if (!$subscribed) { trigger_error('NOT_SUBSCRIBED'); } if (confirm_box(true)) { blog_plugins::plugin_do('unsubscribe_confirm'); $sql = 'DELETE FROM ' . BLOGS_SUBSCRIPTION_TABLE . ' WHERE sub_user_id = ' . $user->data['user_id'] . ' AND blog_id = ' . intval($blog_id); $db->sql_query($sql); //$cache->destroy("_blog_subscription_{$user_id}"); $template->assign_vars(array('S_WATCH_FORUM_TITLE' => $user->lang['SUBSCRIBE_BLOG'], 'S_WATCH_FORUM_LINK' => $blog_urls['subscribe'], 'S_WATCHING_FORUM' => false)); $message = $user->lang['SUBSCRIPTION_REMOVED'] . '<br /><br />'; $message .= '<a href="' . $blog_urls['view_blog'] . '">' . $user->lang['VIEW_BLOG'] . '</a><br />';
// If they did not include the $blog_id give them an error... if ($blog_id == 0) { trigger_error('BLOG_NOT_EXIST'); } // Was Cancel pressed? If so then redirect to the appropriate page if ($cancel) { blog_meta_refresh(0, $blog_urls['view_blog'], true); } // check to see if editing this message is locked, or if the one editing it has mod powers if (blog_data::$blog[$blog_id]['blog_edit_locked'] && !$auth->acl_get('m_blogedit')) { trigger_error('BLOG_EDIT_LOCKED'); } // Setup the page header and sent the title of the page that will go into the browser header page_header($user->lang['DELETE_BLOG']); // Generate the breadcrumbs generate_blog_breadcrumbs($user->lang['DELETE_BLOG']); if (blog_data::$blog[$blog_id]['blog_deleted'] != 0 && !$auth->acl_get('a_blogdelete')) { trigger_error('BLOG_ALREADY_DELETED'); } $display_vars = array(); if ($auth->acl_get('a_blogdelete') && blog_data::$blog[$blog_id]['blog_deleted'] == 0) { $display_vars = array('legend1' => $user->lang['HARD_DELETE'], 'hard_delete' => array('lang' => 'HARD_DELETE', 'validate' => 'bool', 'type' => 'checkbox', 'default' => false, 'explain' => true)); } blog_plugins::plugin_do_ref('blog_delete', $display_vars); include "{$phpbb_root_path}blog/includes/functions_confirm.{$phpEx}"; $settings = blog_confirm('DELETE_BLOG', 'DELETE_BLOG_CONFIRM', $display_vars, 'yes/no'); if (is_array($settings)) { blog_plugins::plugin_do('blog_delete_confirm'); // if it has already been soft deleted, and we want to hard delete it if ((isset($settings['hard_delete']) && $settings['hard_delete'] || blog_data::$blog[$blog_id]['blog_deleted'] != 0) && $auth->acl_get('a_blogdelete')) { // They selected the hard delete checkbox...so we must do a few things.
<?php /** * * @package phpBB3 User Blog * @version $Id: resync.php 485 2008-08-15 23:33:57Z exreaction@gmail.com $ * @copyright (c) 2008 EXreaction * @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ if (!defined('IN_PHPBB')) { exit; } // Setup the page header and sent the title of the page that will go into the browser header page_header($user->lang['RESYNC_BLOG']); // Generate the breadcrumbs generate_blog_breadcrumbs($user->lang['RESYNC_BLOG']); if (confirm_box(true)) { include $phpbb_root_path . 'blog/includes/functions_admin.' . $phpEx; resync_blog('all'); $message = $user->lang['RESYNC_BLOG_SUCCESS'] . '<br /><br />'; $message .= sprintf($user->lang['RETURN_MAIN'], '<a href="' . append_sid("{$phpbb_root_path}blog.{$phpEx}") . '">', '</a>'); trigger_error($message); } else { confirm_box(false, 'RESYNC_BLOG'); } blog_meta_refresh(0, append_sid("{$phpbb_root_path}blog.{$phpEx}"));
exit; } // If they did not include the $reply_id give them an error... if ($reply_id == 0) { trigger_error('REPLY_NOT_EXIST'); } // Add the language Variables for posting $user->add_lang('posting'); // check to see if editing this message is locked, or if the one editing it has mod powers if (blog_data::$reply[$reply_id]['reply_edit_locked'] && !$auth->acl_get('m_blogreplyedit')) { trigger_error('REPLY_EDIT_LOCKED'); } // Setup the page header and sent the title of the page that will go into the browser header page_header($user->lang['EDIT_REPLY']); // Generate the breadcrumbs generate_blog_breadcrumbs($user->lang['EDIT_REPLY']); // Posting permissions $post_options = new post_options(); blog_plugins::plugin_do('reply_edit_start'); // If they select edit mode and didn't submit or hit preview(means they came directly from the view reply page) if (!$submit && !$preview && !$refresh) { // Setup the message so we can import it to the edit page $reply_subject = blog_data::$reply[$reply_id]['reply_subject']; $reply_text = blog_data::$reply[$reply_id]['reply_text']; decode_message($reply_text, blog_data::$reply[$reply_id]['bbcode_uid']); $post_options->set_status(blog_data::$reply[$reply_id]['enable_bbcode'], blog_data::$reply[$reply_id]['enable_smilies'], blog_data::$reply[$reply_id]['enable_magic_url']); // Attachments $blog_attachment->get_attachment_data(false, $reply_id); $blog_attachment->attachment_data = blog_data::$reply[$reply_id]['attachment_data']; } else { // so we can check if they did edit any text when they hit submit
<?php /** * * @package phpBB3 User Blog * @version $Id: upgrade.php 485 2008-08-15 23:33:57Z exreaction@gmail.com $ * @copyright (c) 2008 EXreaction * @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ if (!defined('IN_PHPBB')) { exit; } $user->add_lang(array('install', 'posting')); generate_blog_urls(); generate_blog_breadcrumbs($user->lang['UPGRADE_BLOGS'], append_sid("{$phpbb_root_path}blog.{$phpEx}", 'page=upgrade')); page_header($user->lang['UPGRADE_BLOGS']); include $phpbb_root_path . 'blog/upgrade/upgrade.' . $phpEx; include $phpbb_root_path . 'blog/upgrade/functions.' . $phpEx; include $phpbb_root_path . 'includes/message_parser.' . $phpEx; include $phpbb_root_path . 'includes/functions_install.' . $phpEx; $blog_upgrade = new blog_upgrade(); $stage = request_var('stage', 0); $section = request_var('section', 0); $part = request_var('part', 0); $error = array(); $part_cnt = $section_cnt = 0; $message = ''; $stages = array($user->lang['UPGRADE_LIST'], $user->lang['OPTIONS'], $user->lang['CONFIRM'], $user->lang['CLEANUP'], $user->lang['CONVERT'], $user->lang['REINDEX'], $user->lang['RESYNC'], $user->lang['FINAL']); if ($stage >= 2) { $blog_upgrade->confirm_upgrade_options($mode, $error);
exit; } // If they did not include the $blog_id give them an error... if ($blog_id == 0) { trigger_error('BLOG_NOT_EXIST'); } // Was Cancel pressed? If so then redirect to the appropriate page if ($cancel) { blog_meta_refresh(0, $blog_urls['view_blog'], true); } // add the mcp language file $user->add_lang('mcp'); // Setup the page header and sent the title of the page that will go into the browser header page_header($user->lang['REPORT_BLOG']); // Generate the breadcrumbs generate_blog_breadcrumbs($user->lang['REPORT_BLOG']); blog_plugins::plugin_do('blog_report_start'); // To close the reports if (blog_data::$blog[$blog_id]['blog_reported'] && $auth->acl_get('m_blogreport')) { if (confirm_box(true)) { blog_plugins::plugin_do('blog_report_confirm'); $sql = 'UPDATE ' . BLOGS_TABLE . ' SET blog_reported = 0 WHERE blog_id = ' . intval($blog_id); $db->sql_query($sql); handle_blog_cache('report_blog', $user_id); blog_meta_refresh(3, $blog_urls['view_blog']); $message = $user->lang['REPORT_CLOSED_SUCCESS']; $message .= '<br /><br /><a href="' . $blog_urls['view_blog'] . '">' . $user->lang['VIEW_BLOG'] . '</a>'; trigger_error($message); } else {
} // If they did not include the $reply_id give them an error... if ($reply_id == 0) { trigger_error('REPLY_NOT_EXIST'); } // Was Cancel pressed? If so then redirect to the appropriate page if ($cancel) { blog_meta_refresh(0, $blog_urls['view_reply'], true); } // Add the language Variables for posting $user->add_lang('posting'); // Setup the page header and sent the title of the page that will go into the browser header page_header($user->lang['APPROVE_REPLY']); blog_plugins::plugin_do('reply_approve'); // Generate the breadcrumbs generate_blog_breadcrumbs($user->lang['APPROVE_REPLY']); if (blog_data::$reply[$reply_id]['reply_approved'] == 0) { if (confirm_box(true)) { blog_plugins::plugin_do('reply_approve_confirm'); $sql = 'UPDATE ' . BLOGS_REPLY_TABLE . ' SET reply_approved = 1 WHERE reply_id = ' . intval($reply_id); $db->sql_query($sql); // update the reply count for the blog $sql = 'UPDATE ' . BLOGS_TABLE . ' SET blog_reply_count = blog_reply_count + 1 WHERE blog_id = ' . intval($blog_id); $db->sql_query($sql); set_config('num_blog_replies', ++$config['num_blog_replies'], true); handle_subscription('new_reply', censor_text(blog_data::$reply[$reply_id]['reply_subject']), 0, 0, $reply_id); handle_blog_cache('approve_reply', $user_id); blog_meta_refresh(3, $blog_urls['view_reply']); $message = $user->lang['APPROVE_REPLY_SUCCESS'] . '<br /><br />';