Webmastersite.net
Register Log In

Changing language via image error
all changes take us to index page--no matter what

Comments on Changing language via image error

2222a
Member

Usergroup: Customer
Joined: May 13, 2007

Total Topics: 16
Total Comments: 37
2222a
Posted Jun 02, 2007 - 11:52 PM:

Following the directions here scripts.webmastersite.net/w...language-via-link-151.html I noticed that the language is changed BUT it takes us to the index page all that time, whereas the drop down form reloads the current page. The image version is not good if the user came from search engines or decides to change the language after clicking on an inside page; they will instead be transported to the index page regardless.


Can someone please offer a suggestion as to how to do this? Another program of mine does it via <input type=image src="/
by having the same name for the img and langauge and it relaods perfectly since they are loaded as hidden values. I tried to modify it here, but it didn't work. Since this is only part of my site it is important to get it working for consistency reasons.

Thanks
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Jun 05, 2007 - 9:51 PM:

The dropdown is
 <IF {SWITCH_LANGUAGESELECTOR}>
<form action="{DIRURL}/index.php?action=setlanguage" method="post">
<input type="hidden" name="returnto" value="{CURRENTHTMLURL}">
<select name="languagegroup">{LANGOPTIONS}</select> <input type="submit" value="{LANG_GENERAL_GO}" class="button"></form>
</IF>
so you convert that into a link as
{DIRURL}/index.php?action=setlanguage&returnto={CURRENTHTMLURL}&languagegroup=whatevergroupyouwant
2222a
Member

Usergroup: Customer
Joined: May 13, 2007

Total Topics: 16
Total Comments: 37
2222a
Posted Jun 07, 2007 - 2:21 PM:

Hi Paul,
I sent a ticket for this and www.webmastersite.net/forum..._an_IF_statement-7376.html . Apparently I am doing something wrong.

thanks,
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Jun 07, 2007 - 3:34 PM:

Turns out the return url needs encoding and that 4.0.30's code only accepts it from form posts.
<a href="{DIRURL}/index.php?action=setlanguage&returnto=<?php echo urlencode("{CURRENTHTMLURL}"); ?>&languagegroup=English">English</a>
<br><a href="{DIRURL}/index.php?action=setlanguage&returnto=<?php echo urlencode("{CURRENTHTMLURL}"); ?>&languagegroup=Shqip">Shqip</a>
will work from 4.0.31.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.