当前位置: 首页>>代码示例>>PHP>>正文


PHP request_var函数代码示例

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


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

示例1: main

    function main($id, $mode)
    {
        global $config, $db, $user, $auth, $template, $cache;
        global $phpbb_root_path, $phpbb_admin_path, $phpEx;
        $user->add_lang('install');
        $this->tpl_name = 'acp_update';
        $this->page_title = 'ACP_VERSION_CHECK';
        // Get current and latest version
        $info = htmlspecialchars(obtain_latest_version_info(request_var('versioncheck_force', false)));
        if (empty($info)) {
            trigger_error('VERSIONCHECK_FAIL', E_USER_WARNING);
        }
        $info = explode("\n", $info);
        $latest_version = trim($info[0]);
        $announcement_url = trim($info[1]);
        $announcement_url = strpos($announcement_url, '&') === false ? str_replace('&', '&', $announcement_url) : $announcement_url;
        $update_link = append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=update');
        // next feature release
        $next_feature_version = $next_feature_announcement_url = false;
        if (isset($info[2]) && trim($info[2]) !== '') {
            $next_feature_version = trim($info[2]);
            $next_feature_announcement_url = trim($info[3]);
        }
        // Determine automatic update...
        $sql = 'SELECT config_value
			FROM ' . CONFIG_TABLE . "\n\t\t\tWHERE config_name = 'version_update_from'";
        $result = $db->sql_query($sql);
        $version_update_from = (string) $db->sql_fetchfield('config_value');
        $db->sql_freeresult($result);
        $current_version = !empty($version_update_from) ? $version_update_from : $config['version'];
        $template->assign_vars(array('S_UP_TO_DATE' => phpbb_version_compare($latest_version, $config['version'], '<='), 'S_UP_TO_DATE_AUTO' => phpbb_version_compare($latest_version, $current_version, '<='), 'S_VERSION_CHECK' => true, 'U_ACTION' => $this->u_action, 'U_VERSIONCHECK_FORCE' => append_sid($this->u_action . '&amp;versioncheck_force=1'), 'LATEST_VERSION' => $latest_version, 'CURRENT_VERSION' => $config['version'], 'AUTO_VERSION' => $version_update_from, 'NEXT_FEATURE_VERSION' => $next_feature_version, 'UPDATE_INSTRUCTIONS' => sprintf($user->lang['UPDATE_INSTRUCTIONS'], $announcement_url, $update_link), 'UPGRADE_INSTRUCTIONS' => $next_feature_version ? $user->lang('UPGRADE_INSTRUCTIONS', $next_feature_version, $next_feature_announcement_url) : false));
    }
开发者ID:PetsFundation,项目名称:Pets,代码行数:32,代码来源:acp_update.php

示例2: misc_getContent

function misc_getContent()
{
    $miscID = request_var('miscID', 1);
    switch ($miscID) {
        case 1:
        default:
            $result = getUnitStats();
            break;
        case 2:
            $result = getDefenseStats();
            break;
        case 3:
            $result = getUnitsEncumbrance();
            break;
        case 4:
            $result = getWondersStats();
            break;
        case 5:
            $result = getBuildingsStats();
            break;
        case 6:
            $result = getResourcesStats();
            break;
        case 7:
            $result = getSkillStats();
    }
    return $result;
}
开发者ID:norter,项目名称:Game,代码行数:28,代码来源:module_misc.php

示例3: run_tool

 /**
  * Run tool
  */
 function run_tool()
 {
     $this->mode = request_var('m', 'pf');
     switch ($this->mode) {
         // Post flags
         case 'pf':
             $this->_resync_pms_posts('posts');
             break;
             // PM flags
         // PM flags
         case 'pmf':
             $this->_resync_pms_posts('pms');
             break;
             // Reports
         // Reports
         case 'rf':
             $this->_resync_reports();
             break;
             // Topic flags
         // Topic flags
         case 'tf':
             $this->_resync_topics();
             break;
         case 'finished':
             trigger_error('RESYNC_REPORT_FLAGS_FINISHED');
             break;
     }
 }
开发者ID:melvingb,项目名称:phpbb3.1-STK,代码行数:31,代码来源:resync_report_flags.php

示例4: __construct

 public function __construct()
 {
     global $CONF, $dpath, $LNG, $db, $USER, $PLANET;
     $mode = request_var('mode', '');
     $msg = request_var('msg', '', true);
     $ctype = request_var('chat_type', '');
     $MessageID = request_var('id', 0);
     switch ($mode) {
         case "delete":
             $this->DelMeassageFromChat($MessageID);
             break;
         case "send":
             $this->SetMeassageInChat($ctype, $msg);
             break;
         case "call":
             $this->GetMessages($ctype);
             break;
         default:
             $template = new template();
             $template->execscript("showMessage();setInterval(showMessage, 10000);");
             $template->loadscript("chat.js");
             if (empty($ctype)) {
                 $PlanetRess = new ResourceUpdate();
                 $PlanetRess->CalcResource();
                 $PlanetRess->SavePlanetToDB();
             } else {
                 $template->isPopup(true);
             }
             $template->assign_vars(array('ctype' => $ctype, 'chat_send' => $LNG['chat_send'], 'chat_disc' => $LNG['chat_disc'], 'chat_message' => $LNG['chat_message'], 'chat_bbcode' => $LNG['chat_bbcode'], 'chat_fontcolor' => $LNG['chat_fontcolor'], 'chat_color_white' => $LNG['chat_color_white'], 'chat_color_blue' => $LNG['chat_color_blue'], 'chat_color_yellow' => $LNG['chat_color_yellow'], 'chat_color_green' => $LNG['chat_color_green'], 'chat_color_pink' => $LNG['chat_color_pink'], 'chat_color_red' => $LNG['chat_color_red'], 'chat_color_orange' => $LNG['chat_color_orange'], 'chat_notext' => $LNG['chat_notext'], 'chat_request_url' => $LNG['chat_request_url'], 'chat_request_url_desc' => $LNG['chat_request_url_desc']));
             $template->show("chat_overview.tpl");
             break;
     }
 }
开发者ID:sonicmaster,项目名称:RPG,代码行数:33,代码来源:class.ShowChatPage.php

示例5: _home

	public function _home() {
		global $config, $user, $cache;

		$artist = request_var('a', '');
		$redirect = request_var('r', '');

		if (!empty($artist)) {
			redirect(s_link('acp', array($redirect, 'a' => $artist)));
		}

		$artist_select = '';
		if (!$user->is('founder')) {
			$sql = 'SELECT ub
				FROM _artists_auth
				WHERE user_id = ?';
			$artist_select = ' WHERE ub IN (' . _implode(',', sql_rowset(sql_filter($sql, $user->d('user_id')), false, 'ub')) . ') ';
		}

		$sql = 'SELECT ub, subdomain, name
			FROM _artists
			??
			ORDER BY name';
		$artists = sql_rowset(sql_filter($sql, $artist_select));

		foreach ($artists as $i => $row) {
			if (!$i) _style('artist_list');

			_style('artist_list.row', array(
				'URL' => s_link('acp', array($redirect, 'a' => $row['subdomain'])),
				'NAME' => $row['name'])
			);
		}

		return;
	}
开发者ID:nopticon,项目名称:rockr,代码行数:35,代码来源:artist_select.php

示例6: buildpage

 public function buildpage(viewNavigation $Navigation)
 {
     global $config, $phpbb_root_path, $phpEx, $user, $template;
     $item_id = request_var(URI_ITEM, 0);
     if (!class_exists('\\bbdkp\\controller\\loot\\Loot')) {
         require "{$phpbb_root_path}includes/bbdkp/controller/loot/Loot.{$phpEx}";
     }
     if (!class_exists('\\bbdkp\\controller\\members\\Members')) {
         require "{$phpbb_root_path}includes/bbdkp/controller/members/Members.{$phpEx}";
     }
     if (!class_exists('\\bbdkp\\controller\\raids\\Raids')) {
         require "{$phpbb_root_path}includes/bbdkp/controller/raids/Raids.{$phpEx}";
     }
     $loot = new \bbdkp\controller\loot\Loot($item_id);
     $purchased_items = $loot->Loothistory($loot->item_name);
     $title = $user->lang['ITEM'] . ' : ' . $loot->item_name;
     $sort_order = array(0 => array('item_date desc, item_value desc', 'item_date asc, item_value desc'), 1 => array('member_name asc, item_value desc', 'member_name desc, item_value desc'), 2 => array('item_value desc', 'item_value asc'));
     $current_order = $Navigation->switch_order($sort_order);
     foreach ($purchased_items as $key => $item) {
         $buyer = new \bbdkp\controller\members\Members($item['member_id']);
         $raid = new \bbdkp\controller\raids\Raids($item['raid_id']);
         $template->assign_block_vars('items_row', array('DATE' => !empty($item['item_date']) ? date('d.m.y', $item['item_date']) : '&nbsp;', 'CLASS_COLOR' => $buyer->colorcode, 'CLASS_IMAGE' => $buyer->class_image, 'RACE_IMAGE' => $buyer->race_image, 'RACE' => $buyer->member_race, 'BUYER' => $buyer->member_name, 'U_VIEW_BUYER' => append_sid("{$phpbb_root_path}dkp.{$phpEx}", "page=member&amp;" . URI_NAMEID . '=' . $item['member_id'] . '&amp;' . URI_DKPSYS . '=' . $item['dkpid']), 'U_VIEW_RAID' => append_sid("{$phpbb_root_path}dkp.{$phpEx}", 'page=raid&amp;' . URI_RAID . '=' . $item['raid_id']), 'EVENT_COLOR' => $raid->event_color, 'RAID' => $raid->event_name, 'VALUE' => sprintf("%.2f", $item['item_value']), 'DECAY' => sprintf("%.2f", $item['item_decay']), 'TOTAL' => sprintf("%.2f", $item['item_net'])));
         unset($raid);
         unset($buyer);
     }
     $navlinks_array = array(array('DKPPAGE' => $user->lang['MENU_ITEMVAL'], 'U_DKPPAGE' => append_sid("{$phpbb_root_path}dkp.{$phpEx}", "page=listitems")), array('DKPPAGE' => $user->lang['MENU_VIEWITEM'], 'U_DKPPAGE' => append_sid("{$phpbb_root_path}dkp.{$phpEx}", "page=item&amp;" . URI_ITEM . '=' . $item_id)));
     foreach ($navlinks_array as $name) {
         $template->assign_block_vars('dkpnavlinks', array('DKPPAGE' => $name['DKPPAGE'], 'U_DKPPAGE' => $name['U_DKPPAGE']));
     }
     $template->assign_vars(array('S_SHOWDECAY' => $config['bbdkp_decay'] == '1' ? true : false, 'L_PURCHASE_HISTORY_FOR' => sprintf($user->lang['PURCHASE_HISTORY_FOR'], '<strong>' . $loot->item_name . '</strong>'), 'O_DATE' => $current_order['uri'][0], 'O_BUYER' => $current_order['uri'][1], 'O_VALUE' => $current_order['uri'][2], 'U_VIEW_ITEM' => append_sid("{$phpbb_root_path}dkp.{$phpEx}", 'page=item&amp;' . URI_ITEM . '=' . $item_id), 'VIEWITEM_FOOTCOUNT' => sprintf($user->lang['VIEWITEM_FOOTCOUNT'], count($purchased_items)), 'S_DISPLAY_VIEWITEM' => true));
     unset($purchased_items);
     // Output page
     page_header($title);
 }
开发者ID:ZerGabriel,项目名称:bbDKP,代码行数:34,代码来源:viewItem.php

示例7: ShowFleetTraderPage

/**
 _  \_/ |\ | /¯¯\ \  / /\    |¯¯) |_¯ \  / /¯¯\ |  |   |´¯|¯` | /¯¯\ |\ |5
 ¯  /¯\ | \| \__/  \/ /--\   |¯¯\ |__  \/  \__/ |__ \_/   |   | \__/ | \|Core.
 * @author: Copyright (C) 2011 by Brayan Narvaez (Prinick) developer of xNova Revolution
 * @link: http://www.xnovarevolution.con.ar

 * @package 2Moons
 * @author Slaver <slaver7@gmail.com>
 * @copyright 2009 Lucky <douglas@crockford.com> (XGProyecto)
 * @copyright 2011 Slaver <slaver7@gmail.com> (Fork/2Moons)
 * @license http://www.gnu.org/licenses/gpl.html GNU GPLv3 License
 * @version 1.3 (2011-01-21)
 * @link http://code.google.com/p/2moons/

 * Please do not remove the credits
*/
function ShowFleetTraderPage()
{
    global $USER, $PLANET, $LNG, $CONF, $pricelist, $resource;
    $PlanetRess = new ResourceUpdate();
    $PlanetRess->CalcResource();
    $CONF['trade_allowed_ships'] = explode(',', $CONF['trade_allowed_ships']);
    $ID = request_var('id', 0);
    if (!empty($ID) && in_array($ID, $CONF['trade_allowed_ships'])) {
        $Count = max(min(request_var('count', '0'), $PLANET[$resource[$ID]]), 0);
        $PLANET['metal'] = bcadd($PLANET['metal'], bcmul($Count, bcmul($pricelist[$ID]['metal'], (double) (1 - $CONF['trade_charge']))));
        $PLANET['crystal'] = bcadd($PLANET['crystal'], bcmul($Count, bcmul($pricelist[$ID]['crystal'], (double) (1 - $CONF['trade_charge']))));
        $PLANET['deuterium'] = bcadd($PLANET['deuterium'], bcmul($Count, bcmul($pricelist[$ID]['deuterium'], (double) (1 - $CONF['trade_charge']))));
        $PLANET['norio'] = bcadd($PLANET['norio'], bcmul($Count, bcmul($pricelist[$ID]['norio'], (double) (1 - $CONF['trade_charge']))));
        $USER['darkmatter'] = bcadd($USER['darkmatter'], bcmul($Count, bcmul($pricelist[$ID]['darkmatter'], (double) (1 - $CONF['trade_charge']))));
        $PlanetRess->Builded[$ID] = bcadd(bcmul('-1', $Count), $PlanetRess->Builded[$ID]);
    }
    $PlanetRess->SavePlanetToDB();
    $template = new template();
    $template->loadscript('fleettrader.js');
    $template->execscript('updateVars();');
    $Cost = array();
    foreach ($CONF['trade_allowed_ships'] as $ID) {
        $Cost[$ID] = array($PLANET[$resource[$ID]], $pricelist[$ID]['metal'], $pricelist[$ID]['crystal'], $pricelist[$ID]['deuterium'], $pricelist[$ID]['darkmatter'], $pricelist[$ID]['norio']);
    }
    $template->assign_vars(array('tech' => $LNG['tech'], 'ft_head' => $LNG['ft_head'], 'ft_count' => $LNG['ft_count'], 'ft_max' => $LNG['ft_max'], 'ft_total' => $LNG['ft_total'], 'ft_charge' => $LNG['ft_charge'], 'ft_absenden' => $LNG['ft_absenden'], 'trade_allowed_ships' => $CONF['trade_allowed_ships'], 'CostInfos' => json_encode($Cost), 'Charge' => $CONF['trade_charge']));
    $template->show("fleettrader_overview.tpl");
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:43,代码来源:ShowFleetTraderPage.php

示例8: assign_block

 /**
  * Assigns an image with all data to the defined template-block
  *
  * @param string	$template_block	Name of the template-block
  * @param array	$image_data		Array with the image-data, all columns of GALLERY_IMAGES_TABLE are needed. album_name may be additionally assigned
  */
 public static function assign_block($template_block, &$image_data, $album_status, $display = 126, $album_user_id = -1)
 {
     global $auth, $template, $user;
     static $lang_loaded;
     if (!$lang_loaded) {
         $user->add_lang('mods/gallery_mcp');
         $lang_loaded = true;
     }
     $st = request_var('st', 0);
     $sk = request_var('sk', phpbb_gallery_config::get('default_sort_key'));
     $sd = request_var('sd', phpbb_gallery_config::get('default_sort_dir'));
     $image_data['rating'] = $user->lang['NOT_RATED'];
     if ($image_data['image_rates']) {
         $image_data['rating'] = sprintf($image_data['image_rates'] == 1 ? $user->lang['RATE_STRING'] : $user->lang['RATES_STRING'], $image_data['image_rate_avg'] / 100, $image_data['image_rates']);
     }
     // Hide the result, while still rating on contests
     if ($image_data['image_contest']) {
         $image_data['rating'] = $user->lang['CONTEST_RATING_HIDDEN'];
     }
     $s_user_allowed = $image_data['image_user_id'] == $user->data['user_id'] && $album_status != phpbb_gallery_album::STATUS_LOCKED;
     $s_allowed_delete = phpbb_gallery::$auth->acl_check('i_delete', $image_data['image_album_id'], $album_user_id) && $s_user_allowed || phpbb_gallery::$auth->acl_check('m_delete', $image_data['image_album_id'], $album_user_id);
     $s_allowed_edit = phpbb_gallery::$auth->acl_check('i_edit', $image_data['image_album_id'], $album_user_id) && $s_user_allowed || phpbb_gallery::$auth->acl_check('m_edit', $image_data['image_album_id'], $album_user_id);
     $s_quick_mod = $s_allowed_delete || $s_allowed_edit || phpbb_gallery::$auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id) || phpbb_gallery::$auth->acl_check('m_move', $image_data['image_album_id'], $album_user_id);
     $template->assign_block_vars($template_block, array('IMAGE_ID' => $image_data['image_id'], 'UC_IMAGE_NAME' => $display & phpbb_gallery_block::DISPLAY_IMAGENAME ? self::generate_link('image_name', phpbb_gallery_config::get('link_image_name'), $image_data['image_id'], $image_data['image_name'], $image_data['image_album_id'], false, true, "&amp;sk={$sk}&amp;sd={$sd}&amp;st={$st}") : '', 'UC_THUMBNAIL' => self::generate_link('thumbnail', phpbb_gallery_config::get('link_thumbnail'), $image_data['image_id'], $image_data['image_name'], $image_data['image_album_id']), 'U_ALBUM' => $display & phpbb_gallery_block::DISPLAY_ALBUMNAME ? phpbb_gallery_url::append_sid('album', 'album_id=' . $image_data['image_album_id']) : '', 'S_UNAPPROVED' => phpbb_gallery::$auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id) && $image_data['image_status'] == self::STATUS_UNAPPROVED ? true : false, 'S_LOCKED' => $image_data['image_status'] == self::STATUS_LOCKED ? true : false, 'S_REPORTED' => phpbb_gallery::$auth->acl_check('m_report', $image_data['image_album_id'], $album_user_id) && $image_data['image_reported'] ? true : false, 'ALBUM_NAME' => $display & phpbb_gallery_block::DISPLAY_ALBUMNAME ? isset($image_data['album_name']) ? utf8_strlen(htmlspecialchars_decode($image_data['album_name'])) > phpbb_gallery_config::get('shortnames') + 3 ? htmlspecialchars(utf8_substr(htmlspecialchars_decode($image_data['album_name']), 0, phpbb_gallery_config::get('shortnames')) . '...') : $image_data['album_name'] : '' : '', 'ALBUM_NAME_FULL' => $display & phpbb_gallery_block::DISPLAY_ALBUMNAME ? isset($image_data['album_name']) ? $image_data['album_name'] : '' : '', 'POSTER' => $display & phpbb_gallery_block::DISPLAY_USERNAME ? $image_data['image_contest'] && !phpbb_gallery::$auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id) ? $user->lang['CONTEST_USERNAME'] : get_username_string('full', $image_data['image_user_id'], $image_data['image_username'], $image_data['image_user_colour']) : '', 'TIME' => $display & phpbb_gallery_block::DISPLAY_IMAGETIME ? $user->format_date($image_data['image_time']) : '', 'VIEW' => $display & phpbb_gallery_block::DISPLAY_IMAGEVIEWS ? $image_data['image_view_count'] : -1, 'CONTEST_RANK' => $image_data['image_contest_rank'] ? $user->lang['CONTEST_RESULT_' . $image_data['image_contest_rank']] : '', 'CONTEST_RANK_ID' => $image_data['image_contest_rank'], 'S_RATINGS' => $display & phpbb_gallery_block::DISPLAY_RATINGS ? phpbb_gallery_config::get('allow_rates') && phpbb_gallery::$auth->acl_check('i_rate', $image_data['image_album_id'], $album_user_id) ? $image_data['rating'] : '' : '', 'U_RATINGS' => phpbb_gallery_url::append_sid('image_page', 'album_id=' . $image_data['image_album_id'] . "&amp;image_id=" . $image_data['image_id']) . '#rating', 'L_COMMENTS' => $image_data['image_comments'] == 1 ? $user->lang['COMMENT'] : $user->lang['COMMENTS'], 'S_COMMENTS' => $display & phpbb_gallery_block::DISPLAY_COMMENTS ? phpbb_gallery_config::get('allow_comments') && phpbb_gallery::$auth->acl_check('c_read', $image_data['image_album_id'], $album_user_id) ? $image_data['image_comments'] ? $image_data['image_comments'] : $user->lang['NO_COMMENTS'] : '' : '', 'U_COMMENTS' => phpbb_gallery_url::append_sid('image_page', 'album_id=' . $image_data['image_album_id'] . "&amp;image_id=" . $image_data['image_id']) . '#comments', 'S_MOD_ACTION' => phpbb_gallery_url::append_sid('mcp', "album_id={$image_data['image_album_id']}&amp;image_id={$image_data['image_id']}&amp;quickmod=1", true, $user->session_id), 'S_QUICK_MOD' => $s_quick_mod, 'S_QM_MOVE' => phpbb_gallery::$auth->acl_check('m_move', $image_data['image_album_id'], $album_user_id), 'S_QM_EDIT' => $s_allowed_edit, 'S_QM_DELETE' => $s_allowed_delete, 'S_QM_REPORT' => phpbb_gallery::$auth->acl_check('m_report', $image_data['image_album_id'], $album_user_id), 'S_QM_STATUS' => phpbb_gallery::$auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id), 'S_IMAGE_REPORTED' => $image_data['image_reported'], 'U_IMAGE_REPORTED' => $image_data['image_reported'] ? phpbb_gallery_url::append_sid('mcp', "mode=report_details&amp;album_id={$image_data['image_album_id']}&amp;option_id=" . $image_data['image_reported']) : '', 'S_STATUS_APPROVED' => $image_data['image_status'] == phpbb_gallery_image::STATUS_APPROVED, 'S_STATUS_UNAPPROVED' => $image_data['image_status'] == phpbb_gallery_image::STATUS_UNAPPROVED, 'S_STATUS_LOCKED' => $image_data['image_status'] == phpbb_gallery_image::STATUS_LOCKED, 'S_IP' => $display & phpbb_gallery_block::DISPLAY_IP && $auth->acl_get('a_') ? $image_data['image_user_ip'] : '', 'U_WHOIS' => phpbb_gallery_url::append_sid('mcp', 'mode=whois&amp;ip=' . $image_data['image_user_ip']), 'U_REPORT' => phpbb_gallery::$auth->acl_check('m_report', $image_data['image_album_id'], $album_user_id) && $image_data['image_reported'] ? phpbb_gallery_url::append_sid('mcp', "mode=report_details&amp;album_id={$image_data['image_album_id']}&amp;option_id=" . $image_data['image_reported']) : '', 'U_STATUS' => phpbb_gallery::$auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id) ? phpbb_gallery_url::append_sid('mcp', "mode=queue_details&amp;album_id={$image_data['image_album_id']}&amp;option_id=" . $image_data['image_id']) : '', 'L_STATUS' => $image_data['image_status'] == self::STATUS_UNAPPROVED ? $user->lang['APPROVE_IMAGE'] : ($image_data['image_status'] == self::STATUS_APPROVED ? $user->lang['CHANGE_IMAGE_STATUS'] : $user->lang['UNLOCK_IMAGE']), 'U_MOVE' => phpbb_gallery::$auth->acl_check('m_move', $image_data['image_album_id'], $album_user_id) ? phpbb_gallery_url::append_sid('mcp', "action=images_move&amp;album_id={$image_data['image_album_id']}&amp;image_id=" . $image_data['image_id'] . "&amp;redirect=redirect") : '', 'U_EDIT' => $s_allowed_edit ? phpbb_gallery_url::append_sid('posting', "mode=image&amp;submode=edit&amp;album_id={$image_data['image_album_id']}&amp;image_id=" . $image_data['image_id']) : '', 'U_DELETE' => $s_allowed_delete ? phpbb_gallery_url::append_sid('posting', "mode=image&amp;submode=delete&amp;album_id={$image_data['image_album_id']}&amp;image_id=" . $image_data['image_id']) : ''));
 }
开发者ID:phpbbgallery,项目名称:phpbb-gallery,代码行数:31,代码来源:image.php

示例9: main

 function main($id, $mode)
 {
     global $db, $user, $auth, $template, $sid, $cache;
     global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
     $link = '<br /><a href="' . append_sid("index.{$phpEx}", "i=dkp_bbtooltips&amp;mode=bbtooltips") . '"><h3>Return to Index</h3></a>';
     $user->add_lang(array('mods/dkp_tooltips'));
     // bbtips version
     $template->assign_vars(array('BBTIPS_VERS' => $config['bbdkp_plugin_bbtips_version']));
     switch ($mode) {
         case 'bbtooltips':
             /*** note there are more $config entries for bbtips but they aren't user-configurable yet */
             $submit1 = isset($_POST['site_submit']) ? true : false;
             $submit2 = isset($_POST['arm_submit']) ? true : false;
             $gamesites = array('wowhead' => "Wowhead");
             $langlist = array('en' => "English", 'fr' => "French", 'de' => "German", 'es' => "Spanish", 'ru' => "Russian");
             if ($submit1) {
                 set_config('bbtips_maxparse', request_var('maxparse', 0), true);
                 set_config('bbtips_lang', request_var('site_lang', ''), true);
                 set_config('bbtips_localjs', request_var('localjs', 0), true);
                 $cache->destroy('config');
                 trigger_error($user->lang['BBTOOLTIPS_SETTINGSAVED'] . $link, E_USER_NOTICE);
             } else {
                 foreach ($langlist as $tt_lang => $tt_langname) {
                     $template->assign_block_vars('site_lang_row', array('VALUE' => $tt_lang, 'SELECTED' => $tt_lang == $config['bbtips_lang'] ? ' selected="selected"' : '', 'OPTION' => $tt_langname));
                 }
                 $template->assign_vars(array('F_BBTOOLTIPS' => append_sid("index.{$phpEx}", "i=dkp_bbtooltips&amp;mode=bbtooltips&amp;"), 'MAXPARSE' => $config['bbtips_maxparse'], 'LOCALJS_YES_CHECKED' => $config['bbtips_localjs'] == '1' ? ' checked="checked"' : '', 'LOCALJS_NO_CHECKED' => $config['bbtips_localjs'] == '0' ? ' checked="checked"' : ''));
             }
             $this->page_title = $user->lang['BBTOOLTIPS'];
             $this->tpl_name = 'dkp/acp_' . $mode;
             break;
     }
 }
开发者ID:ZerGabriel,项目名称:bbTips,代码行数:32,代码来源:acp_dkp_bbtooltips.php

示例10: main

 function main($id, $mode)
 {
     global $db, $user, $auth, $template, $cache;
     global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
     add_form_key('wwh');
     $user->add_lang('ucp');
     $this->tpl_name = 'acp_wwh';
     $this->page_title = $user->lang['WWH_TITLE'];
     $submit = isset($_POST['submit']) ? true : false;
     if ($submit) {
         if (!check_form_key('wwh')) {
             trigger_error('FORM_INVALID');
         }
         set_config('wwh_disp_bots', request_var('wwh_disp_bots', 0));
         set_config('wwh_disp_guests', request_var('wwh_disp_guests', 0));
         set_config('wwh_disp_hidden', request_var('wwh_disp_hidden', 0));
         set_config('wwh_disp_time', request_var('wwh_disp_time', 0));
         set_config('wwh_disp_time_format', request_var('wwh_disp_time_format', 'H:i'));
         set_config('wwh_disp_ip', request_var('wwh_disp_ip', 0));
         set_config('wwh_version', request_var('wwh_version', 0));
         set_config('wwh_del_time_h', request_var('wwh_del_time_h', 0));
         set_config('wwh_del_time_m', request_var('wwh_del_time_m', 0));
         set_config('wwh_del_time_s', request_var('wwh_del_time_s', 0));
         set_config('wwh_sort_by', request_var('wwh_sort_by', 0));
         set_config('wwh_record', request_var('wwh_record', 0));
         set_config('wwh_record_timestamp', request_var('wwh_record_timestamp', 'D j. M Y'));
         if (request_var('wwh_reset', 0) > 0) {
             set_config('wwh_record_ips', 1);
             set_config('wwh_record_time', time());
             set_config('wwh_reset_time', time());
         }
         trigger_error($user->lang['WWH_SAVED_SETTINGS'] . adm_back_link($this->u_action));
     }
     $template->assign_vars(array('WWH_MOD_VERSION' => sprintf($user->lang['WWH_INSTALLED'], $config['wwh_mod_version']), 'WWH_DISP_BOTS' => $config['wwh_disp_bots'], 'WWH_DISP_GUESTS' => $config['wwh_disp_guests'], 'WWH_DISP_HIDDEN' => $config['wwh_disp_hidden'], 'WWH_DISP_TIME' => $config['wwh_disp_time'], 'WWH_DISP_TIME_FORMAT' => $config['wwh_disp_time_format'], 'WWH_DISP_IP' => $config['wwh_disp_ip'], 'WWH_VERSION' => $config['wwh_version'], 'WWH_DEL_TIME_H' => $config['wwh_del_time_h'], 'WWH_DEL_TIME_M' => $config['wwh_del_time_m'], 'WWH_DEL_TIME_S' => $config['wwh_del_time_s'], 'WWH_SORT_BY' => $config['wwh_sort_by'], 'WWH_RECORD' => $config['wwh_record'], 'WWH_RECORD_TIMESTAMP' => $config['wwh_record_timestamp'], 'U_ACTION' => $this->u_action));
 }
开发者ID:Galixte,项目名称:who-was-here,代码行数:35,代码来源:acp_wwh.php

示例11: main

    function main($id, $mode)
    {
        global $db, $user, $auth, $template, $cache;
        global $config, $src_root_path, $src_admin_path, $phpEx;
        include $src_root_path . 'includes/functions_user.' . $phpEx;
        $user->add_lang('acp/posting');
        // Set up general vars
        $this->tpl_name = 'acp_disallow';
        $this->page_title = 'ACP_DISALLOW_USERNAMES';
        $form_key = 'acp_disallow';
        add_form_key($form_key);
        $disallow = isset($_POST['disallow']) ? true : false;
        $allow = isset($_POST['allow']) ? true : false;
        if (($allow || $disallow) && !check_form_key($form_key)) {
            trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
        }
        if ($disallow) {
            $disallowed_user = str_replace('*', '%', utf8_normalize_nfc(request_var('disallowed_user', '', true)));
            if (!$disallowed_user) {
                trigger_error($user->lang['NO_USERNAME_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING);
            }
            $sql = 'SELECT disallow_id
				FROM ' . DISALLOW_TABLE . "\n\t\t\t\tWHERE disallow_username = '" . $db->sql_escape($disallowed_user) . "'";
            $result = $db->sql_query($sql);
            $row = $db->sql_fetchrow($result);
            $db->sql_freeresult($result);
            if ($row) {
                trigger_error($user->lang['DISALLOWED_ALREADY'] . adm_back_link($this->u_action), E_USER_WARNING);
            }
            $sql = 'INSERT INTO ' . DISALLOW_TABLE . ' ' . $db->sql_build_array('INSERT', array('disallow_username' => $disallowed_user));
            $db->sql_query($sql);
            $cache->destroy('_disallowed_usernames');
            $message = $user->lang['DISALLOW_SUCCESSFUL'];
            add_log('admin', 'LOG_DISALLOW_ADD', str_replace('%', '*', $disallowed_user));
            trigger_error($message . adm_back_link($this->u_action));
        } else {
            if ($allow) {
                $disallowed_id = request_var('disallowed_id', 0);
                if (!$disallowed_id) {
                    trigger_error($user->lang['NO_USERNAME_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING);
                }
                $sql = 'DELETE FROM ' . DISALLOW_TABLE . '
				WHERE disallow_id = ' . $disallowed_id;
                $db->sql_query($sql);
                $cache->destroy('_disallowed_usernames');
                add_log('admin', 'LOG_DISALLOW_DELETE');
                trigger_error($user->lang['DISALLOWED_DELETED'] . adm_back_link($this->u_action));
            }
        }
        // Grab the current list of disallowed usernames...
        $sql = 'SELECT *
			FROM ' . DISALLOW_TABLE;
        $result = $db->sql_query($sql);
        $disallow_select = '';
        while ($row = $db->sql_fetchrow($result)) {
            $disallow_select .= '<option value="' . $row['disallow_id'] . '">' . str_replace('%', '*', $row['disallow_username']) . '</option>';
        }
        $db->sql_freeresult($result);
        $template->assign_vars(array('U_ACTION' => $this->u_action, 'S_DISALLOWED_NAMES' => $disallow_select));
    }
开发者ID:AkhilSharma,项目名称:Serbest,代码行数:60,代码来源:acp_disallow.php

示例12: _home

	public function _home() {
		global $config, $user, $cache;

		if (!_button()) {
			return false;
		}

		$topic = request_var('topic', 0);
		$important = request_var('important', 0);

		$sql = 'SELECT *
			FROM _forum_topics
			WHERE topic_id = ?';
		if (!$topicdata = sql_fieldrow(sql_filter($sql, $topic))) {
			fatal_error();
		}

		$sql_important = ($important) ? ', topic_important = 1' : '';

		$sql = 'UPDATE _forum_topics
			SET topic_color = ?, topic_announce = 1' . $sql_important . '
			WHERE topic_id = ?';
		sql_query(sql_filter($sql, 'E1CB39', $topic));

		return _pre('El tema <strong>' . $topicdata['topic_title'] . '</strong> ha sido anunciado.', true);
	}
开发者ID:nopticon,项目名称:rockr,代码行数:26,代码来源:forums_topic_announce.php

示例13: process_mb_vars

 /**
  * Wrapper for request_var() for multibtye input
  *
  * @param array $params multi-dimensional array holding the requested vars & defaults.
  *
  * @return mixed
  */
 function process_mb_vars($params = array())
 {
     while (list($var, $param) = @each($params)) {
         $data[$var] = request_var($var, $param, true);
     }
     return $data;
 }
开发者ID:Phatboy82,项目名称:phpbbgarage,代码行数:14,代码来源:class_garage.php

示例14: 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

示例15: main

 function main($id, $mode)
 {
     global $config, $db, $user, $table_prefix, $auth, $template, $phpbb_root_path, $phpEx;
     define('TABLE_PREFIX', $table_prefix);
     require_once 'class_ulogin.php';
     $uLogin = new uLogin($db);
     if ($config['require_activation'] == USER_ACTIVATION_DISABLE) {
         trigger_error('UCP_REGISTER_DISABLE');
     }
     if (!($user_id = $uLogin->auth())) {
         $user_id = $uLogin->register();
     }
     if ($user_id) {
         $session = $user->session_create($user_id, 0, 1);
     }
     if (!$session) {
         page_header($user->lang['LOGIN'], false);
         $template->set_filenames(array('body' => 'login_body.html'));
         make_jumpbox(append_sid("{$phpbb_root_path}viewforum.{$phpEx}"));
         page_footer();
         exit;
     }
     $redirect = request_var('redirect', "{$phpbb_root_path}index.{$phpEx}");
     $message = $user->lang['LOGIN_REDIRECT'];
     $l_redirect = $redirect === "{$phpbb_root_path}index.{$phpEx}" || $redirect === "index.{$phpEx}" ? $user->lang['RETURN_INDEX'] : $user->lang['RETURN_PAGE'];
     $redirect = reapply_sid($redirect);
     if (defined('IN_CHECK_BAN') && $session['user_row']['user_type'] != USER_FOUNDER) {
         return false;
     }
     $redirect = meta_refresh(3, $redirect);
     trigger_error($message . '<br /><br />' . sprintf($l_redirect, '<a href="' . $redirect . '">', '</a>'));
 }
开发者ID:mike-a-b,项目名称:crossfit,代码行数:32,代码来源:ulogin_register.php


注:本文中的request_var函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。