<html>
<body>
<?
/*************************************************

gb_scout.php - Move Guestbook Entrys of the www.perfectweb-design.de Guestbook into the Comment Guestbook of Wordpress 2.3.3
Author: David Wagner <f2@hudecity.de>
Copyright (c): 1999-2008 F2 Technologies ;-), all rights reserved
Version: 1.0

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.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

You may contact the author of gb_scout.php by e-mail at:
f2@hudecity.de
*************************************************/

// *** Ziel DB *******

define('DB_NAME', '');
define('DB_USER', '');
define('DB_PASSWORD', '');
define('DB_HOST', 'localhost');   
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');


// *** QUELL DB *******

define ( 'MYSQL_HOST', '127.0.0.1' ); 
define ( 'MYSQL_BENUTZER', '' ); 
define ( 'MYSQL_KENNWORT', '' ); 
define ( 'MYSQL_DATENBANK', '' ); 
$db_link = mysql_connect (MYSQL_HOST, MYSQL_BENUTZER, MYSQL_KENNWORT); 
mysql_select_db( MYSQL_DATENBANK ); 
$tabelle ="_Name der Quelltabelle der Guestbook Entries_";

$sql = "SELECT * FROM ". $tabelle; 
$db_erg = mysql_query( $sql ); 
if ( ! $db_erg ) 
{ 
die('Ungültige Abfrage: ' . mysql_error()); 
} 
while ($quelle = mysql_fetch_array( $db_erg, MYSQL_ASSOC)) 
{ 
  $datum = date("Y-m-d",$quelle['datum']);
  $uhrzeit = date("H:i:s",$quelle['datum']);

$quelle['nachricht'] = ereg_replace("'","",$quelle['nachricht']);
$quelle['name'] = ereg_replace("'","",$quelle['name']);
  
  
// und rein mit den alten dingern
$conn = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
mysql_select_db(DB_NAME, $conn);
@mysql_query("SET CHARACTER SET 'utf8'", $conn);
@mysql_query("SET NAMES utf8", $conn);
$ziel['comment_post_ID'] = "??";		//Hier die ID der Guestbook Comments Categorie
$ziel['comment_author'] = stripslashes($quelle['name']);;
$ziel['comment_author_email'] = $quelle['email'];
$ziel['comment_author_url'] = "";
$ziel['comment_author_IP'] = " NOIP";
$ziel['comment_date'] = $datum ." ". $uhrzeit;
$ziel['comment_date_gmt'] = "";
$ziel['comment_content'] = stripslashes($quelle['nachricht']);
$ziel['comment_karma'] = "0";
$ziel['comment_approved'] = "1";
$ziel['comment_agent'] = "";
$ziel['comment_type'] = "";
$ziel['comment_parent'] = "0";
$ziel['user_id'] = "0";
mysql_query("INSERT INTO wp_comments (comment_post_ID,comment_author,comment_author_email,comment_author_url,comment_author_IP,comment_date,comment_date_gmt,comment_content,comment_karma,comment_approved,comment_agent,comment_type,comment_parent,user_id) VALUES ('".$ziel['comment_post_ID']."','".$ziel['comment_author']."','".$ziel['comment_author_email']."','".$ziel['comment_author_url']."','".$ziel['comment_author_IP']."','".$ziel['comment_date']."','".$ziel['comment_date_gmt']."','".$ziel['comment_content']."','".$ziel['comment_karma']."','".$ziel['comment_approved']."','".$ziel['comment_agent']."','".$ziel['comment_type']."','".$ziel['comment_parent']."','".$ziel['user_id']."')", $conn)
or    die("bumm: " . mysql_error());
echo "Done!";
} 

mysql_free_result( $db_erg ); 
?> 
</body>
</html>









