Changeset 5188 for trunk/admin/picture_modify.php
- Timestamp:
- Mar 19, 2010, 1:50:19 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/picture_modify.php
r5067 r5188 107 107 ); 108 108 109 // In $_POST[tags] we receive something like array('~~6~~', '~~59~~', 'New 110 // tag', 'Another new tag') The ~~34~~ means that it is an existing 111 // tag. I've added the surrounding ~~ to permit creation of tags like "10" 112 // or "1234" (numeric characters only) 109 // time to deal with tags 113 110 $tag_ids = array(); 114 111 if (isset($_POST['tags'])) 115 112 { 116 foreach ($_POST['tags'] as $raw_tag) 117 { 118 if (preg_match('/^~~(\d+)~~$/', $raw_tag, $matches)) 119 { 120 array_push($tag_ids, $matches[1]); 121 } 122 else 123 { 124 // we have to create a new tag 125 array_push( 126 $tag_ids, 127 tag_id_from_tag_name($raw_tag) 128 ); 129 } 130 } 131 } 132 133 set_tags( 134 $tag_ids, 135 $_GET['image_id'] 136 ); 113 $tag_ids = get_fckb_tag_ids($_POST['tags']); 114 } 115 set_tags($tag_ids, $_GET['image_id']); 137 116 138 117 array_push($page['infos'], l10n('Picture informations updated')); … … 195 174 196 175 // tags 197 $tags = array();198 199 176 $query = ' 200 177 SELECT 201 178 tag_id, 202 name 179 name AS tag_name 203 180 FROM '.IMAGE_TAG_TABLE.' AS it 204 181 JOIN '.TAGS_TABLE.' AS t ON t.id = it.tag_id 205 182 WHERE image_id = '.$_GET['image_id'].' 206 183 ;'; 207 $result = pwg_query($query); 208 while ($row = pwg_db_fetch_assoc($result)) 209 { 210 array_push( 211 $tags, 212 array( 213 'value' => '~~'.$row['tag_id'].'~~', 214 'caption' => $row['name'], 215 ) 216 ); 217 } 184 $tags = get_fckb_taglist($query); 218 185 219 186 // retrieving direct information about picture
Note: See TracChangeset
for help on using the changeset viewer.