Changeset 3517
- Timestamp:
- 02/12/06 07:53:23 (3 years ago)
- Files:
-
- trunk/readme.html (modified) (2 diffs)
- trunk/wp-admin/admin-db.php (modified) (10 diffs)
- trunk/wp-admin/admin-functions.php (modified) (17 diffs)
- trunk/wp-admin/admin.php (modified) (5 diffs)
- trunk/wp-admin/bookmarklet.php (modified) (2 diffs)
- trunk/wp-admin/cat-js.php (modified) (4 diffs)
- trunk/wp-admin/categories.php (modified) (2 diffs)
- trunk/wp-admin/edit-comments.php (modified) (2 diffs)
- trunk/wp-admin/edit-form-ajax-cat.php (modified) (2 diffs)
- trunk/wp-admin/edit.php (modified) (2 diffs)
- trunk/wp-admin/import/blogger.php (modified) (9 diffs)
- trunk/wp-admin/import/dotclear.php (modified) (44 diffs)
- trunk/wp-admin/import/livejournal.php (modified) (7 diffs)
- trunk/wp-admin/import/mt.php (modified) (2 diffs)
- trunk/wp-admin/import/rss.php (modified) (5 diffs)
- trunk/wp-admin/import/textpattern.php (modified) (44 diffs)
- trunk/wp-admin/install.php (modified) (3 diffs)
- trunk/wp-admin/link-manager.php (modified) (6 diffs)
- trunk/wp-admin/list-manipulation.js (modified) (2 diffs)
- trunk/wp-admin/list-manipulation.php (modified) (2 diffs)
- trunk/wp-admin/menu-header.php (modified) (1 diff)
- trunk/wp-admin/moderation.php (modified) (1 diff)
- trunk/wp-admin/options-permalink.php (modified) (4 diffs)
- trunk/wp-admin/options.php (modified) (2 diffs)
- trunk/wp-admin/page-new.php (modified) (1 diff)
- trunk/wp-admin/plugin-editor.php (modified) (2 diffs)
- trunk/wp-admin/plugins.php (modified) (3 diffs)
- trunk/wp-admin/post.php (modified) (8 diffs)
- trunk/wp-admin/setup-config.php (modified) (1 diff)
- trunk/wp-admin/templates.php (modified) (3 diffs)
- trunk/wp-admin/theme-editor.php (modified) (2 diffs)
- trunk/wp-admin/themes.php (modified) (2 diffs)
- trunk/wp-admin/upgrade-functions.php (modified) (22 diffs)
- trunk/wp-admin/upgrade-schema.php (modified) (6 diffs)
- trunk/wp-admin/upgrade.php (modified) (3 diffs)
- trunk/wp-admin/user-edit.php (modified) (1 diff)
- trunk/wp-admin/users.php (modified) (8 diffs)
- trunk/wp-admin/wp-admin.css (modified) (1 diff)
- trunk/wp-admin/xfn.js (modified) (1 diff)
- trunk/wp-commentsrss2.php (modified) (1 diff)
- trunk/wp-content/plugins/wp-db-backup.php (modified) (52 diffs)
- trunk/wp-content/themes/classic/comments-popup.php (modified) (1 diff)
- trunk/wp-content/themes/classic/header.php (modified) (2 diffs)
- trunk/wp-content/themes/classic/index.php (modified) (1 diff)
- trunk/wp-content/themes/classic/sidebar.php (modified) (1 diff)
- trunk/wp-content/themes/default/archive.php (modified) (5 diffs)
- trunk/wp-content/themes/default/archives.php (modified) (1 diff)
- trunk/wp-content/themes/default/attachment.php (modified) (3 diffs)
- trunk/wp-content/themes/default/comments-popup.php (modified) (1 diff)
- trunk/wp-content/themes/default/comments.php (modified) (3 diffs)
- trunk/wp-content/themes/default/functions.php (modified) (5 diffs)
- trunk/wp-content/themes/default/header.php (modified) (2 diffs)
- trunk/wp-content/themes/default/index.php (modified) (2 diffs)
- trunk/wp-content/themes/default/links.php (modified) (1 diff)
- trunk/wp-content/themes/default/page.php (modified) (1 diff)
- trunk/wp-content/themes/default/search.php (modified) (4 diffs)
- trunk/wp-content/themes/default/sidebar.php (modified) (5 diffs)
- trunk/wp-content/themes/default/single.php (modified) (2 diffs)
- trunk/wp-content/themes/default/style.css (modified) (11 diffs)
- trunk/wp-includes/cache.php (modified) (4 diffs)
- trunk/wp-includes/capabilities.php (modified) (11 diffs)
- trunk/wp-includes/class-snoopy.php (modified) (71 diffs)
- trunk/wp-includes/classes.php (modified) (26 diffs)
- trunk/wp-includes/comment-functions.php (modified) (10 diffs)
- trunk/wp-includes/functions-formatting.php (modified) (5 diffs)
- trunk/wp-includes/functions-post.php (modified) (30 diffs)
- trunk/wp-includes/functions.php (modified) (14 diffs)
- trunk/wp-includes/js/colorpicker.js (modified) (5 diffs)
- trunk/wp-includes/js/fat.js (modified) (3 diffs)
- trunk/wp-includes/js/quicktags.js (modified) (1 diff)
- trunk/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js (modified) (6 diffs)
- trunk/wp-includes/js/tinymce/themes/advanced/jscripts/image.js (modified) (1 diff)
- trunk/wp-includes/js/tinymce/tiny_mce.js (modified) (1 diff)
- trunk/wp-includes/js/tinymce/wp-mce-help.php (modified) (1 diff)
- trunk/wp-includes/js/tw-sack.js (modified) (3 diffs)
- trunk/wp-includes/pluggable-functions.php (modified) (8 diffs)
- trunk/wp-includes/registration-functions.php (modified) (10 diffs)
- trunk/wp-includes/rss-functions.php (modified) (46 diffs)
- trunk/wp-includes/template-functions-links.php (modified) (2 diffs)
- trunk/wp-includes/template-functions-post.php (modified) (1 diff)
- trunk/wp-includes/template-loader.php (modified) (1 diff)
- trunk/wp-includes/wp-db.php (modified) (11 diffs)
- trunk/wp-includes/wp-l10n.php (modified) (4 diffs)
- trunk/wp-login.php (modified) (4 diffs)
- trunk/wp-mail.php (modified) (1 diff)
- trunk/wp-register.php (modified) (3 diffs)
- trunk/wp-settings.php (modified) (2 diffs)
- trunk/xmlrpc.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/readme.html
r3339 r3517 17 17 padding: .2em 2em; 18 18 } 19 19 20 20 h1 { 21 21 color: #006; … … 23 23 font-weight: lighter; 24 24 } 25 25 26 26 h2 { 27 27 font-size: 16px; 28 28 } 29 29 30 30 p, li, dt { 31 31 line-height: 140%; trunk/wp-admin/admin-db.php
r3350 r3517 15 15 16 16 $editable = get_editable_user_ids( $user_id ); 17 17 18 18 if( !$editable ) { 19 19 $other_drafts = ''; … … 43 43 function get_editable_user_ids( $user_id, $exclude_zeros = true ) { 44 44 global $wpdb; 45 45 46 46 $user = new WP_User( $user_id ); 47 47 48 48 if ( ! $user->has_cap('edit_others_posts') ) { 49 49 if ( $user->has_cap('edit_posts') || $exclude_zeros == false ) … … 58 58 if ( $exclude_zeros ) 59 59 $query .= " AND meta_value != '0'"; 60 60 61 61 return $wpdb->get_col( $query ); 62 62 } … … 112 112 $wpdb->query ("UPDATE $wpdb->categories SET cat_name = '$cat_name', category_nicename = '$category_nicename', category_description = '$category_description', category_parent = '$category_parent' WHERE cat_ID = '$cat_ID'"); 113 113 } 114 114 115 115 if ( $category_nicename == '' ) { 116 116 $category_nicename = sanitize_title($cat_name, $cat_ID ); … … 243 243 function get_link($link_id, $output = OBJECT) { 244 244 global $wpdb; 245 245 246 246 $link = $wpdb->get_row("SELECT * FROM $wpdb->links WHERE link_id = '$link_id'"); 247 247 … … 259 259 function wp_insert_link($linkdata) { 260 260 global $wpdb, $current_user; 261 261 262 262 extract($linkdata); 263 263 … … 267 267 268 268 if ( empty($link_rating) ) 269 $link_rating = 0; 269 $link_rating = 0; 270 270 271 271 if ( empty($link_target) ) 272 $link_target = ''; 272 $link_target = ''; 273 273 274 274 if ( empty($link_visible) ) 275 275 $link_visible = 'Y'; 276 276 277 277 if ( empty($link_owner) ) 278 278 $link_owner = $current_user->id; … … 293 293 $link_id = $wpdb->insert_id; 294 294 } 295 295 296 296 if ( $update ) 297 297 do_action('edit_link', $link_id); … … 306 306 307 307 $link_id = (int) $linkdata['link_id']; 308 308 309 309 $link = get_link($link_id, ARRAY_A); 310 310 311 311 // Escape data pulled from DB. 312 312 $link = add_magic_quotes($link); 313 313 314 314 // Merge old and new fields with new fields overwriting old ones. 315 315 $linkdata = array_merge($link, $linkdata); … … 322 322 323 323 do_action('delete_link', $link_id); 324 return $wpdb->query("DELETE FROM $wpdb->links WHERE link_id = '$link_id'"); 324 return $wpdb->query("DELETE FROM $wpdb->links WHERE link_id = '$link_id'"); 325 325 } 326 326 trunk/wp-admin/admin-functions.php
r3513 r3517 7 7 if ( 'page' == $_POST['post_type'] ) { 8 8 if ( !current_user_can('edit_pages') ) 9 die(__('You are not allowed to create pages on this blog.')); 9 die(__('You are not allowed to create pages on this blog.')); 10 10 } else { 11 11 if ( !current_user_can('edit_posts') ) … … 31 31 32 32 if ($_POST['post_author'] != $_POST['user_ID']) { 33 if ( 'page' == $_POST['post_type'] ) { 33 if ( 'page' == $_POST['post_type'] ) { 34 34 if ( !current_user_can('edit_others_pages') ) 35 35 die(__('You cannot create pages as this user.')); … … 37 37 if ( !current_user_can('edit_others_posts') ) 38 38 die(__('You cannot post as this user.')); 39 39 40 40 } 41 41 } … … 53 53 if ( 'page' == $_POST['post_type'] ) { 54 54 if ('publish' == $_POST['post_status'] && !current_user_can('publish_pages')) 55 $_POST['post_status'] = 'draft'; 55 $_POST['post_status'] = 'draft'; 56 56 } else { 57 57 if ('publish' == $_POST['post_status'] && !current_user_can('publish_posts')) … … 141 141 if ( 'page' == $_POST['post_type'] ) { 142 142 if ( !current_user_can('edit_page', $post_ID) ) 143 die(__('You are not allowed to edit this page.')); 143 die(__('You are not allowed to edit this page.')); 144 144 } else { 145 145 if ( !current_user_can('edit_post', $post_ID) ) … … 164 164 165 165 if ($_POST['post_author'] != $_POST['user_ID']) { 166 if ( 'page' == $_POST['post_type'] ) { 166 if ( 'page' == $_POST['post_type'] ) { 167 167 if ( !current_user_can('edit_others_pages') ) 168 168 die(__('You cannot edit pages as this user.')); … … 170 170 if ( !current_user_can('edit_others_posts') ) 171 171 die(__('You cannot edit posts as this user.')); 172 172 173 173 } 174 174 } … … 186 186 if ( 'page' == $_POST['post_type'] ) { 187 187 if ('publish' == $_POST['post_status'] && !current_user_can('edit_published_pages')) 188 $_POST['post_status'] = 'draft'; 188 $_POST['post_status'] = 'draft'; 189 189 } else { 190 190 if ('publish' == $_POST['post_status'] && !current_user_can('edit_published_posts')) … … 218 218 update_meta($key, $value['key'], $value['value']); 219 219 } 220 220 221 221 if ($_POST['deletemeta']) { 222 222 foreach ($_POST['deletemeta'] as $key => $value) … … 465 465 function get_link_to_edit($link_id) { 466 466 $link = get_link($link_id); 467 467 468 468 $link->link_url = wp_specialchars($link->link_url, 1); 469 469 $link->link_name = wp_specialchars($link->link_name, 1); … … 471 471 $link->link_notes = wp_specialchars($link->link_notes); 472 472 $link->link_rss = wp_specialchars($link->link_rss); 473 473 474 474 return $link; 475 475 } … … 480 480 else 481 481 $link->link_url = ''; 482 482 483 483 if ( isset($_GET['name']) ) 484 484 $link->link_name = wp_specialchars($_GET['name'], 1); 485 485 else 486 486 $link->link_name = ''; 487 487 488 488 return $link; 489 489 } 490 490 491 491 function add_link() { 492 return edit_link(); 492 return edit_link(); 493 493 } 494 494 … … 503 503 $_POST['link_rss'] = wp_specialchars($_POST['link_rss']); 504 504 $auto_toggle = get_autotoggle($_POST['link_category']); 505 505 506 506 // if we are in an auto toggle category and this one is visible then we 507 507 // need to make the others invisible before we add this new one. … … 578 578 } 579 579 } 580 580 581 581 usort($result, 'sort_cats'); 582 582 … … 616 616 $edit = "<a href='categories.php?action=edit&cat_ID=$category->cat_ID' class='edit'>".__('Edit')."</a></td>"; 617 617 $default_cat_id = get_option('default_category'); 618 618 619 619 if ($category->cat_ID != $default_cat_id) 620 620 $edit .= "<td><a href='categories.php?action=delete&cat_ID=$category->cat_ID' onclick=\"return deleteSomething( 'cat', $category->cat_ID, '".sprintf(__("You are about to delete the category "%s". All of its posts will go to the default category.\\n"OK" to delete, "Cancel" to stop."), wp_specialchars($category->cat_name, 1))."' );\" class='delete'>".__('Delete')."</a>"; … … 700 700 function link_category_dropdown($fieldname, $selected = 0) { 701 701 global $wpdb; 702 702 703 703 $results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle FROM $wpdb->linkcategories ORDER BY cat_id"); 704 704 echo "\n<select name='$fieldname' size='1'>\n"; … … 1835 1835 </div> 1836 1836 </form> 1837 <?php 1837 <?php 1838 1838 } 1839 1839 trunk/wp-admin/admin.php
r3422 r3517 54 54 if (! isset($_GET['noheader'])) 55 55 require_once(ABSPATH . '/wp-admin/admin-header.php'); 56 56 57 57 do_action($page_hook); 58 58 } else { … … 60 60 die(__('Invalid plugin page')); 61 61 } 62 62 63 63 if (! file_exists(ABSPATH . "wp-content/plugins/$plugin_page")) 64 64 die(sprintf(__('Cannot load %s.'), $plugin_page)); … … 66 66 if (! isset($_GET['noheader'])) 67 67 require_once(ABSPATH . '/wp-admin/admin-header.php'); 68 68 69 69 include(ABSPATH . "wp-content/plugins/$plugin_page"); 70 70 } 71 71 72 72 include(ABSPATH . 'wp-admin/admin-footer.php'); 73 73 74 74 exit(); 75 75 } else if (isset($_GET['import'])) { 76 76 77 77 $importer = $_GET['import']; 78 78 … … 80 80 die(__('Invalid importer.')); 81 81 } 82 82 83 83 if (! file_exists(ABSPATH . "wp-admin/import/$importer.php")) 84 84 die(__('Cannot load importer.')); 85 85 86 86 include(ABSPATH . "wp-admin/import/$importer.php"); 87 87 88 88 $parent_file = 'import.php'; 89 89 $title = __('Import'); 90 90 91 91 if (! isset($_GET['noheader'])) 92 92 require_once(ABSPATH . 'wp-admin/admin-header.php'); … … 98 98 99 99 call_user_func($wp_importers[$importer][2]); 100 100 101 101 include(ABSPATH . 'wp-admin/admin-footer.php'); 102 102 trunk/wp-admin/bookmarklet.php
r2972 r3517 26 26 $popuptitle = wp_specialchars(stripslashes($popuptitle)); 27 27 $text = wp_specialchars(stripslashes(urldecode($text))); 28 28 29 29 $popuptitle = funky_javascript_fix($popuptitle); 30 30 $text = funky_javascript_fix($text); 31 31 32 32 $post_title = wp_specialchars($_REQUEST['post_title']); 33 33 if (!empty($post_title)) … … 35 35 else 36 36 $post->post_title = $popuptitle; 37 37 38 38 39 39 $content = wp_specialchars($_REQUEST['content']); trunk/wp-admin/cat-js.php
r3500 r3517 68 68 var ids = new Array(); 69 69 var names = new Array(); 70 70 71 71 ids = myPload( ajaxCat.response ); 72 72 names = myPload( newcat.value ); … … 81 81 return; 82 82 } 83 83 84 84 var exists = document.getElementById('category-' + id); 85 85 86 86 if (exists) { 87 87 var moveIt = exists.parentNode; … … 101 101 newLabel.id = 'new-category-' + id; 102 102 newLabel.className = 'selectit fade'; 103 103 104 104 var newCheck = document.createElement('input'); 105 105 newCheck.type = 'checkbox'; … … 108 108 newCheck.id = 'category-' + id; 109 109 newLabel.appendChild(newCheck); 110 110 111 111 var newLabelText = document.createTextNode(' ' + names[i]); 112 112 newLabel.appendChild(newLabelText); 113 113 114 114 catDiv.insertBefore(newLabel, catDiv.firstChild); 115 115 newCheck.checked = 'checked'; 116 116 117 117 Fat.fade_all(); 118 118 newLabel.className = 'selectit'; trunk/wp-admin/categories.php
r3422 r3517 28 28 if ( !current_user_can('manage_categories') ) 29 29 die (__('Cheatin’ uh?')); 30 30 31 31 wp_insert_category($_POST); 32 32 … … 97 97 if ( !current_user_can('manage_categories') ) 98 98 die (__('Cheatin’ uh?')); 99 99 100 100 wp_update_category($_POST); 101 101 trunk/wp-admin/edit-comments.php
r3422 r3517 89 89 $class .= ' alternate'; 90 90 echo "<li id='comment-$comment->comment_ID' class='$class'>"; 91 ?> 91 ?> 92 92 <p><strong><?php _e('Name:') ?></strong> <?php comment_author() ?> <?php if ($comment->comment_author_email) { ?>| <strong><?php _e('E-mail:') ?></strong> <?php comment_author_email_link() ?> <?php } if ($comment->comment_author_url && 'http://' != $comment->comment_author_url ) { ?> | <strong><?php _e('URI:') ?></strong> <?php comment_author_url_link() ?> <?php } ?>| <strong><?php _e('IP:') ?></strong> <a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP() ?>"><?php comment_author_IP() ?></a></p> 93 93 94 94 <?php comment_text() ?> 95 95 … … 119 119 <p> 120 120 <strong><?php _e('No comments found.') ?></strong></p> 121 121 122 122 <?php 123 123 } // end if ($comments) trunk/wp-admin/edit-form-ajax-cat.php
r3135 r3517 18 18 foreach ($names as $cat_name) { 19 19 $cat_name = trim( $cat_name ); 20 20 21 21 if ( !$category_nicename = sanitize_title($cat_name) ) 22 22 continue; … … 25 25 continue; 26 26 } 27 27 28 28 $new_cat_id = wp_create_category($cat_name); 29 29 30 30 $ids[] = (string) $new_cat_id; 31 31 } trunk/wp-admin/edit.php
r3513 r3517 94 94 <select name='m'> 95 95 <?php 96 foreach ($arc_result as $arc_row) { 96 foreach ($arc_result as $arc_row) { 97 97 $arc_year = $arc_row->yyear; 98 98 $arc_month = $arc_row->mmonth; 99 99 100 100 if( isset($_GET['m']) && $arc_year . zeroise($arc_month, 2) == (int) $_GET['m'] ) 101 101 $default = 'selected="selected"'; 102 102 else 103 103 $default = null; 104 104 105 105 echo "<option $default value=\"" . $arc_year.zeroise($arc_month, 2) . '">'; 106 106 echo $month[zeroise($arc_month, 2)] . " $arc_year"; … … 158 158 159 159 switch($column_name) { 160 160 161 161 case 'id': 162 162 ?> trunk/wp-admin/import/blogger.php
r3397 r3517 136 136 if ($header) curl_setopt($ch, CURLOPT_HTTPHEADER, $header); 137 137 $response = curl_exec ($ch); 138 138 139 139 if ($parse) { 140 140 $response = $this->parse_response($response); … … 142 142 return $response; 143 143 } 144 144 145 145 return $response; 146 146 } … … 211 211 update_option('import-blogger', $this->import); 212 212 } 213 213 214 214 // Redirects to next step 215 215 function do_next_step() { … … 225 225 $this->login_form(__('The script will log into your Blogger account, change some settings so it can read your blog, and restore the original settings when it\'s done. Here\'s what you do:').'</p><ol><li>'.__('Back up your Blogger template.').'</li><li>'.__('Back up any other Blogger settings you might need later.').'</li><li>'.__('Log out of Blogger').'</li><li>'.__('Log in <em>here</em> with your Blogger username and password.').'</li><li>'.__('On the next screen, click one of your Blogger blogs.').'</li><li>'.__('Do not close this window or navigate away until the process is complete.').'</li></ol>'); 226 226 } 227 228 // Try logging in. If we get an array of cookies back, we at least connected. 227 228 // Try logging in. If we get an array of cookies back, we at least connected. 229 229 $this->import['cookies'] = $this->login_blogger($_POST['user'], $_POST['pass']); 230 230 if ( !is_array( $this->import['cookies'] ) ) { 231 231 $this->login_form(__('Login failed. Please enter your credentials again.')); 232 232 } 233 233 234 234 // Save the password so we can log the browser in when it's time to publish. 235 235 $this->import['pass'] = $_POST['pass']; … … 396 396 $archive = $this->get_blogger($url); 397 397 if ( $archive['code'] > 200 ) 398 continue; 398 continue; 399 399 $posts = explode('<wordpresspost>', $archive['body']); 400 400 for ($i = 1; $i < count($posts); $i = $i + 1) { … … 410 410 $post_author_name = $wpdb->escape(trim($postinfo[1])); 411 411 $post_author_email = $postinfo[5] ? $postinfo[5] : 'user@wordpress.org'; 412 412 413 413 if ( $this->lump_authors ) { 414 414 // Ignore Blogger authors. Use the current user_ID for all posts imported. … … 436 436 $postminute = zeroise($post_date_His[1], 2); 437 437 $postsecond = zeroise($post_date_His[2], 2); 438 438 439 439 if (($post_date[2] == 'PM') && ($posthour != '12')) 440 440 $posthour = $posthour + 12; 441 441 else if (($post_date[2] == 'AM') && ($posthour == '12')) 442 442 $posthour = '00'; 443 443 444 444 $post_date = "$postyear-$postmonth-$postday $posthour:$postminute:$postsecond"; 445 445 446 446 $post_content = addslashes($post_content); 447 447 $post_content = str_replace(array('<br>','<BR>','<br/>','<BR/>','<br />','<BR />'), "\n", $post_content); // the XHTML touch... ;) 448 448 449 449 $post_title = addslashes($post_title); 450 450 451 451 $post_status = 'publish'; 452 452 453 453 if ( $ID = post_exists($post_title, '', $post_date) ) { 454 454 $post_array[$i]['ID'] = $ID; … … 598 598 $this->restart(); 599 599 } 600 600 601 601 if ( isset($_GET['noheader']) ) { 602 602 $this->import = get_settings('import-blogger'); … … 648 648 } 649 649 die; 650 650 651 651 } else { 652 652 $this->greet(); trunk/wp-admin/import/dotclear.php
r3424 r3517 8 8 { 9 9 global $wpdb; 10 10 11 11 $cat_id -= 0; // force numeric 12 12 $name = $wpdb->get_var('SELECT cat_ID FROM '.$wpdb->categories.' WHERE category_nicename="'.$category_nicename.'"'); 13 13 14 14 return $name; 15 15 } … … 136 136 echo '</div>'; 137 137 } 138 138 139 139 function greet() 140 140 { … … 154 154 set_magic_quotes_runtime(0); 155 155 $prefix = get_option('tpre'); 156 156 157 157 // Get Categories 158 158 return $dcdb->get_results('SELECT * FROM dc_categorie', ARRAY_A); 159 159 } 160 160 161 161 function get_dc_users() 162 162 { … … 166 166 set_magic_quotes_runtime(0); 167 167 $prefix = get_option('tpre'); 168 168 169 169 // Get Users 170 170 171 171 return $dcdb->get_results('SELECT * FROM dc_user', ARRAY_A); 172 172 } 173 173 174 174 function get_dc_posts() 175 175 { … … 178 178 set_magic_quotes_runtime(0); 179 179 $prefix = get_option('tpre'); 180 180 181 181 // Get Posts 182 182 return $dcdb->get_results('SELECT dc_post.*, dc_categorie.cat_libelle_url AS post_cat_name … … 184 184 ON dc_post.cat_id = dc_categorie.cat_id', ARRAY_A); 185 185 } 186 186 187 187 function get_dc_comments() 188 188 { … … 192 192 set_magic_quotes_runtime(0); 193 193 $prefix = get_option('tpre'); 194 194 195 195 // Get Comments 196 196 return $dcdb->get_results('SELECT * FROM dc_comment', ARRAY_A); 197 197 } 198 198 199 199 function get_dc_links() 200 200 { … … 206 206 return $dcdb->get_results('SELECT * FROM dc_link ORDER BY position', ARRAY_A); 207 207 } 208 208 209 209 function cat2wp($categories='') 210 210 { … … 221 221 $count++; 222 222 extract($category); 223 223 224 224 // Make Nice Variables 225 225 $name = $wpdb->escape($cat_libelle_url); … … 237 237 $dccat2wpcat[$id] = $ret_id; 238 238 } 239 239 240 240 // Store category translation for future use 241 241 add_option('dccat2wpcat',$dccat2wpcat); … … 246 246 return false; 247 247 } 248 248 249 249 function users2wp($users='') 250 250 { … … 253 253 $count = 0; 254 254 $dcid2wpid = array(); 255 255 256 256 // Midnight Mojo 257 257 if(is_array($users)) … … 262 262 $count++; 263 263 extract($user); 264 264 265 265 // Make Nice Variables 266 266 $name = $wpdb->escape(csc ($name)); 267 267 $RealName = $wpdb->escape(csc ($user_pseudo)); 268 268 269 269 if($uinfo = get_userdatabylogin($name)) 270 270 { 271 271 272 272 $ret_id = wp_insert_user(array( 273 273 'ID' => $uinfo->ID, … … 290 290 } 291 291 $dcid2wpid[$user_id] = $ret_id; 292 292 293 293 // Set Dotclear-to-WordPress permissions translation 294 294 295 295 // Update Usermeta Data 296 296 $user = new WP_User($ret_id); … … 303 303 else if(2 <= $wp_perms) { $user->set_role('contributor'); } 304 304 else { $user->set_role('subscriber'); } 305 305 306 306 update_usermeta( $ret_id, 'wp_user_level', $wp_perms); 307 307 update_usermeta( $ret_id, 'rich_editing', 'false'); … … 309 309 update_usermeta( $ret_id, 'last_name', csc ($user_nom)); 310 310 }// End foreach($users as $user) 311 311 312 312 // Store id translation array for future use 313 313 add_option('dcid2wpid',$dcid2wpid); 314 315 314 315 316 316 echo '<p>'.sprintf(__('Done! <strong>%1$s</strong> users imported.'), $count).'<br /><br /></p>'; 317 317 return true; 318 318 }// End if(is_array($users) 319 319 320 320 echo __('No Users to Import!'); 321 321 return false; 322 322 323 323 }// End function user2wp() 324 324 325 325 function posts2wp($posts='') 326 326 { … … 339 339 $count++; 340 340 extract($post); 341 341 342 342 // Set Dotclear-to-WordPress status translation 343 343 $stattrans = array(0 => 'draft', 1 => 'publish'); 344 344 $comment_status_map = array (0 => 'closed', 1 => 'open'); 345 345 346 346 //Can we do this more efficiently? 347 347 $uinfo = ( get_userdatabylogin( $user_id ) ) ? get_userdatabylogin( $user_id ) : 1; … … 357 357 $post_content = $wpdb->escape ($post_content); 358 358 $post_status = $stattrans[$post_pub]; 359 359 360 360 // Import Post data into WordPress 361 361 362 362 if($pinfo = post_exists($Title,$post_content)) 363 363 { … … 398 398 } 399 399 $dcposts2wpposts[$post_id] = $ret_id; 400 400 401 401 // Make Post-to-Category associations 402 402 $cats = array(); … … 408 408 // Store ID translation for later use 409 409 add_option('dcposts2wpposts',$dcposts2wpposts); 410 410 411 411 echo '<p>'.sprintf(__('Done! <strong>%1$s</strong> posts imported.'), $count).'<br /><br /></p>'; 412 return true; 413 } 414 412 return true; 413 } 414 415 415 function comments2wp($comments='') 416 416 { … … 420 420 $dccm2wpcm = array(); 421 421 $postarr = get_option('dcposts2wpposts'); 422 <422
