• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP garbage_collection函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中garbage_collection函数的典型用法代码示例。如果您正苦于以下问题:PHP garbage_collection函数的具体用法?PHP garbage_collection怎么用?PHP garbage_collection使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了garbage_collection函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: main

    function main($id, $mode)
    {
        global $db, $user, $phpbb_root_path, $config, $phpEx;
        // Do we have an id? No, then just exit
        $confirm_id = request_var('id', '');
        $type = request_var('type', 0);
        if (!$confirm_id || !$type) {
            exit;
        }
        // Try and grab code for this id and session
        $sql = 'SELECT code, seed
			FROM ' . CONFIRM_TABLE . "\n\t\t\tWHERE session_id = '" . $db->sql_escape($user->session_id) . "'\n\t\t\t\tAND confirm_id = '" . $db->sql_escape($confirm_id) . "'\n\t\t\t\tAND confirm_type = {$type}";
        $result = $db->sql_query($sql);
        $row = $db->sql_fetchrow($result);
        $db->sql_freeresult($result);
        // If we have a row then grab data else create a new id
        if (!$row) {
            exit;
        }
        if ($config['captcha_gd']) {
            include $phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx;
        } else {
            include $phpbb_root_path . 'includes/captcha/captcha_non_gd.' . $phpEx;
        }
        $captcha = new captcha();
        $captcha->execute($row['code'], $row['seed']);
        garbage_collection();
        exit_handler();
    }
开发者ID:BackupTheBerlios,项目名称:phpbb-hu-svn,代码行数:29,代码来源:ucp_confirm.php


示例2: kleeja_admin_err

/**
 * Print admin area errors
 *
 * @param string $msg The message of error
 * @param bool $navigation [optional] Show the side mneu or not
 * @param string $title [optional] The title of the error
 * @param bool $exit [optional] halt after showing the error
 * @param bool|string $redirect [optional] if link given it will redirected to it after $rs seconds
 * @param int $rs [optional] if $redirected is given and not false, this will be the time in seconds
 * @param string $style [optional] this is just here to use it inside kleeja_admin_info to use admin_info
 */
function kleeja_admin_err($msg, $navigation = true, $title = '', $exit = true, $redirect = false, $rs = 5, $style = 'error.php')
{
    global $text, $tpl, $SHOW_LIST, $adm_extensions, $adm_extensions_menu;
    global $STYLE_PATH_ADMIN, $lang, $plugin, $SQL, $MINI_MENU;
    ($hook = $plugin->run_hook('kleeja_admin_err_func')) ? eval($hook) : null;
    //run hook
    #Exception for ajax
    if (isset($_GET['_ajax_'])) {
        $text = $msg . ($redirect ? "\n" . '<script type="text/javascript"> setTimeout("location.href=\'' . str_replace('&amp;', '&', $redirect) . '\';", ' . $rs * 1000 . ');</script>' : '');
        echo_ajax(1, $tpl->display($style));
        $SQL->close();
        exit;
    }
    #assign {text} in err template
    $text = $msg . ($redirect != false ? redirect($redirect, false, false, $rs, true) : '');
    $SHOW_LIST = $navigation;
    #header
    include get_template_path('header.php');
    #show tpl
    include get_template_path($style);
    #footer
    include get_template_path('footer.php');
    #show tpl
    //echo $tpl->display($style);
    #footer
    //echo $tpl->display("admin_footer");
    #if exit, clean it
    if ($exit) {
        garbage_collection();
        exit;
    }
}
开发者ID:omtim,项目名称:kleeja,代码行数:43,代码来源:functions_adm.php


示例3: phpbb_end_update

function phpbb_end_update($cache, $config)
{
    $cache->purge();
    $config->increment('assets_version', 1);
    ?>
								</p>
							</div>
						</div>
					<span class="corners-bottom"><span></span></span>
				</div>
			</div>
		</div>

		<div id="page-footer">
			<div class="copyright">
				Powered by <a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Limited
			</div>
		</div>
	</div>
</body>
</html>

<?php 
    garbage_collection();
    exit_handler();
}
开发者ID:kilianr,项目名称:phpbb,代码行数:26,代码来源:database_update.php


示例4: adm_page_footer

/**
* Page footer for acp pages
*/
function adm_page_footer($copyright_html = true)
{
    global $db, $config, $template, $user, $auth, $cache;
    global $starttime, $phpbb_admin_path;
    // Output page creation time
    if (defined('DEBUG')) {
        $mtime = explode(' ', microtime());
        $totaltime = $mtime[0] + $mtime[1] - $starttime;
        // Let's remove $auth->acl_get('a_') until I finish coding permissions properly... and also add/remove 'a_' when users are added/removed from administrators in ACP
        //$is_admin = (($user->data['user_level'] == ADMIN) || $auth->acl_get('a_')) ? true : false;
        $is_admin = $user->data['user_level'] == ADMIN ? true : false;
        if (!empty($_REQUEST['explain']) && $is_admin && defined('DEBUG_EXTRA') && method_exists($db, 'sql_report')) {
            $db->sql_report('display');
        }
        $debug_output = sprintf('Time : %.3fs | ' . $db->sql_num_queries() . ' Queries | GZIP : ' . ($config['gzip_compress'] ? 'On' : 'Off') . ($user->load ? ' | Load : ' . $user->load : ''), $totaltime);
        if ($is_admin && defined('DEBUG_EXTRA')) {
            if (function_exists('memory_get_usage')) {
                if ($memory_usage = memory_get_usage()) {
                    global $base_memory_usage;
                    $memory_usage -= $base_memory_usage;
                    $memory_usage = get_formatted_filesize($memory_usage);
                    $debug_output .= ' | Memory Usage: ' . $memory_usage;
                }
            }
            $debug_output .= ' | <a href="' . build_url() . '&amp;explain=1">Explain</a>';
        }
    }
    $template->assign_vars(array('DEBUG_OUTPUT' => defined('DEBUG') ? $debug_output : '', 'TRANSLATION_INFO' => !empty($user->lang['TRANSLATION_INFO']) ? $user->lang['TRANSLATION_INFO'] : '', 'S_COPYRIGHT_HTML' => $copyright_html, 'VERSION' => $config['version']));
    $template->display('body');
    garbage_collection();
    exit_handler();
}
开发者ID:ALTUN69,项目名称:icy_phoenix,代码行数:35,代码来源:functions_admin_phpbb3.php


示例5: main

 function main($id, $mode)
 {
     global $db, $user, $phpbb_root_path, $config, $phpEx, $phpbb_container;
     $captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']);
     $captcha->init(request_var('type', 0));
     $captcha->execute();
     garbage_collection();
     exit_handler();
 }
开发者ID:Tarendai,项目名称:spring-website,代码行数:9,代码来源:ucp_confirm.php


示例6: deliver_demo

 /**
  * Entry point for delivering image CAPTCHAs in the ACP.
  */
 function deliver_demo($selected)
 {
     global $db, $user, $config, $src_container;
     $captcha = $src_container->get('captcha.factory')->get_instance($selected);
     $captcha->init(CONFIRM_REG);
     $captcha->execute_demo();
     garbage_collection();
     exit_handler();
 }
开发者ID:AkhilSharma,项目名称:Serbest,代码行数:12,代码来源:acp_captcha.php


示例7: main

 function main($id, $mode)
 {
     global $config, $phpbb_container, $request;
     $captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']);
     $captcha->init($request->variable('type', 0));
     $captcha->execute();
     garbage_collection();
     exit_handler();
 }
开发者ID:bruninoit,项目名称:phpbb,代码行数:9,代码来源:ucp_confirm.php


示例8: main

 function main($id, $mode)
 {
     global $db, $user, $phpbb_root_path, $config, $phpEx;
     include $phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx;
     $captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']);
     $captcha->init(request_var('type', 0));
     $captcha->execute();
     garbage_collection();
     exit_handler();
 }
开发者ID:ahmatjan,项目名称:Crimson,代码行数:10,代码来源:ucp_confirm.php


示例9: disabled_board

 public function disabled_board($event)
 {
     $style_id = !$this->config['override_user_style'] ? $this->user->data['user_style'] : $this->config['default_style'];
     $sql = 'SELECT style_id FROM ' . STYLES_TABLE . ' WHERE style_copyright LIKE "© SiteSplat.com%"';
     $result = $this->db->sql_query($sql);
     $row = $this->db->sql_fetchrow($result);
     $in_sitesplat = in_array($style_id, $row);
     $this->template->assign_vars(array('PM_NEW_COUNT_BADGE' => $this->user->lang('PM_NEW_MSG_BUBBLE', (int) $this->user->data['user_new_privmsg']), 'PM_NEW_COUNT' => $this->user->lang('PM_NEW_MSG', (int) $this->user->data['user_new_privmsg']), 'PM_UNREAD_COUNT' => $this->user->lang('PM_UNREAD_MSG', (int) $this->user->data['user_unread_privmsg'])));
     if ($this->config['board_disable'] && !defined('IN_LOGIN') && $in_sitesplat && !$this->auth->acl_get('a_')) {
         global $phpbb_path_helper, $phpbb_root_path;
         // Determine board url - we may need it later
         $board_url = generate_board_url() . '/';
         // This path is sent with the base template paths in the assign_vars()
         // call below. We need to correct it in case we are accessing from a
         // controller because the web paths will be incorrect otherwise.
         $phpbb_path_helper = $this->phpbb_container->get('path_helper');
         $corrected_path = $phpbb_path_helper->get_web_root_path();
         $web_path = defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH ? $board_url : $corrected_path;
         // Send a proper content-language to the output
         $user_lang = $this->user->lang['USER_LANG'];
         if (strpos($user_lang, '-x-') !== false) {
             $user_lang = substr($user_lang, 0, strpos($user_lang, '-x-'));
         }
         $file = $phpbb_root_path . 'ext/sitesplat/BBCore/styles/all/template/offline_board_body.html';
         $fp = fopen($file, 'r');
         $content = fread($fp, filesize($file));
         fclose($fp);
         $match = array('#\\{S_CONTENT_DIRECTION\\}#', '#\\{S_USER_LANG\\}#', '#\\{S_CONTENT_ENCODING\\}#', '#\\{SITENAME\\}#', '#\\{PAGE_TITLE\\}#', '#\\{T_STYLESHEET_LINK\\}#', '#\\{T_THEME_PATH\\}#', '#\\{SCRIPT_NAME\\}#', '#\\{L_BOARD_DISABLED\\}#', '#\\{ACP_DISABLE_MESSAGE\\}#', '#\\{L_LOGIN_LOGOUT\\}#', '#\\{U_LOGIN_LOGOUT\\}#');
         $replace = array($this->user->lang['DIRECTION'], $user_lang, 'UTF-8', $this->config['sitename'], 'Website offline', "{$web_path}styles/" . rawurlencode($this->user->style['style_path']) . '/theme/stylesheet.css?assets_version=' . $this->config['assets_version'], "{$web_path}styles/" . rawurlencode($this->user->style['style_path']) . '/theme', str_replace('.' . 'php', '', $this->user->page['page_name']), 'board disabled', $this->config['board_disable_msg'], $this->user->lang['LOGIN'], append_sid("{$phpbb_root_path}ucp.php", 'mode=login'));
         $content = preg_replace($match, $replace, $content);
         $response = new Response('Content', 200, array('content-type' => 'text/html'));
         $response->setContent($content);
         $response->send();
         garbage_collection();
         exit_handler();
     }
 }
开发者ID:rinodung,项目名称:phpbb-forum,代码行数:37,代码来源:listener.php


示例10: deliver_demo

 /**
  * Entry point for delivering image CAPTCHAs in the ACP.
  */
 function deliver_demo($selected)
 {
     global $db, $user, $config;
     $captcha =& phpbb_captcha_factory::get_instance($selected);
     $captcha->init(CONFIRM_REG);
     $captcha->execute_demo();
     garbage_collection();
     exit_handler();
 }
开发者ID:ubick,项目名称:lorekeepers.org,代码行数:12,代码来源:acp_captcha.php


示例11: page_footer

/**
* Generate page footer
*
* @param bool $run_cron Whether or not to run the cron
* @param bool $display_template Whether or not to display the template
* @param bool $exit_handler Whether or not to run the exit_handler()
*/
function page_footer($run_cron = true, $display_template = true, $exit_handler = true)
{
    global $db, $config, $template, $user, $auth, $cache, $starttime, $phpbb_root_path, $phpEx;
    global $request, $phpbb_dispatcher, $phpbb_admin_path;
    // A listener can set this variable to `true` when it overrides this function
    $page_footer_override = false;
    /**
     * Execute code and/or overwrite page_footer()
     *
     * @event core.page_footer
     * @var	bool	run_cron			Shall we run cron tasks
     * @var	bool	page_footer_override	Shall we return instead of running
     *										the rest of page_footer()
     * @since 3.1.0-a1
     */
    $vars = array('run_cron', 'page_footer_override');
    extract($phpbb_dispatcher->trigger_event('core.page_footer', compact($vars)));
    if ($page_footer_override) {
        return;
    }
    phpbb_check_and_display_sql_report($request, $auth, $db);
    $template->assign_vars(array('DEBUG_OUTPUT' => phpbb_generate_debug_output($db, $config, $auth, $user, $phpbb_dispatcher), 'TRANSLATION_INFO' => !empty($user->lang['TRANSLATION_INFO']) ? $user->lang['TRANSLATION_INFO'] : '', 'CREDIT_LINE' => $user->lang('POWERED_BY', '<a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Limited'), 'U_ACP' => $auth->acl_get('a_') && !empty($user->data['is_registered']) ? append_sid("{$phpbb_admin_path}index.{$phpEx}", false, true, $user->session_id) : ''));
    // Call cron-type script
    $call_cron = false;
    if (!defined('IN_CRON') && !$config['use_system_cron'] && $run_cron && !$config['board_disable'] && !$user->data['is_bot'] && !$cache->get('_cron.lock_check')) {
        $call_cron = true;
        $time_now = !empty($user->time_now) && is_int($user->time_now) ? $user->time_now : time();
        // Any old lock present?
        if (!empty($config['cron_lock'])) {
            $cron_time = explode(' ', $config['cron_lock']);
            // If 1 hour lock is present we do not call cron.php
            if ($cron_time[0] + 3600 >= $time_now) {
                $call_cron = false;
            }
        }
    }
    // Call cron job?
    if ($call_cron) {
        global $phpbb_container;
        $cron = $phpbb_container->get('cron.manager');
        $task = $cron->find_one_ready_task();
        if ($task) {
            $url = $task->get_url();
            $template->assign_var('RUN_CRON_TASK', '<img src="' . $url . '" width="1" height="1" alt="cron" />');
        } else {
            $cache->put('_cron.lock_check', true, 60);
        }
    }
    /**
     * Execute code and/or modify output before displaying the template.
     *
     * @event core.page_footer_after
     * @var	bool display_template	Whether or not to display the template
     * @var	bool exit_handler		Whether or not to run the exit_handler()
     *
     * @since 3.1.0-RC5
     */
    $vars = array('display_template', 'exit_handler');
    extract($phpbb_dispatcher->trigger_event('core.page_footer_after', compact($vars)));
    if ($display_template) {
        $template->display('body');
    }
    garbage_collection();
    if ($exit_handler) {
        exit_handler();
    }
}
开发者ID:WarriorMachines,项目名称:warriormachines-phpbb,代码行数:74,代码来源:functions.php


示例12: feed_output

/**
* Outputs data as a Feed.
*
* @param int|array $blog_ids The id's of blogs that are going to get outputted,
* @param string $feed_type The type of feed we are outputting
*/
function feed_output($ids, $feed_type)
{
    global $template, $phpbb_root_path, $phpEx, $page, $mode, $limit, $config, $user, $blog_data, $user_id, $blog_id;
    // Feed explanation page
    if ($feed_type == 'explain') {
        $available_feeds = array('RSS 0.91' => blog_url(false, false, false, array_merge($_GET, array('feed' => 'RSS_0.91'))), 'RSS 1.0' => blog_url(false, false, false, array_merge($_GET, array('feed' => 'RSS_1.0'))), 'RSS 2.0' => blog_url(false, false, false, array_merge($_GET, array('feed' => 'RSS_2.0'))), 'ATOM' => blog_url(false, false, false, array_merge($_GET, array('feed' => 'ATOM'))), 'JAVASCRIPT' => array('url' => blog_url(false, false, false, array_merge($_GET, array('feed' => 'JAVASCRIPT'))), 'text' => htmlspecialchars('<script type="text/javascript" src="' . blog_url(false, false, false, array_merge($_GET, array('feed' => 'JAVASCRIPT', 'output' => 'true'))) . '"></script>'), 'demo' => '<script type="text/javascript" src="' . blog_url(false, false, false, array_merge($_GET, array('feed' => 'JAVASCRIPT', 'output' => 'true'))) . '"></script>'));
        blog_plugins::plugin_do_ref('available_feeds', $available_feeds);
        $message = '<strong>' . $user->lang['AVAILABLE_FEEDS'] . '</strong><br /><br />';
        foreach ($available_feeds as $feed_name => $data) {
            if (!is_array($data)) {
                $message .= '<br /><h2><a href="' . $data . '">' . $feed_name . '</a></h2><div><a href="' . $data . '">' . $data . '</a></div><br />';
            } else {
                $message .= '<br /><h2><a href="' . $data['url'] . '">' . $feed_name . '</a></h2><div><dl class="codebox"><dt>' . $user->lang['CODE'] . ': <a href="#" onclick="selectCode(this); return false;">Select all</a></dt><dd><code style="font-size: 12px;">' . $data['text'] . '</code></dd></dl></div><br />';
                if (isset($data['demo'])) {
                    $message .= $data['demo'];
                }
            }
        }
        trigger_error($message);
    }
    $title = $feed_type == 'JAVASCRIPT' ? str_replace("'", "\\'", $template->_tpldata['navlinks'][sizeof($template->_tpldata['navlinks']) - 1]['FORUM_NAME']) : $template->_tpldata['navlinks'][sizeof($template->_tpldata['navlinks']) - 1]['FORUM_NAME'];
    $template->assign_vars(array('FEED' => $feed_type, 'SELF_URL' => blog_url(false, false, false, array('page' => $page, 'mode' => $mode)), 'SELF_FULL_URL' => blog_url(false, false, false, array('page' => $page, 'mode' => $mode, 'feed' => $feed_type, 'limit' => $limit)), 'TITLE' => $config['sitename'] . ' ' . $title . ' ' . $user->lang['FEED'], 'SITE_URL' => generate_board_url(), 'SITE_DESC' => $config['site_desc'], 'SITE_LANG' => $config['default_lang'], 'CURRENT_TIME' => $feed_type == 'ATOM' ? date3339() : date('r'), 'IMG_MIN' => generate_board_url() . '/styles/' . $user->theme['theme_path'] . '/theme/images/blog/min_dark_blue.gif', 'IMG_MAX' => generate_board_url() . '/styles/' . $user->theme['theme_path'] . '/theme/images/blog/max_dark_blue.gif', 'S_OUTPUT' => isset($_GET['output']) ? true : false));
    if ($ids !== false) {
        if (!is_array($ids)) {
            $ids = array(intval($ids));
        }
        // the items section is only used in RSS 1.0
        if ($feed_type == 'RSS_1.0') {
            if (strpos($mode, 'comments') === false) {
                // output the URLS for the items section
                foreach ($ids as $id) {
                    $template->assign_block_vars('items', array('URL' => blog_url(blog_data::$blog[$id]['user_id'], $id)));
                }
            } else {
                // output the URLS for the items section
                foreach ($ids as $id) {
                    $template->assign_block_vars('items', array('URL' => blog_url(blog_data::$reply[$id]['user_id'], $id)));
                }
            }
        }
        if (strpos($mode, 'comments') === false) {
            // Output the main data
            foreach ($ids as $id) {
                $blog_row = $blog_data->handle_blog_data($id, true);
                $row = array('URL' => blog_url(blog_data::$blog[$id]['user_id'], $id), 'USERNAME' => blog_data::$user[blog_data::$blog[$id]['user_id']]['username'], 'MESSAGE' => str_replace("'", '&#039;', $blog_row['MESSAGE']), 'PUB_DATE' => date('r', blog_data::$blog[$id]['blog_time']), 'DATE_3339' => $feed_type == 'ATOM' ? date3339(blog_data::$blog[$id]['blog_time']) : '');
                $template->assign_block_vars('item', array_merge($blog_row, $row));
            }
        } else {
            // Output the main data
            foreach ($ids as $id) {
                $reply_row = $blog_data->handle_reply_data($id, true);
                $row = array('URL' => blog_url(blog_data::$reply[$id]['user_id'], blog_data::$reply[$id]['blog_id'], $id), 'USERNAME' => blog_data::$user[blog_data::$reply[$id]['user_id']]['username'], 'MESSAGE' => str_replace("'", '&#039;', $reply_row['MESSAGE']), 'PUB_DATE' => date('r', blog_data::$reply[$id]['reply_time']), 'DATE_3339' => $feed_type == 'ATOM' ? date3339(blog_data::$reply[$id]['reply_time']) : '');
                $template->assign_block_vars('item', array_merge($reply_row, $row));
            }
        }
        blog_plugins::plugin_do_arg('function_feed_output', compact('ids', 'feed_type', 'mode'));
    }
    // Output time
    if ($feed_type == 'JAVASCRIPT') {
        header('Content-type: text/html; charset=UTF-8');
    } else {
        header('Content-type: application/xml; charset=UTF-8');
    }
    header('Cache-Control: private, no-cache="set-cookie"');
    header('Expires: 0');
    header('Pragma: no-cache');
    $template->set_template();
    $template->set_filenames(array('body' => 'blog/blog_feed.xml'));
    $template->display('body');
    garbage_collection();
    exit_handler();
}
开发者ID:EXreaction,项目名称:User-Blog-Mod,代码行数:78,代码来源:functions_view.php


示例13: main


//.........这里部分代码省略.........
                    $pak_options = '';
                    foreach ($_paks as $pak) {
                        $pak_options .= '<option value="' . $pak . '">' . htmlspecialchars($pak) . '</option>';
                    }
                    $template->assign_vars(array('S_CHOOSE_PAK' => true, 'S_PAK_OPTIONS' => $pak_options, 'L_TITLE' => $user->lang['ACP_' . $lang], 'L_EXPLAIN' => $user->lang['ACP_' . $lang . '_EXPLAIN'], 'L_NO_PAK_OPTIONS' => $user->lang['NO_' . $lang . '_PAK'], 'L_CURRENT' => $user->lang['CURRENT_' . $lang], 'L_CURRENT_EXPLAIN' => $user->lang['CURRENT_' . $lang . '_EXPLAIN'], 'L_IMPORT_SUBMIT' => $user->lang['IMPORT_' . $lang], 'U_BACK' => $this->u_action, 'U_ACTION' => $this->u_action . '&amp;action=import'));
                }
                break;
            case 'export':
                $this->page_title = 'EXPORT_' . $lang;
                $this->tpl_name = 'message_body';
                $template->assign_vars(array('MESSAGE_TITLE' => $user->lang['EXPORT_' . $lang], 'MESSAGE_TEXT' => sprintf($user->lang['EXPORT_' . $lang . '_EXPLAIN'], '<a href="' . $this->u_action . '&amp;action=send&amp;hash=' . generate_link_hash('acp_icons') . '">', '</a>'), 'S_USER_NOTICE' => true));
                return;
                break;
            case 'send':
                if (!check_link_hash($request->variable('hash', ''), 'acp_icons')) {
                    trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
                }
                $sql = "SELECT *\n\t\t\t\t\tFROM {$table}\n\t\t\t\t\tORDER BY {$fields}_order";
                $result = $db->sql_query($sql);
                $pak = '';
                while ($row = $db->sql_fetchrow($result)) {
                    $pak .= "'" . addslashes($row[$fields . '_url']) . "', ";
                    $pak .= "'" . addslashes($row[$fields . '_width']) . "', ";
                    $pak .= "'" . addslashes($row[$fields . '_height']) . "', ";
                    $pak .= "'" . addslashes($row['display_on_posting']) . "', ";
                    if ($mode == 'smilies') {
                        $pak .= "'" . addslashes($row['emotion']) . "', ";
                        $pak .= "'" . addslashes($row['code']) . "', ";
                    }
                    $pak .= "\n";
                }
                $db->sql_freeresult($result);
                if ($pak != '') {
                    garbage_collection();
                    header('Cache-Control: public');
                    // Send out the Headers
                    header('Content-Type: text/x-delimtext; name="' . $mode . '.pak"');
                    header('Content-Disposition: inline; filename="' . $mode . '.pak"');
                    echo $pak;
                    flush();
                    exit;
                } else {
                    trigger_error($user->lang['NO_' . strtoupper($fields) . '_EXPORT'] . adm_back_link($this->u_action), E_USER_WARNING);
                }
                break;
            case 'delete':
                if (confirm_box(true)) {
                    $sql = "DELETE FROM {$table}\n\t\t\t\t\t\tWHERE {$fields}_id = {$icon_id}";
                    $db->sql_query($sql);
                    switch ($mode) {
                        case 'smilies':
                            break;
                        case 'icons':
                            // Reset appropriate icon_ids
                            $db->sql_query('UPDATE ' . TOPICS_TABLE . "\n\t\t\t\t\t\t\t\tSET icon_id = 0\n\t\t\t\t\t\t\t\tWHERE icon_id = {$icon_id}");
                            $db->sql_query('UPDATE ' . POSTS_TABLE . "\n\t\t\t\t\t\t\t\tSET icon_id = 0\n\t\t\t\t\t\t\t\tWHERE icon_id = {$icon_id}");
                            break;
                    }
                    $notice = $user->lang[$lang . '_DELETED'];
                    $cache->destroy('_icons');
                    $cache->destroy('sql', $table);
                    $phpbb_container->get('text_formatter.cache')->invalidate();
                    if ($request->is_ajax()) {
                        $json_response = new \phpbb\json_response();
                        $json_response->send(array('MESSAGE_TITLE' => $user->lang['INFORMATION'], 'MESSAGE_TEXT' => $notice, 'REFRESH_DATA' => array('time' => 3)));
                    }
开发者ID:phpbb,项目名称:phpbb,代码行数:67,代码来源:acp_icons.php


示例14: _download_result

 /**
  * Download the MySQL Upgrader script
  * @access private
  * @return void
  */
 function _download_result()
 {
     global $cache;
     // Read from the cache
     $result = $cache->get('_stk_mysql_upgrader_result');
     if ($result === false) {
         return;
     }
     // Write the file
     header('Content-Type: text/x-delimtext; name="mysql_upgrader.sql"');
     header('Content-disposition: attachment; filename=mysql_upgrader.sql');
     print $result;
     // Exit
     garbage_collection();
     exit_handler();
 }
开发者ID:napus,项目名称:support-toolkit,代码行数:21,代码来源:mysql_upgrader.php


示例15: wpu_output_page

/**
 * Does final clean-up of the integrated page, and sends it to the browser.
 * @param string $content The fully integrated page.
 */
function wpu_output_page($content)
{
    global $wpuNoHead, $wpu_page_title, $wpu_dtd, $wpuSetWPSignature;
    //Add title back
    $content = str_replace("<!--[**PAGE_TITLE**]-->", $wpu_page_title, $content);
    //Add DTD if needed
    if (isset($wpu_dtd)) {
        $content = str_replace("<!--[**WP_DTD**]-->", $wpu_dtd, $content);
    }
    global $wpuDebug;
    // Add login debugging if requested
    if (defined('WPU_DEBUG') && WPU_DEBUG && !$wpuNoHead) {
        $content = $wpuDebug->add_debug_box($content, 'login');
    }
    // Add stats if requested
    if (defined('WPU_SHOW_STATS') && WPU_SHOW_STATS && !$wpuNoHead) {
        $content = $wpuDebug->add_stats_box($content);
    }
    echo $content . $wpuSetWPSignature;
    // Finally -- clean up
    define('WPU_FINISHED', true);
    garbage_collection();
    exit_handler();
}
开发者ID:snitchashor,项目名称:wp-united,代码行数:28,代码来源:template-integrator.php


示例16: seo_redirect

 /**
  * Custom HTTP 301 redirections.
  * To kill duplicates
  */
 function seo_redirect($url, $header = '301 Moved Permanently', $code = 301, $replace = true)
 {
     global $db;
     if (!$this->seo_opt['zero_dupe']['on'] || @headers_sent()) {
         return false;
     }
     garbage_collection();
     $url = str_replace('&amp;', '&', $url);
     // Behave as redirect() for checks to provide with the same level of protection
     // Make sure no linebreaks are there... to prevent http response splitting for PHP < 4.4.2
     if (strpos(urldecode($url), "\n") !== false || strpos(urldecode($url), "\r") !== false || strpos($url, ';') !== false) {
         trigger_error('Tried to redirect to potentially insecure url.', E_USER_ERROR);
     }
     // Now, also check the protocol and for a valid url the last time...
     $allowed_protocols = array('http', 'https');
     $url_parts = parse_url($url);
     if ($url_parts === false || empty($url_parts['scheme']) || !in_array($url_parts['scheme'], $allowed_protocols)) {
         trigger_error('Tried to redirect to potentially insecure url.', E_USER_ERROR);
     }
     $http = 'HTTP/1.1 ';
     header($http . $header, $replace, $code);
     header('Cache-Control: no-store, no-cache, must-revalidate');
     header('Pragma: no-cache');
     header('Expires: -1');
     header('Location: ' . $url);
     exit_handler();
 }
开发者ID:Ibrahim-Abdelkader,项目名称:phpbb3,代码行数:31,代码来源:setup_phpbb_seo.php


示例17: adm_page_footer

/**
* Page footer for acp pages
*/
function adm_page_footer($copyright_html = true)
{
    global $db, $config, $template, $user, $auth, $cache;
    global $starttime, $phpbb_root_path, $phpbb_admin_path, $phpEx;
    global $request, $phpbb_dispatcher;
    // A listener can set this variable to `true` when it overrides this function
    $adm_page_footer_override = false;
    /**
     * Execute code and/or overwrite adm_page_footer()
     *
     * @event core.adm_page_footer
     * @var	bool	copyright_html			Shall we display the copyright?
     * @var	bool	adm_page_footer_override	Shall we return instead of
     *									running the rest of adm_page_footer()
     * @since 3.1.0-a1
     */
    $vars = array('copyright_html', 'adm_page_footer_override');
    extract($phpbb_dispatcher->trigger_event('core.adm_page_footer', compact($vars)));
    if ($adm_page_footer_override) {
        return;
    }
    phpbb_check_and_display_sql_report($request, $auth, $db);
    $template->assign_vars(array('DEBUG_OUTPUT' => phpbb_generate_debug_output($db, $config, $auth, $user, $phpbb_dispatcher), 'TRANSLATION_INFO' => !empty($user->lang['TRANSLATION_INFO']) ? $user->lang['TRANSLATION_INFO'] : '', 'S_COPYRIGHT_HTML' => $copyright_html, 'CREDIT_LINE' => $user->lang('POWERED_BY', '<a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Limited'), 'T_JQUERY_LINK' => !empty($config['allow_cdn']) && !empty($config['load_jquery_url']) ? $config['load_jquery_url'] : "{$phpbb_root_path}assets/javascript/jquery.min.js", 'S_ALLOW_CDN' => !empty($config['allow_cdn']), 'VERSION' => $config['version']));
    $template->display('body');
    garbage_collection();
    exit_handler();
}
开发者ID:Tarendai,项目名称:spring-website,代码行数:30,代码来源:functions_acp.php


示例18: titania_msg_handler

/**
 * Error and message handler, call with trigger_error
 */
function titania_msg_handler($errno, $msg_text, $errfile, $errline)
{
    global $msg_title, $msg_long_text;
    // Do not display notices if we suppress them via @
    if (error_reporting() == 0) {
        return;
    }
    // Message handler is stripping text. In case we need it, we are possible to define long text...
    if (isset($msg_long_text) && $msg_long_text && !$msg_text) {
        $msg_text = $msg_long_text;
    }
    switch ($errno) {
        case E_NOTICE:
        case E_WARNING:
            // Check the error reporting level and return if the error level does not match
            // If DEBUG is defined the default level is E_ALL
            if (($errno & (defined('DEBUG') ? E_ALL : error_reporting())) == 0) {
                return;
            }
            if (strpos($errfile, 'cache') === false && strpos($errfile, 'template.') === false) {
                // flush the content, else we get a white page if output buffering is on
                if ((int) @ini_get('output_buffering') === 1 || strtolower(@ini_get('output_buffering')) === 'on') {
                    @ob_flush();
                }
                // Another quick fix for those having gzip compression enabled, but do not flush if the coder wants to catch "something". ;)
                if (!empty(phpbb::$config['gzip_compress'])) {
                    if (@extension_loaded('zlib') && !headers_sent() && !ob_get_level()) {
                        @ob_flush();
                    }
                }
                // remove complete path to installation, with the risk of changing backslashes meant to be there
                $errfile = str_replace(array(phpbb_realpath(PHPBB_ROOT_PATH), '\\'), array('', '/'), $errfile);
                $msg_text = str_replace(array(phpbb_realpath(PHPBB_ROOT_PATH), '\\'), array('', '/'), $msg_text);
                echo '<b>[phpBB Debug] PHP Notice</b>: in file <b>' . $errfile . '</b> on line <b>' . $errline . '</b>: <b>' . $msg_text . '</b><br />' . "\n";
                // echo '<br /><br />BACKTRACE<br />' . get_backtrace() . '<br />' . "\n";
            }
            return;
            break;
        case E_USER_ERROR:
            if (!empty(phpbb::$user) && !empty(phpbb::$user->lang)) {
                $msg_text = !empty(phpbb::$user->lang[$msg_text]) ? phpbb::$user->lang[$msg_text] : $msg_text;
                $msg_title = !isset($msg_title) ? phpbb::$user->lang['GENERAL_ERROR'] : (!empty(phpbb::$user->lang[$msg_title]) ? phpbb::$user->lang[$msg_title] : $msg_title);
                $l_return_index = sprintf(phpbb::$user->lang['RETURN_INDEX'], '<a href="' . titania::$absolute_path . '">', '</a>');
                $l_notify = '';
                if (!empty(phpbb::$config['board_contact'])) {
                    $l_notify = '<p>' . sprintf(phpbb::$user->lang['NOTIFY_ADMIN_EMAIL'], phpbb::$config['board_contact']) . '</p>';
                }
            } else {
                $msg_title = 'General Error';
                $l_return_index = '<a href="' . titania::$absolute_path . '">Return to index page</a>';
                $l_notify = '';
                if (!empty(phpbb::$config['board_contact'])) {
                    $l_notify = '<p>Please notify the board administrator or webmaster: <a href="mailto:' . phpbb::$config['board_contact'] . '">' . phpbb::$config['board_contact'] . '</a></p>';
                }
            }
            garbage_collection();
            // Try to not call the adm page data...
            echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
            echo '<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">';
            echo '<head>';
            echo '<meta http-equiv="content-type" content="text/html; charset=utf-8" />';
            echo '<title>' . $msg_title . '</title>';
            echo '<style type="text/css">' . "\n" . '/* <![CDATA[ */' . "\n";
            echo '* { margin: 0; padding: 0; } html { font-size: 100%; height: 100%; margin-bottom: 1px; background-color: #E4EDF0; } body { font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif; color: #536482; background: #E4EDF0; font-size: 62.5%; margin: 0; } ';
            echo 'a:link, a:active, a:visited { color: #006699; text-decoration: none; } a:hover { color: #DD6900; text-decoration: underline; } ';
            echo '#wrap { padding: 0 20px 15px 20px; min-width: 615px; } #page-header { text-align: right; height: 40px; } #page-footer { clear: both; font-size: 1em; text-align: center; } ';
            echo '.panel { margin: 4px 0; background-color: #FFFFFF; border: solid 1px  #A9B8C2; } ';
            echo '#errorpage #page-header a { font-weight: bold; line-height: 6em; } #errorpage #content { padding: 10px; } #errorpage #content h1 { line-height: 1.2em; margin-bottom: 0; color: #DF075C; } ';
            echo '#errorpage #content div { margin-top: 20px; margin-bottom: 5px; border-bottom: 1px solid #CCCCCC; padding-bottom: 5px; color: #333333; font: bold 1.2em "Lucida Grande", Arial, Helvetica, sans-serif; text-decoration: none; line-height: 120%; text-align: left; } ';
            echo "\n" . '/* ]]> */' . "\n";
            echo '</style>';
            echo '</head>';
            echo '<body id="errorpage">';
            echo '<div id="wrap">';
            echo '	<div id="page-header">';
            echo '		' . $l_return_index;
            echo '	</div>';
            echo '	<div id="acp">';
            echo '	<div class="panel">';
            echo '		<div id="content">';
            echo '			<h1>' . $msg_title . '</h1>';
            echo '			<div>' . $msg_text . '</div>';
            echo '			<div>' . get_backtrace() . '</div>';
            echo $l_notify;
            echo '		</div>';
            echo '	</div>';
            echo '	</div>';
            echo '	<div id="page-footer">';
            echo '		Powered by phpBB &copy; 2000, 2002, 2005, 2007 <a href="http://www.phpbb.com/">phpBB Group</a>';
            echo '	</div>';
            echo '</div>';
            echo '</body>';
            echo '</html>';
            exit_handler();
            // On a fatal error (and E_USER_ERROR *is* fatal) we never want other scripts to continue and force an exit here.
            exit;
            break;
//.........这里部分代码省略.........
开发者ID:kairion,项目名称:customisation-db,代码行数:101,代码来源:functions.php


示例19: main


//.........这里部分代码省略.........
				);

				return;

			break;

			case 'send':

				$sql = "SELECT *
					FROM $table
					ORDER BY {$fields}_order";
				$result = $db->sql_query($sql);

				$pak = '';
				while ($row = $db->sql_fetchrow($result))
				{
					$pak .= "'" . addslashes($row[$fields . '_url'])  

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP gatekeeper函数代码示例发布时间:2022-05-15
下一篇:
PHP gantry_import函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap