Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 09-20-2004, 09:32 PM
ashley53680 ashley53680 is offline
 
Join Date: Dec 2003
Posts: 124
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone know how you could get this customized for each user?
Reply With Quote
  #12  
Old 09-20-2004, 11:14 PM
Symbian.info Symbian.info is offline
 
Join Date: Nov 2001
Location: Netherlands
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great!! but how can I remove the border?
Thanks
Reply With Quote
  #13  
Old 10-09-2005, 02:28 PM
LadyBeth LadyBeth is offline
 
Join Date: Jun 2003
Location: East Coast
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #14  
Old 10-28-2005, 01:49 AM
aciurczak aciurczak is offline
 
Join Date: Jun 2005
Posts: 154
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
Code:
<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.

Quote:
Originally Posted by LadyBeth
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:

Code:
<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:

Code:
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

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:

Code:
<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:

Code:
<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:

Code:
[countdown]1 Jan 2006 22:57:27[/countdown]
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...
Attached Files
File Type: txt countdownhelp.js.txt (552 Bytes, 34 views)
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 06:40 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08985 seconds
  • Memory Usage 2,220KB
  • Queries Executed 14 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (6)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (1)postbit_attachment
  • (4)postbit_onlinestatus
  • (4)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_postinfo_query
  • fetch_postinfo
  • 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
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete