function splitArrayCategory($stat, $sep, $page) { $array = Arrays::getArray($stat); $phrase = Phrases::getPhrase($stat); $inserts = null; for ($i = 0; $i < count($array); $i++) { if ($i > 0) { $inserts .= $sep; } if ($stat == "achievement") { $img = "<img src='images/achievements/" . $array[$i] . ".png' class='img'> "; } else { if ($stat == "stat.killEntity" || $stat == "stat.entityKilledBy") { $img = "<img src='images/mobs/" . $array[$i] . ".png' class='img'> "; } else { if ($stat != "stat") { $img = "<img src='images/items/" . $array[$i] . ".png' class='img'> "; } } } $link = "top.php?do={$stat}&page={$page}&sort=" . $array[$i]; $asc = " <a href='{$link}&order=ASC'><img src='images/up.png' class='sort'></a>"; $desc = " <a href='{$link}&order=DESC'><img src='images/down.png' class='sort'></a>"; $inserts .= $img . $phrase[$i] . $asc . $desc; } return $inserts; }
function splitArrayCategory($stat, $sep) { $array = Arrays::getArray($stat); $phrase = Phrases::getPhrase($stat); $inserts = null; for ($i = 0; $i < count($array); $i++) { if ($i > 0) { $inserts .= $sep; } if ($stat == "achievement") { $img = "<img src='images/achievements/" . $array[$i] . ".png' class='img'> "; } else { if ($stat == "stat.killEntity" || $stat == "stat.entityKilledBy") { $img = "<img src='images/mobs/" . $array[$i] . ".png' class='img'> "; } else { if ($stat != "stat") { $img = "<img src='images/items/" . $array[$i] . ".png' class='img'> "; } } } $inserts .= $img . $phrase[$i]; } return $inserts; }
private function getInsertArrayItem($stat) { $inserts = null; $values = null; $updates = null; $total = 0; foreach (Arrays::getArray($stat) as $value) { if ($inserts != null) { $inserts .= ", "; $values .= ", "; $updates .= ", "; } $inserts .= "`{$value}`"; $values .= "'" . $this->stats[$stat . '.minecraft.' . $value] . "'"; $updates .= "`{$value}`='" . $this->stats[$stat . '.minecraft.' . $value] . "'"; $total += $this->stats[$stat . '.minecraft.' . $value]; } $inserts = "`total`, " . $inserts; $values = "'{$total}', " . $values; $updates = "`total`='{$total}', " . $updates; return array($inserts, $values, $updates); }
<?php /*======================================================================*\ || #################################################################### || || # GawdScape Statistics Leaderboard # || || # ---------------------------------------------------------------- # || || # Copyright ©2015 GawdScape. All Rights Reserved. # || || #################################################################### || \*======================================================================*/ // #################### DEFINE IMPORTANT CONSTANTS ####################### $cat = $_GET['cat']; $img = $_GET['img']; // ######################### REQUIRE BACK-END ############################ require_once 'classes/Arrays.php'; require_once 'classes/Images.php'; require_once 'classes/Phrases.php'; // ####################################################################### // ######################## START MAIN SCRIPT ############################ // ####################################################################### if ($cat && $img) { $index = array_search($img, Arrays::getArray($cat)); header("Location: " . Images::getUrl($cat, $index)); }