View Full Version : Countdown Clocks!
TheNiceVoice
01-17-2004, 07:36 PM
Greetings!
I am interested in implementing the option for users to add a customizable countdown clock to their signature. I've seen another vbulletin where they allowed users to customize these clocks in the user CP.
Anyone gotta hack?
Thanks in advance!
SloppyGoat
01-17-2004, 08:39 PM
Here ya go. ;) You might have to play with this. I've never tried it, but a friend of mine has it working on his board.
TheNiceVoice
01-17-2004, 08:43 PM
WOW!!!!!
THAT WAS FAST!
Thank you SO much!!! :up:
SloppyGoat
01-17-2004, 09:55 PM
I just hope you can get it to work. I tried, out of curiosity, and it just tells me my ship has sailed, no matter what I do. :ermm: There was a mistake in the usage format. Remove the slash....
/countdown.php?month=xx&year=xxxx&day=xx&hour=xx&min=xx&sec=xx
Something like that....
SloppyGoat
01-18-2004, 09:20 PM
Can any of you PHP gurus help with this? It's probably something simple I'm missing. Not that I need it, but now I'm curious, since I couldn't get it to work right on my test server. I know for a fact this countdown works. I'd give you a link to the site using it, but I'm afraid people would start using it from their server, which they wouldn't appreciate.
KW802
08-12-2004, 05:20 PM
To get this working....
Change... //Requires GD.
//Use this format, or similar....
//countdown.php?month=xx&year=xxxx&day=xx&hour=xx&min=xx&sec=xx
<?phpto... <?php
//Requires GD.
//Use this format, or similar....
//countdown.php?month=xx&year=xxxx&day=xx&hour=xx&min=xx&sec=xx... and then try something like the following....http://www.yourdomain.com/countdown.php?month=11&year=2004&day=06&hour=15&min=00&sec=00
vadim77777
08-20-2004, 08:11 PM
Hello
What exactly user should put on their signature to make it work?
Musicpill
08-20-2004, 11:52 PM
i doubt this would work in signatures because you need to enable PHP in signatures (thinks)
Or if you enables PHP in sigs, that would be easier, but its more risky.
SVTBlackLight01
08-21-2004, 12:18 AM
Hello
What exactly user should put on their signature to make it work?
It would be a little complicated but you could do this with a php include and a few custom profile fields.
58sniper
08-21-2004, 01:44 PM
It would be a little complicated but you could do this with a php include and a few custom profile fields.
Enable PHP in signatures? Not needed. Insert an image, and paste the URL to the php page (http://www.yourdomain.com/countdown.php?month=11&year=2004&day=06&hour=15&min=00&sec=00) as the image source. That works for me.
ashley53680
09-20-2004, 09:32 PM
Anyone know how you could get this customized for each user?
Symbian.info
09-20-2004, 11:14 PM
Great!! but how can I remove the border?
Thanks
LadyBeth
10-09-2005, 02:28 PM
Can this clock be added so it is in the user profile and when they fill it out, the countdown shows up for the event in their user postbit in threads? I have seen this work on another bbs and love it..I need this one....
Beth
aciurczak
10-28-2005, 01:49 AM
Both versions working fine in 3.0.9; not tested in 3.5.0 yet.
I've got it loaded, I am calling it correctly, and when I go to a URL with the date fields, it works fine in the browser.
But when I put it in the IMG tags on my site (whether in a sig or in a regular post), all it shows is the link. When I click on the link, it opens a browser window with the correct counter. Here's an example below; it's between correct IMG tags, yet it just shows as a link. If you click on it, it should show a counter 'til the end of the year. Any suggestions?
EIDT: Fixed. If it helps anyone else, you need to enable the Dynamic Links for IMG tags in the admincp.
EDIT #2: Managed to turn Dynamic Links for IMG tags back off for security, and just created a new custom BBCode specifically for these countdowns.
Create a new code, make the replacement: <img src="http://www.yourforumname.com/countdown.php?{param}" /></a>
then to call it you just put the parameters you want in between the new tags.
Can this clock be added so it is in the user profile and when they fill it out, the countdown shows up for the event in their user postbit in threads? I have seen this work on another bbs and love it..I need this one....
Beth
I have this working. Add a new profile field. Edit your postbit template to include something like this:
<if condition="$post['field37']">
<img src="http://www.yourforum.com/pathto/countdown.php?$post[field37]" /></a>
</if>
Then in that user profile field, the entry should look something like this:
month=1&day=01&year=2006
It's somewhat clunky to ask users to enter in code like that in the field, and I'm sure there's a slicker way for someone to pull that information from pull-down menus and such; but you get the concept.
__________________________________________________ _________
I wasn't happy with the GD image way to do this, as the countdown was not live (i.e. it did not count down seconds), and you couldn't format the text easily using BBCode. I had found a great countdown script online, but it only worked for the first instance on a page, unless you called it with a different variable each time (impossible if it is put into a signature, for example). So I coded up a small helper script that found the next free variable, then called the main countdown script, and now everything works perfectly.
example: click here (http://www.montgomerybikers.com/forums/showthread.php?t=1635)
Here's what's necessary to get this working. First, download the countdown script from: http://andrewu.co.uk/clj/countdown/
Normal script is called countdown.js, the readable version is countdown_expanded.js in case you want to read through the code.
You need my small helper script, attached to this post, called countdownhelp.js.txt (remove the .txt when you upload it).
Upload them both to the same directory. I use the clientscript directory that's already in vbulletin. Then you need to edit the header include template to call these two scripts. Insert this code pretty much anywhere within that template:
<script type="text/javascript" src="clientscript/countdownhelp.js"></script>
<script type="text/javascript" src="clientscript/countdown.js" defer="defer"></script>
And finally, you need to add 1 custom BBCode for your users to use. Go into BBCode manager, choose add new code, call the tag countdown. Make the replacement:
<script type="text/javascript">
var countdownnum = getcountdownnum();
document.write("<span id=" + countdownnum + ">{param} UTC-0800</span>");
</script>
The UTC-0800 is optional, you can leave it out if you don't want to specify a timezone, but then it relies on the user's web browser dealing with it correctly. There's more info on the UTC parameter on Andrew's page.
If this is set up, then all users need to do to insert a countdown anywhere is use the following BBCode:
1 Jan 2006 22:57:27
Users can put any normal BBCode formatting tags around this tag, and the countdown will be formatted correctly, just like any other normal text. Good luck...
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.