]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
simple stats
authorCash Costello <cash.costello@gmail.com>
Fri, 17 Jul 2009 01:35:46 +0000 (01:35 +0000)
committerCash Costello <cash.costello@gmail.com>
Fri, 17 Jul 2009 01:35:46 +0000 (01:35 +0000)
views/default/tidypics/stats.php

index 8680ab0520d896d25461917db5a35eb2758ff6bc..ebaf9a06141be4b975552e8be02979647fc39bd0 100644 (file)
@@ -1,3 +1,14 @@
 <?php\r
-       echo 'Stats go here';\r
+\r
+       $img_type = get_subtype_id('object', 'image');\r
+       $query = "SELECT count(guid) as total from {$CONFIG->dbprefix}entities where subtype={$img_type}";\r
+       $total = get_data_row($query);\r
+       $num_images = $total->total;\r
+       \r
+       $img_type = get_subtype_id('object', 'album');\r
+       $query = "SELECT count(guid) as total from {$CONFIG->dbprefix}entities where subtype={$img_type}";\r
+       $total = get_data_row($query);\r
+       $num_albums = $total->total;\r
+\r
+       echo  $num_images . " Photos in " . $num_albums . " Albums";\r
 ?>
\ No newline at end of file