本文整理汇总了PHP中absolute_url函数的典型用法代码示例。如果您正苦于以下问题:PHP absolute_url函数的具体用法?PHP absolute_url怎么用?PHP absolute_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了absolute_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: viewerHead
/**
* Queue header scripts
*
* Queues script libraries and stylesheets to include in header
*
* @return null
*/
public function viewerHead($params)
{
$libUrl = absolute_url('plugins/MultimediaDisplay/libraries/mediaelement/build/');
$libUrl = str_replace('admin/', '', $libUrl);
queue_js_url($libUrl . 'mediaelement-and-player.min.js');
queue_css_url($libUrl . 'mediaelementplayer.css');
}
示例2: viewerHead
/**
* Queue header scripts
*
* Queues script libraries and stylesheets to include in header
*
* @return null
*/
public function viewerHead($params)
{
$libDir = dirname(dirname(dirname(__FILE__))) . '/libraries/ohmsviewer/';
$config = parse_ini_file($libDir . "config/config.ini", true);
if (empty($params['cacheFileName'])) {
throw new Exception('Item cannot be displayed. No cache file specified for Ohms Viewer.');
return;
}
$cachefile = is_array($params['cacheFileName']) ? $params['cacheFileName'][0] : $params['cacheFileName'];
require_once $libDir . 'lib/CacheFile.class.php';
$liburl = absolute_url('/plugins/MultimediaDisplay/libraries/ohmsviewer/');
$liburl = str_replace('admin/', '', $liburl);
$cssurl = $liburl . 'css/';
$jsurl = $liburl . 'js/';
//queue_css_url($cssurl.$config['css']);
queue_css_url($cssurl . 'viewer.css');
queue_css_url($cssurl . 'jquery-ui.toggleSwitch.css');
queue_css_url($cssurl . 'jquery-ui-1.8.16.custom.css');
queue_css_url($cssurl . 'font-awesome.css');
queue_css_url($cssurl . 'jquery.fancybox.css');
queue_css_url($cssurl . 'jquery.fancybox-buttons.css');
queue_css_url($cssurl . 'jquery.fancybox-thumbs.css');
queue_css_url($cssurl . 'jplayer.blue.monday.css');
queue_js_url('//ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js');
queue_js_url($jsurl . 'jquery-ui.toggleSwitch.js');
queue_js_url($jsurl . 'viewer_legacy.js');
queue_js_url($jsurl . 'jquery.jplayer.min.js');
queue_js_url($jsurl . 'jquery.easing.1.3.js');
queue_js_url($jsurl . 'jquery.scrollTo-min.js');
queue_js_url($jsurl . 'fancybox_2_1_5/source/jquery.fancybox.pack.js');
queue_js_url($jsurl . 'fancybox_2_1_5/source/helpers/jquery.fancybox-buttons.js');
queue_js_url($jsurl . 'fancybox_2_1_5/source/helpers/jquery.fancybox-media.js');
queue_js_url($jsurl . 'fancybox_2_1_5/source/helpers/jquery.fancybox-thumbs.js');
}
示例3: universalViewer
/**
* Get the specified UniversalViewer.
*
* @param array $args Associative array of optional values:
* - (string) id: The unique main id.
* - (integer|Record) record: The record is the item if it's an integer.
* - (string) type: Type of record if record is integer (item by default).
* - (integer|Item) item
* - (integer|Collection) collection
* - (integer|File) file
* - (string) class
* - (string) width
* - (string) height
* - (string) locale
* The only one record is defined according to the priority above.
* @return string. The html string corresponding to the UniversalViewer.
*/
public function universalViewer($args = array())
{
$record = $this->_getRecord($args);
if (empty($record)) {
return '';
}
// Some specific checks.
switch (get_class($record)) {
case 'Item':
// Currently, item without files is unprocessable.
if ($record->fileCount() == 0) {
return __('This item has no files and is not displayable.');
}
break;
case 'Collection':
if ($record->totalItems() == 0) {
return __('This collection has no item and is not displayable.');
}
break;
}
$class = isset($args['class']) ? $args['class'] : get_option('universalviewer_class');
if (!empty($class)) {
$class = ' ' . $class;
}
$width = isset($args['width']) ? $args['width'] : get_option('universalviewer_width');
if (!empty($width)) {
$width = ' width:' . $width . ';';
}
$height = isset($args['height']) ? $args['height'] : get_option('universalviewer_height');
if (!empty($height)) {
$height = ' height:' . $height . ';';
}
$locale = isset($args['locale']) ? $args['locale'] : get_option('universalviewer_locale');
if (!empty($locale)) {
$locale = ' data-locale="' . $locale . '"';
}
if (isset($args['only_images'])) {
$manif = 'universalviewer_presentation_alternative_manifest';
} else {
$manif = 'universalviewer_presentation_manifest';
}
if (isset($args['current_image'])) {
$currentImage = $args['current_image'];
} else {
$currentImage = 99999;
}
$urlManifest = absolute_url(array('recordtype' => Inflector::tableize(get_class($record)), 'id' => $record->id, 'image' => $currentImage), $manif);
if (isset($args['only_images'])) {
$config = src('config-images', 'universal-viewer', 'json');
} else {
$config = src('config', 'universal-viewer', 'json');
}
$urlJs = src('embed', 'javascripts/uv/lib', 'js');
$imageClass = 'images';
$html = sprintf('<div class="uv%s %s" data-config="%s" data-uri="%s"%s style="background-color: #000;%s%s"></div>', $class, $imageClass, $config, $urlManifest, $locale, $width, $height);
$html .= sprintf('<script type="text/javascript" id="embedUV" src="%s"></script>', $urlJs);
$html .= '<script type="text/javascript">/* wordpress fix */</script>';
return $html;
}
示例4: get_recommended_user_func
function get_recommended_user_func()
{
global $mybb, $db, $lang, $users, $tapatalk_users;
$tapatalk_users = array();
$users = array();
// Load global language phrases
$lang->load("memberlist");
//get tapatalk users
if (isset($_POST['mode']) && $_POST['mode'] == 2) {
$sql = "SELECT userid FROM " . TABLE_PREFIX . "tapatalk_users";
$query = $db->query($sql);
while ($user = $db->fetch_array($query)) {
$tapatalk_users[] = $user['userid'];
}
}
// get pm users
$sql = "SELECT p.toid as uid\n\tFROM " . TABLE_PREFIX . "privatemessages p \n\tWHERE p.uid = " . $mybb->user['uid'] . "\n\tGROUP BY p.toid\n\tLIMIT 0,1000";
get_recommended_user_list($sql, 'contact');
// get pm me users
$sql = "SELECT p.uid as uid\n\tFROM " . TABLE_PREFIX . "privatemessages p \n\tWHERE p.toid = " . $mybb->user['uid'] . "\n\tGROUP BY p.uid\n\tLIMIT 0,1000";
get_recommended_user_list($sql, 'contact');
//get sub topic users
$sql = "SELECT t.uid as uid\n\tFROM " . TABLE_PREFIX . "threadsubscriptions ts \n\tLEFT JOIN " . TABLE_PREFIX . "threads t ON ts.tid = t.tid \n\tWHERE ts.uid = " . $mybb->user['uid'] . "\n\tGROUP BY t.uid\n\tLIMIT 0,1000";
get_recommended_user_list($sql, 'watch');
//get sub me topic users
$sql = "SELECT ts.uid as uid\n\tFROM " . TABLE_PREFIX . "threadsubscriptions ts \n\tRIGHT JOIN " . TABLE_PREFIX . "threads t ON ts.tid = t.tid \n\tWHERE t.uid = " . $mybb->user['uid'] . "\n\tGROUP BY ts.uid\n\tLIMIT 0,1000";
get_recommended_user_list($sql, 'watch');
//get like or thank users
$prefix = "g33k_thankyoulike_";
if (file_exists('thankyoulike.php') && $db->table_exists($prefix . 'thankyoulike')) {
$sql = "SELECT thl.puid as uid\n\t\tFROM " . TABLE_PREFIX . $prefix . "thankyoulike thl \n\t\tWHERE thl.uid = " . $mybb->user['uid'] . "\n\t\tGROUP BY thl.puid\n\t\tLIMIT 0,1000";
get_recommended_user_list($sql, 'like');
$sql = "SELECT thl.uid as uid\n\t\tFROM " . TABLE_PREFIX . $prefix . "thankyoulike thl \n\t\tWHERE thl.puid = " . $mybb->user['uid'] . "\n\t\tGROUP BY thl.uid\n\t\tLIMIT 0,1000";
get_recommended_user_list($sql, 'liked');
}
$page = intval($_POST['page']);
$perpage = intval($_POST['perpage']);
$start = ($page - 1) * $perpage;
$return_user_lists = array();
$users_rank = tapa_rank_users($users);
$total = count($users_rank);
$users_slice = array_slice($users_rank, $start, $perpage);
$user_id_str = implode(',', $users_slice);
$mobi_api_key = loadAPIKey();
if (!empty($user_id_str)) {
$sql = "SELECT uid,username,email,avatar FROM " . TABLE_PREFIX . "users WHERE uid IN({$user_id_str})";
$query = $db->query($sql);
while ($user = $db->fetch_array($query)) {
$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
if ($user['avatar'] != '') {
$user['avatar'] = absolute_url($user['avatar']);
}
$return_user_lists[] = new xmlrpcval(array('username' => new xmlrpcval(basic_clean($user['username']), 'base64'), 'user_id' => new xmlrpcval($user['uid'], 'string'), 'icon_url' => new xmlrpcval($user['avatar'], 'string'), 'type' => new xmlrpcval('', 'string'), 'enc_email' => new xmlrpcval(base64_encode(encrypt(trim($user['email']), $mobi_api_key)), 'string')), 'struct');
}
}
$suggested_users = new xmlrpcval(array('total' => new xmlrpcval($total, 'int'), 'list' => new xmlrpcval($return_user_lists, 'array')), 'struct');
return new xmlrpcresp($suggested_users);
}
示例5: link_to
function link_to($url, $text, $class = '')
{
$uri = absolute_url($url);
if (empty($class)) {
return "<a href=\"{$uri}\">{$text}</a>";
} else {
return "<a href=\"{$uri}\" class=\"{$class}\">{$text}</a>";
}
}
示例6: logout
function logout()
{
if (isset($_SESSION["soap_session"])) {
//print "Unsetting";
unset($_SESSION["soap_session"]);
}
$url = absolute_url('index.php?errors=2');
header("Location: {$url}");
}
示例7: gu_subscription_process
/**
* Processes (un)subscription requests to multiple lists
* @param string $address The email address
* @param array $list_ids The ids of the lists
* @param bool $subscribe TRUE if addresss should be subscribed to the lists, FALSE if it should be unsubscribed
* @return bool TRUE if operation was successful, else FALSE
*/
function gu_subscription_process($address, &$list_ids, $subscribe)
{
if (!check_email($address)) {
return gu_error(t("Invalid email address"));
}
$succ_list_names = array();
$fail_list_names = array();
// For each list we need to load it with all addresses
foreach ($list_ids as $list_id) {
$list = gu_list::get($list_id, TRUE);
// Don't allow subscriptions to private lists
if ($list->is_private()) {
$res = FALSE;
} else {
if ($subscribe) {
$res = $list->add($address, TRUE);
} else {
$res = $list->remove($address, TRUE);
}
}
if ($res) {
$succ_list_names[] = $list->get_name();
} else {
$fail_list_names[] = $list->get_name();
}
}
// Check if there were any successful
if (count($succ_list_names) < 1) {
return FALSE;
}
// Work out if we need to send any emails now, and if so create a sender
if (gu_config::get('list_send_welcome') || gu_config::get('list_send_goodbye') || gu_config::get('list_subscribe_notify') || gu_config::get('list_unsubscribe_notify')) {
$mailer = new gu_mailer();
if ($mailer->init()) {
$subject_prefix = count($succ_list_names) == 1 ? $succ_list_names[0] : gu_config::get('collective_name');
// Send welcome / goodbye message
if ($subscribe && gu_config::get('list_send_welcome') || !$subscribe && gu_config::get('list_send_goodbye')) {
$subject = '[' . $subject_prefix . '] ' . ($subscribe ? t('Subscription') : t('Unsubscription')) . t(' confirmation');
$action = $subscribe ? t('subscribed to') : t('unsubscribed from');
$text = t("This is an automated message to confirm that you have been % the following lists:", array($action)) . "\n\n* " . implode("\n* ", $succ_list_names) . "\n\n";
$text .= t('To change your subscriptions visit: ') . absolute_url('subscribe.php') . '?addr=' . $address . "\n\n";
$text .= t('Please do not reply to this message. Thank you.');
$mailer->send_mail($address, $subject, $text);
}
// Send admin notifications
if ($subscribe && gu_config::get('list_subscribe_notify') || !$subscribe && gu_config::get('list_unsubscribe_notify')) {
$subject = '[' . $subject_prefix . '] ' . ($subscribe ? t('Subscription') : t('Unsubscription')) . t(' notification');
$action = $subscribe ? t('subscribed to') : t('unsubscribed from');
$text = t("This is an automated message to notify you that % has been % the following lists:", array($address, $action)) . "\n\n* " . implode("\n* ", $succ_list_names) . "\n\n";
$mailer->send_admin_mail($subject, $text);
}
}
}
$action = $subscribe ? t('subscribed to') : t('unsubscribed from');
return gu_success(t('You have been % lists: <i>%</i>', array($action, implode('</i>, <i>', $succ_list_names))));
}
示例8: prefetch_account_func
function prefetch_account_func()
{
global $mybb, $db;
$user = tt_get_user_by_email($mybb->input['email']);
if (empty($user['uid'])) {
error("Can't find the user");
}
$result = array('result' => new xmlrpcval(true, 'boolean'), 'result_text' => new xmlrpcval('', 'base64'), 'user_id' => new xmlrpcval($user['uid'], 'string'), 'login_name' => new xmlrpcval(basic_clean($user['username']), 'base64'), 'display_name' => new xmlrpcval(basic_clean($user['username']), 'base64'), 'avatar' => new xmlrpcval(absolute_url($user['avatar']), 'string'));
return new xmlrpcresp(new xmlrpcval($result, 'struct'));
}
示例9: hookPublicItemsShow
public function hookPublicItemsShow($args)
{
$item = $args['item'];
$uri = absolute_url(array('controller' => 'items', 'action' => 'embed', 'id' => $item->id), 'id');
$html = "<div id='embed-codes'><h2>" . __('Embed') . "</h2>";
$html .= "<p>" . __("Copy the code below into your web page") . "</p>";
$iFrameHtml = "<iframe class='omeka-embed' src='{$uri}' style='margin: 2em 0; border: 1px solid #e7e7e7' width='315px' height='285px' frameborder='0' allowfullscreen></iframe>";
$html .= "<textarea id='embed-code-text' style='font-family:monospace' rows='4'>{$iFrameHtml}</textarea>";
$html .= "</div>";
echo $html;
}
示例10: viewerHead
/**
* Queue header scripts
*
* Queues script libraries and stylesheets to include in header
*
* @return null
*/
public function viewerHead($params)
{
if (is_array($params['url'])) {
$liburl = absolute_url('/plugins/MultimediaDisplay/libraries/bookreader/', '', array(), true);
$liburl = str_replace('admin/', '', $liburl);
queue_js_url('http://www.archive.org/bookreader/jquery-ui-1.8.5.custom.min.js');
queue_js_url('http://www.archive.org/bookreader/dragscrollable.js');
queue_js_url('http://www.archive.org/bookreader/jquery.colorbox-min.js');
queue_js_url('http://www.archive.org/bookreader/jquery.ui.ipad.js');
queue_js_url('http://www.archive.org/bookreader/jquery.bt.min.js');
queue_js_url($liburl . 'BookReader.js');
}
}
示例11: getBodyHtml
/**
* Retrieve body html
*
* Retrieves markup to include in the main content body of item show pages
*
* @return string Html to include in the header,
* linking to stylesheets and javascript libraries
*/
public function getBodyHtml($params)
{
$liburl = absolute_url('plugins/MultimediaDisplay/libraries/bookreader/');
$liburl = str_replace('admin/', '', $liburl);
ob_start();
?>
<div id="viewer"></div>
<script type="text/javascript" src="<?php
echo $liburl . 'MiradorDeploy.js';
?>
" />
<?php
return ob_get_clean();
}
示例12: getBookReader
/**
* Get the specified BookReader.
*
* @param array $args Associative array of optional values:
* - (integer|Item) item: The item is the current one if not set.
* - (integer) page: set the page to be shown when including the iframe.
* - (boolean) embed_functions: include buttons (Zoom, Search...).
* - (integer) mode_page: allow to display 1 or 2 pages side-by-side.
* - (integer) part: can be used to display the specified part of a book.
*
* @return string. The html string corresponding to the BookReader.
*/
public function getBookReader($args = array())
{
if (!isset($args['item'])) {
$item = get_current_record('item');
} elseif ($args['item'] instanceof Item) {
$item = $args['item'];
} else {
$item = get_record_by_id('Item', (int) $args['item']);
}
if (empty($item)) {
return '';
}
$part = empty($args['part']) ? 0 : (int) $args['part'];
$page = empty($args['page']) ? '0' : $args['page'];
// Currently, all or none functions are enabled.
$embed_functions = isset($args['embed_functions']) ? $args['embed_functions'] : get_option('bookreader_embed_functions');
// TODO Count leaves, not files.
if ($item->fileCount() > 1) {
$mode_page = isset($args['mode_page']) ? $args['mode_page'] : get_option('bookreader_mode_page');
} else {
$mode_page = 1;
}
// Build url of the page with iframe.
$queryParams = array();
if ($part > 1) {
$queryParams['part'] = $part;
}
if (empty($embed_functions)) {
$queryParams['ui'] = 'embed';
}
$url = absolute_url(array('id' => $item->id), 'bookreader_viewer', $queryParams);
$url .= '#';
$url .= empty($page) ? '' : 'page/n' . $page . '/';
$url .= 'mode/' . $mode_page . 'up';
$class = get_option('bookreader_class');
if (!empty($class)) {
$class = ' class="' . $class . '"';
}
$width = get_option('bookreader_width');
if (!empty($width)) {
$width = ' width="' . $width . '"';
}
$height = get_option('bookreader_height');
if (!empty($height)) {
$height = ' height="' . $height . '"';
}
$html = '<div><iframe src="' . $url . '"' . $class . $width . $height . ' frameborder="0"></iframe></div>';
return $html;
}
示例13: parse
function parse()
{
$this->links = array();
$nodes = $this->api->xpath->query("//a/@href");
if (!$nodes->length) {
$nodes = $this->api->xpath->query("//enclosure/@url");
}
if ($nodes->length) {
foreach ($nodes as $node) {
if ($link = $this->check_link($node->value)) {
$this->links[$link] = array('url' => absolute_url($link, $this->base), 'title' => empty($node->ownerElement->textContent) ? basename($link) : trim($node->ownerElement->textContent));
}
}
}
}
示例14: viewerHead
/**
* Queue header scripts
*
* Queues script libraries and stylesheets to include in header
*
* @return null
*/
public function viewerHead($params)
{
$liburl = absolute_url('/plugins/MultimediaDisplay/libraries/pdf/', '', array(), true);
$liburl = str_replace('admin/', '', $liburl);
queue_js_url($liburl . 'src/shared/util.js');
queue_js_url($liburl . 'src/display/api.js');
queue_js_url($liburl . 'src/display/metadata.js');
queue_js_url($liburl . 'src/display/canvas.js');
queue_js_url($liburl . 'src/display/webgl.js');
queue_js_url($liburl . 'src/display/pattern_helper.js');
queue_js_url($liburl . 'src/display/font_loader.js');
queue_js_url($liburl . 'src/display/annotation_helper.js');
queue_js_string('PDFJS.workerSrc = \'' . $liburl . 'src/worker_loader.js\';');
queue_js_string('pdfFile = \'' . $params['url'][0]['url'] . '\';');
queue_js_url($liburl . 'displayPDF.js');
}
示例15: getJSON
function getJSON($arguments)
{
// important for url_for() links
define('FORCE_NO_RELATIVE', true);
if (!in_array($arguments['currency1'], get_all_currencies())) {
throw new \Exception("Invalid currency '" . $arguments['currency1'] . "'");
}
if (!in_array($arguments['currency2'], get_all_currencies())) {
throw new \Exception("Invalid currency '" . $arguments['currency2'] . "'");
}
$q = db()->prepare("SELECT * FROM ticker_recent WHERE currency1=? AND currency2=? ORDER BY volume DESC");
$q->execute(array($arguments['currency1'], $arguments['currency2']));
$result = array();
while ($ticker = $q->fetch()) {
$result[] = array('exchange' => $ticker['exchange'], 'last_trade' => $ticker['last_trade'], 'bid' => $ticker['bid'], 'ask' => $ticker['ask'], "volume" => $ticker['volume'], 'time' => $ticker['created_at'], 'url' => absolute_url(url_for('historical', array('id' => $ticker['exchange'] . "_" . $ticker['currency1'] . $ticker['currency2'] . "_daily"))));
}
if (!$result) {
throw new \Exception("No rates found");
}
return $result;
}