EzPortal - Portal Software for Forums

EzPortal - Made to Fit Your SMF Forum - Glad You Found Us!

Advertise Here +- +-

UserBox

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Recent Posts

ezPortal 7.0 Released! by EzPortal
February 23, 2026, 08:35:20 pm

ezPortal 6.5 Released! by EzPortal
January 18, 2026, 02:46:30 pm

ezPortal 6.0 released! by EzPortal
July 10, 2025, 10:50:58 pm

Re: TinyMCE Editor disapears by ezxenova
May 06, 2025, 07:38:09 am

Re: TinyMCE Editor disapears by DenDen66
March 02, 2025, 06:59:40 am

Re: TinyMCE Editor disapears by DenDen66
February 28, 2025, 08:09:43 am

Re: TinyMCE Editor disapears by DenDen66
February 28, 2025, 07:31:29 am

Re: TinyMCE Editor disapears by EzPortal
February 27, 2025, 06:57:30 pm

+- HTML Menu


Sample HTML Block Usage - You May Custom Code it, as needed!

Recent Topics ezBlock

ezPortal 7.0 Released! by EzPortal
February 23, 2026, 08:35:20 pm

ezPortal 6.5 Released! by EzPortal
January 18, 2026, 02:46:30 pm

ezPortal 6.0 released! by EzPortal
July 10, 2025, 10:50:58 pm

TinyMCE Editor disapears by ezxenova
May 06, 2025, 07:38:09 am

Renaming a page by DenDen66
February 23, 2025, 10:51:22 am

Styling ezBlock by EzPortal
February 19, 2025, 09:15:05 pm

I don't remember how to upgrade by EzPortal
February 05, 2025, 08:44:58 am

ezPortal 5.6 release by EzPortal
January 31, 2025, 11:21:34 am

5.5.4 by EzPortal
January 16, 2025, 08:31:41 pm

Moving a block higher in list by UkuleleMan
December 17, 2024, 07:58:27 am

Author Topic: Countdown Counter  (Read 17000 times)

0 Members and 1 Guest are viewing this topic.

Countdown Counter
« on: »
I am trying ti find a countdown tracker without much luck.   Any help is appreciated

I have tried these two php examples but they generate an error.

Code: [Select]
<?php$target = mktime(8, 0, 0, 6, 26, 2013) ;$today = time () ;$difference =($target-$today) ;$days =(int) ($difference/86400) ;print "Big Brother 15 is in $days days";?>


=========================

<? /*
   declare target date; source: http://us.imdb.com/ReleaseDates?0121766 ;
  */
  $day   = 26;     // Day of the countdown
  $month = 6;      // Month of the countdown
  $year  = 2013;   // Year of the countdown
  $hour  = 20;     // Hour of the day (east coast time)
  $event = "Big Brother 15"; //event

  $calculation = ((mktime ($hour,0,0,$month,$day,$year) - time(void))/3600);
  $hours = (int)$calculation;
  $days  = (int)($hours/24);
/*
  mktime() http://www.php.net/manual/en/function.mktime.php
  time()   http://www.php.net/manual/en/function.time.php
  (int)    http://www.php.net/manual/en/language.types.integer.php
*/
?>
<ul>
<li>The date is <?=(date ("l, jS \of F Y g:i:s A"));?>.</li>
<li>It is <?=$days?> days until <?=$event?>.</li>
<li>It is <?=$hours?> hours until <?=$event?>.</li>
</ul>   

Re: Countdown Counter
« Reply #1 on: »
If you use a php block just enter this code
Code: [Select]
$target = mktime(8, 0, 0, 6, 26, 2013) ;
$today = time () ;
$difference =($target-$today) ;
$days =(int) ($difference/86400) ;
print "Big Brother 15 is in $days days";
Like ezPortal? Support me at https://www.patreon.com/vbgamer45/

 

Related Topics

  Subject / Started by Replies Last post
0 Replies
8284 Views
Last post September 17, 2011, 08:24:02 am
by Bakdoi

+-SMF Gallery

Quick Menu


Powered by EzPortal