Another image rotator question

5 posts by 2 authors in: Forums > CMS Builder
Last Post: February 29, 2008   (RSS)

By Codee - February 27, 2008

Dave and Co.,

Is it possible with CMS builder to have upload images go to one directory and for the built thumbnails to be placed into another directory? If I want to use a simple dynamic script to pull all the thumbnail images only to display onto an image rotator, then only the thumbnail images need to be in a separate directory.

Re: [equinox69] Another image rotator question

By Dave - February 27, 2008

Sure, we've had two requests for that now. I've added it to v1.10.

If you are comfortable modifying PHP code and want to add it to your v1.09 right away, you can try this:

Open /lib/menus/default/uploadForm_functions.php. Save a backup copy of this file first. Then search for "_thumb" (that should only match one line) and replace that line with this:

$thumbSavePath = $createThumbnail ? preg_replace("|([^/]+)$|", "thumb/$1", $uploadSavePath) : "";

Then search for "$uploadUrl, $thumbSavePath" (that should only match one line) and replace that line with this:

$thumbUrl = $createThumbnail ? preg_replace("|([^/]+)$|", "thumb/$1", $fileUploadUrl) : "";

Then search for "open source image" (that should only match one line) and replace that line with this:

// create target dir
$dir = dirname($targetPath);
if (!file_exists($dir)) { mkdir_recursive($dir); }


// open source image


That will make it so all thumbnails created after that change will be created with the same filename in a subdirectory called "/thumb/" under the upload dir.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [equinox69] Problem came up, Re: [Dave] Another image rotator question

By Dave - February 29, 2008

Hi Terry,

Sounds like we're almost there. See this post on fixing that error with mysql_affected_rows:

http://www.interactivetools.com/iforum/P59353/#59353

All these changes (and your suggestions) will be in v1.10 so you won't need to apply them again.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Problem came up, Re: [Dave] Another image rotator question

By Codee - February 29, 2008

Dave,

Solid. Worked perfectly.

Thanks again!

Terry