diff --git a/admin_shop.php b/admin_shop.php index ae6d6fa..11ec880 100644 --- a/admin_shop.php +++ b/admin_shop.php @@ -3,17 +3,15 @@ require_once 'engine/init.php'; include 'layout/overall/header.php'; protect_page(); admin_only($user_data); -$orders_ammount = isset($_GET['orders_ammount']) && $_GET['orders_ammount'] > 0 && $_GET['orders_ammount'] <= 200 ? (int)$_GET['orders_ammount'] : 50; -$orders = mysql_select_multi('SELECT * FROM `znote_shop_orders` ORDER BY `id` DESC LIMIT ' . $orders_ammount); -$order_types = array(1 => 'Item', 2 => 'Premium Days', 3 => 'Sex Change', 4 => 'Custom'); + +$orders = mysql_select_multi('SELECT * FROM `znote_shop_orders` ORDER BY `id` DESC;'); +$order_types = array(1 => 'Item', 2 => 'Premium Days', 3 => 'Gender Change', 4 => 'Name Change', 5 => 'Custom'); +$items = getItemList(); ?> -

Admin Shop

-

Shop Orders

-

Shows latest shop orders.

-
- - -
+

Shop Logs

+ +

Pending Orders

+

These are pending orders, like items bought, but not received or used yet.

@@ -29,13 +27,43 @@ $order_types = array(1 => 'Item', 2 => 'Premium Days', 3 => 'Sex Change', 4 => ' - +
Id
+ + +

Order History

+

This list contains all transactions bought in the shop.

+ + + + + + + + + + + + + + + + + + + + + + + +
IdAccountTypeItemCountpointsDate
\ No newline at end of file diff --git a/config.php b/config.php index b9ebd46..e76fb7d 100644 --- a/config.php +++ b/config.php @@ -55,64 +55,64 @@ $config['EnableQuests'] = false; // array for filling questlog (Questid, max value, name, end of the quest fill 1 for the last part 0 for all others) - $config['Quests'] = array( - array(1501,100,'Killing in the Name of',0), - array(1502,150,'Killing in the Name of',0), - array(65001,100,'Killing in the Name of',0), - array(65002,150,'Killing in the Name of',0), - array(65003,300,'Killing in the Name of',0), - array(65004,3,'Killing in the Name of',0), - array(65005,300,'Killing in the Name of',0), - array(65006,150,'Killing in the Name of',0), - array(65007,200,'Killing in the Name of',0), - array(65008,300,'Killing in the Name of',0), - array(65009,300,'Killing in the Name of',0), - array(65010,300,'Killing in the Name of',0), - array(65011,300,'Killing in the Name of',0), - array(65012,300,'Killing in the Name of',0), - array(65013,300,'Killing in the Name of',0), - array(65014,300,'Killing in the Name of',1), - array(12110,2,'The Inquisition',0), - array(12111,7,'The Inquisition',0), - array(12112,3,'The Inquisition',0), - array(12113,6,'The Inquisition',0), - array(12114,3,'The Inquisition',0), - array(12115,3,'The Inquisition',0), - array(12116,3,'The Inquisition',0), - array(12117,5,'The Inquisition',1), - array(330,3,'Sam\'s Old Backpack',1), - array(12121,3,'The Ape City',0), - array(12122,5,'The Ape City',0), - array(12123,3,'The Ape City',0), - array(12124,3,'The Ape City',0), - array(12125,3,'The Ape City',0), - array(12126,3,'The Ape City',0), - array(12127,4,'The Ape City',0), - array(12128,3,'The Ape City',0), - array(12129,3,'The Ape City',1), - array(12101,1,'The Ancient Tombs',0), - array(12102,1,'The Ancient Tombs',0), - array(12103,1,'The Ancient Tombs',0), - array(12104,1,'The Ancient Tombs',0), - array(12105,1,'The Ancient Tombs',0), - array(12106,1,'The Ancient Tombs',0), - array(12107,1,'The Ancient Tombs',1), - array(12022,3,'Barbarian Test Quest',0), - array(12022,3,'Barbarian Test Quest',0), - array(12022,3,'Barbarian Test Quest',1), - array(12025,3,'The Ice Islands Quest',0), - array(12026,5,'The Ice Islands Quest',0), - array(12027,3,'The Ice Islands Quest',0), - array(12028,2,'The Ice Islands Quest',0), - array(12029,6,'The Ice Islands Quest',0), - array(12030,8,'The Ice Islands Quest',0), - array(12031,3,'The Ice Islands Quest',0), - array(12032,4,'The Ice Islands Quest',0), - array(12033,2,'The Ice Islands Quest',0), - array(12034,2,'The Ice Islands Quest',0), - array(12035,2,'The Ice Islands Quest',0), - array(12036,6,'The Ice Islands Quest',1), - ); + $config['Quests'] = array( + array(1501,100,"Killing in the Name of",0), + array(1502,150,"Killing in the Name of",0), + array(65001,100,"Killing in the Name of",0), + array(65002,150,"Killing in the Name of",0), + array(65003,300,"Killing in the Name of",0), + array(65004,3,"Killing in the Name of",0), + array(65005,300,"Killing in the Name of",0), + array(65006,150,"Killing in the Name of",0), + array(65007,200,"Killing in the Name of",0), + array(65008,300,"Killing in the Name of",0), + array(65009,300,"Killing in the Name of",0), + array(65010,300,"Killing in the Name of",0), + array(65011,300,"Killing in the Name of",0), + array(65012,300,"Killing in the Name of",0), + array(65013,300,"Killing in the Name of",0), + array(65014,300,"Killing in the Name of",1), + array(12110,2,"The Inquisition",0), + array(12111,7,"The Inquisition",0), + array(12112,3,"The Inquisition",0), + array(12113,6,"The Inquisition",0), + array(12114,3,"The Inquisition",0), + array(12115,3,"The Inquisition",0), + array(12116,3,"The Inquisition",0), + array(12117,5,"The Inquisition",1), + array(330,3,"Sam's Old Backpack",1), + array(12121,3,"The Ape City",0), + array(12122,5,"The Ape City",0), + array(12123,3,"The Ape City",0), + array(12124,3,"The Ape City",0), + array(12125,3,"The Ape City",0), + array(12126,3,"The Ape City",0), + array(12127,4,"The Ape City",0), + array(12128,3,"The Ape City",0), + array(12129,3,"The Ape City",1), + array(12101,1,"The Ancient Tombs",0), + array(12102,1,"The Ancient Tombs",0), + array(12103,1,"The Ancient Tombs",0), + array(12104,1,"The Ancient Tombs",0), + array(12105,1,"The Ancient Tombs",0), + array(12106,1,"The Ancient Tombs",0), + array(12107,1,"The Ancient Tombs",1), + array(12022,3,"Barbarian Test Quest",0), + array(12022,3,"Barbarian Test Quest",0), + array(12022,3,"Barbarian Test Quest",1), + array(12025,3,"The Ice Islands Quest",0), + array(12026,5,"The Ice Islands Quest",0), + array(12027,3,"The Ice Islands Quest",0), + array(12028,2,"The Ice Islands Quest",0), + array(12029,6,"The Ice Islands Quest",0), + array(12030,8,"The Ice Islands Quest",0), + array(12031,3,"The Ice Islands Quest",0), + array(12032,4,"The Ice Islands Quest",0), + array(12033,2,"The Ice Islands Quest",0), + array(12034,2,"The Ice Islands Quest",0), + array(12035,2,"The Ice Islands Quest",0), + array(12036,6,"The Ice Islands Quest",1), + ); // Vocation ids and names. $config['vocations'] = array( diff --git a/engine/function/itemparser/itemlistparser.php b/engine/function/itemparser/itemlistparser.php index a52b853..f65fb58 100644 --- a/engine/function/itemparser/itemlistparser.php +++ b/engine/function/itemparser/itemlistparser.php @@ -16,6 +16,20 @@ function getItemNameById($id) { } } +/* 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')); diff --git a/market.php b/market.php index 524395f..2d295ad 100644 --- a/market.php +++ b/market.php @@ -2,7 +2,7 @@ $server = $config['shop']['imageServer']; $imageType = $config['shop']['imageType']; - +$items = getItemList(); $compare = &$_GET['compare']; // If you are not comparing any items, present the list. @@ -37,7 +37,7 @@ if (!$compare) { foreach (($offers['wts'] ? $offers['wts'] : array()) as $o) { ?> - + " alt="Item Image"> diff --git a/myaccount.php b/myaccount.php index 6e8b457..29ec52f 100644 --- a/myaccount.php +++ b/myaccount.php @@ -131,7 +131,7 @@ if (!empty($_POST['change_gender'])) { $account_id = user_character_account_id($char_name); if ($config['TFSVersion'] == 'TFS_10') { - $chr_data = user_is_online_10($user_id); + $chr_data = user_is_online_10($char_id); } else $chr_data = user_character_data($char_id, 'online'); if ($chr_data['online'] != 1) { diff --git a/shop.php b/shop.php index 8beedf5..6285c59 100644 --- a/shop.php +++ b/shop.php @@ -44,11 +44,11 @@ if (!empty($_POST['buy'])) { user_account_add_premdays($cid, $buy['count']); echo 'You now have '.$buy['count'].' additional days of premium membership.'; } else if ($buy['type'] == 3) { - // Character sex + // Character Gender mysql_insert("INSERT INTO `znote_shop_orders` (`account_id`, `type`, `itemid`, `count`, `time`) VALUES ('$cid', '". $buy['type'] ."', '". $buy['itemid'] ."', '". $buy['count'] ."', '$time')"); echo 'You now have access to change character gender on your characters. Visit My Account to select character and change the gender.'; } else if ($buy['type'] == 4) { - // Character sex + // Character Name mysql_insert("INSERT INTO `znote_shop_orders` (`account_id`, `type`, `itemid`, `count`, `time`) VALUES ('$cid', '". $buy['type'] ."', '". $buy['itemid'] ."', '". $buy['count'] ."', '$time')"); echo 'You now have access to change character name on your characters. Visit My Account to select character and change the name.'; } else {