Link pic & post

This commit is contained in:
2019-11-01 23:12:32 +01:00
parent 584accc72e
commit 1ed68c866f
20 changed files with 153 additions and 1437 deletions

View File

@@ -67,7 +67,7 @@ class Spot extends Main
Feed::SPOT_TABLE => array('ref_spot_id', 'name', 'model'),
Project::PROJ_TABLE => array('name', 'codename', 'active_from', 'active_to', 'geofile', 'timezone'),
self::POST_TABLE => array(Db::getId(Project::PROJ_TABLE), 'name', 'content', 'site_time'),
Media::MEDIA_TABLE => array(Db::getId(Project::PROJ_TABLE), 'filename', 'type', 'taken_on', 'posted_on', 'rotate')
Media::MEDIA_TABLE => array(Db::getId(Project::PROJ_TABLE), 'filename', 'type', 'taken_on', 'posted_on', 'rotate', 'comment')
),
'types' => array
(
@@ -95,7 +95,8 @@ class Spot extends Main
'filename' => "VARCHAR(100) NOT NULL",
'taken_on' => "TIMESTAMP DEFAULT 0",
'posted_on' => "TIMESTAMP DEFAULT 0",
'rotate' => "SMALLINT"
'rotate' => "SMALLINT",
'comment' => "LONGTEXT"
),
'constraints' => array
(
@@ -328,6 +329,12 @@ class Spot extends Main
return $oUploader->sBody;
}
public function addComment($iMediaId, $sComment) {
$oMedia = new Media($this->oDb, $this->oProject, $iMediaId);
$asResult = $oMedia->setComment($sComment);
return self::getJsonResult($asResult['result'], $asResult['desc'], $asResult['data']);
}
public function getAdminSettings() {
return self::getJsonResult(true, '', array('projects'=>$this->oProject->getProjects()));
}