本文整理汇总了PHP中js_add_trigger函数的典型用法代码示例。如果您正苦于以下问题:PHP js_add_trigger函数的具体用法?PHP js_add_trigger怎么用?PHP js_add_trigger使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了js_add_trigger函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAllReviews
function getAllReviews($category_id = null, $product_id = null, $limitstart = null, $limit = null, $text_search = null, $result = "list", $vendor_id = 0, $order = null, $orderDir = null)
{
$lang = JSFactory::getLang();
$db = JFactory::getDBO();
$where = "";
if ($product_id) {
$where .= " AND pr_rew.product_id='" . $db->escape($product_id) . "' ";
}
if ($vendor_id) {
$where .= " AND pr.vendor_id='" . $db->escape($vendor_id) . "' ";
}
if ($limit > 0) {
$limit = " LIMIT " . $limitstart . " , " . $limit;
}
$where .= $text_search ? " AND CONCAT_WS('|',pr.`" . $lang->get('name') . "`,pr.`" . $lang->get('short_description') . "`,pr.`" . $lang->get('description') . "`,pr_rew.review, pr_rew.user_name, pr_rew.user_email ) LIKE '%" . $db->escape($text_search) . "%' " : '';
$ordering = 'pr_rew.review_id desc';
if ($order && $orderDir) {
$ordering = $order . " " . $orderDir;
}
if ($category_id) {
$query = "select pr.`" . $lang->get('name') . "` as name,pr_rew.* , DATE_FORMAT(pr_rew.`time`,'%d.%m.%Y') as dateadd \r\n from #__jshopping_products_reviews as pr_rew\r\n LEFT JOIN #__jshopping_products as pr USING (product_id)\r\n LEFT JOIN `#__jshopping_products_to_categories` AS pr_cat USING (product_id)\r\n WHERE pr_cat.category_id = '" . $db->escape($category_id) . "' " . $where . " ORDER BY " . $ordering . " " . $limit;
} else {
$query = "select pr.`" . $lang->get('name') . "` as name,pr_rew.*, DATE_FORMAT(pr_rew.`time`,'%d.%m.%Y') as dateadd \r\n from #__jshopping_products_reviews as pr_rew\r\n LEFT JOIN #__jshopping_products as pr USING (product_id) \r\n WHERE 1 " . $where . " ORDER BY " . $ordering . " " . $limit;
}
extract(js_add_trigger(get_defined_vars(), "before"));
$db->setQuery($query);
if ($result == "list") {
return $db->loadObjectList();
} else {
$db->query();
return $db->getNumRows();
}
}
示例2: getAllList
function getAllList($display = 0)
{
$db = JFactory::getDBO();
$lang = JSFactory::getLang();
$query = "SELECT id, `" . $lang->get("name") . "` as name, field_id FROM `#__jshopping_products_extra_field_values` order by ordering";
extract(js_add_trigger(get_defined_vars(), "before"));
$db->setQuery($query);
if ($display == 0) {
return $db->loadObjectList();
} elseif ($display == 1) {
$rows = $db->loadObjectList();
$list = array();
foreach ($rows as $k => $row) {
$list[$row->id] = $row->name;
unset($rows[$k]);
}
return $list;
} else {
$rows = $db->loadObjectList();
$list = array();
foreach ($rows as $k => $row) {
$list[$row->field_id][$row->id] = $row->name;
unset($rows[$k]);
}
return $list;
}
}
示例3: getList
function getList($groupordering = 0, $order = null, $orderDir = null, $filter = array())
{
$db = JFactory::getDBO();
$lang = JSFactory::getLang();
$ordering = "F.ordering";
if ($order && $orderDir) {
$ordering = $order . " " . $orderDir;
}
if ($groupordering) {
$ordering = "G.ordering, " . $ordering;
}
$where = '';
$_where = array();
if ($filter['group']) {
$_where[] = " F.group = '" . $db->escape($filter['group']) . "' ";
}
if ($filter['text_search']) {
$text_search = $filter['text_search'];
$word = addcslashes($db->escape($text_search), "_%");
$_where[] = "(LOWER(F.`" . $lang->get('name') . "`) LIKE '%" . $word . "%' OR LOWER(F.`" . $lang->get('description') . "`) LIKE '%" . $word . "%' OR F.id LIKE '%" . $word . "%')";
}
if (count($_where) > 0) {
$where = " WHERE " . implode(" AND ", $_where);
}
$query = "SELECT F.id, F.`" . $lang->get("name") . "` as name, F.`" . $lang->get("description") . "` as description, F.allcats, F.type, F.cats, F.ordering, F.`group`, G.`" . $lang->get("name") . "` as groupname, multilist FROM `#__jshopping_products_extra_fields` as F left join `#__jshopping_products_extra_field_groups` as G on G.id=F.group " . $where . " order by " . $ordering;
extract(js_add_trigger(get_defined_vars(), "before"));
$db->setQuery($query);
return $db->loadObjectList();
}
示例4: getAllLanguages
function getAllLanguages($publish = 1)
{
$jshopConfig = JSFactory::getConfig();
$db = JFactory::getDBO();
$where_add = $publish ? "where `publish`='1'" : "";
$query = "SELECT * FROM `#__jshopping_languages` " . $where_add . " order by `ordering`";
extract(js_add_trigger(get_defined_vars(), "before"));
$db->setQuery($query);
$rowssort = array();
$rows = $db->loadObjectList();
foreach ($rows as $k => $v) {
$rows[$k]->lang = substr($v->language, 0, 2);
if ($jshopConfig->cur_lang == $v->language) {
$rowssort[] = $rows[$k];
}
}
foreach ($rows as $k => $v) {
if (isset($rowssort[0]) && $rowssort[0]->language == $v->language) {
continue;
}
$rowssort[] = $v;
}
unset($rows);
return $rowssort;
}
示例5: check
function check()
{
$db = JFactory::getDBO();
$res = 1;
if (!$this->product_id) {
$res = 0;
}
if ($this->user_name == '') {
$res = 0;
}
if ($this->user_email == '') {
$res = 0;
}
if ($this->review == '') {
$res = 0;
}
$query = "SELECT product_id FROM #__jshopping_products WHERE product_id=" . intval($this->product_id);
$db->setQuery($query);
$pid = intval($db->loadResult());
if (!$pid) {
$res = 0;
}
extract(js_add_trigger(get_defined_vars(), "after"));
return $res;
}
示例6: getDefaultUsergroup
function getDefaultUsergroup()
{
$db = JFactory::getDBO();
$query = "SELECT `usergroup_id` FROM `#__jshopping_usergroups` WHERE `usergroup_is_default`= '1'";
extract(js_add_trigger(get_defined_vars(), "before"));
$db->setQuery($query);
return $db->loadResult();
}
示例7: getCountPublishCountries
/**
* get count county
* @param int $publish
* @return int
*/
function getCountPublishCountries($publish = 1)
{
$db = JFactory::getDBO();
$query = "SELECT COUNT(country_id) FROM `#__jshopping_countries` WHERE country_publish = '" . intval($publish) . "'";
extract(js_add_trigger(get_defined_vars(), "before"));
$db->setQuery($query);
return $db->loadResult();
}
示例8: getCountCoupons
function getCountCoupons()
{
$db = JFactory::getDBO();
$query = "SELECT count(*) FROM `#__jshopping_coupons`";
extract(js_add_trigger(get_defined_vars(), "before"));
$db->setQuery($query);
return $db->loadResult();
}
示例9: getList
function getList()
{
$db = JFactory::getDBO();
$query = "SELECT * FROM `#__jshopping_import_export` ORDER BY name";
extract(js_add_trigger(get_defined_vars(), "before"));
$db->setQuery($query);
return $db->loadObjectList();
}
示例10: loadMain
function loadMain()
{
$query = "SELECT id FROM #__jshopping_vendors WHERE `main`=1";
extract(js_add_trigger(get_defined_vars(), "query"));
$this->_db->setQuery($query);
$id = intval($this->_db->loadResult());
$this->load($id);
}
示例11: getUsers
function getUsers()
{
$db = JFactory::getDBO();
$query = "SELECT U.`user_id`, IF (concat(U.`f_name`,U.`l_name`)='', U.firma_name, concat(U.`f_name`,' ',U.`l_name`)) as `name`\r\n FROM `#__jshopping_users` as U INNER JOIN `#__users` AS UM ON U.user_id=UM.id\r\n ORDER BY name";
extract(js_add_trigger(get_defined_vars(), "before"));
$db->setQuery($query);
return $db->loadObjectList();
}
示例12: getMaxOrdering
function getMaxOrdering()
{
$db = JFactory::getDBO();
$query = "select max(ordering) from `#__jshopping_shipping_method`";
extract(js_add_trigger(get_defined_vars(), "before"));
$db->setQuery($query);
return $db->loadResult();
}
示例13: getList
function getList()
{
$lang = JSFactory::getLang();
$db = JFactory::getDBO();
$query = "SELECT id, alias, `" . $lang->get('title') . "` as title, `" . $lang->get('keyword') . "` as keyword, `" . $lang->get('description') . "` as description FROM `#__jshopping_config_seo` ORDER BY ordering";
$db->setQuery($query);
extract(js_add_trigger(get_defined_vars(), "before"));
return $db->loadObjectList();
}
示例14: getAllAttributes
function getAllAttributes($result = 0, $categorys = null, $order = null, $orderDir = null)
{
$lang = JSFactory::getLang();
$db = JFactory::getDBO();
$ordering = "A.attr_ordering asc";
if ($order && $orderDir) {
$ordering = $order . " " . $orderDir;
}
$query = "SELECT A.attr_id, A.`" . $lang->get("name") . "` as name, A.attr_type, A.attr_ordering, A.independent, A.allcats, A.cats, G.`" . $lang->get("name") . "` as groupname\r\n FROM `#__jshopping_attr` as A left join `#__jshopping_attr_groups` as G on A.`group`=G.id\r\n ORDER BY " . $ordering;
extract(js_add_trigger(get_defined_vars(), "before"));
$db->setQuery($query);
$list = $db->loadObjectList();
if (is_array($categorys) && count($categorys)) {
foreach ($list as $k => $v) {
if (!$v->allcats) {
if ($v->cats != "") {
$cats = unserialize($v->cats);
} else {
$cats = array();
}
$enable = 0;
foreach ($categorys as $cid) {
if (in_array($cid, $cats)) {
$enable = 1;
}
}
if (!$enable) {
unset($list[$k]);
}
}
}
}
if ($result == 0) {
return $list;
}
if ($result == 1) {
$attributes_format1 = array();
foreach ($list as $v) {
$attributes_format1[$v->attr_id] = $v;
}
return $attributes_format1;
}
if ($result == 2) {
$attributes_format2 = array();
$attributes_format2['independent'] = array();
$attributes_format2['dependent'] = array();
foreach ($list as $v) {
if ($v->independent) {
$key_dependent = "independent";
} else {
$key_dependent = "dependent";
}
$attributes_format2[$key_dependent][$v->attr_id] = $v;
}
return $attributes_format2;
}
}
示例15: loadFromAlias
function loadFromAlias($alias)
{
$db = JFactory::getDBO();
$query = "SELECT id FROM `#__jshopping_shipping_ext_calc` WHERE `alias`='" . $db->escape($alias) . "'";
extract(js_add_trigger(get_defined_vars(), "query"));
$db->setQuery($query);
$id = $db->loadResult();
return $this->load($id);
}