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

  #46  
Old 15 Mar 2004, 11:03
mismatch mismatch is offline
 
Join Date: Apr 2003
hi I love this hack and got it set up with no probs whatsoever a few weeks ago.
My members are well chuffed with it too - however my hosting comapny aren't - it isn't just the countdown my members use massive signatures for no apparent nor sensible reason

It has increased my bandwidth and the more members that have the countdown the more bandwidth that gets eaten up - some of them aren't satisfied with one countdown they have to have 2 or 3!!

someone mentioned earlier in the thread about moving it into a showthread instead of header template - is this easy? would it solve the problem? what other files/templates etc... would I need to change? Do i just drop the js that is in the header into showthread in the admin panel and what about new reply does this need attention too?

can you give me some more info on this please I love the countdown and really want to keep it but as my hosting company suspended my account due to using 10gb (how??) I need to start addressing some of these bandwidth munching monsters on my site.

Also does anyone know how I can restrict signatures to x characters? It is nay on impossible reading some posts now due to stupidly long signatures.

I have verbally requested a restriction but this of course is ignored!

TIA
Reply With Quote
  #47  
Old 16 Mar 2004, 11:12
mismatch mismatch is offline
 
Join Date: Apr 2003
I think this is too old a thread for a reply I'll give it a go myself and let you know if I destroy my board in the process

________________

....no I don't trust myself after peering into the files I shall have to remove the hack for a day to see if it is the bandwidth culprit - my members will be gutted if they lose it altogether :ermm:

Last edited by mismatch; 16 Mar 2004 at 12:30.
Reply With Quote
  #48  
Old 14 May 2004, 02:28
ryancooper's Avatar
ryancooper ryancooper is offline
 
Join Date: Jul 2002
Anychance we can get this for VB3?
Reply With Quote
  #49  
Old 14 May 2004, 08:09
mismatch mismatch is offline
 
Join Date: Apr 2003
seriously I wouldn't bother unless it is out of the header_inc my site isn't huge (80,000) posts although a fair few attachments but it has used 20gb bandwidth so far this month and it isn't over yet. My hosting bill more than doubled when I put this hack on.

VB3 has the event reminder system built into the calendar - I am hoping for a countdown from calendar event that could maybe be displayed in profiles for example....does that sound do-able anyone??
Reply With Quote
  #50  
Old 15 May 2004, 12:58
subu1 subu1 is offline
 
Join Date: Sep 2002
cool Hack, click install thxxx, but *g*

i have a problem.

it happen can I that as Threadstarter a field empty would have (Countdown mode)?????

if I goes answer it however, only as Threadstarter have I often problem.

greetz subu1
Reply With Quote
  #51  
Old 22 Jun 2004, 19:45
Stu's Avatar
Stu Stu is offline
 
Join Date: Aug 2002
Originally Posted by ryancooper
Anychance we can get this for VB3?
This works for vB3 as it is
Reply With Quote
  #52  
Old 07 Jul 2004, 20:03
DWard's Avatar
DWard DWard is offline
 
Join Date: Mar 2004
Real name: Dan Ward
OK, the script worked once for me, then never again. I have put the code at the bottom of my header_include and also tried with the code at the top of the body tag, however it shows the text and a blank white box below, what do I do, this is the code it outputs:

<Script language='Javascript'>
var rndNum = Math.floor(Math.random() * 10000);
var tempString="May 4, 2005;Currently At WDW Now;BLUE";
tempArray=explodeArray(tempString,";");
document.writeln("<form name='form" + rndNum + "' action='javascript<b></b>:void(0);'>");
document.writeln('<font size=2 color="'+tempArray[2]+'">My Countdown to Disney World</font><BR>');
document.writeln("<input type=text value='' size=40 name='countdown'>");
document.writeln("</form>");
countdown(tempArray[0], rndNum, tempArray[1]);
</script>
Reply With Quote
  #53  
Old 23 Feb 2005, 02:24
TruckMuddr TruckMuddr is offline
 
Join Date: Sep 2004
Umm, is there a way to add years also???? when you get like 2450 days, it looks alittle weird.
Reply With Quote
  #54  
Old 19 Mar 2005, 15:51
rex_b rex_b is offline
 
Join Date: Jul 2004
This works for 3.0.7 Kevin you may want to rerelease as such.
Reply With Quote
  #55  
Old 14 Dec 2007, 19:41
Mum Mum is offline
 
Join Date: Jun 2006
Real name: Kirsty
Could anyone in the know tell me if i could use this for current vB, as i really want this BBcode, but not sure if it's completely different now?
__________________
Mummybrain.com We're virtually family
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 14:37.

Layout Options | Width: Wide Color: