Plugin Directory

Changeset 534576


Ignore:
Timestamp:
04/21/2012 10:15:26 PM (14 years ago)
Author:
froman118
Message:
 
Location:
my-page-order/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • my-page-order/trunk/mypageorder.php

    r519204 r534576  
    44Plugin URI: http://www.geekyweekly.com/mypageorder
    55Description: 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.1
     6Version: 3.3.2
    77Author: Andrew Charlton
    88Author URI: http://www.geekyweekly.com
     
    5353
    5454if (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);
    5656    $parentID = $parentsParent[0];
    57 }
    58 
    59 if(isset($_GET['hideNote'])) {
    60     update_option('mypageorder_hideNote', '1');
    6157}
    6258
     
    7268<form name="frmMyPageOrder" method="post" action="">
    7369    <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>&nbsp;&nbsp;<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; ?>
    8471   
    8572    <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>
     
    201188        {
    202189            $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));
    204191        }
    205192
     
    218205    foreach($results as $row)
    219206    {
    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);
    221208        if($postCount[0] > 0)
    222209            $subPageStr = $subPageStr."<option value='$row->ID'>".__($row->post_title)."</option>";
     
    228215{
    229216    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) );
    231218}
    232219
  • my-page-order/trunk/readme.txt

    r519200 r534576  
    44Tags: page, order, sidebar, widget
    55Requires at least: 2.8
    6 Tested up to: 3.3.1
    7 Stable tag: 3.3.1
     6Tested up to: 3.3.2
     7Stable tag: 3.3.2
    88
    99My 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.