本文整理汇总了PHP中Common::getGetString方法的典型用法代码示例。如果您正苦于以下问题:PHP Common::getGetString方法的具体用法?PHP Common::getGetString怎么用?PHP Common::getGetString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Common
的用法示例。
在下文中一共展示了Common::getGetString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute()
{
$this->module->includeClass('WC_Warbox');
$this->module->includeClass('WC_Warflag');
$this->module->includeClass('WC_Warflags');
$this->module->includeClass('sites/warbox/WCSite_WARBOX');
if (false === ($this->box = WC_Warbox::getByID(Common::getGetString('boxid')))) {
return $this->module->error('err_warbox');
}
if (false === ($this->site = $this->box->getSite())) {
return $this->module->error('err_site');
}
if (false === ($this->user = GWF_Session::getUser())) {
return GWF_HTML::err('ERR_LOGIN_REQUIRED');
}
if (false === ($this->flags = WC_Warflag::getForBoxAndUser($this->box, $this->user, 'wf_order ASC'))) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
if (count($this->flags) === 0) {
return GWF_HTML::err('ERR_GENERAL', array(__FILE__, __LINE__));
}
if (isset($_POST['password'])) {
return $this->onSolve();
}
return $this->templateOverview();
}
示例2: execute
public function execute()
{
# Page exists?
if (false === ($page = GWF_Page::getByID(Common::getGetString('pageid')))) {
header($_SERVER['SERVER_PROTOCOL'] . " 404 Not Found");
return $this->module->error('err_404');
}
# Have permission to see?
if (!$this->checkPermission($page)) {
header($_SERVER['SERVER_PROTOCOL'] . " 403 Forbidden");
return GWF_HTML::err('ERR_NO_PERMISSION');
}
# Load comments?
if ($page->isOptionEnabled(GWF_Page::COMMENTS)) {
$this->mod_c = GWF_Module::loadModuleDB('Comments', true, true);
if (false === ($this->comments = $page->getComments())) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
$_REQUEST['cmts_id'] = $this->comments->getID();
}
# Exec ...
$back = '';
if (isset($_POST['reply'])) {
$back = $this->onReply($page);
}
return $this->showPage($page) . $back;
}
示例3: execute
public function execute()
{
if (false === Common::isFile(GWF_GESHI_PATH)) {
return '';
// FIXME: {gizmore} log it? GESHI_PATH is may not readable
}
require_once GWF_GESHI_PATH;
$geshi = new GeSHi();
$langs = $geshi->get_supported_languages(false);
$key = htmlspecialchars(Common::getGetString('key', ''), ENT_QUOTES);
sort($langs);
// $this->niceArray($langs, false, '-------')
$this->niceArray($langs, 'python', 'Python');
$this->niceArray($langs, 'perl', 'Perl');
$this->niceArray($langs, 'cpp', 'CPP');
$this->niceArray($langs, 'php', 'PHP');
$back = $this->module->lang('th_lang') . ':' . PHP_EOL;
$back .= '<select id="bb_code_lang_sel_' . $key . '">' . PHP_EOL;
$back .= '<option value="0">' . $this->module->lang('th_lang') . '</option>' . PHP_EOL;
foreach ($langs as $lang) {
$back .= sprintf('<option value="%s">%s</option>', $lang, $lang) . PHP_EOL;
}
$back .= '</select>' . PHP_EOL;
$back .= $this->module->lang('th_title') . ': <input type="text" id="bb_code_title_' . $key . '" size="20" value="" />' . PHP_EOL;
$back .= '<input type="submit" value="' . $this->module->lang('btn_code') . '" onclick="return bbInsertCodeNow(\'' . $key . '\');" />' . PHP_EOL;
return $back;
}
示例4: templateError
private function templateError()
{
$module = $this->module;
$module instanceof Module_GWF;
$codes = $module->lang('ERR_HTTP');
# Get the error page
$code = Common::getGetString('code', '0');
if (false === isset($codes[$code])) {
return GWF_HTML::err('ERR_NO_PERMISSION');
}
@header($_SERVER['SERVER_PROTOCOL'] . ' ' . $code . ' ' . $codes[$code]);
# Generate template
$tVars = array('code' => $code, 'file' => GWF_HTML::error(GWF_SITENAME, $module->getLang()->langA('ERR_HTTP', $code, array(htmlspecialchars($_SERVER['REQUEST_URI']))), false));
$template = $module->template($this->_tpl, $tVars);
# Is the request blacklisted?
foreach (preg_split('/[,;]/', $module->cfgBlacklist()) as $pattern) {
if (false !== strpos($_SERVER['REQUEST_URI'], $pattern)) {
# Do not log and email the request
return $template;
}
}
$message = self::getMessage($code);
# Mail it?
if (1 === preg_match("/(?:^|[,;]){$code}(?:\$|[,;])/", $module->cfgMail())) {
self::errorMail($code, $message);
}
# Log it?
if (1 === preg_match("/(?:^|[,;]){$code}(?:\$|[,;])/", $module->cfgLog())) {
GWF_Log::logHTTP($message);
}
return $template;
}
示例5: execute
public function execute()
{
if (false === ($user = GWF_User::getByName(Common::getGetString('username')))) {
return GWF_HTML::err('ERR_UNKNOWN_USER');
}
if (false !== ($error = $this->module->isExcludedFromAPI($user, false))) {
return $error;
}
$this->module->includeClass('WC_RegAt');
$format = Common::getGetString('format', self::FORMAT);
$bg = Common::getGetString('bg', self::BGCOLOR);
$fg = Common::getGetString('fg', self::FGCOLOR);
$size = Common::clamp(Common::getGetInt('s', self::SIZE), 6, 30);
$spacingx = Common::clamp(Common::getGetInt('sx', 1), 0, 30);
$spacingy = Common::clamp(Common::getGetInt('sy', 1), 0, 30);
$marginx = Common::clamp(Common::getGetInt('mx', 1), 0, 30);
$marginy = Common::clamp(Common::getGetInt('my', 1), 0, 30);
$divider = Common::getGetString('div', ' ');
$font = Common::getGetString('font', self::FONT);
$_GET['font'] = $font;
if (!preg_match('/^[a-z_0-9]+$/iD', $font) || !Common::isFile(GWF_EXTRA_PATH . 'font/' . $font . '.ttf')) {
return "Font not found. Available fonts: " . $this->listFonts();
}
die($this->displayBanner($user, $format, $bg, $fg, $size, $spacingx, $spacingy, $marginx, $marginy, $divider));
}
示例6: templateSongs
private function templateSongs()
{
// $user = GWF_Session::getUser();
// $uid = $user->getID();
$table = GDO::table('Slay_Song');
$joins = NULL;
$headers = array();
$headers[] = array($this->module->lang('th_artist'), 'ss_artist');
$headers[] = array($this->module->lang('th_title'), 'ss_title');
$headers[] = array($this->module->lang('th_duration'), 'ss_duration');
$headers[] = array($this->module->lang('th_bpm'), 'ss_bpm');
$headers[] = array($this->module->lang('th_key'), 'ss_key');
$headers[] = array($this->module->lang('D'));
$headers[] = array($this->module->lang('L'));
$headers[] = array($this->module->lang('T'));
$headers[] = array($this->module->lang('th_tags'));
$where = "";
$nItems = $table->selectVar('COUNT(ss_id)', $where, '', $joins);
$nPages = GWF_PageMenu::getPagecount(self::IPP, $nItems);
$page = Common::clamp(Common::getGetInt('page'), 1, $nPages);
$by = Common::getGetString('by', self::BY);
$dir = Common::getGetString('dir', self::DIR);
$orderby = $table->getMultiOrderby($by, $dir, false);
$songs = $table->selectAll('*', $where, $orderby, $joins, self::IPP, GWF_PageMenu::getFrom($page, self::IPP), GDO::ARRAY_O);
$tVars = array('is_dj' => GWF_User::isInGroupS('dj'), 'sort_url' => GWF_WEB_ROOT . 'index.php?mo=Slaytags&me=Songs&by=%BY%&dir=%DIR%&page=1', 'pagemenu' => GWF_PageMenu::display($page, $nPages, GWF_WEB_ROOT . sprintf('index.php?mo=Slaytags&me=Songs&by=%s&dir=%s&page=%%PAGE%%', urlencode($by), urlencode($dir))), 'songs' => $songs, 'headers' => $headers);
return $this->module->template('songs.tpl', $tVars);
}
示例7: sanitize
private function sanitize()
{
if (false === ($this->group = GWF_Group::getByID(Common::getGetString('gid')))) {
return $this->module->error('err_group');
}
return false;
}
示例8: execute
public function execute()
{
return $_SERVER['REMOTE_ADDR'];
$ip = Common::getGetString('ip', false);
$type = Common::getGetString('type', GWF_IP6::INT_32);
return GWF_IP6::getIP($type, $ip);
}
示例9: execute
public function execute()
{
$nav = $this->module->templateNav();
if ('true' === Common::getGetString('all')) {
return $nav . $this->onInstallAll();
}
if (false !== Common::getPost('install')) {
return $nav . $this->onInstallModuleSafe(false);
}
if (false !== Common::getPost('reinstall')) {
return $nav . $this->onTemplateReinstall(true);
}
if (false !== Common::getPost('reinstall2')) {
return $nav . $this->onInstallModuleSafe(true);
}
if (false !== Common::getPost('resetvars2')) {
return $nav . $this->onResetModule();
}
if (false !== Common::getPost('delete')) {
return $nav . $this->onTemplateReinstall(false);
}
if (false !== Common::getPost('delete2')) {
return $nav . $this->onDeleteModule();
}
if (false !== ($modulename = Common::getGetString('module'))) {
return $nav . $this->onInstall($modulename, false);
}
return GWF_HTML::err('ERR_GENERAL', array(__FILE__, __LINE__));
}
示例10: execute
public function execute()
{
if (false === ($this->song = Slay_Song::getByID(Common::getGetString('song')))) {
return $this->module->error('err_song');
}
return $this->templateSong();
}
示例11: templateChalls
public function templateChalls($for_userid = false, $from_userid = false, $tag = '', $by = '', $dir = '', $show_cloud = true, $show_empty = true)
{
require_once GWF_CORE_PATH . 'module/WeChall/WC_ChallSolved.php';
$challs = GDO::table('WC_Challenge');
$for_userid = (int) $for_userid;
$from_userid = (int) $from_userid;
$solved_bits = $for_userid > 0 ? WC_ChallSolved::getSolvedForUser($for_userid, true) : array();
if (count($solved_bits) === 0 && !$show_empty && $from_userid === 0) {
return '';
}
$solve_filter = Common::getGetString('filter', '');
if ($solve_filter === 'solved' or $solve_filter == 'open') {
$filter_prefix = $solve_filter . '_';
} else {
$filter_prefix = '';
}
$from_query = $from_userid === 0 ? '1' : "chall_creator LIKE '%,{$from_userid},%'";
$conditions = "({$from_query})";
if (0 === ($count = $challs->countRows($conditions))) {
return '';
}
$orderby = $challs->getMultiOrderby($by, $dir);
$tag_2 = $tag == '' ? '' : $tag . '/';
$this->setPageDescr($for_userid, $from_userid, $tag, $count);
$sort_url = 'challs/' . $tag_2 . 'by/' . $by . '/' . $dir . '/page-1';
$tVars = array('filter_prefix' => $filter_prefix, 'sort_url' => GWF_WEB_ROOT . $filter_prefix . 'challs/' . $tag_2 . 'by/%BY%/%DIR%/page-1', 'challs' => $challs->selectObjects('*', $conditions, $orderby), 'tags' => $show_cloud ? $this->getTags() : '', 'solved_bits' => $solved_bits, 'table_title' => $this->getTableTitle($for_userid, $from_userid, $tag, $count), 'tag' => $tag, 'by' => $by, 'dir' => $dir, 'href_all' => GWF_WEB_ROOT . $sort_url, 'href_solved' => GWF_WEB_ROOT . 'solved_' . $sort_url, 'href_unsolved' => GWF_WEB_ROOT . 'open_' . $sort_url, 'sel_all' => $solve_filter === '', 'sel_solved' => $solve_filter === 'solved', 'sel_unsolved' => $solve_filter === 'open');
return $this->module->templatePHP('challs.php', $tVars);
}
示例12: execute
public function execute()
{
GWF_Website::plaintext();
$input = trim(Common::getGetString('username', ''));
if (false !== ($onsitename = Common::getGet('onsitename')) && false !== ($sitename = Common::getGet('sitename'))) {
die($this->rawOnSiteStats($sitename, $onsitename));
}
require_once GWF_CORE_PATH . 'module/WeChall/WC_RegAt.php';
if (Common::getGet('wechall') === 'yes') {
die($this->wechallChalls($input));
}
if ($input === '') {
$message = sprintf('Try %s?username=name/rank. New: ?username=!sitename username/rank. Or: ?username=!sites usernname', 'wechall.php');
die($message);
}
if (strpos($input, '!sites') === 0) {
$this->showSites($input);
} elseif (strpos($input, '!site') === 0) {
$this->showSiteDetail($input);
} elseif (strpos($input, '!') === 0) {
$this->showSite($input);
} else {
die($this->showGlobal($input));
}
}
示例13: execute
public function execute()
{
if (false === ($page = GWF_Page::getByID(Common::getGetString('pageid')))) {
return $this->module->error('err_page');
}
$user = GWF_User::getStaticOrGuest();
$this->is_author = $this->module->isAuthor($user);
$this->is_owner = $this->is_author || $page->isOwner($user);
if (!$this->is_owner && !$this->is_author) {
return GWF_HTML::err('ERR_NO_PERMISSION');
}
$this->page = $page;
$this->user = $user;
$this->is_oowner = $this->is_author ? true : $page->getOtherPage()->isOwner($user);
$back = '';
if (isset($_POST['edit'])) {
$back .= $this->onEdit();
} elseif (isset($_POST['unlock'])) {
return $this->onUnlock() . $this->templateEdit();
} elseif (isset($_POST['delete'])) {
return $this->onDelete() . $this->templateEdit();
} elseif (isset($_POST['translate'])) {
GWF_Website::redirect($this->module->getMethodURL('Translate', '&pageid=' . $page->getID()));
die;
} elseif (isset($_POST['upload'])) {
require_once GWF_CORE_PATH . 'module/PageBuilder/PB_Uploader.php';
$back .= PB_Uploader::onUpload($this->module) . $this->templateEdit();
}
return $back . $this->templateEdit();
}
示例14: execute
public function execute()
{
$this->module->includeClass('WC_Warbox');
$this->module->includeClass('WC_Warflag');
$this->module->includeClass('WC_WarToken');
$this->module->includeClass('sites/warbox/WCSite_WARBOX');
# CHECK TOKEN
if (isset($_GET['CHECK'])) {
$_GET['ajax'] = 1;
if (false === ($username = Common::getGetString('username', false))) {
return GWF_HTML::err('ERR_PARAMETER', array('username'));
}
if (false === ($token = Common::getGetString('token', false))) {
return GWF_HTML::err('ERR_PARAMETER', array('token'));
}
return WC_WarToken::isValidWarToken($username, $token) ? '1' : '0';
}
# GET CONFIG
if (isset($_GET['CONFIG'])) {
return $this->genConfig();
}
if (!GWF_Session::isLoggedIn()) {
return GWF_HTML::err('ERR_LOGIN_REQUIRED');
}
# GEN AND SHOW
return $this->templateToken();
}
示例15: execute
public function execute()
{
GWF_Website::plaintext();
GWF3::setConfig('store_last_url', false);
$lat = $this->module->lat();
$lon = $this->module->lon();
$descr = trim(Common::getGetString('pp_descr'));
$descr = $descr === '' ? null : $descr;
$id = Common::getGetInt('pp_id', 0);
$user = GWF_User::getStaticOrGuest();
$uid = $user->getID();
if (!GWF_ProfilePOI::changeAllowed($id, $uid)) {
$this->module->ajaxError('Permission error!');
}
$count = $id === 0 ? GWF_ProfilePOI::getPOICount($uid) : 0;
$max_pois = $this->module->cfgAllowedPOIs();
if ($count >= $max_pois) {
$this->module->ajaxErr('err_poi_exceed');
}
$poi = new GWF_ProfilePOI(array('pp_id' => $id, 'pp_uid' => $uid, 'pp_lat' => $lat, 'pp_lon' => $lon, 'pp_descr' => $descr));
$poi->replace();
$data = $poi->getGDOData();
$data['user_name'] = $user->getVar('user_name');
die(json_encode($data));
}