Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
New vBCode Tags: [Countdown] and [Countup] timers for users Details »
New vBCode Tags: [Countdown] and [Countup] timers for users
Mod Version: 1.00, by KevinG (Member) KevinG is offline
Developer Last Online: Feb 2003 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 2.2.x Rating: (0 vote - 0 average) Installs: 13
Released: 03 May 2002 Last Update: Never Downloads: 2
Not Supported  

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.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Add the new vBCodes
Using the Admin CP, add the following;

vB Code tag
-----------------------------------------------------
countdown


vB Code replacement
-----------------------------------------------------

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

vB Code example
-----------------------------------------------------
[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
-----------------------------------------------------

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

vB Code example
-----------------------------------------------------
[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.

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
New vbcode.js - vBcode and smilie user interface improvement s.molinari vBulletin 2.x Full Releases 206 01 Feb 2004 21:44

  #31  
Old 21 May 2002, 05:11
Mr. Slugworth's Avatar
Mr. Slugworth Mr. Slugworth is offline
 
Join Date: Oct 2001
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:
Reply With Quote
  #32  
Old 21 May 2002, 21:57
rcooper7 rcooper7 is offline
 
Join Date: May 2002
Thanks Mickey! Much Appreciated
Reply With Quote
  #33  
Old 24 May 2002, 14:00
rcooper7 rcooper7 is offline
 
Join Date: May 2002
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. . .

Last edited by rcooper7; 24 May 2002 at 14:05.
Reply With Quote
  #34  
Old 24 May 2002, 14:11
rcooper7 rcooper7 is offline
 
Join Date: May 2002
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?
Reply With Quote
  #35  
Old 24 May 2002, 16:25
KevinG KevinG is offline
 
Join Date: Dec 2001
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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

The missed line is:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View 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).
Reply With Quote
  #36  
Old 24 May 2002, 22:12
rcooper7 rcooper7 is offline
 
Join Date: May 2002
BEAUTIFULL! Thanks!
Reply With Quote
  #37  
Old 07 Jun 2002, 07:39
jamoss's Avatar
jamoss jamoss is offline
 
Join Date: Apr 2002
Real name: Jennifer
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/
__________________
Jennifer M. - php developer since '98
Reply With Quote
  #38  
Old 07 Jun 2002, 08:43
Slynderdale Slynderdale is offline
 
Join Date: Mar 2002
Real name: John
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]
Attached Images
File Type: jpg counttest.jpg (15.9 KB, 42 views)
Reply With Quote
  #39  
Old 07 Jun 2002, 15:09
KevinG KevinG is offline
 
Join Date: Dec 2001
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.

Last edited by KevinG; 07 Jun 2002 at 15:12.
Reply With Quote
  #40  
Old 07 Jun 2002, 15:48
Slynderdale Slynderdale is offline
 
Join Date: Mar 2002
Real name: John
hmm weird, i placed a count down under it and it worked
Attached Images
File Type: jpg untitled.jpg (33.4 KB, 32 views)
Reply With Quote
  #41  
Old 20 Oct 2002, 20:14
isman isman is offline
 
Join Date: Nov 2001
Small Problem

I'm having trouble incorporating this with the Signature-Editor hack by Fryzid, link to sig editor.

I get java script errors and then can't use any of the buttons on the page.

Is anyone else using these together? Here's a link to my board where you can see first hand what the problem is. Go the edit your signature and then click "Preview Signature". You'll see none of the buttons work after that.

Link to my test board
Reply With Quote
  #42  
Old 22 Oct 2002, 04:27
isman isman is offline
 
Join Date: Nov 2001
This is the line I'm having trouble with but I don't see anything wrong.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Anyone see anything with this?
Reply With Quote
  #43  
Old 17 Nov 2002, 23:51
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Originally posted by isman
This is the line I'm having trouble with but I don't see anything wrong.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Anyone see anything with this?
It's the signature preview bits - remove the signature preview section of the code and you will be fine.
Reply With Quote
  #44  
Old 19 Mar 2003, 18:26
Buddha Buddha is offline
 
Join Date: Jan 2002
tried to install this, and followed the instructions all the way through the thread. got errors in IE, the bottom Post Reply didn't work, and the text didn't appear for the countdown or countup.

very disappointing, seeing as this would have been very useful.
Reply With Quote
  #45  
Old 10 Apr 2003, 17:51
InnerSelf InnerSelf is offline
 
Join Date: Jun 2002
is there a way to just implant this in your own startpage instead of in a post?

i would like to add it in my page without anyone can use it
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 11:18.

Layout Options | Width: Wide Color: