Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
pw
Posts: 8 Joined: Wed 25. Feb 2004, 16:58
Post
by pw » Mon 4. Apr 2005, 11:59
Hello,
I just done simple switcher the same article in another language.
When you click on the link (flag), you will move in another article ( in apprioprate lang ):
I have x langs:
Root (PL)
article1
article2
EN
article1_en
article2_en
:
:
In my header :
<a href="
[PHP]
print($_SERVER['REQUEST_URI'])
[/PHP]
_en"> EN (flag)</a>
:
:
etc...
(I tested only on the aliases!)
Salute,
Pawel
WeDgE
Posts: 51 Joined: Tue 30. Mar 2004, 22:53
Location: France (Nice)
Post
by WeDgE » Fri 8. Apr 2005, 00:57
i want to know, i want to add this function for all the website, to switch in other language of the navigation link, article...
phpwcms have this function or is your modification ?
WeDgE
Posts: 51 Joined: Tue 30. Mar 2004, 22:53
Location: France (Nice)
Post
by WeDgE » Fri 8. Apr 2005, 01:06
ok sorry i just find this
[PHP]
if(!$GLOBALS['aktion'][0]) {
switch( strtolower( substr( $_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2 ) ) ) {
case 'de': header('Location: '.$GLOBALS['phpwcms']['site'].$GLOBALS['phpwcms']['root'].'index.php?de');
exit();
break;
default: header('Location: '.$GLOBALS['phpwcms']['site'].$GLOBALS['phpwcms']['root'].'index.php?en');
exit();
}
}
[/PHP]
east
Posts: 17 Joined: Mon 11. Apr 2005, 12:30
Post
by east » Mon 11. Apr 2005, 17:12
WeDgE wrote: ok sorry i just find this
[PHP]
if(!$GLOBALS['aktion'][0]) {
switch( strtolower( substr( $_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2 ) ) ) {
case 'de': header('Location: '.$GLOBALS['phpwcms']['site'].$GLOBALS['phpwcms']['root'].'index.php?de');
exit();
break;
default: header('Location: '.$GLOBALS['phpwcms']['site'].$GLOBALS['phpwcms']['root'].'index.php?en');
exit();
}
}
[/PHP]
... sorry, I'm a Newbie !
Where I must copy this code if the Function is working ?
east
spirelli
Posts: 996 Joined: Tue 27. Jul 2004, 13:37
Location: London
Post
by spirelli » Mon 11. Apr 2005, 17:26
I figure you sould put this into the "html head:" section of your template.
east
Posts: 17 Joined: Mon 11. Apr 2005, 12:30
Post
by east » Mon 11. Apr 2005, 19:28
Behind the META Tags ?
I do that, but ... nothing.
Pappnase
Post
by Pappnase » Mon 11. Apr 2005, 23:53
hello
create an article called e.g. redir place the script in the summary field. and save it.
root
-redir(article)
--pl(structurelevel)
--en(structurelevel)
east
Posts: 17 Joined: Mon 11. Apr 2005, 12:30
Post
by east » Tue 12. Apr 2005, 01:08
... muss wohl mal mein englisch erweitern ...
nur Bahnhof ...
danke
spirelli
Posts: 996 Joined: Tue 27. Jul 2004, 13:37
Location: London
Post
by spirelli » Tue 12. Apr 2005, 01:33
ok, mein Gerate war falsch. Pappnase liegt da richtig und auf Deutsch ist das:
Erstelle einen Artikel der z.B. "weiterleitung" benannt ist. Das obige PHP script fuegst Du in das Feld 'Schlagtext' ein + speicherst das ganze.
Dann muss Deine Struktur folgende Ebenen haben:
-weiterleitung (mit Weiterleitungsarikel)
--de
--en
gl
Posts: 1 Joined: Tue 3. May 2005, 10:59
Post
by gl » Tue 3. May 2005, 11:55
Hello all,
I used the WeDgE suggestion successfully.
What I changed is the switch clause, like this:
switch( strtolower( substr( $_SERVER['REQUEST_URI'],6, 2 ) ) )
In this way the check is explicitly on the user request and not on the browser configuration.....
bye
gl