Changeset 534578
- Timestamp:
- 04/21/2012 10:19:39 PM (14 years ago)
- Location:
- my-category-order/trunk
- Files:
-
- 2 edited
-
mycategoryorder.php (modified) (6 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
my-category-order/trunk/mycategoryorder.php
r519203 r534578 4 4 Plugin URI: http://www.geekyweekly.com/mycategoryorder 5 5 Description: My Category Order allows you to set the order in which categories will appear in the sidebar. Uses a drag and drop interface for ordering. Adds a widget with additional options for easy installation on widgetized themes. 6 Version: 3.3. 16 Version: 3.3.2 7 7 Author: Andrew Charlton 8 8 Author URI: http://www.geekyweekly.com … … 70 70 71 71 if (isset($_POST['btnReturnParent'])) { 72 $parentsParent = $wpdb->get_row( "SELECT parent FROM $wpdb->term_taxonomy WHERE term_id = " . $_POST['hdnParentID'], ARRAY_N);72 $parentsParent = $wpdb->get_row($wpdb->prepare("SELECT parent FROM $wpdb->term_taxonomy WHERE term_id = %d ", $_POST['hdnParentID']) , ARRAY_N); 73 73 $parentID = $parentsParent[0]; 74 74 } 75 75 76 if(isset($_GET['hideNote']))77 update_option('mycategoryorder_hideNote', '1');78 79 76 $success = ""; 80 77 if (isset($_POST['btnOrderCats'])) { … … 89 86 <h2><?php _e('My Category Order','mycategoryorder'); ?></h2> 90 87 <?php 91 92 echo $success; 93 94 if (get_option("mycategoryorder_hideNote") != "1") 95 { ?> 96 <div class="updated"> 97 <strong><p><?php _e('If you like my plugin please consider donating. Every little bit helps me provide support and continue development.','mycategoryorder'); ?> <a href="http://geekyweekly.com/gifts-and-donations"><?php _e('Donate', 'mycategoryorder'); ?></a> <small><a href="<?php echo mycategoryorder_getTarget(); ?>&hideNote=true"><?php _e('No thanks, hide this', 'mycategoryorder'); ?></a></small></p></strong> 98 </div> 99 <?php 100 }?> 88 echo $success; 89 ?> 101 90 102 91 <p><?php _e('Choose a category from the drop down to order subcategories in that category or order the categories on this level by dragging and dropping them into the desired order.','mycategoryorder'); ?></p> … … 201 190 202 191 $subCatStr = ""; 203 $results=$wpdb->get_results( "SELECT t.term_id, t.name FROM $wpdb->term_taxonomy tt, $wpdb->terms t, $wpdb->term_taxonomy tt2 WHERE tt.parent = $parentID AND tt.taxonomy = 'category' AND t.term_id = tt.term_id AND tt2.parent = tt.term_id GROUP BY t.term_id, t.name HAVING COUNT(*) > 0 ORDER BY t.term_order ASC");192 $results=$wpdb->get_results($wpdb->prepare("SELECT t.term_id, t.name FROM $wpdb->term_taxonomy tt, $wpdb->terms t, $wpdb->term_taxonomy tt2 WHERE tt.parent = %d AND tt.taxonomy = 'category' AND t.term_id = tt.term_id AND tt2.parent = tt.term_id GROUP BY t.term_id, t.name HAVING COUNT(*) > 0 ORDER BY t.term_order ASC", $parentID)); 204 193 foreach($results as $row) 205 194 { … … 222 211 { 223 212 $str = str_replace("id_", "", $IDs[$i]); 224 $wpdb->query( "UPDATE $wpdb->terms SET term_order = '$i' WHERE term_id ='$str'");213 $wpdb->query($wpdb->prepare("UPDATE $wpdb->terms SET term_order = %d WHERE term_id = %d ", $i, $str)); 225 214 } 226 215 … … 234 223 { 235 224 global $wpdb; 236 return $wpdb->get_results( "SELECT * FROM $wpdb->terms t inner join $wpdb->term_taxonomy tt on t.term_id = tt.term_id WHERE taxonomy = 'category' and parent = $parentID ORDER BY term_order ASC");225 return $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->terms t inner join $wpdb->term_taxonomy tt on t.term_id = tt.term_id WHERE taxonomy = 'category' and parent = %d ORDER BY term_order ASC", $parentID)); 237 226 } 238 227 -
my-category-order/trunk/readme.txt
r519198 r534578 4 4 Tags: categories, category, 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 Category Order allows you to set the order in which categories will appear in the sidebar.
Note: See TracChangeset
for help on using the changeset viewer.