foundgz = true; echo "GZ: SKIPPED\n"; return 2; } echo "[WARNING] File was GZ, moving to TXT... "; $s = gzinflate(substr($s, 10 )); if (strpos($f, 'view_counter')!== false) { io_write_file($d . '/view_counter.txt'); echo "(uncompressed) "; } $f = substr($f, 0,-3); unlink($p); $p = "$d/$f"; } $s = mb_convert_encoding($s, 'UTF-8', 'ISO-8859-1'); if (($f != 'view_counter.txt') && (strpos($s, 'VERSION|') === false)) { echo " IMPORTING $f from old versions "; // compatibility with old versions -__-' $cont = explode('|', $s); if (strpos($f, 'entry')!==false) { $s = "VERSION|0.3|SUBJECT|{$cont[0]}|CONTENT|{$cont[2]}|DATE|{$cont[1]}"; } elseif (strpos($f, 'comment')!==false) { $s = "VERSION|0.3|NAME|{$cont[0]}|CONTENT|{$cont[2]}|DATE|{$cont[1]}"; } else { echo "SKIPPED\n"; return; } } // remove or replace offending keys $s = str_replace('relatedlink', 'RELATEDLINK', $s); $s = str_replace('TB_PING||', '', $s); $s = io_write_file($p, $s); echo "DONE\n"; } } } echo "======= FlatPress importer =======\n\n" ; echo "Starting process...\n"; $o =& new utfencoder; echo "\n\nFINISHED"; if ($o->foundgz) { echo "\nWARNING: DataBase contained GZ Files: FlatPress can't read GZipped files,\n" ; echo "so you should call again this script as in /isoconvert.php?ungz=true\n\n"; echo "Please notice that you will LOSE your original GZ files, so DO A BACKUP first."; } ?>