layout aside cleanup

This commit is contained in:
Znote 2021-07-24 04:36:19 +02:00
parent f896b59e36
commit f011f782bd
4 changed files with 28 additions and 21 deletions

View File

@ -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>

View File

@ -3,17 +3,13 @@
Town list / houses
</div>
<div class="body">
<form action="houses.php" method="<?php if ($config['ServerEngine'] !== 'TFS_10') echo "post"; else echo "get" ;?>">
<select name="<?php if ($config['ServerEngine'] !== 'TFS_10') echo "selected"; else echo "id" ;?>">
<form action="houses.php" method="get">
<select name="id">
<?php
foreach ($config['towns'] as $id => $name)
echo '<option value="'. $id .'">'. $name .'</option>';
?>
</select>
<?php
/* Form file */
if ($config['ServerEngine'] !== 'TFS_10') Token::create();
?>
<input type="submit" value="Fetch houses">
</form>
</div>

View File

@ -1,6 +1,6 @@
<div class="well myaccount_widget widget" id="loginContainer">
<div class="header">
Welcome, <?php if ($config['ServerEngine'] !== 'OTHIRE') echo $user_data['name']; else echo $user_data['id'];?>.
Welcome, <?php echo $user_data['name']; ?>.
</div>
<div class="body">
<ul class="linkbuttons">

View File

@ -7,7 +7,11 @@
<?php
$cache = new Cache('engine/cache/topPlayer');
if ($cache->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();