首先在模板module.php中增加已下代码:
function login_to_view($content){ if (preg_match_all(’/<!--loginview start-->([sS]*?)<!--loginview end-->/i’, $content, $hide_words)){ if( ISLOGIN ){ $content = str_replace($hide_words[0], $hide_words[1], $content); }else{ $hide_notice = ’<div style="text-align:center;border:1px dashed #FF9A9A;padding:8px;margin:10px auto;color:#FF6666;">您必须先<a href="’.BLOG_URL.’admin">登录</a>才能查看隐藏内容</div>’; $content = str_replace($hide_words[0], $hide_notice, $content); } } return $content; }
其次将模板echo_log.php中$log_content修改为login_to_view($long_content);即可。
最后一步就是后台了
使用方法:
在后台编辑文章的时候,切换到html模式添加:<!–loginview start–>要隐藏的内容<!–loginview end–>
这时候就一切ok了
演示地址: http://2cbk.com/post-161.html
记忆时光|二超博客整理编辑
方法很不错。我记得两三个月前咱们都很注重友链,而现在的我,已经没有了友情链接。
@姜辰:对啊。我还在
百度。 wordpress登陆可见
@5259:这是emlog的使用方法
@姜辰:也是哦,博客的意义就在于记录生活,像楼主这样整些没用的,就没意义了。
@长安:你说这是什么意思?
@5258:握草,发错博客了,不好意思
@长安:你准备发哪个博客?
测试回复
@姜辰:我完全不知道你们说的是啥。。
@Mr.Lin:不知道就对了