################################################## ######
## Mod Title: select default language mod
## Mod Version: 0.9.3
## Author: Niels Chr. Rød Denmark <
[email protected] >
##
## This mod will make it posible to temporary change the default
## language selection for annonumous users, only for the current browsing user
## any page can be called with the language parmeter, and the change will only
## happen to that specific computer who have made the request
## the default language can be changed by the user at any time on the main index
##
## the default language will stay on the selected language for 6 hours,
## until then it can bee changed either by a external link, or by the
## provided "language selection" on the index page
## after the peroid of 6 hours it goes back to the boards default language
## this is done to insure proper function on shared computers
##
## Note that only installed languages should be parsed, and if a user are logged in,
## he/she will overide this mod and have theire own language
##
## This mod is for phpBB2 ver. 2.0.0
##
## instalation rated easy
## instalation time: aprox 3-6 min
##
## Files to edit: 3
## phpBB2/common.php
## phpBB2/index.php
## phpBB2/templates/Subsilver/index_body.tpl
##
##
################################################## ###############
## Security Disclaimer: This MOD Cannot Be Posted To Or Added At Any Non-Official phpBB Sites
################################################## ###############
##
## Installation Notes:
##
## The most important thing to keep in mind is, take your time, make
## sure you are finding the correct lines to modify, then take care to paste the new code.
## Please also keep in mind, if you are using more than one language file or theme at your
## site, you will need to edit the corrosponding files for each occurrence. Good Luck!
################################################## ###############
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
################################################## ###############
#
#-----[ OPEN FILE: phpBB2/common.php ]------------------------------------------
#
#
#-----[FIND]------------------------------------------
#
$board_config[$row['config_name']] = $row['config_value'];
}
}
#
#-----[ADD AFTER]------------------------------------------
#
if ($language)
{
$board_config['default_lang'] = $language;
setcookie('default_lang',$language , (time()+21600), $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
} else if (isset($HTTP_COOKIE_VARS['default_lang']) )
$board_config['default_lang']=$HTTP_COOKIE_VARS['default_lang'];
#
#-----[ SAVE FILE: phpBB2/common.php ]------------------------------------------
#
#
#-----[ OPEN FILE: phpBB2/index.php ]------------------------------------------
#
#
#-----[FIND]------------------------------------------
#
include($phpbb_root_path . 'common.'.$phpEx);
#
#-----[ADD AFTER]------------------------------------------
#
include($phpbb_root_path . 'includes/functions_selects.'.$phpEx);
#
#-----[FIND]------------------------------------------
#
'FORUM_LOCKED_IMG' => $images['forum_locked'],
#
#-----[ADD AFTER]------------------------------------------
#
'LANGUAGE_SELECT' => language_select($board_config['default_lang'], 'language'),
'L_SELECT_LANG' => $lang['Board_lang'],
'L_CHANGE_NOW' => $lang['Go'],
#
#-----[ SAVE FILE: phpBB2/index.php ]------------------------------------------
#
#
#-----[ OPEN FILE: phpBB2/templates/Subsilver/index_body.tpl ]------------------------------------------
#
# (remember to change this in every template dir)
#
#-----[FIND]------------------------------------------
#
<!-- BEGIN switch_user_logged_out -->
<form method="post" action="{S_LOGIN_ACTION}">
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
<tr>
<td class="catHead" height="28"><a name="login"></a><span class="cattitle">{L_LOGIN_LOGOUT}</span></td>
</tr>
<tr>
<td class="row1" align="center" valign="middle" height="28"><span class="gensmall">{L_USERNAME}:
<input class="post" type="text" name="username" size="10" />
{L_PASSWORD}:
<input class="post" type="password" name="password" size="10" />
{L_AUTO_LOGIN}
<input class="text" type="checkbox" name="autologin" />
<input type="submit" class="mainoption" name="login" value="{L_LOGIN}" />
</span> </td>
</tr>
</table>
</form>
<!-- END switch_user_logged_out -->
#
#-----[REPLACE WITH]------------------------------------------
#
<!-- BEGIN switch_user_logged_out -->
<form method="post" action="{S_LOGIN_ACTION}">
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
<tr>
<td class="catHead" height="28"><a name="login"></a><span class="cattitle">{L_LOGIN_LOGOUT}</span></td>
</tr>
<tr>
<td class="row1" align="center" valign="middle" height="28"><span class="gensmall">{L_USERNAME}:
<input class="post" type="text" name="username" size="10" />
{L_PASSWORD}:
<input class="post" type="password" name="password" size="10" />
{L_AUTO_LOGIN}
<input class="text" type="checkbox" name="autologin" value="ON" />
<input type="submit" class="mainoption" name="login" value="{L_LOGIN}" />
</span> </td>
</tr> </form>
<tr>
<td class="catHead" height="28"><a name="login"></a><span class="cattitle">{L_SELECT_LANG}</span></td>
</tr>
<tr>
<td class="row1" align="center" valign="middle" height="28"><span class="gensmall">
<form method="post" action=""{U_INDEX}">
{LANGUAGE_SELECT} <input type="submit" class="mainoption" name="cangenow" value="{L_CHANGE_NOW}" />
</span></td>
</tr> </form>
</table>
<!-- END switch_user_logged_out -->
// Thats it, you all done