Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

category list (row) (column)


illusions2k

Recommended Posts

<?php
$categories_query = tep_db_query("select lc.link_categories_id, lcd.link_categories_name, lcd.link_categories_description, lc.link_categories_image from " . TABLE_LINK_CATEGORIES . " lc, " . TABLE_LINK_CATEGORIES_DESCRIPTION . " lcd where lc.link_categories_id = lcd.link_categories_id and lc.link_categories_status = '1' and lcd.language_id = '" . (int)$languages_id . "' order by lcd.link_categories_name");

$number_of_categories = tep_db_num_rows($categories_query);

if ($number_of_categories > 0) {
  $rows = 0;
  while ($categories = tep_db_fetch_array($categories_query)) {
	$rows++;
	$lPath_new = 'lPath=' . $categories['link_categories_id'];
	$width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';

	echo '				<td align="left" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_LINKS, $lPath_new) . '">';

	if (SHOW_LINKS_CATEGORIES_IMAGE == 'True') {
	  if (tep_not_null($categories['link_categories_image'])) {
		echo tep_links_image(DIR_WS_IMAGES . $categories['link_categories_image'], $categories['link_categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>';
	  } else {
		echo tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', $categories['link_categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT, 'style="border: 3px double black"') . '<br>';
	  }
	}

  $categories_count_query = tep_db_query("select l.links_id, l.links_status, lc.links_id, lc.link_categories_id from " . TABLE_LINKS . " l, " . TABLE_LINKS_TO_LINK_CATEGORIES . " lc where l.links_id = lc.links_id and l.links_status = 2 and lc.link_categories_id = " . $categories['link_categories_id']);
	$linkCount = tep_db_num_rows($categories_count_query);
	echo '<br><b><u>' . $categories['link_categories_name'] . '</b></u></a> ' . '(' . $linkCount . ')<br>' . $categories['link_categories_description'] . '</td>' . "\n";
	if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {
	  echo '			  </tr>' . "\n";
	  echo '			  <tr>' . "\n";
	}
  }
} else {
?>

 

that code makes 2 columns and they are listed like...

1-----2

3-----4

5-----6

7-----8

9-----10

 

Does anyone know how to change that code so it lists like...

 

1-----6

2-----7

3-----8

4-----9

5-----10

 

thanks

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...