diff options
author | plegall <plg@piwigo.org> | 2006-04-02 22:26:19 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2006-04-02 22:26:19 +0000 |
commit | 42abf4c57664d2596872d437f70b95193f9a5d18 (patch) | |
tree | a1262b8601d5ac5b04b5b2e71af52c453712b9df /admin/picture_modify.php | |
parent | 68ed2ea617ede199a0e2f15fdd4886095ae600cb (diff) |
improvement: tags replace keywords. Better data model, less
limitations. Each image can be associated to as many tag as needed. Tags can
contain non ASCII characters. Oriented navigation with tags by association.
git-svn-id: http://piwigo.org/svn/trunk@1119 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | admin/picture_modify.php | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/admin/picture_modify.php b/admin/picture_modify.php index be7497a07..83bf09a23 100644 --- a/admin/picture_modify.php +++ b/admin/picture_modify.php @@ -100,16 +100,6 @@ if (isset($_POST['submit']) and count($page['errors']) == 0) } } - $keywords = get_keywords($_POST['keywords']); - if (count($keywords) > 0) - { - $data{'keywords'} = implode(',', $keywords); - } - else - { - $data{'keywords'} = ''; - } - mass_updates( IMAGES_TABLE, array( @@ -119,6 +109,11 @@ if (isset($_POST['submit']) and count($page['errors']) == 0) array($data) ); + set_tags( + isset($_POST['tags']) ? $_POST['tags'] : array(), + $_GET['image_id'] + ); + array_push($page['infos'], l10n('Picture informations updated')); } // associate the element to other categories than its storage category @@ -215,6 +210,14 @@ $row = mysql_fetch_array(pwg_query($query)); $storage_category_id = $row['category_id']; $image_file = $row['file']; +// tags +$query = ' +SELECT tag_id + FROM '.IMAGE_TAG_TABLE.' + WHERE image_id = '.$_GET['image_id'].' +;'; +$selected_tags = array_from_query($query, 'tag_id'); + // Navigation path $date = isset($_POST['date_creation']) && empty($page['errors']) @@ -257,9 +260,11 @@ $template->assign_vars( 'CREATION_DATE' => $date, - 'KEYWORDS' => - isset($_POST['keywords']) ? - stripslashes($_POST['keywords']) : @$row['keywords'], + 'TAG_SELECTION' => get_html_tag_selection( + get_all_tags(), + 'tags', + $selected_tags + ), 'DESCRIPTION' => isset($_POST['description']) ? |