本文整理汇总了PHP中PSU::fbAPI方法的典型用法代码示例。如果您正苦于以下问题:PHP PSU::fbAPI方法的具体用法?PHP PSU::fbAPI怎么用?PHP PSU::fbAPI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PSU
的用法示例。
在下文中一共展示了PSU::fbAPI方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* __construct
*
* Initial object setup.
*
* @param string|boolean $uid_or_auto indicates how cache and template directories should be set. uid specifies a unique id to build names, true generates paths automatically. leave blank or false to specify these paths yourself.
*/
function __construct($params = null, $fluid = false, $uid_or_auto = true)
{
static::$GLOBAL_STYLE = PSU_BASE_DIR . '/app/core/templates';
parent::__construct($uid_or_auto);
if ($_SESSION['impersonate']) {
\PSU::get('log/impersonate')->write('Impersonation' . (\PSU::isDev() ? ' on dev server' : '') . ': accessing ' . $_SERVER['REQUEST_URI'] . ($_SERVER['HTTP_REFERER'] ? ' via ' . $_SERVER['HTTP_REFERER'] : ''), $_SESSION['username'], serialize($_REQUEST));
}
//end if
if ($GLOBALS['TEMPLATES']) {
$this->template_dir = $GLOBALS['TEMPLATES'];
}
if (!isset($GLOBALS['USE_APPLICATION_STYLE'])) {
$GLOBALS['USE_APPLICATION_STYLE'] = true;
}
if ($params) {
parse_str($params, $params);
$key = key($params);
if (!$params[$key]) {
$params['page_title'] = str_replace('_', ' ', $key);
}
//end if
}
//end if
$this->page_title = $params['page_title'];
$this->app_title = $params['app_title'] ? $params['app_title'] : ($GLOBALS['TITLE'] ? $GLOBALS['TITLE'] : 'PSU Webapp');
$this->fluid = $params['fluid'] ? $params['fluid'] : $fluid;
// register any custom functions
$this->register_block('box', array($this, 'psu_box'));
$this->register_block('col', array($this, 'psu_col'));
$this->register_block('message', array($this, 'psu_message'));
$this->register_modifier('yesno', array($this, 'yesno'));
$this->register_modifier('pluralize', array($this, 'pluralize'));
$this->register_modifier('query_string', 'http_build_query');
$this->register_function('myrel_access', array($this, 'myrel_access'));
$this->register_function('myrel_list', array($this, 'myrel_list'));
$this->register_function('randomid', array($this, 'randomid'));
$this->register_function('nav', array($this, 'nav'));
$this->register_function('navselect', array($this, 'navselect'));
$this->register_modifier('bool2str', array($this, 'bool2str'));
$this->content_classes = array(\PSU::isDev() ? 'webapp-dev' : 'webapp-prod');
$this->body_style_classes = array();
$this->body_style_classes[] = strtolower('month-' . date('F'));
$this->body_style_classes[] = strtolower('weekday-' . date('l'));
$this->body_style_classes[] = 'week-' . date('W');
$this->body_style_classes[] = 'day-of-year-' . date('z');
$this->body_style_classes[] = 'day-of-month-' . date('j');
$this->body_style_classes[] = 'hour-' . date('H');
$this->body_style_classes[] = 'minute-' . date('i');
if ($_SESSION['username']) {
$this->body_style_classes[] = 'user-' . $_SESSION['username'];
}
//end if
if ($_SESSION['wp_id']) {
$this->body_style_classes[] = 'user-' . $_SESSION['wp_id'];
}
//end if
if ($GLOBALS['FANCY_TPL']) {
$this->body_style_classes[] = 'extra-tag-styles';
}
$this->assign('facebook_api', \PSU::fbAPI());
$this->assign('facebook_enable', $GLOBALS['FACEBOOK_ENABLE'] == true);
$go = new \go($_SESSION['wp_id'] ? $_SESSION['wp_id'] : $_SESSION['username']);
$hot_links = $go->cacheGetSites($_SESSION['wp_id'] || $_SESSION['username'] ? 'popular-me' : 'popular-everyone');
if (sizeof($hot_links) < 5 && $_SESSION['username']) {
$everyone_links = $go->cacheGetSites('popular-everyone');
$hot_links = array_merge($hot_links, $everyone_links);
$hot_links = array_unique($hot_links);
}
//end if
$this->assign('webapp_hot_links', $hot_links);
// cdn base url; omit trailing slash
$this->assign('cdn', substr(\PSU::cdn(), 0, -1));
if (\PSU::mobile() && $_COOKIE['psumobile'] != 'disable' || $_COOKIE['psumobile'] == 'force') {
$this->mobile = true;
}
//end if
}