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

Zen Cart 源代码 category_row.php




下载文件

文件名: category_row.php
文件类型: PHP文件
文件大小: 1.95 KiB
MD5: fd625fb28a0aa07cd36f4c02db158522

category_row.php - 关闭高亮
  1. <?php
  2. /**
  3.  * index category_row.php
  4.  *
  5.  * Prepares the content for displaying a category's sub-category listing in grid format.  
  6.  * Once the data is prepared, it calls the standard tpl_list_box_content template for display.
  7.  *
  8.  * @package page
  9.  * @copyright Copyright 2003-2006 Zen Cart Development Team
  10.  * @copyright Portions Copyright 2003 osCommerce
  11.  * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  12.  * @version $Id: category_row.php 4084 2006-08-06 23:59:36Z drbyte $
  13.  */
  14. if (!defined('IS_ADMIN_FLAG')) {
  15.   die('Illegal Access');
  16. }
  17. $title = '';
  18. $num_categories = $categories->RecordCount();
  19.  
  20. $row = 0;
  21. $col = 0;
  22. $list_box_contents = '';
  23. if ($num_categories > 0) {
  24.   if ($num_categories < MAX_DISPLAY_CATEGORIES_PER_ROW || MAX_DISPLAY_CATEGORIES_PER_ROW == 0) {
  25.     $col_width = floor(100/$num_categories);
  26.   } else {
  27.     $col_width = floor(100/MAX_DISPLAY_CATEGORIES_PER_ROW);
  28.   }
  29.  
  30.   while (!$categories->EOF) {
  31.     if (!$categories->fields['categories_image']) !$categories->fields['categories_image'] = 'pixel_trans.gif';
  32.     $cPath_new = zen_get_path($categories->fields['categories_id']);
  33.  
  34.     // strip out 0_ from top level cats
  35.     $cPath_new = str_replace('=0_', '=', $cPath_new);
  36.  
  37.     //    $categories->fields['products_name'] = zen_get_products_name($categories->fields['products_id']);
  38.  
  39.     $list_box_contents[$row][$col] = array('params' => 'class="categoryListBoxContents"' . ' ' . 'style="width:' . $col_width . '%;"',
  40.                                            'text' => '<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . zen_image(DIR_WS_IMAGES . $categories->fields['categories_image'], $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br />' . $categories->fields['categories_name'] . '</a>');
  41.  
  42.     $col ++;
  43.     if ($col > (MAX_DISPLAY_CATEGORIES_PER_ROW -1)) {
  44.       $col = 0;
  45.       $row ++;
  46.     }
  47.     $categories->MoveNext();
  48.   }
  49. }
  50. ?>
  51.  


cron