Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Countdown hack Details »»
Countdown hack
Version: 1.00, by Kentaurus Kentaurus is offline
Developer Last Online: Jul 2014 Show Printable Version Email this Page

Category: New Posting Features - Version: 3.6.4 Rating:
Released: 12-30-2006 Last Update: Never Installs: 43
 
No support by the author.

Just in time for new year in my forums

Tested with vb3.6.4

Description
---------------------------------------------------------------------
This is a countdown hack, a user enters a simple bbcode tag in any post and a counter starts, supported inside a post, for example:

[countdown=Apocalypsis]30s[/countdown]


The text that would appear is:
"Apocalypsis is in 30 seconds"
(or 29, 28, seconds... depending on the time that you load the post)

When the counter expires then..
"The counter to Apocalypsis has expired"
will be shown. This phrases are editable.

The counter is live, any time the user refreshes the page the counter is updated. (screenshots below)

The following syntax is supported

[countdown=EVENT]1d23h59m59s[/countdown]

That is, EVENT for the event name
then any combination of a number, followed by a "d", for days
a number, followed by an "h", for hours
a number, followed by an "m", for minutes
a number, followed by a "s", for seconds

The order is important, seconds cannot appear before days. You can only include hours and minutes, or days and minutes... or only days. Any combination as long as the order is correct.


How does it work?
---------------------------------------------------------------------


The post's dateline is taken as the date baseline to calculate the time difference, this means that if you edit the post and change the counter, it will always start from the date that the post was published. If you hover over the counter a popup will show when the counter started.

Installation instructions
---------------------------------------------------------------------

1. Login to your admin control panel
2. Go to "Plugins & Products" -> "Manage products"
3. Click on "Add/Import product"
4. Browse for "product-cz_countdown.xml" (included in the zip file), and click "Import"

That's it. You can start using [countdown] bbcode tags in any post


Info for hackers:
---------------------------------------------------------------------
You may modify, improve, upgrade, redistribute this hack, include it
in another hack or yours or translate it provided you do it free of
charge and you distribute it in www.vbulletin.org at least, there is no
need to pm me asking for permission
Some portions of the code are (c) Jelsoft Enterprises Ltd.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 12-31-2006, 07:05 PM
Shazz's Avatar
Shazz Shazz is offline
 
Join Date: Jun 2006
Location: Utah
Posts: 4,758
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Could it be somehow worked into ajax?
Nice mod though
Reply With Quote
  #3  
Old 12-31-2006, 07:06 PM
UltimateOreo! UltimateOreo! is offline
 
Join Date: Nov 2006
Location: Missouri
Posts: 462
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No offense, but if its not ajax, its not really worth installing. This will DEFINATELY be an install if it gets implemented with AJAX. Actually, I think it is, because it has seconds, although, you could make it simpler instead of having users enter a syntax.
Edit- I think the syntax is pretty explainable, just not very professionally done. Make the bb code with the syntax?
Reply With Quote
  #4  
Old 12-31-2006, 08:21 PM
projectego's Avatar
projectego projectego is offline
 
Join Date: Feb 2006
Location: UK
Posts: 724
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This hack has a lot of potential, but I agree with the previous two posters.
Reply With Quote
  #5  
Old 12-31-2006, 08:44 PM
COBRAws's Avatar
COBRAws COBRAws is offline
 
Join Date: Oct 2002
Location: Buenos Aires
Posts: 864
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by UltimateOreo! View Post
No offense, but if its not ajax, its not really worth installing. This will DEFINATELY be an install if it gets implemented with AJAX. Actually, I think it is, because it has seconds, although, you could make it simpler instead of having users enter a syntax.
same thing
Reply With Quote
  #6  
Old 12-31-2006, 08:51 PM
Cornie Cornie is offline
 
Join Date: Mar 2006
Location: Berlin
Posts: 120
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the month in this hack is with 30 day´s ???????????????
Reply With Quote
  #7  
Old 12-31-2006, 09:19 PM
Kentaurus's Avatar
Kentaurus Kentaurus is offline
 
Join Date: Dec 2001
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by UltimateOreo! View Post
No offense, but if its not ajax, its not really worth installing. This will DEFINATELY be an install if it gets implemented with AJAX. Actually, I think it is, because it has seconds, although, you could make it simpler instead of having users enter a syntax.
not really.... it was what I needed, and it was what I installed in my forums It's what my members needed. It was worth writing and worth installing for me.

Any suggestions about how the syntax could be easier are welcome. I wanted to attain a flexible to use syntax, yet powerful. I don't find difficult to remember h for hours, m for minutes, s for seconds...... An alternative I ran into was something like giving a fixed date, but that is more complicated and ended up in having the people to make calculations by hand.

I certainly don't see how someone can add AJAX to this hack, for me, it's a strain to the server, and completely unnecessary.

If the behaviour that you want is a live counter, that decreases second by second without reloading the page, that can be done with a very simple javascript client-side (that I may do if my users ask for it). WITHOUT going to the server side for it, ajax is not for everything.

I will simply not do a request to my server every second just to let the server do the parsing for updating a counter. I'd need something more elaborated to justify using ajax for this. I only see ajax added to this hack to check if the user edited the counter and update it afterwards... I don't see anything else changing server side.

Thanks for the comments everyone. Yes, the month is considered 30 days. But that's only for counters greater than 30 days.
Reply With Quote
  #8  
Old 01-01-2007, 12:42 AM
smoknz28's Avatar
smoknz28 smoknz28 is offline
 
Join Date: Sep 2005
Location: SoCal
Posts: 257
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Mmmm, guess I'm not fully understanding how to get this to work....as I keep getting "The counter has expired".

I put in 500s

[countdown=Whatever]500s[/countdown]
Reply With Quote
  #9  
Old 01-01-2007, 03:00 AM
UltimateOreo! UltimateOreo! is offline
 
Join Date: Nov 2006
Location: Missouri
Posts: 462
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As said before, add the sytnax with the BB code, it will help a lot of users. And just to let you know, other then the syntax, you did a wonderful job.*installs.

Also, could you add a postbit for it?

Ill make an attempt at it, but im usually bad with the postbit
Reply With Quote
  #10  
Old 01-01-2007, 06:30 AM
Kentaurus's Avatar
Kentaurus Kentaurus is offline
 
Join Date: Dec 2001
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by smoknz28 View Post
Mmmm, guess I'm not fully understanding how to get this to work....as I keep getting "The counter has expired".

I put in 500s

[countdown=Whatever]500s[/countdown]
Um... guess I didn't think about it. It only supports up to 99 seconds.
You can always type 8m20s, though

I'll get that fixed to support any number of seconds/minutes/hours
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 02:18 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06854 seconds
  • Memory Usage 2,297KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete