 |
Account Login
|
 |
 |
Latest Articles
|
 |
 |
IRC Channel
|
 |
 |
Associates
|
 |
 |
Associates
|
 |
|
 |
 |
|
 |
03-24-2010, 03:38 AM
|
#1 (permalink)
|
|
The Wanderer
Join Date: Jan 2010
Posts: 22
Thanks: 2
|
Java Text Countdown - Weekly Loop
Hello,
I need help with a little project. I have a 3 hour radio show every week on a New Zealand Radio station (95bFM if anyone's interested). And I want to have a text countdown on my Blogspot http://askew.tv
I want it to countdown to 1am on Thursday morning each week. But, I want it to display 'On Air, click here to stream the show live' between 1am and 3am on Thursday morning.
Is this possible?
Cheers,
Dave
|
|
|
|
03-24-2010, 04:36 AM
|
#2 (permalink)
|
|
is cute and cuddly
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
|
Sure is, check out this javascript for a great starting place. From there you could easily engineer a php script to automatically update the supplied date everytime a show ended.
|
|
|
|
03-25-2010, 02:13 AM
|
#3 (permalink)
|
|
The Wanderer
Join Date: Jan 2010
Posts: 22
Thanks: 2
|
Thanks for the tutorial. I am really new to Java, I'm much better at PHP than Java so I'm going to need some help with this one I'm afraid.
Can anyone change the code in the tutorial above to the spec at the top of this thread?
Any help on this would be very much appreciated 
|
|
|
|
03-25-2010, 06:03 AM
|
#4 (permalink)
|
|
is cute and cuddly
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
|
Thanks to date() and strototime() you hardly have to do any work at all. :)
php Code:
if ( date( 'w' ) != 4 ) { $thursday = strtotime( 'next Thursday 1am' ); }else { if ( date( 'G' ) < 5 ) { $thursday = strtotime( 'today 1am' ); } else { $thursday = strtotime( 'next Thursday 1am' ); }}$thursday = date( 'F j, Y G:i:a', $thursday );
Now forget about the one I linked to above, it only works for dates, not specific times. I found this one that will serve your purpose better. The instructions on the page should be more than adequate for getting it installed. In step two, where it says new cdtime( ... simply replace the date they are using with
and you'll be golden. After that it's just a matter of implementing your own styles.
|
|
|
|
03-25-2010, 08:50 AM
|
#5 (permalink)
|
|
The Wanderer
Join Date: Jan 2010
Posts: 22
Thanks: 2
|
Thanks delayedinsanity, but because I'm using Blogspot, I can't use PHP unfortunately. Otherwise, that would be a really neat solution. Also, I really want a Java dynamic countdown that ticks down the seconds until the show. Is their a way of getting a Java countdown in this format:
3 days, 7 hours, 23 minutes, 17 seconds
that changes without having to reload the page? And then for the three hours that the show is on, I want it to read:
On Air: Click here to stream the show live
And then after the three hour show can it reset itself so it counts down to the show the week after? eg. 6 days, 20 hours, 59 minutes, 59 seconds
|
|
|
|
03-25-2010, 04:44 PM
|
#6 (permalink)
|
|
is cute and cuddly
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
|
You could always ditch blogspot. That's my first suggestion to anybody who uses blogspot, regardless of the underlying question. :D
You never mentioned that originally... yes you did, I just didn't see it.
And then to top it off, I've just been a bag full of forget the past couple days on here. This is the script I was referring to in the above post but never actually linked to. It will do what you want, you just have to change the styles to match your needs, and you will have to manually update the next show time every week.
|
|
|
|
03-25-2010, 11:12 PM
|
#7 (permalink)
|
|
The Wanderer
Join Date: Jan 2010
Posts: 22
Thanks: 2
|
Thanks delayedinsanity,
I though you had forgotten the link, in your previous post. Ah well, easy mistake. That tutorial is excellent, I'm getting a lot closer now.
That tutorial displays 2 countdown, one is for a single date and once that date has past it displays a message. The second is a countdown for christmas and it manages to loop every year. So once it reaches midnight on Christmas eve, it resets and starts counting down to next christmas.
I think that is this bit:
Code:
var currentyear=new Date().getFullYear()
//dynamically get this Christmas' year value. If Christmas already passed, then year=current year+1
var thischristmasyear=(new Date().getMonth()>=11 && new Date().getDate()>25)? currentyear+1 : currentyear
var christmas=new cdtime("countdowncontainer2", "December 25, "+thischristmasyear+" 0:0:00")
christmas.displaycountdown("days", formatresults2)
So is there a way of combining these two so that the countdown loops every 7 days (similar to countdown2 in the tutorial), but pauses for 3 hours once it hits zero and displays a message (closer to the behavior of countdown1 in the tutorial).
If not, I can always use countdown1 and reset the date each week like you said.
|
|
|
|
03-25-2010, 11:24 PM
|
#8 (permalink)
|
|
The Wanderer
Join Date: Jan 2010
Posts: 22
Thanks: 2
|
Ah crap, I just spotted another problem. It uses the date set on the users computer. This is a problem because I've got listeners in New Zealand and the UK so perhaps the simplest solution is to have 2 countdowns:
In New Zealand
3 days, 1 hours, 12 minutes, 30 seconds
In the UK
2 days, 12 hours, 12 minutes, 30 seconds
Unless there is a way to do this server side? A messy solution would be to guess at what country the user is in and then display the date for that country.
|
|
|
|
03-27-2010, 07:14 AM
|
#9 (permalink)
|
|
The Wanderer
Join Date: Jan 2010
Posts: 22
Thanks: 2
|
I'm having trouble using the previous script in BlogSpot. It won't let me put the script in to the head of the page. Is their a way of using java to do this countdown without putting anything in the head of the page?
|
|
|
|
03-27-2010, 06:19 PM
|
#10 (permalink)
|
|
is cute and cuddly
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
|
Scripts don't necessarily have to go in the head to work. Try placing it at the bottom of your page before the closing BODY element would be. See if that works for you, and then strongly consider bailing on blogspot for a self hosted solution. :D I'm strongly biased against blogspot, so I probably won't stop suggesting this, but honestly, for less than $10 a month (sometimes as little as $3-4) you can have complete control over these kind of things.
|
|
|
|
03-27-2010, 11:30 PM
|
#11 (permalink)
|
|
The Wanderer
Join Date: Jan 2010
Posts: 22
Thanks: 2
|
Thanks. Yeah, I know having your own site gives a lot more freedom but it's also a lot more work. Especially when it comes to RSS feeds and the ability to allow users to leave comments. I had my own .co.uk site last year and I couldn't do a lot of the stuff BlogSpot does automatically.
I have got the countdown on my site now http://imaskew.blogspot.com
Thanks for all the help.
|
|
|
|
03-27-2010, 11:44 PM
|
#12 (permalink)
|
|
is cute and cuddly
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
|
WordPress.org makes blogspot look like a pager next to a smartphone. Glad it's working though!
|
|
|
|
10-18-2012, 01:23 PM
|
#13 (permalink)
|
|
The Addict
Join Date: Oct 2012
Posts: 244
Thanks: 0
|
Some conservatives have Coach Factory Outlet pushed that critique further, saying that Mr. Obama’s policies are too costly, often assist the wrong people Louis Vuitton Belts and could have the paradoxical effect of driving up college costs. The dispute turns not just on different Coach Factory Outlet assessments of how policies play out, but on differing philosophical views about the role of government. During Gucci Belts his time in office, Mr. Obama has sharply increased aid to low- and middle-income students, notably through the Pell Grant Coach Factory Outlet program, which grew from $14.6 billion given to 6 million students in 2008, to nearly $40 billion for Coach Factory Outlet almost 10 million students this year. His administration also made it easier to request aid, shortening the Coach Factory Online complex federal application and allowing people to transfer their financial information electronically from the Internal Coach Outlet Online Revenue Service database. But while many education experts laud his efforts, analysts of varying political Coach Outlet Online stripes have also questioned how much impact some of the president’s policies will have, noting that the prices Coach Online Outlet charged by colleges, and student borrowing, continue to climb.But behind the headlines about soaring costs, the Coach Factory Outlet Online reality is more complex and wildly uneven, because a growing number of students receive Coach Outlet Online financial aid, and only relatively high-income families pay those fast-rising sticker prices. Adjusted for Coach Factory Online inflation, the College Board calculates, the average net price changed little over the last decade at private Coach Factory Outlet schools, and rose only modestly at public ones.Defending federal spending, Arne Duncan, the secretary of Hermes Belts education, said that for more than 30 years, college prices had risen even when federal aid had not, leading him to believe Coach Factory Online there was zero correlation.
|
|
|
|
10-22-2012, 09:30 AM
|
#14 (permalink)
|
|
The Addict
Join Date: Oct 2012
Posts: 244
Thanks: 0
|
Coach Outlet
You’ve relatively Coach Outlet recently arrived in New Delhi after living in two of Asia’s other great cities, Coach Outlet Store Online Tokyo and Hong Kong, for several years. Do these cities feel like they’re part of the same continent? Yes, and no. In terms Coach Factory Onlineof infrastructure, they couldn’t be more different. Getting regular Coach Outlet power and water at my house in New Delhi is never a sure thing, even though Coach Purse Outlet OnlineI’m paying the same rent that I paid in Tokyo and almost the same electricity prices. Both Hong Kong and Tokyo are also crowded places, Coach Factory Outlet Online but both cities are incredibly well planned and efficiently run. Efficient is not a word I would use to describe my Coach Bags Outlet Onlineday-to-day life in New Delhi. On the other hand, one thing that I think Hong Kong and New Delhi have in common is Coach Handbags Outlet a shared sense of optimism — a feeling that the best is yet to come. That’s definitely not the feeling you get in Tokyo, Coach Outlet Online or in the U.S. when I go home. It’s a big part of what I find addictive about living and working in this part of the world. You feel like you’re watching the future unfold.
|
|
|
|
01-29-2013, 12:57 PM
|
#15 (permalink)
|
|
The Addict
Join Date: Oct 2012
Posts: 244
Thanks: 0
|
Organizers said Coach Outlet Online was opportune because the battle’s 150-year anniversary is in December, and Fredericksburg Coach Factory Outlet has been preparing to mark the sesquicentennial. in the new agreement is that Coach Outlet Online revolutionary councils from 14 Syrian provinces now each have a representative, though not all live Coach Online Outlet in Syria. The hope is that will bind the coalition to those inside the country. Perhaps Coach Bags Outlet the most important body the new group is expected to form is a Revolutionary Military Council Coach Factory Online to oversee the splintered fighting organizations and to funnel both lethal and nonlethal Coach Factory Outlet military aid to the rebels. It should unite units of the Free Syrian Army, various militias Coach Outlet Store Online and brigades in each city and large groups of defectors. Before the ink was even dry on the Coach Outlet Store final draft, negotiators hoped that it would bring them the antiaircraft missiles they crave to Coach Factory Stores take on the Syrian Air Force. The United States and Britain have offered only Coach Handbags Outlet nonmilitary aid to the uprising. A similar attempt by the Syrian National Council to Coach Factory Store supervise the military never jelled. Organizers said funding was too haphazard. Eventually foreign Coach Factory Online governments like Qatar and Saudi Arabia, which are financing and arming the rebels, found Coach Factory Online their own favorite factions to deal with. Foreign leaders notably including Secretary of State Coach Outlet Hillary Rodham Clinton urged this unification largely so they could coordinate their Coach Factory Outlet efforts and aid through a group of technocrats. Once it receives international recognition, the Coach Outlet Store Online coalition is supposed to establish a temporary Coach Outlet Online military never jelled.
|
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| PDF Creation - Help! |
Sam Granger |
General |
7 |
10-31-2007 11:32 AM |
|