mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-04-30 19:29:22 +02:00

Now checking if character is offline before changing gender. Restructured Admin_shop.php, it will now show pending orders and the whole transaction log.
50 lines
905 B
PHP
50 lines
905 B
PHP
<?php
|
|
|
|
function getItemNameById($id) {
|
|
|
|
$item_list = explode(PHP_EOL, file_get_contents('item_list.txt'));
|
|
|
|
foreach ($item_list as $items) {
|
|
|
|
$item_array = explode('@', $items);
|
|
|
|
if ($item_array[0] == $id) {
|
|
|
|
echo ucfirst($item_array[1]);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
/* Returns a PHP array $id => 'name'
|
|
$items = getItemList();
|
|
echo $items[2160]; // Returns 'Crystal Coin'
|
|
*/
|
|
function getItemList() {
|
|
$item_list = explode(PHP_EOL, file_get_contents('item_list.txt'));
|
|
$ia = array();
|
|
for ($i = 0; $i < count($item_list) - 1; $i++) {
|
|
$it = explode('@', $item_list[$i]);
|
|
$ia[(int)$it[0]] = ucfirst($it[1]);
|
|
}
|
|
return $ia;
|
|
}
|
|
|
|
function getItemIdByName($name) {
|
|
|
|
$item_list = explode(PHP_EOL, file_get_contents('item_list.txt'));
|
|
|
|
foreach ($item_list as $items) {
|
|
|
|
$item_array = explode('@', $items);
|
|
|
|
if ($item_array[1] == $name) {
|
|
|
|
echo ucfirst($item_array[0]);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
|