[ Index ] |
|
Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1 |
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 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 16:45:43 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |