Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //REPLACE THIS
- //Run query
- $res = mysql_query($sql);
- if (!$res)
- return error(mysql_error());
- $items = explode("\n", file_get_contents("items.txt"));
- $itemhash = array();
- foreach($items as $i) {
- $item = explode(",", $i, 2);
- if (count($item) < 2) continue;
- if(isset($item[0]) && isset($item[1])) $itemhash[$item[0]] = $item[1];
- }
- $results = array();
- // Replace this!!
- function getBlockName($string) {
- global $itemhash;
- $parts = explode(":", $string);
- if ($string == "00")
- return "AIR";
- if ($string == "0")
- return "AIR";
- $i = $itemhash[$string];
- if ($i != null)
- return $i;
- if (!isset($itemhash[$parts[0]])) return $string;
- $i = $itemhash[$parts[0]];
- if (count($parts) == 2)
- return $i . ":" . $parts[1];
- else
- return $i;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement