Announcement

#1 2012-06-27 12:38:48

JakobieH
Member
2012-06-27
3

[resolved] pagination for the top of the thumbnails(albums) pages?

I've looked for the past couple hours now, and either I'm just not looking hard enough or I skipped over the answers so please forgive me if this has been posted before.

But Basically, what I would like to do is add the pagination to the top of the page while inside an album. Several of my users have complained to me that constantly having to press the end key or scroll down to the end of the pages just to get to the next/previous page of images is getting rather tiresome.
And I sort of have to agree, and to satisfy them(and save myself from complaints) I'd like to add it to the top, above the thumbnails.



I'll add a screen shot of what I mean
Is this possible, has it been done before? If so I would really appreciate a link or an explanation.

P.S: wasn't totally sure what tags I should have selected, so I used categories and configuration.

Last edited by JakobieH (2012-06-27 12:41:31)

Offline

 

#2 2012-06-27 12:50:12

JakobieH
Member
2012-06-27
3

Re: [resolved] pagination for the top of the thumbnails(albums) pages?

Sorry for double posting, forgot to include my version: 2.3.5
I would update to 2.4, but a)I'm waiting for all the plugin creators to get time to update and make them compatible and b) Due to a string of bad luck with my webhost.. I'm just paranoid at the moment something would go wrong.

Offline

 

#3 2012-06-27 12:53:02

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: [resolved] pagination for the top of the thumbnails(albums) pages?

Hi,
use LocalFilesEditor to create a personal plugin with this content :

Code:

<?php
/*
Plugin Name: Add Navbar on top
Version: 1.0
*/

add_event_handler('loc_end_index', 'top_navbar');

function top_navbar()
{
  global $template;
  $template->set_prefilter('index', 'top_navbar_prefilter');
}

function top_navbar_prefilter($content, &$smarty)
{
  $search = '{if !empty($CATEGORIES)}{$CATEGORIES}{/if}';
  $add = '{if !empty($navbar)}{include file=\'navigation_bar.tpl\'|@get_extent:\'navbar\'}{/if}';
  return str_replace($search, $add.$search, $content);
}

?>

Offline

 

#4 2012-06-27 12:58:13

JakobieH
Member
2012-06-27
3

Re: [resolved] pagination for the top of the thumbnails(albums) pages?

hah success! Thank you very much.

Offline

 

#5 2021-11-02 01:03:09

cbiweb
Member
2021-04-04
46

Re: [resolved] pagination for the top of the thumbnails(albums) pages?

I know this is a very old post, but it's the only one I can find on the topic.

The suggested plugin for this doesn't seem to work in the latest version of Piwigo.

Does anyone know how to make it happen?

Offline

 

#6 2021-11-02 06:26:29

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7201

Re: [resolved] pagination for the top of the thumbnails(albums) pages?

Hi :-)

you can test



Code:

<?php
/*
Plugin Name: Add Navbar on top
Version: 1.0
*/

add_event_handler('loc_end_index', 'top_navbar');

function top_navbar()
{
  global $template;
  $template->set_prefilter('index', 'top_navbar_prefilter');
}

function top_navbar_prefilter($content, $smarty)
{
  $search = '{if !empty($CATEGORIES)}{$CATEGORIES}{/if}';
  $add = '{if !empty($navbar)}{include file=\'navigation_bar.tpl\'|@get_extent:\'navbar\'}{/if}';
  return str_replace($search, $add.$search, $content);
}

?>

You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#7 2021-11-02 13:40:39

cbiweb
Member
2021-04-04
46

Re: [resolved] pagination for the top of the thumbnails(albums) pages?

Unfortunately that didn't work. I'm using the Modus theme.  Maybe I need to make a test site with the default Piwigo theme and see if it shows up there.

Offline

 

#8 2021-11-02 16:58:12

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7201

Re: [resolved] pagination for the top of the thumbnails(albums) pages?

Hi :-)


you can test

Code:

<?php
/*
Plugin Name: Add Navbar on top
Version: 1.0
*/

add_event_handler('loc_end_index', 'top_navbar');

function top_navbar()
{
  global $template;
  $template->set_prefilter('index', 'top_navbar_prefilter');
}

function top_navbar_prefilter($content)
{
  $search = '{if !empty($CATEGORIES)}{$CATEGORIES}{/if}';
  $add = '{if !empty($thumb_navbar)}
  {include file=\'navigation_bar.tpl\'|@get_extent:\'navbar\' navbar=$thumb_navbar}
{/if}';
  return str_replace($search, $add.$search, $content);
}


?>

You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#9 2021-11-02 19:49:23

cbiweb
Member
2021-04-04
46

Re: [resolved] pagination for the top of the thumbnails(albums) pages?

Sorry, still not working.  It must be something I have done with other plugins or customization. When I try a default installation I will know more.  Thank you for trying. :)

Offline

 

#10 2021-11-02 20:43:43

rjpp
Member
2021-07-13
25

Re: [resolved] pagination for the top of the thumbnails(albums) pages?

Thought I'd try that myself but something's gone very wrong... as soon as I hit save on the local file editor then refreshed the site (Bootstrap Darkroom), it's basically stopped working completely and now gives HTTP 500 errors (admin page doesn't work either)
Any ideas, ddtddt?

What file(s) do I need to overwrite via FTP to get things back working again?
####

Edit: ignore the above, found it.
Replacing config.inc.php with the .bak version did it.

Haven't a clue what's in that code that caused such a calamity though, my coding isn't that advanced! :)

Last edited by rjpp (2021-11-02 20:58:43)

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact