/phpcms/modules/content/content.php的add方法跟edit方法负责文章的添加修改
这个方法调用了/phpcms/model/content_model.class.php的add_content以及edit_content实现文章的添加修改
//更新URL地址
if($data['islink']==1) {
$urls[0]= trim_script($_POST['linkurl']);
} else {
$urls=$this->url->show($id,0,$systeminfo['catid'],$systeminfo['inputtime'],$data['prefix'],$inputinfo,'add');
}
调用了phpcms/modules/content/classes/中的url.class.php中的show方法来生成路径
if($content_ishtml&& $url) {
//$url_arr[1]返回的实际在系统中生成的路径
$url_arr[1] = $html_root.'/'.$urls;
//$url_arr[1]返回的是带有域名的在数据库中保存的路径
$url_arr[0] = WEB_PATH == '/' ?$match_url.$html_root.'/'.$urls :$match_url.rtrim(WEB_PATH,'/').$html_root.'/'.$urls;
if(strpos($url_arr[0],'ent')>0){
$url_arr[1]='/ent'.$url_arr[1];
}
echo $url_arr[1];
$url_arr[0]=str_replace("http://fashion","http://www",$url_arr[0]);
}
elseif($content_ishtml){
$url_arr[0] = WEB_PATH == '/' ?$html_root.'/'.$urls : rtrim(WEB_PATH,'/').$html_root.'/'.$urls;
$url_arr[1] = $html_root.'/'.$urls;
} else {
$url_arr[0] = $url_arr[1] =APP_PATH.$urls;
}
if($content_ishtml&& $url) {
if ($domain_dir &&$category['isdomain']) {
$url_arr[1] =$html_root.'/'.$domain_dir.$urls;
$url_arr[0] = $url.$urls;
} else {
$url_arr[1] =$html_root.'/'.$urls;
$url_arr[0] = WEB_PATH == '/' ?$match_url.$html_root.'/'.$urls :$match_url.rtrim(WEB_PATH,'/').$html_root.'/'.$urls;
}
}
elseif($content_ishtml){
$url_arr[0] = WEB_PATH == '/' ?$html_root.'/'.$urls : rtrim(WEB_PATH,'/').$html_root.'/'.$urls;
$url_arr[1] = $html_root.'/'.$urls;
} else {
$url_arr[0] = $url_arr[1] =APP_PATH.$urls;
}