Mercurial > hg > extraction-interface
comparison models/extractapp.php @ 71:26d8c4c43d86 extractapp
minor checking for variable/index in php
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Wed, 08 Apr 2015 14:57:01 +0200 |
parents | 359f48d58cbc |
children | 2daef8e36214 |
comparison
equal
deleted
inserted
replaced
70:359f48d58cbc | 71:26d8c4c43d86 |
---|---|
39 | 39 |
40 | 40 |
41 $stringInput = $lg_text; | 41 $stringInput = $lg_text; |
42 $stringInput = preg_replace("/ /u", "○", $stringInput); | 42 $stringInput = preg_replace("/ /u", "○", $stringInput); |
43 $stringInput = preg_replace("/\n/u", "<br>", $stringInput); | 43 $stringInput = preg_replace("/\n/u", "<br>", $stringInput); |
44 $stringInput = preg_replace("/【(.*?)】/u", "【<a href=\"review_index_xml_images.php?books_id=".$bookId."&pages=\\1&entry=0\" target=\"_bookImg\">\\1</a>】", $stringInput); | 44 $stringInput = preg_replace("/【(.*?)】/u", "【<a href=\"review_index_xml_images.php?books_id=".$this->book_id."&pages=\\1&entry=0\" target=\"_bookImg\">\\1</a>】", $stringInput); |
45 $lg_text = $stringInput; | 45 $lg_text = $stringInput; |
46 | 46 |
47 $this->lg_text = $lg_text; | 47 $this->lg_text = $lg_text; |
48 | 48 |
49 } | 49 } |
104 | 104 |
105 } | 105 } |
106 | 106 |
107 public function GetInfoFromPreviousPage($_postdata) { | 107 public function GetInfoFromPreviousPage($_postdata) { |
108 | 108 |
109 if ($_postdata['fileId']) { | 109 if (isset($_postdata['fileId'])) { |
110 $this->file_id = $_postdata['fileId']; | 110 $this->file_id = $_postdata['fileId']; |
111 } | 111 } |
112 if ($_postdata['sectionId']) { | 112 if (isset($_postdata['sectionId'])) { |
113 $this->section_id = $_postdata['sectionId']; | 113 $this->section_id = $_postdata['sectionId']; |
114 } | 114 } |
115 if ($_postdata['text']) { | 115 if (isset($_postdata['text'])) { |
116 $this->lg_text = $_postdata['text']; | 116 $this->lg_text = $_postdata['text']; |
117 } | 117 } |
118 if ($_postdata['branchId']) { | 118 if (isset($_postdata['branchId'])) { |
119 $this->branch_id = $_postdata['branchId']; | 119 $this->branch_id = $_postdata['branchId']; |
120 } | 120 } |
121 if ($_postdata['userId']) { | 121 if (isset($_postdata['userId'])) { |
122 $this->user_id = $_postdata['userId']; | 122 $this->user_id = $_postdata['userId']; |
123 } | 123 } |
124 if ($_postdata['topic_id']) { | 124 if (isset($_postdata['topic_id'])) { |
125 $this->topic = $_postdata['topic_id']; | 125 $this->topic = $_postdata['topic_id']; |
126 } | 126 } |
127 | 127 |
128 if ($_postdata['sectionName']) { | 128 if (isset($_postdata['sectionName'])) { |
129 $this->section_name = $_postdata['sectionName']; | 129 $this->section_name = $_postdata['sectionName']; |
130 } | 130 } |
131 if ($_postdata['bookName']) { | 131 if (isset($_postdata['bookName'])) { |
132 $this->book_name = $_postdata['bookName']; | 132 $this->book_name = $_postdata['bookName']; |
133 } | 133 } |
134 if ($_postdata['bookId']) { | 134 if (isset($_postdata['bookId'])) { |
135 $this->book_id = $_postdata['bookId']; | 135 $this->book_id = $_postdata['bookId']; |
136 } | 136 } |
137 if ($_postdata['currentFileId']) { | 137 if (isset($_postdata['currentFileId'])) { |
138 $this->current_fileId = $_postdata['currentFileId']; | 138 $this->current_fileId = $_postdata['currentFileId']; |
139 } | 139 } |
140 if ($_postdata['taglistArray']) { | 140 if (isset($_postdata['taglistArray'])) { |
141 $this->taglist_infile = json_decode($_postdata['taglistArray']); | 141 $this->taglist_infile = json_decode($_postdata['taglistArray']); |
142 } | 142 } |
143 if ($_postdata['book_meta']) { | 143 if (isset($_postdata['book_meta'])) { |
144 $this->book_meta = json_decode($_postdata['book_meta']); | 144 $this->book_meta = json_decode($_postdata['book_meta']); |
145 } | 145 } |
146 | 146 |
147 | 147 |
148 } | 148 } |
1244 $listString = preg_replace("/<span(.*?)>/u", "", $listString); | 1244 $listString = preg_replace("/<span(.*?)>/u", "", $listString); |
1245 $listString = preg_replace("/<\/span>/u", "", $listString); | 1245 $listString = preg_replace("/<\/span>/u", "", $listString); |
1246 //$listString = preg_replace("/\n/u", "|", $listString); | 1246 //$listString = preg_replace("/\n/u", "|", $listString); |
1247 | 1247 |
1248 $wordlistArray2 = explode( "\n", $listString ); | 1248 $wordlistArray2 = explode( "\n", $listString ); |
1249 usort($wordlistArray2,'sortFunction'); | 1249 //usort($wordlistArray2,'sortFunction'); |
1250 foreach ( $wordlistArray2 as $index=>$value ) { | 1250 foreach ( $wordlistArray2 as $index=>$value ) { |
1251 $wordlistArray2[$index] = implode("○?", preg_split("/(?<!^)(?!$)/u", $value)); | 1251 $wordlistArray2[$index] = implode("○?", preg_split("/(?<!^)(?!$)/u", $value)); |
1252 } | 1252 } |
1253 foreach ( $wordlistArray2 as $index=>$value ) { | 1253 foreach ( $wordlistArray2 as $index=>$value ) { |
1254 if ($value=="") unset($wordlistArray2[$index]); | 1254 if ($value=="") unset($wordlistArray2[$index]); |