[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
Zen Cart 源代码 init_currencies.php

Zen Cart 源代码 init_currencies.php




下载文件

文件名: init_currencies.php
文件类型: PHP文件
文件大小: 1.96 KiB
MD5: ff0c6d29dcb3862570dcef767c5a3766

init_currencies.php - 关闭高亮
  1. <?php
  2. /**
  3.  * initialise currencies
  4.  * see {@link  http://www.zen-cart.com/wiki/index.php/Developers_API_Tutorials#InitSystem wikitutorials} for more details.
  5.  *
  6.  * @package initSystem
  7.  * @copyright Copyright 2003-2007 Zen Cart Development Team
  8.  * @copyright Portions Copyright 2003 osCommerce
  9.  * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  10.  * @version $Id: init_currencies.php 6300 2007-05-11 15:49:41Z drbyte $
  11.  */
  12. if (!defined('IS_ADMIN_FLAG')) {
  13.   die('Illegal Access');
  14. }
  15.  
  16. // If no currency is set, use appropriate default
  17. if (!isset($_SESSION['currency']) && !isset($_GET['currency']) ) $_SESSION['currency'] = DEFAULT_CURRENCY;
  18.  
  19. // Validate selected new currency, if any. Is false if valid not found.
  20. $new_currency = (isset($_GET['currency'])) ? zen_currency_exists($_GET['currency']) : zen_currency_exists($_SESSION['currency']);
  21.  
  22. // Validate language-currency and default-currency if relevant. Is false if valid not found.
  23. if ($new_currency == false || isset($_GET['language'])) $new_currency = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? zen_currency_exists(LANGUAGE_CURRENCY) : $new_currency;
  24.  
  25. // Final check -- if selected currency is bad and the "default" is bad, default to the first-found currency in order of exch rate.
  26. if ($new_currency == false) $new_currency = zen_currency_exists(DEFAULT_CURRENCY, true);
  27. //echo '<br />NEW = ' . $new_currency . '<br />';
  28.  
  29. // Now apply currency update
  30. if (
  31.    // Has new currency been selected?
  32.   (isset($_GET['currency'])) ||
  33.  
  34.   // Does language change require currency update?
  35.   (isset($_GET['language']) && USE_DEFAULT_LANGUAGE_CURRENCY == 'true' && LANGUAGE_CURRENCY != $_SESSION['currency']  )
  36.  
  37. ) {
  38.   $_SESSION['currency'] = $new_currency;
  39.   // redraw the page without the currency/language info in the URL
  40.   if (isset($_GET['currency']) || isset($_GET['language'])) zen_redirect(zen_href_link($current_page_base, zen_get_all_get_params(array('currency','language'))));
  41. }
  42. ?>