From 42abf4c57664d2596872d437f70b95193f9a5d18 Mon Sep 17 00:00:00 2001 From: plegall Date: Sun, 2 Apr 2006 22:26:19 +0000 Subject: 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 --- admin/picture_modify.php | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'admin/picture_modify.php') 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']) ? -- cgit v1.2.3