$realms = $sql["mgr"]->query("SELECT * FROM config_servers LIMIT 10"); if ($sql["mgr"]->num_rows($realms) > 1 && count($server) > 1) { while ($realm = $sql["mgr"]->fetch_assoc($realms)) { $output .= ' <div class="top"><h1>Top 100 of ' . $realm["Name"] . '</h1></div>'; top100($realm["Index"]); } } else { $output .= ' <div class="top"><h1>' . lang("top", "top100") . '</h1></div>'; top100($realm_id); } } else { $output .= ' <div class="top"><h1>' . lang("top", "top100") . '</h1></div>'; top100($realm_id); } // add buttons to switch viewing between 1 and all realms if ($multi_realm_mode) { $realms = $sql["mgr"]->query("SELECT COUNT(*) FROM config_servers"); $tot_realms = $sql["mgr"]->result($realms, 0); if ($tot_realms > 1 && count($server) > 1) { $output .= ' <div style="height: 30px; width: 284px; margin-left: auto; margin-right: auto;">'; makebutton(lang("top", "view_all"), "top100.php?n_realms=" . $tot_realms, 130); makebutton(lang("top", "view_this"), "top100.php?n_realms=1", 130); $output .= ' </div>'; } } unset($action);
if (isset($_POST['n_realms'])) { $n_realms = $_POST['n_realms']; $realms = $sqlr->query('SELECT id, name FROM realmlist LIMIT 10'); if (1 < $sqlr->num_rows($realms) && 1 < count($server)) { for ($i = 1; $i <= $n_realms; ++$i) { $realm = $sqlr->fetch_assoc($realms); if (isset($server[$realm['id']])) { $output .= ' <div class="top"><h1>Top 100 of ' . $realm['name'] . '</h1></div>'; top100($realm['id'], $sqlr, $sqlc); } } } else { $output .= ' <div class="top"><h1>' . $lang_top['top100'] . '</h1></div>'; top100($realm_id, $sqlr, $sqlc); } } else { $output .= ' <div class="top"><h1>' . $lang_top['top100'] . '</h1></div>'; top100($realm_id, $sqlr, $sqlc); } } else { $output .= ' <div class="top"><h1>' . $lang_top['top100'] . '</h1></div>'; top100($realm_id, $sqlr, $sqlc); } unset($action); unset($action_permission); unset($lang_top); require_once 'footer.php';