$specialstable = $oostable['specials']; $query = "SELECT p.products_id, pd.products_name, p.products_price, p.products_base_price, p.products_base_unit, p.products_tax_class_id, p.products_units_id, p.products_image, s.specials_new_products_price FROM $productstable p, $products_descriptiontable pd, $specialstable s WHERE p.products_status >= '1' AND (p.products_access = '0' OR p.products_access = '" . intval($nGroupID) . "') AND p.products_id = s.products_id AND pd.products_id = s.products_id AND pd.products_languages_id = '" . intval($nLanguageID) . "' AND s.status = '1' ORDER BY s.specials_date_added DESC"; if ($specials_random_product = oos_random_select($query, MAX_RANDOM_SELECT_SPECIALS)) { $specials_block = '1'; $specials_random_product_price = ''; $specials_random_product_special_price = ''; $specials_random_base_product_price = ''; $specials_random_base_product_special_price = ''; if ($_SESSION['member']->group['show_price'] == 1 ) { $specials_random_product_price = $oCurrencies->display_price($specials_random_product['products_price'], oos_get_tax_rate($specials_random_product['products_tax_class_id'])); $specials_random_product_special_price = $oCurrencies->display_price($specials_random_product['specials_new_products_price'], oos_get_tax_rate($specials_random_product['products_tax_class_id'])); if ($specials_random_product['products_base_price'] != 1) { $specials_random_base_product_price = $oCurrencies->display_price($specials_random_product['products_price'] * $specials_random_product['products_base_price'], oos_get_tax_rate($specials_random_product['products_tax_class_id'])); $specials_random_base_product_special_price = $oCurrencies->display_price($specials_random_product['specials_new_products_price'] * $specials_random_product['products_base_price'], oos_get_tax_rate($specials_random_product['products_tax_class_id'])); }
File: reviews.php,v 1.36 2003/02/12 20:27:32 hpdl ---------------------------------------------------------------------- osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce ---------------------------------------------------------------------- Released under the GNU General Public License ---------------------------------------------------------------------- */ /** ensure this file is being included by a parent file */ defined('OOS_VALID_MOD') or die('Direct Access to this location is not allowed.'); if (!$oEvent->installed_plugin('reviews')) { return false; } if ($sFile != $aFilename['product_reviews_write']) { $reviews_block = '1'; $reviewstable = $oostable['reviews']; $productstable = $oostable['products']; $reviews_descriptiontable = $oostable['reviews_description']; $products_descriptiontable = $oostable['products_description']; $random_select = "SELECT r.reviews_id, r.reviews_rating,\n substring(rd.reviews_text, 1, 60) AS reviews_text,\n p.products_id, p.products_image, pd.products_name\n FROM {$reviewstable} r,\n {$reviews_descriptiontable} rd,\n {$productstable} p,\n {$products_descriptiontable} pd\n WHERE p.products_status >= '1'\n AND (p.products_access = '0' OR p.products_access = '" . intval($nGroupID) . "')\n AND p.products_id = r.products_id\n AND r.reviews_id = rd.reviews_id\n AND rd.reviews_languages_id = '" . intval($nLanguageID) . "'\n AND p.products_id = pd.products_id\n AND pd.products_languages_id = '" . intval($nLanguageID) . "'"; if (isset($_GET['products_id'])) { if (!isset($nProductsId)) { $nProductsId = oos_get_product_id($_GET['products_id']); } $random_select .= " AND p.products_id = '" . intval($nProductsId) . "'"; } $random_select .= " ORDER BY r.reviews_id DESC"; $random_product = oos_random_select($random_select, MAX_RANDOM_SELECT_REVIEWS); $oSmarty->assign(array('block_heading_reviews' => $block_heading, 'random_product' => $random_product)); }
osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce ---------------------------------------------------------------------- Released under the GNU General Public License ---------------------------------------------------------------------- */ /** ensure this file is being included by a parent file */ defined('OOS_VALID_MOD') or die('Direct Access to this location is not allowed.'); if ($oEvent->installed_plugin('customer_must_login')) { return false; } $whats_new_block = '0'; $productstable = $oostable['products']; $query = "SELECT products_id, products_image, products_tax_class_id, products_units_id, products_price,\n products_base_price, products_base_unit, products_discount_allowed\n FROM {$productstable}\n WHERE products_status >= '1'\n AND (products_access = '0' OR products_access = '" . intval($nGroupID) . "')\n ORDER BY products_date_added DESC"; if ($random_product = oos_random_select($query, MAX_RANDOM_SELECT_NEW)) { $whats_new_block = '1'; $random_product['products_name'] = oos_get_products_name($random_product['products_id']); $whats_new_product_price = ''; $whats_new_product_special_price = ''; $whats_new_max_product_discount = 0; $whats_new_product_discount_price = ''; $whats_new_base_product_price = ''; $whats_new_base_product_special_price = ''; $whats_new_special_price = ''; if ($_SESSION['member']->group['show_price'] == 1) { $whats_new_special_price = oos_get_products_special_price($random_product['products_id']); $whats_new_product_price = $oCurrencies->display_price($random_product['products_price'], oos_get_tax_rate($random_product['products_tax_class_id'])); if (oos_is_not_null($whats_new_product_price)) { $whats_new_product_special_price = $oCurrencies->display_price($whats_new_special_price, oos_get_tax_rate($random_product['products_tax_class_id'])); } else {
/** * Check to see if a banner exists * * @param $action * @param $identifier */ function oos_banner_exists($action, $identifier) { // Get database information $dbconn =& oosDBGetConn(); $oostable =& oosDBGetTables(); if ($action == 'dynamic') { $bannerstable = $oostable['banners']; return oos_random_select("SELECT banners_id, banners_title, banners_image, banners_html_text FROM {$bannerstable} WHERE status = '1' AND banners_group = '" . oos_db_input($identifier) . "'"); } elseif ($action == 'static') { $bannerstable = $oostable['banners']; $banner_result = $dbconn->Execute("SELECT banners_id, banners_title, banners_image, banners_html_text FROM {$bannerstable} WHERE status = '1' AND banners_id = '" . oos_db_input($identifier) . "'"); return $banner_result - fields; } else { return false; } }
http://www.oscommerce.com Copyright (c) 2003 osCommerce ---------------------------------------------------------------------- Released under the GNU General Public License ---------------------------------------------------------------------- */ /** ensure this file is being included by a parent file */ defined('OOS_VALID_MOD') or die('Direct Access to this location is not allowed.'); $newsfeeds_block = '0'; $newsfeed_managertable = $oostable['newsfeed_manager']; $random_select = "SELECT newsfeed_manager_id, newsfeed_categories_id, newsfeed_manager_name,\n newsfeed_manager_link, newsfeed_manager_languages_id, newsfeed_manager_numarticles,\n newsfeed_manager_refresh, newsfeed_manager_status\n FROM {$newsfeed_managertable}\n WHERE newsfeed_manager_status = '1'\n AND newsfeed_manager_languages_id = '" . intval($nLanguageID) . "'"; if (isset($newsfeed_categories_id) && $newsfeed_categories_id > 0) { $random_select .= " AND newsfeed_categories_id = '" . $newsfeed_categories_id . "'"; } $random_select .= " ORDER BY newsfeed_manager_id DESC"; $random_newsfeed = oos_random_select($random_select, MAX_RANDOM_SELECT_NEWSFEED); if ($random_newsfeed) { $newsfeeds_block = '1'; $newsfeeds = '<b>' . $random_newsfeed['newsfeed_manager_name'] . '</b><br />' . strftime(DATE_TIME_FORMAT) . '<br />'; require_once 'includes/classes/class_rdf.php'; $rdf = new oosRDF(); $rdf->use_dynamic_display(true); $rdf->set_Options(array('channel' => 'hidden', 'build' => 'hidden', 'cache_update' => 'hidden', 'textinput' => 'hidden', 'image' => '')); $rdf->set_max_item($random_newsfeed['newsfeed_manager_numarticles']); $rdf->set_refresh($random_newsfeed['newsfeed_manager_refresh']); ob_start(); $rdf->parse_RDF($random_newsfeed['newsfeed_manager_link']); $newsfeeds .= ob_get_contents(); ob_end_clean(); $rdf->finish(); $oSmarty->assign(array('block_heading_newsfeeds' => $block_heading, 'newsfeeds' => $newsfeeds));