tools:db:spbimporter
Differences
This shows you the differences between two versions of the page.
| tools:db:spbimporter [2019/01/12 17:53] โ external edit 127.0.0.1 | tools:db:spbimporter [2020/01/01 00:04] (current) โ removed arvid | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== SPB Importer ====== | ||
| - | **BACKUP** your original '' | ||
| - | |||
| - | '' | ||
| - | |||
| - | |||
| - | ===== Installing and using ===== | ||
| - | |||
| - | - Copy the code that follows into a file named '' | ||
| - | - Put the file in your flatpress/ root and point your browser to %%http:// | ||
| - | - **IMPORTANT**: | ||
| - | |||
| - | |||
| - | |||
| - | ===== Important additional information ===== | ||
| - | |||
| - | '' | ||
| - | |||
| - | GZ import is disabled by default, so to issue the conversion you must point your browser to %%http:// | ||
| - | |||
| - | **WARNING** Once you run this script, if you SKIPPED GZ files, then you should run the script once again with '' | ||
| - | |||
| - | You can also try the [[tools: | ||
| - | |||
| - | ===== isoconvert.php ===== | ||
| - | <file php isoconvert.php> | ||
| - | <?php | ||
| - | |||
| - | header(' | ||
| - | |||
| - | require_once(' | ||
| - | require_once(INCLUDES_DIR.' | ||
| - | | ||
| - | error_reporting(E_ALL); | ||
| - | |||
| - | |||
| - | class utfencoder extends fs_filelister { | ||
| - | | ||
| - | var $_directory = CONTENT_DIR; | ||
| - | var $foundgz = false; | ||
| - | | ||
| - | function _checkFile($d, | ||
| - | |||
| - | $p=" | ||
| - | if (is_dir($p)) { | ||
| - | return 1; | ||
| - | } else { | ||
| - | |||
| - | $DO_GZ = (isset($_GET[' | ||
| - | |||
| - | echo " | ||
| - | $s = io_load_file($p); | ||
| - | |||
| - | if ((strpos( $p, ' | ||
| - | |||
| - | |||
| - | if (!$DO_GZ) { | ||
| - | $this-> | ||
| - | |||
| - | echo "GZ: SKIPPED\n"; | ||
| - | return 2; | ||
| - | } | ||
| - | |||
| - | echo " | ||
| - | $s = gzinflate(substr($s, | ||
| - | |||
| - | if (strpos($f, ' | ||
| - | io_write_file($d . '/ | ||
| - | echo " | ||
| - | } | ||
| - | |||
| - | $f = substr($f, 0,-3); | ||
| - | unlink($p); | ||
| - | $p = " | ||
| - | |||
| - | |||
| - | } | ||
| - | |||
| - | $s = mb_convert_encoding($s, | ||
| - | if (($f != ' | ||
| - | echo " IMPORTING $f from old versions "; | ||
| - | |||
| - | // compatibility with old versions -__-' | ||
| - | $cont = explode(' | ||
| - | | ||
| - | if (strpos($f, ' | ||
| - | $s = " | ||
| - | } elseif (strpos($f, ' | ||
| - | $s = " | ||
| - | } else { | ||
| - | echo " | ||
| - | return; | ||
| - | } | ||
| - | | ||
| - | } | ||
| - | |||
| - | // remove or replace offending keys | ||
| - | $s = str_replace(' | ||
| - | $s = str_replace(' | ||
| - | |||
| - | $s = io_write_file($p, | ||
| - | |||
| - | |||
| - | echo " | ||
| - | | ||
| - | } | ||
| - | | ||
| - | } | ||
| - | | ||
| - | } | ||
| - | |||
| - | echo " | ||
| - | echo " | ||
| - | |||
| - | |||
| - | $o =& new utfencoder; | ||
| - | echo " | ||
| - | |||
| - | if ($o-> | ||
| - | |||
| - | echo " | ||
| - | echo "so you should call again this script as in / | ||
| - | echo " | ||
| - | |||
| - | } | ||
| - | |||
| - | ?> | ||
| - | </ | ||
tools/db/spbimporter.1547312012.txt.gz ยท Last modified: by 127.0.0.1
