本文整理汇总了PHP中generate_quickjump_cache函数的典型用法代码示例。如果您正苦于以下问题:PHP generate_quickjump_cache函数的具体用法?PHP generate_quickjump_cache怎么用?PHP generate_quickjump_cache使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了generate_quickjump_cache函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit_categories
public function edit_categories()
{
global $lang_common, $lang_admin_common, $lang_admin_categories;
if ($this->user->g_id != FEATHER_ADMIN) {
message($lang_common['No permission'], '403');
}
// Load the admin_options.php language file
require FEATHER_ROOT . 'include/common_admin.php';
require FEATHER_ROOT . 'lang/' . $admin_language . '/categories.php';
if (empty($this->request->post('cat'))) {
message($lang_common['Bad request'], '404');
}
$categories = array();
foreach ($this->request->post('cat') as $cat_id => $properties) {
$category = array('id' => (int) $cat_id, 'name' => feather_escape($properties['name']), 'order' => (int) $properties['order']);
if ($category['name'] == '') {
redirect(get_link('admin/categories/'), $lang_admin_categories['Must enter name message']);
}
$this->model->update_category($category);
}
// Regenerate the quick jump cache
if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
require FEATHER_ROOT . 'include/cache.php';
}
generate_quickjump_cache();
redirect(get_link('admin/categories/'), $lang_admin_categories['Categories updated redirect']);
}
示例2: ob_start
}
// START SUBST - <!-- forum_about -->
ob_start();
($hook = get_hook('ft_about_output_start')) ? eval($hook) : null;
// Display the "Jump to" drop list
if ($forum_user['g_read_board'] == '1' && $forum_config['o_quickjump'] == '1') {
($hook = get_hook('ft_about_pre_quickjump')) ? eval($hook) : null;
// Load cached quickjump
if (file_exists(FORUM_CACHE_DIR . 'cache_quickjump_' . $forum_user['g_id'] . '.php')) {
include FORUM_CACHE_DIR . 'cache_quickjump_' . $forum_user['g_id'] . '.php';
}
if (!defined('FORUM_QJ_LOADED')) {
if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
require FORUM_ROOT . 'include/cache.php';
}
generate_quickjump_cache($forum_user['g_id']);
require FORUM_CACHE_DIR . 'cache_quickjump_' . $forum_user['g_id'] . '.php';
}
}
($hook = get_hook('ft_about_pre_copyright')) ? eval($hook) : null;
?>
<p id="copyright">Ishare+, Forum Board © December 2012. Integrated by <a href="http://hik3.net">hik3studio</a>. Powered by <a href="http://mpp.eng.usm.my/sharers/team.php">Ishare Technology Team</a>. All rights reserved.</p>
<?php
($hook = get_hook('ft_about_end')) ? eval($hook) : null;
$tpl_temp = forum_trim(ob_get_contents());
$tpl_main = str_replace('<!-- forum_about -->', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST - <!-- forum_about -->
// START SUBST - <!-- forum_debug -->
if (defined('FORUM_DEBUG') || defined('FORUM_SHOW_QUERIES')) {
ob_start();
示例3: generate_quickjump_cache
}
// Regenerate the quick jump cache
if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
require PUN_ROOT . 'include/cache.php';
}
generate_quickjump_cache();
redirect('admin_forums.php', $lang_admin_forums['Forum updated redirect']);
} else {
if (isset($_POST['revert_perms'])) {
confirm_referrer('admin_forums.php');
$db->query('DELETE FROM ' . $db->prefix . 'forum_perms WHERE forum_id=' . $forum_id) or error('Unable to delete group forum permissions', __FILE__, __LINE__, $db->error());
// Regenerate the quick jump cache
if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
require PUN_ROOT . 'include/cache.php';
}
generate_quickjump_cache();
redirect('admin_forums.php?edit_forum=' . $forum_id, $lang_admin_forums['Perms reverted redirect']);
}
}
// Fetch forum info
$result = $db->query('SELECT id, forum_name, forum_desc, redirect_url, num_topics, sort_by, cat_id FROM ' . $db->prefix . 'forums WHERE id=' . $forum_id) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());
if (!$db->num_rows($result)) {
message($lang_common['Bad request'], false, '404 Not Found');
}
$cur_forum = $db->fetch_assoc($result);
$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Forums']);
define('PUN_ACTIVE_PAGE', 'admin');
require PUN_ROOT . 'header.php';
generate_admin_menu('forums');
?>
<div class="blockform">
示例4: generate_quickjump_cache
} else {
if ($pun_user['g_search'] == '1') {
echo "\n\t\t\t" . '<dl id="searchlinks" class="conl">' . "\n\t\t\t\t" . '<dt><strong>' . $lang_common['Search links'] . '</strong></dt><dd><a href="search.php?action=show_24h">' . $lang_common['Show recent posts'] . '</a></dd>' . "\n";
echo "\t\t\t\t" . '<dd><a href="search.php?action=show_unanswered">' . $lang_common['Show unanswered posts'] . '</a></dd>' . "\n\t\t\t" . '</dl>' . "\n";
}
}
} else {
if ($footer_style == 'viewforum' || $footer_style == 'viewtopic') {
echo "\n\t\t\t" . '<div class="conl">' . "\n";
// Display the "Jump to" drop list
if ($pun_config['o_quickjump'] == '1') {
// Load cached quickjump
@(include PUN_ROOT . 'cache/cache_quickjump_' . $pun_user['g_id'] . '.php');
if (!defined('PUN_QJ_LOADED')) {
require_once PUN_ROOT . 'include/cache.php';
generate_quickjump_cache($pun_user['g_id']);
require PUN_ROOT . 'cache/cache_quickjump_' . $pun_user['g_id'] . '.php';
}
}
if ($footer_style == 'viewforum' && $is_admmod) {
echo "\t\t\t" . '<p id="modcontrols"><a href="moderate.php?fid=' . $forum_id . '&p=' . $p . '">' . $lang_common['Moderate forum'] . '</a></p>' . "\n";
} else {
if ($footer_style == 'viewtopic' && $is_admmod) {
echo "\t\t\t" . '<dl id="modcontrols"><dt><strong>' . $lang_topic['Mod controls'] . '</strong></dt><dd><a href="moderate.php?fid=' . $forum_id . '&tid=' . $id . '&p=' . $p . '">' . $lang_common['Delete posts'] . '</a></dd>' . "\n";
echo "\t\t\t" . '<dd><a href="moderate.php?fid=' . $forum_id . '&move_topics=' . $id . '">' . $lang_common['Move topic'] . '</a></dd>' . "\n";
if ($cur_topic['closed'] == '1') {
echo "\t\t\t" . '<dd><a href="moderate.php?fid=' . $forum_id . '&open=' . $id . '">' . $lang_common['Open topic'] . '</a></dd>' . "\n";
} else {
echo "\t\t\t" . '<dd><a href="moderate.php?fid=' . $forum_id . '&close=' . $id . '">' . $lang_common['Close topic'] . '</a></dd>' . "\n";
}
if ($cur_topic['sticky'] == '1') {
示例5: generate_quickjump_cache
}
?>
<div id="brdfooternav" class="inbox">
<?php
echo "\t\t\t" . '<div class="conl">' . "\n";
// Display the "Jump to" drop list
if ($feather_config['o_quickjump'] == '1') {
// Load cached quick jump
if (file_exists(FORUM_CACHE_DIR . 'cache_quickjump_' . $feather->user->g_id . '.php')) {
include FORUM_CACHE_DIR . 'cache_quickjump_' . $feather->user->g_id . '.php';
}
if (!defined('FEATHER_QJ_LOADED')) {
if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
require FEATHER_ROOT . 'include/cache.php';
}
generate_quickjump_cache($feather->user->g_id);
require FORUM_CACHE_DIR . 'cache_quickjump_' . $feather->user->g_id . '.php';
}
}
echo "\t\t\t" . '</div>' . "\n";
?>
<div class="conr">
<?php
if ($footer_style == 'index') {
if ($feather_config['o_feed_type'] == '1') {
echo "\t\t\t\t" . '<p id="feedlinks"><span class="rss"><a href="' . get_base_url() . '/extern.php?action=feed&type=rss">' . $lang_common['RSS active topics feed'] . '</a></span></p>' . "\n";
} elseif ($feather_config['o_feed_type'] == '2') {
echo "\t\t\t\t" . '<p id="feedlinks"><span class="atom"><a href="' . get_base_url() . '/extern.php?action=feed&type=atom">' . $lang_common['Atom active topics feed'] . '</a></span></p>' . "\n";
}
} elseif ($footer_style == 'viewforum') {
if ($feather_config['o_feed_type'] == '1') {
示例6: get_extensions
}
}
($hook = get_extensions('footer_moderator_controls')) ? eval($hook) : null;
}
// Display the "Jump to" drop list
if ($panther_config['o_quickjump'] == '1') {
ob_start();
// Load cached quick jump
if (file_exists(FORUM_CACHE_DIR . 'cache_quickjump_' . $panther_user['g_id'] . '.php')) {
require FORUM_CACHE_DIR . 'cache_quickjump_' . $panther_user['g_id'] . '.php';
}
if (!defined('PANTHER_QJ_LOADED')) {
if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
require PANTHER_ROOT . 'include/cache.php';
}
generate_quickjump_cache($panther_user['g_id']);
require FORUM_CACHE_DIR . 'cache_quickjump_' . $panther_user['g_id'] . '.php';
}
$quickjump_tpl = trim(ob_get_contents());
ob_end_clean();
} else {
$quickjump_tpl = '';
}
$feed = array();
if (isset($footer_style) && $footer_style == 'warnings') {
$links[] = array('url' => panther_link($panther_url['warnings']), 'lang' => $lang_warnings['Show warning types']);
if ($panther_user['is_admmod']) {
$links[] = array('url' => panther_link($panther_url['warnings_recent']), 'lang' => $lang_warnings['Show recent warnings']);
}
($hook = get_extensions('footer_warnings')) ? eval($hook) : null;
} elseif (isset($footer_style) && ($footer_style == 'index' || $footer_style == 'viewforum' || $footer_style == 'viewtopic') && ($panther_config['o_feed_type'] == '1' || $panther_config['o_feed_type'] == '2')) {
示例7: generate_cache
/**
* Regenerate FluxBB cache after conversion
*/
function generate_cache()
{
// Load the cache script
require_once PUN_ROOT . 'include/cache.php';
// Generate cache
generate_config_cache();
generate_bans_cache();
generate_quickjump_cache();
generate_censoring_cache();
generate_users_info_cache();
clear_feed_cache();
}
示例8: intval
$result = $db->query('SELECT 1 FROM ' . $db->prefix . 'groups WHERE g_title=\'' . $db->escape($title) . '\' AND g_id!=' . intval($_POST['group_id'])) or error('Unable to check group title collision', __FILE__, __LINE__, $db->error());
if ($db->num_rows($result)) {
message(sprintf($lang_admin_groups['Title already exists message'], pun_htmlspecialchars($title)));
}
$db->query('UPDATE ' . $db->prefix . 'groups SET g_title=\'' . $db->escape($title) . '\', g_user_title=' . $user_title . ', g_promote_min_posts=' . $promote_min_posts . ', g_promote_next_group=' . $promote_next_group . ', g_moderator=' . $moderator . ', g_mod_edit_users=' . $mod_edit_users . ', g_mod_rename_users=' . $mod_rename_users . ', g_mod_change_passwords=' . $mod_change_passwords . ', g_mod_ban_users=' . $mod_ban_users . ', g_mod_promote_users=' . $mod_promote_users . ', g_read_board=' . $read_board . ', g_view_users=' . $view_users . ', g_post_replies=' . $post_replies . ', g_post_topics=' . $post_topics . ', g_edit_posts=' . $edit_posts . ', g_delete_posts=' . $delete_posts . ', g_delete_topics=' . $delete_topics . ', g_post_links=' . $post_links . ', g_set_title=' . $set_title . ', g_search=' . $search . ', g_search_users=' . $search_users . ', g_send_email=' . $send_email . ', g_post_flood=' . $post_flood . ', g_search_flood=' . $search_flood . ', g_email_flood=' . $email_flood . ', g_report_flood=' . $report_flood . ' WHERE g_id=' . intval($_POST['group_id'])) or error('Unable to update group', __FILE__, __LINE__, $db->error());
// Promote all users who would be promoted to this group on their next post
if ($promote_next_group) {
$db->query('UPDATE ' . $db->prefix . 'users SET group_id = ' . $promote_next_group . ' WHERE group_id = ' . intval($_POST['group_id']) . ' AND num_posts >= ' . $promote_min_posts) or error('Unable to auto-promote existing users', __FILE__, __LINE__, $db->error());
}
}
// Regenerate the quick jump cache
if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
require PUN_ROOT . 'include/cache.php';
}
$group_id = $_POST['mode'] == 'add' ? $new_group_id : intval($_POST['group_id']);
generate_quickjump_cache($group_id);
if ($_POST['mode'] == 'edit') {
redirect('admin_groups.php', $lang_admin_groups['Group edited redirect']);
} else {
redirect('admin_groups.php', $lang_admin_groups['Group added redirect']);
}
} else {
if (isset($_POST['set_default_group'])) {
confirm_referrer('admin_groups.php');
$group_id = intval($_POST['default_group']);
// Make sure it's not the admin or guest groups
if ($group_id == PUN_ADMIN || $group_id == PUN_GUEST) {
message($lang_common['Bad request'], false, '404 Not Found');
}
// Make sure it's not a moderator group
if ($groups[$group_id]['g_moderator'] != 0) {
示例9: add_edit_group
public function add_edit_group($groups)
{
global $lang_admin_groups;
if ($this->request->post('group_id')) {
$group_id = $this->request->post('group_id');
} else {
$group_id = 0;
}
// Is this the admin group? (special rules apply)
$is_admin_group = $this->request->post('group_id') && $this->request->post('group_id') == FEATHER_ADMIN ? true : false;
$title = feather_trim($this->request->post('req_title'));
$user_title = feather_trim($this->request->post('user_title'));
$promote_min_posts = $this->request->post('promote_min_posts') ? intval($this->request->post('promote_min_posts')) : '0';
if ($this->request->post('promote_next_group') && isset($groups[$this->request->post('promote_next_group')]) && !in_array($this->request->post('promote_next_group'), array(FEATHER_ADMIN, FEATHER_GUEST)) && ($this->request->post('group_id') || $this->request->post('promote_next_group') != $this->request->post('group_id'))) {
$promote_next_group = $this->request->post('promote_next_group');
} else {
$promote_next_group = '0';
}
$moderator = $this->request->post('moderator') && $this->request->post('moderator') == '1' ? '1' : '0';
$mod_edit_users = $moderator == '1' && $this->request->post('mod_edit_users') == '1' ? '1' : '0';
$mod_rename_users = $moderator == '1' && $this->request->post('mod_rename_users') == '1' ? '1' : '0';
$mod_change_passwords = $moderator == '1' && $this->request->post('mod_change_passwords') == '1' ? '1' : '0';
$mod_ban_users = $moderator == '1' && $this->request->post('mod_ban_users') == '1' ? '1' : '0';
$mod_promote_users = $moderator == '1' && $this->request->post('mod_promote_users') == '1' ? '1' : '0';
$read_board = $this->request->post('read_board') == 0 ? $this->request->post('read_board') : '1';
$view_users = $this->request->post('view_users') && $this->request->post('view_users') == '1' || $is_admin_group ? '1' : '0';
$post_replies = $this->request->post('post_replies') == 0 ? $this->request->post('post_replies') : '1';
$post_topics = $this->request->post('post_topics') == 0 ? $this->request->post('post_topics') : '1';
$edit_posts = $this->request->post('edit_posts') == 0 ? $this->request->post('edit_posts') : $is_admin_group ? '1' : '0';
$delete_posts = $this->request->post('delete_posts') == 0 ? $this->request->post('delete_posts') : $is_admin_group ? '1' : '0';
$delete_topics = $this->request->post('delete_topics') == 0 ? $this->request->post('delete_topics') : $is_admin_group ? '1' : '0';
$post_links = $this->request->post('post_links') == 0 ? $this->request->post('post_links') : '1';
$set_title = $this->request->post('set_title') == 0 ? $this->request->post('set_title') : $is_admin_group ? '1' : '0';
$search = $this->request->post('search') == 0 ? $this->request->post('search') : '1';
$search_users = $this->request->post('search_users') == 0 ? $this->request->post('search_users') : '1';
$send_email = $this->request->post('send_email') && $this->request->post('send_email') == '1' || $is_admin_group ? '1' : '0';
$post_flood = $this->request->post('post_flood') && $this->request->post('post_flood') >= 0 ? $this->request->post('post_flood') : '0';
$search_flood = $this->request->post('search_flood') && $this->request->post('search_flood') >= 0 ? $this->request->post('search_flood') : '0';
$email_flood = $this->request->post('email_flood') && $this->request->post('email_flood') >= 0 ? $this->request->post('email_flood') : '0';
$report_flood = $this->request->post('report_flood') >= 0 ? $this->request->post('report_flood') : '0';
if ($title == '') {
message($lang_admin_groups['Must enter title message']);
}
$user_title = $user_title != '' ? $user_title : 'NULL';
$insert_update_group = array('g_title' => $title, 'g_user_title' => $user_title, 'g_promote_min_posts' => $promote_min_posts, 'g_promote_next_group' => $promote_next_group, 'g_moderator' => $moderator, 'g_mod_edit_users' => $mod_edit_users, 'g_mod_rename_users' => $mod_rename_users, 'g_mod_change_passwords' => $mod_change_passwords, 'g_mod_ban_users' => $mod_ban_users, 'g_mod_promote_users' => $mod_promote_users, 'g_read_board' => $read_board, 'g_view_users' => $view_users, 'g_post_replies' => $post_replies, 'g_post_topics' => $post_topics, 'g_edit_posts' => $edit_posts, 'g_delete_posts' => $delete_posts, 'g_delete_topics' => $delete_topics, 'g_post_links' => $post_links, 'g_set_title' => $set_title, 'g_search' => $search, 'g_search_users' => $search_users, 'g_send_email' => $send_email, 'g_post_flood' => $post_flood, 'g_search_flood' => $search_flood, 'g_email_flood' => $email_flood, 'g_report_flood' => $report_flood);
if ($this->request->post('mode') == 'add') {
$title_exists = DB::for_table('groups')->where('g_title', $title)->find_one();
if ($title_exists) {
message(sprintf($lang_admin_groups['Title already exists message'], feather_escape($title)));
}
DB::for_table('groups')->create()->set($insert_update_group)->save();
$new_group_id = DB::get_db()->lastInsertId($this->feather->prefix . 'groups');
// Now lets copy the forum specific permissions from the group which this group is based on
$select_forum_perms = array('forum_id', 'read_forum', 'post_replies', 'post_topics');
$result = DB::for_table('forum_perms')->select_many($select_forum_perms)->where('group_id', $this->request->post('base_group'))->find_many();
foreach ($result as $cur_forum_perm) {
$insert_perms = array('group_id' => $new_group_id, 'forum_id' => $cur_forum_perm['forum_id'], 'read_forum' => $cur_forum_perm['read_forum'], 'post_replies' => $cur_forum_perm['post_replies'], 'post_topics' => $cur_forum_perm['post_topics']);
DB::for_table('forum_perms')->create()->set($insert_perms)->save();
}
} else {
$title_exists = DB::for_table('groups')->where('g_title', $title)->where_not_equal('g_id', $this->request->post('group_id'))->find_one();
if ($title_exists) {
message(sprintf($lang_admin_groups['Title already exists message'], feather_escape($title)));
}
DB::for_table('groups')->find_one($this->request->post('group_id'))->set($insert_update_group)->save();
// Promote all users who would be promoted to this group on their next post
if ($promote_next_group) {
DB::for_table('users')->where('group_id', $this->request->post('group_id'))->where_gte('num_posts', $promote_min_posts)->update_many('group_id', $promote_next_group);
}
}
// Regenerate the quick jump cache
if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
require FEATHER_ROOT . 'include/cache.php';
}
$group_id = $this->request->post('mode') == 'add' ? $new_group_id : $this->request->post('group_id');
generate_quickjump_cache($group_id);
if ($this->request->post('mode') == 'edit') {
redirect(get_link('admin/groups/'), $lang_admin_groups['Group edited redirect']);
} else {
redirect(get_link('admin/groups/'), $lang_admin_groups['Group added redirect']);
}
}
示例10: array
$db->update('groups', $update, 'g_id=:id', $data);
// Promote all users who would be promoted to this group on their next post
if ($promote_next_group) {
$update = array('group_id' => $promote_next_group);
$data = array(':num_posts' => $promote_min_posts, ':gid' => $group_id);
$db->update('users', $update, 'group_id=:gid AND num_posts>=:num_posts', $data);
}
}
// Regenerate the quick jump cache
if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
require PANTHER_ROOT . 'include/cache.php';
}
generate_groups_cache();
generate_config_cache();
$group_id = $_POST['mode'] == 'add' ? $new_group_id : intval($_POST['group_id']);
generate_quickjump_cache($group_id, $read_board);
$redirect_msg = $_POST['mode'] == 'edit' ? $lang_admin_groups['Group edited redirect'] : $lang_admin_groups['Group added redirect'];
redirect(panther_link($panther_url['admin_groups']), $redirect_msg);
} else {
if (isset($_POST['set_default_group'])) {
confirm_referrer(PANTHER_ADMIN_DIR . '/groups.php');
$group_id = isset($_POST['default_group']) ? intval($_POST['default_group']) : 0;
// Make sure it's not the admin or guest groups
if ($group_id == PANTHER_ADMIN || $group_id == PANTHER_GUEST) {
message($lang_common['Bad request'], false, '404 Not Found');
}
// Make sure it's not a moderator group
if ($panther_groups[$group_id]['g_moderator'] != 0) {
message($lang_common['Bad request'], false, '404 Not Found');
}
$update = array('conf_value' => $group_id);
示例11: generate_quickjump_cache
<?php
if (!defined('PUN') or !defined('PUN_ROOT')) {
exit;
}
$quickjump = @(include PUN_ROOT . 'cache/cache_quickjump_' . $forum_id . '.php');
if (!$quickjump) {
include_once PUN_ROOT . 'include/cache.php';
generate_quickjump_cache($forum_id);
$quickjump = (include PUN_ROOT . 'cache/cache_quickjump_' . $forum_id . '.php');
}
return $quickjump;
示例12: edit_positions
public function edit_positions()
{
global $lang_admin_forums;
foreach ($this->request->post('position') as $forum_id => $position) {
$position = (int) feather_trim($position);
$this->model->update_positions($forum_id, $position);
}
// Regenerate the quick jump cache
if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
require FEATHER_ROOT . 'include/cache.php';
}
generate_quickjump_cache();
redirect(get_link('admin/forums/'), $lang_admin_forums['Forums updated redirect']);
}