[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 源代码 ezpages_bar_header.php

Zen Cart 源代码 ezpages_bar_header.php




下载文件

文件名: ezpages_bar_header.php
文件类型: PHP文件
文件大小: 3.8 KiB
MD5: 91af12d5e83d1dde05c6729c3e3c77e7

ezpages_bar_header.php - 关闭高亮
  1. <?php
  2. /**
  3.  * ezpages_bar_header - used to display links to EZ-Pages content horizontally as a header element
  4.  *
  5.  * @package templateSystem
  6.  * @copyright Copyright 2003-2007 Zen Cart Development Team
  7.  * @copyright Portions Copyright 2003 osCommerce
  8.  * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  9.  * @version $Id: ezpages_bar_header.php 2006-05-16 bunyip $
  10.  * @modified from standard file to provide multi-language support
  11.  
  12.  */
  13. if (!defined('IS_ADMIN_FLAG')) {
  14.   die('Illegal Access');
  15. }
  16. $zco_notifier->notify('NOTIFY_START_EZPAGES_HEADERBAR');
  17.  
  18. // test if bar should display:
  19. if (EZPAGES_STATUS_HEADER == '1' or (EZPAGES_STATUS_HEADER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) {
  20.   if (isset($var_linksList)) {
  21.     unset($var_linksList);
  22.   }
  23.   // query modified for multi-language support
  24.   $page_query = $db->Execute("select e.pages_id, e.page_open_new_window, e.page_is_ssl, e.alt_url, e.alt_url_external, e.toc_chapter, et.pages_title
  25.                              from  " . TABLE_EZPAGES . " e, " . TABLE_EZPAGES_TEXT . " et  
  26.                              where e.pages_id = et.pages_id
  27.                              and et.languages_id = '" . (int)$_SESSION['languages_id'] . "'  
  28.                              and status_header = 1
  29.                              and header_sort_order > 0
  30.                              order by header_sort_order, pages_title");
  31.   // end of modification                             
  32.                              
  33.   if ($page_query->RecordCount()>0) {
  34.     $rows = 0;
  35.     while (!$page_query->EOF) {
  36.       $rows++;
  37.       $page_query_list_header[$rows]['id'] = $page_query->fields['pages_id'];
  38.       $page_query_list_header[$rows]['name'] = $page_query->fields['pages_title'];
  39.       $page_query_list_header[$rows]['altURL'] = '';
  40.  
  41.       // if altURL is specified, check to see if it starts with "http", and if so, create direct URL, otherwise use a zen href link
  42.       switch (true) {
  43.         // external link new window or same window
  44.         case ($page_query->fields['alt_url_external'] != ''):
  45.         $page_query_list_header[$rows]['altURL']  = $page_query->fields['alt_url_external'];
  46.         break;
  47.         // internal link new window
  48.         case ($page_query->fields['alt_url'] != '' and $page_query->fields['page_open_new_window'] == '1'):
  49.         $page_query_list_header[$rows]['altURL']  = (substr($page_query->fields['alt_url'],0,4) == 'http') ?
  50.         $page_query->fields['alt_url'] :
  51.         ($page_query->fields['alt_url']=='' ? '' : zen_href_link($page_query->fields['alt_url'], 'target="_blank', ($page_query->fields['page_is_ssl']=='0' ? 'NONSSL' : 'SSL'), true, true, true));
  52.         break;
  53.         // internal link same window
  54.         case ($page_query->fields['alt_url'] != '' and $page_query->fields['page_open_new_window'] == '0'):
  55.         $page_query_list_header[$rows]['altURL']  = (substr($page_query->fields['alt_url'],0,4) == 'http') ?
  56.         $page_query->fields['alt_url'] :
  57.         ($page_query->fields['alt_url']=='' ? '' : zen_href_link($page_query->fields['alt_url'], '', ($page_query->fields['page_is_ssl']=='0' ? 'NONSSL' : 'SSL'), true, true, true));
  58.         break;
  59.       }
  60.  
  61.       // if altURL is specified, use it; otherwise, use EZPage ID to create link
  62.       $page_query_list_header[$rows]['link'] = ($page_query_list_header[$rows]['altURL'] =='') ?
  63.       zen_href_link(FILENAME_EZPAGES, 'id=' . $page_query->fields['pages_id'] . ($page_query->fields['toc_chapter'] > 0 ? '&chapter=' . $page_query->fields['toc_chapter'] : ''), ($page_query->fields['page_is_ssl']=='0' ? 'NONSSL' : 'SSL')) :
  64.       $page_query_list_header[$rows]['altURL'];
  65.       $page_query_list_header[$rows]['link'] .= ($page_query->fields['page_open_new_window'] == '1' ? '" target="_blank' : '');
  66.  
  67.       $page_query->MoveNext();
  68.     }
  69.  
  70.     $var_linksList = $page_query_list_header;
  71.   }
  72. } // display
  73.  
  74. $zco_notifier->notify('NOTIFY_END_EZPAGES_HEADERBAR');
  75. ?>