Closed (fixed)
Project:
Gallery
Version:
5.x-1.0
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
25 Aug 2007 at 14:00 UTC
Updated:
28 Aug 2007 at 15:49 UTC
Hello folks,
is it possible to show a random picture from a certain album in drupal?
Let's say you have a user profile page in drupal and want to show a random picture from this user's gallery on the profil page. How could this be done?
Ok it is no big deal to show a random picture, but how do I tell gallery to use only a certain album?
Regards,
macco
Comments
Comment #1
macco commentedI found a solution, that works for me. In case your are interested.
I wrote a function that I can use in the user-profile.tpl-file, it returns the random imagethumbnail as a link to original picture, as a parameter it needs a drupal $user-opbject.
I hope this helps, if I could do things more elegant or I missed something, please let me know.
Regards,
macco
Comment #2
macco commentedI'm sorry,
please delete the two print-statements, they where only for debugging purposes.
Comment #3
profix898 commentedUsing the latest development version of gallery.module 5.x-2.x-dev you can configure the block to use items from the useralbum only and include this block in the profile template. To include the first available image block (image-0) you would use the following snippet: