[ Index ]
 

Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/includes/modules/pages/page/ -> header_php.php (source)

   1  <?php
   2  /**

   3   * ez_pages ("page") header_php.php

   4   *

   5   * @package page

   6   * @copyright Copyright 2003-2006 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: header_php.php 4881 2006-11-04 17:51:31Z ajeh $

  10   */
  11  /*

  12  * This "page" page is the display component of the ez-pages module

  13  * It is called "page" instead of "ez-pages" due to the way the URL would display in the browser

  14  * Aesthetically speaking, "page" is more professional in appearance than "ez-page" in the URL

  15  *

  16  * The EZ-Pages concept was adapted from the InfoPages contribution for Zen Cart v1.2.x, with thanks to Sunrom et al.

  17  */
  18  
  19  // This should be first line of the script:

  20  $zco_notifier->notify('NOTIFY_HEADER_START_EZPAGE');
  21  
  22  $ezpage_id = (int)$_GET['id'];
  23  if ($ezpage_id == 0) zen_redirect(zen_href_link(FILENAME_DEFAULT));
  24  
  25  $chapter_id = (int)$_GET['chapter'];
  26  $chapter_link = (int)$_GET['chapter'];
  27  
  28  //die('I SEE ' . $ezpage_id . ' - ' . $group_id);

  29  //die('I SEE ' . $ezpage_id . ' - ' . $chapter_id);

  30  
  31  $var_pageDetails = $db->Execute("select * from " . TABLE_EZPAGES . " where pages_id = " . (int)$ezpage_id );
  32  
  33  //check db for prev/next based on sort orders

  34  $pos = (isset($_GET['pos'])) ? $_GET['pos'] : 'v';  // v for vertical, h for horizontal  (v assumed if not specified)

  35  $vert_links = array();
  36  $horiz_links = array();
  37  //  $pages_order_query = "SELECT pages_id FROM " . TABLE_EZPAGES . " WHERE status = 1 and vertical_sort_order <> 0 ORDER BY vertical_sort_order, horizontal_sort_order, pages_title";

  38  //  $pages_order_query = "SELECT * FROM " . TABLE_EZPAGES . " WHERE ((status_sidebox = 1 and sidebox_sort_order <> 0) or (status_footer = 1 and footer_sort_order <> 0) or (status_header = 1 and header_sort_order <> 0)) and alt_url_external = '' ORDER BY header_sort_order, sidebox_sort_order, footer_sort_order, pages_title";

  39  $pages_order_query = "SELECT *
  40                        FROM " . TABLE_EZPAGES . "
  41                        WHERE ((status_toc = 1 and toc_sort_order <> 0) and toc_chapter= :chapterID )
  42                        AND alt_url_external = '' and alt_url = ''
  43                        ORDER BY toc_sort_order, pages_title";
  44  
  45  $pages_order_query = $db->bindVars($pages_order_query, ':chapterID', $chapter_id, 'integer');
  46  $pages_ordering = $db->execute($pages_order_query);
  47  
  48  $pages_listing = $db->execute($pages_order_query);
  49  
  50  while (!$pages_ordering->EOF) {
  51    $vert_links[] = $pages_ordering->fields['pages_id'];
  52    $pages_ordering->MoveNext();
  53  }
  54  
  55  /*

  56  //  $pages_order_query = "SELECT pages_id FROM " . TABLE_EZPAGES . " WHERE status = 1 and horizontal_sort_order <> 0 ORDER BY horizontal_sort_order, pages_title";

  57  $pages_order_query = "SELECT * FROM " . TABLE_EZPAGES . " WHERE status_footer = 1 and footer_sort_order <> 0 and alt_url_external = '' ORDER BY footer_sort_order, pages_title";

  58  $pages_ordering = $db->execute($pages_order_query);

  59  while (!$pages_ordering->EOF) {

  60  $horiz_links[] = $pages_ordering->fields['pages_id'];

  61  $pages_ordering->MoveNext();

  62  }

  63  */
  64  // now let's determine prev/next

  65  reset ($vert_links);
  66  $counter = 0;
  67  $previous_v = -1;
  68  $last_v = 0;
  69  $previous_vssl = '0';
  70  $next_item_v = 0;
  71  $next_vssl = 0;
  72  while (list($key, $value) = each ($vert_links)) {
  73    if ($value == $ezpage_id) {
  74      $position_v = $counter;
  75      $previous_vssl = '0';
  76      if ($key == 0) {
  77        $previous_v = -1; // it was the first to be found

  78      } else {
  79        $previous_v = $vert_links[$key - 1];
  80      }
  81      $next_vssl = '0';
  82      if ($vert_links[$key + 1]) {
  83        $next_item_v = $vert_links[$key + 1];
  84      } else {
  85        $next_item_v = $vert_links[0];
  86      }
  87    }
  88    $last_v = $value;
  89    $counter++;
  90  }
  91  if ($previous_v == -1) $previous_v = $last_v;
  92  
  93  /*

  94  //prev/next for horiz now

  95  reset ($horiz_links);

  96  $counter = 0;

  97  while (list($key, $value) = each ($horiz_links)) {

  98  if ($value == $ezpage_id) {

  99  $position_h = $counter;

 100  $previous_hssl = '0';

 101  if ($key == 0) {

 102  $previous_h = -1; // it was the first to be found

 103  } else {

 104  $previous_h = $horiz_links[$key - 1];

 105  }

 106  $next_hssl = '0';

 107  if ($horiz_links[$key + 1]) {

 108  $next_item_h = $horiz_links[$key + 1];

 109  } else {

 110  $next_item_h = $horiz_links[0];

 111  }

 112  }

 113  $last_h = $value;

 114  $counter++;

 115  }

 116  if ($previous_h == -1) $previous_h = $last_h;

 117  */
 118  
 119  if (!isset($pos) || empty($pos) || $pos=='v') {
 120    $prev_link = zen_href_link(FILENAME_EZPAGES, 'id=' . $previous_v . '&pos=v' . '&chapter=' . $chapter_link, ($previous_vssl =='0' ? 'NONSSL' : 'SSL'));
 121    $next_link = zen_href_link(FILENAME_EZPAGES, 'id=' . $next_item_v . '&pos=v' . '&chapter=' . $chapter_link, ($next_vssl =='0' ? 'NONSSL' : 'SSL'));
 122  } else {
 123    $prev_link = zen_href_link(FILENAME_EZPAGES, 'id=' . $previous_h . '&pos=h' . '&chapter=' . $chapter_link, ($previous_hssl =='0' ? 'NONSSL' : 'SSL'));
 124    $next_link = zen_href_link(FILENAME_EZPAGES, 'id=' . $next_item_h . '&pos=h' . '&chapter=' . $chapter_link, ($next_hssl =='0' ? 'NONSSL' : 'SSL'));
 125  }
 126  
 127  
 128  
 129  $previous_button = zen_image_button(BUTTON_IMAGE_PREVIOUS, BUTTON_PREVIOUS_ALT);
 130  $next_item_button = zen_image_button(BUTTON_IMAGE_NEXT, BUTTON_NEXT_ALT);
 131  $home_button = zen_image_button(BUTTON_IMAGE_CONTINUE, BUTTON_CONTINUE_ALT);
 132  
 133  
 134  // set Page Title for heading, navigation, etc

 135  define('NAVBAR_TITLE', $var_pageDetails->fields['pages_title']);
 136  define('HEADING_TITLE', $var_pageDetails->fields['pages_title']);
 137  $breadcrumb->add($var_pageDetails->fields['pages_title']);
 138  
 139  require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
 140  
 141  
 142  
 143  // Pull settings from admin switches to determine what, if any, header/column/footer "disable" options need to be set

 144  // Note that these are defined normally under Admin->Configuration->EZ-Pages-Settings

 145  if (!defined('EZPAGES_DISABLE_HEADER_DISPLAY_LIST')) define('EZPAGES_DISABLE_HEADER_DISPLAY_LIST','');
 146  if (!defined('EZPAGES_DISABLE_FOOTER_DISPLAY_LIST')) define('EZPAGES_DISABLE_FOOTER_DISPLAY_LIST','');
 147  if (!defined('EZPAGES_DISABLE_LEFTCOLUMN_DISPLAY_LIST')) define('EZPAGES_DISABLE_LEFTCOLUMN_DISPLAY_LIST','');
 148  if (!defined('EZPAGES_DISABLE_RIGHTCOLUMN_DISPLAY_LIST')) define('EZPAGES_DISABLE_RIGHTCOLUMN_DISPLAY_LIST','');
 149  if ($ezpage_id > 0 ) {
 150    if (in_array($ezpage_id, explode(",",EZPAGES_DISABLE_HEADER_DISPLAY_LIST)) || strstr(EZPAGES_DISABLE_HEADER_DISPLAY_LIST,'*')) $flag_disable_header = true;
 151    if (in_array($ezpage_id, explode(",",EZPAGES_DISABLE_FOOTER_DISPLAY_LIST)) || strstr(EZPAGES_DISABLE_FOOTER_DISPLAY_LIST,'*')) $flag_disable_footer = true;
 152    if (in_array($ezpage_id, explode(",",EZPAGES_DISABLE_LEFTCOLUMN_DISPLAY_LIST)) || strstr(EZPAGES_DISABLE_LEFTCOLUMN_DISPLAY_LIST,'*')) $flag_disable_left = true;
 153    if (in_array($ezpage_id, explode(",",EZPAGES_DISABLE_RIGHTCOLUMN_DISPLAY_LIST)) || strstr(EZPAGES_DISABLE_RIGHTCOLUMN_DISPLAY_LIST,'*')) $flag_disable_right = true;
 154  }
 155  // end flag settings for sections to disable

 156  
 157  
 158  
 159  
 160  // This should be last line of the script:

 161  $zco_notifier->notify('NOTIFY_HEADER_END_EZPAGE');
 162  ?>


Généré le : Mon Nov 26 16:45:43 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics