diff --git a/TODO.md b/TODO.md index f3691d60..4eaf1258 100644 --- a/TODO.md +++ b/TODO.md @@ -1,5 +1,4 @@ TODO: * Taggen door gebruikers -* Uploaden door gebruikers * Album management diff --git a/controllers/UploadMedia.php b/controllers/UploadMedia.php index c1d9df10..99827e1c 100644 --- a/controllers/UploadMedia.php +++ b/controllers/UploadMedia.php @@ -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') diff --git a/models/Tag.php b/models/Tag.php index 5c1b2a69..f4ef0b2d 100644 --- a/models/Tag.php +++ b/models/Tag.php @@ -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}',