Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

changing the header + navigation / need help


Madinson

Recommended Posts

Posted

I'm working on a little problem:

 

 

I changed the header. I put a grafic navigation in it and I have just 8 categories (forever!).

[default.php?cPath=1, cPath=2,....,cPath=8.]

 

I integrated the top_categories.php intop header.php.

 

Now I want the textlinks to change if I change the language. The cpath is 1 for the first link, 2 for the second link...and so on. In the original top_categories.php there is:

 

<!-- top_categories //-->

<tr>

<td>

<?php

//////////

// Display box heading

//////////

$info_box_contents = array();

$info_box_contents[] = array('align' => 'left', 'text' => BOX_HEADING_CATEGORIES);

new infoBoxHeading($info_box_contents, true, false);

 

 

//////////

// Get categories list

//////////

// Test for presence of status field for compatibility with older versions

$status = tep_db_num_rows(tep_db_query('describe categories status'));

 

$query = "select c.categories_id, cd.categories_name, c.parent_id

from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd

where c.categories_id = cd.categories_id

and c.parent_id=0";

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);

 

// Build categories string

$categories_string = '';

while ($row = tep_db_fetch_array($categories_query)) {

$categories_string .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $row['categories_id']) . '">';

list($current) = explode('_', $HTTP_GET_VARS['cPath']);

if ($row['categories_id'] == $current) $categories_string .= '<b>';

$categories_string .= $row['categories_name'];

if ($row['categories_id'] == $current) $categories_string .= '</b>';

$categories_string .= '</a>';

$categories_string .= '<br>';

}

 

//////////

// Display box contents

//////////

$info_box_contents = array();

$info_box_contents[] = array('align' => 'left', 'text' => $categories_string);

new infoBox($info_box_contents);

?>

</td>

</tr>

<!-- top_categories_eof //-->

 

Now I want to ask the database for the linkname of categorie 1...and move it into my html...like. I need no rows or so. )I just want to insert 8 links...

'<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=1' . '">'

 

Are there any specialists...I need your helping hands.

Anyway thanks.

just create...and sell..sell...sell.....

Posted

Hi There:

 

Now I have the list of the 8 categories in one row. Can someone help me to get the link to categorie 1 in row 1, the link to categorie 2 in row 2 ??

 

What I have now:>>>

 

<?php

 

//////////

// Get categories list

//////////

// Test for presence of status field for compatibility with older versions

$status = tep_db_num_rows(tep_db_query('describe categories status'));

 

$query = "select c.categories_id, cd.categories_name, c.parent_id

from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd

where c.categories_id = cd.categories_id

and c.parent_id=0";

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);

?>

 

<tr>

<td align="center" class="boxText" height="24">

 

<?php

// Build categories string

$categories_string = '';

while ($row = tep_db_fetch_array($categories_query)) {

$categories_string .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $row['categories_id']) . '">';

list($current) = explode('_', $HTTP_GET_VARS['cPath']);

if ($row['categories_id'] == $current) $categories_string .= '<b>';

$categories_string .= $row['categories_name'];

if ($row['categories_id'] == $current) $categories_string .= '</b>';

$categories_string .= '</a>';

$categories_string .= '<br>';

}

 

//////////

// Display box contents

//////////

$info_box_contents = array();

$info_box_contents[] = array('align' => 'center', 'text' => $categories_string);

new infoBox($info_box_contents);

?>

 

</td>

just create...and sell..sell...sell.....

Posted

Hi there::

 

What i want is maybe to difficult??

Could someone give me a tip??

just create...and sell..sell...sell.....

Archived

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

×
×
  • Create New...