PageRenderTime 41ms CodeModel.GetById 12ms RepoModel.GetById 1ms app.codeStats 0ms

/includes/application_top.php

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