Page 2 of 3

Posted: Sat 29. Sep 2007, 10:29
by DeXXus
sunny123 wrote:
DeXXus wrote:This may be a dumb question. Is your browser encoding set properly to English?
Can you help me to change the login.php to set properly langage from people choose, and from browser enconding too?
Does this mean that it DID make a difference?

There's an OLD discussion linked below that was regarding the order in which browser detection and backend settings are tested. perhaps you can get something out of it? ( I was scolded back then ;-) )

http://www.phpwcms.de/forum/viewtopic.php?t=9536

Posted: Sun 30. Sep 2007, 01:42
by sunny123
DeXXus wrote: Does this mean that it DID make a difference?

There's an OLD discussion linked below that was regarding the order in which browser detection and backend settings are tested. perhaps you can get something out of it? ( I was scolded back then ;-) )

http://www.phpwcms.de/forum/viewtopic.php?t=9536
NO! There is nothing I want.
I want to user can choose login.php language, how to edit the login.php code?

Posted: Sun 30. Sep 2007, 06:09
by sunny123
Why nobody understand me?


Anybody can help me?

Posted: Sun 30. Sep 2007, 11:27
by Heiko H.
Hi sunny123,

choose the language you want. Leave the datafields (login, password) emty and press the login-Button.

Good luck, Heiko...

Posted: Sun 30. Sep 2007, 13:11
by sunny123
Heiko H. wrote:Hi sunny123,

choose the language you want. Leave the datafields (login, password) emty and press the login-Button.

Good luck, Heiko...
Yes, you are right!
But it is not the correct procedure!

Posted: Sun 30. Sep 2007, 13:21
by Heiko H.
But it is not the correct procedure!
Right, but it works :wink:

May be a bug report is the right way :?:
http://sourceforge.net/tracker/?group_i ... tid=607698


Regards, Heiko...

Posted: Mon 1. Oct 2007, 13:27
by sunny123
Heiko H. wrote:
But it is not the correct procedure!
Right, but it works :wink:

May be a bug report is the right way :?:
http://sourceforge.net/tracker/?group_i ... tid=607698


Regards, Heiko...
Hello Heiko,
I'm sorry, my english is poor, I mean that directly turns English page without pressing the login-Button, may I?

Posted: Mon 1. Oct 2007, 14:18
by Goran
sunny123 wrote: I mean that directly turns English page without pressing the login-Button, may I?
No, not possible without hacking the code,

Posted: Mon 1. Oct 2007, 14:53
by sunny123
Goran wrote:
sunny123 wrote: I mean that directly turns English page without pressing the login-Button, may I?
No, not possible without hacking the code,

It is possible,why?

Posted: Mon 1. Oct 2007, 15:04
by pico
[UPDATE] Post deleted - makes NO sense! and does NOT help!

Posted: Mon 1. Oct 2007, 16:53
by pico
Hi

are you shure that you haven't change something else ?

have tested it now

on a older Version

Edit - shure it will shows a Login-Error ;) this is not a Bug - it's a Feature :lol: 'cause the Username and Password are wrong - hehe all what the changed Code does is to reload the Form like you have clicked on 'Submit'

Second Edit

to solve this Problem too here a little Codechange

Code: Select all

...
<div id="loginForm" style="display:none;">

<!-- New Language Selection Part now here (pico) -->
<form name="login_lang" method="post" action="login.php" style="margin:0;padding:0;">
	<table border="0" cellpadding="0" cellspacing="0" summary="Login Form" style="margin:15px 0 20px 10px">
   <tr>
     <td align="right" nowrap="nowrap" class="v10"><?php echo $BL["login_lang"] ?>:&nbsp;</td>
     <td class="v10">
       <select name="form_lang" onchange="this.form.submit();" id="form_lang" style="width:250px;">
       <?php
         // check available languages installed and build language selector menu
         $lang_dirs = opendir(PHPWCMS_ROOT.'/include/inc_lang/backend');
         $lang_code = array();
         while($lang_codes = readdir( $lang_dirs )) {
         	if( $lang_codes != "." && $lang_codes != ".." && file_exists(PHPWCMS_ROOT.'/include/inc_lang/backend/'.$lang_codes."/lang.inc.php")) {
         		$lang_code[$lang_codes]  = '<option value="'.$lang_codes.'"';
         		$lang_code[$lang_codes] .= ($lang_codes == $_SESSION["wcs_user_lang"]) ? ' selected="selected"' : '';
         		$lang_code[$lang_codes] .= '>';
         		$lang_code[$lang_codes] .= (isset($BL[strtoupper($lang_codes)])) ? $BL[strtoupper($lang_codes)] : strtoupper($lang_codes);
         		$lang_code[$lang_codes] .= '</option>';
         	}
         }
         closedir( $lang_dirs );
         ksort($lang_code);
	       	echo implode(LF, $lang_code);
       ?>
       </select>
     </td>
   </tr>
 </table> 
</form>       
<!-- END modifikation -->

<form name="login_formular" method="post" action="login.php" autocomplete="off" style="margin:0;padding:0;">
...
and some Lines down

Code: Select all

	
...
<table border="0" cellpadding="0" cellspacing="0" summary="Login Form" style="margin:15px 0 20px 10px">
        <tr>
          <td align="right" nowrap="nowrap" class="v10"><?php echo $BL["login_username"] ?>:&nbsp;</td>
          <td class="v10"><input name="form_loginname" type="text" id="form_loginname" style="width:250px;" size="30" maxlength="30" value="<?php echo html_specialchars($wcs_user); ?>"></td>
          </tr>
        <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="3"></td></tr>
        <tr>
          <td align="right" nowrap="nowrap" class="v10"><?php echo $BL["login_userpass"] ?>:&nbsp;</td>
          <td class="v10"><input name="form_password" type="password" id="form_password" style="width:250px;" size="30" maxlength="20"></td>
          </tr>
        <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="4"></td></tr>

<!-- here was the Language Selection Part - moved up //-->

        <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10"></td></tr>
        <tr>
          <td>&nbsp;</td>
          <td><input name="Submit" type="submit" value="<?php echo $BL["login_button"] ?>"><input name="form_aktion" type="hidden" id="form_aktion" value="login"></td>
          </tr>
    </table>
...

Posted: Mon 1. Oct 2007, 18:13
by sunny123
hello pico
A question:Why has to change the position? Can you not to change it?

Posted: Mon 1. Oct 2007, 18:36
by update
to lend a helping hand :wink:

You now can
first: select a login screen language without errors :idea:
second: log in :!:
third: backend language is selected from user details?

:)

Posted: Mon 1. Oct 2007, 19:01
by Oliver Georgi
STOP hacking code!!!!!!

Here is why everything is correct - it is NOT a bug!!!

Default language of your site is defined in conf.inc.php.

Code: Select all

$phpwcms["default_lang"]      = "en";     //default language
If you direct your browser to login.php a session is opened and default language is set to above value. Then phpwcms is checking your browser's language setting - here are the related screenshots for IE7 and FireFox.

Image

Image

If default browser language is available in phpwcms it will automatically switch to this language otherwise if will fall back to phpwcms' default language setting.

It makes no sense to set to any another language than browser's default as long as your are not logged in! So check this value first.

After successful login user related language setting will be loaded.

Oliver

Posted: Mon 1. Oct 2007, 19:02
by pico
Hi

was just a litlle Hack to show you the direction -

but I'm not hired by your Company ;)