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