Postado Dezembro 3, 2020 4 anos Autor Agora, Mask Ghoul disse: Por favor poste a seu codigo em highscores.php , Lastest Deaths.php e index.php highscores <?php require_once 'engine/init.php'; include 'layout/overall/header.php'; ?> <br><table class="blackline"> <tr> <td><img src="layout/images/blank.gif"></td> </tr> </table> <div class="titleheader"> <h1>Highscores</h1> </div> <table class="blackline"> <tr> <td><img src="layout/images/blank.gif"></td> </tr> </table> <?php if ($config['log_ip']) { znote_visitor_insert_detailed_data(3); } // Fetch highscore type $type = (isset($_GET['type'])) ? (int)getValue($_GET['type']) : 7; if ($type > 9) $type = 7; // Fetch highscore page $page = getValue(@$_GET['page']); if (!$page || $page == 0) $page = 1; else $page = (int)$page; $highscore = $config['highscore']; $rows = $highscore['rows']; $rowsPerPage = $highscore['rowsPerPage']; function skillName($type) { $types = array( 1 => "Club", 2 => "Sword", 3 => "Axe", 4 => "Distance", 5 => "Shielding", 6 => "Fishing", 7 => "Experience", // Hardcoded 8 => "Magic Level", // Hardcoded 9 => "Fist", // Since 0 returns false I will make 9 = 0. ); return $types[(int)$type]; } function pageCheck($index, $page, $rowPerPage) { return ($index < ($page * $rowPerPage) && $index >= ($page * $rowPerPage) - $rowPerPage) ? true : false; } $cache = new Cache('engine/cache/highscores'); if ($cache->hasExpired()) { $scores = fetchAllScores($rows, $config['TFSVersion'], $highscore['ignoreGroupId']); $cache->setContent($scores); $cache->save(); } else { $scores = $cache->load(); } if ($scores) { ?> <h1>Ranking for <?php echo skillName($type); ?></h1> <form action="" method="GET"> <select name="type"> <option value="7" <?php if ($type == 7) echo "selected"; ?>>Experience</option> <option value="8" <?php if ($type == 8) echo "selected"; ?>>Magic</option> <option value="5" <?php if ($type == 5) echo "selected"; ?>>Shielding</option> <option value="2" <?php if ($type == 2) echo "selected"; ?>>Sword</option> <option value="1" <?php if ($type == 1) echo "selected"; ?>>Club</option> <option value="3" <?php if ($type == 3) echo "selected"; ?>>Axe</option> <option value="4" <?php if ($type == 4) echo "selected"; ?>>Distance</option> <option value="6" <?php if ($type == 6) echo "selected"; ?>>Fishing</option> <option value="9" <?php if ($type == 9) echo "selected"; ?>>Fist</option> </select> <select name="page"> <?php $pages = (int)($highscore['rows'] / $highscore['rowsPerPage']); for ($i = 0; $i < $pages; $i++) { $x = $i + 1; if ($x == $page) echo "<option value='".$x."' selected>Page: ".$x."</option>"; else echo "<option value='".$x."'>Page: ".$x."</option>"; } ?> </select> <input type="submit" value=" View " class="btn btn-info"> </form> <table id="highscoresTable" class="table table-striped table-hover"> <tr class="yellow"> <td>Rank</td> <td>Name</td> <td>Vocation</td> <td>Level</td> <?php if ($type === 7) echo "<td width='10%'>Experience</td>"; ?> </tr> <?php for ($i = 0; $i < count($scores[$type]); $i++) { if (pageCheck($i, $page, $rowsPerPage)) { ?> <tr> <td><?php echo $i+1; ?></td> <td><a href="characterprofile.php?name=<?php echo $scores[$type][$i]['name']; ?>"><?php echo $scores[$type][$i]['name']; ?></a></td> <td><?php echo vocation_id_to_name($scores[$type][$i]['vocation']); ?></td> <td><?php echo $scores[$type][$i]['value']; ?></td> <?php if ($type === 7) echo "<td>". $scores[$type][$i]['experience'] ."</td>"; ?> </tr> <?php } } ?> </table> <?php } include 'layout/overall/footer.php'; ?>
Postado Dezembro 3, 2020 4 anos 17 minutos atrás, Brum disse: highscores <?php require_once 'engine/init.php'; include 'layout/overall/header.php'; ?> <br><table class="blackline"> <tr> <td><img src="layout/images/blank.gif"></td> </tr> </table> <div class="titleheader"> <h1>Highscores</h1> </div> <table class="blackline"> <tr> <td><img src="layout/images/blank.gif"></td> </tr> </table> <?php if ($config['log_ip']) { znote_visitor_insert_detailed_data(3); } // Fetch highscore type $type = (isset($_GET['type'])) ? (int)getValue($_GET['type']) : 7; if ($type > 9) $type = 7; // Fetch highscore page $page = getValue(@$_GET['page']); if (!$page || $page == 0) $page = 1; else $page = (int)$page; $highscore = $config['highscore']; $rows = $highscore['rows']; $rowsPerPage = $highscore['rowsPerPage']; function skillName($type) { $types = array( 1 => "Club", 2 => "Sword", 3 => "Axe", 4 => "Distance", 5 => "Shielding", 6 => "Fishing", 7 => "Experience", // Hardcoded 8 => "Magic Level", // Hardcoded 9 => "Fist", // Since 0 returns false I will make 9 = 0. ); return $types[(int)$type]; } function pageCheck($index, $page, $rowPerPage) { return ($index < ($page * $rowPerPage) && $index >= ($page * $rowPerPage) - $rowPerPage) ? true : false; } $cache = new Cache('engine/cache/highscores'); if ($cache->hasExpired()) { $scores = fetchAllScores($rows, $config['TFSVersion'], $highscore['ignoreGroupId']); $cache->setContent($scores); $cache->save(); } else { $scores = $cache->load(); } if ($scores) { ?> <h1>Ranking for <?php echo skillName($type); ?></h1> <form action="" method="GET"> <select name="type"> <option value="7" <?php if ($type == 7) echo "selected"; ?>>Experience</option> <option value="8" <?php if ($type == 8) echo "selected"; ?>>Magic</option> <option value="5" <?php if ($type == 5) echo "selected"; ?>>Shielding</option> <option value="2" <?php if ($type == 2) echo "selected"; ?>>Sword</option> <option value="1" <?php if ($type == 1) echo "selected"; ?>>Club</option> <option value="3" <?php if ($type == 3) echo "selected"; ?>>Axe</option> <option value="4" <?php if ($type == 4) echo "selected"; ?>>Distance</option> <option value="6" <?php if ($type == 6) echo "selected"; ?>>Fishing</option> <option value="9" <?php if ($type == 9) echo "selected"; ?>>Fist</option> </select> <select name="page"> <?php $pages = (int)($highscore['rows'] / $highscore['rowsPerPage']); for ($i = 0; $i < $pages; $i++) { $x = $i + 1; if ($x == $page) echo "<option value='".$x."' selected>Page: ".$x."</option>"; else echo "<option value='".$x."'>Page: ".$x."</option>"; } ?> </select> <input type="submit" value=" View " class="btn btn-info"> </form> <table id="highscoresTable" class="table table-striped table-hover"> <tr class="yellow"> <td>Rank</td> <td>Name</td> <td>Vocation</td> <td>Level</td> <?php if ($type === 7) echo "<td width='10%'>Experience</td>"; ?> </tr> <?php for ($i = 0; $i < count($scores[$type]); $i++) { if (pageCheck($i, $page, $rowsPerPage)) { ?> <tr> <td><?php echo $i+1; ?></td> <td><a href="characterprofile.php?name=<?php echo $scores[$type][$i]['name']; ?>"><?php echo $scores[$type][$i]['name']; ?></a></td> <td><?php echo vocation_id_to_name($scores[$type][$i]['vocation']); ?></td> <td><?php echo $scores[$type][$i]['value']; ?></td> <?php if ($type === 7) echo "<td>". $scores[$type][$i]['experience'] ."</td>"; ?> </tr> <?php } } ?> </table> <?php } include 'layout/overall/footer.php'; ?> <?php require_once 'engine/init.php'; include 'layout/overall/header.php'; if ($config['log_ip']) { znote_visitor_insert_detailed_data(3); } // Fetch highscore type $type = (isset($_GET['type'])) ? (int)getValue($_GET['type']) : 7; if ($type > 9) $type = 7; // Fetch highscore vocation $configVocations = $config['vocations']; //$debug['configVocations'] = $configVocations; $vocationIds = array_keys($configVocations); $vocation = 'all'; if (isset($_GET['vocation']) && is_numeric($_GET['vocation'])) { $vocation = (int)$_GET['vocation']; if (!in_array($vocation, $vocationIds)) { $vocation = "all"; } } // Fetch highscore page $page = getValue(@$_GET['page']); if (!$page || $page == 0) $page = 1; else $page = (int)$page; $highscore = $config['highscore']; $loadFlags = ($config['country_flags']['enabled'] && $config['country_flags']['highscores']) ? true : false; $loadOutfits = ($config['show_outfits']['highscores']) ? true : false; $rows = $highscore['rows']; $rowsPerPage = $highscore['rowsPerPage']; function skillName($type) { $types = array( 1 => "Club", 2 => "Sword", 3 => "Axe", 4 => "Distance", 5 => "Shield", 6 => "Fish", 7 => "Experience", // Hardcoded 8 => "Magic Level", // Hardcoded 9 => "Fist", // Since 0 returns false I will make 9 = 0. :) ); return $types[(int)$type]; } function pageCheck($index, $page, $rowPerPage) { return ($index < ($page * $rowPerPage) && $index >= ($page * $rowPerPage) - $rowPerPage) ? true : false; } $cache = new Cache('engine/cache/highscores'); if ($cache->hasExpired()) { $vocGroups = fetchAllScores($rows, $config['TFSVersion'], $highscore['ignoreGroupId'], $configVocations, $vocation, $loadFlags, $loadOutfits); $cache->setContent($vocGroups); $cache->save(); } else { $vocGroups = $cache->load(); } if ($vocGroups) { $vocGroup = (is_array($vocGroups[$vocation])) ? $vocGroups[$vocation] : $vocGroups[$vocGroups[$vocation]]; ?> <br><img src="layout/images/titles/t_highscores.png"/><p><br> <h1>Ranking for <?php echo skillName($type) ?></h1> <table> <tbody> <tr><td style="background: none;"> <table id="highscoresTable" class="table table-striped table-hover"> <tbody><tr bgcolor="#20222c"> <td width="6%"class="whites" style=" background-color: #5d5b5b; color: #f9f6f6; ">Rank</td> <td width="40%" class="whites" style=" background-color: #5d5b5b; color: #f9f6f6; ">Name</td> <td width="20%" class="whites" style=" background-color: #5d5b5b; color: #f9f6f6; ">Vocation</td> <td width="15%" class="whites" style=" background-color: #5d5b5b; color: #f9f6f6; ">Level</td> <?php if ($type === 7) echo "<td colspan='1' style='background-color: #5d5b5b; color: #f9f6f6;' >Experience</td>"; ?> </tr> <?php for ($i = 0; $i < count($vocGroup[$type]); $i++) { if ($vocGroup[$type] === false) { ?> <tr> <td colspan="5">Nothing to show here yet.</td> </tr> <?php } else { if (pageCheck($i, $page, $rowsPerPage)) { $flag = ($loadFlags === true && strlen($vocGroup[$type][$i]['flag']) > 1) ? '<img src="' . $config['country_flags']['server'] . '/' . $vocGroup[$type][$i]['flag'] . '.png"> ' : ''; ?> <tr> <?php if ($loadOutfits): ?> <td class="outfitColumn"><img src="<?php echo $config['show_outfits']['imageServer']; ?>?id=<?php echo $vocGroup[$type][$i]['type']; ?>&addons=<?php echo $vocGroup[$type][$i]['addons']; ?>&head=<?php echo $vocGroup[$type][$i]['head']; ?>&body=<?php echo $vocGroup[$type][$i]['body']; ?>&legs=<?php echo $vocGroup[$type][$i]['legs']; ?>&feet=<?php echo $vocGroup[$type][$i]['feet']; ?>" alt="img"></td> <?php endif; ?> <td><?php echo $i+1; ?></td> <td><?php echo $flag; ?><a href="characterprofile.php?name=<?php echo $vocGroup[$type][$i]['name']; ?>"><?php echo $vocGroup[$type][$i]['name']; ?></a></td> <td><?php echo vocation_id_to_name($vocGroup[$type][$i]['vocation']); ?></td> <td><?php echo $vocGroup[$type][$i]['value']; ?></td> <?php if ($type === 7) echo "<td>". $vocGroup[$type][$i]['experience'] ."</td>"; ?> </tr> <?php } } } ?> </table> <th width="15%" valign="top" align="right"> <table border="0" cellpadding="1" cellspacing="1"> <tbody><tr bgcolor="#20222c"> <td class="whites" style=" background-color: #5d5b5b; color: #f9f6f6; ">Choose a Skill</td> </tr> <tr bgcolor="#1b1e26"> <td> <a href="highscores.php" class="size_xs">Experience</a><br> <a href="highscores.php?type=8&vocation=all&page=1" class="size_xs">Magic</a><br> <a href="highscores.php?type=5&vocation=all&page=1" class="size_xs">Shielding</a><br> <a href="highscores.php?type=4&vocation=all&page=1" class="size_xs">Distance</a><br> <a href="highscores.php?type=9&vocation=all&page=1" class="size_xs">Fist</a><br> <a href="highscores.php?type=2&vocation=all&page=1" class="size_xs">Sword</a><br> <a href="highscores.php?type=3&vocation=all&page=1" class="size_xs">Axe</a><br> <a href="highscores.php?type=1&vocation=all&page=1" class="size_xs">Club</a><br> <a href="highscores.php?type=6&vocation=all&page=1" class="size_xs">Fishing</a><br> </td> </tr> </tbody></table> </th></tr></tbody></table> <?php } include 'layout/overall/footer.php'; ?>
Postado Dezembro 5, 2020 4 anos Autor Em 03/12/2020 em 20:29, Mask Ghoul disse: <?php require_once 'engine/init.php'; include 'layout/overall/header.php'; if ($config['log_ip']) { znote_visitor_insert_detailed_data(3); } // Fetch highscore type $type = (isset($_GET['type'])) ? (int)getValue($_GET['type']) : 7; if ($type > 9) $type = 7; // Fetch highscore vocation $configVocations = $config['vocations']; //$debug['configVocations'] = $configVocations; $vocationIds = array_keys($configVocations); $vocation = 'all'; if (isset($_GET['vocation']) && is_numeric($_GET['vocation'])) { $vocation = (int)$_GET['vocation']; if (!in_array($vocation, $vocationIds)) { $vocation = "all"; } } // Fetch highscore page $page = getValue(@$_GET['page']); if (!$page || $page == 0) $page = 1; else $page = (int)$page; $highscore = $config['highscore']; $loadFlags = ($config['country_flags']['enabled'] && $config['country_flags']['highscores']) ? true : false; $loadOutfits = ($config['show_outfits']['highscores']) ? true : false; $rows = $highscore['rows']; $rowsPerPage = $highscore['rowsPerPage']; function skillName($type) { $types = array( 1 => "Club", 2 => "Sword", 3 => "Axe", 4 => "Distance", 5 => "Shield", 6 => "Fish", 7 => "Experience", // Hardcoded 8 => "Magic Level", // Hardcoded 9 => "Fist", // Since 0 returns false I will make 9 = 0. :) ); return $types[(int)$type]; } function pageCheck($index, $page, $rowPerPage) { return ($index < ($page * $rowPerPage) && $index >= ($page * $rowPerPage) - $rowPerPage) ? true : false; } $cache = new Cache('engine/cache/highscores'); if ($cache->hasExpired()) { $vocGroups = fetchAllScores($rows, $config['TFSVersion'], $highscore['ignoreGroupId'], $configVocations, $vocation, $loadFlags, $loadOutfits); $cache->setContent($vocGroups); $cache->save(); } else { $vocGroups = $cache->load(); } if ($vocGroups) { $vocGroup = (is_array($vocGroups[$vocation])) ? $vocGroups[$vocation] : $vocGroups[$vocGroups[$vocation]]; ?> <br><img src="layout/images/titles/t_highscores.png"/><p><br> <h1>Ranking for <?php echo skillName($type) ?></h1> <table> <tbody> <tr><td style="background: none;"> <table id="highscoresTable" class="table table-striped table-hover"> <tbody><tr bgcolor="#20222c"> <td width="6%"class="whites" style=" background-color: #5d5b5b; color: #f9f6f6; ">Rank</td> <td width="40%" class="whites" style=" background-color: #5d5b5b; color: #f9f6f6; ">Name</td> <td width="20%" class="whites" style=" background-color: #5d5b5b; color: #f9f6f6; ">Vocation</td> <td width="15%" class="whites" style=" background-color: #5d5b5b; color: #f9f6f6; ">Level</td> <?php if ($type === 7) echo "<td colspan='1' style='background-color: #5d5b5b; color: #f9f6f6;' >Experience</td>"; ?> </tr> <?php for ($i = 0; $i < count($vocGroup[$type]); $i++) { if ($vocGroup[$type] === false) { ?> <tr> <td colspan="5">Nothing to show here yet.</td> </tr> <?php } else { if (pageCheck($i, $page, $rowsPerPage)) { $flag = ($loadFlags === true && strlen($vocGroup[$type][$i]['flag']) > 1) ? '<img src="' . $config['country_flags']['server'] . '/' . $vocGroup[$type][$i]['flag'] . '.png"> ' : ''; ?> <tr> <?php if ($loadOutfits): ?> <td class="outfitColumn"><img src="<?php echo $config['show_outfits']['imageServer']; ?>?id=<?php echo $vocGroup[$type][$i]['type']; ?>&addons=<?php echo $vocGroup[$type][$i]['addons']; ?>&head=<?php echo $vocGroup[$type][$i]['head']; ?>&body=<?php echo $vocGroup[$type][$i]['body']; ?>&legs=<?php echo $vocGroup[$type][$i]['legs']; ?>&feet=<?php echo $vocGroup[$type][$i]['feet']; ?>" alt="img"></td> <?php endif; ?> <td><?php echo $i+1; ?></td> <td><?php echo $flag; ?><a href="characterprofile.php?name=<?php echo $vocGroup[$type][$i]['name']; ?>"><?php echo $vocGroup[$type][$i]['name']; ?></a></td> <td><?php echo vocation_id_to_name($vocGroup[$type][$i]['vocation']); ?></td> <td><?php echo $vocGroup[$type][$i]['value']; ?></td> <?php if ($type === 7) echo "<td>". $vocGroup[$type][$i]['experience'] ."</td>"; ?> </tr> <?php } } } ?> </table> <th width="15%" valign="top" align="right"> <table border="0" cellpadding="1" cellspacing="1"> <tbody><tr bgcolor="#20222c"> <td class="whites" style=" background-color: #5d5b5b; color: #f9f6f6; ">Choose a Skill</td> </tr> <tr bgcolor="#1b1e26"> <td> <a href="highscores.php" class="size_xs">Experience</a><br> <a href="highscores.php?type=8&vocation=all&page=1" class="size_xs">Magic</a><br> <a href="highscores.php?type=5&vocation=all&page=1" class="size_xs">Shielding</a><br> <a href="highscores.php?type=4&vocation=all&page=1" class="size_xs">Distance</a><br> <a href="highscores.php?type=9&vocation=all&page=1" class="size_xs">Fist</a><br> <a href="highscores.php?type=2&vocation=all&page=1" class="size_xs">Sword</a><br> <a href="highscores.php?type=3&vocation=all&page=1" class="size_xs">Axe</a><br> <a href="highscores.php?type=1&vocation=all&page=1" class="size_xs">Club</a><br> <a href="highscores.php?type=6&vocation=all&page=1" class="size_xs">Fishing</a><br> </td> </tr> </tbody></table> </th></tr></tbody></table> <?php } include 'layout/overall/footer.php'; ?> Mask, muito obrigado por responder eu incluí esses codigos, mas aí mudou o erro pra Fatal error: Uncaught Error: Call to undefined method Cache::save() in C:\xampp\htdocs\highscores.php:59 Stack trace: #0 {main} thrown in C:\xampp\htdocs\highscores.php on line 59
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.