Mercurial > hg > extraction-interface
diff models/extractapp.php @ 65:f9ae94a9b041 extractapp
New: adding topic names: name_en, name_ch, name_pinyin
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Thu, 02 Apr 2015 11:45:09 +0200 |
parents | 3395385476d1 |
children | e71a437ae49f |
line wrap: on
line diff
--- a/models/extractapp.php Wed Apr 01 15:13:37 2015 +0200 +++ b/models/extractapp.php Thu Apr 02 11:45:09 2015 +0200 @@ -316,7 +316,7 @@ // text_content $text .= $text_content; - $text .= "\n</text>"; + $text .= "</text>"; return $text; } @@ -350,7 +350,7 @@ if ($_postdata['branchId'] == 0) { // -- new branch case - $require = "<text_content>\n".$require."</text_content>\n"; + $require = "<text_content>".$require."</text_content>\n"; } $require = $this->AppendMetaData($require); @@ -739,7 +739,9 @@ $topic = $postdata['topic']; $result = $this->GetTopicByID($topic); $row = mysql_fetch_assoc($result); - $topic_name = $row['name']; + $topic_name_en = $row['name_en']; + $topic_name_ch = $row['name_ch']; + $topic_name_pinyin = $row['name_pinyin']; /* $query = "SELECT taglist.*, topic_tag_relation.topic_id FROM taglist LEFT JOIN topic_tag_relation ON taglist.id = topic_tag_relation.tag_id ORDER BY `topic_id`"; @@ -813,7 +815,7 @@ $data = array(); //$data['taglistArray'] = $taglistArray; $data['topic'] = $topic; - $data['topic_name'] = $topic_name; + $data['topic_name'] = array('name_en'=>$topic_name_en,'name_ch'=>$topic_name_ch,'name_pinyin'=>$topic_name_pinyin); $data['tag_intopic'] = $tag_intopic; $data['tag_others'] = $tag_others; @@ -964,7 +966,8 @@ $topiclistArray = array(); $result = $this->GetTopiclist(); while ($row = mysql_fetch_assoc($result)) { - array_push($topiclistArray, array('id'=>$row['id'],'name'=>$row['name'],'tag'=>$row['tag'])); + //array_push($topiclistArray, array('id'=>$row['id'],'name'=>$row['name'],'tag'=>$row['tag'])); + array_push($topiclistArray, array('id'=>$row['id'],'tag'=>$row['tag'],'name_en'=>$row['name_en'],'name_ch'=>$row['name_ch'],'name_pinyin'=>$row['name_pinyin'],)); } return $topiclistArray; } @@ -980,7 +983,8 @@ private function GetTopicName($topic_id) { $result = $this->GetTopicByID($topic_id); $row = mysql_fetch_assoc($result); - $name = $row['name']; + //$name = $row['name']; + $name = array('name_en'=>$row['name_en'], 'name_ch'=>$row['name_ch'], 'name_pinyin'=>$row['name_pinyin']); return $name; }