From 0c437c746a8f964bf59ae9808a2b990d144bc39e Mon Sep 17 00:00:00 2001 From: AndreaChirulescu Date: Tue, 13 Apr 2021 19:23:59 +0200 Subject: Fixes of LF and extra spaces done by ATOM --- .../public/shortcodes/giglog_process_files.php | 134 ++++++++++----------- 1 file changed, 67 insertions(+), 67 deletions(-) (limited to 'includes/public/shortcodes/giglog_process_files.php') diff --git a/includes/public/shortcodes/giglog_process_files.php b/includes/public/shortcodes/giglog_process_files.php index c3e3427..69a9a26 100644 --- a/includes/public/shortcodes/giglog_process_files.php +++ b/includes/public/shortcodes/giglog_process_files.php @@ -1,67 +1,67 @@ - 3 and (is_dir($dir . '/' . $value) == false)) { - $output .= 'Filename: ' . $value . '
'; - $filecontent = file_get_contents($dir . '/' . $value); - $listcontent = str_replace(array( - "\r", - "\n" - ), '
', $filecontent); //tring to replace end of lines with brs for html - - $output .= 'FILE CONTENT
'; - $r = 1; - //processing each line of the file into a new row in wpg_files table - if (isset($_POST['InsertFileContent'])) { - $lines = new SplFileObject($dir . '/' . $value); - //and then execute a sql query here - $table = 'wpg_files'; - foreach ($lines as $newconcert) { - $output .= '
  • ' . $newconcert . '
  • '; - $wpdb->insert($table, array( - 'id' => '', - 'filename' => $value, - 'rowid' => $r, - 'rowcontent' => $newconcert - )); - $r++; - //$wpdb->print_error(); - $output .= $wpdb->last_error; - $my_id = $wpdb->insert_id; - $output .= '
    ---------------
    Inserted rowID ' . $my_id . '
    '; - } //end processing each line - } //end file processing - - - } //end if that checks whether filename is longer than 3 and is actually a file - - if ($my_id > 0) //if anything was inserted, move file to handled - { - $output .= '
    File ' . $value . ' will be movedto handled folder'; - rename($dir . '/' . $value, $dir . '/handled/' . $value); - } - - } //end looping through all folder content - - if ($my_id > 0) { - $url1 = $_SERVER['REQUEST_URI']; - header("Refresh: 5; URL=$url1"); - } //reload page - - $output .= '
    '; - return $output; -} + 3 and (is_dir($dir . '/' . $value) == false)) { + $output .= 'Filename: ' . $value . '
    '; + $filecontent = file_get_contents($dir . '/' . $value); + $listcontent = str_replace(array( + "\r", + "\n" + ), '
    ', $filecontent); //tring to replace end of lines with brs for html + + $output .= 'FILE CONTENT
    '; + $r = 1; + //processing each line of the file into a new row in wpg_files table + if (isset($_POST['InsertFileContent'])) { + $lines = new SplFileObject($dir . '/' . $value); + //and then execute a sql query here + $table = 'wpg_files'; + foreach ($lines as $newconcert) { + $output .= '
  • ' . $newconcert . '
  • '; + $wpdb->insert($table, array( + 'id' => '', + 'filename' => $value, + 'rowid' => $r, + 'rowcontent' => $newconcert + )); + $r++; + //$wpdb->print_error(); + $output .= $wpdb->last_error; + $my_id = $wpdb->insert_id; + $output .= '
    ---------------
    Inserted rowID ' . $my_id . '
    '; + } //end processing each line + } //end file processing + + + } //end if that checks whether filename is longer than 3 and is actually a file + + if ($my_id > 0) //if anything was inserted, move file to handled + { + $output .= '
    File ' . $value . ' will be movedto handled folder'; + rename($dir . '/' . $value, $dir . '/handled/' . $value); + } + + } //end looping through all folder content + + if ($my_id > 0) { + $url1 = $_SERVER['REQUEST_URI']; + header("Refresh: 5; URL=$url1"); + } //reload page + + $output .= '
    '; + return $output; +} -- cgit v1.2.3