tak wyglądaja kategorie na stronie, na dole obrazka odstep od krawedzi obramowania moge zmienic lecz nie udaje mi sie to w przypadku gory obrazka (zaznaczone czerwoną ramką)

a teraz kod pliku main_categories.php, definiowanie wymiarow obrazka zaczyna sie od linii 93 (nie wiem czy dobrze to ujelem...)
CODE
/*
$Id: \includes\modules\main_categories.php; 25.06.2006
oscGold, Autorska dystrybucja osCommerce
http://www.oscgold.com
autor: Jacek Krysiak
Licencja: GNU General Public License
*/
//------------------------------------------------------------------------------------------------------
// PARAMETERS
//------------------------------------------------------------------------------------------------------
$item_subcategories_options = '';
//------------------------------------------------------------------------------------------------------
// CODE - do not change below here
//------------------------------------------------------------------------------------------------------
// Preorder tree traversal
function preorder($cid, $level, $foo, $cpath) {
global $categories_string, $HTTP_GET_VARS;
// Display link
if ($cid != 0) {
for ($i=0; $i<$level; $i++)
$categories_string .= ' ';
$categories_string .= '';
// 1.6 Are we on the "path" to selected category?
$bold = strstr($HTTP_GET_VARS['cPath'], $cpath . $cid . '_') || $HTTP_GET_VARS['cPath'] == $cpath . $cid;
// 1.6 If yes, use
if ($bold)
$categories_string .= '[b]';
$categories_string .= $foo[$cid]['name'];
if ($bold)
$categories_string .= '';
$categories_string .= '[/b]';
$categories_string .= '
';
}
// Traverse category tree
if (is_array($foo)) {
foreach ($foo as $key => $value) {
if ($foo[$key]['parent'] == $cid) {
preorder($key, $level+1, $foo, ($level != 0 ? $cpath . $cid . '_' : ''));
}
}
}
}
?>
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_CATEGORIES);
new contentBoxHeading($info_box_contents);
?>
$status = tep_db_num_rows(tep_db_query('describe ' . TABLE_CATEGORIES . ' status'));
$query = "select c.categories_id, cd.categories_name, c.parent_id, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION ." cd where c.categories_id = cd.categories_id";
if ($status >0)
$query.= " and c.status = '1'";
$query.= " and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name";
$categories_query = tep_db_query($query);
$categories_string = '';
preorder(0, 0, $foo, '');
//////////
// Display box contents
//////////
$ilosc_col = MAX_DISPLAY_CATEGORIES_PER_ROW;
$ilosc_col = $ilosc_col - 1;
$info_box_contents = array();
$row = 0;
$col = 0;
$width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; // szerokosc tabeli zalezna od ilosci kolumn
// $wysokosc = SUBCATEGORY_IMAGE_HEIGHT + 10; // wysokosc zalezna od wielkosci ustawionych obrazkow kategorii
$szerokosc = SUBCATEGORY_IMAGE_HEIGHT - 20;
$wysokosc = SUBCATEGORY_IMAGE_HEIGHT - 20;
while ($categories = tep_db_fetch_array($categories_query)) {
if ($categories['parent_id'] == 0) {
$rows++;
$cPath_new = tep_get_path($categories['categories_id']);
if ($subcategories['parent_id'] == $categories['categories_id']) {
$cPath_new_sub = "cPath=" . $categories['categories_id']/*"OMITED SO IT DOESNT DISPLAY SUBCATEGORIES" . "_" . $subcategories['categories_id']*/;
$text_subcategories .= ' ';
$text_subcategories .= $subcategories['categories_name'] . '' . " ";
} // if ($subcategories['parent_id'] == $categories['categories_id'])
$info_box_contents[$row][$col] = array('align' => 'center',
'params' => 'class="smallText" width="'.$width.'" valign="top"',
'text' => '
'. $categories['categories_name'] . '
'.
(isset($categories['categories_image']) ? '
' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '
' : '').'
' .tep_draw_separator('pixel_trans.gif', '100%', '5'). '
');
$col ++;
if ($col > $ilosc_col) {
$col = 0;
$row ++;
}
} //if ($categories['parent_id'] == 0)
} // while ($categories = tep_db_fetch_array($categories_query))
new contentBox($info_box_contents);
?>
$Id: \includes\modules\main_categories.php; 25.06.2006
oscGold, Autorska dystrybucja osCommerce
http://www.oscgold.com
autor: Jacek Krysiak
Licencja: GNU General Public License
*/
//------------------------------------------------------------------------------------------------------
// PARAMETERS
//------------------------------------------------------------------------------------------------------
$item_subcategories_options = '';
//------------------------------------------------------------------------------------------------------
// CODE - do not change below here
//------------------------------------------------------------------------------------------------------
// Preorder tree traversal
function preorder($cid, $level, $foo, $cpath) {
global $categories_string, $HTTP_GET_VARS;
// Display link
if ($cid != 0) {
for ($i=0; $i<$level; $i++)
$categories_string .= ' ';
$categories_string .= '';
// 1.6 Are we on the "path" to selected category?
$bold = strstr($HTTP_GET_VARS['cPath'], $cpath . $cid . '_') || $HTTP_GET_VARS['cPath'] == $cpath . $cid;
// 1.6 If yes, use
if ($bold)
$categories_string .= '[b]';
$categories_string .= $foo[$cid]['name'];
if ($bold)
$categories_string .= '';
$categories_string .= '[/b]';
$categories_string .= '
';
}
// Traverse category tree
if (is_array($foo)) {
foreach ($foo as $key => $value) {
if ($foo[$key]['parent'] == $cid) {
preorder($key, $level+1, $foo, ($level != 0 ? $cpath . $cid . '_' : ''));
}
}
}
}
?>
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_CATEGORIES);
new contentBoxHeading($info_box_contents);
?>
$status = tep_db_num_rows(tep_db_query('describe ' . TABLE_CATEGORIES . ' status'));
$query = "select c.categories_id, cd.categories_name, c.parent_id, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION ." cd where c.categories_id = cd.categories_id";
if ($status >0)
$query.= " and c.status = '1'";
$query.= " and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name";
$categories_query = tep_db_query($query);
$categories_string = '';
preorder(0, 0, $foo, '');
//////////
// Display box contents
//////////
$ilosc_col = MAX_DISPLAY_CATEGORIES_PER_ROW;
$ilosc_col = $ilosc_col - 1;
$info_box_contents = array();
$row = 0;
$col = 0;
$width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; // szerokosc tabeli zalezna od ilosci kolumn
// $wysokosc = SUBCATEGORY_IMAGE_HEIGHT + 10; // wysokosc zalezna od wielkosci ustawionych obrazkow kategorii
$szerokosc = SUBCATEGORY_IMAGE_HEIGHT - 20;
$wysokosc = SUBCATEGORY_IMAGE_HEIGHT - 20;
while ($categories = tep_db_fetch_array($categories_query)) {
if ($categories['parent_id'] == 0) {
$rows++;
$cPath_new = tep_get_path($categories['categories_id']);
if ($subcategories['parent_id'] == $categories['categories_id']) {
$cPath_new_sub = "cPath=" . $categories['categories_id']/*"OMITED SO IT DOESNT DISPLAY SUBCATEGORIES" . "_" . $subcategories['categories_id']*/;
$text_subcategories .= ' ';
$text_subcategories .= $subcategories['categories_name'] . '' . " ";
} // if ($subcategories['parent_id'] == $categories['categories_id'])
$info_box_contents[$row][$col] = array('align' => 'center',
'params' => 'class="smallText" width="'.$width.'" valign="top"',
'text' => '
'. $categories['categories_name'] . '
'.
(isset($categories['categories_image']) ? '
' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '
' : '').'
' .tep_draw_separator('pixel_trans.gif', '100%', '5'). '
');
$col ++;
if ($col > $ilosc_col) {
$col = 0;
$row ++;
}
} //if ($categories['parent_id'] == 0)
} // while ($categories = tep_db_fetch_array($categories_query))
new contentBox($info_box_contents);
?>
Podsumowujac to chce aby a gorze obrazka byl taki sam odstep od obramowania boxu co na dole
konkretnie to chodzi o ten kawalek kodu:
<?php $ilosc_col = MAX_DISPLAY_CATEGORIES_PER_ROW; $ilosc_col = $ilosc_col - 1; $row = 0; $col = 0; $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; // szerokosc tabeli zalezna od ilosci kolumn // $wysokosc = SUBCATEGORY_IMAGE_HEIGHT + 10; // wysokosc zalezna od wielkosci ustawionych obrazkow kategorii $szerokosc = SUBCATEGORY_IMAGE_HEIGHT - 20; $wysokosc = SUBCATEGORY_IMAGE_HEIGHT - 20; ?>