Mercurial > hg > extraction-interface
comparison models/extractapp.php @ 52:94064f625650 extractapp
assign book_meta to NULL if it's empty
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Thu, 26 Mar 2015 16:23:33 +0100 |
parents | 840cdb52f476 |
children | f9594c240826 |
comparison
equal
deleted
inserted
replaced
51:840cdb52f476 | 52:94064f625650 |
---|---|
63 $lg_text_url = $this->get_text_from_sectionId_url.$section_id; | 63 $lg_text_url = $this->get_text_from_sectionId_url.$section_id; |
64 $lg_text = file_get_contents($lg_text_url); | 64 $lg_text = file_get_contents($lg_text_url); |
65 | 65 |
66 // TODO: get book_meta from $_postdata and set $this->book_meta: book_id,book_name,author,year,pagenumber | 66 // TODO: get book_meta from $_postdata and set $this->book_meta: book_id,book_name,author,year,pagenumber |
67 $book_meta = array(); | 67 $book_meta = array(); |
68 array_push($book_meta, array($this->book_id,$this->book_name,"","","")); // missing author,year,pagenumber | 68 array_push($book_meta, array($this->book_id,$this->book_name,"NULL","NULL","NULL")); // missing author,year,pagenumber |
69 | 69 |
70 $this->book_meta = $book_meta; | 70 $this->book_meta = $book_meta; |
71 | 71 |
72 | 72 |
73 | 73 |
396 if ($_postdata['text']){ | 396 if ($_postdata['text']){ |
397 $date = date('Y_m_d_H_i_s', time()); | 397 $date = date('Y_m_d_H_i_s', time()); |
398 if ( file_exists("data/parsing_files/".$_postdata['sectionId'].".txt") ) { | 398 if ( file_exists("data/parsing_files/".$_postdata['sectionId'].".txt") ) { |
399 $oldFile = file_get_contents("data/parsing_files/".$_postdata['sectionId'].".txt"); | 399 $oldFile = file_get_contents("data/parsing_files/".$_postdata['sectionId'].".txt"); |
400 //saving in my local machine in developing phrase | 400 //saving in my local machine in developing phrase |
401 file_put_contents("data/parsing_files/".$_postdata['sectionId']."_".$date.".txt", $oldFile); | 401 //file_put_contents("data/parsing_files/".$_postdata['sectionId']."_".$date.".txt", $oldFile); |
402 } | 402 } |
403 | 403 |
404 if (get_magic_quotes_gpc()) { | 404 if (get_magic_quotes_gpc()) { |
405 $require = stripslashes($_postdata['text']); | 405 $require = stripslashes($_postdata['text']); |
406 } else { | 406 } else { |
418 $require = "<text_content>\n".$require."</text_content>\n"; | 418 $require = "<text_content>\n".$require."</text_content>\n"; |
419 } | 419 } |
420 $require = $this->AppendMetaData($require); | 420 $require = $this->AppendMetaData($require); |
421 | 421 |
422 //saving in my local machine in developing phrase | 422 //saving in my local machine in developing phrase |
423 file_put_contents("data/parsing_files/".$_postdata['sectionId'].".txt", $require); | 423 //file_put_contents("data/parsing_files/".$_postdata['sectionId'].".txt", $require); |
424 } | 424 } |
425 | 425 |
426 // ------ | 426 // ------ |
427 | 427 |
428 | 428 |