帝國cms后臺采集支持https開頭的協議地址修改方法
導讀:1建站知識帝國CMS模板網下面的帝國CMS教程欄目為您提供了帝國cms后臺采集支持https開頭的協議地址修改方法seo網站優化高端網站建設。
修改:/e/class/connect.php文件
在該文件最上面加上以下函數
//獲取https鏈接內容
function getHTTPS($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_REFERER, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $result = curl_exec($ch); 網seo優化趨勢 curl_close($ch); return $result; }找到ReadFiletext函數如下代碼
function ReadFiletext($filepath){ $filepath=trim($filepath); $htmlfp=@fopen($filepath,"r"); //遠程 if(strstr($filepath,"://")) { while($data=@fread($htmlfp,500000)) { $string.=$data; } } //本地 else { $string=@fread($htmlfp,@網站seo優化課程filesize($filepath)); } @fclose($htmlfp); return $string; }改成
function ReadFiletext($filepath){ $filepath=trim($filepath); $htmlfp=@fopen($filepath,"r"); //遠程 if(strstr($filepath,"https://")網站推廣優化seo){ return getHTTPS($filepath); } if(strstr($filepath,"://")) { while($data=@fread($htmlfp,500000)) { $string.=$data; } } //本地 else { $string=@fread($htmlfp,@filesize($filepath)); } @fclose($htmlfp); return $string; }自此可實現采集https開頭的網頁鏈接
相關seo網站優化高端網站建設。聲明: 本文由我的SEOUC技術文章主頁發布于:2023-05-22 ,文章帝國cms后臺采集支持https開頭的協議地址修改方法主要講述帝國,開頭,http網站建設源碼以及服務器配置搭建相關技術文章。轉載請保留鏈接: http://www.bifwcx.com/article/web_4113.html