This topic is locked

language selector PHP

4/2/2014 4:21:48 AM
PHPRunner General questions
Y
YCH author

Hi,
I came across this topic on the forum : http://www.asprunner.com/forums/topic/10687-language-selector/
My question is: what would that code be for PHPrunner users?
you can add language dropdown on the menu page manually.

Add following code on the Visual Editor tab in HTML mode:
Quote
{mlang_message LANGUAGE}:

<SELECT {$langselector_attrs}>

<OPTION value="English" {$English_langattrs} selected id="replace_4">English</OPTION>

<OPTION value="French" {$French_langattrs} id="replace_5">French</OPTION>

<OPTION value="German" {$German_langattrs} id="replace_6">German</OPTION>

</SELECT>
Then add Menu page: Before display event on the Events tab.

Here is a sample:
Quote
if REQUEST("language")<> "" then SESSION("language")=REQUEST("language")

svar=GoodFieldName(mlang_getcurrentlang()) & "_langattrs"

xt.assign svar,"selected"

xt.assign "langselector_attrs","name=lang onchange=""java script: window.location='menu.asp?language='+this.options[this.selectedIndex].value"""
Yves.