Jump to content
InvisionCommunity.de - Der Deutsche Invision Community Support
Sign in to follow this  
marcoxz

Datum in Deutsch

Recommended Posts

Zunächst mal, prüfe ob dein Webhoster die Funktion anbietet und welche Einstellun bevorzugt wird.

Dazu lade folgende PHP Datei auf deinen Webspace auf und rufe diese auf.

<?php
$loc_de = setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
echo "Preferred locale for german on this system is '$loc_de'";?>
?>
Anschließend kannst du mit der richtigen Einstellung, die dir dort ausgegeben wird, prüfen, ob es wirklich klappt. Hierfür das de_DE mit dem richtigen Parameter (falls unterschiedlich) bei setlocale ändern.
<?php
setlocale(LC_ALL, 'de_DE');
echo strftime("%A %d %B %Y", time());
?>
Für Version 2.1 Datei init.php Suche:
error_reporting  (E_ERROR | E_WARNING | E_PARSE);
Füge darunter ein (Parameter ggf. ändern):
setlocale(LC_ALL, 'de_DE');
Datei sources/ipsclass.php Suche:
				$this->today_time	 = gmdate('d,m,Y', ( time() + $this->offset) );
$this->yesterday_time = gmdate('d,m,Y', ( (time() - 86400) + $this->offset) );
Ersetze durch:
				$this->today_time	 = strftime('%d,%m,%Y', ( time() + $this->offset) );
$this->yesterday_time = strftime('%d,%m,%Y', ( (time() - 86400) + $this->offset) );
Suche (3 mal):
				return gmdate($this->time_options[$method], ($date + $this->offset) );
Ersetze jeweils durch:
				return strftime($this->time_options[$method], ($date + $this->offset) );
Suche:
			$this_time = gmdate('d,m,Y', ($date + $this->offset) );
Ersetze durch:
			$this_time = strftime('%d,%m,%Y', ($date + $this->offset) );
Suche:
			if ( $this_time == $this->today_time )
{
return str_replace( '{--}', $this->lang['time_today'], gmdate($this->vars['time_use_relative_format'], ($date + $this->offset) ) );
}
else if ( $this_time == $this->yesterday_time )
{
return str_replace( '{--}', $this->lang['time_yesterday'], gmdate($this->vars['time_use_relative_format'], ($date + $this->offset) ) );
}
Ersetze durch:
			if ( $this_time == $this->today_time )
{
return str_replace( '{--}', $this->lang['time_today'], strftime($this->vars['time_use_relative_format'], ($date + $this->offset) ) );
}
else if ( $this_time == $this->yesterday_time )
{
return str_replace( '{--}', $this->lang['time_yesterday'], strftime($this->vars['time_use_relative_format'], ($date + $this->offset) ) );
}
Suche:
		return gmdate($method, ($date + $this->offset) );
Ersetze durch:
		return strftime($method, ($date + $this->offset) );
Datei sources/action_public/profile.php Suche:
		$info['local_time']  = $member['time_offset'] != "" ? gmdate( $this->ipsclass->vars['clock_long'], time() + ($member['time_offset']*3600) + ($this->ipsclass->vars['time_adjust'] * 60) ) : $this->ipsclass->lang['no_info'];
Ersetze durch:
		$info['local_time']  = $member['time_offset'] != "" ? strftime( $this->ipsclass->vars['clock_long'], time() + ($member['time_offset']*3600) + ($this->ipsclass->vars['time_adjust'] * 60) ) : $this->ipsclass->lang['no_info'];

Share this post


Link to post

Ach ja das läuft so auch auf 2.3.4

In der profile.php muß zusätzlich noch diese Zeile:

$member['_local_time']	   = $member['time_offset'] != "" 

? gmdate( $this->ipsclass->vars['clock_long'], time() + ($member['time_offset']*3600) + ($time_adjust * 60) ) : '';
Durch diese:
$member['_local_time']	   = $member['time_offset'] != "" 

? strftime( $this->ipsclass->vars['clock_long'], time() + ($member['time_offset']*3600) + ($time_adjust * 60) ) : '';
ersetzt werden. Und dann noch: in der ipsclass.php müssen noch die anderen Datums formate also die mit % eingesetzt werden (sonst stimmen die Zeiten in der Profil ansicht nicht) also 'TINY' und 'DATE'
//-----------------------------------------

		// Time options

		//-----------------------------------------


		$this->time_options = array( 'JOINED' => $this->vars['clock_joined'],

									 'SHORT'  => $this->vars['clock_short'],

									 'LONG'   => $this->vars['clock_long'],

									 'TINY'   => isset($this->vars['clock_tiny']) ? $this->vars['clock_tiny'] : 'j M Y - G:i',

									 'DATE'   => isset($this->vars['clock_date']) ? $this->vars['clock_date'] : 'j M Y',

								   );


		$this->num_format = ( $this->vars['number_format'] == 'space' ) ? ' ' : $this->vars['number_format'];

Edited by marcoxz

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×