Set tag cover photo automatically on upload.
This commit is contained in:
parent
2d77fbdbb7
commit
e7e3a4368a
1
TODO.md
1
TODO.md
@ -1,5 +1,4 @@
|
|||||||
TODO:
|
TODO:
|
||||||
|
|
||||||
* Taggen door gebruikers
|
* Taggen door gebruikers
|
||||||
* Uploaden door gebruikers
|
|
||||||
* Album management
|
* Album management
|
||||||
|
@ -40,6 +40,9 @@ class UploadMedia extends HTMLController
|
|||||||
|
|
||||||
$new_ids[] = $asset->getId();
|
$new_ids[] = $asset->getId();
|
||||||
$asset->linkTags([$tag->id_tag]);
|
$asset->linkTags([$tag->id_tag]);
|
||||||
|
|
||||||
|
$tag->id_asset_thumb = $asset->getId();
|
||||||
|
$tag->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_REQUEST['format']) && $_REQUEST['format'] === 'json')
|
if (isset($_REQUEST['format']) && $_REQUEST['format'] === 'json')
|
||||||
|
@ -10,7 +10,7 @@ class Tag
|
|||||||
{
|
{
|
||||||
public $id_tag;
|
public $id_tag;
|
||||||
public $id_parent;
|
public $id_parent;
|
||||||
public $id_asset_id;
|
public $id_asset_thumb;
|
||||||
public $tag;
|
public $tag;
|
||||||
public $slug;
|
public $slug;
|
||||||
public $description;
|
public $description;
|
||||||
@ -254,6 +254,8 @@ class Tag
|
|||||||
return Registry::get('db')->query('
|
return Registry::get('db')->query('
|
||||||
UPDATE tags
|
UPDATE tags
|
||||||
SET
|
SET
|
||||||
|
id_parent = {int:id_parent},
|
||||||
|
id_asset_thumb = {int:id_asset_thumb},
|
||||||
tag = {string:tag},
|
tag = {string:tag},
|
||||||
count = {int:count}
|
count = {int:count}
|
||||||
WHERE id_tag = {int:id_tag}',
|
WHERE id_tag = {int:id_tag}',
|
||||||
|
Loading…
Reference in New Issue
Block a user