Extension talk:Countdown

From MediaWiki.org
Jump to navigation Jump to search

14 December 2005: can't seem to get this extension to work[edit]

I can't seem to get this extension to work.

I uploaded the files, added the require_once to my localsettings.php.

Anything I could be missing? - 14 December 2005 by 69.86.31.16

I fixed a small instantiation bug. Try the latest version that I just posted. --Gri6507 02:05, 25 October 2007 (UTC)

June 2007: can't get to work either[edit]

I can't get it to work, either. Text like this is displayed instead: "UNIQ70dd48541bd7958a-countdown-00000002-QINU" --201.51.194.48 18:57, 19 June 2007 (UTC)

Try now, I have posted a version which works for me. Kuebel 09:38, 25 September 2007 (UTC)
This issue is caused (I believe) by a php extension which encrypts the php code. I had to un-install this package to get it to work. Joelb 10:27, 6 March 2008 (UTC)

Blank Version page[edit]

I get the extension to work, except my issue is it causes my specil:version page to show blank. Is there a fix? --216.223.16.33 19:31, 12 February 2008 (UTC)

I've got the same problem: Empty page content (just title and left navigation) on Special:Version - I'm using MediaWiki: 1.11.1 on PHP: 5.2.5 (cgi-fcgi) with MySQL: 5.0.45-community-nt. PHP shows no errors at all if display_errors = On and error_reporting = E_ALL. Hope you can terminate that bug, I really liked that extension! --87.174.78.63 22:41, 4 March 2008 (UTC)
I've tested this in MW v1.11.0 and 1.11.2 with PHP: 5.1.6 (apache2handler) and MySQL: 5.0.45. I cannot reproduce the problem. Can you please make sure that you have all of the code correctly copied into your local file? --Gri6507 01:07, 6 March 2008 (UTC)
I have the blank Version page problem also. I fixed it by removing this part of the code:
$wgExtensionCredits['parserhook'][] = array(
               'version'     => '1.2',
               'name'        => 'Countdown',
               'author'      => array('Peter Strömberg', 'Paul Grinberg'),
               'email'       => 'pez@pezius.com, gri6507 at yahoo dot com',
               'url'         => 'http://www.mediawiki.org/wiki/Extension:Countdown',
               'description' => 'adds <countdown> tags',
               );

Fix[edit]

I also encountered the blank Version page issue, after upgrading to MediaWiki 1.17.0 and PHP 5.3.2

The fix mentioned above does work, but it's overkill; the problem is actually being caused just by the "ö" character. Editing countdown.php to replace this with the html-encoded version will fix the issue.

'Peter Strömberg' becomes 'Peter Str&ouml;mberg'

Adamcox82 20:16, 23 September 2011 (UTC)

Summertime[edit]

They Extension does not work correctly while summertime, don't know where the problem realy is, because I don't know the javascript timefunctions, but maybe the javascript should use the servertime to calculate the difference because the servertime is always given in UTC. --DaSch 22:09, 22 September 2008 (UTC)

It sounds like the issue is just with your wiki user account. Have you made sure that your user preferences are configured correctly? --Gri6507 13:11, 26 September 2008 (UTC)

SVN[edit]

I put it into my Wikis SVN

https://wecowi.svn.sourceforge.net/svnroot/wecowi/trunk/extensions/Countdown

when somebody has any patches or modified version please send it to me or ask for access to this SVN

--DaSch 15:34, 2 October 2009 (UTC)

Importance[edit]

Sorry if I ask, but what for is this cause of this extension.Is there anything really important, what I might do with it? User:Arc96

Rocket launches? Prisoner release dates? Election poll closure times? Leucosticte (talk) 19:29, 17 August 2012 (UTC)

Request[edit]

Hi, I was wondering if we could set a finish line such as 'It's here!' whenever the countdown reaches zero instead of negative numbers, it'd be also a good idea to give the option to add the name of the variable (such as 'hours') under something like <Hh>, allowing the constant to switch into singular whenever the last digit reaches one, such as '1 second' instead of '1 seconds', and another option that lets you remove a variable when the last string of this, such as the last hour before the countdown finishes, leaving only the remaining time left shown. I'm sorry if I'm asking a lot, it's just I'd like to see this implemented on future versions, I'd do it if I knew PHP :/ thanks in advance! 186.48.30.8 19:13, 9 October 2010 (UTC)

It should be possible, e.g. using some of the code from here such as:
FinishMessage = "It is finally here!";
...
  if (secs < 0) {
    document.getElementById("cntdwn").innerHTML = FinishMessage;
    return;
  }

I have tried and failed to adapt this to work with this extension, though. Filed as bugzilla:56450. Leucosticte (talk) 22:27, 31 October 2013 (UTC)

Fix for deprecated ereg_replace() in PHP 5.3[edit]

If you get an error like: [Thu Mar 17 17:08:53 2011] [error] [client 85.xxx.xxx.xxx] PHP Deprecated: Function ereg_replace() is deprecated in .../mw/extensions/Countdown.php on line 53, referer: https://.../mw/index.php?title=Main_Page&action=edit

Replace the line:

 $counter .= $parser->unstrip($parser->recursiveTagParse(ereg_replace('<([DHMS])>','<span id="' . $name . '_\1">\1</span>',$input)), $parser->mStripState) . "\n";

With:

 $counter .= $parser->unstrip($parser->recursiveTagParse(preg_replace('/<([DHMS])>/','<span id="' . $name . '_\1">\1</span>',$input)), $parser->mStripState) . "\n";

--Gertoft 18:29, 17 March 2011 (UTC+1)

So, what not just edit the extension to use that code, rather than putting it on the talk page? I tried this:
        $array = array( 'D', 'H', 'M', 'S' );
        foreach ( $array as $element ) {
                $input = str_replace("<$element>",
                        '<span id="' . $name . '_' . $element . '">' . $element . '</span>', $input );
        }
        $counter .= $parser->mStripState->unstripGeneral($parser->recursiveTagParse ( $input ) )

Leucosticte (talk) 22:29, 31 October 2013 (UTC)


Is it just me or is the date 1 day out?? Like I'm counting down to today and today it says -1 days to go instead of 0 days to go.

Templates[edit]

So, there's no way to use template parameters in it? E.g.:

<countdown time="{{{mm}}}/{{{dd}}}/{{{yyyy}}} 12:00 AM UTC -0500">
 * '''Days:''' <D>
 * '''Hours:''' <H>
 * '''Minutes:''' <M>
 * '''Seconds:''' <S>
 </countdown>

The result I get is:

  • Days: NaN
  • Hours: NaN
  • Minutes: NaN
  • Seconds: NaN

Lacking that functionality, it's mostly pointless. I wonder if there is a way to convert it to a parser function? Leucosticte (talk) 22:31, 16 August 2012 (UTC)

26 April 2013: broken[edit]

This is broken and should be removed. I wasted 2 hours of my life thinking something was wrong elsewhere in my configuration. It is borderline malicious to post broken code/extensions on unsuspecting users. - 14:09, 26 April 2013 165.234.0.138

DateTime::createfromformat()[edit]

There is a problem. when this extension is running, the following message is displayed.

Fatal error: Call to undefined method DateTime::createfromformat() in wiki\extensions\Countdown\Countdown.php on line 45

How to fix it? --Simonlsw (talk) 05:09, 5 March 2014 (UTC)