Hi folks,

I'm trying to modiy the FPSS module so that my client can upload a custom thumbnail.

I've created a field with CCK which deposits files in files/thumbs/, and instructed the client to name it the same name as the main image. So far, so good.

Now the only issue is getting FPSS slideshow to LOOK in that folder for the thumb.

The issue I'm running into is fairly simple I think--here is the code:
$slideimage = $slideimagefolder.$slide['slideimage'];

I need to insert "thumbs/" between the filename & the folder name.

however, when I created a variable ($thumbs, set to "thumbs/") and appended it:
$slideimage = $slideimagefolder.$thumbs.$slide['slideimage'];
It puts "thumbs" at the START of the path.

Can anyone explain how I'm messing the syntax up?

I also tried
$slideimage = $thumbs.$slideimagefolder.$slide['slideimage'];
which also returned an incorrect value.

How do I get this to be BETWEEN the file name & the rest of the folder name?

Comments

coreyp_1’s picture

$slideimage = $slideimagefolder.$thumbs.$slide['slideimage']; looks right, but the question is, what is in the $slideimagefolder and $slide['slideimage'] variables?

I would bet that $slideimagefolder is empty, and $slide['slideimage'] contains the actual folder path AND filename together.

If I am correct, then you are in luck, because PHP has functions to help with this type of problem. Try this code:

<?php
$slideimage = $slideimagefolder . dirname($slide['slideimage']) .'/thumbs/'. basename($slide['slideimage']);
?>

Unless we know more about the variables involved, we can't help any more.

-Corey

streever’s picture

CoreyP:

Wow. Thank you. You are a real hero!
This worked perfectly.

Here it is for future reference (although, read below to see why you should skip FPSS entirely)

--In fpss.module, replace line 978, where $slideimage is defined for thumbnails, with:
$slideimage = $slideimagefolder . dirname($slide['slideimage']) .'/thumbs/'. basename($slide['slideimage']);
(you don't need to encase it in

this will cause FPSS to look for thumbnails in the "thumbs" sub-folder of images. You can also create a CCK field that puts images into /thumbs/! So it is seamless for the client--so long as they use the same filename for the thumb & the full image.

I am sure it would not be much more work to pull the thumb out via the code, but this seems like an easier solution.

With that in mind: I'd advise against using FPSS--It doesn't cost a lot, but there are much better free drupal modules that replicate the behavior desired, with actual customer service: the FPSS folks provide very slow tech service if at all. The man who created the module for drupal did a great job & maintains it well, but FPSS has an ever-changing release schedule for FPSS, which makes it hard to keep up.

I provide free Drupal support on Thursdays: booking calendar coming soon.

bwill’s picture

"there are much better free drupal modules that replicate the behavior desired"

using Drupal 6.12

I have been struggling with FPSS for three days, and can't get anywhere with it. I need a slideshow that goes only on the front page and allows the user to add or delete images - or slides. I'd rather create it in a block than have an extra home page template. FPSS has some nice looking features, but the documentation is not so good - well, it's horrible. I'm trying to use the module, but I don't know if the fpss folder is still rewuired in the root. The module points to the fpss folder in the modules path, and the errors I'm getting seem to be poining to the files in the root fpss folder. I'd like to get it working since I paid the 33 bucks, but please suggest alternatives....