Everybody is asking for multi langual forum, i create my own multi-langual forum yesterday. Take a look to my testing forum :
ISA
The forum contain two language : french and english. I decided to
create 2 forums, one with french language files and buttons files, and
i did samething for english, both connect to the same database.
where i changed the code to get my select option list, is includes/navigation_buttons_inc.asp files
At the end of this file, add :
'Else the user is not logged
Else
'Display a welcome guset message with the option to login or register
Response.Write
(" <a href=""registration_rules.asp?FID=" &
intForumID & """ target=""_self"" class=""nav""><img src="""
& strImagePath & "register_icon.gif"" alt=""" &
strTxtRegister & """ border=""0"" align=""absmiddle"">" &
strTxtRegister & "</a>")
Response.Write
(" <a href=""login_user.asp?FID=" &
intForumID & """ target=""_self"" class=""nav""><img src="""
& strImagePath & "login_icon.gif"" alt=""" & strTxtLogin
& """ border=""0"" align=""absmiddle"">" & strTxtLogin &
"</a>")
End If
%></td>
</tr>
<tr>
<td align="right" class="smText">
<form action="functions/change_language.asp" method="get">
Select language<br>
<select name="choix"
onchange="this.form.submit();" class="smText"><optgroup
label="Language list" class="smText"><option value="-1"
class="smText">Select one</option><option value="fra"
class="smText">Français</option><option value="eng"
class="smText">English</option></optgroup></select>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
After, you have to create a new file functions/change_language.asp, and add this code :
<%
if request.querystring("choix")="fra" then
dim strlink
dim strlink2
strlink = Request.ServerVariables("HTTP_Referer")
arrlink = Split(strlink,"/")
arrlink(4)="forum"
For i = lbound(arrlink) to ubound(arrlink)
if i = ubound(arrlink) then
strlink2=strlink2&arrlink(i)
else
strlink2=strlink2&arrlink(i)&"/"
end if
Next
Response.Redirect(strlink2)
elseif request.querystring("choix")="eng" then
strlink = Request.ServerVariables("HTTP_Referer")
arrlink = Split(strlink,"/")
arrlink(4)="forumeng"
For i = lbound(arrlink) to ubound(arrlink)
if i = ubound(arrlink) then
strlink2=strlink2&arrlink(i)
else
strlink2=strlink2&arrlink(i)&"/"
end if
Next
Response.Redirect(strlink2)
end if
%>
In bold, there is your both main forum, just change the name you give
to the folder. So I hope it could help you, and I just wanna excuse my
writting, i'm a french canadian and I suck in english :p.
Edited by weipper2 - 23 March 2005 at 2:26pm