Page 1 of 1

Images in Sidebar

Posted: Thu Mar 15, 2007 12:19 pm
by jermen
Is it possible to display RANDOM images of the image gallery of serendipity in the side bar? because I cant find any plugin that does this for me.

Re: Images in Sidebar

Posted: Thu Mar 15, 2007 1:33 pm
by garvinhicking
Hi!

Sadly there isn't.

Displaying random images is actually quite hard for the database. There is only a solution that allows random ordering for MySQL, but this does notw ork in SQLite and PostgreSQL. Since we developed the internal media database to work on all of them, there is no functionality to return a random image.

And since the image sidebar plugin uses the media gallery, it usees the internal s9y function to display images - and since there is no randomize core option, the plugin itself also can't offer one.

Best regards,
Garvin

Posted: Thu Mar 15, 2007 2:42 pm
by mgroeninger
I think I might be confused, but I'm pretty sure that the "Unified Sidebar Image Display" plugin can do random images from the media gallery.

I'm pretty sure I wrote it so that it just uses a count of all the images (yeah, it pulls all the images in just to count them, which means it's a RAM hog) and the php rand function to pick however many the user specifies...

It should support random images, directory limitation, and should cache the results pretty well to keep memory usage down as much as it can.

Posted: Thu Mar 15, 2007 2:45 pm
by mgroeninger
Oh, yeah...

jermen -> you will need to select Media Library for the "source" setting. And you might need to save the settings twice before all the options show up (I'll have to look into that bug).

Garvin -> Hi again! Hope life is going well!

Posted: Thu Mar 15, 2007 2:55 pm
by garvinhicking
Hi Matthew!

Nice to see you back posting on the forum here. As you can see there are some things you did that I simply have no knowledge of, and postings where I couldn't fill your space *g*

Hope all is well for you. :)

Now back to the original question: I might of course be mistaken :) I searched the code for "rand" and did see some randomizing code. But I didn't fully understand it and thought that might be a different thing. Sorry then for all the confusion :(

Best regards,
Garvin