>0.1.2 release
git-svn-id: https://plugins.svn.wordpress.org/pagemash/trunk@31950 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
parent
ce4909acc6
commit
d5062e797a
|
@ -3,7 +3,7 @@ Contributors: JoelStarnes
|
||||||
Tags: order pages, ajax, re-order, drag-and-drop, admin,
|
Tags: order pages, ajax, re-order, drag-and-drop, admin,
|
||||||
Requires at least: 2.0
|
Requires at least: 2.0
|
||||||
Tested up to: 2.4-bleeding
|
Tested up to: 2.4-bleeding
|
||||||
Stable tag: 0.1.1
|
Stable tag: 0.1.2
|
||||||
|
|
||||||
Organise your page order with this simple drag-and-drop Ajax interface.
|
Organise your page order with this simple drag-and-drop Ajax interface.
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ If you want to see an example of the admin page check out: http://joelstarnes.co
|
||||||
|
|
||||||
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('depth=1&title_li=);`
|
||||||
|
|
||||||
|
|
||||||
However to achieve full functionality including the 'exclude pages' feature you should replace the wp_list_pages() function with the following php code:
|
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'))`
|
`if(function_exists('pageMash_exclude_pages'))`
|
||||||
|
@ -35,6 +36,7 @@ usually either the header.php or sidebar.php file found in: `wp-content\themes\t
|
||||||
== Frequently Asked Questions ==
|
== Frequently Asked Questions ==
|
||||||
|
|
||||||
If you have any questions or comments,
|
If you have any questions or comments,
|
||||||
|
|
||||||
please drop me an email: joel@joelstarnes.co.uk
|
please drop me an email: joel@joelstarnes.co.uk
|
||||||
|
|
||||||
== Screenshots ==
|
== Screenshots ==
|
||||||
|
@ -52,8 +54,12 @@ The plugin will currently only handle top level pages.
|
||||||
==Change Log==
|
==Change Log==
|
||||||
|
|
||||||
0.1.0 > Initial Release
|
0.1.0 > Initial Release
|
||||||
|
|
||||||
0.1.1 > Removed version check [line72] since some hosts will not allow external includes.
|
0.1.1 > Removed version check [line72] since some hosts will not allow external includes.
|
||||||
|
|
||||||
|
0.1.2 > Fixed CSS&JS headers to only display on pageMash admin
|
||||||
|
|
||||||
|
|
||||||
==Road Map==
|
==Road Map==
|
||||||
|
|
||||||
For the next majour release I hope to support children pages and allow these to be sorted and moved between different parents in a nested list fashion.
|
For the next majour release I hope to support children pages and allow these to be sorted and moved between different parents in a nested list fashion.
|
37
pagemash.php
37
pagemash.php
|
@ -61,9 +61,8 @@ function pageMash_main(){
|
||||||
$pageposts = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_status = 'static' AND post_parent = '0' ORDER BY menu_order");
|
$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 database
|
//get pages-to-hide from option function
|
||||||
$excludePagesObj = $wpdb->get_results("SELECT option_value FROM $wpdb->options WHERE option_name = 'exclude_pages'");
|
$excludePagesList = '>, '.get_option('exclude_pages');
|
||||||
$excludePagesList = '>, '.$excludePagesObj[0]->option_value;
|
|
||||||
//precede with '>, ' otherwise the first pageid will return 0 when strpos() is called to find it.
|
//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
|
//the initial coma allows us to search for ', $pageid,' so as to avoid partial matches
|
||||||
?>
|
?>
|
||||||
|
@ -73,14 +72,14 @@ function pageMash_main(){
|
||||||
version [0.1.1]
|
version [0.1.1]
|
||||||
</div>
|
</div>
|
||||||
<h2 style="margin-bottom:0; clear:none;">pageMash - pageManagement</h2>
|
<h2 style="margin-bottom:0; clear:none;">pageMash - pageManagement</h2>
|
||||||
<p style="margin-top:4px;">You can use this to organise and manage your pages.</p>
|
<p style="margin-top:4px;">You can use this to organise and manage your pages. </p>
|
||||||
|
|
||||||
<ul id="pageMash_pages" style="list-style:none;">
|
<ul id="pageMash_pages" style="list-style:none;">
|
||||||
|
|
||||||
<?php foreach ($pageposts as $page): //list pages ?>
|
<?php foreach ($pageposts as $page): //list pages ?>
|
||||||
<li id="<?=$page->ID;?>" <?php if(strpos($excludePagesList, ', '.$page->ID.',')){echo 'class="remove"';}//if page is in exclude list, add class remove ?>>
|
<li id="<?=$page->ID;?>" <?php if(strpos($excludePagesList, ', '.$page->ID.',')){echo 'class="remove"';}//if page is in exclude list, add class remove ?>>
|
||||||
<strong><?=$page->post_title;?></strong>
|
<strong><?=$page->post_title;?></strong>
|
||||||
[<a href="<?=get_settings('siteurl').'/wp-admin/post.php?action=edit&post='.$page->ID; ?>" title="Edit This Page">edit</a>]
|
[<a href="<?=get_option('siteurl').'/wp-admin/post.php?action=edit&post='.$page->ID; ?>" title="Edit This Page">edit</a>]
|
||||||
</li>
|
</li>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|
||||||
|
@ -105,7 +104,7 @@ function pageMash_main(){
|
||||||
<small><strong>Note:</strong> This plugin only orders top level pages</small>
|
<small><strong>Note:</strong> This plugin only orders top level pages</small>
|
||||||
</p>
|
</p>
|
||||||
<p style="margin-bottom:1px;">To use this plugin you need to use the <strong>wp_list_pages()</strong> function with the parameters as shown below:</p>
|
<p style="margin-bottom:1px;">To use this plugin you need to use the <strong>wp_list_pages()</strong> function with the parameters as shown below:</p>
|
||||||
<code>
|
<code id="pageMash_code">
|
||||||
<span class="white"><?php</span> <span class="purple">if(</span><span class="blue">function_exists(</span><span class="orange">'pageMash_exclude_pages'</span><span class="blue">)</span><span class="purple">){</span><span class="yellow">$exclude_pages</span><span class="white">=</span><span class="blue">pageMash_exclude_pages();</span><span class="purple">} else{</span><span class="yellow">$exclude_pages</span><span class="white">=</span><span class="orange">''</span><span class="blue">;</span><span class="purple">}</span><span class="white">?></span><br />
|
<span class="white"><?php</span> <span class="purple">if(</span><span class="blue">function_exists(</span><span class="orange">'pageMash_exclude_pages'</span><span class="blue">)</span><span class="purple">){</span><span class="yellow">$exclude_pages</span><span class="white">=</span><span class="blue">pageMash_exclude_pages();</span><span class="purple">} else{</span><span class="yellow">$exclude_pages</span><span class="white">=</span><span class="orange">''</span><span class="blue">;</span><span class="purple">}</span><span class="white">?></span><br />
|
||||||
<span class="white"><?php</span> <span class="blue">wp_list_pages(</span><span class="orange">'depth=1&title_li=&exclude='</span><span class="green">.</span><span class="yellow">$exclude_pages</span><span class="blue">);</span><span class="white">?></span>
|
<span class="white"><?php</span> <span class="blue">wp_list_pages(</span><span class="orange">'depth=1&title_li=&exclude='</span><span class="green">.</span><span class="yellow">$exclude_pages</span><span class="blue">);</span><span class="white">?></span>
|
||||||
</code>
|
</code>
|
||||||
|
@ -114,7 +113,10 @@ function pageMash_main(){
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function pageMash_head(){
|
function pageMash_head(){
|
||||||
|
if(strrpos('>'.$_GET["page"], 'pagemash')){ // only include header stuff on pagemash admin page
|
||||||
//stylesheet & javascript to go in page header
|
//stylesheet & javascript to go in page header
|
||||||
global $instantUpdateFeature, $excludePagesFeature;
|
global $instantUpdateFeature, $excludePagesFeature;
|
||||||
?>
|
?>
|
||||||
|
@ -126,15 +128,15 @@ function pageMash_head(){
|
||||||
ul#pageMash_pages li.remove a { color:grey; }
|
ul#pageMash_pages li.remove a { color:grey; }
|
||||||
ul#pageMash_pages li.remove img { opacity:0.2; }
|
ul#pageMash_pages li.remove img { opacity:0.2; }
|
||||||
|
|
||||||
code {display:block; border:solid 3px #858EF4; background-color:#211E1E; padding:7px; margin=10px;}
|
#pageMash_code {display:block; border:solid 3px #858EF4; background-color:#211E1E; padding:7px; margin=10px;}
|
||||||
code .white{color:#DADADA;}
|
#pageMash_code .white{color:#DADADA;}
|
||||||
code .purple{color:#9B2E4D; font-weight:bold;}
|
#pageMash_code .purple{color:#9B2E4D; font-weight:bold;}
|
||||||
code .green{color:#00FF00;}
|
#pageMash_code .green{color:#00FF00;}
|
||||||
code .blue{color:#858EF4;}
|
#pageMash_code .blue{color:#858EF4;}
|
||||||
code .yellow{color:#C1C144;}
|
#pageMash_code .yellow{color:#C1C144;}
|
||||||
code .orange{color:#EC9E00;}
|
#pageMash_code .orange{color:#EC9E00;}
|
||||||
</style>
|
</style>
|
||||||
<script type="text/javascript" src="<?=get_settings('siteurl')?>/wp-content/plugins/pagemash/mootools-1.11.js"></script>
|
<script type="text/javascript" src="<?=get_option('siteurl')?>/wp-content/plugins/pagemash/mootools-1.11.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
/* Moo extenders */
|
/* Moo extenders */
|
||||||
|
@ -241,7 +243,7 @@ function updateOrder (serial) {
|
||||||
});
|
});
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
new Ajax('<?=get_settings('siteurl')?>/wp-content/plugins/pagemash/reorder.php?order='+serial+'&exclude='+excludePages, {
|
new Ajax('<?=get_option('siteurl')?>/wp-content/plugins/pagemash/reorder.php?order='+serial+'&exclude='+excludePages, {
|
||||||
method: 'get',
|
method: 'get',
|
||||||
onComplete: function() {
|
onComplete: function() {
|
||||||
$('update_status').setText('Database Updated');
|
$('update_status').setText('Database Updated');
|
||||||
|
@ -258,7 +260,7 @@ function updateOrder (serial) {
|
||||||
}
|
}
|
||||||
<?php if($excludePagesFeature): ?>
|
<?php if($excludePagesFeature): ?>
|
||||||
var DeleteButton = function(el) {
|
var DeleteButton = function(el) {
|
||||||
new Element('img').setProperties({src: '<?=get_settings("siteurl")?>/wp-content/plugins/pagemash/hide.png', alt: 'show|hide'}).addEvent('click', toggleRemove).injectTop(el);
|
new Element('img').setProperties({src: '<?=get_option("siteurl")?>/wp-content/plugins/pagemash/hide.png', alt: 'show|hide'}).addEvent('click', toggleRemove).injectTop(el);
|
||||||
}
|
}
|
||||||
var toggleRemove = function() {
|
var toggleRemove = function() {
|
||||||
this.parentNode.toggleClass('remove');
|
this.parentNode.toggleClass('remove');
|
||||||
|
@ -266,7 +268,8 @@ function updateOrder (serial) {
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
}
|
} //end main if
|
||||||
|
} //end function
|
||||||
|
|
||||||
|
|
||||||
function pageMash_add_pages(){
|
function pageMash_add_pages(){
|
||||||
|
|
Loading…
Reference in New Issue