Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Only say active time if we can work it out.

chrismeller's suggestion to use a timestamp may be a better solution,
but given this is trivial and a timestamp wouldn't be backwards
compatible, this will do. Closes habari/habari#139.
  • Loading branch information...
commit 211931ba3fa2fdc82d0699e222309949347854ae 1 parent eb7dc71
@michaeltwofish michaeltwofish authored
Showing with 8 additions and 2 deletions.
  1. +5 −1 admin/dashboard.php
  2. +3 −1 handlers/admindashboardhandler.php
View
6 admin/dashboard.php
@@ -15,7 +15,11 @@
<![endif]-->
<p>
- <?php _e( '%s has been active for %s', array( Options::get('title'), $active_time->friendly( 3, false ) ) ); ?>
+ <?php
+ if ( isset($active_time) ) {
+ _e( '%s has been active for %s', array( Options::get('title'), $active_time->friendly( 3, false ) ) );
+ }
+ ?>
<br>
<?php
View
4 handlers/admindashboardhandler.php
@@ -19,7 +19,9 @@ public function get_dashboard()
{
// Not sure how best to determine this yet, maybe set an option on install, maybe do this:
$firstpostdate = DB::get_value( 'SELECT min(pubdate) FROM {posts} WHERE status = ?', array( Post::status( 'published' ) ) );
- $this->theme->active_time = HabariDateTime::date_create( $firstpostdate );
+ if ( $firstpostdate ) {
+ $this->theme->active_time = HabariDateTime::date_create( $firstpostdate );
+ }
// check to see if we have updates to display
$this->theme->updates = Options::get( 'updates_available', array() );
Please sign in to comment.
Something went wrong with that request. Please try again.