sqlite fails at count distinct
This commit is contained in:
		
							parent
							
								
									c9f743bf8f
								
							
						
					
					
						commit
						e81c3e288d
					
				@ -222,7 +222,7 @@ class CommentList implements Extension {
 | 
				
			|||||||
			";
 | 
								";
 | 
				
			||||||
		$result = $database->Execute($get_threads, array($threads_per_page, $start));
 | 
							$result = $database->Execute($get_threads, array($threads_per_page, $start));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		$total_pages = (int)($database->db->GetOne("SELECT COUNT(distinct image_id) AS count FROM comments") / 10);
 | 
							$total_pages = (int)($database->db->GetOne("SELECT COUNT(image_id) AS count FROM comments GROUP BY image_id") / 10);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		$this->theme->display_page_start($page, $current_page, $total_pages);
 | 
							$this->theme->display_page_start($page, $current_page, $total_pages);
 | 
				
			||||||
@ -287,6 +287,9 @@ class CommentList implements Extension {
 | 
				
			|||||||
		global $config;
 | 
							global $config;
 | 
				
			||||||
		global $database;
 | 
							global $database;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// sqlite fails at intervals
 | 
				
			||||||
 | 
							if($database->engine->name == "sqlite") return false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		$window = int_escape($config->get_int('comment_window'));
 | 
							$window = int_escape($config->get_int('comment_window'));
 | 
				
			||||||
		$max = int_escape($config->get_int('comment_limit'));
 | 
							$max = int_escape($config->get_int('comment_limit'));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user