Commit 451a9064 authored by Dries's avatar Dries

- Fixed throttle block problem.  Patch by Jeremy.
parent d45bf0f1
......@@ -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";
......
......@@ -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";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment