<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />PHP nuke / United Nuke to WordPress v1.0.04
<!--?php
/**
* PHP nuke / United Nuke to WordPress v1.0.04
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
**/
// Database connection PHP nuke / United Nuke
$con = mysql_pconnect("localhost","name","password"); // server, name, password
// Change encoding to utf-8
mysql_query('SET NAMES utf8');
mysql_query("SET CHARACTER SET utf8");
mysql_query('SET CHARACTER_SET_CLIENT=utf8');
mysql_query('SET CHARACTER_SET_RESULTS=utf8');
if (!$con)
{die('The connection to the PHP Nuke / United Nuke server failed: ' . mysql_error()); }
$db_selected = mysql_select_db('prefix_nuke', $con); // PHP nuke / United Nuke database name
echo '<em-->Database PHP nuke / United Nuke connected. <br?>';
if (!$db_selected) { die ('<em>The connection to the PHP Nuke / United Nuke server failed:</em> ' . mysql_error());}
// Database connection WordPress
$con1 = mysql_connect("localhost","name","password","wp_database"); // server, name, password, name wp database
if (!$con1) // Fixed bugs by WebSupport.sk
{die('<em>The connection to the WordPress server failed:</em> ' . mysql_error()); }
echo '<em>WordPress database connected. </em>
';
// Select the desired field of PHP Nuke / United Nuke
$contunit = mysql_query("select * FROM `tableprefix_stories`", $con);
while($nuke = mysql_fetch_array($contunit)) {
$sid = $nuke['sid'];
$title = $nuke['title'];
$time = $nuke['time'];
$bodytext = $nuke['bodytext'];
// Creating a URL of the article title, and the creation of
$odstrandia = Array('ä'=>'a', 'Ä'=>'A', 'á'=>'a', 'Á'=>'A', 'à'=>'a', 'À'=>'A', 'ã'=>'a', 'Ã'=>'A', 'â'=>'a', 'Â'=>'A', 'č'=>'c', 'Č'=>'C', 'ć'=>'c', 'Ć'=>'C', 'ď'=>'d', 'Ď'=>'D', 'ě'=>'e', 'Ě'=>'E', 'é'=>'e', 'É'=>'E', 'ë'=>'e', 'Ë'=>'E', 'è'=>'e', 'È'=>'E', 'ê'=>'e', 'Ê'=>'E', 'í'=>'i', 'Í'=>'I', 'ï'=>'i', 'Ï'=>'I', 'ì'=>'i', 'Ì'=>'I', 'î'=>'i', 'Î'=>'I', 'ľ'=>'l', 'Ľ'=>'L', 'ĺ'=>'l', 'Ĺ'=>'L', 'ń'=>'n', 'Ń'=>'N', 'ň'=>'n', 'Ň'=>'N', 'ñ'=>'n', 'Ñ'=>'N', 'ó'=>'o', 'Ó'=>'O', 'ö'=>'o', 'Ö'=>'O', 'ô'=>'o', 'Ô'=>'O', 'ò'=>'o', 'Ò'=>'O', 'õ'=>'o', 'Õ'=>'O', 'ő'=>'o', 'Ő'=>'O', 'ř'=>'r', 'Ř'=>'R', 'ŕ'=>'r', 'Ŕ'=>'R', 'š'=>'s', 'Š'=>'S', 'ś'=>'s', 'Ś'=>'S', 'ť'=>'t', 'Ť'=>'T', 'ú'=>'u', 'Ú'=>'U', 'ů'=>'u', 'Ů'=>'U', 'ü'=>'u', 'Ü'=>'U', 'ù'=>'u', 'Ù'=>'U', 'ũ'=>'u', 'Ũ'=>'U', 'û'=>'u', 'Û'=>'U','ý'=>'y', 'Ý'=>'Y', 'ž'=>'z', 'Ž'=>'Z', 'ź'=>'z', 'Ź'=>'Z');
// Removing original method - strtr
$urlone = strtr($title, $odstrandia);
$urldva = StrToLower($urlone); // Change to lower case
$urldvaa = Trim($urldva); // Gaps at the end and the beginning
$urltri = str_replace(" ", "-", $urldvaa); // Replace the clean field gap
$urlsty = str_replace(":", "", $urltri); // Replace the colon clean for field
$urlpa = str_replace(",", "", $urlsty); // Change comma after the clean field
$url = "http://wp.domain.com/".$urlpa."-".$sid.".html";
$postname = $urlpa."-".$sid;
// Insertion of an Article in WordPressu
$sql= "INSERT INTO table_prefix.wp_posts VALUES ('',1,'$time','$time','$bodytext','$title','','publish', 'open', 'open','','$postname','','','$time','$time','',0,'$url',0,'post','',0 )";
$kontrola=mysql_query($sql);
}
if($kontrola){
echo "
<strong>Job finished...</strong>";
}
else {
echo "<strong>Error!</strong>";
}
?>
download code