Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Languages flags and search box on header navigation bar


29gk

Recommended Posts

I am stuck !!

 

I am trying to combine into the header navigation bar 2 elements, the language flags and a small search box with a button go. I ve totally removed the breadcrub text but i cannot combine the above 2 into a single line without the bar to show too thick. This is the code i am using:

 

<div class="grid_24 ui-widget infoBoxContainer">

<div class="ui-widget-header infoBoxHeading"><ul id="breadcrumb"><?php //echo $breadcrumb->trail(' » '); ?></ul>

 

<?php // Search

 

if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {

if (!isset($lng) || (isset($lng) && !is_object($lng))) {

include(DIR_WS_CLASSES . 'language.php');

$lng = new language;

}

 

if (count($lng->catalog_languages) > 1) {

$languages_string = '';

reset($lng->catalog_languages);

while (list($key, $value) = each($lng->catalog_languages)) {

$languages_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> ';

}

 

echo ' <div id="headerLang">' . $languages_string . '</div>';

 

}

}

 

echo tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', $request_type, false), 'get') ,

' <div style="text-align: right;">' .

' ' . tep_draw_input_field('keywords', '', 'value="Search...." onFocus="javascript:this.value=\'\'" size="20" id="search" maxlength="30" style="width: ' . (BOX_WIDTH-90) . 'px; background: #c0c0c0; color: #000000;font: tahoma; font-size:9;" ') . ' ' . tep_draw_hidden_field('search_in_description', '1') . tep_hide_session_id() . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH, 'align="top"') . '</form>';

// Search ?>

</div>

 

</div>

 

Thanks in advance !

Link to comment
Share on other sites

Finally i found it. Everybody needs some sleep but i forgot it.

 

Here is the code for anyone who needs to put the languages flags and a quick search field into the header navigation bar, with disabled the breadcrub texts:

 

Into /includes/header.php and for oscommerce 2.3 find:

 

<div class="grid_24 ui-widget infoBoxContainer">

<div class="ui-widget-header infoBoxHeading"><ul id="breadcrumb"><?php echo $breadcrumb->trail(' » '); ?></ul>

 

and change these lines into this :

 

<div class="grid_24 ui-widget infoBoxContainer">

<div class="ui-widget-header infoBoxHeading"><ul id="breadcrumb"><?php //echo $breadcrumb->trail(' » '); ?></ul>

 

<?php

//Search and Flags START

 

if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {

if (!isset($lng) || (isset($lng) && !is_object($lng))) {

include(DIR_WS_CLASSES . 'language.php');

$lng = new language;

}

 

$languages_string = '';

reset($lng->catalog_languages);

while (list($key, $value) = each($lng->catalog_languages)) {

$languages_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> ';

}

?>

<td align="right"><?php echo $languages_string; ?></td>

 

<?php

}

 

echo tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', $request_type, false), 'get') ,

' <div style="float: right;">' .

' ' . tep_draw_input_field('keywords', '', 'value="Search...." onFocus="javascript:this.value=\'\'" size="20" id="search" maxlength="30" style="width: ' . (BOX_WIDTH-90) . 'px; height:13px; background: #c0c0c0; color: #000000; font: tahoma; font-size:9;" ') . ' ' . tep_draw_hidden_field('search_in_description', '1') . tep_hide_session_id() . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH, 'align="top"') . '</form>';

// Search and Flags END

?>

</div>

 

</div>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...