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

rapsli’s picture

Assigned: sockah » Unassigned
Category: support » feature
Priority: Normal » Critical

Thanks. 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).

sockah’s picture

Thanks for the quick response.

rapsli’s picture

check out the latest dev version...

jaguarondi’s picture

I 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.

rapsli’s picture

Thanks. You are indeed right. It seems like I just got a lil mixed up with the versions.

rapsli’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

ktonini’s picture

is there any way to change this to most recent image instead of random?

rapsli’s picture

only in the code.

ktonini’s picture

Would it be difficult to make that another available block?