本文整理汇总了PHP中Plugin::staticPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Plugin::staticPath方法的具体用法?PHP Plugin::staticPath怎么用?PHP Plugin::staticPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plugin
的用法示例。
在下文中一共展示了Plugin::staticPath方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: settings
static function settings($setting)
{
/* · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·
· ·
· S E T T I N G S ·
· ·
· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · */
// THESE SETTINGS CAN BE OVERRIDDEN IN CONFIG.PHP
// e.g. $config['site']['qvitter']['enabledbydefault'] = false;
// ENABLED BY DEFAULT (true/false)
$settings['enabledbydefault'] = true;
// DEFAULT BACKGROUND COLOR
$settings['defaultbackgroundcolor'] = '#f4f4f4';
// DEFAULT BACKGROUND IMAGE
$settings['sitebackground'] = 'img/vagnsmossen.jpg';
// DEFAULT FAVICON
$settings['favicon'] = 'img/favicon.ico?v=5';
// DEFAULT SPRITE
$settings['sprite'] = Plugin::staticPath('Qvitter', '') . 'img/sprite.png?v=41';
// DEFAULT LINK COLOR
$settings['defaultlinkcolor'] = '#0084B4';
// ENABLE DEFAULT WELCOME TEXT
$settings['enablewelcometext'] = true;
// CUSTOM WELCOME TEXT (overrides the previous setting)
$settings['customwelcometext'] = false;
// Example:
// $settings['customwelcometext']['sv'] = '<h1>Välkommen till Quitter.se – en federerad<sup>1</sup> mikrobloggsallmänning!</h1><p>Etc etc...</p>';
// $settings['customwelcometext']['en'] = '<h1>Welcome to Quitter.se – a federated microblog common!</h1><p>Etc etc...</p>';
// TIME BETWEEN POLLING
$settings['timebetweenpolling'] = 5000;
// ms
// URL SHORTENER
$settings['urlshortenerapiurl'] = 'http://qttr.at/yourls-api.php';
$settings['urlshortenersignature'] = 'b6afeec983';
// CUSTOM TERMS OF USE
$settings['customtermsofuse'] = false;
// IP ADDRESSES BLOCKED FROM REGISTRATION
$settings['blocked_ips'] = array();
// LINKIFY DOMAINS WITHOUT PROTOCOL AS DEFAULT
$settings['linkify_bare_domains'] = true;
/* · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·
· ·
· (o> >o) ·
· \\\\_\ /_//// .
· \____) (____/ ·
· ·
· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · */
// config.php settings override the settings in this file
$configphpsettings = common_config('site', 'qvitter') ?: array();
foreach ($configphpsettings as $configphpsetting => $value) {
$settings[$configphpsetting] = $value;
}
// set linkify setting
common_config_set('linkify', 'bare_domains', $settings['linkify_bare_domains']);
if (isset($settings[$setting])) {
return $settings[$setting];
} else {
return false;
}
}
示例2: showContent
function showContent()
{
$this->elementStart('fieldset');
$facebook = Facebookclient::getFacebook();
$params = array('scope' => 'read_stream,publish_stream,offline_access,user_status,user_location,user_website,email', 'redirect_uri' => common_local_url('facebookfinishlogin'));
// Degrade to plain link if JavaScript is not available
$this->elementStart('a', array('href' => $facebook->getLoginUrl($params), 'id' => 'facebook_button'));
$attrs = array('src' => Plugin::staticPath('FacebookBridge', 'images/login-button.png'), 'alt' => _m('Login with Facebook'), 'title' => _m('Login with Facebook.'));
$this->element('img', $attrs);
$this->elementEnd('a');
$this->elementEnd('fieldset');
}
示例3: showContent
function showContent()
{
$this->elementStart('fieldset');
$facebook = Facebookclient::getFacebook();
// Degrade to plain link if JavaScript is not available
$this->elementStart('a', array('href' => $facebook->getLoginUrl(array('next' => common_local_url('facebookfinishlogin'), 'cancel' => common_local_url('facebooklogin'), 'req_perms' => 'read_stream,publish_stream,offline_access,user_status,user_location,user_website,email')), 'id' => 'facebook_button'));
$attrs = array('src' => Plugin::staticPath('FacebookBridge', 'images/login-button.png'), 'alt' => _m('Login with Facebook'), 'title' => _m('Login with Facebook.'));
$this->element('img', $attrs);
$this->elementEnd('a');
/*
$this->element('div', array('id' => 'fb-root'));
$this->script(
sprintf(
'http://connect.facebook.net/en_US/all.js#appId=%s&xfbml=1',
common_config('facebook', 'appid')
)
);
$this->element('fb:facepile', array('max-rows' => '2', 'width' =>'300'));
*/
$this->elementEnd('fieldset');
}
示例4: getAvatar
/**
* Get an appropriate avatar image source URL, if available.
*
* @param ActivityObject $actor
* @param DOMElement $feed
* @return string
*/
protected static function getAvatar(ActivityObject $actor, DOMElement $feed)
{
$url = '';
$icon = '';
if ($actor->avatar) {
$url = trim($actor->avatar);
}
if (!$url) {
// Check <atom:logo> and <atom:icon> on the feed
$els = $feed->childNodes();
if ($els && $els->length) {
for ($i = 0; $i < $els->length; $i++) {
$el = $els->item($i);
if ($el->namespaceURI == Activity::ATOM) {
if (empty($url) && $el->localName == 'logo') {
$url = trim($el->textContent);
break;
}
if (empty($icon) && $el->localName == 'icon') {
// Use as a fallback
$icon = trim($el->textContent);
}
}
}
}
if ($icon && !$url) {
$url = $icon;
}
}
if ($url) {
$opts = array('allowed_schemes' => array('http', 'https'));
if (common_valid_http_url($url)) {
return $url;
}
}
return Plugin::staticPath('OStatus', 'images/96px-Feed-icon.svg.png');
}
示例5: showQvitter
function showQvitter()
{
$logged_in_user_nickname = '';
$logged_in_user_obj = false;
$logged_in_user = common_current_user();
if ($logged_in_user) {
$logged_in_user_nickname = $logged_in_user->nickname;
$logged_in_user_obj = ApiAction::twitterUserArray($logged_in_user->getProfile());
}
$registrationsclosed = false;
if (common_config('site', 'closed') == 1 || common_config('site', 'inviteonly') == 1) {
$registrationsclosed = true;
}
// check if the client's ip address is blocked for registration
if (is_array(QvitterPlugin::settings("blocked_ips"))) {
$client_ip_is_blocked = in_array($_SERVER['REMOTE_ADDR'], QvitterPlugin::settings("blocked_ips"));
}
$sitetitle = common_config('site', 'name');
$siterootdomain = common_config('site', 'server');
$qvitterpath = Plugin::staticPath('Qvitter', '');
$apiroot = common_path('api/', StatusNet::isHTTPS());
$attachmentroot = common_path('attachment/', StatusNet::isHTTPS());
$instanceurl = common_path('', StatusNet::isHTTPS());
// user's browser's language setting
$user_browser_language = 'en';
// use english if we can't find the browser language
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$user_browser_language = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
}
common_set_returnto('');
// forget this
// if this is a profile we add a link header for LRDD Discovery (see WebfingerPlugin.php)
if (substr_count($_SERVER['REQUEST_URI'], '/') == 1) {
$nickname = substr($_SERVER['REQUEST_URI'], 1);
if (preg_match("/^[a-zA-Z0-9]+\$/", $nickname) == 1) {
$acct = 'acct:' . $nickname . '@' . common_config('site', 'server');
$url = common_local_url('webfinger') . '?resource=' . $acct;
foreach (array(Discovery::JRD_MIMETYPE, Discovery::XRD_MIMETYPE) as $type) {
header('Link: <' . $url . '>; rel="' . Discovery::LRDD_REL . '"; type="' . $type . '"');
}
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php
print $sitetitle;
?>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
<link rel="stylesheet" type="text/css" href="<?php
print $qvitterpath;
?>
css/qvitter.css?changed=<?php
print date('YmdHis', filemtime(QVITTERDIR . '/css/qvitter.css'));
?>
" />
<link rel="stylesheet" type="text/css" href="<?php
print $qvitterpath;
?>
css/jquery.minicolors.css" />
<link rel="shortcut icon" type="image/x-icon" href="<?php
print $qvitterpath;
print QvitterPlugin::settings("favicon");
?>
">
<?php
// if qvitter is a webapp and this is a users url we add feeds
if (substr_count($_SERVER['REQUEST_URI'], '/') == 1) {
$nickname = substr($_SERVER['REQUEST_URI'], 1);
if (preg_match("/^[a-zA-Z0-9]+\$/", $nickname) == 1) {
$user = User::getKV('nickname', $nickname);
if (!isset($user->id)) {
//error_log("QVITTER: Could not get user id for user with nickname: $nickname – REQUEST_URI: ".$_SERVER['REQUEST_URI']);
} else {
print '<link title="Notice feed for ' . $nickname . ' (Activity Streams JSON)" type="application/stream+json" href="' . $instanceurl . 'api/statuses/user_timeline/' . $user->id . '.as" rel="alternate">' . "\n";
print ' <link title="Notice feed for ' . $nickname . ' (RSS 1.0)" type="application/rdf+xml" href="' . $instanceurl . $nickname . '/rss" rel="alternate">' . "\n";
print ' <link title="Notice feed for ' . $nickname . ' (RSS 2.0)" type="application/rss+xml" href="' . $instanceurl . 'api/statuses/user_timeline/' . $user->id . '.rss" rel="alternate">' . "\n";
print ' <link title="Notice feed for ' . $nickname . ' (Atom)" type="application/atom+xml" href="' . $instanceurl . 'api/statuses/user_timeline/' . $user->id . '.atom" rel="alternate">' . "\n";
print ' <link title="FOAF for ' . $nickname . '" type="application/rdf+xml" href="' . $instanceurl . $nickname . '/foaf" rel="meta">' . "\n";
print ' <link href="' . $instanceurl . $nickname . '/microsummary" rel="microsummary">' . "\n";
// maybe openid
if (array_key_exists('OpenID', StatusNet::getActivePlugins())) {
print ' <link rel="openid2.provider" href="' . common_local_url('openidserver') . '"/>' . "\n";
print ' <link rel="openid2.local_id" href="' . $user->getProfile()->profileurl . '"/>' . "\n";
print ' <link rel="openid2.server" href="' . common_local_url('openidserver') . '"/>' . "\n";
print ' <link rel="openid2.delegate" href="' . $user->getProfile()->profileurl . '"/>' . "\n";
}
}
}
} elseif (substr($_SERVER['REQUEST_URI'], 0, 7) == '/group/') {
$group_id_or_name = substr($_SERVER['REQUEST_URI'], 7);
if (stristr($group_id_or_name, '/id')) {
$group_id_or_name = substr($group_id_or_name, 0, strpos($group_id_or_name, '/id'));
$group = User_group::getKV('id', $group_id_or_name);
if ($group instanceof User_group) {
$group_name = $group->nickname;
//.........这里部分代码省略.........
示例6: showScripts
function showScripts()
{
parent::showScripts();
$this->script(Plugin::staticPath('Bookmark', 'bookmarkpopup.js'));
}
示例7: _getScripts
function _getScripts()
{
if (common_config('site', 'minify')) {
$js = 'realtimeupdate.min.js';
} else {
$js = 'realtimeupdate.js';
}
return array(Plugin::staticPath('Realtime', $js));
}
示例8: _getScripts
function _getScripts()
{
return array(Plugin::staticPath('Realtime', 'realtimeupdate.min.js'));
}
示例9: showContent
function showContent()
{
$this->elementStart('a', array('href' => common_local_url('twitterauthorization', null, array('signin' => true))));
$this->element('img', array('src' => Plugin::staticPath('TwitterBridge', 'Sign-in-with-Twitter-lighter.png'), 'alt' => _m('Sign in with Twitter')));
$this->elementEnd('a');
}