diff --git a/classes/GridUserInfo.php b/classes/GridUserInfo.php index cfd2eeb..defde3b 100644 --- a/classes/GridUserInfo.php +++ b/classes/GridUserInfo.php @@ -267,22 +267,24 @@ private function AddToCache() {$this->MySql->query("REPLACE INTO userdata(id, userdata, lastreq, image)VALUES({0}, {1}, {2}, {3})", array($this->Uuid, $this->ToJson(), $this->LastRequest, $this->ProfileImageBlob));} - public function ToArray() + public function ToArray($ExportImage = true) { if (!empty($this->FirstName)) { - return array("uuid" => $this->Uuid, - "firstname" => $this->FirstName, - "lastname" => $this->LastName, - "homegrid" => $this->HomeGrid, - "birthunix" => $this->BirthUnix, - "profileimage" => $this->ProfileImageUuid, - "about" => $this->ProfileAbout, - "title" => $this->UserTitle, - "home" => $this->HomeRegionName, - "homelocation" => $this->HomeRegionPos, - "img" => $this->ProfileImageBlob, - "homeuri" => $this->HomeRegionUri); + $Export = array("uuid" => $this->Uuid, + "firstname" => $this->FirstName, + "lastname" => $this->LastName, + "homegrid" => $this->HomeGrid, + "birthunix" => $this->BirthUnix, + "profileimage" => $this->ProfileImageUuid, + "about" => $this->ProfileAbout, + "title" => $this->UserTitle, + "home" => $this->HomeRegionName, + "homelocation" => $this->HomeRegionPos, + "homeuri" => $this->HomeRegionUri); + if ($ExportImage) + {$Export["img"] = $this->ProfileImageBlob;} + return $Export; } else {return false;} @@ -291,7 +293,7 @@ public function ToJson() { if (!empty($this->FirstName)) - {return json_encode($this->ToArray());} + {return json_encode($this->ToArray(false));} else {return false;} } diff --git a/index.php b/index.php index e88c686..1afb113 100644 --- a/index.php +++ b/index.php @@ -67,8 +67,7 @@ for ($i = 0; $i < count($AllUsers); ++$i) { $SingleUser = explode(",", $AllUsers[$i]); - for ($z = 0; $z < count($SingleUser); ++$z) - {$SingleUser[$z] = trim($SingleUser[$z]);} + for ($z = 0; $z < count($SingleUser); ++$z) {$SingleUser[$z] = trim($SingleUser[$z]);} if (!empty($SingleUser[0]) && !empty($SingleUser[1])) { //The magic is done here