Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Bugo on October 25, 2011, 11:33:06 AM

Title: Smart Pagination
Post by: Bugo on October 25, 2011, 11:33:06 AM
Link to the mod (https://custom.simplemachines.org/index.php?mod=3235)

Changing of standard pagination's view with CSS and default button class.

If there is only one page, the pagination is hidden.

This work is licensed under the BSD 3-Clause (https://opensource.org/licenses/BSD-3-Clause)
Title: Re: Smart Pagination
Post by: agent47 on October 26, 2011, 07:16:43 AM
Just installed it! Looks sexy.... Goes really well with the site...
Thanks a lot Bugo.....
Title: Re: Smart Pagination
Post by: 4Kstore on October 26, 2011, 09:11:01 AM
Nice style!
Thanks for sharing! :)
Title: Re: Smart Pagination
Post by: Chair on October 26, 2011, 05:40:44 PM
I did this on one of my Inferno theme modifications over at DzinerStudio - I'm very happy to see this has become a modification. :)
Title: Re: Smart Pagination
Post by: TheCodfather on October 26, 2011, 06:21:13 PM
very nice thanks
Title: Re: Smart Pagination
Post by: Robert. on October 31, 2011, 02:49:02 PM
Great mod :)
Title: Re: Smart Pagination
Post by: MrMike on November 02, 2011, 09:27:34 AM
Great mod, looks very nice. I'll be using this on most or all of my sites from now on.  :)
Title: Re: Smart Pagination
Post by: androgyn3 on November 09, 2011, 02:44:14 AM
Hi, very cool mod.

Work well, but when i use "not read" link for see the not read message, this is the old pagination (original smf), the modification is not apply in /forum/index.php?action=unread

Can you fix this ?
Title: Re: Smart Pagination
Post by: Bugo on November 09, 2011, 04:03:12 AM
Thanks for the report, I'll see.

Do u mean these links? (see attachment)
Title: Re: Smart Pagination
Post by: androgyn3 on November 09, 2011, 05:32:52 AM
Hi bugo,

Yes, all is normal as your screen but not in /forum/index.php?action=unread

See attachement
Title: Re: Smart Pagination
Post by: Bugo on November 09, 2011, 07:01:00 AM
Try this updated css file.
Title: Re: Smart Pagination
Post by: teos55 on November 09, 2011, 10:19:59 AM
Great mod, thanks ...

SMF 2.0.1  dfeault theme Simple Portal 2.3.3

  Noticed that if the topic is only one page, then "go top"  ( or whatever the english is ) is not shown . Only back and forwrd are shown.  There is no problem if the topic has more then one page .
Title: Re: Smart Pagination
Post by: Bugo on November 09, 2011, 11:42:03 AM
Don't forget - it's a "smart" pagination ;) It's a feature, not a bug.
Title: Re: Smart Pagination
Post by: teos55 on November 09, 2011, 11:48:27 AM
Bugo,
  Before the mod , "go top" button was a standart future for all topics whether they've got one page or more.
So "smart pagination" should go on top of it. Am I wrong ?
Title: Re: Smart Pagination
Post by: Bugo on November 09, 2011, 12:01:07 PM
Well, if you want to see "go top" button, just remove this block from Subs.php:

if (!strpos($pageindex, "...") && !strpos($pageindex, "2"))
$context['html_headers'] .= '
<style type="text/css">
.pagelinks, div.mypages, .pagesection span { display: none; }
.nextlinks { position: absolute; margin-top: 10px; }
.nextlinks_bottom { position: absolute; }
</style>';
Title: Re: Smart Pagination
Post by: teos55 on November 09, 2011, 12:30:52 PM
 Great ! ,
Bugo, thanks alot.
Title: Re: Smart Pagination
Post by: androgyn3 on November 10, 2011, 04:59:08 AM
Hi Bugo,

QuoteTry this updated css file.

Yes, seem fixed with this, thank  :).

I have a question not for this mod, how i can see immediatly the css change ? SMF seem have a long cache, when I do a change in a CSS, i empty the smf cache, my firefox cache but it's always the old css, the change is very long to appear.
Title: Re: Smart Pagination
Post by: Bugo on November 10, 2011, 06:29:32 AM
Usually enough to clear cache on Admin area -> Maintenance -> Forum Maintenance -> Routine -> Empty the file cache
Title: Re: Smart Pagination
Post by: go- on November 12, 2011, 11:04:34 AM
http://xxx/index.php?action=printpage;topic=37.0
8: Undefined index: page_index
File: /home/www/xxx/html/Sources/Subs-Pagination.php
Line: 25


Any idea with this?
The crawlers are probably the only ones that try printing topics...
Nevertheless it's annoying to get these errors a couple of times a day.
Thank you.

Edit: Not only happening on printing pages.

same error appears in log when posting reply:
http://xxx/index.php?action=post;topic=7.190;last_msg=2021

and

http://xxx/index.php?/topic,7.msg2021/topicseen.html

and

http://xxx/index.php?/topic,7.msg2021.html
Title: Re: Smart Pagination
Post by: Bugo on November 12, 2011, 12:33:36 PM
Just install a new version => 0.8
Title: Re: Smart Pagination
Post by: go- on November 12, 2011, 12:39:55 PM
thank you. errors gone.  ;)
Title: Re: Smart Pagination
Post by: impreza on February 21, 2012, 09:28:30 AM
Great and useful

I have a suggestion - to be a scroll button to start and end pages

Rewind That every one of one position and two of all the items to the last page

How do I turn off limit the number of pages - there are two buttons next to each side of the page - this is an oversight
Title: Re: Smart Pagination
Post by: impreza on April 03, 2012, 11:31:10 AM
badly it works with Simple Portal - the home page
Title: Re: Smart Pagination
Post by: impreza on May 10, 2012, 03:42:59 AM
It's obviously not a problem with SimplePortal. You need to add this line as the second line in the pagination.css file:


.sp_page_index strong,
Title: Re: Smart Pagination
Post by: tMicky on May 12, 2013, 02:42:12 PM
Quote from: impreza on May 10, 2012, 03:42:59 AM
It's obviously not a problem with SimplePortal. You need to add this line as the second line in the pagination.css file:


.sp_page_index strong,

where does one find pagination.css?
Title: Re: Smart Pagination
Post by: Bugo on May 12, 2013, 04:03:46 PM
/Themes/default/css dir.
Title: Re: Smart Pagination
Post by: tMicky on May 12, 2013, 05:56:39 PM
Quote from: Bugo on May 12, 2013, 04:03:46 PM
/Themes/default/css dir.
thank you  :)
Title: Re: Smart Pagination
Post by: Biology Forums on August 22, 2013, 09:58:31 PM
Good mod.

I removed the margin-right: 3px; (I thought it was a bit unnecessary)
Title: Re: Smart Pagination
Post by: Antechinus on January 15, 2015, 03:31:44 PM
Bugo, nice mod, but it doesn't generate consistent presentation on action=unread and action=unreadreplies. Any chance of updating it so it'll handle those pages too? AFAICT it's just a couple of additions to hooks.php and Subs-Pagination.php.
Title: Re: Smart Pagination
Post by: Bannockburn on February 28, 2016, 05:59:42 AM
Any tips on making this work for 2.0.11? Right now it makes it invisible and spitting out only "<!-- Smart Pagination -->" in the code.
Title: Re: Smart Pagination
Post by: spiros on May 12, 2018, 06:07:35 AM
I get this error (php 7.1)

2: Parameter 1 to smart_pagination_buffer() expected to be a reference, value given

Posted here more info: https://www.simplemachines.org/community/index.php?topic=560303.0
Title: Re: Smart Pagination
Post by: d3vcho on May 12, 2018, 06:10:16 AM
Try to change this:

function smart_pagination_buffer(&$buffer)
{
global $context, $txt;

if (isset($_REQUEST['xml']) || empty($context['page_index'])) return $buffer;


To:

function smart_pagination_buffer($buffer)
{
global $context, $txt;

if (isset($_REQUEST['xml']) || empty($context['page_index'])) return $buffer;
Title: Re: Smart Pagination
Post by: spiros on May 12, 2018, 06:19:30 AM
That edit fixed the error, but disabled the mod functionality.
Hmmm, or maybe not, maybe something like nginx or Memcache affecting this mod as sometimes it displays the css changes and others not.
Title: Re: Smart Pagination
Post by: wylekk on February 28, 2020, 07:53:49 AM
Поставил новую версию и посыпались ошибки, на smart_pagination_1.0.smf21 ошибок нет, только не везде стрелки есть.

Тип ошибки: Общие
2: array_merge(): Argument #1 is not an array
https://site.ru/index.php?action=profile;u=14326;area=alerts_popup;counter=3
/home/admin/web/site.ru/public_html/Sources/Class-SmartPagination.php (Строка 47)



Тип ошибки: Неопределенные
8: Undefined index: page_index
https://site.ru/index.php?action=profile;u=14326;area=alerts_popup;counter=3
/home/admin/web/site.ru/public_html/Sources/Class-SmartPagination.php (Строка 41)
Title: Re: Smart Pagination
Post by: Sudhakar Arjunan on September 17, 2020, 03:37:56 PM
I have installed on 2.1 beta 1 but cannot see update.
Do I have some settings to enable.
Title: Re: Smart Pagination
Post by: Sudhakar Arjunan on September 17, 2020, 05:24:37 PM
Type of error: General
The callable SmartPagination::hooks could not be called.
Title: Re: Smart Pagination
Post by: Portugal on October 13, 2020, 11:56:16 AM
Hi Bugo,

You go to update this good mod to works well on 2.0.1.7 version? It gives error if instaled.

Thanks in advance
Title: Re: Smart Pagination
Post by: gevv on March 01, 2022, 03:38:54 PM
Hi,

Should be included in the core  ;D