EzPortal - Portal Software for Forums

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

UserBox

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

+- Recent Posts

New built in translations for six langauges! by EzPortal
March 26, 2024, 11:15:32 pm

Smiley missing in shoutbox 2.1.4 by hustreamload
July 26, 2023, 08:14:02 am

Re: Theme Select Box question? by Shades
March 15, 2023, 06:49:49 pm

Re: Theme Select Box question? by Shades
March 09, 2023, 02:09:24 pm

Re: Theme Select Box question? by Shades
March 09, 2023, 01:55:53 pm

Re: Theme Select Box question? by EzPortal
March 09, 2023, 01:47:42 pm

Re: Theme Select Box question? by Shades
March 09, 2023, 01:34:07 pm

Re: Theme Select Box question? by EzPortal
March 09, 2023, 12:20:17 pm

+- HTML Menu


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

Recent Topics ezBlock

New built in translations for six langauges! by EzPortal
March 26, 2024, 11:15:32 pm

Smiley missing in shoutbox 2.1.4 by hustreamload
July 26, 2023, 08:14:02 am

Theme Select Box question? by Shades
March 15, 2023, 06:49:49 pm

Where is the facebook button color? by EzPortal
February 28, 2023, 06:45:09 pm

Display on Mobile - SMF 2.1.3 and EZ 5.5.2 by BugginIn
December 29, 2022, 04:07:13 pm

Blocks Help by Riggs1973
November 20, 2022, 12:59:30 pm

Surface ol lite theme release Free! by Steffen K.
November 18, 2022, 03:57:24 am

Undefined index: href by EzPortal
October 04, 2022, 08:49:59 pm

SMF-ezportal_column_5.cache): failed to open stream: No such file or directory by EzPortal
June 04, 2022, 11:40:13 am

Arcade block error: failed to open stream: No such file or directory by Shades
May 20, 2022, 02:47:13 pm

Author Topic: Countdown Counter  (Read 12978 times)

0 Members and 1 Guest are viewing this topic.

Offline charmerSC

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
Countdown Counter
« on: May 08, 2013, 04:30:06 am »
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(8006262013) ;
$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>   

Offline EzPortal

  • Administrator
  • *****
  • Posts: 1299
  • Karma: 67
Re: Countdown Counter
« Reply #1 on: May 28, 2013, 10:06:06 pm »
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
5293 Views
Last post September 17, 2011, 08:24:02 am
by Bakdoi

+-SMF Gallery

Quick Menu


Powered by EzPortal