Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
Another image rotator question

 

 


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:


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


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


Code
$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:


Code
  // 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

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4