mazza Posted January 26, 2003 Posted January 26, 2003 How could the selected language be hidden ? For example, if the language was english, there would be only spanish and german flags and if spanish would be selected only german and english flags would be visible. "Use no way as way, have no limitation as limitation." - Bruce Lee
mazza Posted January 27, 2003 Author Posted January 27, 2003 Anybody ? I tried modifying the sql statement in includes/classes/language.php but it did not. Apparently the only place this could be done is includes/boxes/language.php by modifying this code: $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, $connection) . '">' . tep_image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> '; } But how ? "Use no way as way, have no limitation as limitation." - Bruce Lee
Christian Lescuyer Posted January 28, 2003 Posted January 28, 2003 Like this: while (list($key, $value) = each($lng->catalog_languages)) { if (!strcasecmp($value['name'], $language)) continue; $languages_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $connection) . '">' . tep_image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> '; } Christian Lescuyer
mazza Posted January 28, 2003 Author Posted January 28, 2003 Thank you Christian, again. :D "Use no way as way, have no limitation as limitation." - Bruce Lee
zebraplayer Posted March 14, 2006 Posted March 14, 2006 I have the following code: <?php 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> '; } echo $languages_string; ?> How do I modify it to make the above happen. I too only want to show the flag for the language that is not being used. Thanks!
boxtel Posted March 14, 2006 Posted March 14, 2006 I have the following code: <?php 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> '; } echo $languages_string; ?> How do I modify it to make the above happen. I too only want to show the flag for the language that is not being used. Thanks! <?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
zebraplayer Posted March 14, 2006 Posted March 14, 2006 That worked almost perfectly. It had an error where the code should have read: 'language=' . $key, $request_type) instead of 'lng=' . $key, $request_type) as suggested. But I figured that out on my own and now it works perfectly. Thank you very much, boxtel. -zp
zebraplayer Posted March 14, 2006 Posted March 14, 2006 One more thing. Where's that pesky vertical dash "|" that appears between the flags called in the above code? Now that I have only one flag I don't need it and want to remove it. Thanks!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.