- Only export the "who is online" block when the access log is enabled.

Patch by Al.  Fixed bug #1692.

- Only export the "top nodes" block when the node counters are enabled.
4.2.x
Dries Buytaert 2003-05-17 19:57:52 +00:00
parent badf1ca458
commit 07ab3915c4
2 changed files with 12 additions and 4 deletions

View File

@ -812,8 +812,12 @@ function statistics_get($nid) {
/* Block hook */
function statistics_block($op = "list", $delta = 0) {
if ($op == "list") {
$blocks[0]["info"] = t("Top nodes");
$blocks[1]["info"] = t("Who's online");
if (variable_get("statistics_enable_node_counter", 0)) {
$blocks[0]["info"] = t("Top nodes");
}
if (variable_get("statistics_enable_access_log", 0)) {
$blocks[1]["info"] = t("Who's online");
}
return $blocks;
}
else {

View File

@ -812,8 +812,12 @@ function statistics_get($nid) {
/* Block hook */
function statistics_block($op = "list", $delta = 0) {
if ($op == "list") {
$blocks[0]["info"] = t("Top nodes");
$blocks[1]["info"] = t("Who's online");
if (variable_get("statistics_enable_node_counter", 0)) {
$blocks[0]["info"] = t("Top nodes");
}
if (variable_get("statistics_enable_access_log", 0)) {
$blocks[1]["info"] = t("Who's online");
}
return $blocks;
}
else {