WP Digg Style Pagination Plugin V 1.0
Based on the modular version for the pagination, now I have created a version easier to implement, using classes for PHP version 4. The implementation is simple, is necessary to include the class with a require or an include. We defined basic properties for pagination such as an amount of elements to paginate, elements by page, page to which the element "page" will be sent, you need a CSS style and finally we generate the pagination to show it.
include(ABSPATH.'/includes/pagination.class.php');
/*
Now you can work with de pagination class
*/
- Version 0.4 (2007-10-21)
- Added class next and prev to next and prev buttons.
- Bug fix
- Version 0.3.3 (2007-10-05)
- Possibility to set 0 as the current page (no page selected). Back and Next buttons won't be shown.
- Version 0.3.2 (2007-09-19)
- Changed round to ceil (line 122)
Version 0.3.1(2007-08-23)Changed ceil to round (line 122)
- Version 0.3 (2007-07-10)
- Added the URL friendly functionality.
- Version 0.2 (2007-06-15)
- show an error and description if the function was called wrongly.
- Sends & instead of ? if the current file has vars in $_GET
- can change the name of the parameter ?page=
- there is no necessary to calculate in a manual way the pagination ($class->calculate()), is automatically when you show it the first time
- and others functionalities
- Version 0.1 (2007-05-27)
- First version
Dowload and unrar where you will work with the class. For the CSS, you can take one fromthis list.
If you forget a parameters to show or calculate the pagination. The class will show you a error to remember that. by example:
$p->show();
the results:
It is necessary to specify the limit of items to show per page ($class->limit(10))
by default, the target of the pagination link is the same file where the paginations is showed. you can change it. using $class->target(file)
$p->items(1000);
$p->limit(10);
You can change the name of the parameter that brings the current page value. Using the $class->parameterName("p") you will see how the links changes the target to ?p=X instead of ?page=X
$p->items(1000);
$p->limit(10);
$p->show();
Defining the pagination on its basic way, specifying an amount of items, limits of items by page, the pointed file by the pagination and the number of the present page.
$p->Items(1000);
$p->limit(5);
$p->target("paginator.php");
$p->currentPage(2);
$p->show();
Defining in 1 the amount of adjacent pages to the present page.
$p->Items(1000);
$p->limit(5);
$p->target("paginator.php");
$p->currentPage(50);
Defining in 3 the amount of adjacent pages to the present page.
$p->Items(1000);
$p->limit(5);
$p->target("paginator.php");
$p->currentPage(50);
Defining in 4 the amount of adjacent pages to the present page.
$p->Items(1000);
$p->limit(5);
$p->target("paginator.php");
$p->currentPage(50);
Activating the functionality to show the pages amount.
$p->Items(1000);
$p->limit(5);
$p->target("paginator.php");
$p->currentPage(6);
Changing the text of the navigation tags and removing the icons.
$p->Items(1000);
$p->limit(5);
$p->target("paginator.php");
$p->currentPage(7);
Removing the text of the navigation tags.
$p->Items(1000);
$p->limit(5);
$p->target("paginator.php");
$p->currentPage(8);
Changing the icons of the navigation tags
$p->Items(1000);
$p->limit(5);
$p->target("paginator.php");
$p->currentPage(9);
Removing the text of the navigation tags and changing the icons.
$p->Items(1000);
$p->limit(5);
$p->target("#");
$p->currentPage(10);
Changing the div class (<div class="class">Pagination</div>) that surrounds the pagination (to manipulate many CSS styles)
$p->Items(1000);
$p->limit(5);
$p->target("#");
$p->currentPage(11);
$p->currentPage(14);
To use the URL friendly, we need to execute the function $p->urlFriendly();. So we need to add to the $p->target("#"); the placeholder % where we need the page numbers. If we need to change the placeholder, we can do it send it the desired char as parameter to the function $p->urlFriendly('[...]');, and to the $p->target("#[...]");.
$p->Items(1000);
$p->limit(5);
$p->currentPage(14);
$p->urlFriendly();
$p->target("#page/%/");//#page/1/
$p->show();
$p->urlFriendly('[...]');
$p->target("#pagina/[...]/");//#pagina/1/
$p->show();
$p->urlFriendly(false);
$p->target("#");//#page=1
$p->show();
70 Comments
Make A CommentComments RSS Feed TrackBack URL




September 9th, 2007 at 1:09 pm
Deberías poner en un solo paquete el plugin y la clase de paginación para evitar confusiones de los usuarios y ahorrar un paso extraño.
September 10th, 2007 at 3:01 pm
Si, muy cierto. Lo haré en un tiempo libre
hecho!September 15th, 2007 at 5:38 am
ahora funciona,
puedes borrar el comment anterior
thanks
September 15th, 2007 at 2:32 pm
Hola beku, bien!
¿Que causaba el error?, ¿Como lo solucionaste?
September 18th, 2007 at 3:33 pm
A mí tampoco me funcionaba!
Después de quebrarme la cabeza un par de horas, para averiguar cual era la causa de que no había output en el plugin, llegue a la conclusión de que el pattern en PCRE estaba *mal*, simplemente tuve que reemplazar el símbolo de # con los corchetes correspondientes, en la línea 217.
Así estaba en el archivo .rar que tienes arriba:
preg_match('#^(.*)\sLIMIT#siU', $request, $matches);
Lo intercambié por esto, y comenzó a funcionar:
preg_match('{^(.*)\sLIMIT}siU', $request, $matches);
Un saludo.
September 18th, 2007 at 8:41 pm
Good plugin! thnks
How can I use this plugin in "Single Post"?
It returns nothing, if it's single post.
September 19th, 2007 at 3:31 am
I found a bug.
example.
Total # of article : 5
Option->Read->Show post : 4
This plugin returns nothing. in this case. this plugin works only (Total # of article) / (Show post) > 2
Would you fix it for me?
September 19th, 2007 at 9:23 am
Thanks Edmundo Hidalgo
hi bum, The bug was
will fixed in the next release.Fixed.September 19th, 2007 at 9:50 am
Hello, Victor!
You are great!! thanks a lot!!!
September 20th, 2007 at 2:20 pm
I would like to request a feature if possible. Would it be possible to have this plugin with for single posts (single.php) as well? Same format as it is now but would look like this
so the website looks more consistent? thank you
September 20th, 2007 at 5:23 pm
Jimmy: maybe, in the next release.
September 20th, 2007 at 6:04 pm
gracias edmundo! yo por más que me rompí la cabeza no logré nada jajaja pero ya funciona
September 22nd, 2007 at 1:59 am
Hi Victor,
I have installed the gengo plugin (http://jamietalbot.com/wp-hacks/gengo/). It works good with your plugin so far. but Gengo add a 2-letters path like "/en/" to the permalink. With your plugin, a link to "page 2" looks like this : "/en/page/2/en/", it works but the path looks false. I don't know in your code how change the permalink. do you have an idea ?
September 24th, 2007 at 7:52 am
[...] Pagination Plugin V 1.0 [...]
September 24th, 2007 at 3:31 pm
Hola @antoine, revisaré el plugin Gengo, haber si puedo encontrar una solución en el transcurso de la semana (Si el trabajo me lo permite)
Saludos
September 25th, 2007 at 7:09 am
This is a great plugin, but it seems to break on the archive pages in Wordpress 2.3
WordPress database error: [Unknown column 'post_id' in 'field list']
SELECT count(DISTINCT post_id) FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) LEFT JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id) WHERE 1=1 AND wp_term_taxonomy.taxonomy = 'category' AND wp_term_taxonomy.term_id IN ('1') AND post_type = 'post' AND (post_status = 'publish' OR post_status = 'private') ORDER BY post_date DESC
Any solution?
September 25th, 2007 at 7:10 am
I meant the category and search page by the way... =)
September 25th, 2007 at 7:22 am
Sorry for tripple posting...
It was a silly mistake by me.
However, in my search result I now get "It is necessary to specify the number of pages ($class->items(1000))" instead of the pagination bar, and it doesn't matter if the pagination bar shouldn't show...
September 25th, 2007 at 11:52 am
Hi @kristoffer, wait for the next version uff
September 27th, 2007 at 8:26 am
Muchas gracias por tu plugin, lo uso hace tiempo y me encanta...
pero.. yo utilizo asides y no me interesa que determinadas categorías se tengan en cuenta a la hora de contar las páginas.
en la versión anterior había modificado el sql para que no contara los post de la categoría aside, pero en la última versión que has lanzado no hay sql, como se podría implementar ésto?
los que usamos asides nos devuelve más páginas de las que hay, al tener en cuenta los post de la categoria de aside tambien
ya contaras....
September 27th, 2007 at 9:35 am
[...] плагин вы сможете зкачать на сайте Mis Algoritmos. А тут вы сможете найти стили плагина. По вопросам [...]
September 27th, 2007 at 10:43 am
The plugin does not work with (only in) the categories pagination in WP 2.3, i got something like:
[Unknown column 'post_id' in 'field list']
SELECT count(DISTINCT post_id) FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) LEFT JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id) WHERE 1=1 AND wp_term_taxonomy.taxonomy = 'category' AND wp_term_taxonomy.term_id IN ('12') AND post_type = 'post' AND (post_status = 'publish' OR post_status = 'private') ORDER BY post_date DESC
September 28th, 2007 at 7:32 pm
[...] WP Digg Style Pagination Plugin V 1.0Update vom 07.08.07 [...]
September 29th, 2007 at 7:37 pm
It doesn´t work on Wordpress 2.3 or it´s just my blog ?
No funciona en Wordpress 2.3 es algun error en mi blog ?
September 30th, 2007 at 4:37 am
[...] Gracias a tikitakfire me entero que hay una versión 1.1 del plugin WP-Digg Style Paginator con la que no hay problemas en la versión 2.3 de [...]
September 30th, 2007 at 5:11 am
[...] Descarga el plugin WP-Digg Style Paginator [...]
September 30th, 2007 at 11:36 am
[...] Wp Digg-Style Pagination [...]
October 3rd, 2007 at 6:55 pm
Hola, Gracias Victor. but i think i've found a solution: there's a checkbox in the gengo settings page i've uncheck to not add the language code to the url. now it's working great ! thanks again for your plugin. you can see it in action here :
http://innerfrance.com/archives/region/paris/
October 4th, 2007 at 4:57 am
[...] Existe otra versión más nueva que soluciona algunos problemas WP Digg Style Pagination Plugin V1.0 pero parece ser que sigue dando problemas en Wordpress [...]
October 5th, 2007 at 1:12 am
Hello, Victor
Many people are waiting for your great plugin! I don't want to upgrade my wordpress without your plugin. I love this.
Would you let us know, the expected time for next version that support WP2.3?
October 5th, 2007 at 1:30 am
[...] WP-Digg Style Paginator : WP 2.3에서 정상동작하지 않음. 개발자가 다음 버전에 지원예정이라는데, 다음 버전에 대한 일정은 나오지 않았음. 결정적으로 이 플러그인 때문에 WP 2.3으로의 이주가 늦어질 듯하다. 혹시 이걸 대체할만한 플러그인이 없을까? K2의 그것이라면 좋겠지만 [...]
October 5th, 2007 at 10:40 am
Hola, Tengo mucho trabajo. Espero el fin de semana poder trabajar en una solución.--
Hi, I have a lot of work. Maybe in the weekend.
@Carballada: Si hay una consulta SQL, está en la variable $request. Dentro de la clase heredada wp_pagination_plugin en el método show().
@Ponchito147: Estoy trabajando en una solución para WP 2.3.
@antoine: Excellent!
I'm looking for a fix for WP 2.3Fixed! Download the new versionOctober 5th, 2007 at 4:45 pm
[...] Digg style pagination plugin [...]
October 6th, 2007 at 3:30 am
Hola, Victor. Soy muy feliz con su plugin. y gracias por su esfuerzo. ¿Yo tienen una pregunta, son los trabajos de esta versión con WP2.3? Su plugin es muy importante para mí, así que no me trasladaré a WP2.3 sin su plugin. picosegundo. ¡Aprendí español!
October 6th, 2007 at 9:48 am
hi @bum, the plugin works with WP 2.3
October 8th, 2007 at 6:16 am
Great! thanks Victor. now i'm moving to wp2.3!
October 8th, 2007 at 6:27 am
[...] WP-Digg Style Paginator : un plugin pour avoir une pagination à la Digg [...]
November 1st, 2007 at 8:16 am
[...] Digg Style Paginator von Victor De la Rocha [...]
November 3rd, 2007 at 2:31 pm
[...] Digg-style Paginator, para mejorar la navegación entre las páginas. Se lo puede ver en acción al final de listado de [...]
November 3rd, 2007 at 5:13 pm
[...] WP-Digg Style Paginator est malheureusement distribué sous forme d’arive .rar, ce qui n’est pas pour arranger les Linuxiens. Nous devons en effet installer le programme unrar, qui permet de dézipper ce format proprio. sudo apt-get install unrar [...]
November 5th, 2007 at 1:10 am
Thank u very much for this plugin !!!!
But i've got a problem. Go to this link : http://test.tdconcepts.free.fr/requinV2/?m=200711
and try to go to page 1 from page 2 ; it's impossible... Why?
We can go to page 2 from page 1, or go to page 3 from page 2, or page 2 from page 3.
On any page I can't came back on page 1 from page 2....
November 7th, 2007 at 11:47 am
[...] hay varios plugins con la misma funcion, yo uso el “WP Digg Style Pagination Plugin“. Les recomiendo que bajen la version 1.2.1 que, hasta el momento, es la ultima version [...]
November 8th, 2007 at 11:48 am
It doesn't work with WASSUP WP Plugin.
November 18th, 2007 at 9:09 pm
[...] The plugin is called “Digg Style Pagination” Plugin and can be found here. [...]
November 19th, 2007 at 7:31 pm
[...] WP Digg Style Pagination Plugin V 1.0 - WP-digg style pagination plugin allows to add or replace the Wordpress pagination by one easy and more comfortable navigation like Digg, Flickr, Meneame and Sabros.us. [...]
December 1st, 2007 at 5:27 pm
Tengo el mismo problema que dano, le doy a la pagina 2 pero luego al volver a darle a la pagina 1 no va...
December 2nd, 2007 at 3:36 am
La nueva versión de Wordpress hizo cambios en su base de datos, por lo que haré modificaciones considerables en la próxima versión del plugin. Espero esto resuelva el problema.
Por el momento tendrán que esperar un poco, ya que tengo un poco de trabajo y estoy en los últimos pasos de la facultad.
Creo que a mediados de Diciembre me pondré a trabajar en ella.
Disculpen los inconvenientes.
December 5th, 2007 at 3:53 pm
amigos, alguien me diria como instalarlo, es que la verdad deberian de poner un manual de instalacion para novatos, la verdad no entiendo nada, me lo descargue, lo subi, lo active, despues no se que mas hacer, espero sus pronta respuesta, gracias
saludos
December 8th, 2007 at 5:00 am
[...] WP Digg Style Pagination Plugin V 1.0 - WP-digg style pagination plugin allows to add or replace the Wordpress pagination by one easy and more comfortable navigation like Digg, Flickr, Meneame and Sabros.us. [...]
December 10th, 2007 at 7:46 pm
@abita: Intenta leyendo este artículo en español. No sólo es cuestion de subir y activar, hay que agregar unas cuantas líneas en el theme (skin o tema) de tu wordpress.
December 10th, 2007 at 11:35 pm
[...] theme, cansado de ver esto, sin querer encontré en Código Geek la solución definitiva para esto. Aquí dejo como hacerlo y diferentes css para poder adaptarlo a tu gusto, espero les [...]
December 11th, 2007 at 12:57 am
If you want to know how to modify your single.php to include this pagination on your single posts, I've written the "hack" here:
http://www.michaelaulia.com/blogs/2007/11/wordpress-pagination-plugin-and-style.html
It's not exactly perfect , but will do until we have a clear instruction here on how-to
December 14th, 2007 at 3:07 am
[...] y se le ha intentado dar aspecto de web 2.0. Está optimizado para SEO, viene preparado para el plugin digg style pagination (aunque no es necesario), y acepta [...]
December 19th, 2007 at 1:09 am
Hola, esta bueno el plugin pero en la pagina de resultados de busqueda (search.php) me sale:
It is necessary to specify the number of pages ($class->items(1000))
December 20th, 2007 at 3:43 pm
[...] y se le ha intentado dar aspecto de web 2.0. Está optimizado para SEO, viene preparado para el plugin digg style pagination (aunque no es necesario), y acepta widgets. Enlaces: Descarga del tema ; Demo y [...]
December 23rd, 2007 at 3:26 pm
[...] WP-Digg Style Paginator: cambia los vinculos "Entradas anteriores" y "Entradas siguientes" por una paginacion estilo digg. Trata de no usar los widgets y meter las cosas a mano en el theme asi aprendes algo de programacion y como funcionan las plantillas para que despues te hagas una totalmente personalizada , ademas los widgets hacen que WP sea un poco lento cuando carga la pagina. Si tenes alguna duda o necesitas ayuda en algo no dudes en preguntarme ... saludos... [...]
December 27th, 2007 at 7:00 pm
[...] WP Digg Style Pagination Plugin V 1.0 [...]
December 31st, 2007 at 1:46 pm
[...] Acabo de instalar este plugin ahora mismo para remplazar mi antiguo Pagebar, para instalarlo tenemos que ir primero a la web del author. [...]
January 2nd, 2008 at 9:40 pm
[...] pluginnya WP-digg style pagination download di [...]
January 6th, 2008 at 8:19 am
[...] WP-Digg Style Paginator Paginate your blog and posts with this plugin (Digg-style or other CSS styles) [...]
January 11th, 2008 at 1:57 pm
Hola Amigo, tengo un problema con el plugin
1.- Pagina muy bien pero No me limita los posts a los resultados que pido
/*
$p = new wp_pagination_plugin;
$p->changeClass("pagination");
$p->items(5);
$p->limit(4);
$p->adjacents(4);
*/
2.- En mi seccion de categorias (esta con url amigable).
http:/www.dominio.com/categoria/xxxx
No me pagina bien (es como que no esta recibiendo el argumento categoria) y simplemente el paginador me enlaza al index/numero_de_pag.
Te agradeceria una orientación.
Muchas gracias
Moisés R.
P.D. a ver si pones un enlace a paypal. Para hacer colaboración por tu plugin y asi poder reconocer tu trabajo (de forma voluntaria). Este plugin es bueno .
January 11th, 2008 at 6:40 pm
hola @emarts, no tengo idea que esté causando ese error, pero lo revisaré con detenimiento estos días. Estoy trabajando en una nueva versión del plugin basandome en la tabla con contadores que maneja internamente Wordpress, para evitar re-contabilizar con consultas SQL en tiempo de ejecución.
@Moises: ¿que estas tratando de hacer? No es necesario modificar el plugin de paginación si lo usas para Wordpress. Wordpress lo hace sólo.
¿Intentas implementar la clase de paginación en algún sistema por aparte? Si es así intenta leyendo la documentación de la clase, y me cuentas
Creo que sería bueno incluír un botón de paypal. ¡Lo haré ahora mismo! ...
Un saludo a todos, y gracias por sus comentarios y hacer viral todo esto. Se agradece realmente.
¡Feliz año a todos!
Yo ya estoy de vuelta nuevamente.
January 18th, 2008 at 10:39 am
there is a error in this plugin.
look at: http://uploaded.to/?id=jyiijb
February 8th, 2008 at 5:13 am
[...] pré-installés : wp-digg style paginator, flickr-rss, feedburner feedcount, gravatar, [...]
February 12th, 2008 at 9:44 am
[...] yra gan paprasta, reikia tiktai šiek tiek laiko ir kantrybės =] Taigi pamokysiu kaip įsidiegti WP Digg Style Pagination įskiepį (ačiū už nuorodą [...]
February 27th, 2008 at 6:18 pm
Hi
Thanks for the plug-in!
I installed the plug in here
http://alteredstaterecords.com/blog/
And I'm having the following happen:
The page 1 link is retaining the link to the current page.
And on page 2 the link to the previous button stays as page 2 instead of page 1
and the link to page 1 is also page 2.
And further in, say on page 9
the previous link is working right with a link to page 8
but the link to page 1 stays as link to page 9.
Is there something simple that I'm overlooking?
February 28th, 2008 at 10:11 am
I think there is a problem with the pagination in search results.
The second page of search results gives me the second page of the index, and is not related to the search keywords.
Any idea ?
March 3rd, 2008 at 11:30 am
Hola a todos, no tengo narices de conseguir que se mueva a la pagna adecuada. Es decir, el paginador le consigo meter con el estilo que deseo, pero no pagina. Alguien le ha pasado algo similar? puedes mirar un ejemplo en http://www.descenso-de-barrancos.es y en http://www.nalusurf.info tambien me pasa
April 3rd, 2008 at 8:46 pm
[...] Photo Dropper WordPress plugin- [...]
April 6th, 2008 at 6:28 pm
perfect,thanks