Log in

View Full Version : [RELEASE vB 2.0.3] Countdown To Calendar Events


mister
10-03-2001, 10:00 PM
Title: Countdown To Calendar Events hack
Newest Release: 10.04.2001
Author: mister
What It Does: Counts down (to the day) to any public events in the calendar. plus any private events a user may have.
Screenshot: click here for screenshot (http://www.pubarso.com/misc/countdown_screenshot.jpg)
Download: see attached file (countdown1.zip)

Possible Future Enhancements:
span across page, in case of 100's of events
show only private events, only public events, or all
show countdown on actual calendar also



How To Install
1) upload countdown.php to your main forums directory
2) create two templates

countdown_bit

<tr>
<td bgcolor="$altcolor"><a href="calendar.php?s=&action=getinfo&eventid=$event[eventid]"><normalfont>$event[subject]</normalfont></a></td>
<td bgcolor="$altcolor" align="center"><normalfont>$event[eventdate]</normalfont></td>
<td bgcolor="$altcolor"><normalfont>$days_till</normalfont></td>
</tr>


countdown
note: all {} values have spaces in them so this forum doesnt parse them...
copy/paste from the included text file if you dont want to search for all the { blah } variables to change in this template


{ htmldoctype }
<html>
<head><title>$bbtitle - Countdowns</title>
$headinclude
<script language="javascript" type="text/javascript">
<!--
function aimwindow(aimid) {
window.open("member.php?s=$session[sessionhash]&action=aimmessage&aim="+aimid,"_blank","toolbar=no,location=no,menubar=no,scrollbars=no,wi dth=175,height=275,resizeable=yes,status=no")
}
// -->
</script>
</head>
<body>
$header

<table cellpadding="2" cellspacing="0" border="0" width="{ contenttablewidth }" { tableinvisibleextra } align="center">
<tr>
<td width="100%"><img src="{ imagesfolder }/vb_bullet.gif" alt="" border="0" align="absmiddle">
<normalfont><b><a href="index.php?s=$session[sessionhash]">$bbtitle</a> { nav_joiner } Countdowns</b></normalfont></td>
</tr>
</table>

<br>

<table cellpadding=4 cellspacing=1 border=0 bgcolor="{ tablebordercolor }" width="90%">

<tr>
<td bgcolor="{ tableheadbgcolor }"><normalfont><b>Event</b></normalfont></td>
<td bgcolor="{ tableheadbgcolor }" align="center"><normalfont><b>Date</b></normalfont></td>
<td bgcolor="{ tableheadbgcolor }"><normalfont><b>Countdown</b></normalfont></td>
</tr>

$countdown_bits

</table>

$footer
</body>
</html>



3) create a { nav_joiner } replacement variable. (or just edit that out of the template, and put your own in there... its up to you


4) Enjoy.

YourHostSucks
10-04-2001, 04:20 AM
Nice, but I had to replace {nav_joiner} with >

Thanks! :)

mister
10-04-2001, 04:29 AM
oh yea
ill put that in the instructions.

make a replacement variable { nav_joiner } .. or replace it with whatever..

thanks

YourHostSucks
10-04-2001, 04:44 AM
Also.. Is there a reason it does not span the whole page like normal. its only spans about 80-85%?

ex: http://forums.yourhostsucks.com/countdown.php

YourHostSucks
10-04-2001, 05:20 AM
One more thing... :)

You will need to edit online.php or it will look like:
Unknown Location: /countdown.php?

----------------------------------------------------------------------
Open online.php:

Around Line 200 you will see alot of "case" statements

Throw this in there somewhere:

case 'countdown':
$userinfo[where] = "Viewing the <a href='countdown.php?s=$session[sessionhash]'>Countdown</a>";
break;


Then around line 500 you will see more "case" statements

Throw this in there:

case 'countdown.php':
$userinfo[activity] = 'countdown';
break;


-------------------------------------------------------------------------------

(FYI)

mister
10-04-2001, 11:53 AM
Originally posted by YourHostSucks
Also.. Is there a reason it does not span the whole page like normal. its only spans about 80-85%?

ex: http://forums.yourhostsucks.com/countdown.php

i just it up like that

edit this line:
<table cellpadding=4 cellspacing=1 border=0 bgcolor="{ tablebordercolor }" width="90%">

and change the 90 to something whatever you want.

YourHostSucks
10-04-2001, 01:22 PM
Much better :)

Thanks!...
Now I just need the board to be more than a week old, and get some events happening...:p

Mark Hewitt
10-04-2001, 01:27 PM
Great hack. What happens if you have like hundreds of events, will it span pages?

mister
10-04-2001, 05:10 PM
Originally posted by Mark Hewitt
Great hack. What happens if you have like hundreds of events, will it span pages?

unfortunately, not yet.
maybe ill work this into future releases .. or someone can add that in and give us the code...

i dont need it just yet, so i didnt bother putting it in, but the thought did cross my mind
...

maverick1236
10-04-2001, 09:35 PM
this would be great for small boards and user birth-days

could u make it so b-days show up? :)

maverick1236
10-04-2001, 09:36 PM
where is this supposed to show up?
i dont see it anywhere lol

TheCaver
10-04-2001, 09:51 PM
I like this hack but I would like to add 1-3 of the closest events to the main forum index, maybe a new row above birthdays......this possible?

JC

maverick1236
10-04-2001, 10:27 PM
great idea thecaver!!

mister
10-05-2001, 05:07 AM
Originally posted by Maverick1236
where is this supposed to show up?
i dont see it anywhere lol


just load countdown.php in your browser.
put a link wherever you see fit (from main page, from header, from calendar, where-ever)

maverick1236
10-05-2001, 11:58 AM
what if i want it to actually show below birthdaybits? on forumhome?

Ruth
10-06-2001, 11:53 AM
thanks for the hack,

can this be used for the following purpose:

(1) users enter their graduation date in the registration form, for example in the form of [Fixed day - Fixed month - year selected from a drop down menu]

(2) show count down to graduation day in the user profiles.

(3) show the count down by seconds, like most java scripts.

nice hack

thanks :)

Cygnus
10-06-2001, 04:07 PM
Originally posted by Ruth
(3) show the count down by seconds, like most java scripts.

Exactly what I was gonna ask... I have a whole mess of freaks (myself included) who simply cannot wait for Thursday at 8:00pm and will want to know how many minutes and seconds they have to wait...

Cygnus

mister
10-07-2001, 10:27 PM
thanks for the hack,


You're welcome.


(1) users enter their graduation date in the registration form, for example in the form of [Fixed day - Fixed month - year selected from a drop down menu]

You'd have to do some coding in register.php to have it add that graduation date to the calendar. As of now, the countdown script grabs all dates from the calendar.


(2) show count down to graduation day in the user profiles.

if you got it to add the date to the calendar, i suppose this could be worked out...


(3) show the count down by seconds, like most java scripts.

The countdown script feeds off dates from teh calendar, which doesn't allow for hour/min/second ... so it would just countdown to midnight .. so I just rounded it to the nearest day.


-mister

mister
10-07-2001, 10:29 PM
Originally posted by TheCaver
I like this hack but I would like to add 1-3 of the closest events to the main forum index, maybe a new row above birthdays......this possible?


JC

possible? yes
i'll put it in this hack's next release -- which wont be out for quite some time, due to school projects that are piling up :)