diff --git a/contrib/ipban/main.php b/contrib/ipban/main.php index 06e86b1d..bd9a11d0 100644 --- a/contrib/ipban/main.php +++ b/contrib/ipban/main.php @@ -92,7 +92,7 @@ class IPBan extends SimpleExtension { public function onRemoveIPBan($event) { global $database; $database->Execute("DELETE FROM bans WHERE id = :id", array("id"=>$event->id)); - $database->cache->delete("ip_bans"); + $database->cache->delete("ip_bans_sorted"); } // installer {{{ @@ -261,7 +261,7 @@ class IPBan extends SimpleExtension { global $database; $sql = "INSERT INTO bans (ip, reason, end_timestamp, banner_id) VALUES (:ip, :reason, :end, :admin_id)"; $database->Execute($sql, array("ip"=>$ip, "reason"=>$reason, "end"=>strtotime($end), "admin_id"=>$user->id)); - $database->cache->delete("ip_bans"); + $database->cache->delete("ip_bans_sorted"); log_info("ipban", "'$user->name' has banned '$ip' because '$reason' until '$end'"); } // }}} diff --git a/core/imageboard.pack.php b/core/imageboard.pack.php index 1be135fa..73eb31f3 100644 --- a/core/imageboard.pack.php +++ b/core/imageboard.pack.php @@ -111,13 +111,19 @@ class Image { assert(is_numeric($start)); assert(is_numeric($limit)); assert(is_array($tags)); - global $database; + global $database, $user; $images = array(); if($start < 0) $start = 0; if($limit < 1) $limit = 1; + if(SPEED_HAX) { + if($user->is_anonymous() and count($tags) > 3) { + die("Anonymous users may only search for up to 3 tags at a time"); // FIXME: throw an exception? + } + } + $querylet = Image::build_search_querylet($tags); $querylet->append(new Querylet("ORDER BY images.id DESC LIMIT :limit OFFSET :offset", array("limit"=>$limit, "offset"=>$start))); #var_dump($querylet->sql); var_dump($querylet->variables); diff --git a/ext/comment/main.php b/ext/comment/main.php index f260ace2..0a1aaebf 100644 --- a/ext/comment/main.php +++ b/ext/comment/main.php @@ -173,7 +173,6 @@ class CommentList extends SimpleExtension { $h_comment_rate = sprintf("%.1f", ($i_comment_count / $i_days_old)); $event->add_stats("Comments made: $i_comment_count, $h_comment_rate per day"); - global $user; $recent = $this->get_user_recent_comments($event->display_user->id, 10); $this->theme->display_user_comments($recent); } diff --git a/ext/comment/theme.php b/ext/comment/theme.php index 56afa513..c054a80b 100644 --- a/ext/comment/theme.php +++ b/ext/comment/theme.php @@ -144,12 +144,17 @@ class CommentListTheme extends Themelet { $i_comment_id = int_escape($comment->comment_id); $i_image_id = int_escape($comment->image_id); - $anoncode = ""; - if($h_name == "Anonymous" && $this->anon_id >= 0) { - $anoncode = ''.$this->anon_id.''; - $this->anon_id++; + if($h_name == "Anonymous") { + $anoncode = ""; + if($this->anon_id >= 0) { + $anoncode = ''.$this->anon_id.''; + $this->anon_id++; + } + $h_userlink = $h_name . $anoncode; + } + else { + $h_userlink = ''.$h_name.''; } - $h_userlink = ''.$h_name.''.$anoncode; $stripped_nonl = str_replace("\n", "\\n", substr($tfe->stripped, 0, 50)); $stripped_nonl = str_replace("\r", "\\r", $stripped_nonl); $h_dellink = $user->is_admin() ? diff --git a/ext/user/main.php b/ext/user/main.php index 0950c220..b5c9dc64 100644 --- a/ext/user/main.php +++ b/ext/user/main.php @@ -158,7 +158,7 @@ class UserPage extends SimpleExtension { $this->theme->display_error($page, "Not Logged In", "You aren't logged in. First do that, then you can see your stats."); } - else if(!is_null($display_user)) { + else if(!is_null($display_user) && ($display_user->id != $config->get_int("anon_id"))) { send_event(new UserPageBuildingEvent($display_user)); } else {