Jump to content

Extension talk:EventCountdown

Add topic
From mediawiki.org
Latest comment: 10 years ago by Simonlsw in topic 5 March 2014: UNIQ problem

{{TalkFromMeta}}

14 Jun 2006: I like this extension

[edit]

I like this extension. It's very handy and I enjoy using the two tags together, like so:

<eventcountdown date="14-Jun-2016">Happiness is <daysuntil in="days">14 Jun 2016</daysuntil> away.</eventcountdown>

Would it be at all possible to have some alternative text that replaces the <eventcountdown>, as soon as it reaches 14 Jun 2016? Maybe done in the style:

<eventcountdown date="14-Jun-2016" become="Welcome to happiness">Happiness is <daysuntil in="days">14 Jun 2016</daysuntil> away.</eventcountdown>

SimonMayer 03:14, 14 June 2006 (UTC)Reply

I think the major problem is, that it don't move on every day... --84.154.158.211 08:03, 7 July 2006 (UTC)Reply

25 October 2006: doesn't update automatically

[edit]

This doesn't update automatically. I was under the impression it would when I installed it. So, is that an error with my wiki/extension or is this extension just not supposed to update unless I do a blank edit to the page? --Mijunkin 17:17, 25 October 2006 (UTC)Reply

Question about multiple EventCountdown items in a document

[edit]

Is it possible to use multiple EventCountdown items - sort of like creating a task list?

<eventcountdown date="8-Sep-2006">Item 1 Friday is <daysuntil in="days"> 8 Sep 2006</daysuntil> away. </eventcountdown>

<eventcountdown date="9-Sep-2006">Item 2 Saturday is <daysuntil in="days"> 9 Sep 2006</daysuntil> away. </eventcountdown>

Thanks,

Steve

24 April 2007: error report

[edit]

I'm using MW 1.9.3 With tag <daysuntil> everything works fine, buy when i'm using <eventcountdown> whole page brakes... I mean for example any other extensions wchich uses <> brakes won't work on this page. For example extension witch syntax <gg>1234567</gg> looks like that: UNIQ1a5097014d924d70-gg-0000001A-QINU

Any idea what shall I do with it? --193.39.71.4 23:01, 24 April 2007 (UTC)Reply

5 March 2014: UNIQ problem

[edit]

I think it's to do with the recursion in the parsing. The newest method seems to be this. See new replacements for commented out code below.

//function runShowEventCountdown( $input, $argv ) {
function runShowEventCountdown( $input, $argv, &$parser ) {
       $now = time();
       if (!array_key_exists("date",$argv)) return "";
       $then = strtotime($argv["date"]);
       $daysUntil = getDaysBetween($now, $then);

       $output = "";

       if ($daysUntil > 0) {
               //global $wgOut;
               //$output = $wgOut->parse($input, false);
               $output = $parser->recursiveTagParse($input);
       }

       return $output;
}

Also it would be nice to have the extension details added.

--thx, the above function works very well for the UNIQ problem. --Simonlsw (talk) 04:39, 5 March 2014 (UTC)Reply

{{EndTalkFromMeta}}

Solution for the localization problem

[edit]
function day_name() {
	global $wgContLang;
	
	$messages = $wgContLang->messages['ipboptions'];
	$desc = array('day', 'days'); //Some default values
	
	if(preg_match('/1 ([^:]+):1 day/', $messages, $matches))
		$desc[0] = $matches[1];
	
	if(preg_match('/[2-9]+ ([^:]+):[2-9]+ days/', $messages, $matches))
		$desc[1] = $matches[1];
	
	return $desc;
}

This function works for me, but it isn't tested with all languages.

Upgrade (Redundancy)

[edit]

How to enable redundancy on an event ?

I want use it for a online game wiki and some events have redundancy. Is it possible to activate it with a time before repeat ?

Tks for your extension.