WordPress.org

Plugin Directory

Changeset 596959


Ignore:
Timestamp:
09/10/12 14:12:20 (20 months ago)
Author:
Latz
Message:

+ Added: some actions (*_before, *_after)
+ Added: Romaian language file. Thanks Web Geek Science (webhostinggeeks.com)

  • Changed: default pagebar design
  • Fixed: replaced deprecated function clean_url()
  • Fixed: Automagic insert of pagebar only in main loop (Thanks to @toscho, @herrllama and @bueltge)
Location:
pagebar
Files:
27 added
7 edited

Legend:

Unmodified
Added
Removed
  • pagebar/trunk/class-basebar.php

    r301753 r596959  
    5151                $this->wp_query = $wp_query; 
    5252                $this->pbOptions = $pbOptions;         // load options 
    53                 $this->init($this->pbOptions);                             // initialize 
     53                $this->init($this->pbOptions);        // initialize 
    5454        }  //function __construct() 
    5555 
     
    110110            if ($place > 0) echo '<span class="break">'; 
    111111            echo $this->pbOptions["connect"] !== "" ? $this->pbOptions["connect"] : '...'; 
    112             echo '</span>'; 
     112            echo "</span>\n"; 
    113113        } 
    114114        // ----------------------------------------------------------------------------- 
     
    181181                // insert HTML comment for support reasons 
    182182                echo "<!-- pb259 -->"; 
     183                do_action('pagebar_before'); // do general action 
    183184                $this->div_start(); 
     185 
     186                if (isset($this->action)) 
     187                    do_action($this->action . '_before'); 
    184188 
    185189                echo $this->tagReplace ( $this->pbOptions ["pbText"], $this->paged ) . '&nbsp;'; 
     
    191195                    for($i = 1; $i <= $this->max_page; $i ++) 
    192196                        if ($i == $this->paged) 
    193                             $this->thisPage ( $i ); else 
     197                            $this->thisPage ( $i );  
     198                        else 
    194199                            $this->page ( $i ); 
    195200                    $this->nextPage ( $this->paged, $this->max_page ); 
    196                     echo "</div>"; 
     201 
     202                    if (isset($this->action))  
     203                        do_action($this->action . '_after');  // do specific action 
     204                    echo '</div>'; 
     205                    do_action('pagebar_after'); // do general action 
    197206                    return; 
    198207                } //if 
     
    249258    } 
    250259 
     260  if (isset($this->action)) // do specific action 
     261    do_action($this->action . '_after'); // do general action 
    251262  $this->div_end(); 
     263  do_action('pagebar_after'); 
    252264 
    253265        } // function display() 
  • pagebar/trunk/class-commentbar.php

    r147237 r596959  
    1919                                    $this->div_name = "pagebar"; 
    2020                } 
    21  
     21                $this->action = 'commentbar'; 
    2222                $this->display(); 
    2323        } //__construct() 
     
    4141        // ----------------------------------------------------------------------------- 
    4242        function create_link($page) { 
    43                 return clean_url( get_comments_pagenum_link( $page, $this->max_page ) ); 
     43                return esc_url( get_comments_pagenum_link( $page, $this->max_page ) ); 
    4444        } //create_link() 
    4545 
  • pagebar/trunk/class-multipagebar.php

    r147237 r596959  
    1818                            $this->div_name = "pagebar"; 
    1919            } 
     20            $this->action = "multipagebar"; 
    2021            echo parent::display(); 
    2122 
  • pagebar/trunk/class-postbar.php

    r137891 r596959  
    11<?php 
    22 
    3 require_once("class-basebar.php"); 
     3require_once('class-basebar.php'); 
    44 
    55class Postbar extends Basebar { 
     
    77        function __construct($paged, $max_page) { 
    88                parent::__construct($paged, $max_page); 
    9                 $this->div_name = "pagebar"; 
     9                $this->div_name = 'pagebar'; 
     10                $this->action = 'postbar'; 
    1011                $this->display(); 
    1112        }  // function __construct() 
  • pagebar/trunk/pagebar.css

    r134994 r596959  
    99} 
    1010 
    11 .pagebar a,.pageList .this-page { 
    12     border: 1px solid #9AAFE5; 
    13     text-decoration: none; 
    14     padding: 0.2em 0.5em; 
     11.pagebar a, .break, .this-page, .inactive { 
     12    display:inline-block; 
     13    background: #f7f7f7; 
     14    background: -webkit-linear-gradient(top, #f7f7f7 0%,#f5f5f5 52%,#ebebeb 100%); 
     15    background: -moz-linear-gradient(top, #f7f7f7 0%,#f5f5f5 52%,#ebebeb 100%); 
     16    background: -o-linear-gradient(top, #f7f7f7 0%,#f5f5f5 52%,#ebebeb 100%); 
     17    background: -ms-linear-gradient(top, #f7f7f7 0%,#f5f5f5 52%,#ebebeb 100%); 
     18    background: linear-gradient(top, #f7f7f7 0%,#f5f5f5 52%,#ebebeb 100%); 
     19    padding: 5px 10px; 
     20    text-decoration: none; 
     21    color: #7e7e7e; 
     22    border: 1px solid #c6c6c6; 
     23    -webkit-box-shadow: inset 0 4px 3px rgba(255,255,255,0.6), 0 1px 3px rgba(0,0,0,.2); 
     24    -moz-box-shadow: inset 0 4px 3px rgba(255,255,255,0.6), 0 1px 3px rgba(0,0,0,.2); 
     25    box-shadow: inset 0 4px 3px rgba(255,255,255,0.6), 0 1px 3px rgba(0,0,0,.2); 
     26    font-weight: bold; 
     27    border-radius:3px;  
    1528} 
    1629 
     
    2134} 
    2235 
    23 .pagebar .break { 
    24     padding: 2px 6px 2px 6px; 
    25     border: none; 
    26     background: #fff; 
    27     text-decoration: none; 
    28 } 
    2936 
    30 .pagebar .this-page { 
    31     border: 1px solid #2E6AB1; 
    32     padding: 0.2em 0.5em; 
    33     font-weight: bold; 
    34     background: #2E6AB1; 
    35     color: #fff; 
    36 } 
    37  
    38 .pagebar a:hover { 
    39     border-color: #2E6AB1; 
    40 } 
     37.pagebar .this-page, .pagebar a:hover { 
     38background: #9ad6fb; 
     39    background: -webkit-linear-gradient(top, #9ad6fb 0%,#77c4fc 100%); 
     40    background: -moz-linear-gradient(top, #9ad6fb 0%,#77c4fc 100%); 
     41    background: -o-linear-gradient(top, #9ad6fb 0%,#77c4fc 100%); 
     42    background: -ms-linear-gradient(top, #9ad6fb 0%,#77c4fc 100%); 
     43    background: linear-gradient(top, #9ad6fb 0%,#77c4fc 100%); 
     44    border: 1px solid #72ade4; 
     45    color: #4879a6; 
     46    -webkit-box-shadow: inset 0 1px 4px rgba(255,255,255,0.75), 0 1px 3px rgba(79,126,167,.5); 
     47    -moz-box-shadow: inset 0 1px 4px rgba(255,255,255,0.75), 0 1px 3px rgba(79,126,167,.5); 
     48    box-shadow: inset 0 1px 4px rgba(255,255,255,0.75), 0 1px 3px rgba(79,126,167,.5); 
     49    -webkit-transition: all 0.25s ease 0s; 
     50    -moz-transition: all 0.25s ease 0s; 
     51    -o-transition: all 0.25s ease 0s; 
     52    transition: all 0.25s ease 0s; } 
    4153 
    4254.pagebar .inactive 
    4355{ 
    44    border: 1px solid #cccccc; 
    45      color: #ccc; 
    46    text-decoration: none; 
    47    padding: 0.2em 0.5em; 
    48 } 
     56   color: #ccc; 
     57 
     58 
  • pagebar/trunk/pagebar2.php

    r494677 r596959  
    44Plugin URI: http://www.elektroelch.de/hacks/wp/pagebar 
    55Description: Adds an advanced page navigation to Wordpress. 
    6 Version: 2.59.1 
     6Version: 2.60 
     7Requires at least: 3.3 
     8Tested up to: 3.5 
     9Tags: navigation, pagination 
     10Stable tag: trunk 
    711Author: Lutz Schr&ouml;er 
    812Author URI: http://elektroelch.de/blog 
     
    2428 
    2529/* -------------------------------------------------------------------------------------------- */ 
    26  
    27 function postbar() { 
    28         global $paged, $wp_query; 
    29         require_once('class-postbar.php'); 
    30         $pagebar = new Postbar($paged, intval($wp_query->max_num_pages)); 
    31 } 
    32  
    33 /* -------------------------------------------------------------------------------------------- */ 
    34 function pagebar() {  // for compatibility with pagebar v2.21 
    35         postbar(); 
    36 } 
    37 /* -------------------------------------------------------------------------------------------- */ 
    38 function wp_pagebar() {  // for compatibility with pagebar v2.21 
    39         postbar(); 
    40 } 
    41 /* -------------------------------------------------------------------------------------------- */ 
    42 function multipagebar () { 
    43         global $page, $numpages; 
    44         require_once('class-multipagebar.php'); 
    45         $multipagebar = new Multipagebar($page, $numpages); 
    46 } //multipagebar() 
    47 /* -------------------------------------------------------------------------------------------- */ 
    48 function commentbar() { 
    49         global $wp_query; 
    50         require_once('class-commentbar.php'); 
    51         $paged = intval(get_query_var('cpage')); 
    52         $max_page = intval($wp_query->max_num_comment_pages); 
    53         $commentbar = new Commentbar($paged, $max_page); 
    54 } 
    55 // ------------------------------------------------------------------------- 
    5630// determine the path of the plugin 
    5731// stolen from Commentmix 
     
    6438/* -------------------------------------------------------------------------- */ 
    6539 
     40function is_main_loop() { 
     41  global $wp_query, $wp_the_query; 
     42  if ($wp_the_query === $wp_query) { 
     43    return true; 
     44  } 
     45  return false; 
     46} 
     47/* -------------------------------------------------------------------------- */ 
     48function postbar($query) { 
     49    global $paged, $wp_query, $pbOptions; 
     50 
     51    // no automagic insert if we're not in the main loop 
     52    //if ( $pbOptions['auto'] && ! ($wp_the_query === $array) )  
     53    if ( $pbOptions['auto'] && ! ($query->is_main_query()) )         
     54        return; 
     55 
     56    require_once('class-postbar.php'); 
     57    $pagebar = new Postbar($paged, intval($wp_query->max_num_pages)); 
     58     
     59} 
     60/* -------------------------------------------------------------------------------------------- */ 
     61function pagebar($array) {  // for compatibility with pagebar v2.21 
     62    postbar($array); 
     63} 
     64/* -------------------------------------------------------------------------------------------- */ 
     65function wp_pagebar($array) {  // for compatibility with pagebar v2.21 
     66        postbar($array); 
     67} 
     68/* -------------------------------------------------------------------------------------------- */ 
     69function multipagebar () { 
     70        global $page, $numpages; 
     71        require_once('class-multipagebar.php'); 
     72        $multipagebar = new Multipagebar($page, $numpages); 
     73} //multipagebar() 
     74/* -------------------------------------------------------------------------------------------- */ 
     75function commentbar() { 
     76        global $wp_query; 
     77        require_once('class-commentbar.php'); 
     78        $paged = intval(get_query_var('cpage')); 
     79        $max_page = intval($wp_query->max_num_comment_pages); 
     80        $commentbar = new Commentbar($paged, $max_page); 
     81} 
     82 
    6683function pagebar_registerStylesheet($url, $handle, $pluginurl = "") { 
    6784    wp_register_style($handle, $pluginurl . $url); 
     
    7491    if ($pbOptions["stylesheet"] != "styleCss") 
    7592        pagebar_registerStylesheet(get_bloginfo('stylesheet_directory') 
    76                                              . '/' . $pbOptions["cssFilename"], 
     93                                             . '/' . $pbOptions["cssFilename"] . '?id='.time(), 
    7794                                             'pagebar-stylesheet'); 
    7895} 
  • pagebar/trunk/readme.txt

    r494677 r596959  
    33Donate link: http://elektroelch.de 
    44Tags: navigation, navi, page, comments 
    5 Requires at least: 2.7 
    6 Tested up to: 3.3.1 
     5Requires at least: 3.3 
     6Tested up to: 3.4 
    77Stable tag: trunk 
    88 
     
    3838 
    3939+ Automatic installation 
    40 If you have a simple blog (e.g. the default theme) you can easily add postbar by selecting “Automagic insertion” in the options page. Then you can select where you want the postbar to appear: 
     40If you have a simple blog (e.g. the default theme) you can easily add postbar by selecting “Automagic insertion” in the options page. Then you can select where you want the postbar to appear: 
    4141     - Front of postings 
    4242     - Behind postings 
     
    176176{total}   -> Total number of pages 
    177177{current} -> Current page number 
     178 
     179 
     180== Actions == 
     181Since v2.60 pagebar contains some actions: pagebar_before/pagebar_after, postbar_before/postbar_after, multipagebar_before/multipagebar_after,  
     182commentbar_before/commentbar_after: 
     183 
     184[pagebar_before] 
     185   <div id="pagebar>"> 
     186     [postbar_before] 
     187         1 2 3 4 5 6 7 8 9  
     188     [postbar_after] 
     189   </div> 
     190 [pagebar_after] 
    178191 
    179192 
     
    197210+ Marco of mafia-daily.com for pointing out problem with theme editor. 
    198211+ Thomas (koehntopp.com) for his bug report on name collisions. 
     212+ chipmint.com for the new default design 
    199213 
    200214== Changelog == 
     215= 2.60 = 
     216+ Added: some actions (*_before, *_after) 
     217+ Added: Romaian language file. Thanks Web Geek Science (webhostinggeeks.com) 
     218* Changed: default pagebar design 
     219* Fixed: replaced deprecated function clean_url() 
     220* Fixed: Automagic insert of pagebar only in main loop (Thanks to @toscho, @herrllama and @bueltge) 
     221 
    201222= 2.59.1 = 
    202223* Fixed: enabling/disabling of positioning options 
Note: See TracChangeset for help on using the changeset viewer.