![]() |
Useful: imagepaths after moving server
Hi,
I had to move one of our X-cart site to a new server. We use the filesystem to store images, not the database. I noticed that X-cart saves the whole path info for every image stored in the database. I wrote a very small but useful script for anyone that wants to change the path info for all images at one time: Code:
<? Replace all the %% %% with your own values. It's not very handy to store the full path into the database, but it hope it helps for some people! Good luck. John. |
Very useful. :)
|
Image path change xcart 4.0.2
I am only a couple of weeks into using x-cart. Tried to move the store to another location, and lost all of the image links. When I used the above code the "\"s were dropped from the path string during the update.
I was however able to make this sql statement work: Code:
$sql= "UPDATE xcart_thumbnails SET image_path=( REPLACE (image_path,'dirA','dirB'))WHERE productid = '$rowPaths[0]';"; dirA = original directory: c:\inetpub\wwwroot\xcart\files\images..... dirB = new directory: c:\inetpub\wwwroot\backup\files\images.... Only include what needs to be changed: (image_path, 'xcart', 'backup') Hope this helps.... |
All times are GMT -8. The time now is 10:57 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.