帝國cms后臺采集支持https開頭的協(xié)議地址修改方法_帝國Cms教程
教程Tag:暫無Tag,歡迎添加,賺取U幣!
分享一下帝國cms后臺采集支持https開頭的協(xié)議地址修改方法,希望可以幫到你
修改:/e/class/connect.php文件
修改:/e/class/connect.php文件
在該文件最上面加上以下函數(shù)
//獲取https鏈接內(nèi)容
- 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);
- curl_close($ch);
- return $result;
- }
找到ReadFiletext函數(shù)如下代碼
- function ReadFiletext($filepath){
- $filepath=trim($filepath);
- $htmlfp=@fopen($filepath,"r");
- //遠(yuǎn)程
- if(strstr($filepath,"://"))
- {
- while($data=@fread($htmlfp,500000))
- {
- $string.=$data;
- }
- }
- //本地
- else
- {
- $string=@fread($htmlfp,@filesize($filepath));
- }
- @fclose($htmlfp);
- return $string;
- }
改成
- function ReadFiletext($filepath){
- $filepath=trim($filepath);
- $htmlfp=@fopen($filepath,"r");
- //遠(yuǎn)程
- if(strstr($filepath,"https://")){
- return getHTTPS($filepath);
- }
- if(strstr($filepath,"://"))
- {
- while($data=@fread($htmlfp,500000))
- {
- $string.=$data;
- }
- }
- //本地
- else
- {
- $string=@fread($htmlfp,@filesize($filepath));
- }
- @fclose($htmlfp);
- return $string;
- }
自此可實(shí)現(xiàn)采集https開頭的網(wǎng)頁鏈接
相關(guān)帝國Cms教程:
- 帝國CMS更改完搜索列表模板不生效的解決方法
- 在帝國CMS后臺禁止了管理自己的ip地址無法訪問解決辦法
- 帝國CMS下載最終頁模板調(diào)用帶圖片的軟件信息
- 帝國CMS封面列表和內(nèi)容頁調(diào)用欄目別名的兩種方法
- 帝國CMS正文內(nèi)容設(shè)置關(guān)鍵詞與圖片鏈接沖突的問題
- 帝國cms首頁調(diào)用整站最新5條評論評論詳細(xì)信息
- 帝國cms后臺恢復(fù)數(shù)據(jù)庫出現(xiàn)的錯誤
- 帝國cms7.2版本 phome_enewstags數(shù)據(jù)表字段解釋(TAGS表)
- 帝國CMS單條信息指定不同的內(nèi)容模板只限動態(tài)內(nèi)容頁使用
- 整理了一些帝國cms常見問題
- 帝國cms采集規(guī)則加上采集來源地址的方法
- 帝國cms靈動標(biāo)簽調(diào)用信息的標(biāo)題分類名稱和地址
- 相關(guān)鏈接:
- 教程說明:
帝國Cms教程-帝國cms后臺采集支持https開頭的協(xié)議地址修改方法
。