本文整理汇总了PHP中fn_get_image_pairs函数的典型用法代码示例。如果您正苦于以下问题:PHP fn_get_image_pairs函数的具体用法?PHP fn_get_image_pairs怎么用?PHP fn_get_image_pairs使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fn_get_image_pairs函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fn_staff_get_staff_member_data
/**
* Returns an array of staff member data by specified user_id
*
* @param int $user_id - items per page
* @param $lang_code - staff member identifier
* @return array
*/
function fn_staff_get_staff_member_data($user_id, $lang_code = CART_LANGUAGE)
{
$where = array('user_id' => $user_id);
$data = db_get_row('SELECT * FROM ?:staff WHERE ?w', $where);
$data['main_pair'] = fn_get_image_pairs($user_id, 'staff', 'M', true, true, $lang_code);
return $data;
}
示例2: fn_blog_get_page_data
function fn_blog_get_page_data(&$page_data, $lang_code, $preview, $area)
{
if ($page_data['page_type'] == PAGE_TYPE_BLOG) {
$page_data['main_pair'] = fn_get_image_pairs($page_data['page_id'], 'blog', 'M', true, false, $lang_code);
$page_data['author'] = db_get_field("SELECT CONCAT(u.firstname, ' ', u.lastname) FROM ?:blog_authors as b LEFT JOIN ?:users as u ON b.user_id = u.user_id WHERE b.page_id = ?i", $page_data['page_id']);
}
}
示例3: fn_get_aff_banner_image_data
function fn_get_aff_banner_image_data($banner_id, $image_key = 'image', $lang_code = CART_LANGUAGE)
{
$image_data = fn_get_image_pairs($banner_id, 'aff_banners', 'M', true, false, $lang_code);
if (!empty($image_data['image_id'])) {
$image_data[$image_key]['image_path'] = empty($image_data[$image_key]['image_path']) ? '' : 'http://' . Registry::get('config.http_host') . $image_data[$image_key]['image_path'];
}
return empty($image_data) ? false : $image_data;
}
示例4: fn_get_banner_data
function fn_get_banner_data($banner_id, $lang_code = CART_LANGUAGE)
{
$status_condition = AREA == 'A' ? '' : " AND ?:banners.status IN ('A', 'H') ";
$banner = db_get_row("SELECT ?:banners.banner_id, ?:banners.status, ?:banners.url, ?:banner_descriptions.banner, ?:banners.type, ?:banners.target, ?:banners.localization, ?:banners.timestamp, ?:banner_descriptions.description FROM ?:banners LEFT JOIN ?:banner_descriptions ON ?:banner_descriptions.banner_id = ?:banners.banner_id AND ?:banner_descriptions.lang_code = ?s WHERE ?:banners.banner_id = ?i ?p", $lang_code, $banner_id, $status_condition);
if (!empty($banner)) {
$banner['main_pair'] = fn_get_image_pairs($banner['banner_id'], 'banner', 'M', true, false, $lang_code);
}
return $banner;
}
示例5: fn_get_paypal_settings
function fn_get_paypal_settings($lang_code = DESCR_SL)
{
$pp_settings = Settings::instance()->getValues('paypal', 'ADDON');
if (!empty($pp_settings['general']['pp_statuses'])) {
$pp_settings['general']['pp_statuses'] = unserialize($pp_settings['general']['pp_statuses']);
}
$pp_settings['general']['main_pair'] = fn_get_image_pairs(fn_paypal_get_logo_id(), 'paypal_logo', 'M', false, true, $lang_code);
return $pp_settings['general'];
}
示例6: fn_get_store_location
function fn_get_store_location($store_location_id, $lang_code = CART_LANGUAGE)
{
$fields = array('?:store_locations.*', '?:store_location_descriptions.*', '?:country_descriptions.country as country_title');
$join = db_quote(" LEFT JOIN ?:store_location_descriptions ON ?:store_locations.store_location_id = ?:store_location_descriptions.store_location_id AND ?:store_location_descriptions.lang_code = ?s", $lang_code);
$join .= db_quote(" LEFT JOIN ?:country_descriptions ON ?:store_locations.country = ?:country_descriptions.code AND ?:country_descriptions.lang_code = ?s", $lang_code);
$condition = db_quote(" ?:store_locations.store_location_id = ?i ", $store_location_id);
$condition .= AREA == 'C' && defined('CART_LOCALIZATION') ? fn_get_localizations_condition('?:store_locations.localization') : '';
$store_location = db_get_row('SELECT ?p FROM ?:store_locations ?p WHERE ?p', implode(', ', $fields), $join, $condition);
$store_location["image_pairs"] = fn_get_image_pairs($store_location_id, 'store_locations', 'M', true, true, $lang_code);
$store_location["additional_image_pairs"] = fn_get_image_pairs($store_location_id, 'store_locations', 'A', true, true, $lang_code);
return $store_location;
}
示例7: fn_exim_mailru_get_image_url
function fn_exim_mailru_get_image_url($product_id, $object_type, $pair_type, $get_icon, $get_detailed, $lang_code)
{
$image_pair = fn_get_image_pairs($product_id, $object_type, $pair_type, $get_icon, $get_detailed, $lang_code);
$image_data = fn_image_to_display($image_pair, Registry::get('settings.Thumbnails.product_details_thumbnail_width'), Registry::get('settings.Thumbnails.product_details_thumbnail_height'));
if (strpos($image_data['image_path'], '.php')) {
$image_data['image_path'] = fn_generate_thumbnail($image_data['detailed_image_path'], $image_data['width'], $image_data['height']);
}
if (!empty($image_data['image_path'])) {
$url = $image_data['image_path'];
} else {
$url = '';
}
return htmlspecialchars($url, ENT_QUOTES, 'UTF-8');
}
示例8: fn_advanced_menu_get_categories_post
function fn_advanced_menu_get_categories_post(&$categories_list, $params, $lang_code)
{
if (!empty($categories_list)) {
if (isset($params['block_data']) && $params['block_data']['properties']['template'] == 'blocks/categories/categories_dropdown_horizontal.tpl') {
foreach ($categories_list as $k => $v) {
$categories_list[$k]['background_image_pair'] = fn_get_image_pairs($v['category_id'], 'menu', 'M', true, true, CART_LANGUAGE);
$advanced_menu = unserialize($v['advanced_menu']);
$categories_list[$k]['advanced_menu'] = $advanced_menu;
if (isset($advanced_menu['feature_id']) && !empty($advanced_menu['feature_id'])) {
$categories_list[$k]['subcategories'][] = fn_get_feature_by_id($advanced_menu['feature_id'], $v['category_id'], $v['id_path'], $advanced_menu['number_of_variants']);
}
}
}
}
}
示例9: fn_get_product_option_data
function fn_get_product_option_data($option_id, $product_id, $lang_code = DESCR_SL)
{
$extra_variant_fields = '';
$fields = "a.*, b.option_name, b.option_text, b.description, b.inner_hint, b.incorrect_message, b.comment, c.product_id";
$join = db_quote(" LEFT JOIN ?:product_options_descriptions as b ON a.option_id = b.option_id AND b.lang_code = ?s" . " LEFT JOIN ?:product_global_option_links as c ON c.option_id = a.option_id", $lang_code);
$condition = db_quote("a.option_id = ?i AND a.product_id = ?i", $option_id, $product_id);
/**
* Changes params before option data selecting
*
* @param int $option_id Option identifier
* @param int $product_id Product identifier
* @param string $fields Fields to be selected
* @param string $condition String containing SQL-query condition possibly prepended with a logical operator (AND or OR)
* @param string $join String with the complete JOIN information (JOIN type, tables and fields) for an SQL-query
* @param string $extra_variant_fields Additional variant fields to be selected
* @param string $lang_code 2-letters language code
*/
fn_set_hook('get_product_option_data_pre', $option_id, $product_id, $fields, $condition, $join, $extra_variant_fields, $lang_code);
$opt = db_get_row("SELECT " . $fields . " FROM ?:product_options as a" . $join . " WHERE " . $condition . " ORDER BY a.position");
if (!empty($opt)) {
$_cond = $opt['option_type'] == 'C' ? ' AND a.position = 1' : '';
$join = '';
if (fn_allowed_for('ULTIMATE') && Registry::get('runtime.company_id')) {
$extra_variant_fields .= 'IF(shared_option_variants.variant_id IS NOT NULL, shared_option_variants.modifier, a.modifier) as modifier, ';
$extra_variant_fields .= 'IF(shared_option_variants.variant_id IS NOT NULL, shared_option_variants.modifier_type, a.modifier_type) as modifier_type, ';
$join .= db_quote(' LEFT JOIN ?:ult_product_option_variants shared_option_variants ON shared_option_variants.variant_id = a.variant_id AND shared_option_variants.company_id = ?i', Registry::get('runtime.company_id'));
}
$join .= db_quote(' LEFT JOIN ?:product_option_variants_link povl ON povl.option_variant_id = a.variant_id ');
$opt['variants'] = db_get_hash_array("SELECT a.variant_id, a.position, a.modifier, a.modifier_type, a.weight_modifier, a.weight_modifier_type, a.status, a.set_by_user, {$extra_variant_fields} b.variant_name, povl.product_id AS required_product_id FROM ?:product_option_variants as a LEFT JOIN ?:product_option_variants_descriptions as b ON a.variant_id = b.variant_id AND b.lang_code = ?s {$join} WHERE a.option_id = ?i {$_cond} ORDER BY a.position", 'variant_id', $lang_code, $option_id);
if (!empty($opt['variants'])) {
foreach ($opt['variants'] as $k => $v) {
$opt['variants'][$k]['image_pair'] = fn_get_image_pairs($v['variant_id'], 'variant_image', 'V', true, true, $lang_code);
}
}
}
/**
* Changes option data
*
* @param array $opt Option data
* @param int $product_id Product identifier
* @param string $lang_code 2-letters language code
*/
fn_set_hook('get_product_option_data_post', $opt, $product_id, $lang_code);
return $opt;
}
示例10: fn_get_logos
/**
* Gets all logos
* @TODO Remove "create" functionality from Getter
*
* @param int $company_id company ID
* @param int $layout_id layout ID
* @param string $style_id Style ID
* @return array logos list
*/
function fn_get_logos($company_id = null, $layout_id = 0, $style_id = '')
{
/**
* Changes params before selecting logo
*
* @param int $company_id company ID
* @param int $layout_id layout ID
* @param string $style_id Style ID
*/
fn_set_hook('get_logos_pre', $company_id, $layout_id, $style_id);
$condition = array();
$company_condition = '';
if (is_null($company_id)) {
if (Registry::get('runtime.company_id')) {
$company_id = Registry::get('runtime.company_id');
} elseif (fn_allowed_for('MULTIVENDOR')) {
$company_id = 0;
}
}
if (!is_null($company_id)) {
$company_condition = db_quote(' AND company_id = ?i', $company_id);
}
if (!empty($company_id) && fn_allowed_for('ULTIMATE')) {
$layout_data = Layout::instance($company_id)->getDefault();
} else {
$layout_data = array('layout_id' => Registry::get('runtime.layout.layout_id'), 'style_id' => Registry::get('runtime.layout.style_id'));
}
$layout_id = !empty($layout_id) ? $layout_id : $layout_data['layout_id'];
$style_id = !empty($style_id) ? $style_id : $layout_data['style_id'];
$condition[] = db_quote('IF(layout_id = 0, 1, IF(layout_id = ?i, 1, 0))', $layout_id);
if (!empty($style_id)) {
$condition[] = db_quote('IF(style_id = \'\', 1, IF(style_id = ?s, 1, 0))', $style_id);
}
/**
* Changes conditions before selecting logo
*
* @param int $company_id company ID
* @param int $layout_id layout ID
* @param string $style_id Style ID
* @param array $condition Selecting conditions
* @param string $company_condition Condition by companies
*/
fn_set_hook('get_logos', $company_id, $layout_id, $style_id, $condition, $company_condition);
$logos = db_get_hash_array("SELECT * FROM ?:logos WHERE ?p ?p", 'type', implode(' AND ', $condition), $company_condition);
$logo_ids = array();
foreach ($logos as $l) {
$logo_ids[] = $l['logo_id'];
}
$images = fn_get_image_pairs($logo_ids, 'logos', 'M', true, false);
foreach ($logos as $k => $v) {
if (empty($images[$v['logo_id']])) {
$logos[$k]['image'] = array();
continue;
}
$image = reset($images[$v['logo_id']]);
$logos[$k]['image'] = $image['icon'];
}
/**
* Changes logos before returning
*
* @param int $company_id company ID
* @param int $layout_id layout ID
* @param string $style_id Style ID
* @param array $logos Selected logos
*/
fn_set_hook('get_logos_post', $company_id, $layout_id, $style_id, $logos);
return $logos;
}
示例11: db_get_hash_array
$_products[$_k] = $_v;
if (in_array($_v['product_id'], $selected_ids)) {
$_products[$_k]['selected'] = 'Y';
$c_price += $_products[$_k]['price'];
} else {
$_products[$_k]['selected'] = 'N';
}
// Recommended products
if (in_array($_v['product_id'], $default_ids)) {
$_products[$_k]['recommended'] = 'Y';
}
$_products[$_k]['compatible_classes'] = db_get_hash_array("SELECT ?:conf_compatible_classes.slave_class_id, ?:conf_classes.group_id FROM ?:conf_compatible_classes LEFT JOIN ?:conf_classes ON ?:conf_classes.class_id = ?:conf_compatible_classes.slave_class_id WHERE ?:conf_compatible_classes.master_class_id = ?i AND ?:conf_classes.status = 'A'", 'slave_class_id', $_v['class_id']);
}
$product_configurator_groups[$k]['products_count'] = count($_products);
$product_configurator_groups[$k]['products'] = $_products;
$product_configurator_groups[$k]['main_pair'] = fn_get_image_pairs($v['group_id'], 'conf_group', 'M');
}
}
if (empty($product_configurator_groups)) {
unset($product_configurator_steps[$step_id]);
continue;
}
if (empty($current_step_id)) {
$current_step_id = $step_id;
}
Registry::set('navigation.tabs.pc_' . $step_id, array('title' => $step_value['step_name'], 'section' => 'configurator', 'js' => true));
// Substitute configuration price instead of product price
if (!empty($c_price)) {
$product['price'] = $c_price;
}
// Define list of incompatible products
示例12: fn_get_credit_cards_images
function fn_get_credit_cards_images()
{
$data = db_get_array("SELECT ?:static_data.param_id, ?:static_data_descriptions.descr FROM ?:static_data INNER JOIN ?:images_links ON ?:static_data.param_id = ?:images_links.object_id AND ?:images_links.object_type = 'credit_card' LEFT JOIN ?:static_data_descriptions ON ?:static_data.param_id = ?:static_data_descriptions.param_id WHERE ?:static_data.status = 'A' AND ?:static_data.section = 'C' ORDER BY ?:static_data.position, ?:static_data_descriptions.descr ");
if (empty($data)) {
return array();
}
$images = array();
foreach ($data as $key => $entry) {
$image = fn_get_image_pairs($entry['param_id'], 'credit_card', 'M');
if (!empty($image['icon'])) {
$image['icon']['alt'] = empty($image['icon']['alt']) ? $entry['descr'] : $image['icon']['alt'];
$images[] = $image['icon'];
}
}
return $images;
}
示例13: fn_banners_install
function fn_banners_install()
{
// FIXME
if (DEFAULT_LANGUAGE != 'en') {
db_query("UPDATE ?:banner_images SET lang_code = ?s WHERE lang_code = ?s", DEFAULT_LANGUAGE, 'en');
// Demo data
}
$banners = db_get_array("SELECT ?:banners.banner_id, ?:banner_images.banner_image_id FROM ?:banners LEFT JOIN ?:banner_images ON ?:banner_images.banner_id = ?:banners.banner_id AND ?:banner_images.lang_code = ?s", DEFAULT_LANGUAGE);
foreach ($banners as $k => $v) {
$banners[$k]['main_pair'] = fn_get_image_pairs($v['banner_image_id'], 'promo', 'M', true, false, DEFAULT_LANGUAGE);
}
foreach (Languages::getAll() as $lang_code => $v) {
fn_banners_clone($banners, $lang_code);
}
return true;
}
示例14: fn_exim_get_detailed_image_url
function fn_exim_get_detailed_image_url($product_id, $object_type, $pair_type, $lang_code)
{
$image_pair = fn_get_image_pairs($product_id, $object_type, $pair_type, false, true, $lang_code);
return !empty($image_pair['detailed']['http_image_path']) ? $image_pair['detailed']['http_image_path'] : '';
}
示例15: fn_get_theme_path
//fn_set_notification('I','view>',print_r($view));
$view->assign('total_print', $total_print);
$view->assign('order_info', $order_info);
$view->assign('fonts_path', fn_get_theme_path('[relative]/[theme]/media/fonts'));
if ($order_info['shipping_cost'] != 0) {
$view->assign('shipping_cost', true);
}
if ($mode == "send_account_payment") {
if (!empty($order_info['email'])) {
fn_disable_live_editor_mode();
$html = array($view->displayMail('addons/rus_payments/print_invoice_payment.tpl', false, 'C'));
Pdf::render($html, fn_get_files_dir_path() . 'account_payment.pdf', 'save');
$data = array('order_info' => $order_info, 'total_print' => $total_print, 'fonts_path' => fn_get_theme_path('[relative]/[theme]/media/fonts'));
Mailer::sendMail(array('to' => $order_info['email'], 'from' => 'default_company_orders_department', 'data' => $data, 'attachments' => array(fn_get_files_dir_path() . 'account_payment.pdf'), 'tpl' => 'addons/rus_payments/print_invoice_payment.tpl', 'is_html' => true), 'A');
fn_set_notification('N', __('notice'), __('text_email_sent'));
}
} else {
$view->assign('show_print_button', true);
$view->displayMail('addons/rus_payments/print_invoice_payment.tpl', true, 'C');
}
exit;
} elseif ($mode == 'get_stamp') {
Header("Content-Type: image/png");
Header("Content-Type: image/jpg");
Header("Content-Type: image/jpeg");
Header("Content-Type: image/gif");
$path_stamp = fn_get_image_pairs($_REQUEST['payment_id'], 'stamp', 'M', true, true, DESCR_SL);
$image = fn_get_contents($path_stamp['icon']['absolute_path']);
fn_echo($image);
exit;
}