本文整理汇总了PHP中NextendUri::getBaseUri方法的典型用法代码示例。如果您正苦于以下问题:PHP NextendUri::getBaseUri方法的具体用法?PHP NextendUri::getBaseUri怎么用?PHP NextendUri::getBaseUri使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NextendUri
的用法示例。
在下文中一共展示了NextendUri::getBaseUri方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getData
function getData($number)
{
nextendimport('nextend.database.database');
$db = NextendDatabase::getInstance();
require_once JPATH_ADMINISTRATOR . '/components/com_redshop/helpers/redshop.cfg.php';
require_once JPATH_ADMINISTRATOR . '/components/com_redshop/helpers/configuration.php';
require_once JPATH_ADMINISTRATOR . '/components/com_redshop/helpers/template.php';
require_once JPATH_ADMINISTRATOR . '/components/com_redshop/helpers/stockroom.php';
require_once JPATH_ADMINISTRATOR . '/components/com_redshop/helpers/economic.php';
require_once JPATH_SITE . '/components/com_redshop/helpers/product.php';
$Redconfiguration = new Redconfiguration();
$data = array();
$where = array();
$category = array_map('intval', explode('||', $this->_data->get('redshopproductssourcecategory', '')));
if (!in_array(0, $category) && count($category) > 0) {
$where[] = 'pr_cat.category_id IN (' . implode(',', $category) . ') ';
}
if ($this->_data->get('redshopproductssourcepublished', 1)) {
$where[] = ' pr.published = 1 ';
}
if ($this->_data->get('redshopproductssourcespecial', 0)) {
$where[] = ' (pr.product_special = 1) ';
}
if ($this->_data->get('redshopproductssourceonsale', 0)) {
$where[] = ' (pr.product_on_sale = 1) ';
}
$o = '';
$order = NextendParse::parse($this->_data->get('redshopproductsorder1', 'pr.product_name|*|asc'));
if ($order[0]) {
$o .= 'ORDER BY ' . $order[0] . ' ' . $order[1] . ' ';
$order = NextendParse::parse($this->_data->get('redshopproductsorder2', 'pr.product_name|*|asc'));
if ($order[0]) {
$o .= ', ' . $order[0] . ' ' . $order[1] . ' ';
}
}
$query = "SELECT \r\n pr.product_id, \r\n pr.published, \r\n pr_cat.ordering, \r\n pr.product_name as name, \r\n pr.product_s_desc as short_description, \r\n pr.product_desc as description, \r\n man.manufacturer_name as man_name,\r\n pr.product_full_image as image, \r\n pr.product_thumb_image as image_thumbnail, \r\n pr.product_price,\r\n cat.category_id,\r\n cat.category_name, \r\n cat.category_short_description , \r\n cat.category_description\r\n FROM `#__redshop_product` AS pr\r\n LEFT JOIN `#__redshop_product_category_xref` AS pr_cat USING (product_id)\r\n LEFT JOIN `#__redshop_category` AS cat USING (category_id)\r\n LEFT JOIN `#__redshop_manufacturer` AS man USING(manufacturer_id)\r\n WHERE pr.product_parent_id=0 " . (count($where) ? ' AND ' . implode(' AND ', $where) : '') . " " . $o . " LIMIT 0, " . $number;
$db->setQuery($query);
$result = $db->loadAssocList();
$uri = str_replace(array('http://', 'https://'), '//', NextendUri::getBaseUri());
for ($i = 0; $i < count($result); $i++) {
$product = new producthelper();
$result[$i]['title'] = $result[$i]['name'];
$result[$i]['price'] = $product->getProductFormattedPrice($product->getProductPrice($result[$i]['product_id']));
$result[$i]['addtocart'] = $result[$i]['url'] = 'index.php?option=com_redshop&view=product&pid=' . $result[$i]['product_id'] . '&cid=' . $result[$i]['category_id'];
$result[$i]['addtocart_label'] = 'View product';
$result[$i]['category_url'] = 'index.php?option=com_redshop&view=category&cid=' . $result[$i]['category_id'] . '&layout=detail';
$result[$i]['thumbnail'] = $result[$i]['image_thumbnail'] = $uri . REDSHOP_FRONT_IMAGES_ABSPATH . "product/" . $result[$i]['image_thumbnail'];
$result[$i]['image'] = $uri . REDSHOP_FRONT_IMAGES_ABSPATH . "product/" . $result[$i]['image'];
}
return $result;
}
示例2: fetchElement
function fetchElement()
{
$html = parent::fetchElement();
if (nextendIsJoomla()) {
JHtml::_('behavior.modal');
$user = JFactory::getUser();
$link = 'index.php?option=com_media&view=images&tmpl=component&e_name=com_smartslider2&author=' . $user->id;
$html .= '<div class="button2-left" style="margin: 2px 0 2px 10px; float: left;">
<div class="image">
<a onclick="window.jInsertEditorText = function(tag, editor){njQuery(\'#' . $this->_id . '\').val((window.nextendimageurl == 0 ? \'' . NextendUri::getBaseUri() . '\' : \'\')+njQuery(tag).attr(\'src\')); NfireEvent(document.getElementById(\'' . $this->_id . '\'),\'change\'); };return false;" rel="{handler: \'iframe\', size: {x: 900, y: 520}}" href="' . $link . '" title="Image" class="modal btn modal-button"><i class="icon-picture"></i>' . NextendText::_('Image') . '</a>
</div>
</div>';
} else {
if (nextendIsWordPress()) {
add_thickbox();
wp_enqueue_script('media-upload');
wp_print_styles('editor-buttons');
$html .= '
<div class="wp-media-buttons" style="float: left; margint-top:1px;">
<a title="Add Media" onclick="window.send_to_editor = function(html){var inp = njQuery(\'#' . $this->_id . '\'); setFromWPLibrary(html, inp); };tb_show(\'\', \'' . admin_url('media-upload.php?type=image&TB_iframe=true&width=800&height=800') . '\');return false;" data-editor="content" class="button insert-media add_media" href="#"><span class="wp-media-buttons-icon"></span> Add Media</a>
</div>
<script>
function setFromWPLibrary(html, el){
if( Object.prototype.toString.call( html) === \'[object Array]\' ) {
el.val(html[0]);
}else{
var html = jQuery(html);
var img = html;
if(html[0].tagName != \'IMG\'){
img = jQuery(\'img\',html);
}
el.val(img.attr(\'src\'));
}
NfireEvent(el[0], \'change\');
tb_remove();
}
</script>
';
} else {
if (nextendIsMagento()) {
static $loaded;
ob_start();
if ($loaded == null) {
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'extjs/ext-tree.js"></script>';
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'extjs/ext-tree-checkbox.js"></script>';
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'extjs/fix-defer.js"></script>';
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'mage/adminhtml/variables.js"></script>';
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'mage/adminhtml/wysiwyg/widget.js"></script>';
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'lib/flex.js"></script>';
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'lib/FABridge.js"></script>';
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'mage/adminhtml/flexuploader.js"></script>';
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'mage/adminhtml/browser.js"></script>';
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'prototype/window.js"></script>';
$html .= '<link rel="stylesheet" type="text/css" href="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'prototype/windows/themes/default.css" media="screen"/>';
$html .= '<link rel="stylesheet" type="text/css" href="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) . 'adminhtml/default/default/lib/prototype/windows/themes/magento.css" media="screen"/>';
?>
<script type="text/javascript">
njQuery(window).ready(function(){
Mediabrowser.prototype.insert = Mediabrowser.prototype.insert.wrap(function(parentMethod, event) {
var div;
if (event != undefined) {
div = $(Event.findElement(event, 'DIV'));
} else {
$$('div.selected').each(function (e) {
div = jQuery('#'+e.id);
});
}
if (div.length == 0) {
return false;
}
var targetEl = this.getTargetElement();
if (! targetEl) {
alert("Target element not found for content update");
Windows.close('browser_window');
return;
}
div = div[0];
var params = {filename:div.id, node:this.currentNode.id, store:this.storeId};
if (targetEl.tagName.toLowerCase() == 'textarea') {
params.as_is = 1;
}
new Ajax.Request(this.onInsertUrl, {
parameters: params,
onSuccess: function(transport) {
try {
this.onAjaxSuccess(transport);
if (this.getMediaBrowserOpener()) {
self.blur();
}
Windows.close('browser_window');
if (targetEl.tagName.toLowerCase() == 'input') {
targetEl.value = transport.responseText;
NfireEvent(targetEl, 'change');
// AntoineK overload START
if (varienGlobalEvents) {
varienGlobalEvents.fireEvent('mediachooserChange' + targetEl.id, transport.responseText);
}
//.........这里部分代码省略.........
示例3: getData
function getData($number)
{
nextendimport('nextend.database.database');
$db = NextendDatabase::getInstance();
$data = array();
$category = array_map('intval', explode('||', $this->_data->get('phocagallerysourcecategory', '')));
$query = 'SELECT ';
$query .= 'con.id, ';
$query .= 'con.title, ';
$query .= 'con.alias, ';
$query .= 'con.filename, ';
$query .= 'con.description, ';
$query .= 'con.hits, ';
$query .= 'con.catid, ';
$query .= 'cat.title AS cat_title, ';
$query .= 'cat.description AS cat_description, ';
$query .= 'cat.alias AS cat_alias ';
$query .= 'FROM #__phocagallery AS con ';
$query .= 'LEFT JOIN #__phocagallery_categories AS cat ON cat.id = con.catid ';
$where = array();
if (count($category) > 0 && !in_array('0', $category)) {
$where[] = 'con.catid IN (' . implode(',', $category) . ') ';
}
if ($this->_data->get('phocagallerysourcepublished', 1)) {
$where[] = 'con.published = 1 ';
$where[] = 'con.approved = 1 ';
}
if ($this->_data->get('phocagallerysourcefeatured', 0)) {
$where[] = 'con.featured = 1 ';
}
$language = $this->_data->get('phocagallerysourcelanguage', '*');
if ($language) {
$where[] = 'con.language = ' . $db->quote($language) . ' ';
}
if (count($where)) {
$query .= ' WHERE ' . implode(' AND ', $where);
}
$order = NextendParse::parse($this->_data->get('phocagalleryorder1', 'con.title|*|asc'));
if ($order[0]) {
$query .= 'ORDER BY ' . $order[0] . ' ' . $order[1] . ' ';
$order = NextendParse::parse($this->_data->get('phocagalleryorder2', 'con.title|*|asc'));
if ($order[0]) {
$query .= ', ' . $order[0] . ' ' . $order[1] . ' ';
}
}
$query .= 'LIMIT 0, ' . $number . ' ';
$db->setQuery($query);
$result = $db->loadAssocList();
$uri = str_replace(array('http://', 'https://'), '//', NextendUri::getBaseUri());
for ($i = 0; $i < count($result); $i++) {
$result[$i]['url'] = 'index.php?option=com_phocagallery&view=detail&catid=' . $result[$i]['catid'] . ':' . $result[$i]['cat_alias'] . '&id=' . $result[$i]['id'] . ':' . $result[$i]['alias'];
$result[$i]['url_label'] = 'View image';
$result[$i]['categoryurl'] = 'index.php?option=com_phocagallery&view=category&id=' . $result[$i]['catid'] . ':' . $result[$i]['cat_alias'];
$result[$i]['thumbnail'] = $result[$i]['image'] = $uri . "images/phocagallery/" . $result[$i]['filename'];
if (!$result[$i]['description']) {
$result[$i]['description'] = '';
}
$result[$i]['author_name'] = '';
$result[$i]['author_url'] = '#';
}
return $result;
}
示例4: createHash
function createHash()
{
$hash = NextendUri::getBaseUri();
for ($i = 0; $i < count($this->_files); $i++) {
$hash .= $this->_files[$i] . filemtime($this->_files[$i]);
}
return md5($this->parseHash($hash) . $this->_text);
}
示例5: fetchElement
//.........这里部分代码省略.........
<div class="nextend-textarea ">
<textarea autocomplete="off" style="width:400px; height: 40px;" name="" id="description'.$i.'"></textarea>
</div>
</div>
</div>
</div>
<div style="clear:both;"></div>
</script>
<script>
njQuery(window).ready(function(){
var $ = njQuery,
images = $('#selected-images'),
deleteimage = $('#delete-image'),
form = $('#smartslider-form'),
skeleton = njQuery('#image-form-skeleton').html(),
iii = 10000;
function addImageToList(img){
var el = $('<li><img src="'+nextendFixRelative(img)+'" data-src="'+img+'" />'+skeleton.replace(/'\.\$i\.'/g, iii)+'</li>').appendTo(images);
iii++;
images.sortable( "refresh" );
$(window).trigger('resize');
return el;
}
<?php
if (nextendIsJoomla()) {
?>
var folder = "<?php
echo JComponentHelper::getParams('com_media')->get('image_path', 'images') . '/';
?>
",
base_uri = "<?php
echo NextendUri::getBaseUri();
?>
",
iframe = $('#image-chooser'),
frame = $('#image-chooser');
frame.on('load', function(){
frame = $(this.contentWindow.document);
frame.find('#imageframe').next('.well').remove();
frame.find('#imageframe').next('fieldset').remove();
frame.find('#imageframe').prev('fieldset').find('.fltrt').remove();
frame.find('#imageForm').find('.pull-right').remove();
frame.find('#upbutton').css('verticalAlign', 'top');
this.contentWindow.ImageManager.populateFields = function(file){
var uri = '';
if(window.nextendimageurl == 0) uri = base_uri;
addImageToList(uri+folder+file);
}
frame.find('#system-message-container').css('paddingTop', '15px');
frame.find('body').css('overflow', 'hidden').css('padding', '0 15px');
iframe.css('height', frame.find('html').prop('scrollHeight'));
$(window).trigger('resize');
});
<?php
} elseif (nextendIsWordpress()) {
?>
var file_frame;
jQuery('#smartslider-admin .add-image').on('click', function(event){
event.preventDefault();
// If the media frame already exists, reopen it.
if ( file_frame ) {
file_frame.open();
示例6: absoluteURLToPath
static function absoluteURLToPath($url)
{
$i = NextendFilesystem::getInstance();
return str_replace(NextendUri::getBaseUri(), $i->_basepath, $url);
}
示例7: getData
function getData($number)
{
nextendimport('nextend.database.database');
$db = NextendDatabase::getInstance();
$data = array();
$category = array_map('intval', explode('||', $this->_data->get('sourcecategory', '')));
$query = 'SELECT ';
$query .= 'con.id, ';
$query .= 'con.title, ';
$query .= 'con.alias, ';
$query .= 'con.introtext, ';
$query .= 'con.fulltext, ';
$query .= 'con.catid, ';
$query .= 'cat.title AS cat_title, ';
$query .= 'cat.alias AS cat_alias, ';
$query .= 'con.created_by, ';
$query .= 'usr.name AS created_by_alias, ';
$query .= 'con.images ';
$query .= 'FROM #__content AS con ';
$query .= 'LEFT JOIN #__users AS usr ON usr.id = con.created_by ';
$query .= 'LEFT JOIN #__categories AS cat ON cat.id = con.catid ';
$query .= 'WHERE con.catid IN (' . implode(',', $category) . ') ';
$sourceuserid = intval($this->_data->get('sourceuserid', ''));
if ($sourceuserid) {
$query .= 'AND con.created_by = ' . $sourceuserid . ' ';
}
if ($this->_data->get('sourcepublished', 1)) {
$query .= 'AND con.state = 1 ';
$jnow = JFactory::getDate();
$now = version_compare(JVERSION, '1.6.0', '<') ? $jnow->toMySQL() : $jnow->toSql();
$query .= "AND (con.publish_up = '0000-00-00 00:00:00' OR con.publish_up < '" . $now . "') AND (con.publish_down = '0000-00-00 00:00:00' OR con.publish_down > '" . $now . "') ";
}
if ($this->_data->get('sourcefeatured', 0)) {
$query .= 'AND con.featured = 1 ';
}
$language = $this->_data->get('sourcelanguage', '*');
if ($language) {
$query .= 'AND con.language = ' . $db->quote($language) . ' ';
}
$order = NextendParse::parse($this->_data->get('order1', 'con.title|*|asc'));
if ($order[0]) {
$query .= 'ORDER BY ' . $order[0] . ' ' . $order[1] . ' ';
$order = NextendParse::parse($this->_data->get('order2', 'con.title|*|asc'));
if ($order[0]) {
$query .= ', ' . $order[0] . ' ' . $order[1] . ' ';
}
}
$query .= 'LIMIT 0, ' . $number . ' ';
$db->setQuery($query);
$result = $db->loadAssocList();
$dispatcher = JDispatcher::getInstance();
JPluginHelper::importPlugin('content');
$uri = str_replace(array('http://', 'https://'), '//', NextendUri::getBaseUri());
for ($i = 0; $i < count($result); $i++) {
$article = new stdClass();
$article->text = $result[$i]['introtext'];
$_p = array();
$dispatcher->trigger('onContentPrepare', array('com_smartslider2', &$article, &$_p, 0));
if (!empty($article->text)) {
$result[$i]['introtext'] = $article->text;
}
$result[$i]['description'] = $result[$i]['introtext'];
$article->text = $result[$i]['fulltext'];
$_p = array();
$dispatcher->trigger('onContentPrepare', array('com_smartslider2', &$article, &$_p, 0));
if (!empty($article->text)) {
$result[$i]['fulltext'] = $article->text;
}
$result[$i]['url'] = ContentHelperRoute::getArticleRoute($result[$i]['id'] . ':' . $result[$i]['alias'], $result[$i]['catid'] . ':' . $result[$i]['cat_alias']);
$result[$i]['categorylisturl'] = 'index.php?option=com_content&view=category&id=' . $result[$i]['catid'];
$result[$i]['categoryblogurl'] = 'index.php?option=com_content&view=category&layout=blog&id=' . $result[$i]['catid'];
$images = (array) json_decode($result[$i]['images'], true);
$result[$i]['image'] = $result[$i]['thumbnail'] = $result[$i]['intro_image'] = isset($images['image_intro']) ? $uri . $images['image_intro'] : '';
$result[$i]['fulltext_image'] = isset($images['image_fulltext']) ? $uri . $images['image_fulltext'] : '';
unset($result[$i]['images']);
$result[$i]['url_label'] = 'View article';
$result[$i]['author_name'] = $result[$i]['created_by_alias'];
$result[$i]['author_url'] = '#';
}
return $result;
}