crudely hide explicit images from the comment list of anons
This commit is contained in:
		
							parent
							
								
									dbf529825c
								
							
						
					
					
						commit
						ee292c2a25
					
				@ -244,6 +244,11 @@ class CommentList extends SimpleExtension {
 | 
				
			|||||||
		global $config;
 | 
							global $config;
 | 
				
			||||||
		global $database;
 | 
							global $database;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if(class_exists("Ratings")) {
 | 
				
			||||||
 | 
								global $user;
 | 
				
			||||||
 | 
								$user_ratings = Ratings::get_user_privs($user);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if(is_null($current_page) || $current_page <= 0) {
 | 
							if(is_null($current_page) || $current_page <= 0) {
 | 
				
			||||||
			$current_page = 1;
 | 
								$current_page = 1;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
@ -267,6 +272,11 @@ class CommentList extends SimpleExtension {
 | 
				
			|||||||
		while(!$result->EOF) {
 | 
							while(!$result->EOF) {
 | 
				
			||||||
			$image = Image::by_id($result->fields["image_id"]);
 | 
								$image = Image::by_id($result->fields["image_id"]);
 | 
				
			||||||
			$comments = $this->get_comments($image->id);
 | 
								$comments = $this->get_comments($image->id);
 | 
				
			||||||
 | 
								if(class_exists("Ratings")) {
 | 
				
			||||||
 | 
									if(strpos($user_ratings, $image->rating) === FALSE) {
 | 
				
			||||||
 | 
										$image = null; // this is "clever", I may live to regret it
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
			if(!is_null($image)) $images[] = array($image, $comments);
 | 
								if(!is_null($image)) $images[] = array($image, $comments);
 | 
				
			||||||
			$result->MoveNext();
 | 
								$result->MoveNext();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user