本文整理汇总了PHP中hikashop_currentURL函数的典型用法代码示例。如果您正苦于以下问题:PHP hikashop_currentURL函数的具体用法?PHP hikashop_currentURL怎么用?PHP hikashop_currentURL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hikashop_currentURL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
function save()
{
$voteClass = hikashop_get('class.vote');
if (!count($_POST)) {
$app = JFactory::getApplication();
$app->redirect(preg_replace('#ctrl=vote&task=save&[0-9a-z=]+#', '', preg_replace('#/vote/save/[0-9a-z-]+#', '', hikashop_currentURL())), '', 'message', true);
}
$element = new stdClass();
$element->hikashop_vote_type = JRequest::getVar('hikashop_vote_type', 0, 'default', 'string', 0);
$element->vote_ref_id = JRequest::getVar('hikashop_vote_ref_id', 0, 'default', 'int');
if (empty($element->vote_ref_id)) {
$element->vote_ref_id = JRequest::getVar('hikashop_vote_product_id', 0, 'default', 'int');
}
$element->user_id = JRequest::getVar('hikashop_vote_user_id', 0, 'default', 'int');
$element->pseudo_comment = JRequest::getVar('pseudo_comment', 0, 'default', 'string', 0);
$element->email_comment = JRequest::getVar('email_comment', 0, 'default', 'string', 0);
$element->vote_type = JRequest::getVar('vote_type', 0, 'default', 'string', 0);
$element->vote = JRequest::getVar('hikashop_vote', 0, 'default', 'int');
$element->comment = JRequest::getVar('hikashop_vote_comment', '', '', 'string', JREQUEST_ALLOWRAW);
// JRequest::getVar('hikashop_vote_comment', 0, 'default', 'string', 0);
$element->comment = urldecode($element->comment);
if (!empty($element->comment) || !empty($element->vote) || !empty($element->email_comment) || !empty($element->pseudo_comment) || $element->hikashop_vote_type == 'useful') {
$voteClass->save($element);
} else {
echo '0';
}
exit;
}
示例2: onAfterRoute
function onAfterRoute()
{
$app = JFactory::getApplication();
if ($app->isAdmin() || @$_REQUEST['tmpl'] == 'component') {
return true;
}
if (empty($_REQUEST['ctrl'])) {
$_REQUEST['ctrl'] = @$_REQUEST['view'];
}
if (empty($_REQUEST['task'])) {
$_REQUEST['task'] = @$_REQUEST['layout'];
}
if (@$_REQUEST['option'] == 'com_hikashop' && (@$_REQUEST['ctrl'] == 'checkout' || @$_REQUEST['ctrl'] == 'order' && @$_REQUEST['task'] == 'pay')) {
return true;
}
if (@$_REQUEST['option'] == 'com_ccidealplatform' && @$_REQUEST['task'] == 'bankform') {
return true;
}
if (!empty($_POST)) {
return true;
}
if (!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR);
}
if (!(include_once rtrim(JPATH_ADMINISTRATOR, DS) . DS . 'components' . DS . 'com_hikashop' . DS . 'helpers' . DS . 'helper.php')) {
return true;
}
if (hikashop_isSSL()) {
$app->setUserState('com_hikashop.ssl_redirect', 0);
$app->redirect(str_replace('https://', 'http://', hikashop_currentURL()));
}
return true;
}
示例3: save
function save()
{
$voteClass = hikashop_get('class.vote');
if (!count($_POST)) {
$app = JFactory::getApplication();
$app->redirect(preg_replace('#ctrl=vote&task=save&[0-9a-z=]+#', '', preg_replace('#/vote/save/[0-9a-z-]+#', '', hikashop_currentURL())), '', 'message', true);
}
$hikashop_vote_type = JRequest::getVar('hikashop_vote_type', 'update', 'default', 'string', 0);
$element = new stdClass();
$element->vote_type = JRequest::getVar('vote_type', '', 'default', 'string', 0);
if ($hikashop_vote_type == 'useful') {
$element->vote_id = JRequest::getVar('hikashop_vote_id', 0, 'default', 'int');
$element->value = JRequest::getVar('value', 0, 'default', 'int');
$voteClass->saveUseful($element);
} else {
$element->vote_ref_id = JRequest::getVar('hikashop_vote_ref_id', 0, 'default', 'int');
if (empty($element->vote_ref_id) || $element->vote_ref_id == '0') {
$element->vote_ref_id = JRequest::getVar('hikashop_vote_product_id', 0, 'default', 'int');
}
$element->vote_user_id = JRequest::getVar('hikashop_vote_user_id', 0, 'default', 'int');
if ($element->vote_user_id == '0') {
$element->vote_user_id = hikashop_loadUser();
}
$element->vote_pseudo = JRequest::getVar('pseudo_comment', 0, 'default', 'string', 0);
$element->vote_email = JRequest::getVar('email_comment', 0, 'default', 'string', 0);
$element->vote_type = JRequest::getVar('vote_type', '', 'default', 'string', 0);
$element->vote_rating = JRequest::getVar('hikashop_vote', 0, 'default', 'int');
$element->vote_comment = JRequest::getVar('hikashop_vote_comment', '', '', 'string', JREQUEST_ALLOWRAW);
// JRequest::getVar('hikashop_vote_comment', 0, 'default', 'string', 0);
$element->vote_comment = urldecode($element->vote_comment);
$voteClass->save($element);
}
$return = array();
if (!isset($voteClass->error) || empty($voteClass->error['code'])) {
$return['error'] = array('code' => '500001', 'message' => JText::_('VOTE_ERROR'));
} elseif ((int) $voteClass->error['code'] > 500000) {
$return['error'] = array('code' => $voteClass->error['code'], 'message' => $voteClass->error['message']);
} else {
$return['success'] = array('code' => $voteClass->error['code'], 'message' => $voteClass->error['message']);
if (!empty($voteClass->values)) {
$return['values'] = array('average' => round($voteClass->values['average'], 2), 'rounded' => round($voteClass->values['average']), 'total' => $voteClass->values['total']);
$return['tooltip'] = JText::sprintf('HIKA_VOTE_TOOLTIP', round($voteClass->values['average'], 2), $voteClass->values['total'], $element->vote_rating);
}
}
ob_get_clean();
echo json_encode($return);
exit;
}
示例4: hikashop_currentURL
if (HK_GRID_THUMBNAILS !== false && HK_GRID_THUMBNAILS != '') {
echo '</ul>';
}
echo '</div>';
}
}
?>
<div style="clear:both"></div>
</div>
<?php
if (in_array($pagination, array('bottom', 'both')) && $this->params->get('show_limit') && $this->pageInfo->elements->total > $this->pageInfo->limit->value) {
$this->pagination->form = '_bottom';
?>
<form action="<?php
echo hikashop_currentURL();
?>
" method="post" name="adminForm_<?php
echo $this->params->get('main_div_name') . $this->category_selected;
?>
_bottom">
<div class="hikashop_subcategories_pagination hikashop_subcategories_pagination_bottom">
<?php
echo $this->pagination->getListFooter($this->params->get('limit'));
?>
<span class="hikashop_results_counter"><?php
echo $this->pagination->getResultsCounter();
?>
</span>
</div>
<input type="hidden" name="filter_order_<?php
示例5: productDisplay
//.........这里部分代码省略.........
document.getElementById('product_insert').value =document.getElementById('product_insert').value + '|pricetax1';
}
if(document.getElementById('pricetax').value==2 && document.getElementById('price').checked==true){
document.getElementById('product_insert').value =document.getElementById('product_insert').value + '|pricetax2';
}
if(document.getElementById('pricedisc').value==0 && document.getElementById('pricetax').value==0 && document.getElementById('price').checked==true){
document.getElementById('product_insert').value =document.getElementById('product_insert').value + '|price';
}
document.getElementById('product_insert').value=document.getElementById('product_insert').value + '}';
}
if(document.getElementById('name').checked==false
&& document.getElementById('price').checked==false
&& document.getElementById('cart').checked==false
&& document.getElementById('description').checked==false
&& document.getElementById('picture').checked==false){
document.getElementById('product_insert').value='';
}
}
function checkAllBox(){
var checkAll = document.getElementById('checkAll');
var toCheck = document.getElementById('ToCheck').getElementsByTagName('input');
for (i = 0 ; i < toCheck.length ; i++) {
if (toCheck[i].type == 'checkbox') {
if(checkAll.checked == true){
toCheck[i].checked = true;
}else{
toCheck[i].checked = false;
}
}
}
}
</script>
<form action="<?php
echo hikashop_currentURL();
?>
" method="POST" name="adminForm" id="adminForm">
<table class="hikashop_no_border">
<tr>
<td width="100%">
<?php
echo JText::_('FILTER');
?>
:
<input type="text" name="search" id="hikashop_search" value="<?php
echo hikashop_getEscaped($pageInfo->search);
?>
" class="inputbox" onchange="document.adminForm.submit();" />
<button class="btn" onclick="this.form.submit();"><?php
echo JText::_('GO');
?>
</button>
<button class="btn" onclick="document.getElementById('hikashop_search').value='';this.form.submit();"><?php
echo JText::_('RESET');
?>
</button>
</td>
</tr>
</table>
<fieldset>
<legend>OPTIONS</legend>
<div id="productInsertOptions">
<input type="checkbox" name="name" id="name" value="1" checked/><?php
echo JText::_('HIKA_NAME');
?>
<input type="checkbox" name="description" id="description" value="1" checked/><?php
echo JText::_('PRODUCT_DESCRIPTION');
示例6: init
function init($cart = false)
{
$config =& hikashop_config();
$url = $config->get('redirect_url_after_add_cart', 'stay_if_cart');
switch ($url) {
case 'checkout':
$url = $this->_getCheckoutURL();
break;
case 'stay_if_cart':
$url = '';
if (!$cart) {
$url = $this->_getCheckoutURL();
break;
}
case 'ask_user':
case 'stay':
$url = '';
case '':
default:
if (empty($url)) {
$url = hikashop_currentURL('return_url');
}
break;
}
return urlencode($url);
}
示例7: hikashop_completeLink
?>
<input type="checkbox" name="data[products][<?php
echo $cart->product_id;
?>
][checked]" value="1"/>
</td>
<?php
}
if ($hasAccess) {
?>
<td data-title="<?php
echo JText::_('HIKA_DELETE');
?>
" class="hikashop_show_cart_delete">
<a class="hikashop_no_print" href="<?php
echo hikashop_completeLink('product&task=updatecart&stay=1&delete=1&quantity=0&cart_type=' . $cart_type . '&cart_id=' . $cart->cart_id . '&cart_product_id=' . $cart->cart_product_id . '&return_url=' . urlencode(base64_encode(hikashop_currentURL())) . $url_itemid);
?>
" title="<?php
echo JText::_('HIKA_DELETE');
?>
">
<img src="<?php
echo HIKASHOP_IMAGES . 'delete2.png';
?>
" alt="<?php
echo JText::_('HIKA_DELETE');
?>
" />
</a>
</td>
<?php
示例8: defined
<?php
/**
* @package HikaShop for Joomla!
* @version 2.3.5
* @author hikashop.com
* @copyright (C) 2010-2015 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
$current_url = hikashop_currentURL();
$set = JRequest::getString('sort_comment', '');
$config = JFactory::getConfig();
if (HIKASHOP_J30) {
$sef = $config->get('sef');
} else {
$sef = $config->getValue('config.sef');
}
if (!empty($set)) {
if ($sef) {
$current_url = preg_replace('/\\/sort_comment-' . $set . '/', '', $current_url);
} else {
$current_url = preg_replace('/&sort_comment=' . $set . '/', '', $current_url);
}
}
$row =& $this->rows;
$elt =& $this->elts;
$pagination =& $this->pagination;
$no_comment = 1;
$hikashop_vote_con_req_list = $row->hikashop_vote_con_req_list;
$useful_rating = $row->useful_rating;
示例9: onAfterRoute
function onAfterRoute()
{
$app = JFactory::getApplication();
if (JRequest::getString('option') != 'com_virtuemart' || $app->isAdmin()) {
return true;
}
$vmProdId = (int) JRequest::getVar('product_id');
if (empty($vmProdId)) {
$vmProdId = (int) JRequest::getVar('virtuemart_product_id');
}
$vmCatId = (int) JRequest::getVar('category_id');
if (empty($vmCatId)) {
$vmCatId = (int) JRequest::getVar('virtuemart_category_id');
}
$vmOrderId = JRequest::getInt('order_id');
if (empty($vmOrderId)) {
$vmOrderId = (int) JRequest::getVar('order_number');
}
$db = JFactory::getDBO();
if (!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR);
}
if (!(include_once rtrim(JPATH_ADMINISTRATOR, DS) . DS . 'components' . DS . 'com_hikashop' . DS . 'helpers' . DS . 'helper.php')) {
return true;
}
if (empty($vmProdId) && empty($vmCatId) && empty($vmOrderId)) {
$currentURL = hikashop_currentURL();
if (preg_match_all('#/(virtuemart_product_id|product_id|category_id|virtuemart_category_id|order_id|order_number)/([0-9]+)#', $currentURL, $matches)) {
foreach ($matches[1] as $k => $key) {
switch ($key) {
case 'product_id':
case 'virtuemart_product_id':
$vmProdId = $matches[2][$k];
break;
case 'category_id':
case 'virtuemart_category_id':
$vmCatId = $matches[2][$k];
break;
case 'order_id':
case 'order_number':
$vmOrderId = $matches[2][$k];
break;
}
}
}
if (empty($vmProdId) && empty($vmCatId) && empty($vmOrderId)) {
return true;
}
}
$query = 'SHOW TABLES LIKE ' . $db->Quote($db->getPrefix() . substr(hikashop_table('vm_prod'), 3));
$db->setQuery($query);
$table = $db->loadResult();
if (empty($table)) {
return true;
}
$url = null;
if (!empty($vmProdId) && $vmProdId > 0) {
$query = "SELECT a.hk_id, b.product_name as 'name' FROM `#__hikashop_vm_prod` a INNER JOIN `#__hikashop_product` b ON a.hk_id = b.product_id WHERE a.vm_id = " . $vmProdId . ";";
$baseUrl = 'product&task=show';
} else {
if (!empty($vmCatId) && $vmCatId > 0) {
$id = 'vm-fallback';
$alias = 'hikashop-menu-for-module-' . $id;
$db->setQuery('SELECT id FROM ' . hikashop_table('menu', false) . ' WHERE alias=\'' . $alias . '\'');
$itemId = $db->loadResult();
if (empty($itemId)) {
$options = new stdClass();
$config =& hikashop_config();
$options->hikashop_params = $config->get('default_params', null);
$classMenu = hikashop_get('class.menus');
$classMenu->loadParams($options);
$options->hikashop_params['content_type'] = 'category';
$options->hikashop_params['layout_type'] = 'div';
$options->hikashop_params['content_synchronize'] = '1';
if ($options->hikashop_params['columns'] == 1) {
$options->hikashop_params['columns'] = 3;
}
$classMenu->createMenu($options->hikashop_params, $id);
$itemId = $options->hikashop_params['itemid'];
}
$query = "SELECT a.hk_id, b.category_name as 'name' FROM `#__hikashop_vm_cat` a INNER JOIN `#__hikashop_category` b ON a.hk_id = b.category_id WHERE a.vm_id = " . $vmCatId . ";";
$baseUrl = 'category&task=listing&Itemid=' . $itemId;
} elseif (!empty($vmOrderId)) {
$db->setQuery('SELECT order_id FROM ' . hikashop_table('order') . ' WHERE order_vm_id=' . $vmOrderId);
$hikaOrderId = $db->loadResult();
if (!empty($hikaOrderId)) {
$url = hikashop_completeLink('order&task=show&cid=' . $hikaOrderId, false, true);
$app->redirect($url);
return true;
} else {
$db->setQuery('SELECT order_id FROM ' . hikashop_table('order') . ' AS h INNER JOIN `#__virtuemart_orders` AS v ON h.order_vm_id = v.virtuemart_order_id WHERE v.order_number=' . $vmOrderId);
$hikaOrderId = $db->loadResult();
if (!empty($hikaOrderId)) {
$url = hikashop_completeLink('order&task=show&cid=' . $hikaOrderId, false, true);
$app->redirect($url);
return true;
}
}
}
}
//.........这里部分代码省略.........
示例10: defined
<?php
/**
* @package HikaShop for Joomla!
* @version 2.6.1
* @author hikashop.com
* @copyright (C) 2010-2016 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
if (!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR);
}
if (!(include_once rtrim(JPATH_ADMINISTRATOR, DS) . DS . 'components' . DS . 'com_hikashop' . DS . 'helpers' . DS . 'helper.php')) {
echo 'This module can not work without the Hikashop Component';
return;
}
$mode_noform = $params->get('mode_noform', 0);
$currency = hikashop_get('type.currency');
$config =& hikashop_config();
$redirectUrl = hikashop_currentURL();
require JModuleHelper::getLayoutPath('mod_hikashop_currency');
示例11: googleDirectCall
function googleDirectCall($accounts, &$order, $currencyInfo)
{
$found = false;
foreach ($accounts as $a) {
if ($a->currency == $currencyInfo->currency_code && !empty($a->account_id)) {
$account = $a->account_id;
if (!preg_match('/UA-[0-9]{2,12}-[0-9]{1}/', $account)) {
continue;
}
$found = true;
break;
}
}
if (!$found) {
return false;
}
$ip = hikashop_getIP();
$uuid = round(rand() / getrandmax() * 0x7fffffff);
$jconf = JFactory::getConfig();
if (HIKASHOP_J30) {
$siteName = $jconf->get('sitename');
} else {
$siteName = $jconf->getValue('config.sitename');
}
$data = array('v' => 1, 'tid' => $account, 'cid' => $uuid, 't' => 'transaction', 'ti' => $order->order_id, 'ta' => $siteName, 'tr' => round($order->order_full_price, 2), 'tt' => round($order->order_subtotal_no_vat + $order->order_shipping_tax + $order->order_discount_tax, 2), 'ts' => round($order->order_shipping_price, 2), 'cu' => $currencyInfo->currency_code);
$this->googleDirectCallHit($data);
foreach ($order->products as $product) {
$data = array('v' => 1, 'tid' => $account, 'cid' => $uuid, 't' => 'item', 'ti' => $order->order_id, 'in' => strip_tags($product->order_product_name), 'ip' => $product->order_product_price + $product->order_product_tax, 'iq' => $product->order_product_quantity, 'ic' => $product->order_product_code, 'iv' => '', 'cu' => $currencyInfo->currency_code);
$this->googleDirectCallHit($data);
}
if ($this->params->get('debug_mode')) {
$data = 'Send transaction by direct call
IP: ' . $ip . '
URL: ' . hikashop_currentURL();
$this->writeToLog($data);
}
return true;
}
示例12: _addFacebookButton
function _addFacebookButton(&$plugin)
{
if (empty($plugin->params['display_fb'])) {
return;
}
$element = $this->_getElementInfo();
if (empty($element)) {
return '';
}
$options = array('layout' => 'standard', 'width' => 400);
$xfbml_options = array();
$classname = 'standard';
switch ((int) $plugin->params['fb_style']) {
case 1:
$classname = 'button_count';
$options['layout'] = 'button_count';
$xfbml_options['layout'] = 'button_count';
$options['width'] = 115;
break;
case 2:
$classname = 'box_count';
$options['layout'] = 'box_count';
$xfbml_options['layout'] = 'box_count';
$options['width'] = 115;
break;
case 3:
$classname = 'button';
$options['layout'] = 'button';
$xfbml_options['layout'] = 'button';
$options['width'] = 65;
break;
}
if (empty($plugin->params['fb_faces'])) {
$options['show_faces'] = 'false';
$xfbml_options['show-faces'] = 'false';
} else {
$options['show_faces'] = 'true';
$xfbml_options['show-faces'] = 'false';
// in the first version of the plugin, in fact is was set to "false", so...
}
if (empty($plugin->params['fb_verb'])) {
$options['action'] = 'like';
} else {
$options['action'] = 'recommend';
$xfbml_options['action'] = 'recommend';
}
if (empty($plugin->params['fb_theme'])) {
$options['colorscheme'] = 'light';
} else {
$options['colorscheme'] = 'dark';
$xfbml_options['colorscheme'] = 'dark';
}
$fonts = array(0 => 'arial', 1 => 'lucida%20grande', 2 => 'segoe%20ui', 3 => 'tahoma', 4 => 'trebuchet%20ms', 5 => 'verdana');
if (isset($fonts[(int) $plugin->params['fb_font']])) {
$options['font'] = $fonts[(int) $plugin->params['fb_font']];
$xfbml_options['font'] = $fonts[(int) $plugin->params['fb_font']];
}
if (!empty($plugin->params['fb_send'])) {
$xfbml_options['send'] = 'true';
}
if (!empty($element->url_canonical)) {
$url = hikashop_cleanURL($element->url_canonical);
} else {
$url = hikashop_currentURL('', false);
}
$html = '<span class="hikashop_social_fb">';
if ($plugin->params['position'] == 1) {
$html = '<span class="hikashop_social_fb_right">';
}
$url_options = array();
if ($plugin->params['fb_tag'] == 'iframe') {
foreach ($options as $k => $v) {
$url_options[] = $k . '=' . urlencode($v);
}
$html .= '<iframe ' . 'src="//www.facebook.com/plugins/like.php?href=' . urlencode($url) . '&send=false&' . implode('&', $url_options) . '&height=30" ' . 'scrolling="no" frameborder="0" allowTransparency="true" ' . 'style="border:none; overflow:hidden;" class="hikashop_social_fb_' . $classname . '"></iframe>';
} else {
foreach ($xfbml_options as $k => $v) {
$url_options[] = 'data-' . $k . '="' . urlencode($v) . '"';
}
$html .= '<div class="fb-like" data-href="' . $url . '" ' . implode(' ', $url_options) . '></div>';
}
$html .= '</span>';
$this->meta['property="og:title"'] = '<meta property="og:title" content="' . htmlspecialchars($element->name, ENT_COMPAT, 'UTF-8') . '"/> ';
$types = array(0 => 'product', 1 => 'album', 2 => 'book', 3 => 'company', 4 => 'drink', 5 => 'game', 6 => 'movie', 7 => 'song');
if (isset($types[(int) $plugin->params['fb_type']])) {
$this->meta['property="og:type"'] = '<meta property="og:type" content="' . $types[(int) $plugin->params['fb_type']] . '"/> ';
}
$config =& hikashop_config();
$uploadFolder = ltrim(JPath::clean(html_entity_decode($config->get('uploadfolder', 'media/com_hikashop/upload/'))), DS);
$uploadFolder = rtrim($uploadFolder, DS) . DS;
$this->uploadFolder_url = str_replace(DS, '/', $uploadFolder);
$this->uploadFolder = JPATH_ROOT . DS . $uploadFolder;
$this->thumbnail = $config->get('thumbnail', 1);
$this->thumbnail_y = $config->get('product_image_y', $config->get('thumbnail_y'));
$this->thumbnail_x = $config->get('product_image_x', $config->get('thumbnail_x'));
$this->main_thumbnail_x = $this->thumbnail_x;
$this->main_thumbnail_y = $this->thumbnail_y;
$this->main_uploadFolder_url = $this->uploadFolder_url;
$this->main_uploadFolder = $this->uploadFolder;
$imageUrl = $this->_getImageURL($element);
//.........这里部分代码省略.........
示例13: if
?>
'); if (qty_field){<?php
echo $input;
?>
} document.<?php
echo $form;
?>
.submit(); return false;" />
<?php
}
}
if ($this->params->get('show_delete', 1) && $this->params->get('from', 'display') != 'module') {
?>
<div class="hikashop_cart_product_quantity_delete">
<a href="<?php
echo hikashop_completeLink('product&task=updatecart&product_id=' . $row->product_id . $this->url_itemid . '&quantity=0&return_url=' . urlencode(base64_encode(hikashop_currentURL('return_url'))));
?>
" onclick="var qty_field = document.getElementById('hikashop_checkout_quantity_<?php
echo $row->cart_product_id;
?>
'); if(qty_field){qty_field.value=0; <?php
echo $input;
?>
qty_field.form.submit();} return false;" title="<?php
echo JText::_('HIKA_DELETE');
?>
">
<img src="<?php
echo HIKASHOP_IMAGES . 'delete2.png';
?>
" border="0" alt="<?php
示例14: loadJS
function loadJS()
{
static $done = false;
if ($done) {
return true;
}
$done = true;
$current_url = hikashop_currentURL();
$baseUrl = hikashop_completelink('vote&task=save&' . hikashop_getFormToken() . '=1');
$ajaxUrl = hikashop_completelink('vote&task=save', true, true);
if (strpos($baseUrl, '?') !== false) {
$baseUrl .= '&';
} else {
$baseUrl .= '?';
}
$config = hikashop_config();
$email_comment = $config->get('email_comment', 0);
if ($config->get('enable_status_vote', 0) == 'both') {
$vote_comment = 1;
} else {
$vote_comment = 0;
}
$note_comment = $config->get('register_note_comment', 0);
if ($config->get('access_vote', 0) == 'buyed' || $config->get('access_vote', 0) == 'registered') {
$hikashop_vote_con_req = 1;
} else {
$hikashop_vote_con_req = 0;
}
$js = '
function trim(myString){
myString = myString.replace(/(^\\s|&)+/g,\'\').replace(/\\s+$/g,\'\').replace(/\\n/g,\'<br \\/>\');
return myString;
}
function hikashop_vote_useful(hikashop_vote_id,val){
var hikashop_vote_user_id = "";
if(document.getElementById("hikashop_vote_user_id")) hikashop_vote_user_id = document.getElementById("hikashop_vote_user_id").value;
var hikashop_vote_note_comment = ' . $note_comment . ';
if((hikashop_vote_note_comment == 1 && hikashop_vote_user_id != "") || hikashop_vote_note_comment == 0){
data = "hikashop_vote_type=useful";
data += "&value=" + encodeURIComponent(val);
data += "&hikashop_vote_id=" + encodeURIComponent(hikashop_vote_id);
data += "&hikashop_vote_user_id=" + encodeURIComponent(hikashop_vote_user_id);
window.Oby.xRequest("' . $ajaxUrl . '", {mode: "POST", data: data}, function(xhr) {
var el = document.getElementById(hikashop_vote_id);
if(xhr.responseText == "1"){el.innerHTML = " ' . JText::_('THANK_FOR_VOTE', true) . '";}
else if(xhr.responseText == "3"){el.innerHTML = " ' . JText::_('ALREADY_VOTE_USEFUL', true) . '";}
else{el.innerHTML = " ' . JText::_('VOTE_ERROR', true) . '";}
});
setTimeout("document.location=\'' . $current_url . '\'",2250);
}
else{
document.getElementById(hikashop_vote_id).innerHTML = " ' . JText::_('ONLY_REGISTERED_CAN_VOTE', true) . '";
setTimeout("document.getElementById(\'hikashop_vote_id\').innerHTML = \'\'",2250);
}
}
function hikashop_send_vote(hikashop_vote, from){
var re = new RegExp(\'id_(.*?)_hikashop\');
var m = re.exec(from);
if(m != null){
var hikashop_vote_ref_id = "";
for (i = 1; i < m.length; i++) {
hikashop_vote_ref_id = hikashop_vote_ref_id + m[i] + "\\n";
}
}else{
var hikashop_vote_ref_id = document.getElementById("hikashop_vote_ref_id").value;
}
document.getElementById("hikashop_vote_ok_"+parseInt(hikashop_vote_ref_id)).value = "1";
var hikashop_vote_vote_comment = ' . $vote_comment . ';
var hikashop_vote_con_req = ' . $hikashop_vote_con_req . ';
var hikashop_vote_user_id = document.getElementById("hikashop_vote_user_id_"+parseInt(hikashop_vote_ref_id)).value;
var vote_type = document.getElementById("vote_type_"+parseInt(hikashop_vote_ref_id)).value;
var div_vote_status = "hikashop_vote_status_"+parseInt(hikashop_vote_ref_id);
if((hikashop_vote_con_req == 1 && hikashop_vote_user_id != "") || hikashop_vote_con_req == 0){
if(hikashop_vote_vote_comment == 1){//User must enter a comment to note a product
if(from =="hikashop_vote_rating_id"){
document.getElementById("hikashop_vote_status_form").innerHTML = " ' . JText::_('LET_COMMENT_TO_VALID_VOTE', true) . '";
setTimeout("document.getElementById(\'hikashop_vote_status_form\').innerHTML = \'\'",2250);
}else{
var el = document.getElementById(div_vote_status);
el.innerHTML = " ' . JText::_('LET_COMMENT_TO_VALID_VOTE', true) . '";
setTimeout(function(){el.innerHTML = "";},2250);
}
}
else{// Only vote - sending request to saveFrontend() function, and analysing the result, status(thanks, bought, error)
if(from =="hikashop_vote_rating_id"){
var el = document.getElementById("hikashop_vote_status_form");
}else{
var el = document.getElementById(div_vote_status);
}
data = "vote_type=" + encodeURIComponent(vote_type);
data += "&hikashop_vote_type=vote";
data += "&hikashop_vote=" + encodeURIComponent(hikashop_vote);
data += "&hikashop_vote_user_id=" + encodeURIComponent(hikashop_vote_user_id);
data += "&hikashop_vote_ref_id=" + encodeURIComponent(hikashop_vote_ref_id);
window.Oby.xRequest("' . $ajaxUrl . '", {mode: "POST", data: data}, function(xhr) {
if(xhr.responseText == "1"){
el.innerHTML = " ' . JText::_('VOTE_UPDATED', true) . '";
//.........这里部分代码省略.........
示例15: addRate
function addRate(&$rates, $type, $parcel, &$rate, $currency, $nb_package)
{
if (empty($nb_package)) {
$nb_package = 1;
}
$parcel->Service_Type = $type;
$url = 'http://drc.edeliver.com.au/ratecalc.asp?';
foreach (get_object_vars($parcel) as $key => $val) {
$url .= $key . '=' . $val . '&';
}
$url = rtrim($url, '&');
$url = parse_url($url);
if (!isset($url['query'])) {
$url['query'] = '';
}
if (!isset($url['port'])) {
if (!empty($url['scheme']) && in_array($url['scheme'], array('https', 'ssl'))) {
$url['port'] = 443;
} else {
$url['port'] = 80;
}
}
if (!empty($url['scheme']) && in_array($url['scheme'], array('https', 'ssl'))) {
$url['host_socket'] = 'ssl://' . $url['host'];
} else {
$url['host_socket'] = $url['host'];
}
$fp = fsockopen($url['host_socket'], $url['port'], $errno, $errstr, 30);
if (!$fp) {
$app = JFactory::getApplication();
$app->enqueueMessage('Cannot connect to australia post web service. You hosting company might be blocking outbond connections');
return false;
}
$uri = $url['path'] . ($url['query'] != '' ? '?' . $url['query'] : '');
$header = "GET {$uri} HTTP/1.0\r\n" . "User-Agent: PHP/" . phpversion() . "\r\n" . "Referer: " . hikashop_currentURL() . "\r\n" . "Server: " . $_SERVER['SERVER_SOFTWARE'] . "\r\n" . "Host: " . $url['host'] . ":" . $url['port'] . "\r\n" . "Accept: */" . "*\r\n\r\n";
fwrite($fp, $header);
$response = '';
while (!feof($fp)) {
$response .= fgets($fp, 1024);
}
fclose($fp);
$pos = strpos($response, "\r\n\r\n");
$header = substr($response, 0, $pos);
$body = substr($response, $pos + 2 * strlen("\r\n\r\n"));
if (preg_match_all('#([a-z_]+)=([a-z_\\.0-9 ]+?)#Ui', $response, $matches)) {
$data = array();
foreach ($matches[1] as $key => $val) {
$data[$val] = $matches[2][$key];
}
if (!empty($data['err_msg'])) {
if ($data['err_msg'] == 'OK') {
if (empty($rates[$type])) {
$info = new stdClass();
$info = !HIKASHOP_PHP5 ? $rate : clone $rate;
$info->shipping_name .= ' ' . JText::_($type);
if (!empty($rate->shipping_description)) {
$info->shipping_description = $rate->shipping_description . ' ';
} else {
$shipping_description = JText::_($type . '_DESCRIPTION');
if ($shipping_description == $type . '_DESCRIPTION') {
$info->shipping_description .= $shipping_description;
}
$info->shipping_description = $shipping_description;
}
$types = array('SEA' => 1, 'AIR' => 2, 'EXPRESS' => 3, 'STANDARD' => 4);
$info->shipping_id .= '-' . $types[$type];
$rates[$type] = $info;
} else {
$shipping_description = JText::_($type . '_DESCRIPTION');
if ($shipping_description == $type . '_DESCRIPTION') {
$shipping_description = '';
}
if (empty($shipping_description)) {
$shipping_description = $rate->shipping_description;
}
if (!empty($shipping_description)) {
$shipping_description .= '<br/>';
}
if ($nb_package > 1 && (isset($rate->shipping_params->shipping_group) && $rate->shipping_params->shipping_group)) {
$rates[$type]->shipping_description = $shipping_description . JText::sprintf('X_PACKAGES', $nb_package);
} else {
$rates[$type]->shipping_description = $shipping_description;
}
}
if (@$rates[$type]->shipping_tax_id) {
$currencyClass = hikashop_get('class.currency');
$data['charge'] = $currencyClass->getUntaxedPrice($data['charge'], hikashop_getZone(), $rates[$type]->shipping_tax_id);
}
$rates[$type]->shipping_price += $data['charge'];
} elseif (!empty($data['err_msg'])) {
if (preg_match('#Selected Destination not reached by .*#i', $data['err_msg'])) {
return true;
}
$app = JFactory::getApplication();
$app->enqueueMessage('The request to the Australia Post server failed with the message: ' . $data['err_msg']);
} else {
$app = JFactory::getApplication();
$app->enqueueMessage('The request to the Australia Post server failed');
}
}
//.........这里部分代码省略.........