本文整理汇总了PHP中Common::getGetInt方法的典型用法代码示例。如果您正苦于以下问题:PHP Common::getGetInt方法的具体用法?PHP Common::getGetInt怎么用?PHP Common::getGetInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Common
的用法示例。
在下文中一共展示了Common::getGetInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例2: 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));
}
示例3: 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));
}
示例4: execute
public function execute()
{
if (false !== ($bid = Common::getGetInt('subscribe', false))) {
return $this->onSubscribe($bid);
} elseif (false !== ($bid = Common::getGetInt('unsubscribe', false))) {
return $this->onUnSubscribe($bid);
} else {
return GWF_HTML::err('ERR_GENERAL', array(__FILE__, __LINE__));
}
}
示例5: sanitize
private function sanitize()
{
if (false === ($this->site = WC_Site::getByID(Common::getGetInt('siteid', 0)))) {
return array($this->module->lang('err_site'));
}
require_once GWF_CORE_PATH . 'module/WeChall/WC_SiteAdmin.php';
if (!WC_SiteAdmin::isSiteAdmin(GWF_Session::getUserID(), $this->site->getID()) && !GWF_User::isAdminS()) {
return array(GWF_HTML::lang('ERR_NO_PERMISSION'));
}
return false;
}
示例6: templateShow
public function templateShow($href = NULL)
{
$nItems = $this->comments->getVar('cmts_count');
$nPages = GWF_PageMenu::getPagecount($this->module->cfgIPP(), $nItems);
$page = Common::clamp(Common::getGetInt('cpage', 1), 1, $nPages);
$cid = $this->comments->getID();
$visible = GWF_Comment::VISIBLE;
$comments = GDO::table('GWF_Comment')->selectObjects('*', "cmt_cid={$cid} AND cmt_options&{$visible}", 'cmt_date ASC');
$tVars = array('pagemenu' => GWF_PageMenu::display($page, $nPages, $href), 'comments' => $this->comments->displayComments($comments, $href));
return $this->module->template('show.tpl', $tVars);
}
示例7: execute
public function execute()
{
if (false === ($id = Common::getGetInt('id', false))) {
return GWF_HTML::err('ERR_PARAMETER', array(__FILE__, __LINE__, 'id'));
}
if (false === ($log = GWF_AuditLog::getByID($id))) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
GWF_Website::plaintext();
die($log->getVar('al_data'));
}
示例8: execute
public function execute()
{
GWF_Website::plaintext();
GWF3::setConfig('store_last_url', false);
$id = Common::getGetInt('pp_id');
if (!GWF_ProfilePOI::changeAllowed($id, GWF_Session::getUserID())) {
$this->module->ajaxError('Permission error!');
}
GDO::table('GWF_ProfilePOI')->deleteWhere("pp_id = {$id}");
die("{$id}");
}
示例9: onReply
private function onReply(Module_Comments $mod_c, GWF_News $news, GWF_Comments $comments)
{
$ipp = 10;
$nItems = $comments->getVar('cmts_count');
$nPages = GWF_PageMenu::getPagecount($ipp, $nItems);
$page = Common::clamp(Common::getGetInt('cpage'), 1, $nPages);
$href = GWF_WEB_ROOT . 'news-comments-' . $news->getID() . '-' . $news->displayTitle() . '-page-' . $page . '.html';
$me = $mod_c->getMethod('Reply');
$me instanceof Comments_Reply;
return $me->onReply($href);
}
示例10: onAddTag
private function onAddTag()
{
$form = $this->formAddTag();
if (false !== ($error = $form->validate($this->module))) {
return $error . $this->templateAddTag();
}
$user = GWF_Session::getUser();
$uid = $user->isStaff() ? '0' : $user->getID();
GDO::table('Slay_Tag')->insertAssoc(array('st_id' => 0, 'st_uid' => $uid, 'st_name' => $form->getVar('tag')), false);
$href = $this->module->getMethodURL('Tag', '&stid=' . Common::getGetInt('stid', '0'));
return $this->module->message('msg_tag_added', array($href));
}
示例11: templateHistory
private function templateHistory()
{
$table = GDO::table('Slay_PlayHistory');
$ipp = Slay_PlayHistory::IPP;
$where = '';
$nItems = $table->countRows($where);
$nPages = GWF_PageMenu::getPagecount($ipp, $nItems);
$page = Common::clamp(Common::getGetInt('page'), 1, $nPages);
$from = GWF_PageMenu::getFrom($page, $ipp);
$tVars = array('is_admin' => GWF_User::isStaffS(), 'page' => $page, 'pagemenu' => GWF_PageMenu::display($page, $nPages, GWF_WEB_ROOT . 'index.php?mo=Slaytags&me=History&page=%PAGE%'), 'history' => $table->selectAll('*', $where, 'sph_date ASC', array('songs'), $ipp, $from, 'Slay_Song'));
return $this->module->template('history.tpl', $tVars);
}
示例12: execute
public function execute()
{
$nid = Common::getGetInt('nid');
$id = Common::getGetInt('id');
$back = '';
if (isset($_POST['editnavi'])) {
$back = $this->onEdit($this->module, $nid, $id);
}
$this->navigation = GWF_Navigation::getNavigation($nid);
$this->navigations = GWF_Navigations::getByID($nid);
return $back . $this->templateEdit();
}
示例13: sanitize
private function sanitize()
{
$this->user = GWF_Session::getUser();
$this->table = GDO::table('GWF_AccountAccess');
$where = "accacc_uid={$this->user->getID()}";
$this->nItems = $this->table->countRows($where);
$this->nPages = GWF_PageMenu::getPagecount($this->perpage, $this->nItems);
$this->page = Common::clamp(Common::getGetInt('page'), 1, $this->nPages);
$this->from = GWF_PageMenu::getFrom($this->page, $this->perpage);
$this->by = $this->table->getWhitelistedBy(Common::getGetString('by', self::DEFAULT_BY), self::DEFAULT_BY);
$this->dir = $this->table->getWhitelistedBy(Common::getGetString('dir', self::DEFAULT_DIR), self::DEFAULT_DIR);
$this->result = $this->table->select('*', $where, "{$this->by} {$this->dir}", null, $this->perpage, $this->from);
}
示例14: execute
public function execute()
{
$_GET['ajax'] = 1;
header('Content-Type: text/plain');
if (false === ($date = Common::getGetString('datestamp', false))) {
return 'Missing parameter: datestamp.';
}
if (!GWF_Time::isValidDate($date, false, GWF_Date::LEN_SECOND)) {
return 'Error in parameter: datestamp.';
}
$amt = Common::clamp(Common::getGetInt('amt', 5), 1, self::MAX_OUT);
return $this->templateOutput($date, $amt);
}
示例15: templateTermine
private function templateTermine()
{
$termine = GDO::table('Konzert_Termin');
$where = '';
$by = Common::getGetString('by', self::DEFAULT_BY);
$dir = Common::getGetString('dir', self::DEFAULT_DIR);
$orderby = $termine->getMultiOrderby($by, $dir);
$nItems = $termine->countRows($where);
$nPages = GWF_PageMenu::getPagecount(self::IPP, $nItems);
$page = Common::clamp(Common::getGetInt('page'), 1, $nPages);
$from = GWF_PageMenu::getFrom($page, self::IPP);
$tVars = array('add_button' => GWF_Button::add($this->module->lang('btn_add'), $this->module->getMethodURL('AddTermin')), 'termine' => $termine->selectObjects('*', $where, $orderby, self::IPP, $from), 'pagemenu' => GWF_PageMenu::display($page, $nPages, GWF_WEB_ROOT . 'index.php?mo=Konzert&me=AdminTermine&by=' . urlencode($by) . '&dir=' . urlencode($dir) . '&page=%PAGE%'), 'sort_url' => GWF_WEB_ROOT . 'index.php?mo=Konzert&me=AdminTermine&by=%BY%&dir=%DIR%&page=1');
return $this->module->template('a_termine.tpl', $tVars);
}