# HG changeset patch # User Anthony Ly # Date 1355948374 28800 # Node ID 83193a9a9b4eec085146d3806518941db51325c5 # Parent 9db125e8f1e08c1f9bb010a07cecce5a735a55b2 ajout de order post type plugin pour définir l'ordre des slides diff -r 9db125e8f1e0 -r 83193a9a9b4e web/wp-content/plugins/pik-slider/pik-slider.php --- a/web/wp-content/plugins/pik-slider/pik-slider.php Tue Dec 18 17:47:31 2012 -0800 +++ b/web/wp-content/plugins/pik-slider/pik-slider.php Wed Dec 19 12:19:34 2012 -0800 @@ -123,7 +123,6 @@
'; + + update_option('cpto_options', $options); + update_option('CPT_configured', 'TRUE'); + + } + + $queue_data = get_option('ce_queue'); + + ?> +
+
+

+ + + +
+
+

+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + +

+ +
+ +
+ +

+ +

+ + + + +
+ +
+ + '; + + + } + +?> \ No newline at end of file diff -r 9db125e8f1e0 -r 83193a9a9b4e web/wp-content/plugins/post-types-order/lang/cpt-pt_BR.mo Binary file web/wp-content/plugins/post-types-order/lang/cpt-pt_BR.mo has changed diff -r 9db125e8f1e0 -r 83193a9a9b4e web/wp-content/plugins/post-types-order/lang/cpt-pt_BR.po --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/wp-content/plugins/post-types-order/lang/cpt-pt_BR.po Wed Dec 19 12:19:34 2012 -0800 @@ -0,0 +1,98 @@ +msgid "" +msgstr "" +"Project-Id-Version: Post Types Order\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-11-29 09:26-0300\n" +"PO-Revision-Date: 2012-12-07 14:22+0200\n" +"Last-Translator: Gabriel Reguly \n" +"Language-Team: http://ppgr.com.br/\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-KeywordsList: __;_e\n" +"X-Poedit-Basepath: .\n" +"Language: pt_BR\n" +"X-Generator: Poedit 1.5.3\n" +"X-Poedit-SearchPath-0: post-types-order\n" + +#: post-types-order/post-types-order.php:41 +msgid "Post Types Order" +msgstr "Ordenar Posts" + +#: post-types-order/post-types-order.php:176 +msgid "Invalid post type" +msgstr "Type de post inválido" + +#: post-types-order/post-types-order.php:216 +#: post-types-order/post-types-order.php:218 +msgid "Re-Order" +msgstr "Reordenar" + +#: post-types-order/post-types-order.php:229 +#, php-format +msgid "%s - Re-order " +msgstr "Reordenar %s" + +#: post-types-order/post-types-order.php:233 +msgid "" +"This plugin can't work without javascript, because it use drag and drop and " +"AJAX." +msgstr "Este plugin precisa de JavaScript para funcionar." + +#: post-types-order/post-types-order.php:242 +msgid "Update" +msgstr "Atualizar" + +#: post-types-order/post-types-order.php:257 +msgid "Item order updated" +msgstr "Ordem alterada" + +#: post-types-order/post-types-order.php:263 +msgid "" +"Did you found this plug-in useful? Please support our work with a donation." +msgstr "" +"Você considera útil este plugin? Por favor, faça uma doação para o autor." + +#: post-types-order/post-types-order.php:283 +msgid "Pages" +msgstr "Páginas" + +#: post-types-order/include/options.php:6 +msgid "Settings Saved" +msgstr "Configuração salva" + +#: post-types-order/include/options.php:13 +msgid "General Setings" +msgstr "Configuração geral" + +#: post-types-order/include/options.php:16 +msgid "General" +msgstr "Geral" + +#: post-types-order/include/options.php:21 +msgid "Minimum Level to use this plugin" +msgstr "Nível minimo para utilizar este plugin" + +#: post-types-order/include/options.php:25 +msgid "Subscriber" +msgstr "Assinante" + +#: post-types-order/include/options.php:26 +msgid "Contributor" +msgstr "Contribuidor" + +#: post-types-order/include/options.php:27 +msgid "Author" +msgstr "Author" + +#: post-types-order/include/options.php:28 +msgid "Editor" +msgstr "Editor" + +#: post-types-order/include/options.php:29 +msgid "Administrator" +msgstr "Administrador" + +#: post-types-order/include/options.php:36 +msgid "Save Settings" +msgstr "Salvar configuração" diff -r 9db125e8f1e0 -r 83193a9a9b4e web/wp-content/plugins/post-types-order/lang/cpt-ro_RO.mo Binary file web/wp-content/plugins/post-types-order/lang/cpt-ro_RO.mo has changed diff -r 9db125e8f1e0 -r 83193a9a9b4e web/wp-content/plugins/post-types-order/lang/cpt-ro_RO.po --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/wp-content/plugins/post-types-order/lang/cpt-ro_RO.po Wed Dec 19 12:19:34 2012 -0800 @@ -0,0 +1,101 @@ +msgid "" +msgstr "" +"Project-Id-Version: Post Types Order\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-11-29 09:26-0300\n" +"PO-Revision-Date: 2012-12-07 14:34+0200\n" +"Last-Translator: Gabriel Reguly \n" +"Language-Team: http://ppgr.com.br/\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-KeywordsList: __;_e\n" +"X-Poedit-Basepath: .\n" +"Language: pt_BR\n" +"X-Generator: Poedit 1.5.3\n" +"X-Poedit-SearchPath-0: post-types-order\n" + +#: post-types-order/post-types-order.php:41 +msgid "Post Types Order" +msgstr "Post Types Order" + +#: post-types-order/post-types-order.php:176 +msgid "Invalid post type" +msgstr "Post Type Invalid" + +#: post-types-order/post-types-order.php:216 +#: post-types-order/post-types-order.php:218 +msgid "Re-Order" +msgstr "Re-Order" + +#: post-types-order/post-types-order.php:229 +#, php-format +msgid "%s - Re-order " +msgstr "Reordenar %s" + +#: post-types-order/post-types-order.php:233 +msgid "" +"This plugin can't work without javascript, because it use drag and drop and " +"AJAX." +msgstr "" +"Acest plugin nu poate functiona fara JavaScript pentru ca foloseste o " +"capabilitate AJAX" + +#: post-types-order/post-types-order.php:242 +msgid "Update" +msgstr "Actualizare" + +#: post-types-order/post-types-order.php:257 +msgid "Item order updated" +msgstr "Ordonare salvata" + +#: post-types-order/post-types-order.php:263 +msgid "" +"Did you found this plug-in useful? Please support our work with a donation." +msgstr "" +"Ai gasit acest plugin folositor? The rog ajuta exhipa sa dezvolte softul in " +"continuare printr-o donatie" + +#: post-types-order/post-types-order.php:283 +msgid "Pages" +msgstr "Pagini" + +#: post-types-order/include/options.php:6 +msgid "Settings Saved" +msgstr "Setari Salvate" + +#: post-types-order/include/options.php:13 +msgid "General Setings" +msgstr "Setari Generale" + +#: post-types-order/include/options.php:16 +msgid "General" +msgstr "Geral" + +#: post-types-order/include/options.php:21 +msgid "Minimum Level to use this plugin" +msgstr "Niveulul minim pentru a utiliza Re-order" + +#: post-types-order/include/options.php:25 +msgid "Subscriber" +msgstr "Subscriber" + +#: post-types-order/include/options.php:26 +msgid "Contributor" +msgstr "Contributor" + +#: post-types-order/include/options.php:27 +msgid "Author" +msgstr "Author" + +#: post-types-order/include/options.php:28 +msgid "Editor" +msgstr "Editor" + +#: post-types-order/include/options.php:29 +msgid "Administrator" +msgstr "Administrator" + +#: post-types-order/include/options.php:36 +msgid "Save Settings" +msgstr "Salveaza" diff -r 9db125e8f1e0 -r 83193a9a9b4e web/wp-content/plugins/post-types-order/lang/cpt.mo Binary file web/wp-content/plugins/post-types-order/lang/cpt.mo has changed diff -r 9db125e8f1e0 -r 83193a9a9b4e web/wp-content/plugins/post-types-order/lang/cpt.po --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/wp-content/plugins/post-types-order/lang/cpt.po Wed Dec 19 12:19:34 2012 -0800 @@ -0,0 +1,143 @@ +msgid "" +msgstr "" +"Project-Id-Version: Post Types Order\n" +"POT-Creation-Date: 2012-12-07 16:41+0200\n" +"PO-Revision-Date: 2012-12-07 16:41+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.5.3\n" +"X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n" +"X-Poedit-Basepath: ../\n" +"X-Poedit-SearchPath-0: .\n" + +#: post-types-order.php:107 +msgid "Post Types Order must be configured. Please go to" +msgstr "" + +#: post-types-order.php:107 +msgid "Settings Page" +msgstr "" + +#: post-types-order.php:107 +msgid "make the configuration and save" +msgstr "" + +#: post-types-order.php:468 +msgid "" +"This plugin can't work without javascript, because it's use drag and drop " +"and AJAX." +msgstr "" + +#: post-types-order.php:497 +msgid "Items Order Updated" +msgstr "" + +#: post-types-order.php:514 +msgid "Pages" +msgstr "" + +#: include/functions.php:65 +msgid "" +"Did you find this plugin useful? Please support our work with a donation or " +"write an article about this plugin in your blog with a link to our site" +msgstr "" + +#: include/functions.php:66 +msgid "Did you know there is available an Advanced version of this plug-in?" +msgstr "" + +#: include/functions.php:66 +msgid "Read more" +msgstr "" + +#: include/functions.php:67 +msgid "Check our" +msgstr "" + +#: include/functions.php:67 +msgid "" +"plugin which allow to custom sort categories and custom taxonomies terms" +msgstr "" + +#: include/options.php:16 +msgid "Settings Saved" +msgstr "" + +#: include/options.php:28 +msgid "General Settings" +msgstr "" + +#: include/options.php:34 +msgid "General" +msgstr "" + +#: include/options.php:39 +msgid "Minimum Level to use this plugin" +msgstr "" + +#: include/options.php:42 +msgid "Subscriber" +msgstr "" + +#: include/options.php:43 +msgid "Contributor" +msgstr "" + +#: include/options.php:44 +msgid "Author" +msgstr "" + +#: include/options.php:45 +msgid "Editor" +msgstr "" + +#: include/options.php:46 +msgid "Administrator" +msgstr "" + +#: include/options.php:52 +msgid "Auto Sort" +msgstr "" + +#: include/options.php:56 +msgid "" +"If checked, the plug-in will automatically update the wp-queries to use the " +"new order (No code update is necessarily).
If you need more " +"order customizations you will need to uncheck this and include 'menu_order' " +"into your theme queries" +msgstr "" + +#: include/options.php:58 +msgid "Show Examples" +msgstr "" + +#: include/options.php:61 +msgid "The following PHP code will still return the post in the set-up Order" +msgstr "" + +#: include/options.php:74 +msgid "Or" +msgstr "" + +#: include/options.php:83 +msgid "" +"If the Auto Sort is uncheck you will need to use the \"orderby\" and \"order" +"\" parameters" +msgstr "" + +#: include/options.php:98 +msgid "Admin Sort" +msgstr "" + +#: include/options.php:102 +msgid "" +"To affect the admin interface, to see the post types per your new sort, this " +"need to be checked" +msgstr "" + +#: include/options.php:111 +msgid "Save Settings" +msgstr "" diff -r 9db125e8f1e0 -r 83193a9a9b4e web/wp-content/plugins/post-types-order/post-types-order.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/wp-content/plugins/post-types-order/post-types-order.php Wed Dec 19 12:19:34 2012 -0800 @@ -0,0 +1,572 @@ +query['suppress_filters'])) + $query->query['suppress_filters'] = FALSE; + + + if (isset($query->query_vars['suppress_filters'])) + $query->query_vars['suppress_filters'] = FALSE; + + } + + return $query; + } + +add_filter('posts_orderby', 'CPTOrderPosts', 99, 2); +function CPTOrderPosts($orderBy, $query) + { + global $wpdb; + + $options = get_option('cpto_options'); + + //ignore the bbpress + if (isset($query->query_vars['post_type']) && ((is_array($query->query_vars['post_type']) && in_array("reply", $query->query_vars['post_type'])) || ($query->query_vars['post_type'] == "reply"))) + return $orderBy; + if (isset($query->query_vars['post_type']) && ((is_array($query->query_vars['post_type']) && in_array("topic", $query->query_vars['post_type'])) || ($query->query_vars['post_type'] == "topic"))) + return $orderBy; + + if (is_admin()) + { + if ($options['adminsort'] == "1") + $orderBy = "{$wpdb->posts}.menu_order, {$wpdb->posts}.post_date DESC"; + } + else + { + if ($options['autosort'] == "1") + $orderBy = "{$wpdb->posts}.menu_order, " . $orderBy; + } + + return($orderBy); + } + +$is_configured = get_option('CPT_configured'); +if ($is_configured == '') + add_action( 'admin_notices', 'CPTO_admin_notices'); + +function CPTO_admin_notices() + { + if (isset($_POST['form_submit'])) + return; + ?> +
+

+
+ Post Types Order', 'manage_options', 'cpto-options', 'cpt_plugin_options'); + } + + +add_action('wp_loaded', 'initCPTO' ); +function initCPTO() + { + global $custom_post_type_order, $userdata; + + $options = get_option('cpto_options'); + + if (is_admin()) + { + if(isset($options['capability']) && !empty($options['capability'])) + { + if(current_user_can($options['capability'])) + $custom_post_type_order = new CPTO(); + } + else if (is_numeric($options['level'])) + { + if (userdata_get_user_level(true) >= $options['level']) + $custom_post_type_order = new CPTO(); + } + else + { + $custom_post_type_order = new CPTO(); + } + } + } + +add_filter('get_previous_post_where', 'cpto_get_previous_post_where'); +add_filter('get_previous_post_sort', 'cpto_get_previous_post_sort'); +add_filter('get_next_post_where', 'cpto_get_next_post_where'); +add_filter('get_next_post_sort', 'cpto_get_next_post_sort'); +function cpto_get_previous_post_where($where) + { + global $post, $wpdb; + + if ( empty( $post ) ) + return $where; + + $current_post_date = $post->post_date; + + $join = ''; + $posts_in_ex_cats_sql = ''; + if (isset($in_same_cat)) + if ( $in_same_cat || !empty($excluded_categories) ) + { + $join = " INNER JOIN $wpdb->term_relationships AS tr ON p.ID = tr.object_id INNER JOIN $wpdb->term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id"; + + if ( $in_same_cat ) { + $cat_array = wp_get_object_terms($post->ID, 'category', array('fields' => 'ids')); + $join .= " AND tt.taxonomy = 'category' AND tt.term_id IN (" . implode(',', $cat_array) . ")"; + } + + $posts_in_ex_cats_sql = "AND tt.taxonomy = 'category'"; + if ( !empty($excluded_categories) ) { + $excluded_categories = array_map('intval', explode(' and ', $excluded_categories)); + if ( !empty($cat_array) ) { + $excluded_categories = array_diff($excluded_categories, $cat_array); + $posts_in_ex_cats_sql = ''; + } + + if ( !empty($excluded_categories) ) { + $posts_in_ex_cats_sql = " AND tt.taxonomy = 'category' AND tt.term_id NOT IN (" . implode($excluded_categories, ',') . ')'; + } + } + } + $current_menu_order = $post->menu_order; + + //check if there are more posts with lower menu_order + $query = "SELECT p.* FROM $wpdb->posts AS p + WHERE p.menu_order < '".$current_menu_order."' AND p.post_type = '". $post->post_type ."' AND p.post_status = 'publish' $posts_in_ex_cats_sql"; + $results = $wpdb->get_results($query); + + if (count($results) > 0) + { + $where = "WHERE p.menu_order < '".$current_menu_order."' AND p.post_type = '". $post->post_type ."' AND p.post_status = 'publish' $posts_in_ex_cats_sql"; + } + else + { + $where = "WHERE p.post_date < '".$current_post_date."' AND p.post_type = '". $post->post_type ."' AND p.post_status = 'publish' AND p.ID != '". $post->ID ."' $posts_in_ex_cats_sql"; + } + + return $where; + } + +function cpto_get_previous_post_sort($sort) + { + global $post, $wpdb; + $posts_in_ex_cats_sql = ''; + + $current_menu_order = $post->menu_order; + + $query = "SELECT p.* FROM $wpdb->posts AS p + WHERE p.menu_order < '".$current_menu_order."' AND p.post_type = '". $post->post_type ."' AND p.post_status = 'publish' $posts_in_ex_cats_sql"; + $results = $wpdb->get_results($query); + + if (count($results) > 0) + { + $sort = 'ORDER BY p.menu_order DESC, p.post_date ASC LIMIT 1'; + } + else + { + $sort = 'ORDER BY p.post_date DESC LIMIT 1'; + } + + return $sort; + } + +function cpto_get_next_post_where($where) + { + global $post, $wpdb; + + if ( empty( $post ) ) + return null; + + $current_post_date = $post->post_date; + + $join = ''; + $posts_in_ex_cats_sql = ''; + if (isset($in_same_cat)) + if ( $in_same_cat || !empty($excluded_categories) ) + { + $join = " INNER JOIN $wpdb->term_relationships AS tr ON p.ID = tr.object_id INNER JOIN $wpdb->term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id"; + + if ( $in_same_cat ) { + $cat_array = wp_get_object_terms($post->ID, 'category', array('fields' => 'ids')); + $join .= " AND tt.taxonomy = 'category' AND tt.term_id IN (" . implode(',', $cat_array) . ")"; + } + + $posts_in_ex_cats_sql = "AND tt.taxonomy = 'category'"; + if ( !empty($excluded_categories) ) { + $excluded_categories = array_map('intval', explode(' and ', $excluded_categories)); + if ( !empty($cat_array) ) { + $excluded_categories = array_diff($excluded_categories, $cat_array); + $posts_in_ex_cats_sql = ''; + } + + if ( !empty($excluded_categories) ) { + $posts_in_ex_cats_sql = " AND tt.taxonomy = 'category' AND tt.term_id NOT IN (" . implode($excluded_categories, ',') . ')'; + } + } + } + + $current_menu_order = $post->menu_order; + + //check if there are more posts with lower menu_order + $query = "SELECT p.* FROM $wpdb->posts AS p + WHERE p.menu_order > '".$current_menu_order."' AND p.post_type = '". $post->post_type ."' AND p.post_status = 'publish' $posts_in_ex_cats_sql"; + $results = $wpdb->get_results($query); + + if (count($results) > 0) + { + $where = "WHERE p.menu_order > '".$current_menu_order."' AND p.post_type = '". $post->post_type ."' AND p.post_status = 'publish' $posts_in_ex_cats_sql"; + } + else + { + $where = "WHERE p.post_date > '".$current_post_date."' AND p.post_type = '". $post->post_type ."' AND p.post_status = 'publish' AND p.ID != '". $post->ID ."' $posts_in_ex_cats_sql"; + } + + return $where; + } + +function cpto_get_next_post_sort($sort) + { + global $post, $wpdb; + $posts_in_ex_cats_sql = ''; + + $current_menu_order = $post->menu_order; + + $query = "SELECT p.* FROM $wpdb->posts AS p + WHERE p.menu_order > '".$current_menu_order."' AND p.post_type = '". $post->post_type ."' AND p.post_status = 'publish' $posts_in_ex_cats_sql"; + $results = $wpdb->get_results($query); + if (count($results) > 0) + { + $sort = 'ORDER BY p.menu_order ASC, p.post_date DESC LIMIT 1'; + } + else + { + $sort = 'ORDER BY p.post_date ASC LIMIT 1'; + } + + return $sort; + } + + +class Post_Types_Order_Walker extends Walker + { + + var $db_fields = array ('parent' => 'post_parent', 'id' => 'ID'); + + + function start_lvl(&$output, $depth) { + $indent = str_repeat("\t", $depth); + $output .= "\n$indent
    \n"; + } + + + function end_lvl(&$output, $depth) { + $indent = str_repeat("\t", $depth); + $output .= "$indent
\n"; + } + + + function start_el(&$output, $page, $depth, $args) { + if ( $depth ) + $indent = str_repeat("\t", $depth); + else + $indent = ''; + + extract($args, EXTR_SKIP); + + $output .= $indent . '
  • '.apply_filters( 'the_title', $page->post_title, $page->ID ).''; + } + + + function end_el(&$output, $page, $depth) { + $output .= "
  • \n"; + } + + } + + +class CPTO + { + var $current_post_type = null; + + function CPTO() + { + add_action( 'admin_init', array(&$this, 'registerFiles'), 11 ); + add_action( 'admin_init', array(&$this, 'checkPost'), 10 ); + add_action( 'admin_menu', array(&$this, 'addMenu') ); + + + + add_action( 'wp_ajax_update-custom-type-order', array(&$this, 'saveAjaxOrder') ); + } + + function registerFiles() + { + if ( $this->current_post_type != null ) + { + wp_enqueue_script('jQuery'); + wp_enqueue_script('jquery-ui-sortable'); + } + + wp_register_style('CPTStyleSheets', CPTURL . '/css/cpt.css'); + wp_enqueue_style( 'CPTStyleSheets'); + } + + function checkPost() + { + if ( isset($_GET['page']) && substr($_GET['page'], 0, 17) == 'order-post-types-' ) + { + $this->current_post_type = get_post_type_object(str_replace( 'order-post-types-', '', $_GET['page'] )); + if ( $this->current_post_type == null) + { + wp_die('Invalid post type'); + } + } + } + + function saveAjaxOrder() + { + global $wpdb; + + parse_str($_POST['order'], $data); + + if (is_array($data)) + foreach($data as $key => $values ) + { + if ( $key == 'item' ) + { + foreach( $values as $position => $id ) + { + $wpdb->update( $wpdb->posts, array('menu_order' => $position, 'post_parent' => 0), array('ID' => $id) ); + } + } + else + { + foreach( $values as $position => $id ) + { + $wpdb->update( $wpdb->posts, array('menu_order' => $position, 'post_parent' => str_replace('item_', '', $key)), array('ID' => $id) ); + } + } + } + } + + + function addMenu() + { + global $userdata; + //put a menu for all custom_type + $post_types = get_post_types(); + + $options = get_option('cpto_options'); + //get the required user capability + $capability = ''; + if(isset($options['capability']) && !empty($options['capability'])) + { + $capability = $options['capability']; + } + else if (is_numeric($options['level'])) + { + $capability = userdata_get_user_level(); + } + else + { + $capability = 'install_plugins'; + } + + foreach( $post_types as $post_type_name ) + { + if ($post_type_name == 'page') + continue; + + //ignore bbpress + if ($post_type_name == 'reply' || $post_type_name == 'topic') + continue; + + if ($post_type_name == 'post') + add_submenu_page('edit.php', 'Re-Order', 'Re-Order', $capability, 'order-post-types-'.$post_type_name, array(&$this, 'SortPage') ); + else + { + if (!is_post_type_hierarchical($post_type_name)) + add_submenu_page('edit.php?post_type='.$post_type_name, 'Re-Order', 'Re-Order', $capability, 'order-post-types-'.$post_type_name, array(&$this, 'SortPage') ); + } + } + } + + + function SortPage() + { + ?> +
    +

    +

    current_post_type->labels->singular_name . ' - Re-order '?>

    + + + +
    + + + +
    +
      + listPages('hide_empty=0&title_li=&post_type='.$this->current_post_type->name); ?> +
    + +
    +
    + +

    + Update +

    + + + +
    + 0, 'show_date' => '', + 'date_format' => get_option('date_format'), + 'child_of' => 0, 'exclude' => '', + 'title_li' => __('Pages'), 'echo' => 1, + 'authors' => '', 'sort_column' => 'menu_order', + 'link_before' => '', 'link_after' => '', 'walker' => '' + ); + + $r = wp_parse_args( $args, $defaults ); + extract( $r, EXTR_SKIP ); + + $output = ''; + + $r['exclude'] = preg_replace('/[^0-9,]/', '', $r['exclude']); + $exclude_array = ( $r['exclude'] ) ? explode(',', $r['exclude']) : array(); + $r['exclude'] = implode( ',', apply_filters('wp_list_pages_excludes', $exclude_array) ); + + // Query pages. + $r['hierarchical'] = 0; + $args = array( + 'sort_column' => 'menu_order', + 'post_type' => $post_type, + 'posts_per_page' => -1, + 'orderby' => 'menu_order', + 'order' => 'ASC' + ); + + $the_query = new WP_Query($args); + $pages = $the_query->posts; + + if ( !empty($pages) ) { + if ( $r['title_li'] ) + $output .= ''; + } + + $output = apply_filters('wp_list_pages', $output, $r); + + if ( $r['echo'] ) + echo $output; + else + return $output; + } + + function walkTree($pages, $depth, $r) + { + if ( empty($r['walker']) ) + $walker = new Post_Types_Order_Walker; + else + $walker = $r['walker']; + + $args = array($pages, $depth, $r); + return call_user_func_array(array(&$walker, 'walk'), $args); + } + } + + +?> \ No newline at end of file diff -r 9db125e8f1e0 -r 83193a9a9b4e web/wp-content/plugins/post-types-order/readme.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/wp-content/plugins/post-types-order/readme.txt Wed Dec 19 12:19:34 2012 -0800 @@ -0,0 +1,127 @@ +=== Post Types Order === +Contributors: Nsp Code +Donate link: http://www.nsp-code.com/donate.php +Tags: post order, post type order, custom order, admin posts order +Requires at least: 2.8 +Tested up to: 3.5 +Stable tag: 1.5.7 + +Order Post Types Objects (posts, any custom post types) using a Drag and Drop Sortable JavaScript AJAX interface. + +== Description == + +Over 130.000 DOWNLOADS in couple months and near PERFECT ratting out of 130 REVIEWS.
    +A powerful plugin, Order Posts and Post Types Objects using a Drag and Drop Sortable JavaScript capability. +It allow to reorder the posts for any custom post types you defined, including the default Posts. Also you can have the admin posts interface sorted per your new sort. Post Order has never been easier. + += Usage = +This was built considering for everyone to be able to use no matter the WordPress experience, so it's very easy: + +* Install the plugin through the Install Plugins interface or by uploading the `post-types-order` folder to your `/wp-content/plugins/` directory. +* Activate the Post Order plugin. +* A new setting page will be created within Settings > Post Types Order, you should check with that, and make a first options save. +* Using the AutoSort option as ON you don't need to worry about any code changes, the plugin will do the post order update on fly. +* Use the Re-Order interface which appear to every custom post type (non-hierarchical) to change the post order to a new one. + += Example of Usage = +[youtube http://www.youtube.com/watch?v=VEbNKFSfhCc] + +As you can see just a matter of drag and drop and post ordering will change on front side right away. +If for some reason the post order does not update on your front side, you either do something wrong or the theme code you are using does not use a standard query per WordPress Codex rules and regulations. But we can still help, use the forum to report your issue as there are many peoples who gladly help or get in touch with us. + +
    +
    This plugin it's developed by Nsp-Code + +== Installation == + +1. Upload `post-types-order` folder to your `/wp-content/plugins/` directory. +2. Activate the plugin from Admin > Plugins menu. +3. Once activated you should check with Settings > Post Types Order +4. Use Re-Order link which appear into each post type section to make your sort. + + +== Screenshots == + +1. This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). + +== Frequently Asked Questions == + +Feel free to contact me at electronice_delphi@yahoo.com + += I have no PHP knowledge at all, i will still be able to use this plugin? = + +Absolutely you can! Unlike many of other plugins, you don't have to do any code changes to make your post order to change accordingly to custom defined post order. There is an option to autoupdate the WordPress queries so the posts order will be returned in the required order. Anyway this can be turned off to allow customized code usage. + += What kind of posts/pages this plugin allow me to sort? = + +You can sort ALL post types that you have defined into your wordpress as long they are not hierarhically defined: Posts (default WordPress custom post type), Movies, Reviews, Data etc.. + += Ok, i understand about the template post types order, how about the admin interface? = + +There's a option you can trigger, to see the post types order as you defined in the sort list, right into the main admin post list interface. + += There is a feature that i want it implemented, can you do something about it? = + +All ideas are welcome and i put them on my list to be implemented into the new versions. Anyway this may take time, but if you are in a rush, please consider a small donation and we can arrange something. + +== Change Log == + += 1.5.7 = + - Updates/Fixes + - Using Capabilities instead levels + - Updating certain code for WordPress 3.5 compatibility + - Set default order as seccondary query order param + += 1.5.4 = + - Updates/Fixes + += 1.5.1 = + - Updates/Fixes + += 1.4.6 = + - Get Previous / Next Posts Update + += 1.4.3 = + - Small improvments + += 1.4.1 = + - Re-Order Menu Item Appearance fix for update versions + - Improved post order code + += 1.3.9 = + - Re-Order Menu Item Appearance fix + += 1.3.8 = + - Another Plugin conflict fix (thanks Steve Reed) + - Multiple Improvments (thanks for support Video Geek - bestpocketvideocams.com) + - Localisation Update (thanks Gabriel Reguly - ppgr.com.br/wordpress/) + += 1.1.2 = + - Bug Fix + += 1.0.9 = + - Admin will set the roles which can use the plugins (thanks for support Nick - peerpressurecreative.com) + += 1.0.2 = + - Default order used if no sort occour + += 1.0.1 = + - Post order support implemented + += 1.0 = + - First stable version (thanks for support Andrew - PageLines.com) + += 0.9. = + - Initial Release + + +== Upgrade Notice == + +Make sure you get the latest version + + +== Localization == + +Currently only available in English and Brazilian Portuguese. +Want to contribute with a translation to your language? Please contact me at electronice_delphi@yahoo.com +http://www.nsp-code.com diff -r 9db125e8f1e0 -r 83193a9a9b4e web/wp-content/plugins/post-types-order/screenshot-1.png Binary file web/wp-content/plugins/post-types-order/screenshot-1.png has changed