PageRenderTime 57ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/public/includes/application_top.php

https://bitbucket.org/kritik/bemileo
PHP | 519 lines | 380 code | 71 blank | 68 comment | 151 complexity | 8779a2c6daca28f5e1c231c01e9684e5 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. <?php
  2. /*
  3. $Id: application_top.php 1833 2008-01-30 22:03:30Z hpdl $
  4. osCommerce, Open Source E-Commerce Solutions
  5. http://www.oscommerce.com
  6. Copyright (c) 2008 osCommerce
  7. Released under the GNU General Public License
  8. */
  9. define('MAX_DESCR_1','75'); //
  10. define('MAX_DESCR_2','794'); //
  11. define('MAX_DESCR_BESTS','18'); //
  12. define('MAX_DESCR_REVIEWS','75'); //
  13. define('MAX_DESCR_BOX','45'); //
  14. // customization for the design layout
  15. define('MAIN_TABLE', 'main_table'); // class name main table
  16. define('BOX_WIDTH_TD_LEFT', 'box_width_td_left'); // how wide the boxes should be in pixels (default: 125)
  17. define('BOX_WIDTH_TD_RIGHT', 'box_width_td_right'); // how wide the boxes should be in pixels (default: 125)
  18. define('CONTENT_WIDTH_TD', 'content_width_td'); // how wide the boxes should be in pixels (default: 125)
  19. define('BOX_WIDTH_LEFT', 'box_width_left'); // how wide the boxes should be in pixels (default: 125)
  20. define('BOX_WIDTH_RIGHT', 'box_width_right'); // how wide the boxes should be in pixels (default: 125)
  21. // start the timer for the page parse time log
  22. define('PAGE_PARSE_START_TIME', microtime());
  23. // set the level of error reporting
  24. error_reporting(E_ALL & ~E_NOTICE);
  25. // check support for register_globals
  26. if (function_exists('ini_get') && (ini_get('register_globals') == false) && (PHP_VERSION < 4.3) ) {
  27. exit('Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory. Please use PHP 4.3+ if register_globals cannot be enabled on the server.');
  28. }
  29. // Set the local configuration parameters - mainly for developers
  30. if (file_exists('includes/local/configure.php')) include('includes/local/configure.php');
  31. // include server parameters
  32. require('includes/configure.php');
  33. if (strlen(DB_SERVER) < 1) {
  34. if (is_dir('install')) {
  35. header('Location: install/index.php');
  36. }
  37. }
  38. // define the project version
  39. define('PROJECT_VERSION', 'osCommerce Online Merchant v2.2 RC2a');
  40. // some code to solve compatibility issues
  41. require(DIR_WS_FUNCTIONS . 'compatibility.php');
  42. // set the type of request (secure or not)
  43. $request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';
  44. // set php_self in the local scope
  45. if (!isset($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];
  46. if ($request_type == 'NONSSL') {
  47. define('DIR_WS_CATALOG', DIR_WS_HTTP_CATALOG);
  48. } else {
  49. define('DIR_WS_CATALOG', DIR_WS_HTTPS_CATALOG);
  50. }
  51. // include the list of project filenames
  52. require(DIR_WS_INCLUDES . 'filenames.php');
  53. // include the list of project database tables
  54. require(DIR_WS_INCLUDES . 'database_tables.php');
  55. // include the database functions
  56. require(DIR_WS_FUNCTIONS . 'database.php');
  57. // make a connection to the database... now
  58. tep_db_connect() or die('Unable to connect to database server!');
  59. // set the application parameters
  60. $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);
  61. while ($configuration = tep_db_fetch_array($configuration_query)) {
  62. define($configuration['cfgKey'], $configuration['cfgValue']);
  63. }
  64. // if gzip_compression is enabled, start to buffer the output
  65. if ( (GZIP_COMPRESSION == 'true') && ($ext_zlib_loaded = extension_loaded('zlib')) && (PHP_VERSION >= '4') ) {
  66. if (($ini_zlib_output_compression = (int)ini_get('zlib.output_compression')) < 1) {
  67. if (PHP_VERSION >= '4.0.4') {
  68. ob_start('ob_gzhandler');
  69. } else {
  70. include(DIR_WS_FUNCTIONS . 'gzip_compression.php');
  71. ob_start();
  72. ob_implicit_flush();
  73. }
  74. } else {
  75. ini_set('zlib.output_compression_level', GZIP_LEVEL);
  76. }
  77. }
  78. // set the HTTP GET parameters manually if search_engine_friendly_urls is enabled
  79. if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') {
  80. if (strlen(getenv('PATH_INFO')) > 1) {
  81. $GET_array = array();
  82. $PHP_SELF = str_replace(getenv('PATH_INFO'), '', $PHP_SELF);
  83. $vars = explode('/', substr(getenv('PATH_INFO'), 1));
  84. for ($i=0, $n=sizeof($vars); $i<$n; $i++) {
  85. if (strpos($vars[$i], '[]')) {
  86. $GET_array[substr($vars[$i], 0, -2)][] = $vars[$i+1];
  87. } else {
  88. $HTTP_GET_VARS[$vars[$i]] = $vars[$i+1];
  89. }
  90. $i++;
  91. }
  92. if (sizeof($GET_array) > 0) {
  93. while (list($key, $value) = each($GET_array)) {
  94. $HTTP_GET_VARS[$key] = $value;
  95. }
  96. }
  97. }
  98. }
  99. // define general functions used application-wide
  100. require(DIR_WS_FUNCTIONS . 'general.php');
  101. require(DIR_WS_FUNCTIONS . 'html_output.php');
  102. // set the cookie domain
  103. $cookie_domain = (($request_type == 'NONSSL') ? HTTP_COOKIE_DOMAIN : HTTPS_COOKIE_DOMAIN);
  104. $cookie_path = (($request_type == 'NONSSL') ? HTTP_COOKIE_PATH : HTTPS_COOKIE_PATH);
  105. // include cache functions if enabled
  106. if (USE_CACHE == 'true') include(DIR_WS_FUNCTIONS . 'cache.php');
  107. // include shopping cart class
  108. require(DIR_WS_CLASSES . 'shopping_cart.php');
  109. // include navigation history class
  110. require(DIR_WS_CLASSES . 'navigation_history.php');
  111. // check if sessions are supported, otherwise use the php3 compatible session class
  112. if (!function_exists('session_start')) {
  113. define('PHP_SESSION_NAME', 'osCsid');
  114. define('PHP_SESSION_PATH', $cookie_path);
  115. define('PHP_SESSION_DOMAIN', $cookie_domain);
  116. define('PHP_SESSION_SAVE_PATH', SESSION_WRITE_DIRECTORY);
  117. include(DIR_WS_CLASSES . 'sessions.php');
  118. }
  119. // define how the session functions will be used
  120. require(DIR_WS_FUNCTIONS . 'sessions.php');
  121. // set the session name and save path
  122. tep_session_name('osCsid');
  123. tep_session_save_path(SESSION_WRITE_DIRECTORY);
  124. // set the session cookie parameters
  125. if (function_exists('session_set_cookie_params')) {
  126. session_set_cookie_params(0, $cookie_path, $cookie_domain);
  127. } elseif (function_exists('ini_set')) {
  128. ini_set('session.cookie_lifetime', '0');
  129. ini_set('session.cookie_path', $cookie_path);
  130. ini_set('session.cookie_domain', $cookie_domain);
  131. }
  132. // set the session ID if it exists
  133. if (isset($HTTP_POST_VARS[tep_session_name()])) {
  134. tep_session_id($HTTP_POST_VARS[tep_session_name()]);
  135. } elseif ( ($request_type == 'SSL') && isset($HTTP_GET_VARS[tep_session_name()]) ) {
  136. tep_session_id($HTTP_GET_VARS[tep_session_name()]);
  137. }
  138. // start the session
  139. $session_started = false;
  140. if (SESSION_FORCE_COOKIE_USE == 'True') {
  141. tep_setcookie('cookie_test', 'please_accept_for_session', time()+60*60*24*30, $cookie_path, $cookie_domain);
  142. if (isset($HTTP_COOKIE_VARS['cookie_test'])) {
  143. tep_session_start();
  144. $session_started = true;
  145. }
  146. } elseif (SESSION_BLOCK_SPIDERS == 'True') {
  147. $user_agent = strtolower(getenv('HTTP_USER_AGENT'));
  148. $spider_flag = false;
  149. if (tep_not_null($user_agent)) {
  150. $spiders = file(DIR_WS_INCLUDES . 'spiders.txt');
  151. for ($i=0, $n=sizeof($spiders); $i<$n; $i++) {
  152. if (tep_not_null($spiders[$i])) {
  153. if (is_integer(strpos($user_agent, trim($spiders[$i])))) {
  154. $spider_flag = true;
  155. break;
  156. }
  157. }
  158. }
  159. }
  160. if ($spider_flag == false) {
  161. tep_session_start();
  162. $session_started = true;
  163. }
  164. } else {
  165. tep_session_start();
  166. $session_started = true;
  167. }
  168. if ( ($session_started == true) && (PHP_VERSION >= 4.3) && function_exists('ini_get') && (ini_get('register_globals') == false) ) {
  169. extract($_SESSION, EXTR_OVERWRITE+EXTR_REFS);
  170. }
  171. // set SID once, even if empty
  172. $SID = (defined('SID') ? SID : '');
  173. // verify the ssl_session_id if the feature is enabled
  174. if ( ($request_type == 'SSL') && (SESSION_CHECK_SSL_SESSION_ID == 'True') && (ENABLE_SSL == true) && ($session_started == true) ) {
  175. $ssl_session_id = getenv('SSL_SESSION_ID');
  176. if (!tep_session_is_registered('SSL_SESSION_ID')) {
  177. $SESSION_SSL_ID = $ssl_session_id;
  178. tep_session_register('SESSION_SSL_ID');
  179. }
  180. if ($SESSION_SSL_ID != $ssl_session_id) {
  181. tep_session_destroy();
  182. tep_redirect(tep_href_link(FILENAME_SSL_CHECK));
  183. }
  184. }
  185. // verify the browser user agent if the feature is enabled
  186. if (SESSION_CHECK_USER_AGENT == 'True') {
  187. $http_user_agent = getenv('HTTP_USER_AGENT');
  188. if (!tep_session_is_registered('SESSION_USER_AGENT')) {
  189. $SESSION_USER_AGENT = $http_user_agent;
  190. tep_session_register('SESSION_USER_AGENT');
  191. }
  192. if ($SESSION_USER_AGENT != $http_user_agent) {
  193. tep_session_destroy();
  194. tep_redirect(tep_href_link(FILENAME_LOGIN));
  195. }
  196. }
  197. // verify the IP address if the feature is enabled
  198. if (SESSION_CHECK_IP_ADDRESS == 'True') {
  199. $ip_address = tep_get_ip_address();
  200. if (!tep_session_is_registered('SESSION_IP_ADDRESS')) {
  201. $SESSION_IP_ADDRESS = $ip_address;
  202. tep_session_register('SESSION_IP_ADDRESS');
  203. }
  204. if ($SESSION_IP_ADDRESS != $ip_address) {
  205. tep_session_destroy();
  206. tep_redirect(tep_href_link(FILENAME_LOGIN));
  207. }
  208. }
  209. // create the shopping cart & fix the cart if necesary
  210. if (tep_session_is_registered('cart') && is_object($cart)) {
  211. if (PHP_VERSION < 4) {
  212. $broken_cart = $cart;
  213. $cart = new shoppingCart;
  214. $cart->unserialize($broken_cart);
  215. }
  216. } else {
  217. tep_session_register('cart');
  218. $cart = new shoppingCart;
  219. }
  220. // include currencies class and create an instance
  221. require(DIR_WS_CLASSES . 'currencies.php');
  222. $currencies = new currencies();
  223. // include the mail classes
  224. require(DIR_WS_CLASSES . 'mime.php');
  225. require(DIR_WS_CLASSES . 'email.php');
  226. // set the language
  227. if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) {
  228. if (!tep_session_is_registered('language')) {
  229. tep_session_register('language');
  230. tep_session_register('languages_id');
  231. }
  232. include(DIR_WS_CLASSES . 'language.php');
  233. $lng = new language();
  234. if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {
  235. $lng->set_language($HTTP_GET_VARS['language']);
  236. } else {
  237. $lng->get_browser_language();
  238. }
  239. $language = $lng->language['directory'];
  240. $languages_id = $lng->language['id'];
  241. }
  242. // include the language translations
  243. require(DIR_WS_LANGUAGES . $language . '.php');
  244. // currency
  245. if (!tep_session_is_registered('currency') || isset($HTTP_GET_VARS['currency']) || ( (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') && (LANGUAGE_CURRENCY != $currency) ) ) {
  246. if (!tep_session_is_registered('currency')) tep_session_register('currency');
  247. if (isset($HTTP_GET_VARS['currency']) && $currencies->is_set($HTTP_GET_VARS['currency'])) {
  248. $currency = $HTTP_GET_VARS['currency'];
  249. } else {
  250. $currency = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY;
  251. }
  252. }
  253. // navigation history
  254. if (tep_session_is_registered('navigation')) {
  255. if (PHP_VERSION < 4) {
  256. $broken_navigation = $navigation;
  257. $navigation = new navigationHistory;
  258. $navigation->unserialize($broken_navigation);
  259. }
  260. } else {
  261. tep_session_register('navigation');
  262. $navigation = new navigationHistory;
  263. }
  264. $navigation->add_current_page();
  265. // Shopping cart actions
  266. if (isset($HTTP_GET_VARS['action'])) {
  267. // redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled
  268. if ($session_started == false) {
  269. tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE));
  270. }
  271. if (DISPLAY_CART == 'true') {
  272. $goto = FILENAME_SHOPPING_CART;
  273. $parameters = array('action', 'cPath', 'products_id', 'pid');
  274. } else {
  275. $goto = basename($PHP_SELF);
  276. if ($HTTP_GET_VARS['action'] == 'buy_now') {
  277. $parameters = array('action', 'pid', 'products_id');
  278. } else {
  279. $parameters = array('action', 'pid');
  280. }
  281. }
  282. switch ($HTTP_GET_VARS['action']) {
  283. // customer wants to update the product quantity in their shopping cart
  284. case 'update_product' : for ($i=0, $n=sizeof($HTTP_POST_VARS['products_id']); $i<$n; $i++) {
  285. if (in_array($HTTP_POST_VARS['products_id'][$i], (is_array($HTTP_POST_VARS['cart_delete']) ? $HTTP_POST_VARS['cart_delete'] : array()))) {
  286. $cart->remove($HTTP_POST_VARS['products_id'][$i]);
  287. } else {
  288. if (PHP_VERSION < 4) {
  289. // if PHP3, make correction for lack of multidimensional array.
  290. reset($HTTP_POST_VARS);
  291. while (list($key, $value) = each($HTTP_POST_VARS)) {
  292. if (is_array($value)) {
  293. while (list($key2, $value2) = each($value)) {
  294. if (ereg ("(.*)\]\[(.*)", $key2, $var)) {
  295. $id2[$var[1]][$var[2]] = $value2;
  296. }
  297. }
  298. }
  299. }
  300. $attributes = ($id2[$HTTP_POST_VARS['products_id'][$i]]) ? $id2[$HTTP_POST_VARS['products_id'][$i]] : '';
  301. } else {
  302. $attributes = ($HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]]) ? $HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]] : '';
  303. }
  304. $cart->add_cart($HTTP_POST_VARS['products_id'][$i], $HTTP_POST_VARS['cart_quantity'][$i], $attributes, false);
  305. }
  306. }
  307. tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
  308. break;
  309. // customer adds a product from the products page
  310. case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
  311. $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);
  312. }
  313. tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
  314. break;
  315. // performed by the 'buy now' button in product listings and review page
  316. case 'buy_now' : if (isset($HTTP_GET_VARS['products_id'])) {
  317. if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {
  318. tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
  319. } else {
  320. $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);
  321. }
  322. }
  323. tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
  324. break;
  325. case 'notify' : if (tep_session_is_registered('customer_id')) {
  326. if (isset($HTTP_GET_VARS['products_id'])) {
  327. $notify = $HTTP_GET_VARS['products_id'];
  328. } elseif (isset($HTTP_GET_VARS['notify'])) {
  329. $notify = $HTTP_GET_VARS['notify'];
  330. } elseif (isset($HTTP_POST_VARS['notify'])) {
  331. $notify = $HTTP_POST_VARS['notify'];
  332. } else {
  333. tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify'))));
  334. }
  335. if (!is_array($notify)) $notify = array($notify);
  336. for ($i=0, $n=sizeof($notify); $i<$n; $i++) {
  337. $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $notify[$i] . "' and customers_id = '" . $customer_id . "'");
  338. $check = tep_db_fetch_array($check_query);
  339. if ($check['count'] < 1) {
  340. tep_db_query("insert into " . TABLE_PRODUCTS_NOTIFICATIONS . " (products_id, customers_id, date_added) values ('" . $notify[$i] . "', '" . $customer_id . "', now())");
  341. }
  342. }
  343. tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify'))));
  344. } else {
  345. $navigation->set_snapshot();
  346. tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
  347. }
  348. break;
  349. case 'notify_remove' : if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['products_id'])) {
  350. $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
  351. $check = tep_db_fetch_array($check_query);
  352. if ($check['count'] > 0) {
  353. tep_db_query("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
  354. }
  355. tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action'))));
  356. } else {
  357. $navigation->set_snapshot();
  358. tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
  359. }
  360. break;
  361. case 'cust_order' : if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['pid'])) {
  362. if (tep_has_product_attributes($HTTP_GET_VARS['pid'])) {
  363. tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['pid']));
  364. } else {
  365. $cart->add_cart($HTTP_GET_VARS['pid'], $cart->get_quantity($HTTP_GET_VARS['pid'])+1);
  366. }
  367. }
  368. tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
  369. break;
  370. }
  371. }
  372. // include the who's online functions
  373. require(DIR_WS_FUNCTIONS . 'whos_online.php');
  374. tep_update_whos_online();
  375. // include the password crypto functions
  376. require(DIR_WS_FUNCTIONS . 'password_funcs.php');
  377. // include validation functions (right now only email address)
  378. require(DIR_WS_FUNCTIONS . 'validations.php');
  379. // split-page-results
  380. require(DIR_WS_CLASSES . 'split_page_results.php');
  381. // infobox
  382. require(DIR_WS_CLASSES . 'boxes.php');
  383. // auto activate and expire banners
  384. require(DIR_WS_FUNCTIONS . 'banner.php');
  385. tep_activate_banners();
  386. tep_expire_banners();
  387. // auto expire special products
  388. require(DIR_WS_FUNCTIONS . 'specials.php');
  389. tep_expire_specials();
  390. // calculate category path
  391. if (isset($HTTP_GET_VARS['cPath'])) {
  392. $cPath = $HTTP_GET_VARS['cPath'];
  393. } elseif (isset($HTTP_GET_VARS['products_id']) && !isset($HTTP_GET_VARS['manufacturers_id'])) {
  394. $cPath = tep_get_product_path($HTTP_GET_VARS['products_id']);
  395. } else {
  396. $cPath = '';
  397. }
  398. if (tep_not_null($cPath)) {
  399. $cPath_array = tep_parse_category_path($cPath);
  400. $cPath = implode('_', $cPath_array);
  401. $current_category_id = $cPath_array[(sizeof($cPath_array)-1)];
  402. } else {
  403. $current_category_id = 0;
  404. }
  405. // include the breadcrumb class and start the breadcrumb trail
  406. require(DIR_WS_CLASSES . 'breadcrumb.php');
  407. $breadcrumb = new breadcrumb;
  408. $breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER);
  409. $breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_DEFAULT));
  410. // add category names or the manufacturer name to the breadcrumb trail
  411. if (isset($cPath_array)) {
  412. for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) {
  413. $categories_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$cPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'");
  414. if (tep_db_num_rows($categories_query) > 0) {
  415. $categories = tep_db_fetch_array($categories_query);
  416. $breadcrumb->add($categories['categories_name'], tep_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1)))));
  417. } else {
  418. break;
  419. }
  420. }
  421. } elseif (isset($HTTP_GET_VARS['manufacturers_id'])) {
  422. $manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
  423. if (tep_db_num_rows($manufacturers_query)) {
  424. $manufacturers = tep_db_fetch_array($manufacturers_query);
  425. $breadcrumb->add($manufacturers['manufacturers_name'], tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id']));
  426. }
  427. }
  428. // add the products model to the breadcrumb trail
  429. if (isset($HTTP_GET_VARS['products_id'])) {
  430. $model_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
  431. if (tep_db_num_rows($model_query)) {
  432. $model = tep_db_fetch_array($model_query);
  433. $breadcrumb->add($model['products_model'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $HTTP_GET_VARS['products_id']));
  434. }
  435. }
  436. // initialize the message stack for output messages
  437. require(DIR_WS_CLASSES . 'message_stack.php');
  438. $messageStack = new messageStack;
  439. // set which precautions should be checked
  440. define('WARN_INSTALL_EXISTENCE', 'true');
  441. define('WARN_CONFIG_WRITEABLE', 'true');
  442. define('WARN_SESSION_DIRECTORY_NOT_WRITEABLE', 'true');
  443. define('WARN_SESSION_AUTO_START', 'true');
  444. define('WARN_DOWNLOAD_DIRECTORY_NOT_READABLE', 'true');
  445. ?>