On Integration - Image gallery it says "Now you can insert the following into a php-enabled textarea (eg. a node body, custom block or other area)" But there is no code there... I would really like to use this feature and would be grateful if someone could point me in the right direction!

Cheers
Andy

Comments

andykemp’s picture

I had a hunt through the integration module, and it looked like the code should be:

<?php
// Self explanatory code.
$playlist = swftools_playlist_from_image_gallery(11);
print swf_list($playlist);
?>

But when I do this is seems to generate

<div class="swftools-wrapper wijering-imagerotator ">
<div id="ufo-id-11813152611" class="swftools ufo" 
swftools='{ "wmode": "opaque", 
"bgcolor": "#FFFFFF", 
"menu": "false", 
"play": "true", 
"loop": "false", 
"quality": "autohigh", 
"align": "l", 
"salign": "tl", 
"scale": "showall", 
"swliveconnect": 0, 
"version": "7", 
"base": "http://www.warwickbaptists.org.uk/beta/files",
"src_path": "modules/swftools/shared/flash_image_rotator/imagerotator.swf", 
"src": "http://www.warwickbaptists.org.uk/beta/modules/swftools/shared/flash_image_rotator/imagerotator.swf", 
"height": 200, 
"width": 600, 
"flashvars": "showicons=true\x26
backcolor=0xFFFFFF\x26
rotatetime=3\x26
transition=random\x26
overstretch=false\x26
file=http%3A//www.warwickbaptists.org.uk/beta/files/playlists/b0c6caa973c1e0ec9406be970cf8ce8f.xml" }' >
<p>Sorry, flash is not available.</p></div></div><br class="clear" />  </div>

But this generates the following error messages:

    * Could not display the flash because "files/files/images/PP.SG.3.preview.JPG" does not appear to exist.
    * Could not display the flash because "files/files/images/PP.SG.4.preview.JPG" does not appear to exist.
    * Could not display the flash because "files/files/images/PP.SG.5.preview.JPG" does not appear to exist.
    * Could not display the flash because "files/files/images/PP.SG.6.preview.JPG" does not appear to exist.
    * Could not display the flash because "files/files/images/PPWC2.preview.jpg" does not appear to exist.
    * Could not display the flash because "files/files/images/PPWC3.preview.jpg" does not appear to exist.

I have checked the generated xml file and this has paths to the images of files/images/PP.SG.3.preview.JPG, so it seems it is adding the files directory to both the base and the path.

I tried manually hacking the base attribute in the swftools.module file but this didn't seem to fix the problem...

Any ideas why? and how to fix this?

Thanks
Andy

andykemp’s picture

Tried the upload version:

<?php
// Self explanatory code.
$playlist = swftools_playlist_from_upload();
print swf_list($playlist);
?>

and that works fine, so it would appear to be an issue with the generated xml from swftools_playlist_from_image_gallery. Should the paths be in xml from the image gallery be full paths as they are for the upload module but not for the image gallery one...

andykemp’s picture

Just double checked and the path in the xml file looks like

http://www.warwickbaptists.org.uk/beta/files/files/images/Tiddlers Birthday Bash 218.preview.jpg

so at some point when it is generating the xml it is adding the file folder twice.

I have uninstalled SWFTools, and reinstalled the latest dev and am still having problems...

Andy

funkeyrandy’s picture

me too!!!!!

plus i need to get the description data into the xml..its just not there!!

thanks!

andykemp’s picture

I still can't work out where the second Files folder is coming from but I found a nasty hack which got it working. So if anyone wants a quick and dirty fix replace line 105 in the swftools_integrate module with:
$files[$nid->nid] = substr($node->images[$derivative],6);

It just strips the first 5 characters off the image location...

It got it working which is nice, but a better more permanent solution would be good!

sime’s picture

Hi andykemp

I've updated the demo page with the php to use:
http://emspace.com.au/node/33

But I guess there is something else happening there... on the /admin/media/swf/embed page, there is a "File Locations" section. Can you tell me what value is in there for "Media directory url" ?

Also, what is your "File system path" in /admin/settings/file-system ?

andykemp’s picture

Media directory url:
http://www.warwickbaptists.org.uk/beta/files

File System Path:
files

sime’s picture

Status: Active » Fixed

Fixed in dev version, make sure shownavigation is true.

andykemp’s picture

Status: Fixed » Active

Sorry, I'm sure I am being slow but I have upgraded to the latest dev, but can't find the option you mention. Where should I be looking... Without changing this setting it is it still doesn't work.

sime’s picture

Title: Integration with Image Gallery » Extra "files" in media path

I'm sorry, I got this issue mixed up with another, ignore my comment there.

While there is a new release, I didn't identify the cause of your extra "files" at this stage.

paxton’s picture

I have the same problem and used the following workaround.

files directory: www.domain.de/drupal/files
swf tools uses this instead: www.domain.de/drupal/files/files

Therefore I've added this to my settings.php

$conf = array(
    'swftools_media_url' => 'http://www.domain.de/drupal', // No trailing slashes!
  );

Now it does work (with Wijering Flash plugins - I still have problems with the others)...

Stuart Greenfield’s picture

Status: Active » Needs review

Think this is now fixed in the latest dev code. I haven't seen any cases of the "double files" with recent testing so hopefully it is now cured.

Stuart Greenfield’s picture

Status: Needs review » Fixed

Setting to fixed as new releases of SWF Tools 5.x-2.0 and SWF Tools 6.x-1.1 are now available which address this issue.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

alex_ost’s picture

Status: Closed (fixed) » Needs review

Hi !

in fact, it seems there's a problem with the tag parameters parsing. Here's a quick and dirty fix (didn't bother to produce a patch) : line 1021, change
preg_match_all('/\s+?(\w*)=[\"](.*?)[\"]#?/', $passed_parameters, $match_vars[$key]);
to
preg_match_all('/\s?(\w*)=[\"](.*?)[\"]#?/', $passed_parameters, $match_vars[$key]);
(suppress the "+" after the "\s")

Thanx for this module !

Stuart Greenfield’s picture

Status: Needs review » Closed (fixed)

The regex is design to catch multiple spaces between parameters, hence the use of +? rather than just ?. The filters are working with the current format so I don't currently plan to change them.