Mercurial > hg > extraction-interface
diff develop/models/extractapp.php @ 45:3d6b8fb7335d extractapp
lock the topic tag when edit tag list
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Fri, 13 Mar 2015 14:47:23 +0100 |
parents | c245d54eab9f |
children | b3ca5d2b4d3f |
line wrap: on
line diff
--- a/develop/models/extractapp.php Thu Mar 12 17:58:09 2015 +0100 +++ b/develop/models/extractapp.php Fri Mar 13 14:47:23 2015 +0100 @@ -715,24 +715,28 @@ $result = $this->GetTaglistByTopicID($topic_id); $taglistArray = array(); + foreach ($result as $row) { $taglistArray[$row[0]] = array($row[1], $row[2], $row[3]); //$taglistArray[$row['id']] = array($row['name'], $row['tag'], $row['color']); // TODO: the format is not good, so I use $row[0], $row[1],... This could be changed some time. } - /* - //$result = $this->GetTaglist(); - $taglistArray = array(); - while ($row = mysql_fetch_assoc($result)) { - $taglistArray[$row['id']] = array($row['name'], $row['tag'], $row['color']); + $topic_tag_name = $this->GetTopicTag($topic_id); + + $query = "SELECT id FROM taglist WHERE taglist.tag='".$topic_tag_name."'"; + $result = mysql_query($query); + if (!$result) { + echo json_encode(mysql_error()); } - */ + $row = mysql_fetch_assoc($result); + $topic_tag_id = $row['id']; $data = array(); $data['taglistArray'] = $taglistArray; $data['topic_id'] = $topic_id; $data['largest_id'] = $largest_id; + $data['topic_tag_id'] = $topic_tag_id; return $data;