Set tag cover photo automatically on upload.

This commit is contained in:
Aaron van Geffen 2016-09-04 14:55:23 +02:00
parent 2d77fbdbb7
commit e7e3a4368a
3 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,4 @@
TODO:
* Taggen door gebruikers
* Uploaden door gebruikers
* Album management

View File

@ -40,6 +40,9 @@ class UploadMedia extends HTMLController
$new_ids[] = $asset->getId();
$asset->linkTags([$tag->id_tag]);
$tag->id_asset_thumb = $asset->getId();
$tag->save();
}
if (isset($_REQUEST['format']) && $_REQUEST['format'] === 'json')

View File

@ -10,7 +10,7 @@ class Tag
{
public $id_tag;
public $id_parent;
public $id_asset_id;
public $id_asset_thumb;
public $tag;
public $slug;
public $description;
@ -254,6 +254,8 @@ class Tag
return Registry::get('db')->query('
UPDATE tags
SET
id_parent = {int:id_parent},
id_asset_thumb = {int:id_asset_thumb},
tag = {string:tag},
count = {int:count}
WHERE id_tag = {int:id_tag}',