Closed (fixed)
Project:
Fast Gallery
Version:
6.x-1.2RC5
Component:
Code
Priority:
Critical
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
17 Aug 2008 at 16:59 UTC
Updated:
29 Jul 2009 at 18:20 UTC
Great module here. It was very helpful for me to set up a gallery on my Web site.
However, I also wanted to create a block so I could feature a couple screenshots at random from my gallery on the sidebars. The screenshots would then link to fast gallery.
Could anybody suggest to me the best way to go about this?
Many thanks.
Comments
Comment #1
rapsli commentedThanks. So far there's no way of doing this. Could though be a nice feature for the next version, and also easy to implement (at leat the simple version -> just a random picture from the gallery).
Comment #2
sockah commentedThanks for the quick response.
Comment #3
rapsli commentedcheck out the latest dev version...
Comment #4
jaguarondi commentedI had 6.x-1.2 installed and when playing with new themes I just installed, I came upon this: Fatal error: Call to undefined method FastGallery::getRandomPicture() in /var/www/localhost/htdocs/drupal/sites/all/modules/fast_gallery/fast_gallery.module on line 760
I don't know how switching to one theme suddenly installed the fast gallery block (with 6.x-1.2 stable) but from then on I couldn't access anything.
I then added the following getrandomPicture function:
/**
* Get one random pic from the db
* @return random pic
*/
public function getRandomPicture() {
$sql = "SELECT gid,path,gid FROM {fast_gallery} ORDER BY RAND()";
$result = db_query($sql);
$pic = db_fetch_object($result);
return $pic;
}
I don't know anything to php (yet), that's just copy paste from your code but it works and might be useful to you.
David
p.s. just a detail, but the fast_gallery module lists itself in 'other' in the module administration page, while other modules (i.e. Lightbox2) lists themselves under 'Other' (Capitaized). You can update it in fast_gallery.info line 5.
Comment #5
rapsli commentedThanks. You are indeed right. It seems like I just got a lil mixed up with the versions.
Comment #6
rapsli commentedComment #7
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #8
ktonini commentedis there any way to change this to most recent image instead of random?
Comment #9
rapsli commentedonly in the code.
Comment #10
ktonini commentedWould it be difficult to make that another available block?