link to image in the event log
This commit is contained in:
		
							parent
							
								
									c59ef1f355
								
							
						
					
					
						commit
						181bbcc9b7
					
				@ -20,7 +20,7 @@ class LogDatabaseTheme extends Themelet {
 | 
				
			|||||||
					"<a href='".make_link("user/".url_escape($event['username']))."'>".html_escape($event['username'])."</a>".
 | 
										"<a href='".make_link("user/".url_escape($event['username']))."'>".html_escape($event['username'])."</a>".
 | 
				
			||||||
					"</span></td>";
 | 
										"</span></td>";
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			$table .= "<td>".html_escape($event['message'])."</td>";
 | 
								$table .= "<td>".$this->scan_entities(html_escape($event['message']))."</td>";
 | 
				
			||||||
			$table .= "</tr>\n";
 | 
								$table .= "</tr>\n";
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		$table .= "</tbody></table>";
 | 
							$table .= "</tbody></table>";
 | 
				
			||||||
@ -42,5 +42,15 @@ class LogDatabaseTheme extends Themelet {
 | 
				
			|||||||
			default: return "";
 | 
								default: return "";
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						protected function scan_entities($line) {
 | 
				
			||||||
 | 
							$line = preg_replace_callback("/Image #(\d+)/s", array($this, "link_image"), $line);
 | 
				
			||||||
 | 
							return $line;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						protected function link_image($id) {
 | 
				
			||||||
 | 
							$iid = int_escape($id[1]);
 | 
				
			||||||
 | 
							return "<a href='".make_link("post/view/$iid")."'>Image #$iid</a>";
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
?>
 | 
					?>
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user