[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/templates/fallback/content/ -> index_nested.tpl.php (source)

   1      <table border="0" width="100%" cellspacing="0" cellpadding="0">
   2        <tr>
   3          <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
   4            <tr>
   5                          <td class="pageHeading">
   6               <?php
   7  /* bof catdesc for bts1a, replacing "echo HEADING_TITLE;" by "categories_heading_title" */
   8               if ( (ALLOW_CATEGORY_DESCRIPTIONS == 'true') && (tep_not_null($category['categories_heading_title'])) ) {
   9                   echo $category['categories_heading_title'];
  10                 } else {
  11                   echo HEADING_TITLE;
  12                 }
  13  /* eof catdesc for bts1a */
  14               ?>
  15              </td>
  16              <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . DYNAMIC_MOPICS_THUMBS_DIR . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
  17            </tr>
  18        <!-- bof catdesc for bts1a, adding "categories_description" -->
  19            <?php if ( (ALLOW_CATEGORY_DESCRIPTIONS == 'true') && (tep_not_null($category['categories_description'])) ) { ?>
  20            <tr>
  21              <td align="left" colspan="2" class="category_desc"><?php echo $category['categories_description']; ?></td>
  22            </tr>
  23            <?php } ?>
  24  <!-- eof catdesc -->
  25          </table></td>
  26        </tr>
  27        <tr>
  28          <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  29        </tr>
  30        <tr>
  31          <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
  32            <tr>
  33              <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
  34                <tr>
  35  <?php
  36      if (isset($cPath) && strpos('_', $cPath)) {
  37  // check to see if there are deeper categories within the current category
  38        $category_links = array_reverse($cPath_array);
  39        for($i=0, $n=sizeof($category_links); $i<$n; $i++) {
  40          $categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
  41          $categories = tep_db_fetch_array($categories_query);
  42          if ($categories['total'] < 1) {
  43            // do nothing, go through the loop
  44          } else {
  45            $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, pcategories.parent_id as grand_parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES . " AS pcategories, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and pcategories.categories_id = '" . (int)$category_links[$i] . "' order by c.sort_order, cd.categories_name");
  46            break; // we've found the deepest category the customer is in
  47          }
  48        }
  49      } else {
  50        $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, pcategories.parent_id as grand_parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES . " AS pcategories, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and pcategories.categories_id = '" . (int)$current_category_id . "' order by c.sort_order, cd.categories_name");
  51      }
  52  
  53      $number_of_categories = tep_db_num_rows($categories_query);
  54  
  55      $rows = 0;
  56      while ($categories = tep_db_fetch_array($categories_query)) {
  57      $rows++;
  58      $cPath_new = tep_get_path($categories['categories_id'], $categories['parent_id'], $categories['grand_parent_id']);
  59        $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
  60        echo '                <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . DYNAMIC_MOPICS_THUMBS_DIR . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n";
  61        if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {
  62          echo '              </tr>' . "\n";
  63          echo '              <tr>' . "\n";
  64        }
  65      }
  66  
  67  // needed for the new products module shown below
  68      $new_products_category_id = $current_category_id;
  69  ?>
  70                </tr>
  71              </table></td>
  72            </tr>
  73            <tr>
  74              <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  75            </tr>
  76            <tr>
  77              <td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>
  78            </tr>
  79          </table></td>
  80        </tr>
  81      </table>


Generated: Fri Jan 1 13:43:16 2010 Cross-referenced by PHPXref 0.7