- Fixed throttle block problem. Patch by Jeremy.

4.4.x
Dries Buytaert 2003-12-04 22:42:19 +00:00
parent d45bf0f1e7
commit 451a90645b
2 changed files with 10 additions and 6 deletions

View File

@ -155,9 +155,11 @@ function throttle_display_throttle_block() {
$output .= t("Current level: %level (%min+)", array("%level" => $throttle, "%min" => $minimum)) ."<br />\n";
}
$output .= t("Probability: %probability%", array("%probability" => $probability)) ."<br />\n";
$recent_activity = db_fetch_object(db_query("SELECT COUNT(timestamp) AS hits FROM {accesslog} WHERE timestamp >= %d", (time() - 60)));
$output .= "<br />". t("This site has served %hits in the past minute.", array("%hits" => format_plural($recent_activity->hits , "1 page", "%count pages")));
_throttle_update($recent_activity->hits);
if ($throttle < 5) {
$recent_activity = db_fetch_object(db_query("SELECT COUNT(timestamp) AS hits FROM {accesslog} WHERE timestamp >= %d", (time() - 60)));
$output .= "<br />". t("This site has served %pages in the past minute.", array("%pages" => format_plural($recent_activity->hits , "1 page", "%count pages")));
_throttle_update($recent_activity->hits);
}
}
else {
$output .= t("Throttle: %status", array("%status" => l(t("disabled"), "admin/system/modules/throttle"))) ."<br />\n";

View File

@ -155,9 +155,11 @@ function throttle_display_throttle_block() {
$output .= t("Current level: %level (%min+)", array("%level" => $throttle, "%min" => $minimum)) ."<br />\n";
}
$output .= t("Probability: %probability%", array("%probability" => $probability)) ."<br />\n";
$recent_activity = db_fetch_object(db_query("SELECT COUNT(timestamp) AS hits FROM {accesslog} WHERE timestamp >= %d", (time() - 60)));
$output .= "<br />". t("This site has served %hits in the past minute.", array("%hits" => format_plural($recent_activity->hits , "1 page", "%count pages")));
_throttle_update($recent_activity->hits);
if ($throttle < 5) {
$recent_activity = db_fetch_object(db_query("SELECT COUNT(timestamp) AS hits FROM {accesslog} WHERE timestamp >= %d", (time() - 60)));
$output .= "<br />". t("This site has served %pages in the past minute.", array("%pages" => format_plural($recent_activity->hits , "1 page", "%count pages")));
_throttle_update($recent_activity->hits);
}
}
else {
$output .= t("Throttle: %status", array("%status" => l(t("disabled"), "admin/system/modules/throttle"))) ."<br />\n";