Added "days ago" to the Site Started field on admin home
authorDan
Mon, 01 Feb 2010 02:14:02 -0500
changeset 1215 ec7f8f6312bb
parent 1214 edd52b2933a4
child 1216 4125e19d3b27
Added "days ago" to the Site Started field on admin home
language/english/admin.json
plugins/admin/Home.php
--- a/language/english/admin.json	Tue Jan 19 10:02:30 2010 -0500
+++ b/language/english/admin.json	Mon Feb 01 02:14:02 2010 -0500
@@ -231,6 +231,7 @@
       stat_dbsize: 'Database size:',
       stat_dbsize_unsupported: 'Unsupported',
       stat_installdate: 'Site started:',
+      stat_installdate_ago: '(%days% %this.etc_unit_days% ago)',
       stat_lastupdate: 'Last Enano upgrade:',
       stat_lastupdate_never: 'Never',
       
--- a/plugins/admin/Home.php	Tue Jan 19 10:02:30 2010 -0500
+++ b/plugins/admin/Home.php	Mon Feb 01 02:14:02 2010 -0500
@@ -315,7 +315,14 @@
   }
   
   // Install date
+  $site_age = floor((time() - $install_date) / 86400);
   $install_date_human = MemberlistFormatter::format_date($install_date);
+  if ( $site_age > 7 )
+  {
+    $install_date_human .= ' ' . $lang->get('acphome_stat_installdate_ago', array(
+        'days' => number_format($site_age)
+      ));
+  }
   
   // Last upgrade
   $q = $db->sql_query('SELECT time_id FROM ' . table_prefix . "logs WHERE log_type = 'security' AND action = 'upgrade_enano' ORDER BY time_id DESC LIMIT 1;");
@@ -329,7 +336,14 @@
   else
   {
     list($last_upgrade) = $db->fetchrow_num();
+    $ver_age = floor((time() - $last_upgrade) / 86400);
     $last_upgrade = MemberlistFormatter::format_date($last_upgrade);
+    if ( $ver_age > 7 )
+    {
+      $last_upgrade .= ' ' . $lang->get('acphome_stat_installdate_ago', array(
+          'days' => number_format($ver_age)
+        ));
+    }
   }
   $db->free_result();