if ($_COOKIE['recent_viewed'] != '') { $current_products = explode('_', $_COOKIE['recent_viewed']); } else { $current_products = ''; } $new_products = array(); $new_products[] = $products_id; $product_count = 0; if (is_array($current_products)) { foreach ($current_products as $product) { if ($product != $products_id) { if (defined('RECENT_VIEWED_PRODUCTS_MAXIMUM') && RECENT_VIEWED_PRODUCTS_MAXIMUM - 1 > $product_count || !defined('RECENT_VIEWED_PRODUCTS_MAXIMUM') || !zen_not_null(RECENT_VIEWED_PRODUCTS_MAXIMUM)) { $product_count++; $new_products[] = $product; } else { break; } } } } else { //nothing } return implode('_', $new_products); } if (!isset($_SESSION['recent_products'])) { $_SESSION['recent_products'] = array(); } if (isset($_GET['products_id']) && zen_not_null($_GET['products_id'])) { $products_id = (int) $_GET['products_id']; zen_setcookie("recent_viewed", update_recent_products($products_id), time() + 60 * 60 * 24 * 30); }
} elseif ($request_type == 'SSL' && isset($_GET[zen_session_name()])) { zen_session_id($_GET[zen_session_name()]); } /** * need to tidy up $_SERVER['REMOTE_ADDR'] here before we use it anywhere else * one problem we don't address here is if $_SERVER['REMOTE_ADDRESS'] is not set to anything at all */ $ipAddressArray = explode(',', zen_get_ip_address()); $ipAddress = sizeof($ipAddressArray) > 0 ? $ipAddressArray[0] : ''; $_SERVER['REMOTE_ADDR'] = $ipAddress; /** * start the session */ $session_started = false; if (SESSION_FORCE_COOKIE_USE == 'True') { zen_setcookie('cookie_test', 'please_accept_for_session', time() + 60 * 60 * 24 * 30, '/', zen_not_null($current_domain) ? $current_domain : ''); if (isset($_COOKIE['cookie_test'])) { zen_session_start(); $session_started = true; } } elseif (SESSION_BLOCK_SPIDERS == 'True') { $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']); $spider_flag = false; if (zen_not_null($user_agent)) { $spiders = file(DIR_WS_INCLUDES . 'spiders.txt'); for ($i = 0, $n = sizeof($spiders); $i < $n; $i++) { if (zen_not_null($spiders[$i]) && substr($spiders[$i], 0, 4) != '$Id:') { if (is_integer(strpos($user_agent, trim($spiders[$i])))) { $spider_flag = true; break; }
* @copyright Copyright 2003-2006 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: html_header.php 6948 2007-09-02 23:30:49Z drbyte $ */ /** * load the module for generating page meta-tags */ require DIR_WS_MODULES . zen_get_module_directory('meta_tags.php'); /** * output main page HEAD tag and related headers/meta-tags, etc */ if ($_GET['main_page'] != 'advanced_search_result') { if (isset($_GET['display']) and is_numeric(substr($_GET['display'], -1, 1))) { $listTypes = substr($_GET['display'], -1, 1); zen_setcookie('listTypes', $listTypes, time() + 60 * 60 * 24 * 30); } else { if ($_COOKIE['listTypes']) { $listTypes = $_COOKIE['listTypes']; } } } //caizhouqing update head ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title><?php echo META_TAG_TITLE; ?> </title>