Ticket #986: 986-admin.diff
| File 986-admin.diff, 172.1 KB (added by Nazgul, 6 years ago) |
|---|
-
wp-admin/admin-ajax.php
139 139 break; 140 140 case 'add-cat' : // From Manage->Categories 141 141 if ( !current_user_can( 'manage_categories' ) ) 142 die('-1');142 die('-1'); 143 143 if ( !$cat = wp_insert_category( $_POST ) ) 144 144 die('0'); 145 145 if ( !$cat = get_category( $cat ) ) -
wp-admin/admin-db.php
48 48 if ( ! $user->has_cap('edit_others_posts') ) { 49 49 if ( $user->has_cap('edit_posts') || $exclude_zeros == false ) 50 50 return array($user->id); 51 else 51 else 52 52 return false; 53 53 } 54 54 … … 93 93 $update = false; 94 94 95 95 $cat_name = apply_filters('pre_category_name', $cat_name); 96 96 97 97 if (empty ($category_nicename)) 98 98 $category_nicename = sanitize_title($cat_name); 99 99 else … … 192 192 $cats = array($default_cat); 193 193 else 194 194 $cats = array_diff($cats, array($cat_ID)); 195 wp_set_post_categories($post_id, $cats); 195 wp_set_post_categories($post_id, $cats); 196 196 } 197 197 198 198 $default_link_cat = get_option('default_link_category'); … … 203 203 $cats = array($default_link_cat); 204 204 else 205 205 $cats = array_diff($cats, array($cat_ID)); 206 wp_set_link_cats($link_id, $cats); 206 wp_set_link_cats($link_id, $cats); 207 207 } 208 208 209 209 wp_cache_delete($cat_ID, 'category'); 210 210 wp_cache_delete('all_category_ids', 'category'); 211 211 … … 279 279 280 280 function wp_revoke_user($id) { 281 281 $id = (int) $id; 282 282 283 283 $user = new WP_User($id); 284 $user->remove_all_caps(); 284 $user->remove_all_caps(); 285 285 } 286 286 287 287 function wp_insert_link($linkdata) { … … 347 347 $link = add_magic_quotes($link); 348 348 349 349 // Passed link category list overwrites existing category list if not empty. 350 if ( isset($linkdata['link_category']) && is_array($linkdata['link_category'])350 if ( isset($linkdata['link_category']) && is_array($linkdata['link_category']) 351 351 && 0 != count($linkdata['link_category']) ) 352 $link_cats = $linkdata['link_category'];353 else 354 $link_cats = $link['link_category'];352 $link_cats = $linkdata['link_category']; 353 else 354 $link_cats = $link['link_category']; 355 355 356 356 // Merge old and new fields with new fields overwriting old ones. 357 357 $linkdata = array_merge($link, $linkdata); 358 $linkdata['link_category'] = $link_cats;358 $linkdata['link_category'] = $link_cats; 359 359 360 360 return wp_insert_link($linkdata); 361 361 } … … 364 364 global $wpdb; 365 365 366 366 do_action('delete_link', $link_id); 367 367 368 368 $categories = wp_get_link_cats($link_id); 369 369 if( is_array( $categories ) ) { 370 370 foreach ( $categories as $category ) { … … 380 380 function wp_get_link_cats($link_ID = 0) { 381 381 global $wpdb; 382 382 383 $sql = "SELECT category_id 384 FROM $wpdb->link2cat 385 WHERE link_id = $link_ID 383 $sql = "SELECT category_id 384 FROM $wpdb->link2cat 385 WHERE link_id = $link_ID 386 386 ORDER BY category_id"; 387 387 388 388 $result = $wpdb->get_col($sql); … … 403 403 404 404 // First the old categories 405 405 $old_categories = $wpdb->get_col(" 406 SELECT category_id 407 FROM $wpdb->link2cat 406 SELECT category_id 407 FROM $wpdb->link2cat 408 408 WHERE link_id = $link_ID"); 409 409 410 410 if (!$old_categories) { … … 419 419 if ($delete_cats) { 420 420 foreach ($delete_cats as $del) { 421 421 $wpdb->query(" 422 DELETE FROM $wpdb->link2cat 423 WHERE category_id = $del 424 AND link_id = $link_ID 422 DELETE FROM $wpdb->link2cat 423 WHERE category_id = $del 424 AND link_id = $link_ID 425 425 "); 426 426 } 427 427 } … … 432 432 if ($add_cats) { 433 433 foreach ($add_cats as $new_cat) { 434 434 $wpdb->query(" 435 INSERT INTO $wpdb->link2cat (link_id, category_id) 435 INSERT INTO $wpdb->link2cat (link_id, category_id) 436 436 VALUES ($link_ID, $new_cat)"); 437 437 } 438 438 } 439 439 440 440 // Update category counts. 441 441 $all_affected_cats = array_unique(array_merge($link_categories, $old_categories)); 442 442 foreach ( $all_affected_cats as $cat_id ) { -
wp-admin/admin-functions.php
316 316 $text = wp_specialchars(stripslashes(urldecode($_REQUEST['text']))); 317 317 $text = funky_javascript_fix($text); 318 318 $popupurl = wp_specialchars($_REQUEST['popupurl']); 319 $post_content = '<a href="'.$popupurl.'">'.$post_title.'</a>'."\n$text";320 }319 $post_content = '<a href="'.$popupurl.'">'.$post_title.'</a>'."\n$text"; 320 } 321 321 322 322 if ( !empty($_REQUEST['excerpt']) ) 323 323 $post_excerpt = wp_specialchars(stripslashes($_REQUEST['excerpt'])); … … 581 581 582 582 if ($post_ID) { 583 583 $checked_categories = $wpdb->get_col(" 584 SELECT category_id585 FROM $wpdb->categories, $wpdb->post2cat586 WHERE $wpdb->post2cat.category_id = cat_ID AND $wpdb->post2cat.post_id = '$post_ID'587 ");584 SELECT category_id 585 FROM $wpdb->categories, $wpdb->post2cat 586 WHERE $wpdb->post2cat.category_id = cat_ID AND $wpdb->post2cat.post_id = '$post_ID' 587 "); 588 588 589 589 if (count($checked_categories) == 0) { 590 590 // No selected categories, strange … … 592 592 } 593 593 } else if ($link_id) { 594 594 $checked_categories = $wpdb->get_col(" 595 SELECT category_id596 FROM $wpdb->categories, $wpdb->link2cat597 WHERE $wpdb->link2cat.category_id = cat_ID AND $wpdb->link2cat.link_id = '$link_id'598 ");595 SELECT category_id 596 FROM $wpdb->categories, $wpdb->link2cat 597 WHERE $wpdb->link2cat.category_id = cat_ID AND $wpdb->link2cat.link_id = '$link_id' 598 "); 599 599 600 600 if (count($checked_categories) == 0) { 601 601 // No selected categories, strange 602 602 $checked_categories[] = $default; 603 } 603 } 604 604 } else { 605 605 $checked_categories[] = $default; 606 606 } … … 664 664 $edit = ''; 665 665 666 666 $class = ('alternate' == $class) ? '' : 'alternate'; 667 667 668 668 $category->category_count = number_format( $category->category_count ); 669 669 $category->link_count = number_format( $category->link_count ); 670 670 echo "<tr id='cat-$category->cat_ID' class='$class'><th scope='row'>$category->cat_ID</th><td>$pad $category->cat_name</td> … … 700 700 $id = $post->ID; 701 701 $class = ('alternate' == $class) ? '' : 'alternate'; 702 702 ?> 703 <tr id='page-<?php echo $id; ?>' class='<?php echo $class; ?>'> 704 <th scope="row"><?php echo $post->ID; ?></th> 705 <td>706 <?php echo $pad; ?><?php the_title() ?>707 <?php if ('private' == $post->post_status) _e(' - <strong>Private</strong>'); ?>708 </td> 709 <td><?php the_author() ?></td>710 <td><?php echo mysql2date('Y-m-d g:i a', $post->post_modified); ?></td> 711 <td><a href="<?php the_permalink(); ?>" rel="permalink" class="edit"><?php _e('View'); ?></a></td>712 <td><?php if ( current_user_can('edit_page', $id) ) { echo "<a href='page.php?action=edit&post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td> 713 <td><?php if ( current_user_can('edit_page', $id) ) { echo "<a href='" . wp_nonce_url("page.php?action=delete&post=$id", 'delete-page_' . $id) . "' class='delete' onclick=\"return deleteSomething( 'page', " . $id . ", '" . sprintf(__("You are about to delete the "%s" page.\\n"OK" to delete, "Cancel" to stop."), js_escape(get_the_title()) ) . "' );\">" . __('Delete') . "</a>"; } ?></td> 714 </tr> 703 <tr id='page-<?php echo $id; ?>' class='<?php echo $class; ?>'> 704 <th scope="row"><?php echo $post->ID; ?></th> 705 <td> 706 <?php echo $pad; ?><?php the_title() ?> 707 <?php if ('private' == $post->post_status) _e(' - <strong>Private</strong>'); ?> 708 </td> 709 <td><?php the_author() ?></td> 710 <td><?php echo mysql2date('Y-m-d g:i a', $post->post_modified); ?></td> 711 <td><a href="<?php the_permalink(); ?>" rel="permalink" class="edit"><?php _e('View'); ?></a></td> 712 <td><?php if ( current_user_can('edit_page', $id) ) { echo "<a href='page.php?action=edit&post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td> 713 <td><?php if ( current_user_can('edit_page', $id) ) { echo "<a href='" . wp_nonce_url("page.php?action=delete&post=$id", 'delete-page_' . $id) . "' class='delete' onclick=\"return deleteSomething( 'page', " . $id . ", '" . sprintf(__("You are about to delete the "%s" page.\\n"OK" to delete, "Cancel" to stop."), js_escape(get_the_title()) ) . "' );\">" . __('Delete') . "</a>"; } ?></td> 714 </tr> 715 715 716 716 <?php 717 717 if ( $hierarchy) page_rows($id, $level + 1, $pages); … … 985 985 $metavalue = $wpdb->escape(stripslashes(trim($_POST['metavalue']))); 986 986 987 987 if ( ('0' === $metavalue || !empty ($metavalue)) && ((('#NONE#' != $metakeyselect) && !empty ($metakeyselect)) || !empty ($metakeyinput)) ) { 988 // We have a key/value pair. If both the select and the 988 // We have a key/value pair. If both the select and the 989 989 // input for the key have data, the input takes precedence: 990 990 991 if ('#NONE#' != $metakeyselect)991 if ('#NONE#' != $metakeyselect) 992 992 $metakey = $metakeyselect; 993 993 994 994 if ($metakeyinput) 995 995 $metakey = $metakeyinput; // default 996 996 997 997 $result = $wpdb->query(" 998 INSERT INTO $wpdb->postmeta 999 (post_id,meta_key,meta_value) 998 INSERT INTO $wpdb->postmeta 999 (post_id,meta_key,meta_value) 1000 1000 VALUES ('$post_ID','$metakey','$metavalue') 1001 1001 "); 1002 1002 return $wpdb->insert_id; … … 1030 1030 1031 1031 if ( $for_post ) 1032 1032 $edit = ( ('draft' == $post->post_status) && (!$post->post_date || '0000-00-00 00:00:00' == $post->post_date) ) ? false : true; 1033 1033 1034 1034 echo '<fieldset><legend><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp" /> <label for="timestamp">'.__('Edit timestamp').'</label></legend>'; 1035 1035 1036 1036 $time_adj = time() + (get_settings('gmt_offset') * 3600); … … 1052 1052 ?> 1053 1053 </select> 1054 1054 <input type="text" id="jj" name="jj" value="<?php echo $jj; ?>" size="2" maxlength="2" onchange="edit_date.checked=true"/> 1055 <input type="text" id="aa" name="aa" value="<?php echo $aa ?>" size="4" maxlength="5" onchange="edit_date.checked=true" /> @ 1056 <input type="text" id="hh" name="hh" value="<?php echo $hh ?>" size="2" maxlength="2" onchange="edit_date.checked=true" /> : 1057 <input type="text" id="mn" name="mn" value="<?php echo $mn ?>" size="2" maxlength="2" onchange="edit_date.checked=true" /> 1058 <input type="hidden" id="ss" name="ss" value="<?php echo $ss ?>" size="2" maxlength="2" onchange="edit_date.checked=true" /> 1055 <input type="text" id="aa" name="aa" value="<?php echo $aa ?>" size="4" maxlength="5" onchange="edit_date.checked=true" /> @ 1056 <input type="text" id="hh" name="hh" value="<?php echo $hh ?>" size="2" maxlength="2" onchange="edit_date.checked=true" /> : 1057 <input type="text" id="mn" name="mn" value="<?php echo $mn ?>" size="2" maxlength="2" onchange="edit_date.checked=true" /> 1058 <input type="hidden" id="ss" name="ss" value="<?php echo $ss ?>" size="2" maxlength="2" onchange="edit_date.checked=true" /> 1059 1059 <?php 1060 1060 if ( $edit ) { 1061 1061 _e('Existing timestamp'); … … 1201 1201 var startPos = myField.selectionStart; 1202 1202 var endPos = myField.selectionEnd; 1203 1203 myField.value = myField.value.substring(0, startPos) 1204 + myValue1205 + myField.value.substring(endPos, myField.value.length);1204 + myValue 1205 + myField.value.substring(endPos, myField.value.length); 1206 1206 myField.focus(); 1207 1207 myField.selectionStart = startPos + myValue.length; 1208 1208 myField.selectionEnd = startPos + myValue.length; … … 1314 1314 global $menu_nopriv; 1315 1315 1316 1316 $parent = get_admin_page_parent(); 1317 1317 1318 1318 if ( isset($menu_nopriv[$pagenow]) ) 1319 1319 return false; 1320 1320 … … 1341 1341 return false; 1342 1342 } 1343 1343 } 1344 1344 1345 1345 return true; 1346 1346 } 1347 1347 … … 1413 1413 $parent_file = $plugin_page; 1414 1414 if ( isset($real_parent_file[$parent_file]) ) 1415 1415 $parent_file = $real_parent_file[$parent_file]; 1416 1416 1417 1417 return $parent_file; 1418 1418 } 1419 1419 } … … 1853 1853 1854 1854 // Compute the URL 1855 1855 $url = $uploads['url'] . "/$filename"; 1856 1856 1857 1857 $return = apply_filters( 'wp_handle_upload', array('file' => $new_file, 'url' => $url, 'type' => $type) ); 1858 1858 1859 1859 return $return; -
wp-admin/admin.php
2 2 if ( defined('ABSPATH') ) 3 3 require_once( ABSPATH . 'wp-config.php'); 4 4 else 5 require_once('../wp-config.php');5 require_once('../wp-config.php'); 6 6 7 7 if ( get_option('db_version') != $wp_db_version ) 8 8 die (sprintf(__("Your database is out-of-date. Please <a href='%s'>upgrade</a>."), get_option('siteurl') . '/wp-admin/upgrade.php')); 9 9 10 10 require_once(ABSPATH . 'wp-admin/admin-functions.php'); 11 11 require_once(ABSPATH . 'wp-admin/admin-db.php'); 12 12 require_once(ABSPATH . WPINC . '/registration.php'); -
wp-admin/bookmarklet.php
35 35 else 36 36 $post->post_title = $popuptitle; 37 37 38 38 39 39 $content = wp_specialchars($_REQUEST['content']); 40 40 $popupurl = wp_specialchars($_REQUEST['popupurl']); 41 if ( !empty($content) ) {42 $post->post_content = wp_specialchars( stripslashes($_REQUEST['content']) );43 } else {44 $post->post_content = '<a href="'.$popupurl.'">'.$popuptitle.'</a>'."\n$text";45 }41 if ( !empty($content) ) { 42 $post->post_content = wp_specialchars( stripslashes($_REQUEST['content']) ); 43 } else { 44 $post->post_content = '<a href="'.$popupurl.'">'.$popuptitle.'</a>'."\n$text"; 45 } 46 46 47 /* /big funky fixes */47 /* /big funky fixes */ 48 48 49 49 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 50 50 <html xmlns="http://www.w3.org/1999/xhtml"> … … 77 77 } 78 78 79 79 #wpbookmarklet .wrap { 80 border: 0px;80 border: 0px; 81 81 } 82 82 83 83 #wpbookmarklet #postdiv { 84 margin-bottom: 0.5em;84 margin-bottom: 0.5em; 85 85 } 86 86 87 87 #wpbookmarklet #titlediv { 88 margin-bottom: 1em;88 margin-bottom: 1em; 89 89 } 90 90 91 91 --> -
wp-admin/categories.php
30 30 $cat_name = get_catname($cat_ID); 31 31 32 32 // Don't delete the default cats. 33 if ( $cat_ID == get_option('default_category') )33 if ( $cat_ID == get_option('default_category') ) 34 34 die(sprintf(__("Can't delete the <strong>%s</strong> category: this is the default one"), $cat_name)); 35 35 36 if ( $cat_ID == get_option('default_link_category') )36 if ( $cat_ID == get_option('default_link_category') ) 37 37 die(sprintf(__("Can't delete the <strong>%s</strong> category: this is the default one for bookmarks"), $cat_name)); 38 38 39 39 wp_delete_category($cat_ID); … … 44 44 45 45 case 'edit': 46 46 47 require_once ('admin-header.php');48 $cat_ID = (int) $_GET['cat_ID'];49 $category = get_category_to_edit($cat_ID);50 include('edit-category-form.php');47 require_once ('admin-header.php'); 48 $cat_ID = (int) $_GET['cat_ID']; 49 $category = get_category_to_edit($cat_ID); 50 include('edit-category-form.php'); 51 51 52 52 break; 53 53 … … 87 87 <thead> 88 88 <tr> 89 89 <th scope="col"><?php _e('ID') ?></th> 90 <th scope="col" style="text-align: left"><?php _e('Name') ?></th>91 <th scope="col" style="text-align: left"><?php _e('Description') ?></th>92 <th scope="col" width="90"><?php _e('Posts') ?></th>93 <th scope="col" width="90"><?php _e('Bookmarks') ?></th>94 <th colspan="2"><?php _e('Action') ?></th>90 <th scope="col" style="text-align: left"><?php _e('Name') ?></th> 91 <th scope="col" style="text-align: left"><?php _e('Description') ?></th> 92 <th scope="col" width="90"><?php _e('Posts') ?></th> 93 <th scope="col" width="90"><?php _e('Bookmarks') ?></th> 94 <th colspan="2"><?php _e('Action') ?></th> 95 95 </tr> 96 96 </thead> 97 97 <tbody id="the-list"> -
wp-admin/comment.php
89 89 $noredir = false; 90 90 } 91 91 92 $postdata = get_post($p) or 92 $postdata = get_post($p) or 93 93 die(sprintf(__('Oops, no post with this ID. <a href="%s">Go back</a>!'), 'edit.php')); 94 94 95 95 if ( ! $comment = get_comment($comment) ) … … 114 114 case 'unapprovecomment': 115 115 $comment = (int) $_GET['comment']; 116 116 check_admin_referer('unapprove-comment_' . $comment); 117 117 118 118 $p = (int) $_GET['p']; 119 119 if (isset($_GET['noredir'])) { 120 120 $noredir = true; -
wp-admin/custom-fields.js
14 14 for ( var i=0; i < inputs.length; i++ ) { 15 15 if ('text' == inputs[i].type) { 16 16 inputs[i].setAttribute('autocomplete', 'off'); 17 inputs[i].onkeypress = function(e) {return killSubmit('theList.ajaxUpdater("meta", "meta-' + parseInt(this.name.slice(5),10) + '");', e); };17 inputs[i].onkeypress = function(e) {return killSubmit('theList.ajaxUpdater("meta", "meta-' + parseInt(this.name.slice(5),10) + '");', e); }; 18 18 } 19 19 if ('updatemeta' == inputs[i].className) { 20 inputs[i].onclick = function(e) {return killSubmit('theList.ajaxUpdater("meta", "meta-' + parseInt(this.parentNode.parentNode.id.slice(5),10) + '");', e); };20 inputs[i].onclick = function(e) {return killSubmit('theList.ajaxUpdater("meta", "meta-' + parseInt(this.parentNode.parentNode.id.slice(5),10) + '");', e); }; 21 21 } 22 22 } 23 23 -
wp-admin/dbx-admin-key-js.php
9 9 break; 10 10 case 'page.php' : 11 11 case 'page-new.php' : 12 $man = 'pagemeta'; 12 $man = 'pagemeta'; 13 13 break; 14 14 case 'link.php' : 15 15 $man = 'linkmeta'; -
wp-admin/edit-category-form.php
22 22 <?php wp_nonce_field($nonce_action); ?> 23 23 <table class="editform" width="100%" cellspacing="2" cellpadding="5"> 24 24 <tr> 25 <th width="33%" scope="row" valign="top"><label for="cat_name"><?php _e('Category name:') ?></label></th>26 <td width="67%"><input name="cat_name" id="cat_name" type="text" value="<?php echo wp_specialchars($category->cat_name); ?>" size="40" /></td>25 <th width="33%" scope="row" valign="top"><label for="cat_name"><?php _e('Category name:') ?></label></th> 26 <td width="67%"><input name="cat_name" id="cat_name" type="text" value="<?php echo wp_specialchars($category->cat_name); ?>" size="40" /></td> 27 27 </tr> 28 28 <tr> 29 29 <th scope="row" valign="top"><label for="category_nicename"><?php _e('Category slug:') ?></label></th> … … 31 31 </tr> 32 32 <tr> 33 33 <th scope="row" valign="top"><label for="category_parent"><?php _e('Category parent:') ?></label></th> 34 <td> 34 <td> 35 35 <select name='category_parent' id='category_parent'> 36 <option value='0' <?php if (!$category->category_parent) echo " selected='selected'"; ?>><?php _e('None') ?></option>37 <?php wp_dropdown_cats($category->cat_ID, $category->category_parent); ?>38 </select></td>36 <option value='0' <?php if (!$category->category_parent) echo " selected='selected'"; ?>><?php _e('None') ?></option> 37 <?php wp_dropdown_cats($category->cat_ID, $category->category_parent); ?> 38 </select></td> 39 39 </tr> 40 40 <tr> 41 41 <th scope="row" valign="top"><label for="category_description"><?php _e('Description: (optional)') ?></label></th> -
wp-admin/edit-comments.php
39 39 </script> 40 40 <div class="wrap"> 41 41 <h2><?php _e('Comments'); ?></h2> 42 <form name="searchform" action="" method="get" id="editcomments"> 43 <fieldset> 44 <legend><?php _e('Show Comments That Contain...') ?></legend> 45 <input type="text" name="s" value="<?php if (isset($_GET['s'])) echo wp_specialchars($_GET['s'], 1); ?>" size="17" /> 46 <input type="submit" name="submit" value="<?php _e('Search') ?>" /> 47 <input type="hidden" name="mode" value="<?php echo $mode; ?>" />48 <?php _e('(Searches within comment text, e-mail, URI, and IP address.)') ?>49 </fieldset> 42 <form name="searchform" action="" method="get" id="editcomments"> 43 <fieldset> 44 <legend><?php _e('Show Comments That Contain...') ?></legend> 45 <input type="text" name="s" value="<?php if (isset($_GET['s'])) echo wp_specialchars($_GET['s'], 1); ?>" size="17" /> 46 <input type="submit" name="submit" value="<?php _e('Search') ?>" /> 47 <input type="hidden" name="mode" value="<?php echo $mode; ?>" /> 48 <?php _e('(Searches within comment text, e-mail, URI, and IP address.)') ?> 49 </fieldset> 50 50 </form> 51 51 <p><a href="?mode=view"><?php _e('View Mode') ?></a> | <a href="?mode=edit"><?php _e('Mass Edit Mode') ?></a></p> 52 52 <?php … … 105 105 ++$i; $class = ''; 106 106 $authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $comment->comment_post_ID")); 107 107 $comment_status = wp_get_comment_status($comment->comment_ID); 108 if ('unapproved' == $comment_status) 108 if ('unapproved' == $comment_status) 109 109 $class .= ' unapproved'; 110 110 if ($i % 2) 111 111 $class .= ' alternate'; … … 115 115 116 116 <?php comment_text() ?> 117 117 118 <p><?php comment_date('M j, g:i A'); ?> — [ 118 <p><?php comment_date('M j, g:i A'); ?> — [ 119 119 <?php 120 120 if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 121 121 echo " <a href='comment.php?action=editcomment&comment=".$comment->comment_ID."'>" . __('Edit') . '</a>'; … … 143 143 144 144 ?> 145 145 <p> 146 <strong><?php _e('No comments found.') ?></strong></p>146 <strong><?php _e('No comments found.') ?></strong></p> 147 147 148 148 <?php 149 149 } // end if ($comments) … … 154 154 wp_nonce_field('bulk-comments'); 155 155 echo '<table class="widefat"> 156 156 <thead> 157 <tr>158 <th scope="col"><input type="checkbox" onclick="checkAll(document.getElementById(\'deletecomments\'));" /></th>159 <th scope="col" style="text-align: left">' . __('Name') . '</th>160 <th scope="col" style="text-align: left">' . __('E-mail') . '</th>161 <th scope="col" style="text-align: left">' . __('IP') . '</th>162 <th scope="col" style="text-align: left">' . __('Comment Excerpt') . '</th>163 <th scope="col" colspan="3">' . __('Actions') . '</th>164 </tr>157 <tr> 158 <th scope="col"><input type="checkbox" onclick="checkAll(document.getElementById(\'deletecomments\'));" /></th> 159 <th scope="col" style="text-align: left">' . __('Name') . '</th> 160 <th scope="col" style="text-align: left">' . __('E-mail') . '</th> 161 <th scope="col" style="text-align: left">' . __('IP') . '</th> 162 <th scope="col" style="text-align: left">' . __('Comment Excerpt') . '</th> 163 <th scope="col" colspan="3">' . __('Actions') . '</th> 164 </tr> 165 165 </thead>'; 166 166 foreach ($comments as $comment) { 167 167 $authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $comment->comment_post_ID")); … … 169 169 $class = ('alternate' == $class) ? '' : 'alternate'; 170 170 $class .= ('unapproved' == $comment_status) ? ' unapproved' : ''; 171 171 ?> 172 <tr id="comment-<?php echo $comment->comment_ID; ?>" class='<?php echo $class; ?>'>173 <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { ?><input type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" /><?php } ?></td>174 <td><?php comment_author_link() ?></td>175 <td><?php comment_author_email_link() ?></td>176 <td><a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP() ?>"><?php comment_author_IP() ?></a></td>177 <td><?php comment_excerpt(); ?></td>178 <td>179 <?php if ('unapproved' == $comment_status) { ?>180 (Unapproved)181 <?php } else { ?>182 <a href="<?php echo get_permalink($comment->comment_post_ID); ?>#comment-<?php comment_ID() ?>" class="edit"><?php _e('View') ?></a>183 <?php } ?>184 </td>185 <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) {186 echo "<a href='comment.php?action=editcomment&comment=$comment->comment_ID' class='edit'>" . __('Edit') . "</a>"; } ?></td>187 <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) {188 echo "<a href=\"comment.php?action=deletecomment&p=".$comment->comment_post_ID."&comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . sprintf(__("You are about to delete this comment by "%s".\\n"Cancel" to stop, "OK" to delete."), js_escape( $comment->comment_author )) . "', theCommentList );\" class='delete'>" . __('Delete') . "</a> ";172 <tr id="comment-<?php echo $comment->comment_ID; ?>" class='<?php echo $class; ?>'> 173 <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { ?><input type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" /><?php } ?></td> 174 <td><?php comment_author_link() ?></td> 175 <td><?php comment_author_email_link() ?></td> 176 <td><a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP() ?>"><?php comment_author_IP() ?></a></td> 177 <td><?php comment_excerpt(); ?></td> 178 <td> 179 <?php if ('unapproved' == $comment_status) { ?> 180 (Unapproved) 181 <?php } else { ?> 182 <a href="<?php echo get_permalink($comment->comment_post_ID); ?>#comment-<?php comment_ID() ?>" class="edit"><?php _e('View') ?></a> 183 <?php } ?> 184 </td> 185 <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 186 echo "<a href='comment.php?action=editcomment&comment=$comment->comment_ID' class='edit'>" . __('Edit') . "</a>"; } ?></td> 187 <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 188 echo "<a href=\"comment.php?action=deletecomment&p=".$comment->comment_post_ID."&comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . sprintf(__("You are about to delete this comment by "%s".\\n"Cancel" to stop, "OK" to delete."), js_escape( $comment->comment_author )) . "', theCommentList );\" class='delete'>" . __('Delete') . "</a> "; 189 189 } ?></td> 190 </tr>191 <?php 190 </tr> 191 <?php 192 192 } // end foreach 193 193 ?></table> 194 194 <p class="submit"><input type="submit" name="delete_button" value="<?php _e('Delete Checked Comments »') ?>" onclick="var numchecked = getNumChecked(document.getElementById('deletecomments')); if(numchecked < 1) { alert('<?php _e("Please select some comments to delete"); ?>'); return false } return confirm('<?php printf(__("You are about to delete %s comments permanently \\n \'Cancel\' to stop, \'OK\' to delete."), "' + numchecked + '"); ?>')" /> 195 195 <input type="submit" name="spam_button" value="<?php _e('Mark Checked Comments as Spam »') ?>" onclick="return confirm('<?php _e("You are about to mark these comments as spam \\n \'Cancel\' to stop, \'OK\' to mark as spam.") ?>')" /></p> 196 </form>196 </form> 197 197 <div id="ajax-response"></div> 198 198 <?php 199 199 } else { -
wp-admin/edit-form-advanced.php
8 8 <?php endif; ?> 9 9 10 10 <form name="post" action="post.php" method="post" id="post"> 11 <?php if ( (isset($mode) && 'bookmarklet' == $mode) || 12 isset($_GET['popupurl']) ): ?> 11 <?php if ( (isset($mode) && 'bookmarklet' == $mode) || isset($_GET['popupurl']) ): ?> 13 12 <input type="hidden" name="mode" value="bookmarklet" /> 14 13 <?php endif; ?> 15 14 … … 83 82 <input name="advanced_view" type="hidden" value="1" /> 84 83 <label for="comment_status" class="selectit"> 85 84 <input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> /> 86 <?php _e('Allow Comments') ?></label> 85 <?php _e('Allow Comments') ?></label> 87 86 <label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow Pings') ?></label> 88 87 </div> 89 88 </fieldset> 90 89 91 90 <fieldset id="passworddiv" class="dbx-box"> 92 <h3 class="dbx-handle"><?php _e('Password-Protect Post') ?></h3> 91 <h3 class="dbx-handle"><?php _e('Password-Protect Post') ?></h3> 93 92 <div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo $post->post_password ?>" /></div> 94 93 </fieldset> 95 94 96 95 <fieldset id="slugdiv" class="dbx-box"> 97 <h3 class="dbx-handle"><?php _e('Post slug') ?></h3> 96 <h3 class="dbx-handle"><?php _e('Post slug') ?></h3> 98 97 <div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo $post->post_name ?>" /></div> 99 98 </fieldset> 100 99 101 100 <fieldset class="dbx-box"> 102 <h3 class="dbx-handle"><?php _e('Post Status') ?></h3> 101 <h3 class="dbx-handle"><?php _e('Post Status') ?></h3> 103 102 <div class="dbx-content"><?php if ( current_user_can('publish_posts') ) : ?> 104 103 <label for="post_status_publish" class="selectit"><input id="post_status_publish" name="post_status" type="radio" value="publish" <?php checked($post->post_status, 'publish'); checked($post->post_status, 'future'); ?> /> <?php _e('Published') ?></label> 105 104 <?php endif; ?> 106 <label for="post_status_draft" class="selectit"><input id="post_status_draft" name="post_status" type="radio" value="draft" <?php checked($post->post_status, 'draft'); ?> /> <?php _e('Draft') ?></label>107 <label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="radio" value="private" <?php checked($post->post_status, 'private'); ?> /> <?php _e('Private') ?></label></div>105 <label for="post_status_draft" class="selectit"><input id="post_status_draft" name="post_status" type="radio" value="draft" <?php checked($post->post_status, 'draft'); ?> /> <?php _e('Draft') ?></label> 106 <label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="radio" value="private" <?php checked($post->post_status, 'private'); ?> /> <?php _e('Private') ?></label></div> 108 107 </fieldset> 109 108 110 109 <?php if ( current_user_can('edit_posts') ) : ?> … … 119 118 <h3 class="dbx-handle"><?php _e('Post author'); ?>:</h3> 120 119 <div class="dbx-content"> 121 120 <select name="post_author_override" id="post_author_override"> 122 <?php 121 <?php 123 122 foreach ($authors as $o) : 124 123 $o = get_userdata( $o->ID ); 125 124 if ( $post->post_author == $o->ID || ( empty($post_ID) && $user_ID == $o->ID ) ) $selected = 'selected="selected"'; … … 138 137 </div> 139 138 140 139 <fieldset id="titlediv"> 141 <legend><?php _e('Title') ?></legend> 142 <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div>140 <legend><?php _e('Title') ?></legend> 141 <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div> 143 142 </fieldset> 144 143 145 144 <fieldset id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>"> … … 151 150 <?php echo $form_prevstatus ?> 152 151 153 152 154 <p class="submit"><?php echo $saveasdraft; ?> <input type="submit" name="submit" value="<?php _e('Save') ?>" style="font-weight: bold;" tabindex="4" /> 155 <?php 153 <p class="submit"><?php echo $saveasdraft; ?> <input type="submit" name="submit" value="<?php _e('Save') ?>" style="font-weight: bold;" tabindex="4" /> 154 <?php 156 155 if ('publish' != $post->post_status || 0 == $post_ID) { 157 156 ?> 158 157 <?php if ( current_user_can('publish_posts') ) : ?> 159 <input name="publish" type="submit" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" /> 158 <input name="publish" type="submit" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" /> 160 159 <?php endif; ?> 161 160 <?php 162 161 } 163 162 ?> 164 <input name="referredby" type="hidden" id="referredby" value="<?php 163 <input name="referredby" type="hidden" id="referredby" value="<?php 165 164 if ( !empty($_REQUEST['popupurl']) ) 166 165 echo wp_specialchars($_REQUEST['popupurl']); 167 166 else if ( url_to_postid(wp_get_referer()) == $post_ID ) … … 192 191 <fieldset class="dbx-box"> 193 192 <h3 class="dbx-handle"><?php _e('Trackbacks') ?></h3> 194 193 <div class="dbx-content"><?php _e('Send trackbacks to'); ?>: <?php echo $form_trackback; ?> (<?php _e('Separate multiple URIs with spaces'); ?>) 195 <?php 194 <?php 196 195 if ( ! empty($pings) ) 197 196 echo $pings; 198 197 ?> … … 205 204 <table cellpadding="3"> 206 205 <?php 207 206 $metadata = has_meta($post_ID); 208 list_meta($metadata); 207 list_meta($metadata); 209 208 ?> 210 209 211 210 </table> -
wp-admin/edit-form-comment.php
18 18 addLoadEvent(focusit); 19 19 </script> 20 20 <fieldset id="namediv"> 21 <legend><label for="name"><?php _e('Name:') ?></label></legend>21 <legend><label for="name"><?php _e('Name:') ?></label></legend> 22 22 <div> 23 <input type="text" name="newcomment_author" size="25" value="<?php echo $comment->comment_author ?>" tabindex="1" id="name" />24 </div>23 <input type="text" name="newcomment_author" size="25" value="<?php echo $comment->comment_author ?>" tabindex="1" id="name" /> 24 </div> 25 25 </fieldset> 26 26 <fieldset id="emaildiv"> 27 <legend><label for="email"><?php _e('E-mail:') ?></label></legend>28 <div>29 <input type="text" name="newcomment_author_email" size="20" value="<?php echo $comment->comment_author_email ?>" tabindex="2" id="email" />30 </div>27 <legend><label for="email"><?php _e('E-mail:') ?></label></legend> 28 <div> 29 <input type="text" name="newcomment_author_email" size="20" value="<?php echo $comment->comment_author_email ?>" tabindex="2" id="email" /> 30 </div> 31 31 </fieldset> 32 32 <fieldset id="uridiv"> 33 <legend><label for="URL"><?php _e('URI:') ?></label></legend>34 <div>35 <input type="text" id="newcomment_author_url" name="newcomment_author_url" size="35" value="<?php echo $comment->comment_author_url ?>" tabindex="3" id="URL" />36 </div>33 <legend><label for="URL"><?php _e('URI:') ?></label></legend> 34 <div> 35 <input type="text" id="newcomment_author_url" name="newcomment_author_url" size="35" value="<?php echo $comment->comment_author_url ?>" tabindex="3" id="URL" /> 36 </div> 37 37 </fieldset> 38 38 39 39 <fieldset style="clear: both;"> 40 <legend><?php _e('Comment') ?></legend>40 <legend><?php _e('Comment') ?></legend> 41 41 <?php the_editor($comment->comment_content, 'content', 'newcomment_author_url'); ?> 42 42 </fieldset> 43 43 44 44 <p class="submit"><input type="submit" name="editcomment" id="editcomment" value="<?php echo $submitbutton_text ?>" style="font-weight: bold;" tabindex="6" /> 45 <input name="referredby" type="hidden" id="referredby" value="<?php echo wp_get_referer(); ?>" />45 <input name="referredby" type="hidden" id="referredby" value="<?php echo wp_get_referer(); ?>" /> 46 46 </p> 47 47 48 48 </div> … … 54 54 <tr> 55 55 <th scope="row" valign="top"><?php _e('Comment Status') ?>:</th> 56 56 <td><label for="comment_status_approved" class="selectit"><input id="comment_status_approved" name="comment_status" type="radio" value="1" <?php checked($comment->comment_approved, '1'); ?> /> <?php _e('Approved') ?></label><br /> 57 <label for="comment_status_moderated" class="selectit"><input id="comment_status_moderated" name="comment_status" type="radio" value="0" <?php checked($comment->comment_approved, '0'); ?> /> <?php _e('Moderated') ?></label><br />58 <label for="comment_status_spam" class="selectit"><input id="comment_status_spam" name="comment_status" type="radio" value="spam" <?php checked($comment->comment_approved, 'spam'); ?> /> <?php _e('Spam') ?></label></td>57 <label for="comment_status_moderated" class="selectit"><input id="comment_status_moderated" name="comment_status" type="radio" value="0" <?php checked($comment->comment_approved, '0'); ?> /> <?php _e('Moderated') ?></label><br /> 58 <label for="comment_status_spam" class="selectit"><input id="comment_status_spam" name="comment_status" type="radio" value="spam" <?php checked($comment->comment_approved, 'spam'); ?> /> <?php _e('Spam') ?></label></td> 59 59 </tr> 60 60 61 61 <?php if ( current_user_can('edit_posts') ) : ?> … … 67 67 68 68 <tr> 69 69 <th scope="row" valign="top"><?php _e('Delete'); ?>:</th> 70 <td><input name="deletecomment" class="button" type="submit" id="deletecomment" tabindex="10" value="<?php _e('Delete this comment') ?>" <?php echo "onclick=\"return confirm('" . __("You are about to delete this comment \\n \'Cancel\' to stop, \'OK\' to delete.") . "')\""; ?> /> 70 <td><input name="deletecomment" class="button" type="submit" id="deletecomment" tabindex="10" value="<?php _e('Delete this comment') ?>" <?php echo "onclick=\"return confirm('" . __("You are about to delete this comment \\n \'Cancel\' to stop, \'OK\' to delete.") . "')\""; ?> /> 71 71 <input type="hidden" name="comment" value="<?php echo $comment->comment_ID ?>" /> 72 72 <input type="hidden" name="p" value="<?php echo $comment->comment_post_ID ?>" /> 73 73 <input type="hidden" name="noredir" value="1" /> -
wp-admin/edit-form.php
19 19 </script> 20 20 21 21 <div id="poststuff"> 22 <fieldset id="titlediv">23 <legend><a href="http://wordpress.org/docs/reference/post/#title" title="<?php _e('Help on titles') ?>"><?php _e('Title') ?></a></legend> 24 <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div>25 </fieldset>22 <fieldset id="titlediv"> 23 <legend><a href="http://wordpress.org/docs/reference/post/#title" title="<?php _e('Help on titles') ?>"><?php _e('Title') ?></a></legend> 24 <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div> 25 </fieldset> 26 26 27 <fieldset id="categorydiv">28 <legend><a href="http://wordpress.org/docs/reference/post/#category" title="<?php _e('Help on categories') ?>"><?php _e('Categories') ?></a></legend> 29 <div><?php dropdown_categories($post->post_category); ?></div>30 </fieldset>27 <fieldset id="categorydiv"> 28 <legend><a href="http://wordpress.org/docs/reference/post/#category" title="<?php _e('Help on categories') ?>"><?php _e('Categories') ?></a></legend> 29 <div><?php dropdown_categories($post->post_category); ?></div> 30 </fieldset> 31 31 32 32 <br /> 33 33 <fieldset id="postdiv"> 34 <legend><a href="http://wordpress.org/docs/reference/post/#post" title="<?php _e('Help with post field') ?>"><?php _e('Post') ?></a></legend>34 <legend><a href="http://wordpress.org/docs/reference/post/#post" title="<?php _e('Help with post field') ?>"><?php _e('Post') ?></a></legend> 35 35 <?php the_quicktags(); ?> 36 36 <?php 37 37 $rows = get_settings('default_post_edit_rows'); 38 38 if (($rows < 3) || ($rows > 100)) { 39 $rows = 10;39 $rows = 10; 40 40 } 41 41 ?> 42 42 <div><textarea rows="<?php echo $rows; ?>" cols="40" name="content" tabindex="4" id="content"><?php echo $post->post_content ?></textarea></div> … … 54 54 <p><label for="trackback"> <?php printf(__('<a href="%s" title="Help on trackbacks"><strong>TrackBack</strong> a <abbr title="Universal Resource Identifier">URI</abbr></a>:</label> (Separate multiple <abbr title="Universal Resource Identifier">URI</abbr>s with spaces.)<br />'), 'http://wordpress.org/docs/reference/post/#trackback') ?> 55 55 <input type="text" name="trackback_url" style="width: 360px" id="trackback" tabindex="7" /></p> 56 56 57 <p class="submit"><input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" value="<?php _e('Save as Draft') ?>" /> 58 <input name="saveasprivate" type="submit" id="saveasprivate" tabindex="10" value="<?php _e('Save as Private') ?>" />57 <p class="submit"><input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" value="<?php _e('Save as Draft') ?>" /> 58 <input name="saveasprivate" type="submit" id="saveasprivate" tabindex="10" value="<?php _e('Save as Private') ?>" /> 59 59 60 60 <?php if ( current_user_can('edit_posts') ) : ?> 61 <input name="publish" type="submit" id="publish" tabindex="6" style="font-weight: bold;" value="<?php _e('Publish') ?>" /> 61 <input name="publish" type="submit" id="publish" tabindex="6" style="font-weight: bold;" value="<?php _e('Publish') ?>" /> 62 62 <?php endif; ?> 63 63 64 64 <?php if ('bookmarklet' != $mode) { 65 echo '<input name="advanced" type="submit" id="advancededit" tabindex="7" value="' . __('Advanced Editing »') . '" />';66 } ?>67 <input name="referredby" type="hidden" id="referredby" value="<?php if ( wp_get_referer() ) echo urlencode(wp_get_referer()); ?>" />65 echo '<input name="advanced" type="submit" id="advancededit" tabindex="7" value="' . __('Advanced Editing »') . '" />'; 66 } ?> 67 <input name="referredby" type="hidden" id="referredby" value="<?php if ( wp_get_referer() ) echo urlencode(wp_get_referer()); ?>" /> 68 68 </p> 69 69 70 70 <?php do_action('simple_edit_form', ''); ?> -
wp-admin/edit-link-form.php
30 30 } 31 31 ?> 32 32 33 <div class="wrap"> 33 <div class="wrap"> 34 34 <h2><?php echo $heading ?></h2> 35 35 <?php echo $form ?> 36 36 <?php wp_nonce_field($nonce_action); ?> … … 48 48 </fieldset> 49 49 50 50 <fieldset class="dbx-box"> 51 <h3 class="dbx-handle"><?php _e('Target') ?></h3> 51 <h3 class="dbx-handle"><?php _e('Target') ?></h3> 52 52 <div class="dbx-content"> 53 53 <label for="link_target_blank" class="selectit"> 54 54 <input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo(($link->link_target == '_blank') ? 'checked="checked"' : ''); ?> /> … … 63 63 </fieldset> 64 64 65 65 <fieldset class="dbx-box"> 66 <h3 class="dbx-handle"><?php _e('Visible') ?></h3> 66 <h3 class="dbx-handle"><?php _e('Visible') ?></h3> 67 67 <div class="dbx-content"> 68 68 <label for="link_visible_yes" class="selectit"> 69 69 <input id="link_visible_yes" type="radio" name="link_visible" <?php if ($link->link_visible == 'Y') echo "checked='checked'"; ?> value="Y" /> -
wp-admin/edit-page-form.php
17 17 $sendto = wp_get_referer(); 18 18 19 19 if ( 0 != $post_ID && $sendto == get_permalink($post_ID) ) 20 $sendto = 'redo';20 $sendto = 'redo'; 21 21 $sendto = wp_specialchars( $sendto ); 22 22 23 23 ?> … … 28 28 wp_nonce_field($nonce_action); 29 29 30 30 if (isset($mode) && 'bookmarklet' == $mode) { 31 echo '<input type="hidden" name="mode" value="bookmarklet" />';31 echo '<input type="hidden" name="mode" value="bookmarklet" />'; 32 32 } 33 33 ?> 34 34 <input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" /> … … 54 54 <input name="advanced_view" type="hidden" value="1" /> 55 55 <label for="comment_status" class="selectit"> 56 56 <input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> /> 57 <?php _e('Allow Comments') ?></label> 57 <?php _e('Allow Comments') ?></label> 58 58 <label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow Pings') ?></label> 59 59 </div> 60 60 </fieldset> 61 61 62 62 <fieldset class="dbx-box"> 63 <h3 class="dbx-handle"><?php _e('Page Status') ?></h3> 63 <h3 class="dbx-handle"><?php _e('Page Status') ?></h3> 64 64 <div class="dbx-content"><?php if ( current_user_can('publish_pages') ) : ?> 65 65 <label for="post_status_publish" class="selectit"><input id="post_status_publish" name="post_status" type="radio" value="publish" <?php checked($post->post_status, 'publish'); checked($post->post_status, 'future'); ?> /> <?php _e('Published') ?></label> 66 66 <?php endif; ?> 67 <label for="post_status_draft" class="selectit"><input id="post_status_draft" name="post_status" type="radio" value="draft" <?php checked($post->post_status, 'draft'); ?> /> <?php _e('Draft') ?></label>68 <label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="radio" value="private" <?php checked($post->post_status, 'private'); ?> /> <?php _e('Private') ?></label></div>67 <label for="post_status_draft" class="selectit"><input id="post_status_draft" name="post_status" type="radio" value="draft" <?php checked($post->post_status, 'draft'); ?> /> <?php _e('Draft') ?></label> 68 <label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="radio" value="private" <?php checked($post->post_status, 'private'); ?> /> <?php _e('Private') ?></label></div> 69 69 </fieldset> 70 70 71 71 <fieldset id="passworddiv" class="dbx-box"> 72 <h3 class="dbx-handle"><?php _e('Password-Protect Page') ?></h3> 72 <h3 class="dbx-handle"><?php _e('Password-Protect Page') ?></h3> 73 73 <div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo $post->post_password ?>" /></div> 74 74 </fieldset> 75 75 76 76 <fieldset id="pageparent" class="dbx-box"> 77 <h3 class="dbx-handle"><?php _e('Page Parent') ?></h3> 77 <h3 class="dbx-handle"><?php _e('Page Parent') ?></h3> 78 78 <div class="dbx-content"><p><select name="parent_id"> 79 79 <option value='0'><?php _e('Main Page (no parent)'); ?></option> 80 80 <?php parent_dropdown($post->post_parent); ?> … … 84 84 85 85 <?php if ( 0 != count( get_page_templates() ) ) { ?> 86 86 <fieldset id="pageparent" class="dbx-box"> 87 <h3 class="dbx-handle"><?php _e('Page Template:') ?></h3> 87 <h3 class="dbx-handle"><?php _e('Page Template:') ?></h3> 88 88 <div class="dbx-content"><p><select name="page_template"> 89 89 <option value='default'><?php _e('Default Template'); ?></option> 90 90 <?php page_template_dropdown($post->page_template); ?> … … 94 94 <?php } ?> 95 95 96 96 <fieldset id="slugdiv" class="dbx-box"> 97 <h3 class="dbx-handle"><?php _e('Page slug') ?></h3> 97 <h3 class="dbx-handle"><?php _e('Page slug') ?></h3> 98 98 <div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo $post->post_name ?>" /></div> 99 99 </fieldset> 100 100 … … 103 103 <h3 class="dbx-handle"><?php _e('Page author'); ?>:</h3> 104 104 <div class="dbx-content"> 105 105 <select name="post_author_override" id="post_author_override"> 106 <?php 106 <?php 107 107 foreach ($authors as $o) : 108 108 $o = get_userdata( $o->ID ); 109 109 if ( $post->post_author == $o->ID || ( empty($post_ID) && $user_ID == $o->ID ) ) $selected = 'selected="selected"'; … … 117 117 <?php endif; ?> 118 118 119 119 <fieldset id="pageorder" class="dbx-box"> 120 <h3 class="dbx-handle"><?php _e('Page Order') ?></h3> 120 <h3 class="dbx-handle"><?php _e('Page Order') ?></h3> 121 121 <div class="dbx-content"><p><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo $post->menu_order ?>" /></p></div> 122 122 </fieldset> 123 123 … … 127 127 </div> 128 128 129 129 <fieldset id="titlediv"> 130 <legend><?php _e('Page Title') ?></legend> 131 <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div>130 <legend><?php _e('Page Title') ?></legend> 131 <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div> 132 132 </fieldset> 133 133 134 134 135 135 <fieldset id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>"> 136 <legend><?php _e('Page Content') ?></legend>136 <legend><?php _e('Page Content') ?></legend> 137 137 <?php the_editor($post->post_content); ?> 138 138 </fieldset> 139 139 140 140 <p class="submit"> 141 141 <input name="save" type="submit" id="save" tabindex="3" value="<?php _e('Save and Continue Editing'); ?>" /> 142 <input type="submit" name="submit" value="<?php _e('Save') ?>" style="font-weight: bold;" tabindex="4" /> 143 <?php 142 <input type="submit" name="submit" value="<?php _e('Save') ?>" style="font-weight: bold;" tabindex="4" /> 143 <?php 144 144 if ('publish' != $post->post_status || 0 == $post_ID): 145 145 ?> 146 146 <?php if ( current_user_can('publish_pages') ) : ?> 147 <input name="publish" type="submit" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" /> 147 <input name="publish" type="submit" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" /> 148 148 <?php endif; endif;?> 149 149 <input name="referredby" type="hidden" id="referredby" value="<?php echo $sendto; ?>" /> 150 150 </p> … … 167 167 <h3 class="dbx-handle"><?php _e('Custom Fields') ?></h3> 168 168 <div id="postcustomstuff" class="dbx-content"> 169 169 <table cellpadding="3"> 170 <?php 170 <?php 171 171 $metadata = has_meta($post_ID); 172 list_meta($metadata); 172 list_meta($metadata); 173 173 ?> 174 174 175 175 </table> … … 184 184 </div> 185 185 186 186 <?php if ('edit' == $action) : 187 $delete_nonce = wp_create_nonce( 'delete-page_' . $post_ID ); 187 $delete_nonce = wp_create_nonce( 'delete-page_' . $post_ID ); 188 188 if ( current_user_can('delete_page', $post->ID) ) ?> 189 189 <input name="deletepost" class="button" type="submit" id="deletepost" tabindex="10" value="<?php _e('Delete this page') ?>" <?php echo "onclick=\"if ( confirm('" . sprintf(__("You are about to delete this page \'%s\'\\n \'Cancel\' to stop, \'OK\' to delete."), js_escape($post->post_title) ) . "') ) { document.forms.post._wpnonce.value = '$delete_nonce'; return true;}return false;\""; ?> /> 190 190 <?php endif; ?> -
wp-admin/edit-pages.php
10 10 <h2><?php _e('Page Management'); ?></h2> 11 11 <p><?php _e('Pages are like posts except they live outside of the normal blog chronology and can be hierarchical. You can use pages to organize and manage any amount of content.'); ?> <a href="page-new.php"><?php _e('Create a new page »'); ?></a></p> 12 12 13 <form name="searchform" action="" method="get"> 14 <fieldset> 15 <legend><?php _e('Search Pages…') ?></legend>16 <input type="text" name="s" value="<?php if (isset($_GET['s'])) echo wp_specialchars($_GET['s'], 1); ?>" size="17" /> 17 <input type="submit" name="submit" value="<?php _e('Search') ?>" /> 18 </fieldset>13 <form name="searchform" action="" method="get"> 14 <fieldset> 15 <legend><?php _e('Search Pages…') ?></legend> 16 <input type="text" name="s" value="<?php if (isset($_GET['s'])) echo wp_specialchars($_GET['s'], 1); ?>" size="17" /> 17 <input type="submit" name="submit" value="<?php _e('Search') ?>" /> 18 </fieldset> 19 19 </form> 20 20 21 21 <?php … … 28 28 29 29 if ($posts) { 30 30 ?> 31 <table class="widefat"> 32 <thead>33 <tr>34 <th scope="col"><?php _e('ID') ?></th>35 <th scope="col" style="text-align: left"><?php _e('Title') ?></th>36 <th scope="col" style="text-align: left"><?php _e('Owner') ?></th>37 <th scope="col" style="text-align: left"><?php _e('Updated') ?></th>38 <th scope="col" colspan="3"><?php _e('Action'); ?></th>39 </tr>40 </thead>41 <tbody id="the-list">31 <table class="widefat"> 32 <thead> 33 <tr> 34 <th scope="col"><?php _e('ID') ?></th> 35 <th scope="col" style="text-align: left"><?php _e('Title') ?></th> 36 <th scope="col" style="text-align: left"><?php _e('Owner') ?></th> 37 <th scope="col" style="text-align: left"><?php _e('Updated') ?></th> 38 <th scope="col" colspan="3"><?php _e('Action'); ?></th> 39 </tr> 40 </thead> 41 <tbody id="the-list"> 42 42 <?php 43 43 page_rows(0, 0, $posts, $all); 44 44 ?> 45 </tbody>45 </tbody> 46 46 </table> 47 47 48 48 <div id="ajax-response"></div> … … 53 53 <p><?php _e('No pages yet.') ?></p> 54 54 <?php 55 55 } // end if ($posts) 56 ?> 56 ?> 57 57 58 58 <h3><a href="page-new.php"><?php _e('Create New Page »'); ?></a></h3> 59 59 60 60 </div> 61 61 62 <?php include('admin-footer.php'); ?> 62 <?php include('admin-footer.php'); ?> -
wp-admin/edit.php
12 12 $other_drafts = get_others_drafts( $user_ID); 13 13 14 14 if ($drafts || $other_drafts) { 15 ?> 15 ?> 16 16 <div class="wrap"> 17 17 <?php if ($drafts) { ?> 18 <p><strong><?php _e('Your Drafts:') ?></strong> 19 <?php18 <p><strong><?php _e('Your Drafts:') ?></strong> 19 <?php 20 20 $i = 0; 21 21 foreach ($drafts as $draft) { 22 22 if (0 != $i) … … 27 27 echo "<a href='post.php?action=edit&post=$draft->ID' title='" . __('Edit this draft') . "'>$draft->post_title</a>"; 28 28 ++$i; 29 29 } 30 ?> 31 .</p> 30 ?> 31 .</p> 32 32 <?php } ?> 33 33 34 <?php if ($other_drafts) { ?> 35 <p><strong><?php _e('Other’s Drafts:') ?></strong> 36 <?php34 <?php if ($other_drafts) { ?> 35 <p><strong><?php _e('Other’s Drafts:') ?></strong> 36 <?php 37 37 $i = 0; 38 38 foreach ($other_drafts as $draft) { 39 39 if (0 != $i) … … 44 44 echo "<a href='post.php?action=edit&post=$draft->ID' title='" . __('Edit this draft') . "'>$draft->post_title</a>"; 45 45 ++$i; 46 46 } 47 ?> 48 .</p> 47 ?> 48 .</p> 49 49 50 50 <?php } ?> 51 51 … … 73 73 ?> 74 74 </h2> 75 75 76 <form name="searchform" action="" method="get" style="float: left; width: 16em; margin-right: 3em;"> 77 <fieldset> 78 <legend><?php _e('Search Posts…') ?></legend> 79 <input type="text" name="s" value="<?php if (isset($s)) echo wp_specialchars($s, 1); ?>" size="17" /> 80 <input type="submit" name="submit" value="<?php _e('Search') ?>" /> 81 </fieldset>76 <form name="searchform" action="" method="get" style="float: left; width: 16em; margin-right: 3em;"> 77 <fieldset> 78 <legend><?php _e('Search Posts…') ?></legend> 79 <input type="text" name="s" value="<?php if (isset($s)) echo wp_specialchars($s, 1); ?>" size="17" /> 80 <input type="submit" name="submit" value="<?php _e('Search') ?>" /> 81 </fieldset> 82 82 </form> 83 83 84 84 <?php $arc_result = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_type = 'post' ORDER BY post_date DESC"); … … 88 88 <form name="viewarc" action="" method="get" style="float: left; width: 20em; margin-bottom: 1em;"> 89 89 <fieldset> 90 90 <legend><?php _e('Browse Month…') ?></legend> 91 <select name='m'>91 <select name='m'> 92 92 <?php 93 93 foreach ($arc_result as $arc_row) { 94 94 if ( $arc_row->yyear == 0 ) … … 106 106 } 107 107 ?> 108 108 </select> 109 <input type="submit" name="submit" value="<?php _e('Show Month') ?>" /> 109 <input type="submit" name="submit" value="<?php _e('Show Month') ?>" /> 110 110 </fieldset> 111 111 </form> 112 112 … … 117 117 <?php 118 118 // define the columns to display, the syntax is 'internal name' => 'display name' 119 119 $posts_columns = array( 120 'id' => __('ID'),121 'date' => __('When'),122 'title' => __('Title'),123 'categories' => __('Categories'),124 'comments' => __('Comments'),125 'author' => __('Author')120 'id' => __('ID'), 121 'date' => __('When'), 122 'title' => __('Title'), 123 'categories' => __('Categories'), 124 'comments' => __('Comments'), 125 'author' => __('Author') 126 126 ); 127 127 $posts_columns = apply_filters('manage_posts_columns', $posts_columns); 128 128 … … 133 133 134 134 ?> 135 135 136 <table class="widefat"> 136 <table class="widefat"> 137 137 <thead> 138 138 <tr> 139 139 … … 150 150 foreach ($posts as $post) { start_wp(); 151 151 add_filter('the_title','wp_specialchars'); 152 152 $class = ('alternate' == $class) ? '' : 'alternate'; 153 ?> 153 ?> 154 154 <tr id='post-<?php echo $id; ?>' class='<?php echo $class; ?>'> 155 155 156 156 <?php … … 185 185 186 186 case 'comments': 187 187 ?> 188 <td style="text-align: center"><a href="edit.php?p=<?php echo $id ?>&c=1"> 189 <?php comments_number(__('0'), __('1'), __('%')) ?> 190 </a></td>188 <td style="text-align: center"><a href="edit.php?p=<?php echo $id ?>&c=1"> 189 <?php comments_number(__('0'), __('1'), __('%')) ?> 190 </a></td> 191 191 <?php 192 192 break; 193 193 … … 223 223 } 224 224 } 225 225 ?> 226 </tr> 226 </tr> 227 227 <?php 228 228 } 229 229 } else { 230 230 ?> 231 <tr style='background-color: <?php echo $bgcolor; ?>'> 232 <td colspan="8"><?php _e('No posts found.') ?></td> 233 </tr> 231 <tr style='background-color: <?php echo $bgcolor; ?>'> 232 <td colspan="8"><?php _e('No posts found.') ?></td> 233 </tr> 234 234 <?php 235 235 } // end if ($posts) 236 236 ?> … … 249 249 250 250 $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved != 'spam' ORDER BY comment_date"); 251 251 if ($comments) { 252 ?> 253 <h3 id="comments"><?php _e('Comments') ?></h3> 254 <ol id="the-comment-list" class="commentlist"> 252 ?> 253 <h3 id="comments"><?php _e('Comments') ?></h3> 254 <ol id="the-comment-list" class="commentlist"> 255 255 <?php 256 256 $i = 0; 257 257 foreach ($comments as $comment) { … … 259 259 ++$i; $class = ''; 260 260 $authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $comment->comment_post_ID")); 261 261 $comment_status = wp_get_comment_status($comment->comment_ID); 262 if ('unapproved' == $comment_status) 262 if ('unapproved' == $comment_status) 263 263 $class .= ' unapproved'; 264 264 if ($i % 2) 265 265 $class .= ' alternate'; … … 289 289 echo '</ol>'; 290 290 }//end if comments 291 291 ?> 292 <?php } ?> 293 </div> 294 <?php 292 <?php } ?> 293 </div> 294 <?php 295 295 include('admin-footer.php'); 296 ?> 296 ?> -
wp-admin/export.php
33 33 $posts = $wpdb->get_results("SELECT * FROM $wpdb->posts ORDER BY post_date_gmt ASC"); 34 34 ?> 35 35 <!-- generator="wordpress/<?php bloginfo_rss('version') ?>" created="<?php echo date('Y-m-d H:m'); ?>"--> 36 <rss version="2.0" 36 <rss version="2.0" 37 37 xmlns:content="http://purl.org/rss/1.0/modules/content/" 38 38 xmlns:wfw="http://wellformedweb.org/CommentAPI/" 39 39 xmlns:dc="http://purl.org/dc/elements/1.1/" … … 68 68 <wp:post_parent><?php echo $post->post_parent; ?></wp:post_parent> 69 69 <wp:post_type><?php echo $post->post_type; ?></wp:post_type> 70 70 <?php 71 $postmeta = $wpdb->get_results("SELECT * FROM $wpdb->postmeta WHERE post_id = $post->ID"); 71 $postmeta = $wpdb->get_results("SELECT * FROM $wpdb->postmeta WHERE post_id = $post->ID"); 72 72 if ( $postmeta ) { 73 73 ?> 74 74 <?php foreach( $postmeta as $meta ) { ?> … … 79 79 <?php } ?> 80 80 <?php } ?> 81 81 <?php 82 $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $post->ID"); 82 $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $post->ID"); 83 83 if ( $comments ) { foreach ( $comments as $c ) { ?> 84 84 <wp:comment> 85 85 <wp:comment_author><?php echo $c->comment_author; ?></wp:comment_author> -
wp-admin/index.php
1 1 <?php 2 require_once('admin.php'); 3 $title = __('Dashboard'); 2 require_once('admin.php'); 3 $title = __('Dashboard'); 4 4 require_once('admin-header.php'); 5 5 require_once (ABSPATH . WPINC . '/rss.php'); 6 6 … … 45 45 <?php endif; ?> 46 46 47 47 <ul> 48 <?php 48 <?php 49 49 if ( $comments ) { 50 50 foreach ($comments as $comment) { 51 51 echo '<li>' . sprintf(__('%1$s on %2$s'), get_comment_author_link(), '<a href="'. get_permalink($comment->comment_post_ID) . '#comment-' . $comment->comment_ID . '">' . get_the_title($comment->comment_post_ID) . '</a>'); 52 edit_comment_link(__("Edit"), ' <small>(', ')</small>'); 52 edit_comment_link(__("Edit"), ' <small>(', ')</small>'); 53 53 echo '</li>'; 54 54 } 55 55 } … … 79 79 80 80 <?php 81 81 if ( $scheduled = $wpdb->get_results("SELECT ID, post_title, post_date_gmt FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'future' ORDER BY post_date ASC") ) : 82 ?> 82 ?> 83 83 <div> 84 84 <h3><?php _e('Scheduled Entries:') ?></h3> 85 85 <ul> … … 89 89 $post->post_title = sprintf(__('Post #%s'), $post->ID); 90 90 echo "<li>" . sprintf(__('%1$s in %2$s'), "<a href='post.php?action=edit&post=$post->ID' title='" . __('Edit this post') . "'>$post->post_title</a>", human_time_diff( current_time('timestamp', 1), strtotime($post->post_date_gmt. ' GMT') )) . "</li>"; 91 91 } 92 ?> 92 ?> 93 93 </ul> 94 94 </div> 95 95 <?php endif; ?> … … 98 98 <h3><?php _e('Blog Stats'); ?></h3> 99 99 <?php 100 100 $numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish'"); 101 if (0 < $numposts) $numposts = number_format($numposts); 101 if (0 < $numposts) $numposts = number_format($numposts); 102 102 103 103 $numcomms = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'"); 104 104 if (0 < $numcomms) $numcomms = number_format($numcomms); -
wp-admin/install-helper.php
9 9 ** false on error 10 10 */ 11 11 function maybe_create_table($table_name, $create_ddl) { 12 global $wpdb;13 foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) {14 if ($table == $table_name) {15 return true;16 }17 }18 //didn't find it try to create it.19 $q = $wpdb->query($create_ddl);20 // we cannot directly tell that whether this succeeded!21 foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) {22 if ($table == $table_name) {23 return true;24 }25 }26 return false;12 global $wpdb; 13 foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) { 14 if ($table == $table_name) { 15 return true; 16 } 17 } 18 //didn't find it try to create it. 19 $q = $wpdb->query($create_ddl); 20 // we cannot directly tell that whether this succeeded! 21 foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) { 22 if ($table == $table_name) { 23 return true; 24 } 25 } 26 return false; 27 27 } 28 28 29 29 /** … … 33 33 ** false on error 34 34 */ 35 35 function maybe_add_column($table_name, $column_name, $create_ddl) { 36 global $wpdb, $debug;37 foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {38 if ($debug) echo("checking $column == $column_name<br />");39 if ($column == $column_name) {40 return true;41 }42 }43 //didn't find it try to create it.44 $q = $wpdb->query($create_ddl);45 // we cannot directly tell that whether this succeeded!46 foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {47 if ($column == $column_name) {48 return true;49 }50 }51 return false;36 global $wpdb, $debug; 37 foreach ($wpdb->get_col("DESC $table_name",0) as $column ) { 38 if ($debug) echo("checking $column == $column_name<br />"); 39 if ($column == $column_name) { 40 return true; 41 } 42 } 43 //didn't find it try to create it. 44 $q = $wpdb->query($create_ddl); 45 // we cannot directly tell that whether this succeeded! 46 foreach ($wpdb->get_col("DESC $table_name",0) as $column ) { 47 if ($column == $column_name) { 48 return true; 49 } 50 } 51 return false; 52 52 } 53 53 54 54 … … 59 59 ** false on error 60 60 */ 61 61 function maybe_drop_column($table_name, $column_name, $drop_ddl) { 62 global $wpdb;63 foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {64 if ($column == $column_name) {65 //found it try to drop it.66 $q = $wpdb->query($drop_ddl);67 // we cannot directly tell that whether this succeeded!68 foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {69 if ($column == $column_name) {70 return false;71 }72 }73 }74 }75 // else didn't find it76 return true;62 global $wpdb; 63 foreach ($wpdb->get_col("DESC $table_name",0) as $column ) { 64 if ($column == $column_name) { 65 //found it try to drop it. 66 $q = $wpdb->query($drop_ddl); 67 // we cannot directly tell that whether this succeeded! 68 foreach ($wpdb->get_col("DESC $table_name",0) as $column ) { 69 if ($column == $column_name) { 70 return false; 71 } 72 } 73 } 74 } 75 // else didn't find it 76 return true; 77 77 } 78 78 79 79 … … 92 92 ** Extra 93 93 */ 94 94 function check_column($table_name, $col_name, $col_type, $is_null = null, $key = null, $default = null, $extra = null) { 95 global $wpdb, $debug;96 $diffs = 0;97 $results = $wpdb->get_results("DESC $table_name");98 99 foreach ($results as $row ) {100 if ($debug > 1) print_r($row);101 if ($row->Field == $col_name) {102 // got our column, check the params103 if ($debug) echo ("checking $row->Type against $col_type\n");104 if (($col_type != null) && ($row->Type != $col_type)) {105 ++$diffs;106 }107 if (($is_null != null) && ($row->Null != $is_null)) {108 ++$diffs;109 }110 if (($key != null) && ($row->Key != $key)) {111 ++$diffs;112 }113 if (($default != null) && ($row->Default != $default)) {114 ++$diffs;115 }116 if (($extra != null) && ($row->Extra != $extra)) {117 ++$diffs;118 }119 if ($diffs > 0) {120 if ($debug) echo ("diffs = $diffs returning false\n");121 return false;122 }123 return true;124 } // end if found our column125 }126 return false;95 global $wpdb, $debug; 96 $diffs = 0; 97 $results = $wpdb->get_results("DESC $table_name"); 98 99 foreach ($results as $row ) { 100 if ($debug > 1) print_r($row); 101 if ($row->Field == $col_name) { 102 // got our column, check the params 103 if ($debug) echo ("checking $row->Type against $col_type\n"); 104 if (($col_type != null) && ($row->Type != $col_type)) { 105 ++$diffs; 106 } 107 if (($is_null != null) && ($row->Null != $is_null)) { 108 ++$diffs; 109 } 110 if (($key != null) && ($row->Key != $key)) { 111 ++$diffs; 112 } 113 if (($default != null) && ($row->Default != $default)) { 114 ++$diffs; 115 } 116 if (($extra != null) && ($row->Extra != $extra)) { 117 ++$diffs; 118 } 119 if ($diffs > 0) { 120 if ($debug) echo ("diffs = $diffs returning false\n"); 121 return false; 122 } 123 return true; 124 } // end if found our column 125 } 126 return false; 127 127 } 128 128 129 129 /* 130 130 echo "<p>testing</p>"; 131 131 echo "<pre>"; 132 132 133 //check_column('wp_links', 'link_description', 'mediumtext'); 133 //check_column('wp_links', 'link_description', 'mediumtext'); 134 134 //if (check_column($wpdb->comments, 'comment_author', 'tinytext')) 135 135 // echo "ok\n"; 136 136 $error_count = 0; … … 138 138 // check the column 139 139 if (!check_column($wpdb->links, 'link_description', 'varchar(255)')) 140 140 { 141 $ddl = "ALTER TABLE $wpdb->links MODIFY COLUMN link_description varchar(255) NOT NULL DEFAULT '' ";142 $q = $wpdb->query($ddl);141 $ddl = "ALTER TABLE $wpdb->links MODIFY COLUMN link_description varchar(255) NOT NULL DEFAULT '' "; 142 $q = $wpdb->query($ddl); 143 143 } 144 144 if (check_column($wpdb->links, 'link_description', 'varchar(255)')) { 145 $res .= $tablename . ' - ok <br />';145 $res .= $tablename . ' - ok <br />'; 146 146 } else { 147 $res .= 'There was a problem with ' . $tablename . '<br />';148 ++$error_count;147 $res .= 'There was a problem with ' . $tablename . '<br />'; 148 ++$error_count; 149 149 } 150 150 echo "</pre>"; 151 151 */ -
wp-admin/install.php
1 1 <?php 2 2 define('WP_INSTALLING', true); 3 if (!file_exists('../wp-config.php')) 4 die("There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started. Need more help? <a href='http://wordpress.org/docs/faq/#wp-config'>We got it</a>. You can <a href='setup-config.php'>create a <code>wp-config.php</code> file through a web interface</a>, but this doesn't work for all server setups. The safest way is to manually create the file.");3 if (!file_exists('../wp-config.php')) 4 die("There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started. Need more help? <a href='http://wordpress.org/docs/faq/#wp-config'>We got it</a>. You can <a href='setup-config.php'>create a <code>wp-config.php</code> file through a web interface</a>, but this doesn't work for all server setups. The safest way is to manually create the file."); 5 5 6 6 require_once('../wp-config.php'); 7 7 require_once('./upgrade-functions.php'); … … 62 62 text-align: right; 63 63 } 64 64 #footer { 65 text-align: center; 66 border-top: 1px solid #ccc; 67 padding-top: 1em; 65 text-align: center; 66 border-top: 1px solid #ccc; 67 padding-top: 1em; 68 68 font-style: italic; 69 69 } 70 70 --> … … 104 104 <tr> 105 105 <th scope="row" valign="top"> <?php __('Privacy:'); ?></th> 106 106 <td><label><input type="checkbox" name="blog_public" value="1" checked="checked" /> <?php _e('I would like my blog to appear in search engines like Google and Technorati.'); ?></label></td> 107 </tr> 107 </tr> 108 108 </table> 109 109 <p><em><?php _e('Double-check that email address before continuing.'); ?></em></p> 110 110 <h2 class="step"> -
wp-admin/link-add.php
7 7 8 8 9 9 wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image', 10 'description', 'visible', 'target', 'category', 'link_id',11 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel',12 'notes', 'linkcheck[]'));10 'description', 'visible', 'target', 'category', 'link_id', 11 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', 12 'notes', 'linkcheck[]')); 13 13 14 14 wp_enqueue_script( array('xfn', 'dbx-admin-key?pagenow=link.php') ); 15 15 if ( current_user_can( 'manage_categories' ) ) -
wp-admin/link-import.php
12 12 ?> 13 13 <?php 14 14 switch ($step) { 15 case 0:16 {17 include_once('admin-header.php');18 if ( !current_user_can('manage_links') )19 die (__("Cheatin’ uh?"));15 case 0: 16 { 17 include_once('admin-header.php'); 18 if ( !current_user_can('manage_links') ) 19 die (__("Cheatin’ uh?")); 20 20 21 $opmltype = 'blogrolling'; // default.21 $opmltype = 'blogrolling'; // default. 22 22 ?> 23 23 24 24 <div class="wrap"> … … 60 60 61 61 </div> 62 62 <?php 63 break;64 } // end case 063 break; 64 } // end case 0 65 65 66 case 1: {66 case 1: { 67 67 check_admin_referer('import-bookmarks'); 68 68 69 include_once('admin-header.php');70 if ( !current_user_can('manage_links') )71 die (__("Cheatin' uh ?"));69 include_once('admin-header.php'); 70 if ( !current_user_can('manage_links') ) 71 die (__("Cheatin' uh ?")); 72 72 ?> 73 73 <div class="wrap"> 74 74 75 <h2><?php _e('Importing...') ?></h2>75 <h2><?php _e('Importing...') ?></h2> 76 76 <?php 77 $cat_id = $_POST['cat_id'];78 if (($cat_id == '') || ($cat_id == 0)) {79 $cat_id = 1;80 }77 $cat_id = $_POST['cat_id']; 78 if (($cat_id == '') || ($cat_id == 0)) { 79 $cat_id = 1; 80 } 81 81 82 $opml_url = $_POST['opml_url'];83 if (isset($opml_url) && $opml_url != '' && $opml_url != 'http://') {84 $blogrolling = true;85 }86 else // try to get the upload file.87 {88 $overrides = array('test_form' => false, 'test_type' => false);89 $file = wp_handle_upload($_FILES['userfile'], $overrides);82 $opml_url = $_POST['opml_url']; 83 if (isset($opml_url) && $opml_url != '' && $opml_url != 'http://') { 84 $blogrolling = true; 85 } 86 else // try to get the upload file. 87 { 88 $overrides = array('test_form' => false, 'test_type' => false); 89 $file = wp_handle_upload($_FILES['userfile'], $overrides); 90 90 91 if ( isset($file['error']) )92 die($file['error']);91 if ( isset($file['error']) ) 92 die($file['error']); 93 93 94 $url = $file['url'];95 $opml_url = $file['file'];96 $blogrolling = false;97 }94 $url = $file['url']; 95 $opml_url = $file['file']; 96 $blogrolling = false; 97 } 98 98 99 if (isset($opml_url) && $opml_url != '') {100 $opml = wp_remote_fopen($opml_url);101 include_once('link-parse-opml.php');99 if (isset($opml_url) && $opml_url != '') { 100 $opml = wp_remote_fopen($opml_url); 101 include_once('link-parse-opml.php'); 102 102 103 $link_count = count($names);104 for ($i = 0; $i < $link_count; $i++) {105 if ('Last' == substr($titles[$i], 0, 4))106 $titles[$i] = '';107 if ('http' == substr($titles[$i], 0, 4))108 $titles[$i] = '';109 $link = array( 'link_url' => $urls[$i], 'link_name' => $wpdb->escape($names[$i]), 'link_category' => array($cat_id), 'link_description' => $wpdb->escape($descriptions[$i]), 'link_owner' => $user_ID, 'link_rss' => $feeds[$i]); 110 wp_insert_link($link);111 echo sprintf('<p>'.__('Inserted <strong>%s</strong>').'</p>', $names[$i]);112 }103 $link_count = count($names); 104 for ($i = 0; $i < $link_count; $i++) { 105 if ('Last' == substr($titles[$i], 0, 4)) 106 $titles[$i] = ''; 107 if ('http' == substr($titles[$i], 0, 4)) 108 $titles[$i] = ''; 109 $link = array( 'link_url' => $urls[$i], 'link_name' => $wpdb->escape($names[$i]), 'link_category' => array($cat_id), 'link_description' => $wpdb->escape($descriptions[$i]), 'link_owner' => $user_ID, 'link_rss' => $feeds[$i]); 110 wp_insert_link($link); 111 echo sprintf('<p>'.__('Inserted <strong>%s</strong>').'</p>', $names[$i]); 112 } 113 113 ?> 114 <p><?php printf(__('Inserted %1$d bookmarks into category %2$s. All done! Go <a href="%3$s">manage those bookmarks</a>.'), $link_count, $cat_id, 'link-manager.php') ?></p>114 <p><?php printf(__('Inserted %1$d bookmarks into category %2$s. All done! Go <a href="%3$s">manage those bookmarks</a>.'), $link_count, $cat_id, 'link-manager.php') ?></p> 115 115 <?php 116 } // end if got url117 else118 {119 echo "<p>" . __("You need to supply your OPML url. Press back on your browser and try again") . "</p>\n";120 } // end else116 } // end if got url 117 else 118 { 119 echo "<p>" . __("You need to supply your OPML url. Press back on your browser and try again") . "</p>\n"; 120 } // end else 121 121 122 122 if ( ! $blogrolling ) 123 123 @unlink($opml_url); 124 124 ?> 125 125 </div> 126 126 <?php 127 break;128 } // end case 1127 break; 128 } // end case 1 129 129 } // end switch 130 130 131 131 include('admin-footer.php'); -
wp-admin/link-manager.php
76 76 <h2><?php _e('Bookmark Management'); ?></h2> 77 77 <p><?php _e('Here you add links to sites that you visit often and share them on your blog. When you have a list of links in your sidebar to other blogs, it’s called a “blogroll.”'); ?></p> 78 78 <form id="cats" method="get" action=""> 79 <p>Currently showing 79 <p>Currently showing 80 80 <?php $categories = get_categories("hide_empty=1&type=link"); ?> 81 81 <select name="cat_id"> 82 82 <option value="all" <?php echo ($cat_id == 'all') ? " selected='selected'" : ''; ?>><?php _e('All') ?></option> … … 85 85 </option> 86 86 <?php endforeach; ?> 87 87 </select> 88 bookmarks ordered by 88 bookmarks ordered by 89 89 <select name="order_by"> 90 90 <option value="order_id" <?php if ($order_by == 'order_id') echo " selected='selected'";?>><?php _e('Bookmark ID') ?></option> 91 91 <option value="order_name" <?php if ($order_by == 'order_name') echo " selected='selected'";?>><?php _e('Name') ?></option> … … 142 142 echo $link->link_description . "</td>"; 143 143 echo "<td><a href=\"$link->link_url\" title=\"".sprintf(__('Visit %s'), $link->link_name)."\">$short_url</a></td>"; 144 144 ?> 145 <td>146 <?php145 <td> 146 <?php 147 147 148 148 $cat_names = array(); 149 149 foreach ($link->link_category as $category) { … … 156 156 echo implode(', ', $cat_names); 157 157 ?> 158 158 </td> 159 <td><?php echo $link->link_rel; ?></td>160 <td align='center'><?php echo $visible; ?></td>159 <td><?php echo $link->link_rel; ?></td> 160 <td align='center'><?php echo $visible; ?></td> 161 161 <?php 162 162 163 163 echo '<td><a href="link.php?link_id='.$link->link_id.'&action=edit" class="edit">'.__('Edit').'</a></td>'; -
wp-admin/link-parse-opml.php
4 4 // columns we wish to find are: link_url, link_name, link_target, link_description 5 5 // we need to map XML attribute names to our columns 6 6 $opml_map = array('URL' => 'link_url', 7 'HTMLURL' => 'link_url',8 'TEXT' => 'link_name',9 'TITLE' => 'link_name',10 'TARGET' => 'link_target',11 'DESCRIPTION' => 'link_description',12 'XMLURL' => 'link_rss'7 'HTMLURL' => 'link_url', 8 'TEXT' => 'link_name', 9 'TITLE' => 'link_name', 10 'TARGET' => 'link_target', 11 'DESCRIPTION' => 'link_description', 12 'XMLURL' => 'link_rss' 13 13 ); 14 14 15 15 $map = $opml_map; … … 20 20 **/ 21 21 function startElement($parser, $tagName, $attrs) { 22 22 global $updated_timestamp, $all_links, $map; 23 global $names, $urls, $targets, $descriptions, $feeds;23 global $names, $urls, $targets, $descriptions, $feeds; 24 24 25 25 if ($tagName == 'OUTLINE') { 26 foreach (array_keys($map) as $key) {27 if (isset($attrs[$key])) {28 $$map[$key] = $attrs[$key];29 }30 }26 foreach (array_keys($map) as $key) { 27 if (isset($attrs[$key])) { 28 $$map[$key] = $attrs[$key]; 29 } 30 } 31 31 32 //echo("got data: link_url = [$link_url], link_name = [$link_name], link_target = [$link_target], link_description = [$link_description]<br />\n");32 //echo("got data: link_url = [$link_url], link_name = [$link_name], link_target = [$link_target], link_description = [$link_description]<br />\n"); 33 33 34 // save the data away.35 $names[] = $link_name;36 $urls[] = $link_url;37 $targets[] = $link_target;34 // save the data away. 35 $names[] = $link_name; 36 $urls[] = $link_url; 37 $targets[] = $link_target; 38 38 $feeds[] = $link_rss; 39 $descriptions[] = $link_description;40 } // end if outline39 $descriptions[] = $link_description; 40 } // end if outline 41 41 } 42 42 43 43 /** … … 55 55 xml_set_element_handler($xml_parser, "startElement", "endElement"); 56 56 57 57 if (!xml_parse($xml_parser, $opml, true)) { 58 echo(sprintf(__('XML error: %1$s at line %2$s'),59 xml_error_string(xml_get_error_code($xml_parser)),60 xml_get_current_line_number($xml_parser)));58 echo(sprintf(__('XML error: %1$s at line %2$s'), 59 xml_error_string(xml_get_error_code($xml_parser)), 60 xml_get_current_line_number($xml_parser))); 61 61 } 62 62 63 63 // Free up memory used by the XML parser -
wp-admin/link.php
29 29 $deleted = 0; 30 30 foreach ($linkcheck as $link_id) { 31 31 $link_id = (int) $link_id; 32 32 33 33 if ( wp_delete_link($link_id) ) 34 34 $deleted++; 35 35 } -
wp-admin/list-manipulation-js.php
130 130 }else if(inputs[a][i].tagName.match(/select/i)){ 131 131 this.inputData+='&'+inputs[a][i].name+'='+encodeURIComponent(inputs[a][i].options[inputs[a][i].selectedIndex].value);this.clearInputs.push(inputs[a][i].id); 132 132 } 133 } 133 } 134 134 } 135 135 } 136 136 this.getListPos=function(id,n){for(var i=0;i<listItems.length;i++){if(id==listItems[i]){var pos=i;break;}}if(!n){if(pos<this.recolorPos)this.recolorPos=pos;}return pos;} -
wp-admin/menu-header.php
10 10 11 11 // 0 = name, 1 = capability, 2 = file 12 12 if (( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file))) $class = ' class="current"'; 13 13 14 14 if ( !empty($submenu[$item[2]]) || current_user_can($item[1]) ) { 15 15 if ( file_exists(ABSPATH . "wp-content/plugins/{$item[2]}") ) 16 16 echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/admin.php?page={$item[2]}'$class>{$item[0]}</a></li>"; … … 27 27 if ( isset($submenu["$parent_file"]) ) : 28 28 ?> 29 29 <ul id="submenu"> 30 <?php 31 foreach ($submenu["$parent_file"] as $item) : 30 <?php 31 foreach ($submenu["$parent_file"] as $item) : 32 32 if ( !current_user_can($item[1]) ) 33 33 continue; 34 34 … … 41 41 $menu_hook = get_plugin_page_hook($item[2], $parent_file); 42 42 43 43 if (file_exists(ABSPATH . "wp-content/plugins/{$item[2]}") || ! empty($menu_hook)) { 44 if ( 'admin.php' == $pagenow )44 if ( 'admin.php' == $pagenow ) 45 45 echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/admin.php?page={$item[2]}'$class>{$item[0]}</a></li>"; 46 46 else 47 47 echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/{$parent_file}?page={$item[2]}'$class>{$item[0]}</a></li>"; … … 54 54 </ul> 55 55 <?php 56 56 57 endif; 57 endif; 58 58 59 59 do_action('admin_notices'); 60 60 -
wp-admin/menu.php
78 78 unset($submenu[$parent][$index]); 79 79 } 80 80 } 81 81 82 82 if ( empty($submenu[$parent]) ) 83 83 unset($submenu[$parent]); 84 84 } … … 86 86 // Loop over the top-level menu. 87 87 // Remove menus that have no accessible submenus and require privs that the user does not have. 88 88 // Menus for which the original parent is not acessible due to lack of privs will have the next 89 // submenu in line be assigned as the new menu parent. 89 // submenu in line be assigned as the new menu parent. 90 90 foreach ( $menu as $id => $data ) { 91 91 // If submenu is empty... 92 92 if ( empty($submenu[$data[2]]) ) { … … 105 105 if ( $new_parent != $old_parent ) { 106 106 $real_parent_file[$old_parent] = $new_parent; 107 107 $menu[$id][2] = $new_parent; 108 108 109 109 foreach ($submenu[$old_parent] as $index => $data) { 110 110 $submenu[$new_parent][$index] = $submenu[$old_parent][$index]; 111 111 unset($submenu[$old_parent][$index]); 112 112 } 113 unset($submenu[$old_parent]); 113 unset($submenu[$old_parent]); 114 114 } 115 115 } 116 116 } -
wp-admin/moderation.php
31 31 foreach($comment as $key => $value) { 32 32 if ($feelinglucky && 'later' == $value) 33 33 $value = 'delete'; 34 switch($value) {34 switch($value) { 35 35 case 'later': 36 36 // do nothing with that comment 37 37 // wp_set_comment_status($key, "hold"); … … 41 41 wp_set_comment_status($key, 'delete'); 42 42 ++$item_deleted; 43 43 break; 44 case 'spam':45 wp_set_comment_status($key, 'spam');46 ++$item_spam;47 break;44 case 'spam': 45 wp_set_comment_status($key, 'spam'); 46 ++$item_spam; 47 break; 48 48 case 'approve': 49 49 wp_set_comment_status($key, 'approve'); 50 50 if ( get_settings('comments_notify') == true ) { … … 52 52 } 53 53 ++$item_approved; 54 54 break; 55 }55 } 56 56 } 57 57 58 58 $file = basename(__FILE__); … … 85 85 echo sprintf(__("%s comments deleted"), $deleted) . " <br/>\n"; 86 86 } 87 87 } 88 if ($spam) {89 if ('1' == $spam) {88 if ($spam) { 89 if ('1' == $spam) { 90 90 echo __("1 comment marked as spam") . " <br/>\n"; 91 } else {92 echo sprintf(__("%s comments marked as spam"), $spam) . " <br/>\n";93 }94 }91 } else { 92 echo sprintf(__("%s comments marked as spam"), $spam) . " <br/>\n"; 93 } 94 } 95 95 if ($ignored) { 96 96 if ('1' == $ignored) { 97 97 echo __("1 comment unchanged") . " <br/>\n"; … … 113 113 $comments = ''; 114 114 115 115 if ($comments) { 116 // list all comments that are waiting for approval117 $file = basename(__FILE__);116 // list all comments that are waiting for approval 117 $file = basename(__FILE__); 118 118 ?> 119 <h2><?php _e('Moderation Queue') ?></h2>120 <form name="approval" action="moderation.php" method="post">121 <?php wp_nonce_field('moderate-comments') ?>122 <input type="hidden" name="action" value="update" />123 <ol id="the-comment-list" class="commentlist">119 <h2><?php _e('Moderation Queue') ?></h2> 120 <form name="approval" action="moderation.php" method="post"> 121 <?php wp_nonce_field('moderate-comments') ?> 122 <input type="hidden" name="action" value="update" /> 123 <ol id="the-comment-list" class="commentlist"> 124 124 <?php 125 125 $i = 0; 126 foreach($comments as $comment) {127 ++$i;128 $comment_date = mysql2date(get_settings("date_format") . " @ " . get_settings("time_format"), $comment->comment_date);129 $post_title = $wpdb->get_var("SELECT post_title FROM $wpdb->posts WHERE ID='$comment->comment_post_ID'");130 if ($i % 2) $class = 'js-unapproved alternate';131 else $class = 'js-unapproved';132 echo "\n\t<li id='comment-$comment->comment_ID' class='$class'>";126 foreach($comments as $comment) { 127 ++$i; 128 $comment_date = mysql2date(get_settings("date_format") . " @ " . get_settings("time_format"), $comment->comment_date); 129 $post_title = $wpdb->get_var("SELECT post_title FROM $wpdb->posts WHERE ID='$comment->comment_post_ID'"); 130 if ($i % 2) $class = 'js-unapproved alternate'; 131 else $class = 'js-unapproved'; 132 echo "\n\t<li id='comment-$comment->comment_ID' class='$class'>"; 133 133 ?> 134 134 <p><strong><?php comment_author() ?></strong> <?php if ($comment->comment_author_email) { ?>| <?php comment_author_email_link() ?> <?php } if ($comment->comment_author_url && 'http://' != $comment->comment_author_url) { ?> | <?php comment_author_url_link() ?> <?php } ?>| <?php _e('IP:') ?> <a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP() ?>"><?php comment_author_IP() ?></a></p> 135 135 <?php comment_text() ?> … … 151 151 152 152 </li> 153 153 <?php 154 }154 } 155 155 ?> 156 </ol>156 </ol> 157 157 158 158 <div id="ajax-response"></div> 159 159 160 <p class="submit"><input type="submit" name="submit" value="<?php _e('Bulk Moderate Comments »') ?>" /></p>160 <p class="submit"><input type="submit" name="submit" value="<?php _e('Bulk Moderate Comments »') ?>" /></p> 161 161 <script type="text/javascript"> 162 162 // <![CDATA[ 163 163 function markAllForDelete() { … … 197 197 <input name="feelinglucky" type="checkbox" id="feelinglucky" value="true" /> <label for="feelinglucky"><?php _e('Delete every comment marked "defer." <strong>Warning: This can’t be undone.</strong>'); ?></label> 198 198 </p> 199 199 </noscript> 200 </form>200 </form> 201 201 <?php 202 202 } else { 203 // nothing to approve203 // nothing to approve 204 204 echo '<p>'.__("Currently there are no comments for you to moderate.") . "</p>\n"; 205 205 } 206 206 ?> -
wp-admin/options-discussion.php
18 18 } 19 19 ?> 20 20 21 <div class="wrap"> 22 <h2><?php _e('Discussion Options') ?></h2> 23 <form method="post" action="options.php"> 21 <div class="wrap"> 22 <h2><?php _e('Discussion Options') ?></h2> 23 <form method="post" action="options.php"> 24 24 <?php wp_nonce_field('update-options') ?> 25 25 <fieldset class="options"> 26 <legend><?php _e('Usual settings for an article:<br /><small><em>(These settings may be overridden for individual articles.)</em></small>') ?></legend> 27 <ul> 28 <li> 29 <label for="default_pingback_flag"> 30 <input name="default_pingback_flag" type="checkbox" id="default_pingback_flag" value="1" <?php checked('1', get_settings('default_pingback_flag')); ?> /> 31 <?php _e('Attempt to notify any Weblogs linked to from the article (slows down posting.)') ?></label> 32 </li> 33 <li> 34 <label for="default_ping_status"> 35 <input name="default_ping_status" type="checkbox" id="default_ping_status" value="open" <?php checked('open', get_settings('default_ping_status')); ?> /> 36 <?php _e('Allow link notifications from other Weblogs (pingbacks and trackbacks.)') ?></label> 37 </li> 38 <li> 39 <label for="default_comment_status"> 40 <input name="default_comment_status" type="checkbox" id="default_comment_status" value="open" <?php checked('open', get_settings('default_comment_status')); ?> /> 41 <?php _e('Allow people to post comments on the article') ?></label> 42 </li> 43 </ul> 26 <legend><?php _e('Usual settings for an article:<br /><small><em>(These settings may be overridden for individual articles.)</em></small>') ?></legend> 27 <ul> 28 <li> 29 <label for="default_pingback_flag"> 30 <input name="default_pingback_flag" type="checkbox" id="default_pingback_flag" value="1" <?php checked('1', get_settings('default_pingback_flag')); ?> /> 31 <?php _e('Attempt to notify any Weblogs linked to from the article (slows down posting.)') ?></label> 32 </li> 33 <li> 34 <label for="default_ping_status"> 35 <input name="default_ping_status" type="checkbox" id="default_ping_status" value="open" <?php checked('open', get_settings('default_ping_status')); ?> /> 36 <?php _e('Allow link notifications from other Weblogs (pingbacks and trackbacks.)') ?></label> 37 </li> 38 <li> 39 <label for="default_comment_status"> 40 <input name="default_comment_status" type="checkbox" id="default_comment_status" value="open" <?php checked('open', get_settings('default_comment_status')); ?> /> 41 <?php _e('Allow people to post comments on the article') ?></label> 42 </li> 43 </ul> 44 44 </fieldset> 45 45 <fieldset class="options"> 46 <legend><?php _e('E-mail me whenever:') ?></legend> 47 <ul> 48 <li> 49 <label for="comments_notify"> 50 <input name="comments_notify" type="checkbox" id="comments_notify" value="1" <?php checked('1', get_settings('comments_notify')); ?> /> 51 <?php _e('Anyone posts a comment') ?> </label> 52 </li> 53 <li> 54 <label for="moderation_notify"> 55 <input name="moderation_notify" type="checkbox" id="moderation_notify" value="1" <?php checked('1', get_settings('moderation_notify')); ?> /> 56 <?php _e('A comment is held for moderation') ?> </label> 57 </li> 58 </ul> 46 <legend><?php _e('E-mail me whenever:') ?></legend> 47 <ul> 48 <li> 49 <label for="comments_notify"> 50 <input name="comments_notify" type="checkbox" id="comments_notify" value="1" <?php checked('1', get_settings('comments_notify')); ?> /> 51 <?php _e('Anyone posts a comment') ?> </label> 52 </li> 53 <li> 54 <label for="moderation_notify"> 55 <input name="moderation_notify" type="checkbox" id="moderation_notify" value="1" <?php checked('1', get_settings('moderation_notify')); ?> /> 56 <?php _e('A comment is held for moderation') ?> </label> 57 </li> 58 </ul> 59 59 </fieldset> 60 60 <fieldset class="options"> 61 <legend><?php _e('Before a comment appears:') ?></legend> 61 <legend><?php _e('Before a comment appears:') ?></legend> 62 62 <ul> 63 63 <li> 64 <label for="comment_moderation"> 65 <input name="comment_moderation" type="checkbox" id="comment_moderation" value="1" <?php checked('1', get_settings('comment_moderation')); ?> /> 66 <?php _e('An administrator must approve the comment (regardless of any matches below)') ?> </label> 67 </li> 68 <li><label for="require_name_email"><input type="checkbox" name="require_name_email" id="require_name_email" value="1" <?php checked('1', get_settings('require_name_email')); ?> /> <?php _e('Comment author must fill out name and e-mail') ?></label></li> 69 <li><label for="comment_whitelist"><input type="checkbox" name="comment_whitelist" id="comment_whitelist" value="1" <?php checked('1', get_settings('comment_whitelist')); ?> /> <?php _e('Comment author must have a previously approved comment') ?></label></li> 70 </ul> 64 <label for="comment_moderation"> 65 <input name="comment_moderation" type="checkbox" id="comment_moderation" value="1" <?php checked('1', get_settings('comment_moderation')); ?> /> 66 <?php _e('An administrator must approve the comment (regardless of any matches below)') ?> </label> 67 </li> 68 <li><label for="require_name_email"><input type="checkbox" name="require_name_email" id="require_name_email" value="1" <?php checked('1', get_settings('require_name_email')); ?> /> <?php _e('Comment author must fill out name and e-mail') ?></label></li> 69 <li><label for="comment_whitelist"><input type="checkbox" name="comment_whitelist" id="comment_whitelist" value="1" <?php checked('1', get_settings('comment_whitelist')); ?> /> <?php _e('Comment author must have a previously approved comment') ?></label></li> 70 </ul> 71 71 </fieldset> 72 72 <fieldset class="options"> 73 73 <legend><?php _e('Comment Moderation') ?></legend> 74 74 <p><?php printf(__('Hold a comment in the queue if it contains more than %s links. (A common characteristic of comment spam is a large number of hyperlinks.)'), '<input name="comment_max_links" type="text" id="comment_max_links" size="3" value="' . get_settings('comment_max_links'). '" />' ) ?></p> 75 75 76 76 <p><?php _e('When a comment contains any of these words in its content, name, URI, e-mail, or IP, hold it in the moderation queue: (Separate multiple words with new lines.) <a href="http://codex.wordpress.org/Spam_Words">Common spam words</a>.') ?></p> 77 <p>78 <textarea name="moderation_keys" cols="60" rows="4" id="moderation_keys" style="width: 98%; font-size: 12px;" class="code"><?php form_option('moderation_keys'); ?></textarea>79 </p>80 77 <p> 78 <textarea name="moderation_keys" cols="60" rows="4" id="moderation_keys" style="width: 98%; font-size: 12px;" class="code"><?php form_option('moderation_keys'); ?></textarea> 79 </p> 80 <p> 81 81 <a id="retrospambutton" href="options-discussion.php?action=retrospam"><?php _e('Check past comments against moderation list'); ?></a> 82 </p> 82 </p> 83 83 </fieldset> 84 84 <fieldset class="options"> 85 85 <legend><?php _e('Comment Blacklist') ?></legend> 86 86 <p><?php _e('This is a list of words that you want completely blacklisted from your blog. Be very careful what you add here, because if a comment matches something here it will be completely nuked and there will be no notification. Remember that partial words can match, so if there is any chance something here might match it would be better to put it in the moderation box above.') ?></p> 87 <p> 88 <textarea name="blacklist_keys" cols="60" rows="4" id="blacklist_keys" style="width: 98%; font-size: 12px;" class="code"><?php form_option('blacklist_keys'); ?></textarea> 87 <p> 88 <textarea name="blacklist_keys" cols="60" rows="4" id="blacklist_keys" style="width: 98%; font-size: 12px;" class="code"><?php form_option('blacklist_keys'); ?></textarea> 89 89 </p> 90 <p><label for="open_proxy_check"> 91 <input name="open_proxy_check" type="checkbox" id="open_proxy_check" value="1" <?php checked('1', get_settings('open_proxy_check')); ?> /> 90 <p><label for="open_proxy_check"> 91 <input name="open_proxy_check" type="checkbox" id="open_proxy_check" value="1" <?php checked('1', get_settings('open_proxy_check')); ?> /> 92 92 <?php _e('Blacklist comments from open and insecure proxies.') ?></label></p> 93 93 </fieldset> 94 94 <p class="submit"> 95 <input type="hidden" name="action" value="update" /> 96 <input type="hidden" name="page_options" value="default_pingback_flag,default_ping_status,default_comment_status,comments_notify,moderation_notify,comment_moderation,require_name_email,comment_whitelist,comment_max_links,moderation_keys,blacklist_keys,open_proxy_check" /> 97 <input type="submit" name="Submit" value="<?php _e('Update Options') ?>" /> 98 </p> 99 </form> 95 <input type="hidden" name="action" value="update" /> 96 <input type="hidden" name="page_options" value="default_pingback_flag,default_ping_status,default_comment_status,comments_notify,moderation_notify,comment_moderation,require_name_email,comment_whitelist,comment_max_links,moderation_keys,blacklist_keys,open_proxy_check" /> 97 <input type="submit" name="Submit" value="<?php _e('Update Options') ?>" /> 98 </p> 99 </form> 100 100 </div> 101 101 <?php include('./admin-footer.php'); ?> -
wp-admin/options-general.php
6 6 7 7 include('./admin-header.php'); 8 8 ?> 9 9 10 10 <div class="wrap"> 11 11 <h2><?php _e('General Options') ?></h2> 12 <form method="post" action="options.php"> 12 <form method="post" action="options.php"> 13 13 <?php wp_nonce_field('update-options') ?> 14 <table class="optiontable"> 15 <tr valign="top"> 16 <th scope="row"><?php _e('Weblog title:') ?></th> 17 <td><input name="blogname" type="text" id="blogname" value="<?php form_option('blogname'); ?>" size="40" /></td> 18 </tr> 19 <tr valign="top"> 20 <th scope="row"><?php _e('Tagline:') ?></th> 14 <table class="optiontable"> 15 <tr valign="top"> 16 <th scope="row"><?php _e('Weblog title:') ?></th> 17 <td><input name="blogname" type="text" id="blogname" value="<?php form_option('blogname'); ?>" size="40" /></td> 18 </tr> 19 <tr valign="top"> 20 <th scope="row"><?php _e('Tagline:') ?></th> 21 21 <td><input name="blogdescription" type="text" id="blogdescription" style="width: 95%" value="<?php form_option('blogdescription'); ?>" size="45" /> 22 22 <br /> 23 <?php _e('In a few words, explain what this weblog is about.') ?></td> 24 </tr> 25 <tr valign="top"> 26 <th scope="row"><?php _e('WordPress address (URI):') ?></th> 27 <td><input name="siteurl" type="text" id="siteurl" value="<?php form_option('siteurl'); ?>" size="40" class="code" /></td> 28 </tr> 23 <?php _e('In a few words, explain what this weblog is about.') ?></td> 24 </tr> 29 25 <tr valign="top"> 26 <th scope="row"><?php _e('WordPress address (URI):') ?></th> 27 <td><input name="siteurl" type="text" id="siteurl" value="<?php form_option('siteurl'); ?>" size="40" class="code" /></td> 28 </tr> 29 <tr valign="top"> 30 30 <th scope="row"><?php _e('Blog address (URI):') ?></th> 31 31 <td><input name="home" type="text" id="home" value="<?php form_option('home'); ?>" size="40" class="code" /><br /><?php _e('If you want your blog homepage <a href="http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory">to be different than the directory</a> you installed WordPress in, enter that address here.'); ?></td> 32 32 </tr> 33 <tr valign="top"> 34 <th scope="row"><?php _e('E-mail address:') ?> </th> 33 <tr valign="top"> 34 <th scope="row"><?php _e('E-mail address:') ?> </th> 35 35 <td><input name="admin_email" type="text" id="admin_email" value="<?php form_option('admin_email'); ?>" size="40" class="code" /> 36 36 <br /> 37 <?php _e('This address is used only for admin purposes.') ?></td> 37 <?php _e('This address is used only for admin purposes.') ?></td> 38 38 </tr> 39 <tr valign="top"> 40 <th scope="row"><?php _e('Membership:') ?></th> 41 <td> <label for="users_can_register"> 42 <input name="users_can_register" type="checkbox" id="users_can_register" value="1" <?php checked('1', get_settings('users_can_register')); ?> /> 39 <tr valign="top"> 40 <th scope="row"><?php _e('Membership:') ?></th> 41 <td> <label for="users_can_register"> 42 <input name="users_can_register" type="checkbox" id="users_can_register" value="1" <?php checked('1', get_settings('users_can_register')); ?> /> 43 43 <?php _e('Anyone can register') ?></label><br /> 44 44 <label for="comment_registration"> 45 <input name="comment_registration" type="checkbox" id="comment_registration" value="1" <?php checked('1', get_settings('comment_registration')); ?> /> 45 <input name="comment_registration" type="checkbox" id="comment_registration" value="1" <?php checked('1', get_settings('comment_registration')); ?> /> 46 46 <?php _e('Users must be registered and logged in to comment') ?> 47 47 </label> 48 </td> 49 </tr> 50 <tr valign="top"> 51 <th scope="row"><?php _e('New User Default Role:') ?></th> 52 <td><label for="default_role"> 48 </td> 49 </tr> 50 <tr valign="top"> 51 <th scope="row"><?php _e('New User Default Role:') ?></th> 52 <td><label for="default_role"> 53 53 <select name="default_role" id="default_role"><?php wp_dropdown_roles( get_settings('default_role') ); ?></select></label> 54 </td> 55 </tr> 56 </table> 57 <fieldset class="options"> 58 <legend><?php _e('Date and Time') ?></legend> 59 <table class="optiontable"> 60 <tr> 61 <th scope="row"><?php _e('<abbr title="Coordinated Universal Time">UTC</abbr> time is:') ?> </th> 62 <td><code><?php echo gmdate('Y-m-d g:i:s a'); ?></code></td> 54 </td> 63 55 </tr> 56 </table> 57 <fieldset class="options"> 58 <legend><?php _e('Date and Time') ?></legend> 59 <table class="optiontable"> 64 60 <tr> 61 <th scope="row"><?php _e('<abbr title="Coordinated Universal Time">UTC</abbr> time is:') ?> </th> 62 <td><code><?php echo gmdate('Y-m-d g:i:s a'); ?></code></td> 63 </tr> 64 <tr> 65 65 <th scope="row"><?php _e('Times in the weblog should differ by:') ?> </th> 66 <td><input name="gmt_offset" type="text" id="gmt_offset" size="2" value="<?php form_option('gmt_offset'); ?>" /> 66 <td><input name="gmt_offset" type="text" id="gmt_offset" size="2" value="<?php form_option('gmt_offset'); ?>" /> 67 67 <?php _e('hours') ?> </td> 68 68 </tr> 69 69 <tr> … … 75 75 <th scope="row"><?php _e('Default time format:') ?></th> 76 76 <td><input name="time_format" type="text" id="time_format" size="30" value="<?php form_option('time_format'); ?>" /><br /> 77 77 <?php _e('Output:') ?> <strong><?php echo gmdate(get_settings('time_format'), current_time('timestamp')); ?></strong></td> 78 </tr> 78 </tr> 79 79 <tr> 80 80 <th scope="row"> </th> 81 81 <td><?php _e('<a href="http://codex.wordpress.org/Formatting_Date_and_Time">Documentation on date formatting</a>. Save option to update sample output.') ?> </td> … … 92 92 </select></td> 93 93 </tr> 94 94 </table> 95 </fieldset> 95 </fieldset> 96 96 97 97 <p class="submit"><input type="submit" name="Submit" value="<?php _e('Update Options »') ?>" /> 98 <input type="hidden" name="action" value="update" /> 99 <input type="hidden" name="page_options" value="blogname,blogdescription,siteurl,admin_email,users_can_register,gmt_offset,date_format,time_format,home,start_of_week,comment_registration,default_role,blog_public" /> 98 <input type="hidden" name="action" value="update" /> 99 <input type="hidden" name="page_options" value="blogname,blogdescription,siteurl,admin_email,users_can_register,gmt_offset,date_format,time_format,home,start_of_week,comment_registration,default_role,blog_public" /> 100 100 </p> 101 101 </form> 102 102 103 </div> 103 </div> 104 104 105 105 <?php include('./admin-footer.php') ?> -
wp-admin/options-misc.php
7 7 include('admin-header.php'); 8 8 9 9 ?> 10 11 <div class="wrap"> 12 <h2><?php _e('Miscellaneous Options') ?></h2> 10 11 <div class="wrap"> 12 <h2><?php _e('Miscellaneous Options') ?></h2> 13 13 <form method="post" action="options.php"> 14 14 <?php wp_nonce_field('update-options') ?> 15 15 <fieldset class="options"> … … 42 42 43 43 <p class="submit"> 44 44 <input type="hidden" name="action" value="update" /> 45 <input type="hidden" name="page_options" value="hack_file,use_linksupdate,uploads_use_yearmonth_folders,upload_path" /> 45 <input type="hidden" name="page_options" value="hack_file,use_linksupdate,uploads_use_yearmonth_folders,upload_path" /> 46 46 <input type="submit" name="Submit" value="<?php _e('Update Options »') ?>" /> 47 47 </p> 48 </form> 48 </form> 49 49 </div> 50 50 51 51 <?php include('./admin-footer.php'); ?> 52 No newline at end of file -
wp-admin/options-permalink.php
96 96 if ($writable) 97 97 _e('Permalink structure updated.'); 98 98 else 99 _e('You should update your .htaccess now.'); 99 _e('You should update your .htaccess now.'); 100 100 ?></p></div> 101 101 <?php endif; ?> 102 102 103 <div class="wrap"> 104 <h2><?php _e('Customize Permalink Structure') ?></h2> 105 <p><?php _e('By default WordPress uses web URIs which have question marks and lots of numbers in them, however WordPress offers you the ability to create a custom URI structure for your permalinks and archives. This can improve the aesthetics, usability, and forward-compatibility of your links. A <a href="http://codex.wordpress.org/Using_Permalinks">number of tags are available</a>, and here are some examples to get you started.'); ?></p>103 <div class="wrap"> 104 <h2><?php _e('Customize Permalink Structure') ?></h2> 105 <p><?php _e('By default WordPress uses web URIs which have question marks and lots of numbers in them, however WordPress offers you the ability to create a custom URI structure for your permalinks and archives. This can improve the aesthetics, usability, and forward-compatibility of your links. A <a href="http://codex.wordpress.org/Using_Permalinks">number of tags are available</a>, and here are some examples to get you started.'); ?></p> 106 106 107 107 <?php 108 108 $prefix = ''; … … 116 116 $prefix . '/archives/%post_id%' 117 117 ); 118 118 ?> 119 <form name="form" action="options-permalink.php" method="post"> 119 <form name="form" action="options-permalink.php" method="post"> 120 120 <?php wp_nonce_field('update-permalink') ?> 121 121 <h3><?php _e('Common options:'); ?></h3> 122 122 <p> 123 123 <label> 124 <input name="selection" type="radio" value="" class="tog" <?php checked('', $permalink_structure); ?> /> 125 <?php _e('Default'); ?><br /> <span> » <code><?php echo get_settings('home'); ?>/?p=123</code></span>126 </label>124 <input name="selection" type="radio" value="" class="tog" <?php checked('', $permalink_structure); ?> /> 125 <?php _e('Default'); ?><br /> <span> » <code><?php echo get_settings('home'); ?>/?p=123</code></span> 126 </label> 127 127 </p> 128 128 <p> 129 129 <label> 130 <input name="selection" type="radio" value="<?php echo $structures[1]; ?>" class="tog" <?php checked($structures[1], $permalink_structure); ?> /> 131 <?php _e('Date and name based'); ?><br /> <span> » <code><?php echo get_settings('home') . $prefix . '/' . date('Y') . '/' . date('m') . '/' . date('d') . '/sample-post/'; ?></code></span>132 </label>130 <input name="selection" type="radio" value="<?php echo $structures[1]; ?>" class="tog" <?php checked($structures[1], $permalink_structure); ?> /> 131 <?php _e('Date and name based'); ?><br /> <span> » <code><?php echo get_settings('home') . $prefix . '/' . date('Y') . '/' . date('m') . '/' . date('d') . '/sample-post/'; ?></code></span> 132 </label> 133 133 </p> 134 134 <p> 135 135 <label> 136 <input name="selection" type="radio" value="<?php echo $structures[2]; ?>" class="tog" <?php checked($structures[2], $permalink_structure); ?> /> 137 <?php _e('Numeric'); ?><br /> <span> » <code><?php echo get_settings('home') . $prefix ; ?>/archives/123</code></span>138 </label>136 <input name="selection" type="radio" value="<?php echo $structures[2]; ?>" class="tog" <?php checked($structures[2], $permalink_structure); ?> /> 137 <?php _e('Numeric'); ?><br /> <span> » <code><?php echo get_settings('home') . $prefix ; ?>/archives/123</code></span> 138 </label> 139 139 </p> 140 140 <p> 141 141 <label> … … 143 143 <?php if ( !in_array($permalink_structure, $structures) ) { ?> 144 144 checked="checked" 145 145 <?php } ?> 146 /> 146 /> 147 147 <?php _e('Custom, specify below'); ?> 148 148 </label> 149 149 <br /> … … 156 156 <?php else : ?> 157 157 <p><?php _e('If you like, you may enter a custom prefix for your category URIs here. For example, <code>/index.php/taxonomy/tags</code> would make your category links like <code>http://example.org/index.php/taxonomy/tags/uncategorized/</code>. If you leave this blank the default will be used.') ?></p> 158 158 <?php endif; ?> 159 <p> 160 <?php _e('Category base'); ?>: <input name="category_base" type="text" class="code" value="<?php echo $category_base; ?>" size="30" /> 161 </p> 162 <p class="submit"> 163 <input type="submit" name="submit" value="<?php _e('Update Permalink Structure »') ?>" /> 164 </p> 165 </form> 159 <p> 160 <?php _e('Category base'); ?>: <input name="category_base" type="text" class="code" value="<?php echo $category_base; ?>" size="30" /> 161 </p> 162 <p class="submit"> 163 <input type="submit" name="submit" value="<?php _e('Update Permalink Structure »') ?>" /> 164 </p> 165 </form> 166 166 <?php if ( $permalink_structure && !$usingpi && !$writable ) : ?> 167 <p><?php _e('If your <code>.htaccess</code> file were <a href="http://codex.wordpress.org/Make_a_Directory_Writable">writable</a>, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your <code>.htaccess</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all.') ?></p>168 <form action="options-permalink.php" method="post">169 <?php wp_nonce_field('update-permalink') ?>170 <p>171 <textarea rows="5" style="width: 98%;" name="rules"><?php echo $wp_rewrite->mod_rewrite_rules(); ?>172 </textarea>173 </p>167 <p><?php _e('If your <code>.htaccess</code> file were <a href="http://codex.wordpress.org/Make_a_Directory_Writable">writable</a>, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your <code>.htaccess</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all.') ?></p> 168 <form action="options-permalink.php" method="post"> 169 <?php wp_nonce_field('update-permalink') ?> 170 <p> 171 <textarea rows="5" style="width: 98%;" name="rules"><?php echo $wp_rewrite->mod_rewrite_rules(); ?> 172 </textarea> 173 </p> 174 174 </form> 175 175 <?php endif; ?> 176 176 -
wp-admin/options-privacy.php
6 6 7 7 include('./admin-header.php'); 8 8 ?> 9 9 10 10 <div class="wrap"> 11 11 <h2><?php _e('Privacy Options') ?></h2> 12 <form method="post" action="options.php"> 12 <form method="post" action="options.php"> 13 13 <?php wp_nonce_field('update-options') ?> 14 <table class="optiontable"> 15 <tr valign="top"> 16 <th scope="row"><?php _e('Blog visibility:') ?> </th> 14 <table class="optiontable"> 15 <tr valign="top"> 16 <th scope="row"><?php _e('Blog visibility:') ?> </th> 17 17 <td> 18 18 <input id="blog-public" type="radio" name="blog_public" value="1" <?php checked('1', get_option('blog_public')); ?> /> 19 19 <label for="blog-public">I would like my blog to be visible to anyone who visits, including search engines and archivers</label> … … 21 21 <input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked('0', get_option('blog_public')); ?> /> 22 22 <label for="blog-norobots">I would like to block search engines, but allow normal folks</label> 23 23 <?php do_action('blog_privacy_selector'); ?> 24 </td> 24 </td> 25 25 </tr> 26 </table> 26 </table> 27 27 28 28 <p class="submit"><input type="submit" name="Submit" value="<?php _e('Update Options »') ?>" /> 29 <input type="hidden" name="action" value="update" /> 30 <input type="hidden" name="page_options" value="blog_public" /> 29 <input type="hidden" name="action" value="update" /> 30 <input type="hidden" name="page_options" value="blog_public" /> 31 31 </p> 32 32 </form> 33 33 34 </div> 34 </div> 35 35 36 36 <?php include('./admin-footer.php') ?> -
wp-admin/options-reading.php
7 7 include('admin-header.php'); 8 8 ?> 9 9 10 <div class="wrap"> 11 <h2><?php _e('Reading Options') ?></h2> 10 <div class="wrap"> 11 <h2><?php _e('Reading Options') ?></h2> 12 12 <form name="form1" method="post" action="options.php"> 13 13 <?php wp_nonce_field('update-options') ?> 14 14 15 15 <?php if ( get_pages() ): ?> 16 <fieldset class="options"> 17 <legend><?php _e('Front Page') ?></legend> 18 <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 19 <tr valign="top"> 20 <th width="33%" scope="row"><?php _e('Front page displays:')?></th> 16 <fieldset class="options"> 17 <legend><?php _e('Front Page') ?></legend> 18 <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 19 <tr valign="top"> 20 <th width="33%" scope="row"><?php _e('Front page displays:')?></th> 21 21 <td> 22 22 <label> 23 <input name="show_on_front" type="radio" value="posts" class="tog" <?php checked('posts', get_option('show_on_front')); ?> /> 23 <input name="show_on_front" type="radio" value="posts" class="tog" <?php checked('posts', get_option('show_on_front')); ?> /> 24 24 <?php _e('The latest posts'); ?> 25 25 </label> 26 26 <br /> 27 27 <label> 28 <input name="show_on_front" type="radio" value="page" class="tog" <?php checked('page', get_option('show_on_front')); ?> /> 28 <input name="show_on_front" type="radio" value="page" class="tog" <?php checked('page', get_option('show_on_front')); ?> /> 29 29 <?php printf(__('A static <a href="%s">page</a> (select below)'), 'edit-pages.php'); ?> 30 30 </label> 31 31 <ul> … … 40 40 </div> 41 41 <?php endif; ?> 42 42 </fieldset> 43 </td> 44 </tr> 45 </table> 43 </td> 44 </tr> 45 </table> 46 46 </fieldset> 47 47 <?php endif; ?> 48 48 49 <fieldset class="options"> 50 <legend><?php _e('Blog Pages') ?></legend> 51 <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 52 <tr valign="top"> 53 <th width="33%" scope="row"><?php _e('Show at most:') ?></th> 49 <fieldset class="options"> 50 <legend><?php _e('Blog Pages') ?></legend> 51 <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 52 <tr valign="top"> 53 <th width="33%" scope="row"><?php _e('Show at most:') ?></th> 54 54 <td> 55 <input name="posts_per_page" type="text" id="posts_per_page" value="<?php form_option('posts_per_page'); ?>" size="3" /> 56 <select name="what_to_show" id="what_to_show" > 57 <option value="days" <?php selected('days', get_settings('what_to_show')); ?>><?php _e('days') ?></option> 58 <option value="posts" <?php selected('posts', get_settings('what_to_show')); ?>><?php _e('posts') ?></option> 55 <input name="posts_per_page" type="text" id="posts_per_page" value="<?php form_option('posts_per_page'); ?>" size="3" /> 56 <select name="what_to_show" id="what_to_show" > 57 <option value="days" <?php selected('days', get_settings('what_to_show')); ?>><?php _e('days') ?></option> 58 <option value="posts" <?php selected('posts', get_settings('what_to_show')); ?>><?php _e('posts') ?></option> 59 59 </select> 60 </td> 61 </tr> 62 </table> 63 </fieldset> 60 </td> 61 </tr> 62 </table> 63 </fieldset> 64 64 65 <fieldset class="options"> 66 <legend><?php _e('Syndication Feeds') ?></legend> 67 <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 68 <tr valign="top"> 69 <th width="33%" scope="row"><?php _e('Show the most recent:') ?></th> 70 <td><input name="posts_per_rss" type="text" id="posts_per_rss" value="<?php form_option('posts_per_rss'); ?>" size="3" /> <?php _e('posts') ?></td> 65 <fieldset class="options"> 66 <legend><?php _e('Syndication Feeds') ?></legend> 67 <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 68 <tr valign="top"> 69 <th width="33%" scope="row"><?php _e('Show the most recent:') ?></th> 70 <td><input name="posts_per_rss" type="text" id="posts_per_rss" value="<?php form_option('posts_per_rss'); ?>" size="3" /> <?php _e('posts') ?></td> 71 71 </tr> 72 72 <tr valign="top"> 73 73 <th scope="row"><?php _e('For each article, show:') ?> </th> … … 75 75 <label><input name="rss_use_excerpt" type="radio" value="0" <?php checked(0, get_settings('rss_use_excerpt')); ?> /> <?php _e('Full text') ?></label><br /> 76 76 <label><input name="rss_use_excerpt" type="radio" value="1" <?php checked(1, get_settings('rss_use_excerpt')); ?> /> <?php _e('Summary') ?></label> 77 77 </td> 78 </tr> 79 </table> 80 </fieldset> 81 <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 82 <tr valign="top"> 83 <th width="33%" scope="row"><?php _e('Encoding for pages and feeds:') ?></th> 78 </tr> 79 </table> 80 </fieldset> 81 <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 82 <tr valign="top"> 83 <th width="33%" scope="row"><?php _e('Encoding for pages and feeds:') ?></th> 84 84 <td><input name="blog_charset" type="text" id="blog_charset" value="<?php form_option('blog_charset'); ?>" size="20" class="code" /><br /> 85 <?php _e('The character encoding you write your blog in (UTF-8 is <a href="http://developer.apple.com/documentation/macos8/TextIntlSvcs/TextEncodingConversionManager/TEC1.5/TEC.b0.html">recommended</a>)') ?></td> 85 <?php _e('The character encoding you write your blog in (UTF-8 is <a href="http://developer.apple.com/documentation/macos8/TextIntlSvcs/TextEncodingConversionManager/TEC1.5/TEC.b0.html">recommended</a>)') ?></td> 86 86 </tr> 87 </table> 87 </table> 88 88 <p> 89 <label><input type="checkbox" name="gzipcompression" value="1" <?php checked('1', get_settings('gzipcompression')); ?> /> 89 <label><input type="checkbox" name="gzipcompression" value="1" <?php checked('1', get_settings('gzipcompression')); ?> /> 90 90 <?php _e('WordPress should compress articles (gzip) if browsers ask for them') ?></label> 91 91 </p> 92 92 <p class="submit"> 93 <input type="hidden" name="action" value="update" /> 94 <input type="hidden" name="page_options" value="posts_per_page,what_to_show,posts_per_rss,rss_use_excerpt,blog_charset,gzipcompression,show_on_front,page_on_front,page_for_posts" /> 95 <input type="submit" name="Submit" value="<?php _e('Update Options »') ?>" /> 96 </p> 97 </form> 98 </div> 93 <input type="hidden" name="action" value="update" /> 94 <input type="hidden" name="page_options" value="posts_per_page,what_to_show,posts_per_rss,rss_use_excerpt,blog_charset,gzipcompression,show_on_front,page_on_front,page_for_posts" /> 95 <input type="submit" name="Submit" value="<?php _e('Update Options »') ?>" /> 96 </p> 97 </form> 98 </div> 99 99 <?php include('./admin-footer.php'); ?> 100 No newline at end of file -
wp-admin/options-writing.php
7 7 include('admin-header.php'); 8 8 ?> 9 9 10 <div class="wrap"> 11 <h2><?php _e('Writing Options') ?></h2> 12 <form method="post" action="options.php"> 10 <div class="wrap"> 11 <h2><?php _e('Writing Options') ?></h2> 12 <form method="post" action="options.php"> 13 13 <?php wp_nonce_field('update-options') ?> 14 <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 15 <tr valign="top"> 16 <th width="33%" scope="row"> <?php _e('Size of the post box:') ?></th> 17 <td><input name="default_post_edit_rows" type="text" id="default_post_edit_rows" value="<?php form_option('default_post_edit_rows'); ?>" size="2" style="width: 1.5em; " /> 18 <?php _e('lines') ?></td> 19 </tr> 14 <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 20 15 <tr valign="top"> 16 <th width="33%" scope="row"> <?php _e('Size of the post box:') ?></th> 17 <td><input name="default_post_edit_rows" type="text" id="default_post_edit_rows" value="<?php form_option('default_post_edit_rows'); ?>" size="2" style="width: 1.5em; " /> 18 <?php _e('lines') ?></td> 19 </tr> 20 <tr valign="top"> 21 21 <th scope="row"><?php _e('Formatting:') ?></th> 22 22 <td> 23 23 <label for="rich_editing"> … … 64 64 <tr valign="top"> 65 65 <th scope="row"><?php _e('Mail server:') ?></th> 66 66 <td><input name="mailserver_url" type="text" id="mailserver_url" value="<?php form_option('mailserver_url'); ?>" size="40" /> 67 <label for="mailserver_port"><?php _e('Port:') ?></label> 67 <label for="mailserver_port"><?php _e('Port:') ?></label> 68 68 <input name="mailserver_port" type="text" id="mailserver_port" value="<?php form_option('mailserver_port'); ?>" size="6" /> 69 69 </td> 70 70 </tr> … … 102 102 </fieldset> 103 103 104 104 <p class="submit"> 105 <input type="hidden" name="action" value="update" /> 106 <input type="hidden" name="page_options" value="default_post_edit_rows,use_smilies,rich_editing,ping_sites,mailserver_url,mailserver_port,mailserver_login,mailserver_pass,default_category,default_email_category,use_balanceTags,default_link_category" /> 107 <input type="submit" name="Submit" value="<?php _e('Update Options »') ?>" /> 105 <input type="hidden" name="action" value="update" /> 106 <input type="hidden" name="page_options" value="default_post_edit_rows,use_smilies,rich_editing,ping_sites,mailserver_url,mailserver_port,mailserver_login,mailserver_pass,default_category,default_email_category,use_balanceTags,default_link_category" /> 107 <input type="submit" name="Submit" value="<?php _e('Update Options »') ?>" /> 108 108 </p> 109 </form> 110 </div> 109 </form> 110 </div> 111 111 112 112 <?php include('./admin-footer.php') ?> 113 No newline at end of file -
wp-admin/options.php
48 48 } 49 49 } 50 50 } 51 51 52 52 if ($any_changed) { 53 53 // If siteurl or home changed, reset cookies. 54 54 if ( get_settings('siteurl') != $old_siteurl || get_settings('home') != $old_home ) { … … 61 61 } 62 62 63 63 //$message = sprintf(__('%d setting(s) saved... '), $any_changed); 64 }65 64 } 65 66 66 $referred = remove_query_arg('updated' , wp_get_referer()); 67 67 $goback = add_query_arg('updated', 'true', wp_get_referer()); 68 68 $goback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $goback); 69 69 wp_redirect($goback); 70 break;70 break; 71 71 72 72 default: 73 73 include('admin-header.php'); ?> 74 74 75 75 <div class="wrap"> 76 <h2><?php _e('All options'); ?></h2>77 <form name="form" action="options.php" method="post">78 <?php wp_nonce_field('update-options') ?>79 <input type="hidden" name="action" value="update" />80 <table width="98%">76 <h2><?php _e('All options'); ?></h2> 77 <form name="form" action="options.php" method="post"> 78 <?php wp_nonce_field('update-options') ?> 79 <input type="hidden" name="action" value="update" /> 80 <table width="98%"> 81 81 <?php 82 82 $options = $wpdb->get_results("SELECT * FROM $wpdb->options ORDER BY option_name"); 83 83 … … 91 91 </tr>"; 92 92 endforeach; 93 93 ?> 94 </table>94 </table> 95 95 <p class="submit"><input type="submit" name="Update" value="<?php _e('Update Settings »') ?>" /></p> 96 </form>96 </form> 97 97 </div> 98 98 99 99 -
wp-admin/page-new.php
20 20 } 21 21 ?> 22 22 23 <?php include('admin-footer.php'); ?> 24 No newline at end of file 23 <?php include('admin-footer.php'); ?> 24 No newline at end of file -
wp-admin/page.php
116 116 if ( ! wp_delete_attachment($page_id) ) 117 117 die( __('Error in deleting...') ); 118 118 } else { 119 if ( !wp_delete_post($page_id) ) 119 if ( !wp_delete_post($page_id) ) 120 120 die( __('Error in deleting...') ); 121 121 } 122 122 -
wp-admin/plugin-editor.php
60 60 <?php if (isset($_GET['a'])) : ?> 61 61 <div id="message" class="updated fade"><p><?php _e('File edited successfully.') ?></p></div> 62 62 <?php endif; ?> 63 <div class="wrap"> 64 <?php63 <div class="wrap"> 64 <?php 65 65 if (is_writeable($real_file)) { 66 66 echo '<h2>' . sprintf(__('Editing <strong>%s</strong>'), $file) . '</h2>'; 67 67 } else { … … 74 74 <?php 75 75 if ($plugin_files) : 76 76 ?> 77 <ul>78 <?php foreach($plugin_files as $plugin_file) : ?>77 <ul> 78 <?php foreach($plugin_files as $plugin_file) : ?> 79 79 <li><a href="plugin-editor.php?file=<?php echo "$plugin_file"; ?>"><?php echo $plugins[$plugin_file]['Name']; ?></a></li> 80 <?php endforeach; ?>81 </ul>80 <?php endforeach; ?> 81 </ul> 82 82 <?php endif; ?> 83 83 </div> 84 <?php if (!$error) { ?> 85 <form name="template" id="template" action="plugin-editor.php" method="post">86 <?php wp_nonce_field('edit-plugin_' . $file) ?>87 <div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1"><?php echo $content ?></textarea>88 <input type="hidden" name="action" value="update" /> 89 <input type="hidden" name="file" value="<?php echo $file ?>" /> 84 <?php if (!$error) { ?> 85 <form name="template" id="template" action="plugin-editor.php" method="post"> 86 <?php wp_nonce_field('edit-plugin_' . $file) ?> 87 <div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1"><?php echo $content ?></textarea> 88 <input type="hidden" name="action" value="update" /> 89 <input type="hidden" name="file" value="<?php echo $file ?>" /> 90 90 </div> 91 91 <?php if ( is_writeable($real_file) ) : ?> 92 <p class="submit">93 <?php94 echo "<input type='submit' name='submit' value=' " . __('Update File »') . "' tabindex='2' />";95 ?>96 </p>92 <p class="submit"> 93 <?php 94 echo "<input type='submit' name='submit' value=' " . __('Update File »') . "' tabindex='2' />"; 95 ?> 96 </p> 97 97 <?php else : ?> 98 <p><em><?php _e('If this file were writable you could edit it.'); ?></em></p>98 <p><em><?php _e('If this file were writable you could edit it.'); ?></em></p> 99 99 <?php endif; ?> 100 </form>101 <?php100 </form> 101 <?php 102 102 } else { 103 103 echo '<div class="error"><p>' . __('Oops, no such file exists! Double check the name and try again, merci.') . '</p></div>'; 104 104 } 105 ?>105 ?> 106 106 <div class="clear"> </div> 107 </div> 107 </div> 108 108 <?php 109 109 break; 110 110 } 111 111 112 include("admin-footer.php") ?> 112 include("admin-footer.php") ?> -
wp-admin/post-new.php
60 60 <?php 61 61 if ($is_NS4 || $is_gecko) { 62 62 ?> 63 <a href="javascript:if(navigator.userAgent.indexOf('Safari') >= 0){Q=getSelection();}else{Q=document.selection?document.selection.createRange().text:document.getSelection();}location.href='<?php echo get_settings('siteurl') ?>/wp-admin/post-new.php?text='+encodeURIComponent(Q)+'&popupurl='+encodeURIComponent(location.href)+'&popuptitle='+encodeURIComponent(document.title);"><?php printf(__('Press It - %s'), wp_specialchars(get_settings('blogname'))); ?></a> 63 <a href="javascript:if(navigator.userAgent.indexOf('Safari') >= 0){Q=getSelection();}else{Q=document.selection?document.selection.createRange().text:document.getSelection();}location.href='<?php echo get_settings('siteurl') ?>/wp-admin/post-new.php?text='+encodeURIComponent(Q)+'&popupurl='+encodeURIComponent(location.href)+'&popuptitle='+encodeURIComponent(document.title);"><?php printf(__('Press It - %s'), wp_specialchars(get_settings('blogname'))); ?></a> 64 64 <?php 65 65 } else if ($is_winIE) { 66 66 ?> … … 75 75 <br /> 76 76 <br /> 77 77 <?php _e('One-click bookmarklet:') ?><br /> 78 <a href="javascript:oneclickbookmarklet(0);"><?php _e('click here') ?></a> 78 <a href="javascript:oneclickbookmarklet(0);"><?php _e('click here') ?></a> 79 79 <?php 80 80 } else if ($is_opera) { 81 81 ?> 82 <a href="javascript:location.href='<?php echo get_settings('siteurl'); ?>/wp-admin/post-new.php?popupurl='+escape(location.href)+'&popuptitle='+escape(document.title);"><?php printf(__('Press it - %s'), get_settings('blogname')); ?></a> 82 <a href="javascript:location.href='<?php echo get_settings('siteurl'); ?>/wp-admin/post-new.php?popupurl='+escape(location.href)+'&popuptitle='+escape(document.title);"><?php printf(__('Press it - %s'), get_settings('blogname')); ?></a> 83 83 <?php 84 84 } else if ($is_macIE) { 85 85 ?> 86 <a href="javascript:Q='';location.href='<?php echo get_settings('siteurl'); ?>/wp-admin/bookmarklet.php?text='+escape(document.getSelection())+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title);"><?php printf(__('Press it - %s'), get_settings('blogname')); ?></a> 86 <a href="javascript:Q='';location.href='<?php echo get_settings('siteurl'); ?>/wp-admin/bookmarklet.php?text='+escape(document.getSelection())+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title);"><?php printf(__('Press it - %s'), get_settings('blogname')); ?></a> 87 87 <?php 88 88 } 89 89 ?> -
wp-admin/post.php
15 15 $parent_file = 'post-new.php'; 16 16 $submenu_file = 'post-new.php'; 17 17 check_admin_referer('add-post'); 18 18 19 19 $post_ID = 'post' == $action ? write_post() : edit_post(); 20 20 21 21 // Redirect. … … 86 86 case 'editpost': 87 87 $post_ID = (int) $_POST['post_ID']; 88 88 check_admin_referer('update-post_' . $post_ID); 89 89 90 90 $post_ID = edit_post(); 91 91 92 92 if ($_POST['save']) { … … 123 123 if ( ! wp_delete_attachment($post_id) ) 124 124 die( __('Error in deleting...') ); 125 125 } else { 126 if ( !wp_delete_post($post_id) ) 126 if ( !wp_delete_post($post_id) ) 127 127 die( __('Error in deleting...') ); 128 128 } 129 129 -
wp-admin/profile.php
1 <?php 1 <?php 2 2 require_once('admin.php'); 3 3 4 4 $title = __('Profile'); … … 117 117 118 118 <?php do_action('profile_personal_options'); ?> 119 119 120 <table width="99%" border="0" cellspacing="2" cellpadding="3" class="editform">121 <?php122 if(count($profileuser->caps) > count($profileuser->roles)):123 ?>124 <tr>125 <th scope="row"><?php _e('Additional Capabilities:') ?></th>126 <td><?php 120 <table width="99%" border="0" cellspacing="2" cellpadding="3" class="editform"> 121 <?php 122 if(count($profileuser->caps) > count($profileuser->roles)): 123 ?> 124 <tr> 125 <th scope="row"><?php _e('Additional Capabilities:') ?></th> 126 <td><?php 127 127 $output = ''; 128 128 foreach($profileuser->caps as $cap => $value) { 129 129 if(!$wp_roles->is_role($cap)) { … … 133 133 } 134 134 echo $output; 135 135 ?></td> 136 </tr>137 <?php138 endif;139 ?>140 </table>136 </tr> 137 <?php 138 endif; 139 ?> 140 </table> 141 141 <p class="submit"> 142 142 <input type="submit" value="<?php _e('Update Profile »') ?>" name="submit" /> 143 143 </p> -
wp-admin/setup-config.php
2 2 define('WP_INSTALLING', true); 3 3 4 4 if (!file_exists('../wp-config-sample.php')) 5 die('Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.');5 die('Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.'); 6 6 7 7 $configFile = file('../wp-config-sample.php'); 8 8 … … 82 82 83 83 switch($step) { 84 84 case 0: 85 ?> 85 ?> 86 86 87 <p>Welcome to WordPress. Before getting started, we need some information on the database. You will need to know the following items before proceeding.</p> 88 <ol> 89 <li>Database name</li> 90 <li>Database username</li> 91 <li>Database password</li>92 <li>Database host</li> 93 <li>Table prefix (if you want to run more than one WordPress in a single database) </li>94 </ol> 87 <p>Welcome to WordPress. Before getting started, we need some information on the database. You will need to know the following items before proceeding.</p> 88 <ol> 89 <li>Database name</li> 90 <li>Database username</li> 91 <li>Database password</li> 92 <li>Database host</li> 93 <li>Table prefix (if you want to run more than one WordPress in a single database) </li> 94 </ol> 95 95 <p><strong>If for any reason this automatic file creation doesn't work, don't worry. All this does is fill in the database information to a configuration file. You may also simply open <code>wp-config-sample.php</code> in a text editor, fill in your information, and save it as <code>wp-config.php</code>. </strong></p> 96 96 <p>In all likelihood, these items were supplied to you by your ISP. If you do not have this information, then you will need to contact them before you can continue. If you’re all ready, <a href="setup-config.php?step=1">let’s go</a>! </p> 97 97 <?php 98 98 break; 99 99 100 100 case 1: 101 ?> 102 </p> 101 ?> 102 </p> 103 103 <form method="post" action="setup-config.php?step=2"> 104 <p>Below you should enter your database connection details. If you're not sure about these, contact your host. </p>105 <table> 106 <tr> 107 <th scope="row">Database Name</th> 108 <td><input name="dbname" type="text" size="25" value="wordpress" /></td>109 <td>The name of the database you want to run WP in. </td> 110 </tr> 111 <tr> 112 <th scope="row">User Name</th> 113 <td><input name="uname" type="text" size="25" value="username" /></td>114 <td>Your MySQL username</td> 115 </tr> 116 <tr> 117 <th scope="row">Password</th> 118 <td><input name="pwd" type="text" size="25" value="password" /></td>119 <td>...and MySQL password.</td> 120 </tr> 121 <tr> 122 <th scope="row">Database Host</th> 123 <td><input name="dbhost" type="text" size="25" value="localhost" /></td>124 <td>99% chance you won't need to change this value.</td> 125 </tr>126 <tr>127 <th scope="row">Table Prefix</th>128 <td><input name="prefix" type="text" id="prefix" value="wp_" size="25" /></td>129 <td>If you want to run multiple WordPress installations in a single database, change this.</td>130 </tr> 131 </table>132 <h2 class="step">133 <input name="submit" type="submit" value="Submit" />134 </h2>135 </form> 104 <p>Below you should enter your database connection details. If you're not sure about these, contact your host. </p> 105 <table> 106 <tr> 107 <th scope="row">Database Name</th> 108 <td><input name="dbname" type="text" size="25" value="wordpress" /></td> 109 <td>The name of the database you want to run WP in. </td> 110 </tr> 111 <tr> 112 <th scope="row">User Name</th> 113 <td><input name="uname" type="text" size="25" value="username" /></td> 114 <td>Your MySQL username</td> 115 </tr> 116 <tr> 117 <th scope="row">Password</th> 118 <td><input name="pwd" type="text" size="25" value="password" /></td> 119 <td>...and MySQL password.</td> 120 </tr> 121 <tr> 122 <th scope="row">Database Host</th> 123 <td><input name="dbhost" type="text" size="25" value="localhost" /></td> 124 <td>99% chance you won't need to change this value.</td> 125 </tr> 126 <tr> 127 <th scope="row">Table Prefix</th> 128 <td><input name="prefix" type="text" id="prefix" value="wp_" size="25" /></td> 129 <td>If you want to run multiple WordPress installations in a single database, change this.</td> 130 </tr> 131 </table> 132 <h2 class="step"> 133 <input name="submit" type="submit" value="Submit" /> 134 </h2> 135 </form> 136 136 <?php 137 137 break; 138 138 139 139 case 2: 140 140 $dbname = trim($_POST['dbname']); 141 $uname = trim($_POST['uname']);142 $passwrd = trim($_POST['pwd']);143 $dbhost = trim($_POST['dbhost']);141 $uname = trim($_POST['uname']); 142 $passwrd = trim($_POST['pwd']); 143 $dbhost = trim($_POST['dbhost']); 144 144 $prefix = trim($_POST['prefix']); 145 145 if (empty($prefix)) $prefix = 'wp_'; 146 146 147 // Test the db connection.148 define('DB_NAME', $dbname);149 define('DB_USER', $uname);150 define('DB_PASSWORD', $passwrd);151 define('DB_HOST', $dbhost);147 // Test the db connection. 148 define('DB_NAME', $dbname); 149 define('DB_USER', $uname); 150 define('DB_PASSWORD', $passwrd); 151 define('DB_HOST', $dbhost); 152 152 153 // We'll fail here if the values are no good.154 require_once('../wp-includes/wp-db.php');153 // We'll fail here if the values are no good. 154 require_once('../wp-includes/wp-db.php'); 155 155 $handle = fopen('../wp-config.php', 'w'); 156 156 157 foreach ($configFile as $line_num => $line) {158 switch (substr($line,0,16)) {159 case "define('DB_NAME'":160 fwrite($handle, str_replace("wordpress", $dbname, $line));161 break;162 case "define('DB_USER'":163 fwrite($handle, str_replace("'username'", "'$uname'", $line));164 break;165 case "define('DB_PASSW":166 fwrite($handle, str_replace("'password'", "'$passwrd'", $line));167 break;168 case "define('DB_HOST'":169 fwrite($handle, str_replace("localhost", $dbhost, $line));170 break;157 foreach ($configFile as $line_num => $line) { 158 switch (substr($line,0,16)) { 159 case "define('DB_NAME'": 160 fwrite($handle, str_replace("wordpress", $dbname, $line)); 161 break; 162 case "define('DB_USER'": 163 fwrite($handle, str_replace("'username'", "'$uname'", $line)); 164 break; 165 case "define('DB_PASSW": 166 fwrite($handle, str_replace("'password'", "'$passwrd'", $line)); 167 break; 168 case "define('DB_HOST'": 169 fwrite($handle, str_replace("localhost", $dbhost, $line)); 170 break; 171 171 case '$table_prefix =': 172 172 fwrite($handle, str_replace('wp_', $prefix, $line)); 173 173 break; 174 default:175 fwrite($handle, $line);176 }177 }178 fclose($handle);174 default: 175 fwrite($handle, $line); 176 } 177 } 178 fclose($handle); 179 179 chmod('../wp-config.php', 0666); 180 ?> 181 <p>All right sparky! You've made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to <a href="install.php">run the install!</a></p> 180 ?> 181 <p>All right sparky! You've made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to <a href="install.php">run the install!</a></p> 182 182 <?php 183 183 break; 184 184 } -
wp-admin/sidebar.php
34 34 padding: 3px; 35 35 } 36 36 .sidebar-categories { 37 display: block;38 height: 6.6em;39 overflow: auto;40 background-color: #f4f4f4;37 display: block; 38 height: 6.6em; 39 overflow: auto; 40 background-color: #f4f4f4; 41 41 } 42 42 .sidebar-categories label { 43 43 font-size: 10px; 44 display: block;45 width: 90%;44 display: block; 45 width: 90%; 46 46 } 47 47 </style> 48 48 </head> … … 65 65 <textarea rows="8" cols="12" style="width: 100%" name="content" tabindex="2"></textarea> 66 66 </p> 67 67 <p> 68 <input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" value="Save as Draft" /> 68 <input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" value="Save as Draft" /> 69 69 <?php if ( current_user_can('publish_posts') ) : ?> 70 <input name="publish" type="submit" id="publish" tabindex="6" style="font-weight: bold;" value="Publish" /> 70 <input name="publish" type="submit" id="publish" tabindex="6" style="font-weight: bold;" value="Publish" /> 71 71 <?php endif; ?> 72 72 </p> 73 73 </div> -
wp-admin/templates.php
78 78 <div id="message" class="updated fade"><p><?php _e('File edited successfully.') ?></p></div> 79 79 <?php endif; ?> 80 80 <?php endif; ?> 81 <div class="wrap"> 81 <div class="wrap"> 82 82 <?php 83 83 if (is_writeable($real_file)) { 84 84 echo '<h2>' . sprintf(__('Editing <strong>%s</strong>'), wp_specialchars($file) ) . '</h2>'; … … 87 87 } 88 88 ?> 89 89 <div id="templateside"> 90 <?php 91 if ( $recents ) : 90 <?php 91 if ( $recents ) : 92 92 ?> 93 93 <h3><?php _e('Recent'); ?></h3> 94 94 <?php … … 106 106 if (file_exists(ABSPATH . $old_file)) 107 107 $common_files[] = $old_file; 108 108 } ?> 109 <ul>110 <?php foreach ($common_files as $common_file) : ?>111 <li><a href="templates.php?file=<?php echo $common_file?>"><?php echo get_file_description($common_file); ?></a></li>112 <?php endforeach; ?>113 </ul>109 <ul> 110 <?php foreach ($common_files as $common_file) : ?> 111 <li><a href="templates.php?file=<?php echo $common_file?>"><?php echo get_file_description($common_file); ?></a></li> 112 <?php endforeach; ?> 113 </ul> 114 114 </div> 115 115 <?php if (!$error) { ?> 116 <form name="template" id="template" action="templates.php" method="post"> 117 <?php wp_nonce_field('edit-file_' . $file) ?>118 <div><textarea cols="70" rows="25" name="newcontent" id='newcontent' tabindex="1"><?php echo $content ?></textarea> 119 <input type="hidden" name="action" value="update" /> 120 <input type="hidden" name="file" value="<?php echo $file ?>" /> 121 </div>116 <form name="template" id="template" action="templates.php" method="post"> 117 <?php wp_nonce_field('edit-file_' . $file) ?> 118 <div><textarea cols="70" rows="25" name="newcontent" id='newcontent' tabindex="1"><?php echo $content ?></textarea> 119 <input type="hidden" name="action" value="update" /> 120 <input type="hidden" name="file" value="<?php echo $file ?>" /> 121 </div> 122 122 <?php if ( is_writeable($real_file) ) : ?> 123 <p class="submit">123 <p class="submit"> 124 124 <?php 125 125 echo "<input type='submit' name='submit' value=' " . __('Update File »') . "' tabindex='2' />"; 126 126 ?> … … 128 128 <?php else : ?> 129 129 <p><em><?php _e('If this file were writable you could edit it.'); ?></em></p> 130 130 <?php endif; ?> 131 </form> 132 <?php131 </form> 132 <?php 133 133 } else { 134 134 echo '<div class="error"><p>' . __('Oops, no such file exists! Double check the name and try again, merci.') . '</p></div>'; 135 135 } … … 139 139 <div class="wrap"> 140 140 <h2><?php _e('Other Files') ?></h2> 141 141 142 <p><?php _e('To edit a file, type its name here. You can edit any file <a href="http://codex.wordpress.org/Changing_File_Permissions" title="Read more about making files writable">writable by the server</a>, e.g. CHMOD 666.') ?></p> 143 <form name="file" action="templates.php" method="get"> 144 <input type="text" name="file" /> 145 <input type="submit" name="submit" value="<?php _e('Edit file »') ?>" /> 146 </form> 142 <p><?php _e('To edit a file, type its name here. You can edit any file <a href="http://codex.wordpress.org/Changing_File_Permissions" title="Read more about making files writable">writable by the server</a>, e.g. CHMOD 666.') ?></p> 143 <form name="file" action="templates.php" method="get"> 144 <input type="text" name="file" /> 145 <input type="submit" name="submit" value="<?php _e('Edit file »') ?>" /> 146 </form> 147 147 148 <p><?php _e('Note: of course, you can also edit the files/templates in your text editor of choice and upload them. This online editor is only meant to be used when you don’t have access to a text editor or FTP client.') ?></p>149 </div> 148 <p><?php _e('Note: of course, you can also edit the files/templates in your text editor of choice and upload them. This online editor is only meant to be used when you don’t have access to a text editor or FTP client.') ?></p> 149 </div> 150 150 <?php 151 151 152 152 break; -
wp-admin/theme-editor.php
75 75 <div id="message" class="updated fade"><p><?php _e('File edited successfully.') ?></p></div> 76 76 <?php endif; ?> 77 77 <div class="wrap"> 78 <form name="theme" action="theme-editor.php" method="post"> 78 <form name="theme" action="theme-editor.php" method="post"> 79 79 <?php _e('Select theme to edit:') ?> 80 80 <select name="theme" id="theme"> 81 81 <?php … … 87 87 echo "\n\t<option value=\"$theme_name\" $selected>$theme_name</option>"; 88 88 } 89 89 ?> 90 </select>91 <input type="submit" name="Submit" value="<?php _e('Select »') ?>" />92 </form>93 </div>90 </select> 91 <input type="submit" name="Submit" value="<?php _e('Select »') ?>" /> 92 </form> 93 </div> 94 94 95 <div class="wrap"> 96 <?php95 <div class="wrap"> 96 <?php 97 97 if ( is_writeable($real_file) ) { 98 98 echo '<h2>' . sprintf(__('Editing <code>%s</code>'), $file_show) . '</h2>'; 99 99 } else { … … 101 101 } 102 102 ?> 103 103 <div id="templateside"> 104 <h3><?php printf(__("<strong>'%s'</strong> theme files"), $theme) ?></h3>104 <h3><?php printf(__("<strong>'%s'</strong> theme files"), $theme) ?></h3> 105 105 106 106 <?php 107 107 if ($allowed_files) : 108 108 ?> 109 <ul>109 <ul> 110 110 <?php foreach($allowed_files as $allowed_file) : ?> 111 111 <li><a href="theme-editor.php?file=<?php echo "$allowed_file"; ?>&theme=<?php echo urlencode($theme) ?>"><?php echo get_file_description($allowed_file); ?></a></li> 112 112 <?php endforeach; ?> 113 </ul>113 </ul> 114 114 <?php endif; ?> 115 </div> 115 </div> 116 116 <?php 117 117 if (!$error) { 118 ?> 119 <form name="template" id="template" action="theme-editor.php" method="post">120 <?php wp_nonce_field('edit-theme_' . $file . $theme) ?>121 <div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1"><?php echo $content ?></textarea> 122 <input type="hidden" name="action" value="update" /> 123 <input type="hidden" name="file" value="<?php echo $file ?>" /> 124 <input type="hidden" name="theme" value="<?php echo $theme ?>" />118 ?> 119 <form name="template" id="template" action="theme-editor.php" method="post"> 120 <?php wp_nonce_field('edit-theme_' . $file . $theme) ?> 121 <div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1"><?php echo $content ?></textarea> 122 <input type="hidden" name="action" value="update" /> 123 <input type="hidden" name="file" value="<?php echo $file ?>" /> 124 <input type="hidden" name="theme" value="<?php echo $theme ?>" /> 125 125 </div> 126 126 <?php if ( is_writeable($real_file) ) : ?> 127 <p class="submit">127 <p class="submit"> 128 128 <?php 129 129 echo "<input type='submit' name='submit' value=' " . __('Update File »') . "' tabindex='2' />"; 130 130 ?> … … 132 132 <?php else : ?> 133 133 <p><em><?php _e('If this file were writable you could edit it.'); ?></em></p> 134 134 <?php endif; ?> 135 </form> 136 <?php135 </form> 136 <?php 137 137 } else { 138 138 echo '<div class="error"><p>' . __('Oops, no such file exists! Double check the name and try again, merci.') . '</p></div>'; 139 139 } 140 140 ?> 141 141 <div class="clear"> </div> 142 </div> 142 </div> 143 143 <?php 144 144 break; 145 145 } 146 146 147 include("admin-footer.php") ?> 147 include("admin-footer.php") ?> -
wp-admin/themes.php
112 112 113 113 $theme = ('class="alternate"' == $theme) ? '' : 'class="alternate"'; 114 114 echo " 115 <tr $theme>116 <td>$title</td>117 <td>$description</td>118 </tr>";115 <tr $theme> 116 <td>$title</td> 117 <td>$description</td> 118 </tr>"; 119 119 } 120 120 ?> 121 121 </table> -
wp-admin/update-links.php
28 28 while ( !feof($fs) ) 29 29 $response .= fgets($fs, 1160); // One TCP-IP packet 30 30 fclose($fs); 31 31 32 32 $response = explode("\r\n\r\n", $response, 2); 33 33 $body = trim( $response[1] ); 34 34 $body = str_replace(array("\r\n", "\r"), "\n", $body); 35 35 36 36 $returns = explode("\n", $body); 37 37 38 38 foreach ($returns as $return) : 39 39 $time = $wpdb->escape( substr($return, 0, 19) ); 40 40 $uri = $wpdb->escape( preg_replace('/(.*?) | (.*?)/', '$2', $return) ); -
wp-admin/upgrade-functions.php
121 121 http://wordpress.org/ 122 122 "), $blog_url, $name, $password); 123 123 124 @wp_mail($email, __('New WordPress Blog'), $message, $message_headers); 124 @wp_mail($email, __('New WordPress Blog'), $message, $message_headers); 125 125 } 126 126 endif; 127 127 … … 138 138 wp_cache_flush(); 139 139 make_db_current_silent(); 140 140 upgrade_all(); 141 wp_cache_flush(); 141 wp_cache_flush(); 142 142 } 143 143 endif; 144 144 … … 188 188 $posts = $wpdb->get_results("SELECT ID, post_title, post_name FROM $wpdb->posts WHERE post_name = ''"); 189 189 if ($posts) { 190 190 foreach($posts as $post) { 191 if ('' == $post->post_name) { 191 if ('' == $post->post_name) { 192 192 $newtitle = sanitize_title($post->post_title); 193 193 $wpdb->query("UPDATE $wpdb->posts SET post_name = '$newtitle' WHERE ID = '$post->ID'"); 194 194 } … … 197 197 198 198 $categories = $wpdb->get_results("SELECT cat_ID, cat_name, category_nicename FROM $wpdb->categories"); 199 199 foreach ($categories as $category) { 200 if ('' == $category->category_nicename) { 200 if ('' == $category->category_nicename) { 201 201 $newtitle = sanitize_title($category->cat_name); 202 202 $wpdb->query("UPDATE $wpdb->categories SET category_nicename = '$newtitle' WHERE cat_ID = '$category->cat_ID'"); 203 203 } … … 252 252 function upgrade_110() { 253 253 global $wpdb; 254 254 255 // Set user_nicename.255 // Set user_nicename. 256 256 $users = $wpdb->get_results("SELECT ID, user_nickname, user_nicename FROM $wpdb->users"); 257 foreach ($users as $user) {258 if ('' == $user->user_nicename) { 259 $newname = sanitize_title($user->user_nickname);260 $wpdb->query("UPDATE $wpdb->users SET user_nicename = '$newname' WHERE ID = '$user->ID'");261 }262 }257 foreach ($users as $user) { 258 if ('' == $user->user_nicename) { 259 $newname = sanitize_title($user->user_nickname); 260 $wpdb->query("UPDATE $wpdb->users SET user_nicename = '$newname' WHERE ID = '$user->ID'"); 261 } 262 } 263 263 264 264 $users = $wpdb->get_results("SELECT ID, user_pass from $wpdb->users"); 265 265 foreach ($users as $row) { 266 266 if (!preg_match('/^[A-Fa-f0-9]{32}$/', $row->user_pass)) { 267 $wpdb->query('UPDATE '.$wpdb->users.' SET user_pass = MD5(\''.$row->user_pass.'\') WHERE ID = \''.$row->ID.'\'');267 $wpdb->query('UPDATE '.$wpdb->users.' SET user_pass = MD5(\''.$row->user_pass.'\') WHERE ID = \''.$row->ID.'\''); 268 268 } 269 269 } 270 270 … … 306 306 } 307 307 308 308 function upgrade_130() { 309 global $wpdb;309 global $wpdb; 310 310 311 // Remove extraneous backslashes.311 // Remove extraneous backslashes. 312 312 $posts = $wpdb->get_results("SELECT ID, post_title, post_content, post_excerpt, guid, post_date, post_name, post_status, post_author FROM $wpdb->posts"); 313 313 if ($posts) { 314 314 foreach($posts as $post) { 315 $post_content = addslashes(deslash($post->post_content));316 $post_title = addslashes(deslash($post->post_title));317 $post_excerpt = addslashes(deslash($post->post_excerpt));315 $post_content = addslashes(deslash($post->post_content)); 316 $post_title = addslashes(deslash($post->post_title)); 317 $post_excerpt = addslashes(deslash($post->post_excerpt)); 318 318 if ( empty($post->guid) ) 319 319 $guid = get_permalink($post->ID); 320 320 else 321 321 $guid = $post->guid; 322 322 323 $wpdb->query("UPDATE $wpdb->posts SET post_title = '$post_title', post_content = '$post_content', post_excerpt = '$post_excerpt', guid = '$guid' WHERE ID = '$post->ID'");323 $wpdb->query("UPDATE $wpdb->posts SET post_title = '$post_title', post_content = '$post_content', post_excerpt = '$post_excerpt', guid = '$guid' WHERE ID = '$post->ID'"); 324 324 } 325 325 } 326 326 327 // Remove extraneous backslashes.327 // Remove extraneous backslashes. 328 328 $comments = $wpdb->get_results("SELECT comment_ID, comment_author, comment_content FROM $wpdb->comments"); 329 329 if ($comments) { 330 330 foreach($comments as $comment) { 331 $comment_content = addslashes(deslash($comment->comment_content));332 $comment_author = addslashes(deslash($comment->comment_author));333 $wpdb->query("UPDATE $wpdb->comments SET comment_content = '$comment_content', comment_author = '$comment_author' WHERE comment_ID = '$comment->comment_ID'");331 $comment_content = addslashes(deslash($comment->comment_content)); 332 $comment_author = addslashes(deslash($comment->comment_author)); 333 $wpdb->query("UPDATE $wpdb->comments SET comment_content = '$comment_content', comment_author = '$comment_author' WHERE comment_ID = '$comment->comment_ID'"); 334 334 } 335 335 } 336 336 337 // Remove extraneous backslashes.337 // Remove extraneous backslashes. 338 338 $links = $wpdb->get_results("SELECT link_id, link_name, link_description FROM $wpdb->links"); 339 339 if ($links) { 340 340 foreach($links as $link) { 341 $link_name = addslashes(deslash($link->link_name));342 $link_description = addslashes(deslash($link->link_description));343 $wpdb->query("UPDATE $wpdb->links SET link_name = '$link_name', link_description = '$link_description' WHERE link_id = '$link->link_id'");341 $link_name = addslashes(deslash($link->link_name)); 342 $link_description = addslashes(deslash($link->link_description)); 343 $wpdb->query("UPDATE $wpdb->links SET link_name = '$link_name', link_description = '$link_description' WHERE link_id = '$link->link_id'"); 344 344 } 345 345 } 346 346 347 // The "paged" option for what_to_show is no more.348 if ($wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = 'what_to_show'") == 'paged') {349 $wpdb->query("UPDATE $wpdb->options SET option_value = 'posts' WHERE option_name = 'what_to_show'");350 }347 // The "paged" option for what_to_show is no more. 348 if ($wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = 'what_to_show'") == 'paged') { 349 $wpdb->query("UPDATE $wpdb->options SET option_value = 'posts' WHERE option_name = 'what_to_show'"); 350 } 351 351 352 $active_plugins = __get_option('active_plugins');352 $active_plugins = __get_option('active_plugins'); 353 353 354 // If plugins are not stored in an array, they're stored in the old355 // newline separated format. Convert to new format.356 if ( !is_array( $active_plugins ) ) {357 $active_plugins = explode("\n", trim($active_plugins));358 update_option('active_plugins', $active_plugins);359 }354 // If plugins are not stored in an array, they're stored in the old 355 // newline separated format. Convert to new format. 356 if ( !is_array( $active_plugins ) ) { 357 $active_plugins = explode("\n", trim($active_plugins)); 358 update_option('active_plugins', $active_plugins); 359 } 360 360 361 361 // Obsolete tables 362 362 $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'optionvalues'); … … 500 500 // Give future posts a post_status of future. 501 501 $now = gmdate('Y-m-d H:i:59'); 502 502 $wpdb->query ("UPDATE $wpdb->posts SET post_status = 'future' WHERE post_status = 'publish' AND post_date_gmt > '$now'"); 503 503 504 504 $posts = $wpdb->get_results("SELECT ID, post_date FROM $wpdb->posts WHERE post_status ='future'"); 505 505 if ( !empty($posts) ) 506 506 foreach ( $posts as $post ) … … 509 509 if ( $wp_current_db_version < 3570 ) { 510 510 // Create categories for link categories if a category with the same 511 511 // name doesn't exist. Create a map of link cat IDs to cat IDs. 512 $link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories"); 512 $link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories"); 513 513 foreach ( $link_cats as $link_cat) { 514 514 if ( $cat_id = category_exists($link_cat->cat_name) ) { 515 515 $link_cat_id_map[$link_cat->cat_id] = $cat_id; … … 528 528 if (!$cat && 0 != $link->link_category) { 529 529 $wpdb->query("INSERT INTO $wpdb->link2cat (link_id, category_id) 530 530 VALUES ('$link->link_id', '$link_cat')"); 531 } 531 } 532 532 } 533 533 534 534 // Set default to the last category we grabbed during the upgrade loop. 535 535 update_option('default_link_category', $default_link_cat); 536 536 … … 549 549 550 550 // General 551 551 function maybe_create_table($table_name, $create_ddl) { 552 global $wpdb;553 foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) {554 if ($table == $table_name) {555 return true;556 }557 }558 //didn't find it try to create it.559 $q = $wpdb->query($create_ddl);560 // we cannot directly tell that whether this succeeded!561 foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) {562 if ($table == $table_name) {563 return true;564 }565 }566 return false;552 global $wpdb; 553 foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) { 554 if ($table == $table_name) { 555 return true; 556 } 557 } 558 //didn't find it try to create it. 559 $q = $wpdb->query($create_ddl); 560 // we cannot directly tell that whether this succeeded! 561 foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) { 562 if ($table == $table_name) { 563 return true; 564 } 565 } 566 return false; 567 567 } 568 568 569 569 function drop_index($table, $index) { … … 592 592 ** false on error 593 593 */ 594 594 function maybe_add_column($table_name, $column_name, $create_ddl) { 595 global $wpdb, $debug;596 foreach ($wpdb->get_col("DESC $table_name", 0) as $column ) {597 if ($debug) echo("checking $column == $column_name<br />");598 if ($column == $column_name) {599 return true;600 }601 }602 //didn't find it try to create it.603 $q = $wpdb->query($create_ddl);604 // we cannot directly tell that whether this succeeded!605 foreach ($wpdb->get_col("DESC $table_name", 0) as $column ) {606 if ($column == $column_name) {607 return true;608 }609 }610 return false;595 global $wpdb, $debug; 596 foreach ($wpdb->get_col("DESC $table_name", 0) as $column ) { 597 if ($debug) echo("checking $column == $column_name<br />"); 598 if ($column == $column_name) { 599 return true; 600 } 601 } 602 //didn't find it try to create it. 603 $q = $wpdb->query($create_ddl); 604 // we cannot directly tell that whether this succeeded! 605 foreach ($wpdb->get_col("DESC $table_name", 0) as $column ) { 606 if ($column == $column_name) { 607 return true; 608 } 609 } 610 return false; 611 611 } 612 612 613 613 … … 616 616 global $wpdb; 617 617 if ($options = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options")) { 618 618 foreach ($options as $option) { 619 // "When trying to design a foolproof system, 619 // "When trying to design a foolproof system, 620 620 // never underestimate the ingenuity of the fools :)" -- Dougal 621 621 if ('siteurl' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value); 622 622 if ('home' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value); … … 647 647 } 648 648 649 649 function deslash($content) { 650 // Note: \\\ inside a regex denotes a single backslash.650 // Note: \\\ inside a regex denotes a single backslash. 651 651 652 // Replace one or more backslashes followed by a single quote with653 // a single quote.654 $content = preg_replace("/\\\+'/", "'", $content);652 // Replace one or more backslashes followed by a single quote with 653 // a single quote. 654 $content = preg_replace("/\\\+'/", "'", $content); 655 655 656 // Replace one or more backslashes followed by a double quote with657 // a double quote.658 $content = preg_replace('/\\\+"/', '"', $content);656 // Replace one or more backslashes followed by a double quote with 657 // a double quote. 658 $content = preg_replace('/\\\+"/', '"', $content); 659 659 660 // Replace one or more backslashes with one backslash.661 $content = preg_replace("/\\\+/", "\\", $content);660 // Replace one or more backslashes with one backslash. 661 $content = preg_replace("/\\\+/", "\\", $content); 662 662 663 return $content;663 return $content; 664 664 } 665 665 666 666 function dbDelta($queries, $execute = true) { … … 827 827 $index_columns .= '('.$column_data['subpart'].')'; 828 828 } 829 829 } 830 // Add the column list to the index create string 830 // Add the column list to the index create string 831 831 $index_string .= ' ('.$index_columns.')'; 832 832 833 833 if(!(($aindex = array_search($index_string, $indices)) === false)) { -
wp-admin/upgrade-schema.php
2 2 // Here we keep the DB structure and option values 3 3 4 4 $wp_queries="CREATE TABLE $wpdb->categories ( 5 cat_ID bigint(20) NOT NULL auto_increment,6 cat_name varchar(55) NOT NULL default '',7 category_nicename varchar(200) NOT NULL default '',8 category_description longtext NOT NULL,9 category_parent bigint(20) NOT NULL default '0',10 category_count bigint(20) NOT NULL default '0',11 link_count bigint(20) NOT NULL default '0',12 posts_private tinyint(1) NOT NULL default '0',13 links_private tinyint(1) NOT NULL default '0',14 PRIMARY KEY (cat_ID),15 KEY category_nicename (category_nicename)5 cat_ID bigint(20) NOT NULL auto_increment, 6 cat_name varchar(55) NOT NULL default '', 7 category_nicename varchar(200) NOT NULL default '', 8 category_description longtext NOT NULL, 9 category_parent bigint(20) NOT NULL default '0', 10 category_count bigint(20) NOT NULL default '0', 11 link_count bigint(20) NOT NULL default '0', 12 posts_private tinyint(1) NOT NULL default '0', 13 links_private tinyint(1) NOT NULL default '0', 14 PRIMARY KEY (cat_ID), 15 KEY category_nicename (category_nicename) 16 16 ); 17 17 CREATE TABLE $wpdb->comments ( 18 comment_ID bigint(20) unsigned NOT NULL auto_increment,19 comment_post_ID int(11) NOT NULL default '0',20 comment_author tinytext NOT NULL,21 comment_author_email varchar(100) NOT NULL default '',22 comment_author_url varchar(200) NOT NULL default '',23 comment_author_IP varchar(100) NOT NULL default '',24 comment_date datetime NOT NULL default '0000-00-00 00:00:00',25 comment_date_gmt datetime NOT NULL default '0000-00-00 00:00:00',26 comment_content text NOT NULL,27 comment_karma int(11) NOT NULL default '0',28 comment_approved enum('0','1','spam') NOT NULL default '1',29 comment_agent varchar(255) NOT NULL default '',30 comment_type varchar(20) NOT NULL default '',31 comment_parent bigint(20) NOT NULL default '0',32 user_id bigint(20) NOT NULL default '0',33 PRIMARY KEY (comment_ID),34 KEY comment_approved (comment_approved),35 KEY comment_post_ID (comment_post_ID)18 comment_ID bigint(20) unsigned NOT NULL auto_increment, 19 comment_post_ID int(11) NOT NULL default '0', 20 comment_author tinytext NOT NULL, 21 comment_author_email varchar(100) NOT NULL default '', 22 comment_author_url varchar(200) NOT NULL default '', 23 comment_author_IP varchar(100) NOT NULL default '', 24 comment_date datetime NOT NULL default '0000-00-00 00:00:00', 25 comment_date_gmt datetime NOT NULL default '0000-00-00 00:00:00', 26 comment_content text NOT NULL, 27 comment_karma int(11) NOT NULL default '0', 28 comment_approved enum('0','1','spam') NOT NULL default '1', 29 comment_agent varchar(255) NOT NULL default '', 30 comment_type varchar(20) NOT NULL default '', 31 comment_parent bigint(20) NOT NULL default '0', 32 user_id bigint(20) NOT NULL default '0', 33 PRIMARY KEY (comment_ID), 34 KEY comment_approved (comment_approved), 35 KEY comment_post_ID (comment_post_ID) 36 36 ); 37 37 CREATE TABLE $wpdb->link2cat ( 38 rel_id bigint(20) NOT NULL auto_increment,39 link_id bigint(20) NOT NULL default '0',40 category_id bigint(20) NOT NULL default '0',41 PRIMARY KEY (rel_id),42 KEY link_id (link_id,category_id)38 rel_id bigint(20) NOT NULL auto_increment, 39 link_id bigint(20) NOT NULL default '0', 40 category_id bigint(20) NOT NULL default '0', 41 PRIMARY KEY (rel_id), 42 KEY link_id (link_id,category_id) 43 43 ); 44 44 CREATE TABLE $wpdb->links ( 45 link_id bigint(20) NOT NULL auto_increment,46 link_url varchar(255) NOT NULL default '',47 link_name varchar(255) NOT NULL default '',48 link_image varchar(255) NOT NULL default '',49 link_target varchar(25) NOT NULL default '',50 link_category bigint(20) NOT NULL default '0',51 link_description varchar(255) NOT NULL default '',52 link_visible enum('Y','N') NOT NULL default 'Y',53 link_owner int(11) NOT NULL default '1',54 link_rating int(11) NOT NULL default '0',55 link_updated datetime NOT NULL default '0000-00-00 00:00:00',56 link_rel varchar(255) NOT NULL default '',57 link_notes mediumtext NOT NULL,58 link_rss varchar(255) NOT NULL default '',59 PRIMARY KEY (link_id),60 KEY link_category (link_category),61 KEY link_visible (link_visible)45 link_id bigint(20) NOT NULL auto_increment, 46 link_url varchar(255) NOT NULL default '', 47 link_name varchar(255) NOT NULL default '', 48 link_image varchar(255) NOT NULL default '', 49 link_target varchar(25) NOT NULL default '', 50 link_category bigint(20) NOT NULL default '0', 51 link_description varchar(255) NOT NULL default '', 52 link_visible enum('Y','N') NOT NULL default 'Y', 53 link_owner int(11) NOT NULL default '1', 54 link_rating int(11) NOT NULL default '0', 55 link_updated datetime NOT NULL default '0000-00-00 00:00:00', 56 link_rel varchar(255) NOT NULL default '', 57 link_notes mediumtext NOT NULL, 58 link_rss varchar(255) NOT NULL default '', 59 PRIMARY KEY (link_id), 60 KEY link_category (link_category), 61 KEY link_visible (link_visible) 62 62 ); 63 63 CREATE TABLE $wpdb->options ( 64 option_id bigint(20) NOT NULL auto_increment,65 blog_id int(11) NOT NULL default '0',66 option_name varchar(64) NOT NULL default '',67 option_can_override enum('Y','N') NOT NULL default 'Y',68 option_type int(11) NOT NULL default '1',69 option_value longtext NOT NULL,70 option_width int(11) NOT NULL default '20',71 option_height int(11) NOT NULL default '8',72 option_description tinytext NOT NULL,73 option_admin_level int(11) NOT NULL default '1',74 autoload enum('yes','no') NOT NULL default 'yes',75 PRIMARY KEY (option_id,blog_id,option_name),76 KEY option_name (option_name)64 option_id bigint(20) NOT NULL auto_increment, 65 blog_id int(11) NOT NULL default '0', 66 option_name varchar(64) NOT NULL default '', 67 option_can_override enum('Y','N') NOT NULL default 'Y', 68 option_type int(11) NOT NULL default '1', 69 option_value longtext NOT NULL, 70 option_width int(11) NOT NULL default '20', 71 option_height int(11) NOT NULL default '8', 72 option_description tinytext NOT NULL, 73 option_admin_level int(11) NOT NULL default '1', 74 autoload enum('yes','no') NOT NULL default 'yes', 75 PRIMARY KEY (option_id,blog_id,option_name), 76 KEY option_name (option_name) 77 77 ); 78 78 CREATE TABLE $wpdb->post2cat ( 79 rel_id bigint(20) NOT NULL auto_increment,80 post_id bigint(20) NOT NULL default '0',81 category_id bigint(20) NOT NULL default '0',82 PRIMARY KEY (rel_id),83 KEY post_id (post_id,category_id)79 rel_id bigint(20) NOT NULL auto_increment, 80 post_id bigint(20) NOT NULL default '0', 81 category_id bigint(20) NOT NULL default '0', 82 PRIMARY KEY (rel_id), 83 KEY post_id (post_id,category_id) 84 84 ); 85 85 CREATE TABLE $wpdb->postmeta ( 86 meta_id bigint(20) NOT NULL auto_increment,87 post_id bigint(20) NOT NULL default '0',88 meta_key varchar(255) default NULL,89 meta_value longtext,90 PRIMARY KEY (meta_id),91 KEY post_id (post_id),92 KEY meta_key (meta_key)86 meta_id bigint(20) NOT NULL auto_increment, 87 post_id bigint(20) NOT NULL default '0', 88 meta_key varchar(255) default NULL, 89 meta_value longtext, 90 PRIMARY KEY (meta_id), 91 KEY post_id (post_id), 92 KEY meta_key (meta_key) 93 93 ); 94 94 CREATE TABLE $wpdb->posts ( 95 ID bigint(20) unsigned NOT NULL auto_increment,96 post_author bigint(20) NOT NULL default '0',97 post_date datetime NOT NULL default '0000-00-00 00:00:00',98 post_date_gmt datetime NOT NULL default '0000-00-00 00:00:00',99 post_content longtext NOT NULL,100 post_title text NOT NULL,101 post_category int(4) NOT NULL default '0',102 post_excerpt text NOT NULL,103 post_status enum('publish','draft','private','static','object','attachment','inherit','future') NOT NULL default 'publish',104 comment_status enum('open','closed','registered_only') NOT NULL default 'open',105 ping_status enum('open','closed') NOT NULL default 'open',106 post_password varchar(20) NOT NULL default '',107 post_name varchar(200) NOT NULL default '',108 to_ping text NOT NULL,109 pinged text NOT NULL,110 post_modified datetime NOT NULL default '0000-00-00 00:00:00',111 post_modified_gmt datetime NOT NULL default '0000-00-00 00:00:00',112 post_content_filtered text NOT NULL,113 post_parent bigint(20) NOT NULL default '0',114 guid varchar(255) NOT NULL default '',115 menu_order int(11) NOT NULL default '0',116 post_type varchar(20) NOT NULL default 'post',117 post_mime_type varchar(100) NOT NULL default '',118 comment_count bigint(20) NOT NULL default '0',119 PRIMARY KEY (ID),120 KEY post_name (post_name),121 KEY type_status_date (post_type, post_status, post_date, ID)95 ID bigint(20) unsigned NOT NULL auto_increment, 96 post_author bigint(20) NOT NULL default '0', 97 post_date datetime NOT NULL default '0000-00-00 00:00:00', 98 post_date_gmt datetime NOT NULL default '0000-00-00 00:00:00', 99 post_content longtext NOT NULL, 100 post_title text NOT NULL, 101 post_category int(4) NOT NULL default '0', 102 post_excerpt text NOT NULL, 103 post_status enum('publish','draft','private','static','object','attachment','inherit','future') NOT NULL default 'publish', 104 comment_status enum('open','closed','registered_only') NOT NULL default 'open', 105 ping_status enum('open','closed') NOT NULL default 'open', 106 post_password varchar(20) NOT NULL default '', 107 post_name varchar(200) NOT NULL default '', 108 to_ping text NOT NULL, 109 pinged text NOT NULL, 110 post_modified datetime NOT NULL default '0000-00-00 00:00:00', 111 post_modified_gmt datetime NOT NULL default '0000-00-00 00:00:00', 112 post_content_filtered text NOT NULL, 113 post_parent bigint(20) NOT NULL default '0', 114 guid varchar(255) NOT NULL default '', 115 menu_order int(11) NOT NULL default '0', 116 post_type varchar(20) NOT NULL default 'post', 117 post_mime_type varchar(100) NOT NULL default '', 118 comment_count bigint(20) NOT NULL default '0', 119 PRIMARY KEY (ID), 120 KEY post_name (post_name), 121 KEY type_status_date (post_type, post_status, post_date, ID) 122 122 ); 123 123 CREATE TABLE $wpdb->users ( 124 ID bigint(20) unsigned NOT NULL auto_increment,125 user_login varchar(60) NOT NULL default '',126 user_pass varchar(64) NOT NULL default '',127 user_nicename varchar(50) NOT NULL default '',128 user_email varchar(100) NOT NULL default '',129 user_url varchar(100) NOT NULL default '',130 user_registered datetime NOT NULL default '0000-00-00 00:00:00',131 user_activation_key varchar(60) NOT NULL default '',132 user_status int(11) NOT NULL default '0',133 display_name varchar(250) NOT NULL default '',134 PRIMARY KEY (ID),135 KEY user_login_key (user_login)124 ID bigint(20) unsigned NOT NULL auto_increment, 125 user_login varchar(60) NOT NULL default '', 126 user_pass varchar(64) NOT NULL default '', 127 user_nicename varchar(50) NOT NULL default '', 128 user_email varchar(100) NOT NULL default '', 129 user_url varchar(100) NOT NULL default '', 130 user_registered datetime NOT NULL default '0000-00-00 00:00:00', 131 user_activation_key varchar(60) NOT NULL default '', 132 user_status int(11) NOT NULL default '0', 133 display_name varchar(250) NOT NULL default '', 134 PRIMARY KEY (ID), 135 KEY user_login_key (user_login) 136 136 ); 137 137 CREATE TABLE $wpdb->usermeta ( 138 umeta_id bigint(20) NOT NULL auto_increment,139 user_id bigint(20) NOT NULL default '0',140 meta_key varchar(255) default NULL,141 meta_value longtext,142 PRIMARY KEY (umeta_id),143 KEY user_id (user_id),144 KEY meta_key (meta_key)138 umeta_id bigint(20) NOT NULL auto_increment, 139 user_id bigint(20) NOT NULL default '0', 140 meta_key varchar(255) default NULL, 141 meta_value longtext, 142 PRIMARY KEY (umeta_id), 143 KEY user_id (user_id), 144 KEY meta_key (meta_key) 145 145 );"; 146 146 147 147 function populate_options() { … … 224 224 add_option('uploads_use_yearmonth_folders', 1); 225 225 add_option('upload_path', 'wp-content/uploads'); 226 226 } 227 227 228 228 // 2.0.3 229 229 add_option('secret', md5(uniqid(microtime()))); 230 230 -
wp-admin/upgrade.php
68 68 69 69 case 0: 70 70 $goback = wp_specialchars(wp_get_referer()); 71 ?> 72 <p><?php _e('This file upgrades you from any previous version of WordPress to the latest. It may take a while though, so be patient.'); ?></p> 71 ?> 72 <p><?php _e('This file upgrades you from any previous version of WordPress to the latest. It may take a while though, so be patient.'); ?></p> 73 73 <h2 class="step"><a href="upgrade.php?step=1&backto=<?php echo $goback; ?>"><?php _e('Upgrade WordPress »'); ?></a></h2> 74 74 <?php 75 75 break; … … 81 81 $backto = __get_option('home'); 82 82 else 83 83 $backto = wp_specialchars( $_GET['backto'] , 1 ); 84 ?> 85 <h2><?php _e('Step 1'); ?></h2> 84 ?> 85 <h2><?php _e('Step 1'); ?></h2> 86 86 <p><?php printf(__("There's actually only one step. So if you see this, you're done. <a href='%s'>Have fun</a>!"), $backto); ?></p> 87 87 88 88 <!-- … … 96 96 <?php 97 97 break; 98 98 } 99 ?> 99 ?> 100 100 </body> 101 101 </html> -
wp-admin/user-edit.php
182 182 <?php do_action('edit_user_profile'); ?> 183 183 184 184 <br clear="all" /> 185 <table width="99%" border="0" cellspacing="2" cellpadding="3" class="editform">186 <?php187 if(count($profileuser->caps) > count($profileuser->roles)):188 ?>189 <tr>190 <th scope="row"><?php _e('Additional Capabilities:') ?></th>191 <td><?php 185 <table width="99%" border="0" cellspacing="2" cellpadding="3" class="editform"> 186 <?php 187 if(count($profileuser->caps) > count($profileuser->roles)): 188 ?> 189 <tr> 190 <th scope="row"><?php _e('Additional Capabilities:') ?></th> 191 <td><?php 192 192 $output = ''; 193 193 foreach($profileuser->caps as $cap => $value) { 194 194 if(!$wp_roles->is_role($cap)) { … … 198 198 } 199 199 echo $output; 200 200 ?></td> 201 </tr>202 <?php203 endif;204 ?>205 </table>201 </tr> 202 <?php 203 endif; 204 ?> 205 </table> 206 206 <p class="submit"> 207 207 <input type="hidden" name="action" value="update" /> 208 208 <input type="hidden" name="user_id" id="user_id" value="<?php echo $user_id; ?>" /> 209 <input type="submit" value="<?php _e('Update User »') ?>" name="submit" />209 <input type="submit" value="<?php _e('Update User »') ?>" name="submit" /> 210 210 </p> 211 211 </form> 212 212 </div> -
wp-admin/wp-admin.css
258 258 } 259 259 260 260 .commentlist li { 261 border-bottom: 1px solid #ccc; 261 border-bottom: 1px solid #ccc; 262 262 padding: 1em 1em .2em; 263 263 margin: 0; 264 264 } … … 762 762 } 763 763 764 764 /* A handy div class for hiding controls. 765 Some browsers will disable them when you766 set display:none; */765 Some browsers will disable them when you 766 set display:none; */ 767 767 .zerosize { 768 768 height: 0px; 769 769 width: 0px; … … 803 803 } 804 804 805 805 /**************************************************************** 806 avoid padding, margins or borders on dbx-box, 807 to reduce visual discrepancies between it and the clone. 808 overall, dbx-box is best left as visually unstyled as possible 806 avoid padding, margins or borders on dbx-box, 807 to reduce visual discrepancies between it and the clone. 808 overall, dbx-box is best left as visually unstyled as possible 809 809 *****************************************************************/ 810 810 .dbx-box { 811 811 margin:0; … … 870 870 float: left; 871 871 width: 40%; 872 872 padding: .5em 2em; 873 margin: 1em; 873 margin: 1em; 874 874 } 875 875 876 876 #your-profile fieldset input { -
wp-admin/xfn.js
10 10 } 11 11 12 12 function meChecked() { 13 var undefined;14 var eMe = document.getElementById('me');15 if (eMe == undefined) return false;16 else return eMe.checked;13 var undefined; 14 var eMe = document.getElementById('me'); 15 if (eMe == undefined) return false; 16 else return eMe.checked; 17 17 } 18 18 19 19 function upit() {
