Changeset 6798
- Timestamp:
- 02/12/2008 08:01:32 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
wp-admin/edit-pages.php (modified) (2 diffs)
-
wp-admin/link-manager.php (modified) (9 diffs)
-
wp-includes/bookmark.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-pages.php
r6797 r6798 14 14 ); 15 15 16 $post_status_label = __(' Pages');16 $post_status_label = __('Manage Pages'); 17 17 $post_status_q = ''; 18 18 if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($post_stati) ) ) { … … 67 67 68 68 <p id="post-search"> 69 <input type="text" id="post-search-input" name="s" value="<?php the_search_query(); ?>" />69 <input type="text" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" /> 70 70 <input type="submit" value="<?php _e( 'Search Pages' ); ?>" /> 71 71 </p> -
trunk/wp-admin/link-manager.php
r6570 r6798 59 59 <div class="wrap"> 60 60 61 <form id="posts-filter" action="" method="get"> 61 62 <h2><?php _e('Manage Links'); ?></h2> 62 <p><a href="link-add.php"><?php _e('Add Link'); ?></a> | <a href="edit-link-categories.php"><?php _e('Link Categories'); ?></a> | <a href="link-import.php"><?php _e('Import Links'); ?></a></p> 63 <p><?php _e('Here you <a href="link-add.php">add links</a> 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> 64 <form id="cats" method="get" action=""> 65 <p><?php 63 64 <p id="post-search"> 65 <input type="text" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" /> 66 <input type="submit" value="<?php _e( 'Search Links' ); ?>" /> 67 </p> 68 69 <br style="clear:both;" /> 70 71 <div class="tablenav"> 72 73 <div style="float: left"> 74 <input type="button" value="<?php _e('Delete'); ?>" name="deleteit" /> 75 76 <?php 66 77 $categories = get_terms('link_category', "hide_empty=1"); 67 78 $select_cat = "<select name=\"cat_id\">\n"; 68 $select_cat .= '<option value="all"' . (($cat_id == 'all') ? " selected='selected'" : '') . '>' . __(' All') . "</option>\n";79 $select_cat .= '<option value="all"' . (($cat_id == 'all') ? " selected='selected'" : '') . '>' . __('View all Categories') . "</option>\n"; 69 80 foreach ((array) $categories as $cat) 70 81 $select_cat .= '<option value="' . $cat->term_id . '"' . (($cat->term_id == $cat_id) ? " selected='selected'" : '') . '>' . sanitize_term_field('name', $cat->name, $cat->term_id, 'link_category', 'display') . "</option>\n"; … … 72 83 73 84 $select_order = "<select name=\"order_by\">\n"; 74 $select_order .= '<option value="order_id"' . (($order_by == 'order_id') ? " selected='selected'" : '') . '>' . __(' Link ID') . "</option>\n";75 $select_order .= '<option value="order_name"' . (($order_by == 'order_name') ? " selected='selected'" : '') . '>' . __(' Name') . "</option>\n";76 $select_order .= '<option value="order_url"' . (($order_by == 'order_url') ? " selected='selected'" : '') . '>' . __(' Address') . "</option>\n";77 $select_order .= '<option value="order_rating"' . (($order_by == 'order_rating') ? " selected='selected'" : '') . '>' . __(' Rating') . "</option>\n";85 $select_order .= '<option value="order_id"' . (($order_by == 'order_id') ? " selected='selected'" : '') . '>' . __('Order by Link ID') . "</option>\n"; 86 $select_order .= '<option value="order_name"' . (($order_by == 'order_name') ? " selected='selected'" : '') . '>' . __('Order by Name') . "</option>\n"; 87 $select_order .= '<option value="order_url"' . (($order_by == 'order_url') ? " selected='selected'" : '') . '>' . __('Order by Address') . "</option>\n"; 88 $select_order .= '<option value="order_rating"' . (($order_by == 'order_rating') ? " selected='selected'" : '') . '>' . __('Order by Rating') . "</option>\n"; 78 89 $select_order .= "</select>\n"; 79 90 80 printf(__('Currently showing %1$s links ordered by %2$s'), $select_cat, $select_order); 81 ?> 82 <input type="submit" name="action" value="<?php _e('Update »') ?>" /></p> 91 echo $select_cat; 92 echo $select_order; 93 94 ?> 95 <input type="submit" id="post-query-submit" value="<?php _e('Filter »'); ?>" class="button" /> 96 97 </div> 98 99 <br style="clear:both;" /> 100 </div> 83 101 </form> 102 103 <br style="clear:both;" /> 104 84 105 <?php 85 106 $link_columns = array( … … 89 110 'rel' => '<th style="text-align: center">' . __('rel') . '</th>', 90 111 'visible' => '<th style="text-align: center">' . __('Visible') . '</th>', 91 'action' => '<th colspan="2" style="text-align: center">' . __('Action') . '</th>',92 112 ); 93 113 $link_columns = apply_filters('manage_link_columns', $link_columns); … … 97 117 if ( 'all' == $cat_id ) 98 118 $cat_id = ''; 99 $links = get_bookmarks( "category=$cat_id&hide_invisible=0&orderby=$sqlorderby&hide_empty=0" ); 119 $args = array('category' => $cat_id, 'hide_invisible' => 0, 'orderby' => $sqlorderby, 'hide_empty' => 0); 120 if ( $_GET['s'] ) 121 $args['search'] = $_GET['s']; 122 $links = get_bookmarks( $args ); 100 123 if ( $links ) { 101 124 ?> … … 110 133 <thead> 111 134 <tr> 135 <th style="text-align: center"><input type="checkbox" onclick="checkAll(document.getElementById('links'));" /></th> 112 136 <?php foreach($link_columns as $column_display_name) { 113 137 echo $column_display_name; 114 138 } ?> 115 <th style="text-align: center"><input type="checkbox" onclick="checkAll(document.getElementById('links'));" /></th>116 139 </tr> 117 140 </thead> … … 133 156 $style = ($i % 2) ? '' : ' class="alternate"'; 134 157 ?><tr id="link-<?php echo $link->link_id; ?>" valign="middle" <?php echo $style; ?>><?php 158 echo '<td align="center"><input type="checkbox" name="linkcheck[]" value="'.$link->link_id.'" /></td>'; 135 159 foreach($link_columns as $column_name=>$column_display_name) { 136 160 switch($column_name) { 137 161 case 'name': 138 ?><td><strong><?php echo $link->link_name; ?></strong><br /><?php 162 163 echo "<td><a href='link.php?link_id=$link->link_id&action=edit' class='edit'>$link->link_name</a><br />"; 139 164 echo $link->link_description . "</td>"; 140 165 break; … … 163 188 ?><td align='center'><?php echo $visible; ?></td><?php 164 189 break; 165 case 'action':166 echo "<td><a href='link.php?link_id=$link->link_id&action=edit' class='edit'>" . __('Edit') . '</a></td>';167 echo "<td><a href='" . wp_nonce_url('link.php?link_id='.$link->link_id.'&action=delete', 'delete-bookmark_' . $link->link_id ) . "' class='delete:the-list:link-$link->link_id delete'>" . __('Delete') . '</a></td>';168 break;169 190 default: 170 191 ?> … … 175 196 } 176 197 } 177 echo '<td align="center"><input type="checkbox" name="linkcheck[]" value="'.$link->link_id.'" /></td>';178 198 echo "\n </tr>\n"; 179 199 } … … 184 204 <div id="ajax-response"></div> 185 205 186 <p class="submit"><input type="submit" class="button" name="deletebookmarks" id="deletebookmarks" value="<?php _e('Delete Checked Links »') ?>" onclick="return confirm('<?php echo js_escape(__("You are about to delete these links permanently.\n'Cancel' to stop, 'OK' to delete.")); ?>')" /></p>187 206 </form> 188 207 -
trunk/wp-includes/bookmark.php
r6726 r6798 112 112 'category_name' => '', 'hide_invisible' => 1, 113 113 'show_updated' => 0, 'include' => '', 114 'exclude' => '' 114 'exclude' => '', 'search' => '' 115 115 ); 116 116 … … 161 161 } 162 162 163 if ( ! empty($search) ) { 164 $search = like_escape($search); 165 $search = " AND ( (link_url LIKE '%$search%') OR (link_name LIKE '%$search%') OR (link_description LIKE '%$search%') ) "; 166 } 167 163 168 $category_query = ''; 164 169 $join = ''; … … 208 213 209 214 $query = "SELECT * $length $recently_updated_test $get_updated FROM $wpdb->links $join WHERE 1=1 $visible $category_query"; 210 $query .= " $exclusions $inclusions ";215 $query .= " $exclusions $inclusions $search"; 211 216 $query .= " ORDER BY $orderby $order"; 212 217 if ($limit != -1)
Note: See TracChangeset
for help on using the changeset viewer.