PHPCMS V9添加https/http开头的友情链接的解决方法

现在很多网站都开始启用https,不管是在收录上,对搜索引擎的友好程度都是不错的选择,但是在换友情链接的时候要填写https开头的网址,可是phpcms v9却提示只能填写以http开头的网站,那么我们应该怎么去修改,让其可以添加https网站呢?下面是CMS集中营给您总结的方法,希望对您有所帮助。

相关注意:

找到下面的语句的时候可能有些写法不一样,但是 http:\/\/ 该字样是一致的,我们只需要将其替换掉就可以了。如果没有的话,就直接跳到下一个字样寻找修改即可。

代码所在文件夹及其文件:

1、打开 \phpcms\modules\link\index.php 文件

ctrl+f:if($_POST[‘url’] :

if($_POST['url']=="" || !preg_match('/^http:\/\/(.*)/i', $_POST['url'])){
showmessage(L('siteurl_not_empty'),"?m=link&c=index&a=register&siteid=$siteid");
 }

http:\/\/ (.*)修改修改成 (http:\/\/|https:\/\/) 如下代码:

if($_POST['url']=="" || !preg_match('/^(http:\/\/|https:\/\/)(.*)/i', $_POST['url'])){
showmessage(L('siteurl_not_empty'),"?m=link&c=index&a=register&siteid=$siteid");
 }

ctrl+f: $logo :

$logo = safe_replace(strip_tags($_POST['logo']));
if(!preg_match('/^http:\/\/(.*)/i', $logo)){
$logo = '';
}

http:\/\/ (.*)修改修改成 (http:\/\/|https:\/\/) 如下代码:

$logo = safe_replace(strip_tags($_POST['logo']));
if(!preg_match('/^(http:\/\/|https:\/\/)(.*)/i', $logo)){
$logo = '';
}

2、打开 \phpcms\modules\link\templates\link_add.tpl.php 文件

ctrl+f: $(“#link_url”) :

$("#link_url").formValidator({onshow:"{C}",onfocus:"{C}"}).inputValidator({min:1,onerror:"{C}"}).regexValidator({regexp:"^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&]*([^<>])*$",onerror:"{C}"})

http:\/\/ (.*)修改修改成 (http:\/\/|https:\/\/) 如下代码:

$("#link_url").formValidator({onshow:"{C}",onfocus:"{C}"}).inputValidator({min:1,onerror:"{C}"}).regexValidator({regexp:"^(http:\/\/|https:\/\/)[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&]*([^<>])*$",onerror:"{C}"})

3、打开 \phpcms\modules\link\templates\link_edit.tpl.php 文件

ctrl+f: $(“#link_url”) :

$("#link_url").formValidator({onshow:"",onfocus:""}).inputValidator({min:1,onerror:""}).regexValidator({regexp:"^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&]*([^<>])*$",onerror:""})
 

http:\/\/ (.*)修改修改成 (http:\/\/|https:\/\/) 如下代码:

$("#link_url").formValidator({onshow:"",onfocus:""}).inputValidator({min:1,onerror:""}).regexValidator({regexp:"^(http:\/\/|https:\/\/)[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&]*([^<>])*$",onerror:""})

在修改站内代码的,需要仔细,不要盲目的直接修改,这个就显的自己不专业的,一定要记住:在修改代码的时候,必须备份,不管是对于新手老手来说这个是一定掌握的,不然到时候修改之后不知道修改的哪里,重新写,或者是直接不就会,很让自己悲剧的事情。

该文章属于:计算机技术网原创

转载请注明标题:PHPCMS V9添加https/http开头的友情链接的解决方法-计算机技术网

转载请注明出处:https://www.ctvol.com/seoomethods/2256.html

(0)
上一篇 2019年11月5日 下午12:02
下一篇 2019年11月16日

精彩推荐