Member
Member
davidarnoult   08-07-2020, 12:29
#1

Is there an easy way to select random images from an album and its subalbums, in recursive mode?

Adding a parameter to getRandomImagesAlbum() would be great.

  • @param mixed $rootAlbum optional album object/folder from which to get the image.
  • @param bool $daily set to true to change picture only once a day.

Would it be difficult?
Or another recursive way already exists?

Thanks...

Administrator
Administrator
acrylian   08-07-2020, 12:38
#2

Use get/printImageStatistics from the image_album_statistics plugin with its random option instead.

These randomimages function will get deprecated soon and switch to use those function internally. The only thing special on these is teh "picture of day" option which will be moved to its own function.

Member
Member
davidarnoult   09-07-2020, 08:23
#3

Thanks. I will to that, it makes sense.

Can you tell me more about new "picture of the day" own function?

I used to use this option but it does not work for me so far (always same image chosen, even when day changes, strange).

When will it be available (1.5.X ou in next major release)?

Administrator
Administrator
acrylian   09-07-2020, 08:26
#4

Can you tell me more about new "picture of the day" own function?I used to use this option but it does not work for me so far (always same image chosen, even when day changes, strange).

It might be a bug in this old function. Generally it chooses one random image and stores it so the whole day that image is shown and not a new random one each page visit. The new function will just mirror this behaviour by using the iamge_album_statistics function internally and it will be part of the plugin then.

That change likely will be in 1.5.8.

Member
Member
davidarnoult   09-07-2020, 11:35
#5

I confirm it is buggy. Looking forward for 1.5.8 then ;-)

Administrator
Administrator
acrylian   09-07-2020, 11:54
#6

Random is of course a bit random, so if for some reason it randomly picks the same image again, there is not much to be done unless extra checks. But I think this is really not much of an issue to actual visitors.

Also if you have the html cache enabled with a long time frame until it updates itself there will be naturally no change until then.

Member
Member
davidarnoult   09-07-2020, 12:00
#7

For sure, I have tested with deactivated html cache and cleared it but always same image is picked again and again... What is strange is when I force update with CTRL+F5, a new image appears. But at the second loading, it always comes back to previous image. It is strange... I will wait until the new function then.

Administrator
Administrator
acrylian   09-07-2020, 12:07
#8

What is strange is when I force update with CTRL+F5, a new image appears. But at the second loading, it always comes back to previous image. It is strange.

This somehow sounds like a too persistent browser cache. It is really overly persistent these days with all browsers I know (and on most you cannot even disable it anymore) and you constanlty have to force clear it several times when testing CSS…

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.