本文整理汇总了PHP中fn_get_products函数的典型用法代码示例。如果您正苦于以下问题:PHP fn_get_products函数的具体用法?PHP fn_get_products怎么用?PHP fn_get_products使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fn_get_products函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: fn_required_products_get_product_data_post
function fn_required_products_get_product_data_post(&$product, &$auth)
{
if (!empty($product['product_id'])) {
list($required) = fn_get_products(array('for_required_product' => $product['product_id']));
if (count($required)) {
$product['have_required'] = 'Y';
$ids = fn_array_column($required, 'product_id');
$have = fn_required_products_get_existent($auth, $ids);
$product['required_products'] = array();
fn_gather_additional_products_data($required, array('get_icon' => true, 'get_detailed' => true, 'get_options' => true, 'get_discounts' => true));
foreach ($required as $entry) {
$id = $entry['product_id'];
$product['required_products'][$id] = $entry;
$product['required_products'][$id]['bought'] = $have && in_array($id, $have) ? 'Y' : 'N';
}
if (!empty($have) && count($have) >= count($ids)) {
$product['can_add_to_cart'] = 'Y';
} else {
$product['can_add_to_cart'] = 'N';
}
} else {
$product['have_required'] = 'N';
}
}
}
开发者ID:ambient-lounge,项目名称:site,代码行数:25,代码来源:func.php
示例2: fn_required_products_get_product_data_more
function fn_required_products_get_product_data_more(&$product, &$auth)
{
if (!empty($product['product_id'])) {
list($requered) = fn_get_products(array('for_required_product' => $product['product_id'], 'type' => 'extended'));
if (count($requered)) {
$product['have_required'] = 'Y';
$ids = array();
foreach ($requered as $entry) {
$ids[] = $entry['product_id'];
}
$have = fn_required_products_get_existent($auth, $ids, false);
$product['required_products'] = array();
foreach ($requered as $entry) {
$id = $entry['product_id'];
fn_gather_additional_product_data($entry, true, true, true, true, true);
$product['required_products'][$id] = $entry;
$product['required_products'][$id]['bought'] = $have && in_array($id, $have) ? 'Y' : 'N';
}
if (!empty($have) && count($have) >= count($ids)) {
$product['can_add_to_cart'] = 'Y';
} else {
$product['can_add_to_cart'] = 'N';
}
} else {
$product['have_required'] = 'N';
}
}
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:28,代码来源:func.php
示例3: index
public function index($id = 0, $params = array())
{
$lang_code = $this->safeGet($params, 'lang_code', DEFAULT_LANGUAGE);
if ($this->getParentName() == 'categories') {
$parent_category = $this->getParentData();
$params['cid'] = $parent_category['category_id'];
}
if (!empty($id)) {
$data = fn_get_product_data($id, $this->auth, $lang_code, '', true, true, true, false, false, false, false);
if (empty($data)) {
$status = Response::STATUS_NOT_FOUND;
} else {
$status = Response::STATUS_OK;
}
} else {
$items_per_page = $this->safeGet($params, 'items_per_page', Registry::get('settings.Appearance.admin_products_per_page'));
$params['extend'][] = 'categories';
list($products, $search) = fn_get_products($params, $items_per_page, $lang_code);
$params['get_options'] = $this->safeGet($params, 'get_options', false);
$params['get_features'] = $this->safeGet($params, 'get_features', true);
$params['get_detailed'] = $this->safeGet($params, 'get_detailed', true);
$params['get_icon'] = $this->safeGet($params, 'get_icon', true);
$params['get_additional'] = $this->safeGet($params, 'get_additional', true);
$params['detailed_params'] = $this->safeGet($params, 'detailed_params', false);
$params['features_display_on'] = 'A';
fn_gather_additional_products_data($products, $params);
$data = array('products' => array_values($products), 'params' => $search);
$status = Response::STATUS_OK;
}
return array('status' => $status, 'data' => $data);
}
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:Products.php
示例4: processProducts
/**
* Gets products for printing and print them
* @param array $params product search params
*/
protected function processProducts($params)
{
$total = static::ITEMS_PER_PAGE;
while (static::ITEMS_PER_PAGE * ($params['page'] - 1) <= $total) {
list($products, $search) = fn_get_products($params, static::ITEMS_PER_PAGE);
$total = $search['total_items'];
if ($params['page'] == 1) {
fn_set_progress('parts', $total);
}
$get_images = !empty($this->selected_fields['image']);
$_params = array('get_icon' => $get_images, 'get_detailed' => $get_images, 'get_options' => Registry::get('addons.price_list.include_options') == 'Y' ? true : false, 'get_discounts' => false);
fn_gather_additional_products_data($products, $_params);
$params['page']++;
$this->printProductsBatch(true);
foreach ($products as $product) {
fn_set_progress('echo');
if (Registry::get('addons.price_list.include_options') == 'Y' && $product['has_options']) {
$product = fn_price_list_get_combination($product);
foreach ($product['combinations'] as $c_id => $c_value) {
$product['price'] = $product['combination_prices'][$c_id];
$product['weight'] = $product['combination_weight'][$c_id];
$product['amount'] = $product['combination_amount'][$c_id];
$product['product_code'] = $product['combination_code'][$c_id];
$this->printProductRow($product, $c_value);
}
} else {
$this->printProductRow($product);
}
}
$this->printProductsBatch();
}
}
开发者ID:ambient-lounge,项目名称:site,代码行数:36,代码来源:AGenerator.php
示例5: fn_specific_development_products_from_current_category
function fn_specific_development_products_from_current_category($category_ids)
{
$category_id = fn_specific_development_get_main_category($category_ids);
if (!$category_id) {
return array();
}
$params = array('sl' => 'EN', 'type' => 'extended', 'cid' => $category_id);
if (!empty($_REQUEST['sl'])) {
$params['sl'] = $_REQUEST['sl'];
}
list($products) = fn_get_products($params);
if (!empty($products)) {
foreach ($products as $k => $v) {
fn_gather_additional_product_data($products[$k], false, true, false, false, true);
}
}
fn_specific_development_view_category($products);
return $products;
}
开发者ID:ambient-lounge,项目名称:site,代码行数:19,代码来源:func_eileen_08232012.php
示例6: fn_required_products_get_product_data_post
function fn_required_products_get_product_data_post(&$product, &$auth)
{
if (!empty($product['product_id'])) {
list($required) = fn_get_products(array('for_required_product' => $product['product_id']));
//var_dump($required);
//var_dump(AREA);
if (AREA != "A") {
$checkedVariants = db_get_fields("SELECT required_id FROM ?:product_required_products WHERE product_id=?i AND linked=1", $_REQUEST['product_id']);
foreach ($required as $keyProductRequired => $productRequired) {
if (in_array($productRequired['product_id'], $checkedVariants)) {
unset($required[$keyProductRequired]);
}
}
}
if (count($required)) {
$product['have_required'] = 'Y';
$ids = array();
foreach ($required as $entry) {
$ids[] = $entry['product_id'];
}
$have = fn_required_products_get_existent($auth, $ids, false);
$product['required_products'] = array();
fn_gather_additional_products_data($required, array('get_icon' => true, 'get_detailed' => true, 'get_options' => true, 'get_discounts' => true));
foreach ($required as $entry) {
$id = $entry['product_id'];
$product['required_products'][$id] = $entry;
$product['required_products'][$id]['bought'] = $have && in_array($id, $have) ? 'Y' : 'N';
}
if (!empty($have) && count($have) >= count($ids)) {
$product['can_add_to_cart'] = 'Y';
} else {
$product['can_add_to_cart'] = 'N';
}
} else {
$product['have_required'] = 'N';
}
}
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:38,代码来源:func.php
示例7: fn_lv_get_product_default_navigation
/**
* Gets products default navigation
*
* @param array $params Request params
* @return array navigation data
*/
function fn_lv_get_product_default_navigation($params)
{
if (empty($params['product_id'])) {
return false;
}
$update_data = array();
$product_id = $params['product_id'];
if (fn_allowed_for('ULTIMATE') && Registry::get('runtime.company_id')) {
$company_condition = fn_get_company_condition('c.company_id');
$category_id = db_get_field("SELECT c.category_id, IF(pc.link_type = ?s, 1, 0) as is_main FROM ?:categories AS c LEFT JOIN ?:products_categories AS pc ON c.category_id = pc.category_id WHERE pc.product_id = ?i {$company_condition} ORDER BY is_main DESC", 'M', $product_id);
} else {
$category_id = db_get_field("SELECT category_id FROM ?:products_categories WHERE product_id = ?i AND link_type = ?s", $product_id, 'M');
}
if (empty($category_id)) {
return false;
}
$search_params = array('cid' => $category_id, 'get_conditions' => true);
list($fields, $join, $condition) = fn_get_products($search_params);
$sorting = "ORDER BY descr1.product asc";
// get product position in full list
db_query("SET @r = 0;");
$product_position = db_get_field("SELECT a.row FROM (SELECT products.product_id, @r := @r + 1 as row FROM ?:products as products {$join} WHERE 1 {$condition} GROUP BY products.product_id {$sorting}) AS a WHERE a.product_id = ?i", $product_id);
$items_per_page = Registry::get('settings.Appearance.products_per_page');
if (empty($product_position) || empty($items_per_page)) {
return false;
}
$page = ceil($product_position / $items_per_page);
$limit = db_paginate($page, $items_per_page);
$stored_items_ids[$page] = db_get_fields("SELECT SQL_CALC_FOUND_ROWS products.product_id FROM ?:products as products {$join} WHERE 1 {$condition} GROUP BY products.product_id {$sorting} {$limit}");
$total_items = db_get_found_rows();
$total_pages = ceil($total_items / $items_per_page);
unset($search_params['get_conditions']);
$update_data['params'] = serialize($search_params);
$update_data['view_results'] = array('items_ids' => $stored_items_ids, 'total_pages' => $total_pages, 'items_per_page' => $items_per_page, 'total_items' => $total_items);
$update_data['view_results'] = serialize($update_data['view_results']);
return $update_data;
}
开发者ID:askzap,项目名称:ultimate,代码行数:43,代码来源:frontend.functions.php
示例8: fn_rssf_get_items
function fn_rssf_get_items($params, $lang_code = CART_LANGUAGE)
{
$items_data = $additional_data = $block_data = array();
if (!empty($params['bid']) && !empty($params['sid']) && empty($params['category_id'])) {
$block_data = Block::instance()->getById($params['bid'], $params['sid'], array(), $lang_code);
if (!empty($block_data['content']['filling']) && $block_data['content']['filling'] == 'products') {
$_params = array('sort_by' => $block_data['properties']['filling']['products']['rss_sort_by'] == 'U' ? 'updated_timestamp' : 'timestamp', 'sort_order' => 'desc');
$max_items = !empty($block_data['properties']['max_item']) ? $block_data['properties']['max_item'] : 5;
list($products) = fn_get_products($_params, $max_items, $lang_code);
fn_gather_additional_products_data($products, array('get_icon' => true, 'get_detailed' => true, 'get_options' => false, 'get_discounts' => false));
$additional_data['title'] = !empty($block_data['properties']['feed_title']) ? $block_data['properties']['feed_title'] : __('products') . '::' . __('page_title', '', $lang_code);
$additional_data['description'] = !empty($block_data['properties']['feed_description']) ? $block_data['properties']['feed_description'] : $additional_data['title'];
$additional_data['link'] = fn_url('', 'C', 'http', $lang_code);
$additional_data['language'] = $lang_code;
$additional_data['lastBuildDate'] = !empty($products[0]['updated_timestamp']) ? $products[0]['updated_timestamp'] : TIME;
$items_data = fn_format_products_items($products, $block_data['properties']['filling']['products'], $lang_code);
}
} else {
//show rss feed for categories page
list($items_data, $additional_data) = fn_format_categories_items($params, $lang_code);
}
fn_set_hook('generate_rss_feed', $items_data, $additional_data, $block_data, $lang_code);
return array($items_data, $additional_data);
}
开发者ID:arpad9,项目名称:bygmarket,代码行数:24,代码来源:rss.php
示例9: fn_google_sitemap_get_content
function fn_google_sitemap_get_content($map_page = 0)
{
$cache_path = fn_get_cache_path(false) . 'google_sitemap/';
define('ITEMS_PER_PAGE', 500);
define('MAX_URLS_IN_MAP', 50000);
// 50 000 is the maximum for one sitemap file
define('MAX_SIZE_IN_KBYTES', 10000);
// 10240 KB || 10 Mb is the maximum for one sitemap file
$sitemap_settings = Registry::get('addons.google_sitemap');
$location = Registry::get('config.http_location');
$lmod = date("Y-m-d", TIME);
header("Content-Type: text/xml;charset=utf-8");
// HEAD SECTION
$simple_head = <<<HEAD
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
HEAD;
$simple_foot = <<<FOOT
</urlset>
FOOT;
$index_map_url = <<<HEAD
<url>
<loc>{$location}/</loc>
<lastmod>{$lmod}</lastmod>
<changefreq>{$sitemap_settings['site_change']}</changefreq>
<priority>{$sitemap_settings['site_priority']}</priority>
</url>
HEAD;
// END HEAD SECTION
// SITEMAP CONTENT
$link_counter = 1;
$file_counter = 1;
fn_mkdir($cache_path);
$file = fopen($cache_path . 'sitemap' . $file_counter . '.xml', "wb");
fwrite($file, $simple_head . $index_map_url);
$languages = db_get_hash_single_array("SELECT lang_code, name FROM ?:languages WHERE status = 'A'", array('lang_code', 'name'));
if ($sitemap_settings['include_categories'] == "Y") {
$categories = db_get_fields("SELECT category_id FROM ?:categories WHERE FIND_IN_SET(?i, usergroup_ids) AND status = 'A' ?p", USERGROUP_ALL, fn_get_google_sitemap_company_condition('?:categories.company_id'));
//Add the all active categories
foreach ($categories as $category) {
$links = fn_google_sitemap_generate_link('category', $category, $languages);
$item = fn_google_sitemap_print_item_info($links, $lmod, $sitemap_settings['categories_change'], $sitemap_settings['categories_priority']);
fn_google_sitemap_check_counter($file, $link_counter, $file_counter, $links, $simple_head, $simple_foot);
fwrite($file, $item);
}
}
if ($sitemap_settings['include_products'] == "Y") {
$page = 1;
$total = ITEMS_PER_PAGE;
$params = $_REQUEST;
$params['page'] = $page;
$params['custom_extend'] = array('categories');
$params['sort_by'] = 'null';
$params['only_short_fields'] = true;
while (ITEMS_PER_PAGE * ($params['page'] - 1) <= $total) {
list($products, $search) = fn_get_products($params, ITEMS_PER_PAGE);
$total = $search['total_items'];
$params['page']++;
foreach ($products as $product) {
$links = fn_google_sitemap_generate_link('product', $product['product_id'], $languages);
$item = fn_google_sitemap_print_item_info($links, $lmod, $sitemap_settings['products_change'], $sitemap_settings['products_priority']);
fn_google_sitemap_check_counter($file, $link_counter, $file_counter, $links, $simple_head, $simple_foot);
fwrite($file, $item);
}
}
unset($products);
}
if ($sitemap_settings['include_pages'] == "Y") {
$pages = db_get_fields("SELECT page_id FROM ?:pages WHERE status = 'A' AND page_type != 'L' ?p", fn_get_google_sitemap_company_condition('?:pages.company_id'));
//Add the all active pages
foreach ($pages as $page) {
$links = fn_google_sitemap_generate_link('page', $page, $languages);
$item = fn_google_sitemap_print_item_info($links, $lmod, $sitemap_settings['pages_change'], $sitemap_settings['pages_priority']);
fn_google_sitemap_check_counter($file, $link_counter, $file_counter, $links, $simple_head, $simple_foot);
fwrite($file, $item);
}
}
if ($sitemap_settings['include_extended'] == "Y") {
$vars = db_get_fields("SELECT ?:product_feature_variants.variant_id FROM ?:product_feature_variants " . "LEFT JOIN ?:product_features ON (?:product_feature_variants.feature_id = ?:product_features.feature_id) " . "WHERE ?:product_features.feature_type = 'E' AND ?:product_features.status = 'A'");
//Add the all active extended features
foreach ($vars as $var) {
$links = fn_google_sitemap_generate_link('extended', $var, $languages);
$item = fn_google_sitemap_print_item_info($links, $lmod, $sitemap_settings['extended_change'], $sitemap_settings['extended_priority']);
fn_google_sitemap_check_counter($file, $link_counter, $file_counter, $links, $simple_head, $simple_foot);
fwrite($file, $item);
}
}
if (Registry::isExist("addons.news_and_emails") && $sitemap_settings['include_news'] == 'Y') {
$news = db_get_fields("SELECT news_id FROM ?:news WHERE status = 'A' ?p", fn_get_google_sitemap_company_condition('?:news.company_id'));
if (!empty($news)) {
foreach ($news as $news_id) {
$links = fn_google_sitemap_generate_link('news', $news_id, $languages);
$item = fn_google_sitemap_print_item_info($links, $lmod, $sitemap_settings['news_change'], $sitemap_settings['news_priority']);
//.........这里部分代码省略.........
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:101,代码来源:func.php
示例10: fn_twg_api_get_products
/**
* Get products as API list
* @param array $params
* @param integer $items_per_page
* @param string $lang_code
* @return array array('products' => array(), 'params' => array())
*/
function fn_twg_api_get_products($params, $items_per_page = 10, $lang_code = CART_LANGUAGE)
{
$to_unserialize = array('extend', 'variants');
foreach ($to_unserialize as $field) {
if (!empty($params[$field]) && is_string($params[$field])) {
$params[$field] = unserialize($params[$field]);
}
}
if (empty($params['extend'])) {
$params['extend'] = array('description');
}
if (!empty($params['pid']) && !is_array($params['pid'])) {
$params['pid'] = explode(',', $params['pid']);
}
if (!empty($params['q'])) {
// search by product code
$params['ppcode'] = 'Y';
$params['subcats'] = 'Y';
$params['status'] = 'A';
$params['pshort'] = 'Y';
$params['pfull'] = 'Y';
$params['pname'] = 'Y';
$params['pkeywords'] = 'Y';
$params['search_performed'] = 'Y';
}
if (isset($params['company_id']) and $params['company_id'] == 0) {
unset($params['company_id']);
}
if (empty($params['page'])) {
$params['page'] = 1;
}
list($products, $params) = fn_get_products($params, $items_per_page, $lang_code);
fn_gather_additional_products_data($products, array('get_icon' => true, 'get_detailed' => true, 'get_options' => true, 'get_discounts' => true, 'get_features' => false));
if (empty($products)) {
return array(array(), array());
}
$product_ids = array();
$image_params = TwigmoSettings::get('images.catalog');
foreach ($products as $k => $v) {
if (!empty($products[$k]['short_description']) || !empty($products[$k]['full_description'])) {
$products[$k]['short_description'] = !empty($products[$k]['short_description']) ? strip_tags($products[$k]['short_description']) : fn_substr(strip_tags($products[$k]['full_description']), 0, TWG_MAX_DESCRIPTION_LEN);
unset($products[$k]['full_description']);
} else {
$products[$k]['short_description'] = '';
}
$product_ids[] = $v['product_id'];
// Get product image data
if (!empty($v['main_pair'])) {
$products[$k]['icon'] = TwigmoImage::getApiImageData($v['main_pair'], 'product', 'icon', $image_params);
}
}
$category_descr = !empty($product_ids) ? db_get_hash_array("SELECT p.product_id, p.category_id, c.category\n FROM ?:products_categories AS p, ?:category_descriptions AS c\n WHERE c.category_id = p.category_id\n AND c.lang_code = ?s\n AND p.product_id IN (?a)\n AND p.link_type = 'M'", 'product_id', $lang_code, $product_ids) : array();
foreach ($products as $key => $product) {
if (!empty($product['product_id']) && !empty($category_descr[$product['product_id']])) {
$products[$key]['category'] = $category_descr[$product['product_id']]['category'];
$products[$key]['category_id'] = $category_descr[$product['product_id']]['category_id'];
}
if (!empty($product['inventory_amount']) && $product['inventory_amount'] > $product['amount']) {
$products[$key]['amount'] = $product['inventory_amount'];
}
}
$result = Api::getAsList('products', $products);
return array($result, $params);
}
开发者ID:arpad9,项目名称:bygmarket,代码行数:71,代码来源:func.php
示例11: fn_data_feeds_export
function fn_data_feeds_export($datafeed_id, $options = array(), $pattern = '')
{
static $pattern;
if (empty($pattern)) {
$pattern = fn_get_pattern_definition('products');
}
$params['datafeed_id'] = $datafeed_id;
$params['single'] = true;
$params['available_fields'] = 'Y';
$params = array_merge($params, $options);
$datafeed_data = fn_data_feeds_get_data($params, DESCR_SL);
if (empty($pattern) || empty($params['datafeed_id'])) {
fn_set_notification('E', __('error'), __('error_exim_no_data_exported'));
return false;
}
if ($datafeed_data['exclude_disabled_products'] == 'Y') {
$params['status'] = 'A';
}
if (empty($datafeed_data['products']) && empty($datafeed_data['categories'])) {
$params['cid'] = 0;
$params['subcats'] = 'Y';
$params['skip_view'] = 'Y';
$params['extend'] = array('categories');
list($products, $search) = fn_get_products($params);
$pids = array_map(create_function('$product', '$pid = $product["product_id"]; return $pid;'), $products);
} else {
$pids = array();
if (!empty($datafeed_data['products'])) {
$pids = explode(',', $datafeed_data['products']);
}
if (!empty($datafeed_data['categories'])) {
$params['cid'] = explode(',', $datafeed_data['categories']);
$params['subcats'] = 'Y';
$params['skip_view'] = 'Y';
$params['extend'] = array('categories');
list($products, $search) = fn_get_products($params);
$_pids = array_map(create_function('$product', '$pid = $product["product_id"]; return $pid;'), $products);
$pids = array_merge($pids, $_pids);
unset($_pids);
}
$pids = array_unique($pids);
}
if (empty($pids)) {
fn_set_notification('E', __('error'), __('error_exim_no_data_exported'));
return false;
}
$pattern['condition']['conditions']['product_id'] = $pids;
$fields = array();
if (!empty($datafeed_data['fields'])) {
foreach ($datafeed_data['fields'] as $field) {
$fields[$field['field']] = $field['export_field_name'];
}
}
$features = db_get_array('SELECT feature_id, description FROM ?:product_features_descriptions WHERE lang_code = ?s', DESCR_SL);
$features_fields = array();
if (!empty($features)) {
foreach ($features as $feature) {
$features_fields[$feature['description']] = array('process_get' => array('fn_data_feeds_get_product_features', '#key', '#field', '#lang_code'), 'linked' => false);
}
}
$pattern['export_fields'] = array_merge($pattern['export_fields'], $features_fields);
$options = $datafeed_data['export_options'];
$options['delimiter'] = $datafeed_data['csv_delimiter'];
$options['filename'] = $datafeed_data['file_name'];
$options['fields_names'] = true;
$options['force_header'] = true;
$pattern['enclosure'] = !empty($datafeed_data['enclosure']) ? $datafeed_data['enclosure'] : '';
if (!empty($fields)) {
if (fn_export($pattern, $fields, $options) == true) {
$errors = false;
$export_location = empty($params['location']) ? $datafeed_data['export_location'] : $params['location'];
if ($export_location == 'S') {
if (file_exists(fn_get_files_dir_path() . $datafeed_data['file_name']) && is_dir($datafeed_data['save_dir'])) {
fn_rename(fn_get_files_dir_path() . $datafeed_data['file_name'], $datafeed_data['save_dir'] . '/' . $datafeed_data['file_name']);
} else {
$errors = true;
fn_set_notification('E', __('error'), __('check_server_export_settings'));
}
} elseif ($export_location == 'F') {
if (empty($datafeed_data['ftp_url'])) {
$errors = true;
fn_set_notification('E', __('error'), __('ftp_connection_problem'));
} else {
preg_match("/[^\\/^\\^:]+/", $datafeed_data['ftp_url'], $matches);
$host = $matches[0];
preg_match("/.*:([0-9]+)/", $datafeed_data['ftp_url'], $matches);
$port = empty($matches[1]) ? 21 : $matches[1];
preg_match("/[^\\/]+(.*)/", $datafeed_data['ftp_url'], $matches);
$url = empty($matches[1]) ? '' : $matches[1];
$conn_id = @ftp_connect($host, $port);
$result = @ftp_login($conn_id, $datafeed_data['ftp_user'], $datafeed_data['ftp_pass']);
if (!empty($url)) {
@ftp_chdir($conn_id, $url);
}
$filename = fn_get_files_dir_path() . $datafeed_data['file_name'];
if ($result) {
if (@ftp_put($conn_id, $datafeed_data['file_name'], $filename, FTP_ASCII)) {
unlink($filename);
} else {
$errors = true;
//.........这里部分代码省略.........
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:101,代码来源:func.php
示例12: fn_get_product_data_for_compare
if (!empty($optsVariantsLinksToProductsArray)) {
$comparationResults = fn_get_product_data_for_compare($optsVariantsLinksToProductsArray, $action);
Registry::get('view')->assign('comparison_data', $comparationResults);
Registry::get('view')->assign('total_products', count($optsVariantsLinksToProductsArray));
Registry::get('view')->assign('list', $list);
Registry::get('view')->assign('action', $action);
}
if ($_REQUEST['compare_type']) {
Registry::get('view')->assign('elem_width', $_REQUEST['elem_width']);
Registry::set('runtime.root_template', 'views/products/show_option_variant_link_products_list.tpl');
}
} elseif ($mode == 'show_boxes_products') {
if ($_REQUEST['product_ids']) {
$params['item_ids'] = $_REQUEST['product_ids'];
$params['p_status'] = array("A", "H");
list($products, $search) = fn_get_products($params, 100, CART_LANGUAGE);
}
Registry::get('view')->assign('products', $products);
} elseif ($mode == 'ls_wishlist_update') {
//update number of favorite products through ajax
$result = $_SESSION['wishlist'];
$wishlistest3 = count($result['products']);
echo $wishlistest3;
exit;
} elseif ($mode == 'delete_footer' && !empty($_REQUEST['cart_id'])) {
fn_delete_wishlist_product($wishlist, $_REQUEST['cart_id']);
fn_save_cart_content($wishlist, $auth['user_id'], 'W');
exit;
} elseif ($mode == 'view_details_compact') {
if ($_REQUEST['variant_id']) {
$fieldsOptionsVariantsLinksToProducts = "d.product_id AS linked_product_id";
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:31,代码来源:products.php
示例13: fn_get_users
//.........这里部分代码省略.........
}
if (!fn_allowed_for('ULTIMATE:FREE')) {
if (isset($params['usergroup_id']) && $params['usergroup_id'] != ALL_USERGROUPS) {
if (!empty($params['usergroup_id'])) {
$join .= db_quote(" LEFT JOIN ?:usergroup_links ON ?:usergroup_links.user_id = ?:users.user_id AND ?:usergroup_links.usergroup_id = ?i", $params['usergroup_id']);
$condition['usergroup_links'] = " AND ?:usergroup_links.status = 'A'";
} else {
$join .= " LEFT JOIN ?:usergroup_links ON ?:usergroup_links.user_id = ?:users.user_id AND ?:usergroup_links.status = 'A'";
$condition['usergroup_links'] = " AND ?:usergroup_links.user_id IS NULL";
}
}
}
if (!empty($params['status'])) {
$condition['status'] = db_quote(" AND ?:users.status = ?s", $params['status']);
}
if (isset($params['email']) && fn_string_not_empty($params['email'])) {
$condition['email'] = db_quote(" {$union_condition} ?:users.email LIKE ?l", "%" . trim($params['email']) . "%");
}
if (isset($params['address']) && fn_string_not_empty($params['address'])) {
$condition['address'] = db_quote(" AND (?:user_profiles.b_address LIKE ?l OR ?:user_profiles.s_address LIKE ?l)", "%" . trim($params['address']) . "%", "%" . trim($params['address']) . "%");
}
if (isset($params['zipcode']) && fn_string_not_empty($params['zipcode'])) {
$condition['zipcode'] = db_quote(" AND (?:user_profiles.b_zipcode LIKE ?l OR ?:user_profiles.s_zipcode LIKE ?l)", "%" . trim($params['zipcode']) . "%", "%" . trim($params['zipcode']) . "%");
}
if (!empty($params['country'])) {
$condition['country'] = db_quote(" AND (?:user_profiles.b_country LIKE ?l OR ?:user_profiles.s_country LIKE ?l)", "%{$params['country']}%", "%{$params['country']}%");
}
if (isset($params['state']) && fn_string_not_empty($params['state'])) {
$condition['state'] = db_quote(" AND (?:user_profiles.b_state LIKE ?l OR ?:user_profiles.s_state LIKE ?l)", "%" . trim($params['state']) . "%", "%" . trim($params['state']) . "%");
}
if (isset($params['city']) && fn_string_not_empty($params['city'])) {
$condition['city'] = db_quote(" AND (?:user_profiles.b_city LIKE ?l OR ?:user_profiles.s_city LIKE ?l)", "%" . trim($params['city']) . "%", "%" . trim($params['city']) . "%");
}
if (!empty($params['user_id'])) {
$condition['user_id'] = db_quote(' AND ?:users.user_id IN (?n)', $params['user_id']);
}
if (!empty($params['p_ids']) || !empty($params['product_view_id'])) {
$arr = strpos($params['p_ids'], ',') !== false || !is_array($params['p_ids']) ? explode(',', $params['p_ids']) : $params['p_ids'];
if (empty($params['product_view_id'])) {
$condition['order_product_id'] = db_quote(" AND ?:order_details.product_id IN (?n)", $arr);
} else {
$condition['order_product_id'] = db_quote(" AND ?:order_details.product_id IN (?n)", db_get_fields(fn_get_products(array('view_id' => $params['product_view_id'], 'get_query' => true))));
}
$join .= db_quote(" LEFT JOIN ?:orders ON ?:orders.user_id = ?:users.user_id AND ?:orders.is_parent_order != 'Y' LEFT JOIN ?:order_details ON ?:order_details.order_id = ?:orders.order_id");
}
if (defined('RESTRICTED_ADMIN')) {
// FIXME: NOT GOOD
$condition['restricted_admin'] = db_quote(" AND ((?:users.user_type != 'A' AND ?:users.user_type != 'V') OR (?:users.user_type = 'A' AND ?:users.user_id = ?i))", $auth['user_id']);
}
// sometimes other vendor's admins could buy products from other vendors.
if (!empty($params['user_type']) && (!($params['user_type'] == 'C' && Registry::get('runtime.company_id')) || fn_allowed_for('ULTIMATE'))) {
$condition['user_type'] = db_quote(' AND ?:users.user_type = ?s', $params['user_type']);
} else {
// Get active user types
$user_types = array_keys(fn_get_user_types());
// Select only necessary groups frm all available
if (!empty($params['user_types'])) {
$user_types = array_intersect($user_types, $params['user_types']);
}
if (!empty($params['exclude_user_types'])) {
$user_types = array_diff($user_types, $params['exclude_user_types']);
}
$condition['user_type'] = db_quote(" AND ?:users.user_type IN(?a)", $user_types);
}
$join .= db_quote(" LEFT JOIN ?:user_profiles ON ?:user_profiles.user_id = ?:users.user_id");
$join .= db_quote(" LEFT JOIN ?:companies ON ?:companies.company_id = ?:users.company_id");
/**
* Prepare params for getting users query
*
* @param array $params Params list
* @param array $fields Fields list
* @param array $sortings Sorting variants
* @param array $condition Conditions set
* @param str $join Joins list
* @param array $auth Auth data
*/
fn_set_hook('get_users', $params, $fields, $sortings, $condition, $join, $auth);
$sorting = db_sort($params, $sortings, 'name', 'asc');
// Used for Extended search
if (!empty($params['get_conditions'])) {
return array($fields, $join, $condition);
}
// Paginate search results
$limit = '';
if (!empty($params['items_per_page'])) {
$params['total_items'] = db_get_field("SELECT COUNT(DISTINCT(?:users.user_id)) FROM ?:users {$join} WHERE 1 " . implode(' ', $condition));
$limit = db_paginate($params['page'], $params['items_per_page'], $params['total_items']);
}
$users = db_get_array("SELECT " . implode(', ', $fields) . " FROM ?:users {$join} WHERE 1" . implode('', $condition) . " {$group} {$sorting} {$limit}");
LastView::instance()->processResults('users', $users, $params);
/**
* Actions after getting users list
*
* @param array $users Users list
* @param array $params Params list
* @param array $auth Auth data
*/
fn_set_hook('get_users_post', $users, $params, $auth);
return array($users, $params);
}
开发者ID:askzap,项目名称:ultimate,代码行数:101,代码来源:fn.users.php
示例14: die
<?php
use Tygh\Registry;
if (!defined('BOOTSTRAP')) {
die('Access denied');
}
if ($mode == 'view' && !empty($_REQUEST['product_id'])) {
$product_id = $_REQUEST['product_id'];
if (!empty($product_id)) {
$catId = db_get_field('SELECT category_id FROM ?:products_categories WHERE product_id = ?i LIMIT 1', $product_id);
if ($catId) {
Registry::get('view')->assign('catid', $catId);
} else {
$catId = 0;
Registry::get('view')->assign('catid', $catId);
}
list($products) = fn_get_products(array('pid' => $product_id));
!empty($products[0]['price']) ? Registry::get('view')->assign('ra_oldPrice', $products[0]['price']) : "";
}
}
开发者ID:retargeting,项目名称:CsCart,代码行数:20,代码来源:products.post.php
示例15: fn_twg_get_product_stats_by_params
function fn_twg_get_product_stats_by_params($params = array())
{
$default_params = array('only_short_fields' => true, 'extend' => array('companies', 'sharing'), 'get_conditions' => true);
$params = array_merge($default_params, $params);
list($fields, $join, $condition) = fn_get_products($params);
if (isset($params['product_type'])) {
$condition .= db_quote(' AND products.product_type=?s', $params['product_type']);
}
db_query('SELECT SQL_CALC_FOUND_ROWS 1 FROM ?:products AS products' . $join . ' WHERE 1 ' . $condition . 'GROUP BY products.product_id');
return db_get_found_rows();
}
开发者ID:askzap,项目名称:ultimate,代码行数:11,代码来源:twigmo.php
示例16: strlen
$width[$col] = strlen($price_schema['fields'][$field]['title']) * FIELD_MWIDTH;
}
$col++;
}
$col = 'A';
$row++;
$page = 1;
$total = ITEMS_PER_PAGE;
$fill = true;
$params = $_REQUEST;
$params['type'] = 'extended';
$params['subcats'] = 'N';
$params['sort_by'] = $price_schema['fields'][Registry::get('addons.price_list.price_list_sorting')]['sort_by'];
$params['page'] = $page;
while (ITEMS_PER_PAGE * ($params['page'] - 1) <= $total) {
list($products, , $total) = fn_get_products($params, ITEMS_PER_PAGE);
$params['page']++;
// Write products information
foreach ($products as $product) {
if (Registry::get('addons.price_list.include_options') == 'Y') {
fn_gather_additional_product_data($product, true, false, true, true, true);
} else {
fn_gather_additional_product_data($product, true, false, false, true, true);
}
if (Registry::get('addons.price_list.include_options') == 'Y' && $product['has_options']) {
$product = fn_price_list_get_combination($product);
foreach ($product['combinations'] as $c_id => $c_value) {
$product['price'] = $product['combination_prices'][$c_id];
$product['weight'] = $product['combination_weight'][$c_id];
$product['amount'] = $product['combination_amount'][$c_id];
$product['product_code'] = $product['combination_code'][$c_id];
开发者ID:diedsmiling,项目名称:busenika,代码行数:31,代码来源:xls.php
示例17: getOrderConditions
public final function getOrderConditions($params)
{
$condition = $join = $group = '';
if (!empty($params['cname'])) {
$arr = explode(' ', $params['cname']);
if (sizeof($arr) == 2) {
$condition .= db_quote(" AND ?:orders.firstname LIKE ?l AND ?:orders.lastname LIKE ?l", "%{$arr['0']}%", "%{$arr['1']}%");
} else {
$condition .= db_quote(" AND (?:orders.firstname LIKE ?l OR ?:orders.lastname LIKE ?l)", "%{$params['cname']}%", "%{$params['cname']}%");
}
}
if (!empty($params['tax_exempt'])) {
$condition .= db_quote(" AND ?:orders.tax_exempt = ?s", $params['tax_exempt']);
}
if (!empty($params['email'])) {
$condition .= db_quote(" AND ?:orders.email LIKE ?l", "%{$params['email']}%");
}
if (!empty($params['user_id'])) {
$condition .= db_quote(' AND ?:orders.user_id IN (?n)', $params['user_id']);
}
if (!empty($params['total_from'])) {
$condition .= db_quote(" AND ?:orders.total >= ?d", fn_convert_price($params['total_from']));
}
if (!empty($params['total_to'])) {
$condition .= db_quote(" AND ?:orders.total <= ?d", fn_convert_price($params['total_to']));
}
if (!empty($params['status'])) {
$condition .= db_quote(' AND ?:orders.status IN (?a)', $params['status']);
}
if (!empty($params['order_id'])) {
$multiple_ids = strpos($params['order_id'], ',') !== false;
$condition .= db_quote(' AND ?:orders.order_id IN (?n)', !is_array($params['order_id']) && $multiple_ids ? explode(',', $params['order_id']) : $par
|
请发表评论