Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PLEASE HELP: Language box into Navigation


Guest

Recommended Posts

Hello,

 

I want to have the Language icons (from the Language infobox) in to the navigation row in the header.

 

In Includes/Boxes/Languages.php I found this code:

<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_LANGUAGES);

new infoBoxHeading($info_box_contents, false, false);

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> ';
}

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

new infoBox($info_box_contents);
?>

 

What do I have to change or delete, so that I can paste it in the header.php and that the navigation row will only show the language icons and not a complete box?

 

THANKS IN ADVANCE!!

Link to comment
Share on other sites

The code below was done to place the UK and Dutch flags (and their language links) into a header file. Edit the code as necessary for your site.

 

<td align=middle valign=middle width=25><a href="index.php?language=nl"><img src="includes/languages/dutch/images/icon.gif" valign=bottom width=24 height=15 alt="Nederlands" border=0></a></td>
<td align=left valign=middle width=25><a href="index.php?language=en"><img src="includes/languages/english/images/icon.gif" valign=bottom width=24 height=15 alt="English" border=0></a></td>
<td align=left valign=middle width=10> </td>

 

Vger

Link to comment
Share on other sites

Hello,

 

I want to have the Language icons (from the Language infobox) in to the navigation row in the header.

 

In Includes/Boxes/Languages.php I found this code:

<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_LANGUAGES);

new infoBoxHeading($info_box_contents, false, false);

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> ';
}

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

new infoBox($info_box_contents);
?>

 

What do I have to change or delete, so that I can paste it in the header.php and that the navigation row will only show the language icons and not a complete box?

 

THANKS IN ADVANCE!!

 

 

to display those languages other than the current one :

 

<?php

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

include(DIR_WS_CLASSES . 'language.php');

$lng = new language;

}

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

reset($lng->catalog_languages);

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

if ($language != $value['directory'] ){

$languages_string .= ' | <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency', 'action')) . 'lng=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' . $value['image'], $value['name'],'','',' style="vertical-align: middle;" ') . '</a>';

}

}

echo $languages_string;

}

?>

Treasurer MFC

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...