######################################################## 
## Mod Title:   select default language mod 
## Mod Version: 0.9.2 
## Author:       Niels Chr. Rd Denmark < ncr@db9.dk > 
## 
## 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 the default language selection 
## 
## This mod is only for phpBB2!! 
## developed in RC-2 
## modifyed / confirmed on RC-4 
## 
## instalation rated easy 
## instalation time: aprox 5-8 min 
## 
## Files to edit: 4 
## phpBB2/common.php 
## phpBB2/index.php 
## phpBB2/language/lang_DIRxx/lang_main.php 
## phpBB2/templates/theme_DIRxx/index_body.tpl 
## 
## 
######################################################## 
## 
## Installation Notes: 
## 
## remember to thange all themes and language your board support 
## 
######################################################## 

# 
#-----[ ACTION ]------------------------------------------ 
# 
#  OPEN FILE:  phpBB2/language/lang_dirXX/lang_main.php (remember to change this in every language dir) 

[FIND]: 
// 
// That's all Folks! 

[ADD BEFORE]: 
// add to change default lang mod 
$lang['Change']="Change now"; 

################################### This completes the changes in lang_main.php ############################## 

# 
#-----[ ACTION ]------------------------------------------ 
# 
#  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']; 


################################### This completes the changes in common.php ############################## 

# 
#-----[ ACTION ]------------------------------------------ 
# 
#  OPEN FILE:  phpBB2/index.php 

[FIND]: 
include($phpbb_root_path . 'common.'.$phpEx); 

[ADD AFTER]: 
include($phpbb_root_path . 'includes/functions_selects.'.$phpEx); 

# 
#-----[ ACTION ]------------------------------------------ 
# 

[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['Change'], 

################################### This completes the changes in index.php ############################## 

# 
#-----[ ACTION ]------------------------------------------ 
# 
#  OPEN FILE:  phpBB2/templates/templatedirXX/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" /> 
      &nbsp;&nbsp;&nbsp;{L_PASSWORD}: 
      <input class="post" type="password" name="password" size="10" /> 
      &nbsp;&nbsp; &nbsp;&nbsp;{L_AUTO_LOGIN} 
      <input class="text" type="checkbox" name="autologin" /> 
      &nbsp;&nbsp;&nbsp; 
      <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" /> 
      &nbsp;&nbsp;&nbsp;{L_PASSWORD}: 
      <input class="post" type="password" name="password" size="10" /> 
      &nbsp;&nbsp; &nbsp;&nbsp;{L_AUTO_LOGIN} 
      <input class="text" type="checkbox" name="autologin" value="ON" /> 
      &nbsp;&nbsp;&nbsp; 
      <input type="submit" class="mainoption" name="login" value="{L_LOGIN}" /> 
</form> 
      </span> </td> 
   </tr> 
   <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}&nbsp;&nbsp;&nbsp; <input type="submit" class="mainoption" name="cangenow" value="{L_CHANGE_NOW}" />       
      </form></span></td> 
   </tr> 
  </table> 

<!-- END switch_user_logged_out --> 

################################### This completes the changes in index_body.tpl ############################## 


// Thats it, you all done 