Hi,
I'm responsible for the administration of the wiki we're just starting to set up at work. The wiki uses German language and I'd like to edit the DefaultDateFormat, but I couldn't find out how and where. :(
At the Moment, when I use the button "Ihre Signatur mit Zeitstempel" to sign a text with adding a timestamp, the stamp has the following format:
09:57, 3. Jul. 2007 (CEST)
The timestamp-format doesn't change, when I choose a different date-format in my userprofile-preferences, so maybe it's not the DefaultDateFormat I need to change, but a different parameter?
I'd like to change the timestamp-Format (and/or the DefaultDateFormat) so that the timestamp looks like this:
03.06.2007, 09:57
In which file can I make this change and how?
Greetings Katharina Wolkwitz
-- Fachhochschule Südwestfalen Hochschulbibliothek Haldener Straße 182 58095 Hagen Tel.: 02331/987-2706
Hi again,
I forgot to describe the MediaWiki-background:
We use MediaWiki 1.10.0 on a Xampp 1.6.2-installation (Apache HTTPD 2.2.4, MySQL 5.0.41, PHP 5.2.2) currently running on a PC with Windows2000, SP4.
Katharina Wolkwitz schrieb:
Hi,
I'm responsible for the administration of the wiki we're just starting to set up at work. The wiki uses German language and I'd like to edit the DefaultDateFormat, but I couldn't find out how and where. :(
At the Moment, when I use the button "Ihre Signatur mit Zeitstempel" to sign a text with adding a timestamp, the stamp has the following format:
09:57, 3. Jul. 2007 (CEST)
The timestamp-format doesn't change, when I choose a different date-format in my userprofile-preferences, so maybe it's not the DefaultDateFormat I need to change, but a different parameter?
I'd like to change the timestamp-Format (and/or the DefaultDateFormat) so that the timestamp looks like this:
03.06.2007, 09:57
In which file can I make this change and how?
Greetings Katharina Wolkwitz
-- Fachhochschule Südwestfalen Hochschulbibliothek Haldener Straße 182 58095 Hagen Tel.: 02331/987-2706
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Hi again,
At the Moment, when I use the button "Ihre Signatur mit Zeitstempel" to sign a text with adding a timestamp, the stamp has the following format:
09:57, 3. Jul. 2007 (CEST)
The timestamp-format doesn't change, when I choose a different date-format in my userprofile-preferences, so maybe it's not the DefaultDateFormat I need to change, but a different parameter?
I'd like to change the timestamp-Format (and/or the DefaultDateFormat) so that the timestamp looks like this:
03.06.2007, 09:57
I found the place, where the timestamp in the signature is configured. Here are the lines from includes/parser.php:
/* Note: This is the timestamp saved as hardcoded wikitext to * the database, we use $wgContLang here in order to give * everyone the same signature and use the default one rather * than the one selected in each user's preferences. */ if ( isset( $wgLocaltimezone ) ) { $oldtz = getenv( 'TZ' ); putenv( 'TZ='.$wgLocaltimezone ); } $d = $wgContLang->timeanddate( date( 'YmdHis' ), false, false) . ' (' . date( 'T' ) . ')'; if ( isset( $wgLocaltimezone ) ) { putenv( 'TZ='.$oldtz ); }
As I understand it, those lines are explicitly there, so that one cannot change the signature-timestamp-format. :(
Is there a way to circumvent this? And how?
Hi All,
This is a basic question I guess.
I create a link to a template page from the current page using {{templatename}} to include the contents of the template. Then, when I try to edit the current page, the template page gets edited instead of the current page. Any ideas as what I am doing wrong here?
For eg. I created a current page using [[currentpage]]; inside the currentpage I created a link {{templatename}}. I only want to edit the current page with the template contents in it.
Any help plz,
Thanks, Balaji
This is a basic question I guess.
I create a link to a template page from the current page using {{templatename}} to include the contents of the template. Then, when I try to edit the current page, the template page gets edited instead of the current page. Any ideas as what I am doing wrong here?
For eg. I created a current page using [[currentpage]]; inside the currentpage I created a link {{templatename}}. I only want to edit the current page with the template contents in it.
Are you using the "Edit this page" link at the top or an "[Edit]" link in the page itself? If the latter, try using the former.
I tried both.
When I try it from the top of the page, I only see {{templatename}} at the editing section(but I actually want to see the template contents).
Thanks,
Bala
Thomas Dalton wrote:
This is a basic question I guess.
I create a link to a template page from the current page using {{templatename}} to include the contents of the template. Then, when I try to edit the current page, the template page gets edited instead of the current page. Any ideas as what I am doing wrong here?
For eg. I created a current page using [[currentpage]]; inside the currentpage I created a link {{templatename}}. I only want to edit the current page with the template contents in it.
Are you using the "Edit this page" link at the top or an "[Edit]" link in the page itself? If the latter, try using the former.
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
When I try it from the top of the page, I only see {{templatename}} at the editing section(but I actually want to see the template contents).
That's the correct behaviour. If you want the contents of templatename to be inserted into the source code of the currentpage use {{subst:templatename}} instead of {{templatename}} (subst stands for substitute). If you do this, currentpage won't be updated when you edit templatename.
yes, thats what I wanted.
thanks so much, Bala
Thomas Dalton wrote:
When I try it from the top of the page, I only see {{templatename}} at the editing section(but I actually want to see the template contents).
That's the correct behaviour. If you want the contents of templatename to be inserted into the source code of the currentpage use {{subst:templatename}} instead of {{templatename}} (subst stands for substitute). If you do this, currentpage won't be updated when you edit templatename.
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Hi all,
I'm still looking for a way to change the timestamp-format that comes the the signature-button in the edit-window. At the Moment, when I use the button "Ihre Signatur mit Zeitstempel" to sign a text with adding a timestamp, the stamp has the following format:
09:57, 3. Jul. 2007 (CEST)
I'd like to change the timestamp-Format (and/or the DefaultDateFormat) so that the timestamp looks like this:
03.06.2007, 09:57
After some searching I found the place where the signature is put together according to the number of ~ used. I've followed through the generation of the timestamp, but found my php is definitly not fluent enough to even try to hack the code in order to get what I want. :( Also the note in parser.php sort of discourages me even further...
How can I change timestamp-format of the signature? Can any of you help me with this?
To ease the way for those of you with more php-knowledge I've added those parts of the code that is used in formatting the timestamp.
The generation of the signature and timestamp starts in includes/parser.php
/**
- Pre-save transform helper function
- @private
*/ function pstPass2( $text, &$stripState, $user ) { global $wgContLang, $wgLocaltimezone; /* Note: This is the timestamp saved as hardcoded wikitext to * the database, we use $wgContLang here in order to give * everyone the same signature and use the default one rather * than the one selected in each user's preferences. */ if ( isset( $wgLocaltimezone ) ) { $oldtz = getenv( 'TZ' ); putenv( 'TZ='.$wgLocaltimezone ); } $d = $wgContLang->timeanddate( date( 'YmdHis' ), false, false) . ' (' . date( 'T' ) . ')'; if ( isset( $wgLocaltimezone ) ) { putenv( 'TZ='.$oldtz ); } # Variable replacement # Because mOutputType is OT_WIKI, this will only process {{subst:xxx}} type tags $text = $this->replaceVariables( $text ); # Strip out <nowiki> etc. added via replaceVariables $text = $this->strip( $text, $stripState, false, array( 'gallery' ) ); # Signatures $sigText = $this->getUserSig( $user ); $text = strtr( $text, array( '~~~~~' => $d, '~~~~' => "$sigText $d", '~~~' => $sigText ) );
It continues in languages/language.php
/**
- @public
- @param mixed $ts the time format which needs to be turned into a
date('YmdHis') format with wfTimestamp(TS_MW,$ts)
- @param bool $adj whether to adjust the time output according to the
user configured offset ($timecorrection)
- @param mixed $format what format to return, if it's false output the
default one (default true)
- @param string $timecorrection the time offset as returned by
validateTimeZone() in Special:Preferences
- @return string
*/ function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false) { $this->load(); $ts = wfTimestamp( TS_MW, $ts ); if ( $adj ) { $ts = $this->userAdjust( $ts, $timecorrection ); } $pref = $this->dateFormat( $format ); if( $pref == 'default' || !isset( $this->dateFormats["$pref both"] ) ) { $pref = $this->defaultDateFormat; }
And finally the formatting of the timestamp is done in includes/GlobalFunctions.php
/**
- @param mixed $outputtype A timestamp in one of the supported formats, the
function will autodetect which format is supplied
and act accordingly.
- @return string Time in the format specified in $outputtype
*/ function wfTimestamp($outputtype=TS_UNIX,$ts=0) { $uts = 0; $da = array(); if ($ts==0) { $uts=time(); } elseif (preg_match('/^(\d{4})-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)$/D',$ts,$da)) { # TS_DB $uts=gmmktime((int)$da[4],(int)$da[5],(int)$da[6], (int)$da[2],(int)$da[3],(int)$da[1]); } elseif (preg_match('/^(\d{4}):(\d\d):(\d\d) (\d\d):(\d\d):(\d\d)$/D',$ts,$da)) { # TS_EXIF $uts=gmmktime((int)$da[4],(int)$da[5],(int)$da[6], (int)$da[2],(int)$da[3],(int)$da[1]); } elseif (preg_match('/^(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/D',$ts,$da)) { # TS_MW $uts=gmmktime((int)$da[4],(int)$da[5],(int)$da[6], (int)$da[2],(int)$da[3],(int)$da[1]); } elseif (preg_match('/^(\d{1,13})$/D',$ts,$da)) { # TS_UNIX $uts = $ts; } elseif (preg_match('/^(\d{1,2})-(...)-(\d\d(\d\d)?) (\d\d).(\d\d).(\d\d)/', $ts, $da)) { # TS_ORACLE $uts = strtotime(preg_replace('/(\d\d).(\d\d).(\d\d)(.(\d+))?/', "$1:$2:$3", str_replace("+00:00", "UTC", $ts))); } elseif (preg_match('/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$/', $ts, $da)) { # TS_ISO_8601 $uts=gmmktime((int)$da[4],(int)$da[5],(int)$da[6], (int)$da[2],(int)$da[3],(int)$da[1]); } elseif (preg_match('/^(\d{4})-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)[+- ](\d\d)$/',$ts,$da)) { # TS_POSTGRES $uts=gmmktime((int)$da[4],(int)$da[5],(int)$da[6], (int)$da[2],(int)$da[3],(int)$da[1]); } elseif (preg_match('/^(\d{4})-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/',$ts,$da)) { # TS_POSTGRES $uts=gmmktime((int)$da[4],(int)$da[5],(int)$da[6], (int)$da[2],(int)$da[3],(int)$da[1]); } else { # Bogus value; fall back to the epoch... wfDebug("wfTimestamp() fed bogus time value: $outputtype; $ts\n"); $uts = 0; }
Greetings
Katharina Wolkwitz
Katharina Wolkwitz wrote:
Hi,
I'm responsible for the administration of the wiki we're just starting to set up at work. The wiki uses German language and I'd like to edit the DefaultDateFormat, but I couldn't find out how and where. :(
At the Moment, when I use the button "Ihre Signatur mit Zeitstempel" to sign a text with adding a timestamp, the stamp has the following format:
09:57, 3. Jul. 2007 (CEST)
The timestamp-format doesn't change, when I choose a different date-format in my userprofile-preferences, so maybe it's not the DefaultDateFormat I need to change, but a different parameter?
I'd like to change the timestamp-Format (and/or the DefaultDateFormat) so that the timestamp looks like this:
03.06.2007, 09:57
In which file can I make this change and how?
You can edit date formats in languages/messages/MessagesDe.php, or MessagesEn.php if your wiki language is set to English. For the format, see
http://meta.wikimedia.org/wiki/ParserFunctions#.23time:
-- Tim Starling
You can edit date formats in languages/messages/MessagesDe.php, or MessagesEn.php if your wiki language is set to English.
I don't assume those can be overwritten in LocalSettings.php!? That'd be much more convenient than hacking the core though...
-- F.
mediawiki-l@lists.wikimedia.org