De trouwdag
Klantervaringen
/* * $Date: 2010/03/04 12:20:32 $ * $Revision: 1.0 $ */ /* Plugin Name: Zamango Page Navigation Plugin URI: http://www.zamango.com/ Description: This plugin adds an advanced page navigation to Wordpress Author: Zamango Version: 1.3 Requires at least: 2.8 Author URI: http://www.zamango.com/ License: GPL */ require_once('zmg_admin.php'); /******************************************************************************/ if (!class_exists('zmg_page_navigation')) { class zmg_page_navigation extends zmg_admin { var $hook = 'zmg-page-navigation'; var $version = '1.3'; var $page_title = 'Page Navigation'; var $menu_title = 'Page Navigation'; var $filename = 'zamango-page-navigation/zmg_page_navigation.php'; var $options = array(); /**********************************************************************/ function zmg_page_navigation() { require_once('zmg_page_navigation_defaults.php'); $this->dir_name = basename(dirname(__FILE__)); $this->plugin_url = WP_PLUGIN_URL . '/' . $this->dir_name; $this->plugin_path = WP_PLUGIN_DIR . '/' . $this->dir_name; $this->reg_deactivation_hook(); add_action('init', array($this, 'admin_init'), 3); add_action('init', array($this, 'init')); } /**********************************************************************/ function deactivate() { $this->options = get_option($this->hook); if ($this->options['clear_options']) delete_option($this->hook); } /**********************************************************************/ function query_vars_endpoint($vars) { $vars[] = 'all'; return $vars; } /**********************************************************************/ function add_custom_css() { echo '\n\n'; } /**********************************************************************/ function init() { global $wp_rewrite; $wp_rewrite->add_endpoint('all', EP_ALL); $wp_rewrite->flush_rules(); add_filter('query_vars', array($this, 'query_vars_endpoint')); $this->add_js('zmg-pn-admin-js', $this->plugin_url . '/zmg_page_navigation_admin.js', true); $this->add_css('zmg-pn-admin-js', $this->plugin_url . '/zmg_page_navigation_admin.css', true); if ($this->options['is_zmg_css']) $this->add_css('zmg-pn-css', $this->plugin_url . '/zmg_page_navigation.css'); else add_action('wp_head', array($this, 'add_custom_css')); if ($wp_query->is_feed || is_admin()) return true; $before_loop = new zmg_pn_parser ('before_loop', $this->options, $this->version); $after_loop = new zmg_pn_parser ('after_loop', $this->options, $this->version); if ($this->options['before_loop']) add_action('loop_start', array($before_loop, 'parse_br')); if ($this->options['after_loop']) add_action('loop_end', array($after_loop, 'parse_br')); if ($this->options['before_loop_s']) add_action('loop_start', array($before_loop, 'parse_sp')); if ($this->options['after_loop_s']) add_action('loop_end', array($after_loop, 'parse_sp')); } /**********************************************************************/ function plugin_option_page_content() { if (isset($_POST['ZMG_SUBMIT'])) { $this->validate_params(); if (isset($this->errors)) echo $this->disappearing_message( __('Incorrect settings value', $this->hook) ); else { $this->save_options(); echo $this->disappearing_message( __('Settings have been saved', $this->hook) ); } } $this->form_begin($this->hidden('ZMG_SUBMIT')); $this->postbox($this->hook . '-blogroll_navigation', __('Blogroll navigation', $this->hook), $this->blogroll_navigation()); $this->postbox($this->hook . '-quick_links_on_single_post', __('Quick links on single post', $this->hook), $this->quick_links_on_single_post()); $this->postbox($this->hook . '-common_options_and_css', __('Common options & CSS', $this->hook), $this->common_options_and_css()); $this->form_end(); } /**********************************************************************/ function blogroll_navigation() { $content = '
'; $content .= __('You may use the following Zamango "tags" while ' . 'configuring Page Navigation bar on lists pages', $this->hook); $content .= '
'; $ul = array(); $html = '[zmg_pn:current]
';
$html .= __('current page number (i.e. page on which the ' .
'navigation bar is shown)', $this->hook);
$ul[] = $this->elem($html);
$html = '[zmg_pn:total]
';
$html .= __('total pages amount', $this->hook);
$ul[] = $this->elem($html);
$html = '[zmg_pn:page]
';
$html .= __('number of page which is processing by script for ' .
'that moment (note that if page navigation bar ' .
'contains links to 10 pages plus current then value ' .
'of [zmg_pn:page] will have 11 valuessequentially)',
$this->hook);
$ul[] = $this->elem($html);
$content .= $this->ul($ul);
$content .= ''; $content .= __('Also you can use any HTML tags.', $this->hook); $content .= '
'; $disc_link = $this->add_description(__('Help on Zamango tags', $this->hook), $content, 'blogroll_navigation'); $content = $this->information_message( __('Navigation bar shown on the index, category, tag, ' . 'archive browsing, search results and other lists', $this->hook) ); $rows = array(); $row = array(); $html = ''; $html = __('Where the pagebar must be inserted:', $this->hook); $row[] = $this->elem($html); $html = $this->checkbox('before_loop', '1', $this->options['before_loop'], __('before posts list', $this->hook)); $html .= ''; $content .= __('You may use the following Zamango "tags" while ' . 'configuring Page Navigation bar on single posts', $this->hook); $content .= '
'; $ul = array(); $html = '[zmg_pn:prev_post]
';
$html .= __('Title for link to previous post', $this->hook);
$ul[] = $this->elem($html);
$html = '[zmg_pn:next_post]
';
$html .= __('Title for link to next post', $this->hook);
$ul[] = $this->elem($html);
$content .= $this->ul($ul);
$content .= ''; $content .= __('Also you can use any HTML tags.', $this->hook); $content .= '
'; $disc_link = $this->add_description(__('Help on Zamango tags', $this->hook), $content, 'quick_links_on_single_post'); $content = $this->information_message( __('Links to `Previous post` and `Next post` shown on single ' . 'post', $this->hook) ); $rows = array(); $row = array(); $html = ''; $html = __('Where links must be inserted:', $this->hook); $row[] = $this->elem($html); $html = $this->checkbox('before_loop_s', '1', $this->options['before_loop_s'], __('before post', $this->hook)); $html .= 'De trouwdag