mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-10-19 20:33:26 +02:00
layout aside cleanup
This commit is contained in:
@@ -30,24 +30,31 @@
|
||||
</li>
|
||||
<?php
|
||||
$new = 0;
|
||||
$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';");
|
||||
$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();
|
||||
}
|
||||
?>
|
||||
<li>
|
||||
|
Reference in New Issue
Block a user