I've got the Slideshow Creator working fine when displaying images from a URL or a directory. But...

How does it display images from within my drupal image gallery module (http://drupal.org/project/image).

[slideshow:2, rotate=10, blend=10, layout=default, name=Banner, height=100, width=300, img=|image/tid/1||Kitchens|descrip|_self|, img=|node/47||Cobblestones|DESCRIP|_self|]

Do I have to use the real file URL ? ie. files/images/sample.jpg ?

I'd like to set it to read all images from a specified image gallery.

I've tried setting the image link to "image/tid/1" or "node/47", but havn't worked it out yet. Any help appreciated.

Comments

alynner’s picture

I hacked it to work with my gallery.

Just add this code to the if/else at line 151:

		else if (trim(strtolower($attribute[0])) == 'gal' ) { // gal tag: scan all images from a given gallery (tid)
          $dir_attributes = explode('|' , $attribute[1]);
		  if (!empty($dir_attributes[1]) and $files = slideshow_creator_gallery($dir_attributes[1])) {
			foreach ($files as $file) {
              $file = base_path() . preg_replace('/^\.\//', '', $file);
              $ss['total']++;
              $ss[$ss['total']] = array(
                'src' => $file,
                'link' => !empty($dir_attributes[3]) ? $file : 'javascript: void(0);',
                'title' => !empty($dir_attributes[4]) ? check_plain(preg_replace('|\\\,|', ',', trim($dir_attributes[4]))) : '',
                'description' => !empty($dir_attributes[5]) ? check_plain(preg_replace('|\\\,|', ',', trim($dir_attributes[5]))) : '',
                'target' => !empty($dir_attributes[6]) ? check_plain(trim($dir_attributes[6])) : '_blank',
              );
            }
          }
        }

and then add this custom function at the end of the file:

function slideshow_creator_gallery($tid){
	$sql = db_query('SELECT DISTINCT(n.nid), n.sticky, n.title, n.created FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid WHERE tn.tid = '.$tid.' AND n.status = 1 ORDER BY n.created');
	while ($arr = db_fetch_object($sql)) {
		$node = node_load($arr->nid);
		$files[] = $node->images[preview];
	}
	return $files;
}

To use this, simply enter your input tags like so: [slideshow:2, rotate=4, blend=2,width=634,gal=|$tid||$link||||]

works for me anyway, hopefully someone else can make use...

alynner

brmassa’s picture

Status: Active » Fixed

it seems its a fixed issue!

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

mariagwyn’s picture

Version: 5.x-1.x-dev » 6.x-1.29
Status: Closed (fixed) » Active

It seems that alynner HACKED this in the module file to work. Is it possible to add this as standard functionality within the module itself (since not all of us want to hack the module itself)? A way to link to galleries rather than images or directories? This would be VERY helpful as it would require less work for sites that need very easy user interface.

I am most interested in this on 6.x, and so changing the settings.

Thanks,
Maria

clintthayer’s picture

Can't seem to get this to work... Put the code in and passing the $tid to a specific term (album)... which in my case was 9. so I have...

[slideshow: 2, rotate=3, blend=3, height=300, width=300, gal=|9||||||]

Any thoughts?

brmassa’s picture

Status: Active » Closed (won't fix)

Guys, there is a drupal.org initiative about unifying some modules. Since Slideshow Creator is by far less powerful and flexible and other solutions, I will not support it more. Please, take a look on other similar modules.