Changeset 534576
- Timestamp:
- 04/21/2012 10:15:26 PM (14 years ago)
- Location:
- my-page-order/trunk
- Files:
-
- 2 edited
-
mypageorder.php (modified) (6 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
my-page-order/trunk/mypageorder.php
r519204 r534576 4 4 Plugin URI: http://www.geekyweekly.com/mypageorder 5 5 Description: My Page Order allows you to set the order of pages through a drag and drop interface. The default method of setting the order page by page is extremely clumsy, especially with a large number of pages. 6 Version: 3.3. 16 Version: 3.3.2 7 7 Author: Andrew Charlton 8 8 Author URI: http://www.geekyweekly.com … … 53 53 54 54 if (isset($_POST['btnReturnParent'])) { 55 $parentsParent = $wpdb->get_row( "SELECT post_parent FROM $wpdb->posts WHERE ID = " . $_POST['hdnParentID'], ARRAY_N);55 $parentsParent = $wpdb->get_row( $wpdb->prepare("SELECT post_parent FROM $wpdb->posts WHERE ID = %d ", $_POST['hdnParentID'] ), ARRAY_N); 56 56 $parentID = $parentsParent[0]; 57 }58 59 if(isset($_GET['hideNote'])) {60 update_option('mypageorder_hideNote', '1');61 57 } 62 58 … … 72 68 <form name="frmMyPageOrder" method="post" action=""> 73 69 <h2><?php _e('My Page Order', 'mypageorder') ?></h2> 74 <?php 75 echo $success; 76 if (get_option("mypageorder_hideNote") != "1") 77 { ?> 78 <div class="updated"> 79 <strong><p><?php _e('If you like my plugin please consider donating. Every little bit helps me provide support and continue development.','mypageorder'); ?> <a href="http://geekyweekly.com/gifts-and-donations"><?php _e('Donate', 'mypageorder'); ?></a> <small><a href="<?php echo mypageorder_getTarget(); ?>&hideNote=true"><?php _e('No thanks, hide this', 'mypageorder'); ?></a></small></p></strong> 80 </div> 81 <?php 82 } 83 ?> 70 <?php echo $success; ?> 84 71 85 72 <p><?php _e('Choose a page from the drop down to order its subpages or order the pages on this level by dragging and dropping them into the desired order.', 'mypageorder') ?></p> … … 201 188 { 202 189 $str = str_replace("id_", "", $IDs[$i]); 203 $wpdb->query( "UPDATE $wpdb->posts SET menu_order = '$i' WHERE id ='$str'");190 $wpdb->query($wpdb->prepare("UPDATE $wpdb->posts SET menu_order = %d WHERE id = %d ", $i, $str)); 204 191 } 205 192 … … 218 205 foreach($results as $row) 219 206 { 220 $postCount=$wpdb->get_row( "SELECT count(*) as postsCount FROM $wpdb->posts WHERE post_parent = $row->ID and post_type = 'page' AND post_status != 'trash' AND post_status != 'auto-draft' ", ARRAY_N);207 $postCount=$wpdb->get_row($wpdb->prepare("SELECT count(*) as postsCount FROM $wpdb->posts WHERE post_parent = %d and post_type = 'page' AND post_status != 'trash' AND post_status != 'auto-draft' ", $row->ID) , ARRAY_N); 221 208 if($postCount[0] > 0) 222 209 $subPageStr = $subPageStr."<option value='$row->ID'>".__($row->post_title)."</option>"; … … 228 215 { 229 216 global $wpdb; 230 return $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE post_parent = $parentID and post_type = 'page' AND post_status != 'trash' AND post_status != 'auto-draft' ORDER BY menu_order ASC");217 return $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->posts WHERE post_parent = %d and post_type = 'page' AND post_status != 'trash' AND post_status != 'auto-draft' ORDER BY menu_order ASC", $parentID) ); 231 218 } 232 219 -
my-page-order/trunk/readme.txt
r519200 r534576 4 4 Tags: page, order, sidebar, widget 5 5 Requires at least: 2.8 6 Tested up to: 3.3. 17 Stable tag: 3.3. 16 Tested up to: 3.3.2 7 Stable tag: 3.3.2 8 8 9 9 My Page Order allows you to set the order of pages through a drag and drop interface.
Note: See TracChangeset
for help on using the changeset viewer.