The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
New vBCode Tags: [Countdown] and [Countup] timers for users Details »» | |||||||||||||||||||||||||||
New vBCode Tags: [Countdown] and [Countup] timers for users
Developer Last Online: Feb 2003
Have you or any of your members ever had the need or desire to post a countdown or countup in a post?
Something that automatically shows the remaining days, hours, minutes and seconds of that upcoming Walt Disney World trip? Or want to show everyone how many days, hours, minutes and seconds that the user has gone without a cigarette, drink, sex? - LOL I came up with this one here. It basically gives your users two new vB Code Tags, [countdown] and [countup]. Now there is no need to worry that the user will mess up your threads with incorrect JavaScript. All they have to do is use these tags, just like most other tags. For counting down, they would just have to do the following: [countdown=May 21, 2002 12:32 PM EST;We are off to see Mickey Mouse;RED]My Walt Disney World Trip Begins in [/countdown] Same for counting up with just different text of course. I guess this would qualify as a hack as you do need to change one field in the database to store this. Luckily, it's in a very small table so it should not slow anything down in theory. Modify the database Modify the field bbcodereplacement in the bbcode table to increase the storage size. Change the field properties from varchar(200) to LONGTEXT. This is needed for the new vB Code replacement to follow. I used phpMyAdmin which is very easy to use for this change. Add new JavaScript Add the following JavaScript code to your Style under Head Insert preferrably at the bottom. Be sure to do this for every style that you defined in your database. PHP Code:
Using the Admin CP, add the following; vB Code tag ----------------------------------------------------- countdown vB Code replacement ----------------------------------------------------- PHP Code:
----------------------------------------------------- [countdown="May 4, 2002;Currently At WDW Now;BLUE"]My Countdown to Disney World[/countdown] vB Code explanation ----------------------------------------------------- Enter any text you would like to say to your members here. Use {option} ? ----------------------------------------------------- Select YES Add the [countup] tag next; vB Code tag ----------------------------------------------------- countup vB Code replacement ----------------------------------------------------- PHP Code:
----------------------------------------------------- [countup="May 4, 2002;Waiting for my last cigarette;RED"]Smokefree Days[/countup] vB Code explanation ----------------------------------------------------- Enter any text you would like to say to your members here. Use {option} ? ----------------------------------------------------- Select YES There are many variations that can be use here for how the text field looks. We can post suggestions here for everyone to share I can post a screenshot tomorrow if you would like. It's really just a text field containing the days, hours, minutes and seconds of the timers with the {param} text over it. Edit: Reformatting some of the text as the PHP blocks are very wide. Also fixed a case conversion that the PHP code tag is making in my post. Show Your Support
|
Comments |
#32
|
||||
|
||||
Ryan, get into your phpmyadmin, and click on your database. Find the bbcode listing and hit properties. Then you will see the listing for bbcodereplacement, click Change. Then, chang the Type to LONGTEXT in the dropdown box. Hit save, and you are done. That is it.
Mickey :bandit: |
#33
|
|||
|
|||
Thanks Mickey! Much Appreciated
|
#34
|
|||
|
|||
Is it possabel to make this work like a birthday box in the control panel?. Let the user pick the date and what it should say and then show the countdown in the sig!
I have no clue how to do this. . . |
#35
|
|||
|
|||
OK one more question,
everything seem t owork amazing But when I add it to my Sig, the message does not appear above the countdown http://www.talkdisney.com/forums/sho...&threadid=1821 Did I miss something? |
#36
|
|||
|
|||
I just checked that thread you posted and viewed it's source.
Looks like you missed a line in your vbcode replacement Here is the original code that I posted on page one: PHP Code:
PHP Code:
This code is for the countdown vbcode, not the countup vbcode. Since you have not tested that one in your thread, I'm not sure if that also has the same problem (if it has a problem). |
#37
|
|||
|
|||
BEAUTIFULL! Thanks!
|
#38
|
||||
|
||||
Wooo! Finally got it to work. I found out it REALLY DOESN'T LIKE PUNCTUATION!!!
So you can't put: [ countdown="May 10, 2003;The Big Three-O;BLUE" ]until my birthday![ /countdown ] anyway, it's awesome. Just what I was looking for. Jennifer Moss BabyNames.com http://www.babynames.com/boards/ |
#39
|
|||
|
|||
i cant get the countdown to work, but the count up works good, does any one know whats wrong?
[php] <Script language='Javascript'> var rndNum = Math.floor(Math.random() * 10000); var tempString="{option}"; tempArray=explodeArray(tempString,";"); document.writeln("<form name='form" + rndNum + "' action='java script:void(0);'>"); document.writeln('<font size=2 color="'+tempArray[2]+'">{param}</font><BR>'); document.writeln("<input type=text value='' size=40 name='countdown' border-style='none' style='background-color:transparent; border-bottom: 0px solid; border-left: 0px solid;border-right: 0px solid;border-top: 0px solid'>"); document.writeln("</form>"); countdown(tempArray[0], rndNum, tempArray[1]); </script> [php] |
#40
|
|||
|
|||
Slynderdale,
Can you post, or PM me, the website where you installed this? I can take a look and tell you why the countdown is not working. Also, double check the added code to the header. |
#41
|
|||
|
|||
hmm weird, i placed a count down under it and it worked
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|