vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   [RELEASE vB 2.0.3] Countdown To Calendar Events (https://vborg.vbsupport.ru/showthread.php?t=29500)

mister 10-03-2001 09: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
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
Quote:

<tr>
<td bgcolor="$altcolor"><a href="calendar.php?s=&action=getinfo&eventid=$even t[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


Quote:

{ 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=n o,location=no,menubar=no,scrollbars=no,width=175,h eight=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 03:20 AM

Nice, but I had to replace {nav_joiner} with >

Thanks! :)

mister 10-04-2001 03: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 03: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 04: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:

PHP Code:

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:

PHP Code:

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

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

(FYI)

mister 10-04-2001 10:53 AM

Quote:

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

<table cellpadding=4 cellspacing=1 border=0 bgcolor="{ tablebordercolor }" width="90%">
and change the 90 to something whatever you want.

YourHostSucks 10-04-2001 12: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 12:27 PM

Great hack. What happens if you have like hundreds of events, will it span pages?

mister 10-04-2001 04:10 PM

Quote:

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 08:35 PM

this would be great for small boards and user birth-days

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


All times are GMT. The time now is 02:59 AM.

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.01581 seconds
  • Memory Usage 1,746KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete