pageManagement [WP_Admin > Manage > pageMash] Author: Joel Starnes Version: 1.1.6 Author URI: http://joelstarnes.co.uk/ */ #########CONFIG OPTIONS############################################ $minlevel = 7; /*[deafult=7]*/ /* Minimum user level to access page order */ $excludePagesFeature = true; /*[deafult=true]*/ /* Allows you to set pages not to be listed */ $renamePagesFeature = true; /*[deafult=true]*/ /* Lets you rename pages */ $CollapsePagesOnLoad = false; /*[deafult=true]*/ /* Collapse all parent pages on load */ $ShowDegubInfo = false; /*[deafult=false]*/ /* Show server response debug info */ ################################################################### /* INSPIRATIONS/CREDITS: Valerio Proietti - Mootools JS Framework [http://mootools.net/] Stefan Lange-Hegermann - Mootools AJAX timeout class extension [http://www.blackmac.de/archives/44-Mootools-AJAX-timeout.html] vladimir - Mootools Sortables class extension [http://vladimir.akilles.cl/scripts/sortables/] ShiftThis - WP Page Order Plugin [http://www.shiftthis.net/wordpress-order-pages-plugin/] Garrett Murphey - Page Link Manager [http://gmurphey.com/2006/10/05/wordpress-plugin-page-link-manager/] */ /* Copyright 2008 Joel Starnes (email : joel@joelstarnes.co.uk) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ // Pre-2.6 compatibility if ( !defined('WP_CONTENT_URL') ) define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); if ( !defined('WP_CONTENT_DIR') ) define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // Guess the location $codeWord_path = WP_CONTENT_DIR.'/plugins/'.plugin_basename(dirname(__FILE__)); $pageMash_url = WP_CONTENT_URL.'/plugins/'.plugin_basename(dirname(__FILE__)); function pageMash_getPages($post_parent){ //this is a recurrsive function which calls itself to produce a nested list of elements //$post_parent should be 0 for root pages, or contain a pageID to return it's sub-pages global $wpdb, $wp_version, $excludePagesFeature, $excludePagesList, $renamePagesFeature; if($wp_version >= 2.1){ //get pages from database $pageposts = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_type = 'page' AND post_parent = '$post_parent' ORDER BY menu_order"); }else{ $pageposts = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_status = 'static' AND post_parent = '$post_parent' ORDER BY menu_order"); } if ($pageposts == true){ //if $pageposts == true then it does have sub-page(s), so list them. echo (0 === $post_parent) ? '