Jump to content
Sign in to follow this  
aidis steam

GET Inventory 500 jquery-1.11.1.min Internal Server Error

Recommended Posts

Problem nie ładuja sie itemy mam.

 

GET http://5.196.126.85/get_inv.php?undefined 500 jquery-1.11.1.min.js:1  (Internal Server Error)

 

<?php
include ('link.php');
require_once('steamauth/steamauth.php');
@include_once('steamauth/userInfo.php');
if(!(isset($_SESSION["steamid"]))) exit(json_encode(array('success'=>false, 'error'=>'Wymagane logowanie.')));
		if((file_exists('cache/'.$user['steamid'].'.txt')) && (!isset($_GET['nocache']))) {
			$array = file_get_contents('cache/'.$user['steamid'].'.txt');
			$array = unserialize($array);
			$array['fromcache'] = true;
			if(isset($_COOKIE['tid'])) {
				$sql = $db->query('SELECT * FROM `trades` WHERE `id` = '.$db->quote($_COOKIE['tid']).' AND `status` = 0');
				if($sql->rowCount() != 0) {
					$row = $sql->fetch();
					$array['code'] = $row['code'];
					$array['amount'] = $row['summa'];
					$array['tid'] = $row['id'];
					$array['bot'] = "Bot #".$row['bot_id'];
				} else {
					setcookie("tid", "", time() - 3600, '/');
				}
			}
			exit(json_encode($array));
		}
		$prices = file_get_contents('prices.txt');
		$prices = json_decode($prices, true);
		$inv = curl('https://steamcommunity.com/profiles/'.$user['steamid'].'/inventory/json/730/2/');
		$inv = json_decode($inv, true);
		if($inv['success'] != 1) {
			exit(json_encode(array('error'=>'TwĂłj profil jest prawdopodobnie prywatny.<a href="http://steamcommunity.com/my/edit/settings" target="_blank">Ustaw swĂłj ekwipunek na publiczny</a> i <a href="javascript:loadLeft(\'nocache\')">sprĂłbuj ponownie</a>.')));
		}
		$items = array();
		foreach ($inv['rgInventory'] as $key => $value) {
			$id = $value['classid'].'_'.$value['instanceid'];
			$trade = $inv['rgDescriptions'][$id]['tradable'];
			if(!$trade) continue;
			$name = $inv['rgDescriptions'][$id]['market_hash_name'];
			$price = $prices[$name]*1000;
			if ($price <= 5000){
				$price = $price * 0.85;
			} else if ($price <= 10000){
				$price = $price * 0.93;
			}
			$img = 'http://steamcommunity-a.akamaihd.net/economy/image/'.$inv['rgDescriptions'][$id]['icon_url'];
			if((preg_match('/(Souvenir)/', $name)) || ($price < $min)) {
				$price = 0;
				$reject = 'Śmieć';
			} else {
				$reject = 'unknown item';
			}
			$items[] = array(
				'assetid' => $value['id'],
				'bt_price' => "0.00",
				'img' => $img,
				'name' => $name,
				'price' => floor($price),
				'reject' => $reject,
				'sa_price' => $price,
				'steamid' => $user['steamid']);
		}
		$array = array(
			'error' => 'none',
			'fromcache' => false,
			'items' => $items,
			'success' => true);
		if(isset($_COOKIE['tid'])) {
			$sql = $db->query('SELECT * FROM `trades` WHERE `id` = '.$db->quote($_COOKIE['tid']).' AND `status` = 0');
			if($sql->rowCount() != 0) {
				$row = $sql->fetch();
				$array['code'] = $row['code'];
				$array['amount'] = $row['summa'];
				$array['tid'] = $row['id'];
				$array['bot'] = "Bot #".$row['bot_id'];
			} else {
				setcookie("tid", "", time() - 3600, '/');
			}
		}
		file_put_contents('cache/'.$user['steamid'].'.txt', serialize($array), LOCK_EX);
		exit(json_encode($array));
		?>

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Create a New Account. It’s free and easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×
×
  • Create New...