comparison models/extractapp.php @ 55:e930eb88b547 extractapp

bug fixed: when addTagTitle, removing self-closing tag which causes error in coloring tag
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Mon, 30 Mar 2015 15:43:47 +0200
parents f9e7119339b2
children 95f929d7b318
comparison
equal deleted inserted replaced
54:f9e7119339b2 55:e930eb88b547
402 if ($_postdata['text']){ 402 if ($_postdata['text']){
403 $date = date('Y_m_d_H_i_s', time()); 403 $date = date('Y_m_d_H_i_s', time());
404 if ( file_exists("data/parsing_files/".$_postdata['sectionId'].".txt") ) { 404 if ( file_exists("data/parsing_files/".$_postdata['sectionId'].".txt") ) {
405 $oldFile = file_get_contents("data/parsing_files/".$_postdata['sectionId'].".txt"); 405 $oldFile = file_get_contents("data/parsing_files/".$_postdata['sectionId'].".txt");
406 //saving in my local machine in developing phrase 406 //saving in my local machine in developing phrase
407 file_put_contents("data/parsing_files/".$_postdata['sectionId']."_".$date.".txt", $oldFile); 407 //file_put_contents("data/parsing_files/".$_postdata['sectionId']."_".$date.".txt", $oldFile);
408 } 408 }
409 409
410 if (get_magic_quotes_gpc()) { 410 if (get_magic_quotes_gpc()) {
411 $require = stripslashes($_postdata['text']); 411 $require = stripslashes($_postdata['text']);
412 } else { 412 } else {
418 $require = preg_replace("/【<a(.*?)>(.*?)<\/a>】/u", "【\\2】", $require); 418 $require = preg_replace("/【<a(.*?)>(.*?)<\/a>】/u", "【\\2】", $require);
419 $require = preg_replace('/&amp;/u', "&", $require); 419 $require = preg_replace('/&amp;/u', "&", $require);
420 $require = preg_replace("/○/u", " ", $require); 420 $require = preg_replace("/○/u", " ", $require);
421 $require = preg_replace("/<br>/u", "\n", $require); 421 $require = preg_replace("/<br>/u", "\n", $require);
422 //$require = preg_replace("/<br>/u", "\n", $require); 422 //$require = preg_replace("/<br>/u", "\n", $require);
423 423
424 echo "----------------------------------<br>"; 424 echo "----------------------------------<br>";
425 echo "Debug: (full text after) ". $require; 425 echo "Debug: (full text after) ". $require;
426 426
427 if ($_postdata['branchId'] == 0) { 427 if ($_postdata['branchId'] == 0) {
428 // -- new branch case 428 // -- new branch case
429 $require = "<text_content>\n".$require."</text_content>\n"; 429 $require = "<text_content>\n".$require."</text_content>\n";
430 } 430 }
431 $require = $this->AppendMetaData($require); 431 $require = $this->AppendMetaData($require);
432 432
433 //saving in my local machine in developing phrase 433 //saving in my local machine in developing phrase
434 file_put_contents("data/parsing_files/".$_postdata['sectionId'].".txt", $require); 434 //file_put_contents("data/parsing_files/".$_postdata['sectionId'].".txt", $require);
435 } 435 }
436 436
437 // ------ 437 // ------
438 438
439 439
477 'Content-type: multipart/form-data;charset=utf-8' 477 'Content-type: multipart/form-data;charset=utf-8'
478 )); 478 ));
479 479
480 // execute the request 480 // execute the request
481 // **** commended to DEBUG *** 481 // **** commended to DEBUG ***
482 //$output = curl_exec($ch); 482 $output = curl_exec($ch);
483 // ***** 483 // *****
484 484
485 // output the profile information - includes the header 485 // output the profile information - includes the header
486 //echo($output) . PHP_EOL; 486 //echo($output) . PHP_EOL;
487 487