一、织梦文章要会员才可以浏览,则需设置文章为动态。
二、织梦系统基本参数开启会员功能。
三、/include/arc.archives.class.php修改,找到代码:
在此代码前添加:
var $MemberLogin;
在:
//End foreach
后加:
global $cfg_ckbodyopen,$cfg_ckbodynum;
$this->Fields['$cfg_ckbodyopen'] = (empty($cfg_ckbodyopen) ? "Y" : "$cfg_ckbodyopen" );
$this->Fields['$cfg_ckbodynum'] = (empty($cfg_ckbodynum) ? "500" : "$cfg_ckbodynum" );
if(($this->Fields['$cfg_ckbodyopen'] == "Y" || $this->Fields['$cfg_ckbodyopen'] == "y") && $this->Fields['ismake']==-1){
require_once(DEDEINC.'/memberlogin.class.php');
$this->MemberLogin = new MemberLogin();
$this->Fields['ckbodyhtml'] = " <br/>
<div class='ckbodyhtml' style='width:80%;margin-left:10%;margin-top:30px;float:left;border:1px solid #000;background:#dedede;text-align:center;'> 你没有登陆,无法阅读全文内容,点击此处登陆 </div>";
if($this->MemberLogin->IsLogin()){
$this->Fields['ckbody'] = $this->Fields['body'];
//已经登陆
}else{
$this->Fields['ckbody'] = cn_substr(Html2Text($this->Fields['body']),$this->Fields['$cfg_ckbodynum']);
$this->Fields['ckbody'] .= $this->Fields['ckbodyhtml'];
//未登陆
}
}else{
$this->Fields['ckbody'] = $this->Fields['body'];
}
文章中内容body调用标签:
{dede:field.ckbody/}
四、会员登录系统一般是在member文件夹
资源均来自第三方,谨慎下载,前往第三方网站下载