本文整理汇总了PHP中GWF_User::getStaticOrGuest方法的典型用法代码示例。如果您正苦于以下问题:PHP GWF_User::getStaticOrGuest方法的具体用法?PHP GWF_User::getStaticOrGuest怎么用?PHP GWF_User::getStaticOrGuest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GWF_User
的用法示例。
在下文中一共展示了GWF_User::getStaticOrGuest方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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();
}
示例2: 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));
}
示例3: execute
public function execute()
{
$user = GWF_User::getStaticOrGuest();
GWF_Website::addJavascriptInline($this->getInlineJS($user));
$tVars = array('worlds' => $this->getWorlds($user));
GWF3::setDesign('jqmsl4');
return $this->module->template('shadowclient.tpl', $tVars);
}
示例4: getData
private function getData()
{
$table = GDO::table('WC_Warflags');
$by = Common::getGetString('by', 'wf_order');
$dir = Common::getGetString('dir', 'ASC');
$orderby = $table->getMultiOrderby($by, $dir);
return WC_Warflag::getForBoxAndUser($this->box, GWF_User::getStaticOrGuest(), $orderby);
}
示例5: onJoin
private function onJoin($array)
{
if (false !== ($error = GWF_Form::validateCSRF_WeakS())) {
return GWF_HTML::error('Join Group', $error);
}
if (false === ($group = GWF_Group::getByID(key($array)))) {
return $this->module->error('err_unk_group');
}
return $this->module->getMethod('Join')->onQuickJoin($group, GWF_User::getStaticOrGuest());
}
示例6: templateVotes
public function templateVotes(WC_Challenge $chall)
{
$user = GWF_User::getStaticOrGuest();
$userid = $user->getID();
$has_solved = WC_ChallSolved::hasSolved($userid, $chall->getID());
Module_WeChall::includeForums();
$form_vote = $this->getFormVote($chall, $has_solved, $userid);
$tVars = array('chall' => $chall, 'has_solved' => $has_solved, 'form_vote' => $form_vote->templateX($this->module->lang('ft_vote_chall', array($chall->display('chall_title')))));
return $this->module->templatePHP('chall_votes.php', $tVars);
}
示例7: execute
public function execute()
{
$module = $this->module;
$module instanceof Module_PageBuilder;
$user = GWF_User::getStaticOrGuest();
GWF_Website::setMetaTags($module->lang('mt_overview'));
GWF_Website::setMetaDescr($module->lang('md_overview'));
GWF_Website::setPageTitle($module->lang('overview_title'));
$tVars = array('add_perms' => $module->isAuthor($user), 'add_guest' => $module->cfgLockedPosting(), 'href_add' => GWF_WEB_ROOT . 'index.php?mo=PageBuilder&me=Add', 'href_search' => GWF_WEB_ROOT . 'index.php?mo=PageBuilder&me=Search');
return $this->module->template('overview.tpl', $tVars);
}
示例8: execute
public function execute()
{
GWF3::setConfig('log_request', false);
$back = array();
$user = GWF_User::getStaticOrGuest();
$back['news'] = (int) $this->module->getNewsCount();
$back['pm'] = (int) WC_HTML::getUnreadPMCount($user);
$back['links'] = (int) WC_HTML::getUnreadLinksCount($user);
$back['forum'] = (int) WC_HTML::getUnreadThreadCount($user);
return json_encode($back);
}
示例9: templateShowLyrics
private function templateShowLyrics(Slay_Song $song)
{
$sid = $song->getID();
$user = GWF_User::getStaticOrGuest();
$staff = $user->isStaff();
$table = GDO::table('Slay_Lyrics');
$perm = $staff ? '' : ' AND ssl_options&' . Slay_Lyrics::ENABLED;
$where = "ssl_sid={$sid}{$perm}";
$tVars = array('song' => $song, 'lyrics' => $table->selectAll('*', $where, 'ssl_date ASC', array('user'), -1, -1, GDO::ARRAY_O), 'is_admin' => $staff);
return $this->module->template('lyrics.tpl', $tVars);
}
示例10: templateSiteDetail
public function templateSiteDetail(WC_Site $site)
{
$this->module->includeVotes();
// $this->module->includeForums();
// GWF_Module::loadModuleDB('Forum', true, true);
// GWF_ForumBoard::init(true, true);
// GWF_Module::loadModuleDB('Votes', true);
$time = $this->module->cfgLastPlayersTime();
$tVars = array('site' => $site, 'boxcount' => $site->getBoxCount(), 'descr' => WC_SiteDescr::getDescription($site->getID()), 'site_quickjump' => $this->module->templateSiteQuickjumpDetail(), 'latest_players_time' => GWF_Time::humanDuration($time), 'latest_players' => $this->getLatestPlayers($time, $site->getID()), 'jquery' => Common::getGet('ajax') !== false, 'can_vote' => $site->canVote(GWF_User::getStaticOrGuest()));
$ajax = isset($_GET['ajax']) ? '_ajax' : '';
return $this->module->templatePHP('site_detail' . $ajax . '.php', $tVars);
}
示例11: templatePlaces
private function templatePlaces()
{
GWF_Website::addJavascript($this->googleMapsPath());
GWF_Website::addJavascript(GWF_WEB_ROOT_NO_LANG . 'js/module/Profile/profile.js?v=57');
// GWF_Website::addJavascript(GWF_WEB_ROOT_NO_LANG.'js/3p/fancybox/jquery.fancybox.pack.js');
// GWF_Website::addCSS(GWF_WEB_ROOT_NO_LANG.'js/3p/fancybox/jquery.fancybox.css');
// GWF_Website::addCSS(GWF_WEB_ROOT_NO_LANG.'css/profile_poi.css');
$user = GWF_User::getStaticOrGuest();
$userid = $user->getID();
$table = GDO::table('GWF_ProfilePOI');
$tVars = array('user_id' => $userid, 'is_admin' => $user->isAdmin() ? 'true' : 'false', 'total' => $table->countRows(), 'visible' => $table->countRows(GWF_ProfilePOI::wherePermissions(), array('users', 'profiles', 'whitelist')), 'js_trans' => $this->jsTrans(), 'form_delete' => $this->formDelete(), 'pois' => GWF_ProfilePOI::getPOICount($userid), 'maxp' => $this->module->cfgAllowedPOIs(), 'api_key' => $this->module->cfgMapsApiKey(), 'protocol' => Common::getProtocol(), 'init_lat' => 0, 'init_lon' => 0);
return $this->module->templatePHP('places.php', $tVars);
}
示例12: form
private function form(GWF_User $user)
{
$u = GWF_User::getStaticOrGuest();
$data = array();
if ('' === ($email = $u->getValidMail())) {
$data['email'] = array(GWF_Form::STRING, $u->getValidMail(), $this->module->lang('th_user_email'));
}
$data['message'] = array(GWF_Form::MESSAGE, '', $this->module->lang('th_message'));
if ($u->isGuest()) {
$data['captcha'] = array(GWF_Form::CAPTCHA);
}
$data['send'] = array(GWF_Form::SUBMIT, $this->module->lang('btn_sendmail'));
return new GWF_Form($this, $data);
}
示例13: getForm
private function getForm($row)
{
$user = GWF_User::getStaticOrGuest();
if ($row === false) {
$email = $user->getValidMail();
$type = 0;
$langid = GWF_Language::getCurrentID();
} else {
$email = $row->getEMail();
$type = $row->getType();
$langid = $row->getLangID();
}
$data = array('email' => array(GWF_Form::STRING, $email, $this->module->lang('th_email')), 'type' => array(GWF_Form::SELECT, GWF_Newsletter::getTypeSelectB($this->module, 'type', $type), $this->module->lang('th_type')), 'langid' => array(GWF_Form::SELECT, GWF_LangSelect::single(GWF_Language::SUPPORTED, 'langid', $langid), $this->module->lang('th_langid')), 'sign' => array(GWF_Form::SUBMIT, $this->module->lang('btn_sign'), ''));
return new GWF_Form(GDO::table('GWF_Newsletter'), $data);
}
示例14: getQuickSearchTable
private function getQuickSearchTable()
{
$user = GWF_User::getStaticOrGuest();
$orders = GDO::table('GWF_Order');
$orders instanceof GWF_Order;
$o = Common::getGet('o') !== false;
$bit = $o ? 'o' : 't';
$sortURL = $this->getMethodHref('&' . $bit . '=1&by=%BY%&dir=%DIR%');
$fields = $orders->getSearchableFields($user);
$term = Common::getRequestString('term', '');
// var_dump($fields, $term);
if (false === ($conditions = GWF_QuickSearch::getQuickSearchConditions($orders, $fields, $term))) {
$conditions = '0';
}
return GWF_TableGDO::display($this->module, $orders, $user, $sortURL, $conditions, 25, true);
}
示例15: validateType
public static function validateType(Module_PageBuilder $m, $arg, $locked_mode)
{
switch ($arg) {
case GWF_Page::SMARTY:
case GWF_Page::HTML:
if ($m->isAuthor(GWF_User::getStaticOrGuest())) {
return false;
}
break;
case GWF_Page::BBCODE:
return false;
default:
break;
}
return $m->lang('err_type');
}