 |

equinox69
User
Feb 27, 2008, 2:20 PM
Post #1 of 5
(632 views)
Shortcut
|
|
Another image rotator question
|
Can't Post
|
|
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.
|
|
|  |
 |

Dave
Staff
/ Moderator

Feb 27, 2008, 4:54 PM
Post #2 of 5
(628 views)
Shortcut
|
|
Re: [equinox69] Another image rotator question
[In reply to]
|
Can't Post
|
|
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
|
|
|  |
 |

equinox69
User
Feb 29, 2008, 11:50 AM
Post #3 of 5
(609 views)
Shortcut
|
Problem came up, Re: [Dave] Another image rotator question
[In reply to]
|
Can't Post
|
|
Hi Dave, I did exactly as you said in the posted reply for modifying the code. I got errors stating the directory could not be created but realized it was a permissions issue. I manually created the directory (/thumb/) and changed the permissions to it and it works. However, when I went to delete the new test record, I got this message from the admin screen: The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. " -------------------------------------------------------------------------------- Only one top level element is allowed in an XML document. Error processing resource 'http://www.graddysequipment.com/cmsAdm... <b>Notice</b>: Use of undefined constant mysql_affected_rows - assumed 'mysql_affected_rows' in <b>/usr/h... " I can hit "back" on the browser and the listing is deleted but the error needs not to occur and the customer won't accept this of course. Am I relegated to restoring the original uploadForm_functions.php page? I really need the thumbnails in a separate directory. Terry
|
|
|  |
 |

Dave
Staff
/ Moderator

Feb 29, 2008, 1:03 PM
Post #4 of 5
(606 views)
Shortcut
|
|
Re: [equinox69] Problem came up, Re: [Dave] Another image rotator question
[In reply to]
|
Can't Post
|
|
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
|
|
|  |
 |

equinox69
User
Feb 29, 2008, 2:37 PM
Post #5 of 5
(603 views)
Shortcut
|
|
Re: [Dave] Problem came up, Re: [Dave] Another image rotator question
[In reply to]
|
Can't Post
|
|
Dave, Solid. Worked perfectly. Thanks again! Terry
|
|
|  |
|