Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Blackice2999’s picture

Status: Active » Postponed (maintainer needs more info)

Hi,

the 7.x Version has a "jQuery Countdown Block". So what are you missing here ?

HongPong’s picture

Status: Postponed (maintainer needs more info) » Active
FileSize
13.45 KB

Here's the output of coder.

Blackice2999’s picture

Status: Active » Postponed (maintainer needs more info)

Hi HongPong,

sorry but i dont understand what you want, so i dont want to watch line by line of a patch. Tell me your problem and we had a base for discussion.
thanks
Dennis

HongPong’s picture

Is it possible to make multiple countdown blocks in the 7.x version? That was the missing functionality I was trying to get going. It looked like the old version let you set multiple deltas. Thanks much.

Blackice2999’s picture

Category: feature » support
Status: Postponed (maintainer needs more info) » Active

Hi,

now i understand what you want. Why not use views for this ? - you can create multiple views blocks - but you need a content type with a date field for that.
alternativly you can try http://drupal.org/project/multiblock

HongPong’s picture

Aha! Now I see how to do it. Referred to #685956: CCK date field formatter . I will try to write up documentation & post a README to include, as well as add to the community docs. It is pretty slick and also not complicated to setup.

Blackice2999’s picture

Hi,

sure feel free to write a documentation page this is a good idea.

HongPong’s picture

Title: port jquery_countdown_block to 7.x » add README to jquery_countdown
Status: Active » Needs review
FileSize
4.22 KB

Alright I wrote up the Readme. I also used some of the material on the other threads to come up with new example code that seems to work nicely on my local machine. Hope this helps the module find a broader audience - and possibly consider using my examples on the module page? I can add a Docs page for it too if you think the doc is good.

HongPong’s picture

I forgot to note the blocks admin page. Fixed.

HongPong’s picture

... whitespaces fixed.

HongPong’s picture

A couple missing line breaks fixed.

pazza98’s picture

Hi, I'm a bit new to this, so please excuse me if I've missed anything.

I've successfully implemented the jquery_countdown_add example with the 10 second countdown and an extended 10 minute variation on the same using 600 instead of 10 so as to avoid the annoying popup 10 seconds after loading my test page (aka my homepage).

However I'm having trouble getting to grips with the rest of the syntax and can't seem to find any relevant example code to help. Or find the code from the built in jquery-countdown-block.

Could someone document other options and how to use them, even if it just explains how to port the original jquery_countdown options to Drupal using jquery_countdown_add().

My attempt at trying to explain it to myself goes like this:

+<?php
+  echo '<div class="countdown">10 seconds!</div>';
+  jquery_countdown_add(".countdown", array("until" => 10, "onExpiry" => "finished"));
+  drupal_add_js("function finished() { alert('You are done!'); }", 'inline');
+?>


++ Breakdown of the code above is like

+<?php

++<?php opens the php code section

+  echo '<div class="countdown">10 seconds!</div>';

++ echo ' . . . ' sends some html to the client
++ div class="countdown" sets the active div
++ class="countdown" is like class="<$cid>"
++ 10 seconds! Is just a label really

+  jquery_countdown_add(".countdown", array("until" => 10, "onExpiry" => "finished"));

++ jquery_countdown_add() is a function
++ it takes ".countdown", array("until" => 10, "onExpiry" => "finished")
++ as a set of options
++
++ that breaks down to ".countdown" and array()
++ ".countdown" I think refers to the div / class
++ array() is another function which takes "until" => 10 and "onExpiry" => "finished"

+  drupal_add_js("function finished() { alert('You are done!'); }", 'inline');

++ finally drupal_add_js() is a function which is used in this case to finish off
++ "function finished() calls the action for onExpiry in the code above
++ {alert('You are done!');}" calls for alert('You are done!'); which creates a popup with 
++ the text 'You are done!'
++ 'inline' is a formatting parameter

I realise this could be totally wrong. Thanks in advance.

Will.