本文整理匯總了PHP中vRequest::uword方法的典型用法代碼示例。如果您正苦於以下問題:PHP vRequest::uword方法的具體用法?PHP vRequest::uword怎麽用?PHP vRequest::uword使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vRequest
的用法示例。
在下文中一共展示了vRequest::uword方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: plgVmAddToSearch
public function plgVmAddToSearch(&$where, &$PluginJoinTables, $custom_id)
{
if ($keyword = vRequest::uword('custom_specification_name1', null, ' ')) {
$db = JFactory::getDBO();
if ($this->_name != $this->GetNameByCustomId($custom_id)) {
return;
}
$keyword = '"%' . $db->escape($keyword, true) . '%"';
$where[] = $this->_name . '.`custom_specification_default1` LIKE ' . $keyword;
$PluginJoinTables[] = $this->_name;
}
return true;
}
示例2: display
public function display($tpl = null)
{
$show_prices = VmConfig::get('show_prices', 1);
if ($show_prices == '1') {
if (!class_exists('calculationHelper')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'calculationh.php';
}
}
$this->assignRef('show_prices', $show_prices);
if (!class_exists('shopFunctionsF')) {
require VMPATH_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
}
// add javascript for price and cart, need even for quantity buttons, so we need it almost anywhere
vmJsApi::jPrice();
$document = JFactory::getDocument();
$app = JFactory::getApplication();
$pathway = $app->getPathway();
if (!class_exists('VmImage')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'image.php';
}
// set search and keyword
if ($keyword = vRequest::uword('keyword', false, ' ,-,+,.,_')) {
$pathway->addItem($keyword);
//$title .=' ('.$keyword.')';
}
//$search = vRequest::uword('keyword', null);
$this->searchcustom = '';
$this->searchCustomValues = '';
//if (!empty($keyword)) {
$this->getSearchCustom();
$search = $keyword;
/*} else {
$keyword ='';
$search = NULL;
}*/
$this->assignRef('keyword', $keyword);
$this->assignRef('search', $search);
$menus = $app->getMenu();
$menu = $menus->getActive();
if (!empty($menu->id)) {
ShopFunctionsF::setLastVisitedItemId($menu->id);
} else {
if ($itemId = vRequest::getInt('Itemid', false)) {
ShopFunctionsF::setLastVisitedItemId($itemId);
}
}
$virtuemart_manufacturer_id = vRequest::getInt('virtuemart_manufacturer_id', -1);
if ($virtuemart_manufacturer_id === -1 and !empty($menu->query['virtuemart_manufacturer_id'])) {
$virtuemart_manufacturer_id = $menu->query['virtuemart_manufacturer_id'];
vRequest::setVar('virtuemart_manufacturer_id', $virtuemart_manufacturer_id);
}
$this->categoryId = vRequest::getInt('virtuemart_category_id', -1);
if ($this->categoryId === -1 and !empty($menu->query['virtuemart_category_id'])) {
$this->categoryId = $menu->query['virtuemart_category_id'];
vRequest::setVar('virtuemart_category_id', $this->categoryId);
} else {
if ($this->categoryId === -1 and $virtuemart_manufacturer_id === -1) {
$this->categoryId = ShopFunctionsF::getLastVisitedCategoryId();
}
}
$this->setCanonicalLink($tpl, $document, $this->categoryId, $virtuemart_manufacturer_id);
if (($this->categoryId === -1 or $this->categoryId === 0) and $virtuemart_manufacturer_id) {
$this->categoryId = 0;
$catType = 'manufacturer';
$this->setCanonicalLink($tpl, $document, $virtuemart_manufacturer_id, $catType);
}
$categoryModel = VmModel::getModel('category');
$productModel = VmModel::getModel('product');
if ($this->categoryId === -1) {
$this->categoryId = 0;
}
$vendorId = 1;
$category = $categoryModel->getCategory($this->categoryId);
if (!isset($menu->query['showproducts'])) {
$menu->query['showproducts'] = 1;
}
$this->showproducts = vRequest::getInt('showproducts', $menu->query['showproducts']);
if (!empty($category)) {
$vendorId = $category->virtuemart_vendor_id;
if ($this->showproducts) {
//if(empty($category->category_layout) or $category->category_layout != 'categories') {
// Load the products in the given category
$ids = $productModel->sortSearchListQuery(TRUE, $this->categoryId);
$this->perRow = empty($category->products_per_row) ? VmConfig::get('products_per_row', 3) : $category->products_per_row;
$this->vmPagination = $productModel->getPagination($this->perRow);
$ratingModel = VmModel::getModel('ratings');
$this->showRating = $ratingModel->showRating();
$productModel->withRating = $this->showRating;
$this->orderByList = $productModel->getOrderByList($this->categoryId);
$this->products = $productModel->getProducts($ids);
//$products = $productModel->getProductsInCategory($this->categoryId);
$productModel->addImages($this->products, 1);
if ($this->products) {
$currency = CurrencyDisplay::getInstance();
$this->assignRef('currency', $currency);
$display_stock = VmConfig::get('display_stock', 1);
$showCustoms = VmConfig::get('show_pcustoms', 1);
if ($display_stock or $showCustoms) {
if (!$showCustoms) {
foreach ($this->products as $i => $productItem) {
//.........這裏部分代碼省略.........
示例3: updateRequests
/**
* This functions updates the variables of the model which are used in the sortSearchListQuery
* with the variables from the Request
*
* @author Max Milbers
*/
function updateRequests()
{
$this->keyword = vRequest::uword('keyword', "", ' ,-,+,.,_,#,/');
if ($this->keyword == "") {
$this->keyword = vRequest::uword('filter_product', "", ' ,-,+,.,_,#,/');
JRequest::setVar('filter_product', $this->keyword);
JRequest::setVar('keyword', $this->keyword);
} else {
JRequest::setVar('keyword', $this->keyword);
}
$app = JFactory::getApplication();
$option = 'com_virtuemart';
$view = 'product';
if ($app->isSite()) {
$filter_order = JRequest::getString('orderby', "0");
if ($filter_order == "0") {
$filter_order_raw = $this->getLastProductOrdering($this->_selectedOrdering);
$filter_order = $this->checkFilterOrder($filter_order_raw);
} else {
vmdebug('my $filter_order ', $filter_order);
$filter_order = $this->checkFilterOrder($filter_order);
vmdebug('my $filter_order after check', $filter_order);
$this->setLastProductOrdering($filter_order);
}
$filter_order_Dir = strtoupper(JRequest::getWord('dir', VmConfig::get('prd_brws_orderby_dir', 'ASC')));
$valid_search_fields = VmConfig::get('browse_search_fields');
//vmdebug('$valid_search_fields ',$valid_search_fields);
//unset($valid_search_fields[]
} else {
$filter_order = strtolower($app->getUserStateFromRequest('com_virtuemart.' . $view . '.filter_order', 'filter_order', $this->_selectedOrdering, 'cmd'));
$filter_order = $this->checkFilterOrder($filter_order);
$filter_order_Dir = strtoupper($app->getUserStateFromRequest($option . '.' . $view . '.filter_order_Dir', 'filter_order_Dir', '', 'word'));
$valid_search_fields = $this->valid_BE_search_fields;
}
$filter_order_Dir = $this->checkFilterDir($filter_order_Dir);
$this->filter_order = $filter_order;
$this->filter_order_Dir = $filter_order_Dir;
$this->valid_search_fields = $valid_search_fields;
$this->product_parent_id = JRequest::getInt('product_parent_id', FALSE);
$this->virtuemart_manufacturer_id = JRequest::getInt('virtuemart_manufacturer_id', FALSE);
$this->search_type = JRequest::getVar('search_type', '');
$this->searchcustoms = JRequest::getVar('customfields', array(), 'default', 'array');
$this->searchplugin = JRequest::getInt('custom_parent_id', 0);
}
示例4: foreach
<th><?php
echo $this->sort('product_weight', 'COM_VIRTUEMART_PRODUCT_INVENTORY_WEIGHT');
?>
</th>
<th><?php
echo $this->sort('published');
?>
</th>
</tr>
</thead>
<tbody>
<?php
if (count($this->inventorylist) > 0) {
$i = 0;
$k = 0;
$keyword = vRequest::uword('keyword', "", ' ,-,+,.,_,#,/');
foreach ($this->inventorylist as $key => $product) {
$checked = JHTML::_('grid.id', $i, $product->virtuemart_product_id);
$published = JHTML::_('grid.published', $product, $i);
//<!-- low_stock_notification -->
if ($product->product_in_stock - $product->product_ordered < 1) {
$stockstatut = "out";
} elseif ($product->product_in_stock - $product->product_ordered < $product->low_stock_notification) {
$stockstatut = "low";
} else {
$stockstatut = "normal";
}
$stockstatut = 'class="stock-' . $stockstatut . '" title="' . jText::_('COM_VIRTUEMART_STOCK_LEVEL_' . $stockstatut) . '"';
?>
<tr class="row<?php
echo $k;