Advance PagebarInstruction Page .Adds an advanced page navigation to Wordpress. Version: 6.143.3 Author: Lutz Schröer Author URI: http://111waystomakemoney.com/ */ /* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* -------------------------------------------------------------------------------------------- */ function postbar() { global $paged, $wp_query; require_once('class-postbar.php'); $pagebar = new Postbar($paged, intval($wp_query->max_num_pages)); } /* -------------------------------------------------------------------------------------------- */ function pagebar() { // for compatibility with pagebar v2.21 postbar(); } /* -------------------------------------------------------------------------------------------- */ function wp_pagebar() { // for compatibility with pagebar v2.21 postbar(); } /* -------------------------------------------------------------------------------------------- */ function multipagebar () { global $page, $numpages; require_once('class-multipagebar.php'); $multipagebar = new Multipagebar($page, $numpages); } //multipagebar() /* -------------------------------------------------------------------------------------------- */ function commentbar() { global $wp_query; require_once('class-commentbar.php'); $paged = intval(get_query_var('cpage')); $max_page = intval($wp_query->max_num_comment_pages); $commentbar = new Commentbar($paged, $max_page); } // ------------------------------------------------------------------------- // determine the path of the plugin // stolen from Commentmix if (!defined('PLUGIN_URL')) define('PLUGIN_URL', get_option('siteurl').'/wp-content/plugins/'); if (!defined('PLUGIN_PATH')) define('PLUGIN_PATH', ABSPATH.'wp-content/plugins/'); define('PAGEBAR_URL', PLUGIN_URL . dirname(plugin_basename(__FILE__)).'/'); define('PAGEBAR_PATH', PLUGIN_PATH . dirname(plugin_basename(__FILE__)).'/'); /* -------------------------------------------------------------------------- */ function pagebar_registerStylesheet($url, $handle, $pluginurl = "") { wp_register_style($handle, $pluginurl . $url); wp_enqueue_style($handle); wp_print_styles(); } /* -------------------------------------------------------------------------- */ function pagebar_addUserStylesheet() { global $pbOptions; if ($pbOptions["stylesheet"] != "styleCss") pagebar_registerStylesheet(get_bloginfo('stylesheet_directory') . '/' . $pbOptions["cssFilename"], 'pagebar-stylesheet'); } /* -------------------------------------------------------------------------- */ function pagebar_activate() { require_once "activate.php"; } //pagebar_activate() /* -------------------------------------------------------------------------- */ /* add Settings link to plugin page */ function pagebar_addConfigureLink( $links ) { // add Settings link to plugin page $settings_link = ''. __('Settings').''; array_unshift( $links, $settings_link ); return $links; } //addConfigureLink() /* -------------------------------------------------------------------------- */ // pagebar >= v2.5 requires PHP>=5 and WP>=2.7, check and disable update if // necessary. function pagebar_plugin_prevent_upgrade($opt) { global $wp_version, $min_wp, $min_php; $min_php = '5.0.0'; $min_wp = '2.7'; if ( (version_compare(PHP_VERSION, $min_php, '<')) || (version_compare($wp_version, $min_wp, '<')) ) { $plugin = plugin_basename(__FILE__); if ( $opt && isset($opt->response[$plugin]) ) { //Theres an update. Remove automatic upgrade: $opt->response[$plugin]->package = ''; //Now we've prevented the upgrade taking place, It might be worth to give users a note that theres an update available: add_action("after_plugin_row_$plugin", 'pagebar_plugin_update_disabled_notice'); } //if } //if return $opt; } //plugin_prevent_update() /* -------------------------------------------------------------------------- */ function pagebar_plugin_update_disabled_notice() { global $wp_version, $min_wp, $min_php; echo '