cnahged exclude_pages DB update format

git-svn-id: https://plugins.svn.wordpress.org/pagemash/trunk@32266 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
jmash 2008-02-19 16:48:23 +00:00
parent cb1b76bda4
commit 9c45a18655
2 changed files with 5 additions and 16 deletions

View File

@ -4,7 +4,7 @@ Plugin Name: pageMash
Plugin URI: http://joelstarnes.co.uk/pagemash/ Plugin URI: http://joelstarnes.co.uk/pagemash/
Description: pageMash > pageManagement [WP_Admin > Manage > pageMash] Description: pageMash > pageManagement [WP_Admin > Manage > pageMash]
Author: Joel Starnes Author: Joel Starnes
Version: 0.1.3 Version: 0.1.2
Author URI: http://joelstarnes.co.uk/ Author URI: http://joelstarnes.co.uk/
CHANGELOG: CHANGELOG:
@ -64,18 +64,9 @@ function pageMash_main(){
} }
//get pages set to exclude //get pages set to exclude
$excludePagesList = get_option('exclude_pages'); $excludePagesList = '>,'.get_option('exclude_pages');
switch($excludePagesList) { //precede with '>,' otherwise the first pageid will return 0 when strpos() is called to find it.
case null: //the initial coma allows us to search for ',$pageid,' so as to avoid partial matches
//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;
}
?> ?>
<div id="pageMash" class="wrap"> <div id="pageMash" class="wrap">

View File

@ -9,9 +9,7 @@ foreach ($order as $pageid):
$position += 1; //increment position var $position += 1; //increment position var
endforeach; endforeach;
$exclude = $_GET['exclude']; update_option("exclude_pages", $value = $_GET['exclude'];, $description = 'PageMash: Pages to not show in menu.', $autoload = 'yes');
$postquery = "UPDATE $wpdb->options SET option_value='$exclude' WHERE option_name='exclude_pages'"; //setup db query
$wpdb->query($postquery); //update pages in db
echo "pagemashed"; echo "pagemashed";
?> ?>