Hello/Hi/Greetings,
I am developing a website in which i have installed piwigo and it is working fine. Huge thanks for developers.
I have used Piwigo-random library (https://github.com/moy/piwigo-random) from git hub to show some random images from my gallery in my home page.
But now i want to show recent images in home page. how can i do that ?
please help me by providing some solution.
Piwigo version: latest
PHP version: latest
MySQL version: latest
Piwigo URL: http://
Offline
hkk007 wrote:
But now i want to show recent images in home page. how can i do that ?
Home page of who ... Piwigo?
If yes you can do that with PWG stuff plugin http://piwigo.org/ext/extension_view.php?eid=190
or method 2 ... you can go in you theme templates and edit them, use that library that you are using now because smarty templates allow you to write html and php inside them.
Offline
I guess it's a separate website.
Just use that piwigo-random plugin and edit [Github] piwigo-random file piwigo-random-backend.php@L96
replace "&order=random" with "&order=date_available%20desc"
Last edited by teekay (2017-10-27 22:33:06)
Offline
please give more details
the eliz82 solution can be completed by using the /index.php?/recent_pics page in the local config for parameter which allows you to set another index/home page
Offline
Sorry for the late reply.
i want to show the recent images in the home page of my website.not gallery home page.
i will try your answer, editing piwigo-random-backend.php and replyyou soon. thanks for the support.
Offline
teekay wrote:
I guess it's a separate website.
Just use that piwigo-random plugin and edit [Github] piwigo-random file piwigo-random-backend.php@L96
replace "&order=random" with "&order=date_available%20desc"
i have changed as you said piwigo-random-backend.php#L96
but after that images show in some other order. not recent posted order
can you tell me how api is called to show recent images.
this is the gallery
http://malikdeenargreatjumamasjid.com/newgallery/
i want to show recent photos in this page(visit on phone)
http://malikdeenargreatjumamasjid.com/m/index.php
but it shows some other order
Offline
Hi,
the order looks correct, but it seems to start with an offset.
Look at http://malikdeenargreatjumamasjid.com/n … ories/flat - sort order date created new -> old, the second row is what gets displayed (pic ids 53, 52, 51, 50 in that order)
Does that piwigo-random-backend.php thing fire on every request, or is it caching things somehow? If you call the API directly, it pics the latest images.
http://malikdeenargreatjumamasjid.com/n … ble%20desc
If you know some jQuery, you could also use something like this instead of piwigo-random:
<div id="recent-images"></div> <script type="text/javascript"> var pwg_api = "http://malikdeenargreatjumamasjid.com/newgallery/ws.php?format=json&method=pwg.categories.getImages&recursive=true&per_page=5&recursive=true&order=date_available%20desc"; $.getJSON(pwg_api, function (json) { var images = json.result.images; $.each( images, function ( i, image ) { var src = image.derivatives.xlarge.url; var height = image.derivatives.xlarge.height; var name = image.file; var link = image.categories[0].page_url; $('#recent-images').append('<img class="img-fluid" src="' + src + '" alt="' + name + '"/>'); }); }); </script>
Last edited by teekay (2017-10-28 09:51:29)
Offline