Hi,
I would like to add an additional navigation feature, on the top of each album page, to be able to select the 'Next' Album, or the Previous Album. This would make it much easier to swiftly browse through a large set of albums.
Without this feature, you need to go up one level to view the parent album, and then go down and select the child album. And then up again to go down.... So to speak.
I understand this can be done with a Template, and I have found the place in Index.tpl (using the default theme) where the code should be added. But I am unaware of how to retrieve the information on which albums is the previous/next, based on the album I am currently viewing.
Attached is a mock-up screenshot on how I want the navigation to work.
"Prev" should be a link to " /Blomgren / 1997"
"Next" should be a link to " /Blomgren / 1999 "
Any pointers on how to get this info would be greatly appreciated!
~Mike
Offline
Hello
you're right retrieve which album is next/previous requires a mysql request
sry I don't have time for that kind of dev Until you have knowledge on that or someone else with time develop it, could you open a ticket in our bugtracker ? http://piwigo.org/bugs/bug_report_advanced_page.php thx
that's an interesting idea
Offline
Done. Mantis 2812.
All I need is the SQL or pwg_function to retrieve the Next/Previous Album (using the current Sort Order of couse). Once done, I can probably figure out how to implement it in the index.tpl.
Thanks,
~Mike
Offline
Bump. Any ideas on how to write the Previous Album/Next Album Query? (see my original request above)
Thanks,
~Mike
Offline
hi
as far as i remmeber you might try to search in the global variable like $page or in the template variable set
Offline
I coded it as a plugin. With the help of the skeleton plugin, I figured out a way to solve it without modifying the templates.
[extension by miblo69] PrevNext
Cheers,
~Mike
Offline
Hi
Can you (or someone) fix it for 2.8?
Fatal error: Uncaught Error: Cannot use object of type PwgError as array in /home/gallery/plugins/prevnext/include/public_events.inc.php:41 Stack trace: #0 /home/gallery/include/functions_plugins.inc.php(279): prevnext_add_button() #1 /home/gallery/index.php(364): trigger_notify('loc_end_index') #2 {main} thrown in /home/gallery/plugins/prevnext/include/public_events.inc.php on line 41
[Edit: error data]
Last edited by netizen (2016-03-17 10:17:34)
Offline
I saw the error too after upgrading. I will attempt a fix, but if anyone has an idea on what changed between 2.7 and 2.8 - pls let me know.
Offline
in the zip [extension by miblo69] PrevNext there is two main.inc!
Offline
Fixed the issue, so it's now compatible with 2.8.
Removed extraneous files.
Offline
Hi miblo69,
I was interested in this previous/next tool too.
So i have installed the plugin you made. Thanks for it!
But i'm a french user.
So I add multilingual support (english and french).
If you are interested about this improvement of your code, I can transmit you the files.
Note : it seems that many code lines and files are unused in your plugin. I think a big clean up of the code would be really opportune...
Cheers
MacGeol
Offline
Hello I tried the extension with the latest version of Piwigo 2.10.2 with the default theme. But i couldn't get it working. Does it work with the current version and standard template. If so what do i need to do?
Offline
Hi,
Wow, I am surprised yet pleased that there still is an interest in this Plugin :)
I haven't updated it in years, and I use it with the 'elegant' theme where it works well in 2.10.2.
For other themes, I don't know. And I don't really have the time/knowledge/know-how to quickly have a look and change the code, if needed.
Sorry.
Offline
Hey,
I just noticed that the "prevnext" plugin doesn't work anymore (although it's still shown as activated).
Could you make it compatible with the current version, please?
I like it very much and find it quite useful, for example when I put my travel photos in galleries and can quickly go to the next site.
Thanks!
Offline