update mx map object

This commit is contained in:
kremsy 2014-05-11 19:51:53 +02:00
parent f9df0fc325
commit 2650db54e3

View File

@ -18,7 +18,7 @@ class MXMapInfo {
public $exebld, $routes, $length, $unlimiter, $laps, $difficulty, $lbrating, $trkvalue;
public $replaytyp, $replayid, $replaycnt, $acomment, $awards, $comments;
public $pageurl, $replayurl, $imageurl, $thumburl, $downloadurl, $dir;
public $ratingVoteCount, $ratingVoteAverage;
public $ratingVoteCount, $ratingVoteAverage, $vehicleName;
/**
* Returns map object with all available data from MX map data
@ -75,6 +75,7 @@ class MXMapInfo {
$this->acomment = $mx->Comments;
$this->awards = isset($mx->AwardCount) ? $mx->AwardCount : 0;
$this->comments = $mx->CommentCount;
$this->vehicleName = isset($mx->VehicleName) ? $mx->VehicleName : '';
$this->ratingVoteCount = isset($mx->RatingVoteCount) ? $mx->RatingVoteCount : 0;
$this->ratingVoteAverage = isset($mx->RatingVoteAverage) ? $mx->RatingVoteAverage : 0;
@ -91,10 +92,21 @@ class MXMapInfo {
$this->acomment = preg_replace('/\[url=.*\]/', '<i>', $this->acomment);
$this->pageurl = 'http://' . $this->prefix . '.mania-exchange.com/' . $this->dir . '/view/' . $this->id;
$this->imageurl = 'http://' . $this->prefix . '.mania-exchange.com/' . $this->dir . '/screenshot/normal/' . $this->id;
$this->thumburl = 'http://' . $this->prefix . '.mania-exchange.com/' . $this->dir . '/screenshot/small/' . $this->id;
$this->downloadurl = 'http://' . $this->prefix . '.mania-exchange.com/' . $this->dir . '/download/' . $this->id;
if ($mx->HasScreenshot) {
$this->imageurl = 'http://' . $this->prefix . '.mania-exchange.com/' . $this->dir . '/screenshot/normal/' . $this->id;
} else {
$this->imageurl = '';
}
if ($mx->HasThumbnail) {
$this->thumburl = 'http://' . $this->prefix . '.mania-exchange.com/' . $this->dir . '/screenshot/small/' . $this->id;
} else {
$this->thumburl = '';
}
if ($this->prefix == 'tm' && $this->replayid > 0) {
$this->replayurl = 'http://' . $this->prefix . '.mania-exchange.com/replays/download/' . $this->replayid;
} else {