From da07b1d1c0fe4fc8d67b069b0734ff2ce5e9c6ea Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 21 Mar 2006 00:14:18 +0000 Subject: [PATCH] Allow alternative table prefix in dotclear importer. Props thomasq. fixes #2388 git-svn-id: https://develop.svn.wordpress.org/trunk@3650 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/import/dotclear.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/wp-admin/import/dotclear.php b/wp-admin/import/dotclear.php index 8b32ff135c..9dc8a6e9b2 100644 --- a/wp-admin/import/dotclear.php +++ b/wp-admin/import/dotclear.php @@ -157,10 +157,10 @@ class Dotclear_Import { // General Housekeeping $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost')); set_magic_quotes_runtime(0); - $prefix = get_option('tpre'); + $dbprefix = get_option('dcdbprefix'); // Get Categories - return $dcdb->get_results('SELECT * FROM dc_categorie', ARRAY_A); + return $dcdb->get_results('SELECT * FROM '.$dbprefix.'categorie', ARRAY_A); } function get_dc_users() @@ -169,11 +169,11 @@ class Dotclear_Import { // General Housekeeping $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost')); set_magic_quotes_runtime(0); - $prefix = get_option('tpre'); + $dbprefix = get_option('dcdbprefix'); // Get Users - return $dcdb->get_results('SELECT * FROM dc_user', ARRAY_A); + return $dcdb->get_results('SELECT * FROM '.$dbprefix.'user', ARRAY_A); } function get_dc_posts() @@ -181,12 +181,12 @@ class Dotclear_Import { // General Housekeeping $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost')); set_magic_quotes_runtime(0); - $prefix = get_option('tpre'); + $dbprefix = get_option('dcdbprefix'); // Get Posts - return $dcdb->get_results('SELECT dc_post.*, dc_categorie.cat_libelle_url AS post_cat_name - FROM dc_post INNER JOIN dc_categorie - ON dc_post.cat_id = dc_categorie.cat_id', ARRAY_A); + return $dcdb->get_results('SELECT '.$dbprefix.'post.*, '.$dbprefix.'categorie.cat_libelle_url AS post_cat_name + FROM '.$dbprefix.'post INNER JOIN '.$dbprefix.'categorie + ON '.$dbprefix.'post.cat_id = '.$dbprefix.'categorie.cat_id', ARRAY_A); } function get_dc_comments() @@ -195,10 +195,10 @@ class Dotclear_Import { // General Housekeeping $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost')); set_magic_quotes_runtime(0); - $prefix = get_option('tpre'); + $dbprefix = get_option('dcdbprefix'); // Get Comments - return $dcdb->get_results('SELECT * FROM dc_comment', ARRAY_A); + return $dcdb->get_results('SELECT * FROM '.$dbprefix.'comment', ARRAY_A); } function get_dc_links() @@ -206,7 +206,7 @@ class Dotclear_Import { //General Housekeeping $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost')); set_magic_quotes_runtime(0); - $dbprefix = get_option('dbprefix'); + $dbprefix = get_option('dcdbprefix'); return $dcdb->get_results('SELECT * FROM '.$dbprefix.'link ORDER BY position', ARRAY_A); } @@ -609,7 +609,7 @@ class Dotclear_Import { function cleanup_dcimport() { - delete_option('dbprefix'); + delete_option('dcdbprefix'); delete_option('dc_cats'); delete_option('dcid2wpid'); delete_option('dccat2wpcat'); @@ -699,9 +699,9 @@ class Dotclear_Import { } if($_POST['dbprefix']) { - if(get_option('tpre')) - delete_option('tpre'); - add_option('tpre',$_POST['dbprefix']); + if(get_option('dcdbprefix')) + delete_option('dcdbprefix'); + add_option('dcdbprefix',$_POST['dbprefix']); }