burakbarr Posted February 1, 2008 Posted February 1, 2008 Hi, I have a problem about my banner (not advertisement banner) and logo. I want them (banner and logo) to change according to languages. It should change when my visitors click on their own language. Example, for English it should show Banner_1, for French Banner_2 etc. You can visit my website to see my problem better. http://www.shoetr.com I am waiting for a help which will really work. Thank you
web-project Posted February 1, 2008 Posted February 1, 2008 possible to setup using the php code and language parameters. Please read this line: Do you want to find all the answers to your questions? click here. As for contribution database it's located here! 8 people out of 10 don't bother to read installation manuals. I can recommend: if you can't read the installation manual, don't bother to install any contribution yourself. Before installing contribution or editing/updating/deleting any files, do the full backup, it will save to you & everyone here on the forum time to fix your issues. Any issues with oscommerce, I am here to help you.
germ Posted February 1, 2008 Posted February 1, 2008 Logo change example code here: Click Me If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
burakbarr Posted February 1, 2008 Author Posted February 1, 2008 I know some changes are needed in php files and languages but i don't know how will it be done and how it will work. If anyone knows how to solve this problem please help. Any complete explanations about which codes are changing and etc. will be appreciated. Thanks again for your messages.
germ Posted February 2, 2008 Posted February 2, 2008 Copy the text in the Codebox below into Notepad on your PC: <?php require('includes/application_top.php'); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Language" content="en-us"> </head> <body> <?php echo '<br>'; echo '<br>'; $this->catalog_languages = array(); $languages_query = tep_db_query("select languages_id, name, code, image, directory from " . TABLE_LANGUAGES . " order by sort_order"); while ($languages = tep_db_fetch_array($languages_query)) {$this->catalog_languages[$languages['code']] = array('id' => $languages['languages_id'],'name' => $languages['name'],'image' => $languages['image'],'directory' => $languages['directory']); echo '<br>Language ID: '; echo $languages['languages_id']; echo '<br>Language Name: '; echo $languages['name']; echo '<br>'; echo '<br>'; } echo '<br>'; echo '<br>'; ?> </body> </html> Save it as langtest.php Upload it into the root folder of your site (the same place your osCommerce index.php file is located). Access it with your browser: http://www.shoetr.com/langtest.php It will produce an output similar to this in your browser: Language ID: 1Language Name: English Language ID: 2 Language Name: Deutsch Language ID: 3 Language Name: Español Copy/paste that info into your next post. Also, post the contents of your /includes/header.php file (BETWEEN "CODE" TAGS TO PRESERVE FORMATTING!!!) And I'll need to know the filename of the banner and logo you want to display with each language. If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
burakbarr Posted February 3, 2008 Author Posted February 3, 2008 Hi again.When I upload the file langtest.php it gives a fatal error: Fatal error: Using $this when not in object context in /home/content/s/h/o/shoetr/html/langtest.php on line 17 Why is that i couldnt understand the problem?
germ Posted February 4, 2008 Posted February 4, 2008 Change this line: $this->catalog_languages = array(); To: $this = array(); And give it another try. If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
burakbarr Posted February 5, 2008 Author Posted February 5, 2008 I tried the way you want me to do but now it gives a fatal error again. Now it says: Fatal error: Cannot re-assign $this in /home/content/s/h/o/shoetr/html/langtest.php on line 17
germ Posted February 5, 2008 Posted February 5, 2008 ARRRRGH!!!!!!!!!!!!!!!! <_< Change this: $this = array(); To: unset($this); $this = array(); If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
burakbarr Posted February 5, 2008 Author Posted February 5, 2008 I am sorry for that but it still gives an error :) Fatal error: Cannot re-assign $this in /home/content/s/h/o/shoetr/html/langtest.php on line 18
burakbarr Posted February 5, 2008 Author Posted February 5, 2008 Germ, if you can give me your msn address or icq, skype etc. we can talk faster and solve this problem? Thanks again for your help.
germ Posted February 5, 2008 Posted February 5, 2008 That won't be necessary. Seeing that you didn't post at all yesterday, you can't be in that much of a hurry. I suppose my first mistake was that I copy/pasted code from another PHP file without looking at it closer. Although, all the code I've posted works on my server (I always try the code before I post it if possible), but I think you are running under PHP 5, and I'm not. All I'm looking for is the language ID osC uses for each language on your install. I didn't think it was going to be such a huge effort..... :blink: Let's try this code instead: <?php require('includes/application_top.php'); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Language" content="en-us"> </head> <body> <?php echo '<br>'; echo '<br>'; $that1 = array(); $languages_query = tep_db_query("select languages_id, name, code, image, directory from " . TABLE_LANGUAGES . " order by sort_order"); while ($languages = tep_db_fetch_array($languages_query)) {$that1->catalog_languages[$languages['code']] = array('id' => $languages['languages_id'],'name' => $languages['name'],'image' => $languages['image'],'directory' => $languages['directory']); echo '<br>Language ID: '; echo $languages['languages_id']; echo '<br>Language Name: '; echo $languages['name']; echo '<br>'; echo '<br>'; } echo '<br>'; echo '<br>'; ?> </body> </html> If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
burakbarr Posted February 5, 2008 Author Posted February 5, 2008 It worked ! Language ID: 1 Language Name: English Language ID: 4 Language Name: Turkce Language ID: 10 Language Name: French Language ID: 2 Language Name: Deutsch Language ID: 5 Language Name: russian Language ID: 3 Language Name: Espanol I want my banner and logo names to go like: banner_1 for eng banner_2 for turkish ... banner_6 for espanol. logo_1 for eng logo_2 for turkish ... logo_6 for espanol. and my header.php content is included below.
burakbarr Posted February 5, 2008 Author Posted February 5, 2008 <?php /* $Id: header.php,v 1.42 2003/06/10 18:20:38 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions [url=http://www.oscommerce.com]http://www.oscommerce.com[/url] Copyright © 2003 osCommerce Released under the GNU General Public License */ // check if the 'install' directory exists, and warn of its existence if (WARN_INSTALL_EXISTENCE == 'true') { if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) { $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning'); } } // check if the configure.php file is writeable if (WARN_CONFIG_WRITEABLE == 'true') { if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) { $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning'); } } // check if the session folder is writeable if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') { if (STORE_SESSIONS == '') { if (!is_dir(tep_session_save_path())) { $messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning'); } elseif (!is_writeable(tep_session_save_path())) { $messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning'); } } } // check session.auto_start is disabled if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) { if (ini_get('session.auto_start') == '1') { $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning'); } } if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) { if (!is_dir(DIR_FS_DOWNLOAD)) { $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning'); } } if ($messageStack->size('header') > 0) { echo $messageStack->output('header'); } ?> <!-- start --> <table cellpadding="0" cellspacing="0" border="0" width="100%" style="height:800px;width:766px; margin:auto;" align="center"><tr><td align="center"> <table cellpadding="0" cellspacing="0" border="0" style=""> <!-- header --> <tr> <td width="766"> <table cellpadding="0" cellspacing="0" border="0" style="height:100px; " class="head"> <tr><td><?php echo tep_draw_separator('spacer.gif', '1', '27'); ?></td></tr> <tr><td> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td height="52"><?php echo tep_draw_separator('spacer.gif', '20', '2'); ?></td> <td><table cellpadding="0" cellspacing="0" border="0" style="width:531px;"> <tr> <td><a href="<?=tep_href_link('index.php')?>"> <?=tep_image(DIR_WS_IMAGES.'logo.gif','','','','style="margin:6px 125px 0px 14px;"')?> </a></td> <td width="100%" style="padding:16px 0px 0px 0px; ">Phone us: <strong>9-0212-516-5302</strong></td> </tr> </table></td> <td bgcolor="#1F1F1F"><?php echo tep_image(DIR_WS_IMAGES.'part_0_1.gif')?></td> <td height="100%" width="100%"> <table cellpadding="0" cellspacing="0" border="0" width="170" style="height:58px; "> <tr> <td><?php echo tep_draw_separator('spacer.gif', '15', '1'); ?></td> <td width="100"><a href="<?=tep_href_link('shopping_cart.php')?>"><?=tep_image(DIR_WS_IMAGES.'icon_1.gif','','','','align="left" style="margin:0px 9px 0px 0px;"')?></a><br style=" line-height:1px;"><br style=" line-height:5px;"> <b><a href="<?=tep_href_link('shopping_cart.php')?>"><?=BOX_HEADING_SHOPPING_CART?></a></b> </td> <td height="100%"> <table cellpadding="0" cellspacing="0" border="0" style="height:100%;" bgcolor="#1F1F1F"> <tr><td><?=tep_image(DIR_WS_IMAGES.'part_0_1.gif','',1,10)?></td></tr> <tr><td height="100%"><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td></tr> <tr><td><?=tep_image(DIR_WS_IMAGES.'part_0_1.gif','',1,20)?></td></tr> </table></td> <td align="center" width="49" style="padding-top:7px; "><a href="<?=tep_href_link('shopping_cart.php')?>"><i><?=BOX_SHOPPING_CART_EMPTY?><br/><b>[<?=$cart->count_contents()?>]</b></i></a></td> </tr> </table> </td> <td><?php echo tep_draw_separator('spacer.gif', '31', '1'); ?></td> </tr> </table> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td><?php echo tep_draw_separator('spacer.gif', '1', '2'); ?></td> <td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td> <td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td> <td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td> <td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td> </tr> </table> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td><?php echo tep_draw_separator('spacer.gif', '29', '1'); ?></td> <td> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td><a href="<?=tep_href_link('index.php')?>"><?=tep_image_button('m_0.gif')?></a></td> <td height="100%"> <table cellpadding="0" cellspacing="0" border="0" style="height:100%;"> <tr><td height="100%"><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td></tr> <tr><td bgcolor="#000000"><?php echo tep_draw_separator('spacer.gif', '1', '19'); ?></td></tr> </table> </td> <td><a href="<?=tep_href_link('products_new.php')?>"><?=tep_image_button('m_1.gif')?></a></td> <td height="100%"> <table cellpadding="0" cellspacing="0" border="0" style="height:100%;"> <tr><td height="100%"><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td></tr> <tr><td bgcolor="#000000"><?php echo tep_draw_separator('spacer.gif', '1', '19'); ?></td></tr> </table> </td> <td><a href="<?=tep_href_link('account.php')?>"><?=tep_image_button('m_2.gif')?></a></td> <td height="100%"> <table cellpadding="0" cellspacing="0" border="0" style="height:100%;"> <tr><td height="100%"><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td></tr> <tr><td bgcolor="#000000"><?php echo tep_draw_separator('spacer.gif', '1', '19'); ?></td></tr> </table> </td> <td><a href="<?=tep_href_link('shopping_cart.php')?>"><?=tep_image_button('m_3.gif')?></a></td> <td height="100%"> <table cellpadding="0" cellspacing="0" border="0" style="height:100%;"> <tr><td height="100%"><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td></tr> <tr><td bgcolor="#000000"><?php echo tep_draw_separator('spacer.gif', '1', '19'); ?></td></tr> </table> </td> <td><a href="<?=tep_href_link('checkout_shipping.php')?>"><?=tep_image_button('m_4.gif')?></a></td> </tr> </table> </td> <td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td> <td width="100%" bgcolor="#000000"> <table cellpadding="0" cellspacing="0" border="0" width="100%" style="height:100%; "> <tr style="background:url(images/head_bg_2.gif) right top repeat-x;"><td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td><td align="right"><?php echo tep_image(DIR_WS_IMAGES.'head_corn_t.gif')?></td></tr> <tr><td><?php echo tep_draw_separator('spacer.gif', '1', '21'); ?></td><td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td></tr> <tr><td height="100%" width="100%" style="vertical-align:middle;" align="left"> <?php echo tep_draw_form('search',tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false),'get') ?> <input type=text name="keywords" value="" style="width:85px;"></td> <td> <a href="search.php" onclick="document.forms.search.submit();return false;"><?=tep_image_button('btn_search.gif')?></a> </form> </td></tr> </table> </td> <td style="background:url(images/head_bg_1.gif) left top repeat-y;"><img src="images/head_corn1_t_r.gif" border="0" alt="" width="13" height="12" style="margin:0px 18px 0px 0px;"></td> </tr> </table> </td></tr> </table> <table cellpadding="0" cellspacing="0" border="0" width="766" class="head"> <tr> <td style="background:url(images/head_bg_3.gif) right top repeat-y;"><?php echo tep_draw_separator('spacer.gif', '30', '1'); ?></td> <td><a href="<?=tep_href_link('products_new.php')?>"><?=tep_image(DIR_WS_IMAGES.'banner_1.jpg','','','','style="border:4px solid #000000; border-left:1px solid #000000;"')?></a></td> <td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td> <td width="100%" bgcolor="#000000"> <table cellpadding="0" cellspacing="0" border="0" width="183"> <tr> <td><?php echo tep_draw_separator('spacer.gif', '22', '1'); ?></td> <td width="100%"> <ul style="padding:12px 0px 8px 1px; "> <li><a href="<?=tep_href_link('specials.php')?>"><?=BOX_HEADING_SPECIALS?></a></li> <li><a href="<?=tep_href_link('advanced_search.php')?>"><?=BOX_SEARCH_ADVANCED_SEARCH?></a></li> <li><a href="<?=tep_href_link('contact_us.php')?>"><?=BOX_INFORMATION_CONTACT?></a></li> <li><a href="<?=tep_href_link('create_account.php')?>"><?=HEADER_TITLE_CREATE_ACCOUNT?></a></li> <li> <? if (tep_session_is_registered('customer_id')) { ?><a href="<?=tep_href_link('logoff.php')?>"><?=HEADER_TITLE_LOGOFF?></a><? } else { ?><a href="<?=tep_href_link('login.php')?>"><?=HEADER_TITLE_LOGIN?></a><? } ?> </li> </ul> </td> <td><?php echo tep_draw_separator('spacer.gif', '32', '1'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td> <td> <strong><b><?=BOX_HEADING_CURRENCIES?>:</b></strong><br> <form action=""><table cellpadding="0" cellspacing="0" border="0"> <tr><td> <? // CURRENCIES echo tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'); reset($currencies->currencies); $currencies_array = array(); while (list($key, $value) = each($currencies->currencies)) { $currencies_array[] = array('id' => $key, 'text' => $value['title']); } $hidden_get_variables = ''; reset($HTTP_GET_VARS); while (list($key, $value) = each($HTTP_GET_VARS)) { if ( ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) { $hidden_get_variables .= tep_draw_hidden_field($key, $value); } } echo tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" class="se"') . $hidden_get_variables . tep_hide_session_id(); echo '</form>'; ?> </td></tr> </table></form></td> <td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td> <td style="padding:2px 0px 0px 0px; "><?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; ?></td> <td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td> </tr> </table> </td> <td style="background:url(images/head_bg_4.gif) left top repeat-y; "><?php echo tep_draw_separator('spacer.gif', '32', '1'); ?></td> </tr> </table> </td> </tr> </table> <!-- end --> <?php if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="headerError"> <td class="headerError"><?php echo htmlspecialchars(urldecode($HTTP_GET_VARS['error_message'])); ?></td> </tr> </table> <?php } if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="headerInfo"> <td class="headerInfo"><?php echo htmlspecialchars($HTTP_GET_VARS['info_message']); ?></td> </tr> </table> <?php } ?> <!-- start --> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td> <td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td> <td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td></tr> <tr> <td style="background:url(images/head_bg_3.gif) right top repeat-y; "><?php echo tep_draw_separator('spacer.gif', '30', '1'); ?></td> <td width="100%" height="100%"> <!-- end --> <?php define(MAX_DESCR_1,'80'); define(MAX_DESCR_NAME,'35'); define(MAX_DESCR_NAME_SHOPPCART,'35'); define(MAX_DESCR_BESTS,'19'); define(MAX_DESCR_REVIEWS,'50'); define(MAX_DESCR_NAME_BOX,'15'); ?>
germ Posted February 5, 2008 Posted February 5, 2008 GREAT!!! :sweating: (w00t) Now I need the other things I asked for in this post: Click Me And we can get you fixed up... :lol: If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
germ Posted February 5, 2008 Posted February 5, 2008 Language ID: 1Language Name: English Language ID: 4 Language Name: Turkce Language ID: 10 Language Name: French Language ID: 2 Language Name: Deutsch Language ID: 5 Language Name: russian Language ID: 3 Language Name: Espanol I want my banner and logo names to go like: banner_1 for eng banner_2 for turkish ... banner_6 for espanol. logo_1 for eng logo_2 for turkish ... logo_6 for espanol. OK. I've got six languages, and three banners and logos.... :huh: What do you want displayed for the languages you haven't assigned a banner and logo to? :unsure: If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
♥bruyndoncx Posted February 5, 2008 Posted February 5, 2008 I'm sorry to interrupt but I don't understand why you make it so complicated I've just put different logos in each language specific directory images folder and have this line of code to show them. This also does not require any code change if a language is added in the future. echo '<div style="float:left"><a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_LANGUAGES . $language . '/images/' . 'keukenlust_header.gif', STORE_NAME,''). '</a></div>'; KEEP CALM AND CARRY ON I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support). So if you are still here ? What are you waiting for ?! Find the most frequent unique errors to fix: grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt
germ Posted February 5, 2008 Posted February 5, 2008 MAKE A BACKUP OF YOUR EXISTING FILE BEFORE MAKING ANY EDITS!!! Then replace your existing code with this: <?php /* $Id: header.php,v 1.42 2003/06/10 18:20:38 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions [url=http://www.oscommerce.com]http://www.oscommerce.com[/url] Copyright © 2003 osCommerce Released under the GNU General Public License */ // check if the 'install' directory exists, and warn of its existence if (WARN_INSTALL_EXISTENCE == 'true') { if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) { $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning'); } } // check if the configure.php file is writeable if (WARN_CONFIG_WRITEABLE == 'true') { if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) { $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning'); } } // check if the session folder is writeable if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') { if (STORE_SESSIONS == '') { if (!is_dir(tep_session_save_path())) { $messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning'); } elseif (!is_writeable(tep_session_save_path())) { $messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning'); } } } // check session.auto_start is disabled if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) { if (ini_get('session.auto_start') == '1') { $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning'); } } if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) { if (!is_dir(DIR_FS_DOWNLOAD)) { $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning'); } } if ($messageStack->size('header') > 0) { echo $messageStack->output('header'); } ?> <!-- start --> <table cellpadding="0" cellspacing="0" border="0" width="100%" style="height:800px;width:766px; margin:auto;" align="center"><tr><td align="center"> <table cellpadding="0" cellspacing="0" border="0" style=""> <!-- header --> <tr> <td width="766"> <table cellpadding="0" cellspacing="0" border="0" style="height:100px; " class="head"> <tr><td><?php echo tep_draw_separator('spacer.gif', '1', '27'); ?></td></tr> <tr><td> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td height="52"><?php echo tep_draw_separator('spacer.gif', '20', '2'); ?></td> <td><table cellpadding="0" cellspacing="0" border="0" style="width:531px;"> <tr> <td><a href="<?=tep_href_link('index.php')?>"> <?php // // multi banner/logo code added 02/05/08 // $mylogo = 'logo.gif'; $mybanr = 'banner_1.jpg'; switch ( $languages_id ) { // english case 1: case '1': $mylogo = 'logo_1.gif'; $mybanr = 'banner_1.jpg'; break; // german case 2: case '2': $mylogo = 'logo_4.gif'; $mybanr = 'banner_4.jpg'; break; // spanish case 3: case '3': $mylogo = 'logo_6.gif'; $mybanr = 'banner_6.jpg'; break; // turkish case 4: case '4': $mylogo = 'logo_2.gif'; $mybanr = 'banner_2.jpg'; break; // russian case 5: case '5': $mylogo = 'logo_5.gif'; $mybanr = 'banner_5.jpg'; break; // french case 10: case '10': $mylogo = 'logo_3.gif'; $mybanr = 'banner_3.jpg'; break; default: break; } ?> <!-- next line modified for multi-logo code 02/05/08 --> <?=tep_image(DIR_WS_IMAGES.$mylogo,'','','','style="margin:6px 125px 0px 14px;"')?> </a></td> <td width="100%" style="padding:16px 0px 0px 0px; ">Phone us: <strong>9-0212-516-5302</strong></td> </tr> </table></td> <td bgcolor="#1F1F1F"><?php echo tep_image(DIR_WS_IMAGES.'part_0_1.gif')?></td> <td height="100%" width="100%"> <table cellpadding="0" cellspacing="0" border="0" width="170" style="height:58px; "> <tr> <td><?php echo tep_draw_separator('spacer.gif', '15', '1'); ?></td> <td width="100"><a href="<?=tep_href_link('shopping_cart.php')?>"><?=tep_image(DIR_WS_IMAGES.'icon_1.gif','','','','align="left" style="margin:0px 9px 0px 0px;"')?></a><br style=" line-height:1px;"><br style=" line-height:5px;"> <b><a href="<?=tep_href_link('shopping_cart.php')?>"><?=BOX_HEADING_SHOPPING_CART?></a></b> </td> <td height="100%"> <table cellpadding="0" cellspacing="0" border="0" style="height:100%;" bgcolor="#1F1F1F"> <tr><td><?=tep_image(DIR_WS_IMAGES.'part_0_1.gif','',1,10)?></td></tr> <tr><td height="100%"><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td></tr> <tr><td><?=tep_image(DIR_WS_IMAGES.'part_0_1.gif','',1,20)?></td></tr> </table></td> <td align="center" width="49" style="padding-top:7px; "><a href="<?=tep_href_link('shopping_cart.php')?>"><i><?=BOX_SHOPPING_CART_EMPTY?><br/><b>[<?=$cart->count_contents()?>]</b></i></a></td> </tr> </table> </td> <td><?php echo tep_draw_separator('spacer.gif', '31', '1'); ?></td> </tr> </table> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td><?php echo tep_draw_separator('spacer.gif', '1', '2'); ?></td> <td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td> <td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td> <td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td> <td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td> </tr> </table> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td><?php echo tep_draw_separator('spacer.gif', '29', '1'); ?></td> <td> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td><a href="<?=tep_href_link('index.php')?>"><?=tep_image_button('m_0.gif')?></a></td> <td height="100%"> <table cellpadding="0" cellspacing="0" border="0" style="height:100%;"> <tr><td height="100%"><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td></tr> <tr><td bgcolor="#000000"><?php echo tep_draw_separator('spacer.gif', '1', '19'); ?></td></tr> </table> </td> <td><a href="<?=tep_href_link('products_new.php')?>"><?=tep_image_button('m_1.gif')?></a></td> <td height="100%"> <table cellpadding="0" cellspacing="0" border="0" style="height:100%;"> <tr><td height="100%"><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td></tr> <tr><td bgcolor="#000000"><?php echo tep_draw_separator('spacer.gif', '1', '19'); ?></td></tr> </table> </td> <td><a href="<?=tep_href_link('account.php')?>"><?=tep_image_button('m_2.gif')?></a></td> <td height="100%"> <table cellpadding="0" cellspacing="0" border="0" style="height:100%;"> <tr><td height="100%"><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td></tr> <tr><td bgcolor="#000000"><?php echo tep_draw_separator('spacer.gif', '1', '19'); ?></td></tr> </table> </td> <td><a href="<?=tep_href_link('shopping_cart.php')?>"><?=tep_image_button('m_3.gif')?></a></td> <td height="100%"> <table cellpadding="0" cellspacing="0" border="0" style="height:100%;"> <tr><td height="100%"><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td></tr> <tr><td bgcolor="#000000"><?php echo tep_draw_separator('spacer.gif', '1', '19'); ?></td></tr> </table> </td> <td><a href="<?=tep_href_link('checkout_shipping.php')?>"><?=tep_image_button('m_4.gif')?></a></td> </tr> </table> </td> <td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td> <td width="100%" bgcolor="#000000"> <table cellpadding="0" cellspacing="0" border="0" width="100%" style="height:100%; "> <tr style="background:url(images/head_bg_2.gif) right top repeat-x;"><td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td><td align="right"><?php echo tep_image(DIR_WS_IMAGES.'head_corn_t.gif')?></td></tr> <tr><td><?php echo tep_draw_separator('spacer.gif', '1', '21'); ?></td><td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td></tr> <tr><td height="100%" width="100%" style="vertical-align:middle;" align="left"> <?php echo tep_draw_form('search',tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false),'get') ?> <input type=text name="keywords" value="" style="width:85px;"></td> <td> <a href="search.php" onclick="document.forms.search.submit();return false;"><?=tep_image_button('btn_search.gif')?></a> </form> </td></tr> </table> </td> <td style="background:url(images/head_bg_1.gif) left top repeat-y;"><img src="images/head_corn1_t_r.gif" border="0" alt="" width="13" height="12" style="margin:0px 18px 0px 0px;"></td> </tr> </table> </td></tr> </table> <table cellpadding="0" cellspacing="0" border="0" width="766" class="head"> <tr> <td style="background:url(images/head_bg_3.gif) right top repeat-y;"><?php echo tep_draw_separator('spacer.gif', '30', '1'); ?></td> <!-- next line modified for multi-banner code 02/05/08 --> <td><a href="<?=tep_href_link('products_new.php')?>"><?=tep_image(DIR_WS_IMAGES.$mybanr,'','','','style="border:4px solid #000000; border-left:1px solid #000000;"')?></a></td> <td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td> <td width="100%" bgcolor="#000000"> <table cellpadding="0" cellspacing="0" border="0" width="183"> <tr> <td><?php echo tep_draw_separator('spacer.gif', '22', '1'); ?></td> <td width="100%"> <ul style="padding:12px 0px 8px 1px; "> <li><a href="<?=tep_href_link('specials.php')?>"><?=BOX_HEADING_SPECIALS?></a></li> <li><a href="<?=tep_href_link('advanced_search.php')?>"><?=BOX_SEARCH_ADVANCED_SEARCH?></a></li> <li><a href="<?=tep_href_link('contact_us.php')?>"><?=BOX_INFORMATION_CONTACT?></a></li> <li><a href="<?=tep_href_link('create_account.php')?>"><?=HEADER_TITLE_CREATE_ACCOUNT?></a></li> <li> <? if (tep_session_is_registered('customer_id')) { ?><a href="<?=tep_href_link('logoff.php')?>"><?=HEADER_TITLE_LOGOFF?></a><? } else { ?><a href="<?=tep_href_link('login.php')?>"><?=HEADER_TITLE_LOGIN?></a><? } ?> </li> </ul> </td> <td><?php echo tep_draw_separator('spacer.gif', '32', '1'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td> <td> <strong><b><?=BOX_HEADING_CURRENCIES?>:</b></strong><br> <form action=""><table cellpadding="0" cellspacing="0" border="0"> <tr><td> <? // CURRENCIES echo tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'); reset($currencies->currencies); $currencies_array = array(); while (list($key, $value) = each($currencies->currencies)) { $currencies_array[] = array('id' => $key, 'text' => $value['title']); } $hidden_get_variables = ''; reset($HTTP_GET_VARS); while (list($key, $value) = each($HTTP_GET_VARS)) { if ( ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) { $hidden_get_variables .= tep_draw_hidden_field($key, $value); } } echo tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" class="se"') . $hidden_get_variables . tep_hide_session_id(); echo '</form>'; ?> </td></tr> </table></form></td> <td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td> <td style="padding:2px 0px 0px 0px; "><?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; ?></td> <td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td> </tr> </table> </td> <td style="background:url(images/head_bg_4.gif) left top repeat-y; "><?php echo tep_draw_separator('spacer.gif', '32', '1'); ?></td> </tr> </table> </td> </tr> </table> <!-- end --> <?php if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="headerError"> <td class="headerError"><?php echo htmlspecialchars(urldecode($HTTP_GET_VARS['error_message'])); ?></td> </tr> </table> <?php } if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="headerInfo"> <td class="headerInfo"><?php echo htmlspecialchars($HTTP_GET_VARS['info_message']); ?></td> </tr> </table> <?php } ?> <!-- start --> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td> <td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td> <td><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td></tr> <tr> <td style="background:url(images/head_bg_3.gif) right top repeat-y; "><?php echo tep_draw_separator('spacer.gif', '30', '1'); ?></td> <td width="100%" height="100%"> <!-- end --> <?php define(MAX_DESCR_1,'80'); define(MAX_DESCR_NAME,'35'); define(MAX_DESCR_NAME_SHOPPCART,'35'); define(MAX_DESCR_BESTS,'19'); define(MAX_DESCR_REVIEWS,'50'); define(MAX_DESCR_NAME_BOX,'15'); ?> If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
burakbarr Posted February 5, 2008 Author Posted February 5, 2008 OK. I've got six languages, and three banners and logos.... :huh: What do you want displayed for the languages you haven't assigned a banner and logo to? :unsure: :) No, you've got six languages and six banners and six logos When I say banner_1 for english, banner_2 turkish ... banner_6 espanol , i mean it goes as banner_1 for english, banner_3 for french banner_4 for deutsch, banner_5 for russian, banner_6 espanol. and same for logos too.. As you can see on my website, it writes "fashionable models bla bla".. but i want it to change "EN IYI MODELLER bla bla" for turkish and for other languages i need to do same process too.Because of that I need to create another banner and logo images.I hope I understood your question clearly.Sorry for my bad english if there is a mistake or misunderstanding.
burakbarr Posted February 5, 2008 Author Posted February 5, 2008 Now, should i copy these to my header or do you need to fix these codes for six banners and six logos before i copy them?
burakbarr Posted February 5, 2008 Author Posted February 5, 2008 I'm sorry to interrupt but I don't understand why you make it so complicatedI've just put different logos in each language specific directory images folder and have this line of code to show them. This also does not require any code change if a language is added in the future. echo '<div style="float:left"><a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_LANGUAGES . $language . '/images/' . 'keukenlust_header.gif', STORE_NAME,''). '</a></div>'; Can you explain how to do it? and is it really works for logos and banners? Where should i paste this code and which file name should i give to banners?
germ Posted February 6, 2008 Posted February 6, 2008 I think what Carine meant was this: You have an images folder in each language folder: /includes/languages/[insert language here]/images english turkish french german russian spanish So, if you put the logo in each of the languages images folder (as noted above), and named it logo.gif Then, if you put the banner in each of the languages images folder (as noted above), and named it banner.jpg In that case you would just need to alter two lines of code: Old code: <?=tep_image(DIR_WS_IMAGES.'logo.gif','','','','style="margin:6px 125px 0px 14px;"')?> New code: <?=tep_image(DIR_WS_LANGUAGES . $language.'/images/logo.gif','','','','style="margin:6px 125px 0px 14px;"')?> Old code: <td><a href="<?=tep_href_link('products_new.php')?>"><?=tep_image(DIR_WS_IMAGES.'banner_1.jpg','','','','style="border:4px solid #000000; border-left:1px solid #000000;"')?></a></td> New code: <td><a href="<?=tep_href_link('products_new.php')?>"><?=tep_image(DIR_WS_LANGUAGES . $language.'/images/banner.jpg','','','','style="border:4px solid #000000; border-left:1px solid #000000;"')?></a></td> An excellent idea for multilingual stores, if you ask me. Thanks, Carine! :wub: If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
burakbarr Posted February 6, 2008 Author Posted February 6, 2008 Many thanks for your help Germ and Carine :) I'll try this and write my reviews here.
burakbarr Posted February 6, 2008 Author Posted February 6, 2008 I tried the code you gave to me it worked but another error occured now. Take a look at a picture below What should i do now for this?
germ Posted February 6, 2008 Posted February 6, 2008 You'll need to be more explicit. I went to the site, and clicked on all the language icons. Nothing changed (image wise), but I didn't see any errors either... :huh: If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
Recommended Posts
Archived
This topic is now archived and is closed to further replies.