close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Powerstore 3 - Seperate folders for images

Thread began 5/14/2010 1:16 pm by dnys04173367569 | Last modified 5/17/2010 2:26 pm by Jason Byrnes | 641 views | 3 replies |

dnys04173367569

Powerstore 3 - Seperate folders for images

I am trying to get my Thumbnails to be stored in a seperate folder from my ProductImage.

Currently I have managed to get this to work by changing the UploadFolder for the ProductImage from:

'UploadFolder' => "../imagesupload/",

to

'UploadFolder' => "../imagesupload/images/productShots/large/",

and similar changes to the ThumbNail UploadFolder as follows:-

'UploadFolder' => "../imagesupload/images/productShots/small/",



I have also change how the image link is stored on my database as follows under $WA_fieldValueStr in both Products_Update.php and Products_Insert.php as follows.

$WA_fieldValuesStr = "".((isset($_POST["ProductSKU"]))?$_POST["ProductSKU"]:"") ."" . "|" . "".((isset($_POST["ProductName"]))?$_POST["ProductName"]:"") ."" . "|" . "".((isset($_POST["ProductPrice"]))?$_POST["ProductPrice"]:"") ."" . "|" . "".((isset($_POST["ProductWeight"]))?$_POST["ProductWeight"]:"") ."" . "|" . "".((isset($_POST["ProductCartDesc"]))?$_POST["ProductCartDesc"]:"") ."" . "|" . "".((isset($_POST["ProductShortDesc"]))?$_POST["ProductShortDesc"]:"") ."" . "|" . "".((isset($_POST["ProductLongDesc"]))?$_POST["ProductLongDesc"]:"") ."" . "|" . "images/productShots/small/".$WA_DFP_UploadStatus["WA_UploadResult2"]["serverFileName"] ."" . "|" . "images/productShots/large/".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."" . "|" . "".((isset($_POST["ProductStock"]))?$_POST["ProductStock"]:"0") ."" . "|" . "".((isset($_POST["ProductLive"]))?$_POST["ProductLive"]:"") ."" . "|" . "".((isset($_POST["ProductUnilimited"]))?$_POST["ProductUnilimited"]:"") ."";

This stores the links to my images as follows in my mysql database as follows:

images/productShots/large/ProductImage.jpg
images/productShots/small/ThumbNail.jpg

This all seems alright when creating a new product under Products_Insert.php

However, when actually using Products_Update.php it is working when I am actually updating the product with new images to replace the original images.

But if I have nothing in the two image update fields, say when selecting to make a product available or unavailable, then the Product updates as normal, but the image are no longer available.

This is because when there is no image in the image fields, the function controlling the update of the images takes what is in the database as the filename and appends the "images/productShots/small/" or "images/ProductShots/large" each time.

So the database shows:

images/productShots/large/images/productShots/large/ProductImage.jpg
images/productShots/small/images/productShots/small/ThumbNail.jpg

This gets bigger everytime I do an update without putting new images in the fields.

Extract from above $WA_fieldValuesStr =
. "|" . "images/productShots/small/".$WA_DFP_UploadStatus["WA_UploadResult2"]["serverFileName"] ."" . "|" . "images/productShots/large/".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."" . "|"

I would appreciate any help in finding a solution around this problem which will still allow me to seperate my ThumbNails from my ProductImages

Sign in to reply to this post

Jason ByrnesWebAssist

On the update page find the following 2 lines of code:
from:

php:
'DefaultFileName' => "" . $row_WADAProducts["ProductImage"] . "",



to:

php:
'DefaultFileName' => "" . str_replace("images/productShots/large/", "", $row_WADAProducts["ProductImage"]) . "",



From:

php:
'DefaultFileName' => "" . $row_WADAProducts["ProductThumb"] . "",



to:

php:
'DefaultFileName' => "" . str_replace("images/productShots/small/", "", $row_WADAProducts["ProductThumb"]) . "",
Sign in to reply to this post

dnys04173367569

Thank You

Many thanks for your quick response Jason.

This now works perfectly.

Regards

David

Sign in to reply to this post

Jason ByrnesWebAssist

excellent, glad to hear it is working.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...