Hello/Hi/Greetings,
I would like to add something like "recently added" from PWG_stuffs but not as a block but under e.g. under a menu. But I didn't find any other plugin or useful piece of code. Is there something out there? Possibly with a date picker to select a date for "recently" ;-)
I already found "Display a calendar by posted date" but that seems to be not to user-friendly. Or maybe it can be used with a "pre-set date" to avoid navigation through the calendar and to show the results page right away?
Thanks,
Thomas
Piwigo 2.9.5
Operating system: Linux
PHP: 5.6.40 (Show info) [2019-07-27 18:47:05]
MySQL: 5.5.60-0+deb7u1-log [2019-07-27 18:47:05]
Graphics Library: External ImageMagick 6.8.9-9
Piwigo URL: http://bilder.feuster.com
Offline
Reply to self:
Have found the "Specials Menu" that shows Calendar, Recent Photos, ...
Now I only need to figure out why no photos are shown when I select a date/month with photos. Any ideas?
Offline
I had time to look into this a bit deeper.
Seems like in section_init.inc.php in the "recent pictures section" the query retrieves some pictures and adds them to $page like:
Array ( [0] => Array ( ) [1] => Array ( ) [2] => Array ( ) [3] => Array ( ) [4] => 11 [5] => 0.0045878887176514 [6] => 999 [7] => Array ( [0] => 12597 [1] => 12582 [2] => 12583 [3] => 12584 [4] => 12585 [5] => 12586 [6] => 12587 [7] => 12588 [8] => 12589 [9] => 12590 [10] => 12591 [11] => 12592 [12] => 12593 [13] => 12594 [14] => 12595 [15] => 12596 ) [8] => 0 [9] => 0 [10] => [11] => recent_pics [12] => Recent photos )
But during parsing via index.tpl somehow the pictures aren't shown under the map section (see http://www.feuster.com/piwigo/index?/recent_pics).
So surely I have some setting somewhere that leads to this behavior. Any idea where to look for?
Thanks,
Thomas
Offline
Answer to self :-)
Some digging showed that its my own theme elegant_slick that hides the recent pics. The code didn't take into account that the event loc_end_index_thumbnails can happen without a category page...
Now the only thing I have ran into is the same as already asked a few years ago (https://piwigo.org/forum/viewtopic.php?id=25841): any easy way to change the sort order of the recent pics results?
I have managed to do with code like
add_event_handler('loc_end_index_thumbnails', 'reorderThumbs'); function reorderThumbs($tpl_thumbnails_var) { global $page; //print_r('reorderThumbs'); // if ($page['section'] == 'recent_pics') <- from section_init.inc.php if (!empty($page) and ($page['section'] == 'recent_pics')) { //print_r('reordering'); $tpl_thumbnails_var = array_reverse($tpl_thumbnails_var); } return $tpl_thumbnails_var; }
but there might be a better way for this?
I have seen the reference to $page['super_order_by'] but there seems to be nothing in the documentation on this...
Offline