diff --git a/README.txt b/README.txt index 1aafab8..e5dded4 100644 --- a/README.txt +++ b/README.txt @@ -3,7 +3,7 @@ Contributors: JoelStarnes Tags: order pages, ajax, re-order, drag-and-drop, admin, Requires at least: 2.0 Tested up to: 2.4-bleeding -Stable tag: 0.1.2 +Stable tag: 0.1.3 Organise your page order with this simple drag-and-drop Ajax interface. @@ -20,14 +20,14 @@ If you want to see an example of the admin page check out: http://joelstarnes.co 1. Activate in 'Plugins' admin menu 1. {Edit your Template} -In most cases the plugin should work straight out the box, since most templates will include something similar to: `wp_list_pages('depth=1&title_li=);` +In most cases the plugin should work straight out the box, since most templates will include something similar to: `wp_list_pages('title_li=

Pages

);` However to achieve full functionality including the 'exclude pages' feature you should replace the wp_list_pages() function with the following php code: `if(function_exists('pageMash_exclude_pages'))` `{$exclude_pages=pageMash_exclude_pages();} else{$exclude_pages='';}` - `wp_list_pages('depth=1&title_li=&exclude='.$exclude_pages);` + `wp_list_pages('title_li=

Pages

&exclude='.$exclude_pages);` You can place the code wherever you would like your page listings to appear; @@ -65,6 +65,8 @@ The plugin will currently only handle top level pages. 0.1.2 > Fixed CSS&JS headers to only display on pageMash admin +0.1.3 > Fixed exclude pages feature + ==Road Map== diff --git a/pagemash.php b/pagemash.php index 951d6dd..86b32d7 100644 --- a/pagemash.php +++ b/pagemash.php @@ -4,14 +4,15 @@ Plugin Name: pageMash Plugin URI: http://joelstarnes.co.uk/pagemash/ Description: pageMash > pageManagement [WP_Admin > Manage > pageMash] Author: Joel Starnes -Version: 0.1.2 +Version: 0.1.3 Author URI: http://joelstarnes.co.uk/ CHANGELOG: Release: Date: Description: 0.1.0 10 Feb 2008 Initial release -0.1.1 12 Feb 2008 Minor fixes > Removed external include -0.1.2 15 Feb 2008 Minor fixes > Fixed CSS&JS headers to only display on pagemash +0.1.1 12 Feb 2008 Fixed Removed external include +0.1.2 15 Feb 2008 Fixed CSS&JS headers to only display on pagemash +0.1.3 19 Feb 2008 Fixed exclude pages feature */ #########CONFIG OPTIONS############################################ @@ -61,16 +62,25 @@ function pageMash_main(){ }else{ $pageposts = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_status = 'static' AND post_parent = '0' ORDER BY menu_order"); } - - //get pages-to-hide from option function - $excludePagesList = '>, '.get_option('exclude_pages'); - //precede with '>, ' otherwise the first pageid will return 0 when strpos() is called to find it. - //the initial coma allows us to search for ', $pageid,' so as to avoid partial matches + + //get pages set to exclude + $excludePagesList = get_option('exclude_pages'); + switch($excludePagesList) { + case null: + //adds exclude_pages row to options DB. @FIXME runs when the value exists but equals '' + add_option("exclude_pages", '', 'Pages to not show in menu.', 'yes'); + break; + default: + //precede with '>,' otherwise the first pageid will return 0 when strpos() is called to find it. + //the initial coma allows us to search for ',$pageid,' so as to avoid partial matches + $excludePagesList = '>,'.$excludePagesList; + break; + } ?>
- version [0.1.2] + version [0.1.3]

pageMash - pageManagement

You can use this to organise and manage your pages.

@@ -78,7 +88,7 @@ function pageMash_main(){
@@ -240,7 +250,7 @@ function updateOrder (serial) { var excludePages = ""; $$('#pageMash_pages li.remove').each(function(el){ - excludePages += el.getProperty('id') + ', '; + excludePages += el.getProperty('id') + ','; });