diff --git a/layout/widgets/admin.php b/layout/widgets/admin.php index 6da4b93..b316065 100644 --- a/layout/widgets/admin.php +++ b/layout/widgets/admin.php @@ -30,24 +30,31 @@ '1';"); + $cache = new Cache('engine/cache/asideFeedbackCount'); + if ($cache->hasExpired()) { + $cat = 4; //Category ID for feedback section + $threads = mysql_select_multi("SELECT `id`, `player_id` FROM `znote_forum_threads` WHERE `forum_id`='$cat' AND `closed`='0';"); + if ($threads !== false) { + $staffs = mysql_select_multi("SELECT `id` FROM `players` WHERE `group_id` > '1';"); - foreach($threads as $thread) { - $response = false; - $posts = mysql_select_multi("SELECT `id`, `player_id` FROM `znote_forum_posts` WHERE `thread_id`='". $thread['id'] ."';"); - if ($posts !== false) { - foreach($posts as $post) { - foreach ($staffs as $staff) { - if ($post['player_id'] == $staff['id']) $response = true; + foreach($threads as $thread) { + $response = false; + $posts = mysql_select_multi("SELECT `id`, `player_id` FROM `znote_forum_posts` WHERE `thread_id`='". $thread['id'] ."';"); + if ($posts !== false) { + foreach($posts as $post) { + foreach ($staffs as $staff) { + if ($post['player_id'] == $staff['id']) $response = true; + } } } - } - if (!$response) $new++; + if (!$response) $new++; + } } + $cache->setContent($new); + $cache->save(); + } else { + $new = $cache->load(); } ?>
  • diff --git a/layout/widgets/houses.php b/layout/widgets/houses.php index 20e02c0..9186811 100644 --- a/layout/widgets/houses.php +++ b/layout/widgets/houses.php @@ -3,17 +3,13 @@ Town list / houses
    -
    "> - $name) echo ''; ?> -
    diff --git a/layout/widgets/myaccount.php b/layout/widgets/myaccount.php index e90afe5..80ac8b9 100644 --- a/layout/widgets/myaccount.php +++ b/layout/widgets/myaccount.php @@ -1,6 +1,6 @@
    - Welcome, . + Welcome, .
      diff --git a/layout/widgets/topplayers.php b/layout/widgets/topplayers.php index 3ce32cf..7b530a4 100644 --- a/layout/widgets/topplayers.php +++ b/layout/widgets/topplayers.php @@ -7,7 +7,11 @@ hasExpired()) { - $players = mysql_select_multi('SELECT `name`, `level`, `experience` FROM `players` WHERE `group_id` < ' . $config['highscore']['ignoreGroupId'] . ' ORDER BY `level` DESC, `experience` DESC LIMIT 5;'); + $players = mysql_select_multi(" + SELECT `name`, `level`, `experience` + FROM `players` WHERE `group_id` < {$config['highscore']['ignoreGroupId']} + ORDER BY `level` DESC, `experience` DESC LIMIT 5; + "); $cache->setContent($players); $cache->save();