First, let's take a look at how to change the ecshop ad picture/data/afficheimg/relative path to absolute path address.
First open the function that controls the path of the picture, find the includes/lib_insert.php file, look for the functions insert_ads ($arr) function, and the following code:
The code is as follows |
Copy Code |
Case 0://Photo ads $SRC = (Strpos ($row [' Ad_code '], ' http://') = = False && strpos ($row [' Ad_code '], ' https://') = = False)? ' Http://www.111cn.net/'. Data_dir. "/afficheimg/$row [Ad_code]": $row [' Ad_code '];
|
OK, then look at your own advertising picture address, now has been changed to an absolute address.
Second, sometimes also need to ecshop product picture relative path to absolute path address, we first look at how to modify it.
Modify the function Get_image_path functions in the includes/lib_common.php file, search: Rewrite the URL address, in the following function Build_uri functions, in $uri = '; Added below $weburl = ' http://'. $_server[' server_name ']. ' /';
Then return the following $uri, replace it with the return $weburl. $uri;
Find the picture Format function Get_image_path return $url;
The code is as follows |
Copy Code |
Return (Strpos ($url, ' http://') = = False && Strpos ($url, ' https://') = = False)? ' Http://www.111cn.net/'. $url: $url;
|
After the modification, this is the following:
The code is as follows |
Copy Code |
function Get_image_path ($goods _id, $image = ', $thumb =false, $call = ' goods ', $del =false) {$url = Emptyempty ($image)? $GLOBALS [' _cfg '] [' no_picture ']: $image; Return (Strpos ($url, ' http://') = = False && Strpos ($url, ' https://') = = False)? ' Http://www.111cn.net/'. $url: $url; }
|
Third, to introduce the Ecshop product Details page inside the picture how to change to absolute path.
This is simpler, directly in the database to modify, open phpMyAdmin, execute the following SQL statement:
The code is as follows |
Copy Code |
Update ecs_goods Set Goods_desc=replace (Goods_desc, ' src= '/images/upload/', ' src= ' http://www.111cn.net/images/ upload/')
|
If you do not have phpMyAdmin, you can also in the Ecshop background database management SQL query to execute.
Note: Regardless of the modification of the Ecshop file or the MySQL database, still the same as the old, be sure to remember to advance the file and database backup, right, these relative path to absolute path, many people do not understand exactly what is to do, why must be so modified, in fact, do not need to modify,
If it is a level two domain name directly in the replacement and program changes to replace the www.111cn.net into your level two domain name, such as M.111cn.net.