function set_snapshot($aSetPage = '') { global $sPage, $request_type; if (is_array($aSetPage)) { $this->snapshot = array('page' => $aSetPage['page'], 'mode' => $aSetPage['mode'], 'get' => $aSetPage['get']); } else { $get_all = ''; if (isset($_GET)) { $get_all = oos_get_all_get_parameters(); $get_all = oos_remove_trailing($get_all); } $this->snapshot = array('page' => $sPage, 'mode' => $request_type, 'get' => $get_all); } }
---------------------------------------------------------------------- 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')) { $_SESSION['navigation']->remove_current_page(); MyOOS_CoreApi::redirect(oos_href_link($aModules['main'], $aFilename['main'])); } if (!isset($_GET['reviews_id'])) { MyOOS_CoreApi::redirect(oos_href_link($aModules['reviews'], $aFilename['reviews_reviews'])); } require 'includes/languages/' . $sLanguage . '/reviews_product_info.php'; // lets retrieve all $_GET keys and values.. $get_parameters = oos_get_all_get_parameters(array('reviews_id')); $get_parameters = oos_remove_trailing($get_parameters); $reviewstable = $oostable['reviews']; $productstable = $oostable['products']; $reviews_descriptiontable = $oostable['reviews_description']; $products_descriptiontable = $oostable['products_description']; $sql = "SELECT rd.reviews_text, r.reviews_rating, r.reviews_id, r.products_id,\n r.customers_name, r.date_added, r.last_modified, r.reviews_read,\n p.products_id, pd.products_name, p.products_model, p.products_image\n FROM {$reviewstable} r,\n {$reviews_descriptiontable} rd,\n {$productstable} p,\n {$products_descriptiontable} pd\n WHERE r.reviews_id = '" . intval($_GET['reviews_id']) . "'\n AND r.reviews_id = rd.reviews_id\n AND rd.reviews_languages_id = '" . intval($nLanguageID) . "'\n AND r.products_id = p.products_id\n AND p.products_status >= '1'\n AND p.products_id = pd.products_id\n AND pd.products_languages_id = '" . intval($nLanguageID) . "'"; $reviews_result = $dbconn->Execute($sql); if (!$reviews_result->RecordCount()) { MyOOS_CoreApi::redirect(oos_href_link($aModules['reviews'], $aFilename['reviews_reviews'])); } $reviews = $reviews_result->fields; $dbconn->Execute("UPDATE " . $oostable['reviews'] . "\n SET reviews_read = reviews_read+1\n WHERE reviews_id = '" . $reviews['reviews_id'] . "'"); // links breadcrumb $oBreadcrumb->add($reviews['products_name'], oos_href_link($aModules['products'], $aFilename['product_info'], 'categories=' . $categories . '&products_id=' . $reviews['products_id'])); $oBreadcrumb->add($aLang['navbar_title'], oos_href_link($aModules['reviews'], $aFilename['product_reviews'], $get_parameters)); $aOption['template_main'] = $sTheme . '/modules/product_reviews_info.html';
$_SESSION['navigation']->remove_current_page(); MyOOS_CoreApi::redirect(oos_href_link($aPages['main'])); } if (isset($_GET['products_id'])) { if (!isset($nProductsId)) $nProductsId = oos_get_product_id($_GET['products_id']); } else { MyOOS_CoreApi::redirect(oos_href_link($aPages['reviews'])); } require 'includes/languages/' . $sLanguage . '/reviews_product.php'; // lets retrieve all $_GET keys and values.. $get_params = oos_get_all_get_parameters(array('reviews_id')); $get_params = oos_remove_trailing($get_params); $productstable = $oostable['products']; $products_descriptiontable = $oostable['products_description']; $sql = "SELECT pd.products_name, p.products_model FROM $products_descriptiontable pd LEFT JOIN $productstable p ON pd.products_id = p.products_id WHERE pd.products_languages_id = '" . intval($nLanguageID) . "' AND p.products_status >= '1' AND pd.products_id = '" . intval($nProductsId) . "'"; $product_info_result = $dbconn->Execute($sql); if (!$product_info_result->RecordCount()) MyOOS_CoreApi::redirect(oos_href_link($aPages['reviews'])); $product_info = $product_info_result->fields; $reviewstable = $oostable['reviews']; $sql = "SELECT reviews_rating, reviews_id, customers_name, date_added, reviews_read
} elseif ($product_info['products_discount2'] > 0) { $price_discount = $oCurrencies->display_price($product_info['products_discount2'], oos_get_tax_rate($product_info['products_tax_class_id'])); } elseif ($product_info['products_discount1'] > 0) { $price_discount = $oCurrencies->display_price($product_info['products_discount1'], oos_get_tax_rate($product_info['products_tax_class_id'])); } if (isset($price_discount)) { $oSmarty->assign('price_discount', $price_discount); } } } require 'includes/modules/products_options.php'; // assign Smarty variables; $oSmarty->assign(array('oos_breadcrumb' => $oBreadcrumb->trail(BREADCRUMB_SEPARATOR), 'discounts_price' => $discounts_price)); if (!isset($block_get_parameters)) { $block_get_parameters = oos_get_all_get_parameters(array('action')); $block_get_parameters = oos_remove_trailing($block_get_parameters); $oSmarty->assign('get_params', $block_get_parameters); } $oSmarty->assign('product_info', $product_info); $oSmarty->assign('options', $options); $oSmarty->assign('redirect', oos_href_link($aPages['redirect'], 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', false, false)); $oSmarty->assign('oosDate', date("Y-m-d H:i:s", time())); if (SOCIAL_BOOKMARKS == '1') { $oSmarty->caching = true; if (!$oSmarty->is_cached($aOption['social_bookmarks'], $oos_social_bookmarks_cache_id)) { $oSmarty->assign('bookmark', oos_href_link($aPages['product_info'], 'products_id=' . intval($nProductsId), 'NONSSL', false)); $oSmarty->assign('bookmarktitle', STORE_NAME . ' - ' . $product_info['products_name']); } $oSmarty->assign('social_bookmarks', $oSmarty->fetch($aOption['social_bookmarks'], $oos_social_bookmarks_cache_id)); $oSmarty->caching = false; }