Skip to content

Commit

Permalink
Now calling tim() only once.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattonomics committed Jan 14, 2012
1 parent ce145e4 commit 92d7a3b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions protest-sopa-pipa/protest-sopa-pipa.php
Expand Up @@ -31,10 +31,11 @@ class protest_sopa_pipa {
public $start = 1326891600; // 1/18/2012 8am EST
public $end = 1326934800; // 1/18/2012 8pm EST

public function __construct() {
if ( ( time() > $this->start ) && ( time() < $this->end ) )
public function __construct() {
$time = time();
if ( ( $time > $this->start ) && ( $time < $this->end ) )
$this->on();
elseif ( time() > $this->end )
elseif ( $time > $this->end )
$this->off();
}

Expand Down

0 comments on commit 92d7a3b

Please sign in to comment.