diff --git a/ext/home/main.php b/ext/home/main.php index 4a4fe5d4..e828e281 100644 --- a/ext/home/main.php +++ b/ext/home/main.php @@ -26,6 +26,8 @@ class Home extends Extension public function onSetupBuilding(SetupBuildingEvent $event) { $counters = []; + $counters["None"] = "none"; + $counters["Text-only"] = "text-only"; foreach (glob("ext/home/counters/*") as $counter_dirname) { $name = str_replace("ext/home/counters/", "", $counter_dirname); $counters[ucfirst($name)] = $name; @@ -50,15 +52,20 @@ class Home extends Extension } $counter_dir = $config->get_string('home_counter', 'default'); - $total = Image::count_images(); - $strtotal = "$total"; - $num_comma = number_format($total); - + $num_comma = ""; $counter_text = ""; - $length = strlen($strtotal); - for ($n=0; $n<$length; $n++) { - $cur = $strtotal[$n]; - $counter_text .= "$cur"; + if ($counter_dir != 'none') { + $total = Image::count_images(); + $num_comma = number_format($total); + + if ($counter_dir != 'text-only') { + $strtotal = "$total"; + $length = strlen($strtotal); + for ($n=0; $n<$length; $n++) { + $cur = $strtotal[$n]; + $counter_text .= "$cur"; + } + } } // get the homelinks and process them diff --git a/ext/home/theme.php b/ext/home/theme.php index 009783d6..a0b37efe 100644 --- a/ext/home/theme.php +++ b/ext/home/theme.php @@ -53,7 +53,7 @@ EOD $counter_html