Use Image::count_images() rather than SQL, to take advantage of advanced features and caching
This commit is contained in:
parent
c31faa3936
commit
9b98e6c90a
@ -64,14 +64,12 @@ class Home extends SimpleExtension {
|
|||||||
$contact_link = $config->get_string('contact_link');
|
$contact_link = $config->get_string('contact_link');
|
||||||
$counter_dir = $config->get_string('home_counter', 'default');
|
$counter_dir = $config->get_string('home_counter', 'default');
|
||||||
|
|
||||||
$total = ceil($database->db->GetOne("SELECT COUNT(*) FROM images"));
|
$total = Image::count_images();
|
||||||
$strtotal = "$total";
|
$strtotal = "$total";
|
||||||
|
|
||||||
$num_comma = number_format($total);
|
$num_comma = number_format($total);
|
||||||
|
|
||||||
$counter_text = "";
|
$counter_text = "";
|
||||||
for($n=0; $n<strlen($strtotal); $n++)
|
for($n=0; $n<strlen($strtotal); $n++) {
|
||||||
{
|
|
||||||
$cur = $strtotal[$n];
|
$cur = $strtotal[$n];
|
||||||
$counter_text .= " <img alt='$cur' src='$data_href/ext/home/counters/$counter_dir/$cur.gif' /> ";
|
$counter_text .= " <img alt='$cur' src='$data_href/ext/home/counters/$counter_dir/$cur.gif' /> ";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user