X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/022dfbbbe3215917d84708eb09acca93b21ae9e0..8a06f4f9392d1ac373442f82ee40428a3cb81395:/wp-admin/import/dotclear.php diff --git a/wp-admin/import/dotclear.php b/wp-admin/import/dotclear.php index fd4f2d65..da1047ff 100644 --- a/wp-admin/import/dotclear.php +++ b/wp-admin/import/dotclear.php @@ -7,34 +7,13 @@ /** Add These Functions to make our lives easier **/ -if(!function_exists('get_catbynicename')) -{ - function get_catbynicename($category_nicename) - { - global $wpdb; - - $cat_id -= 0; // force numeric - $name = $wpdb->get_var('SELECT cat_ID FROM '.$wpdb->categories.' WHERE category_nicename="'.$category_nicename.'"'); - - return $name; - } -} if(!function_exists('get_comment_count')) { function get_comment_count($post_ID) { global $wpdb; - return $wpdb->get_var('SELECT count(*) FROM '.$wpdb->comments.' WHERE comment_post_ID = '.$post_ID); - } -} - -if(!function_exists('link_cat_exists')) -{ - function link_cat_exists($catname) - { - global $wpdb; - return $wpdb->get_var('SELECT cat_id FROM '.$wpdb->linkcategories.' WHERE cat_name = "'.$wpdb->escape($catname).'"'); + return $wpdb->get_var( $wpdb->prepare("SELECT count(*) FROM $wpdb->comments WHERE comment_post_ID = %d", $post_ID) ); } } @@ -43,7 +22,7 @@ if(!function_exists('link_exists')) function link_exists($linkname) { global $wpdb; - return $wpdb->get_var('SELECT link_id FROM '.$wpdb->links.' WHERE link_name = "'.$linkname.'"'); + return $wpdb->get_var( $wpdb->prepare("SELECT link_id FROM $wpdb->links WHERE link_name = %s", $linkname) ); } } @@ -130,26 +109,26 @@ function textconv ($s) { **/ class Dotclear_Import { - function header() + function header() { echo '
'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'
'; } - function footer() + function footer() { echo ''.__('Howdy! This importer allows you to extract posts from a DotClear database into your blog. Mileage may vary.').'
'; echo ''.__('Your DotClear Configuration settings are as follows:').'
'; echo ''.sprintf(__('Done! %1$s categories imported.'), $count).'
'.sprintf(__ngettext('Done! %1$s category imported.', 'Done! %1$s categories imported.', $count), $count).'
';
- printf(__('Done! %s links or link categories imported'), $count);
+ printf(__ngettext('Done! %s link or link category imported.', 'Done! %s links or link categories imported.', $count), $count);
echo '