1. Modify the configuration file system. php
| The code is as follows: |
Copy code |
// Configure the attachment 'Upload _ path' => PHPCMS_PATH. 'Upload /', 'Upload _ path_danji '=> PHPCMS_PATH. 'Danji/upload/', // upload path of images on the standalone site 'Upload _ path_mobile '=> PHPCMS_PATH. 'Upload/shouji/', // upload path of the mobile station image 'Upload _ url' => '/upload/', // attachment path 'Upload _ url_danji '=>'/danji/upload/', // path of the attachment to the standalone site 'Upload _ url_mobile '=>'/upload/shouji/', // path of the mobile phone station attachment |
2. Search for "upload_path" in the folder"
Search for "upload_path" in the folder, and you can find that the configuration parameter is used for the extra files. Here, the configuration parameter is to be modified and determined based on the current site.
For example, modules/attachment/attachments. php
| The code is as follows: |
Copy code |
Function _ construct (){ Pc_base: load_app_func ('global '); $ This-> siteid = param: get_cookie ('siteid '); If ($ this-> siteid = 1 ){ $ This-> upload_url = pc_base: load_config ('system', 'upload _ url '); $ This-> upload_path = pc_base: load_config ('system', 'upload _ path '); } Elseif ($ this-> siteid = 2 ){ $ This-> upload_url = pc_base: load_config ('system', 'upload _ url_danji '); $ This-> upload_path = pc_base: load_config ('system', 'upload _ path_danji '); } Elseif ($ this-> siteid = 3 ){ $ This-> upload_url = pc_base: load_config ('system', 'upload _ url_mobile '); $ This-> upload_path = pc_base: load_config ('system', 'upload _ path_mobile '); } $ This-> imgext = array ('jpg ', 'GIF', 'PNG', 'bmp ', 'jpeg '); $ This-> userid = param: get_cookie ('userid ')? Param: get_cookie ('userid'): param: get_cookie ('_ userid '); $ This-> isadmin = $ this-> admin_username = $ _ SESSION ['roleid']? 1: 0; $ This-> groupid = param: get_cookie ('_ groupid ')? Param: get_cookie ('_ groupid'): 8; }
|
Modify the constructor and read the corresponding upload_path parameters and path parameters based on the current site. If the modification is made in several places, I will not list them one by one.