Emlog文章隐藏内容登陆后可见

首先在模板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

             记忆时光|二超博客整理编辑


评论

  1. 2025年前
    -0001-11-30 0:00:00

    方法很不错。我记得两三个月前咱们都很注重友链,而现在的我,已经没有了友情链接。

  2. 2025年前
    -0001-11-30 0:00:00

    @姜辰:对啊。我还在

  3. 2025年前
    -0001-11-30 0:00:00

    百度。 wordpress登陆可见

  4. 2025年前
    -0001-11-30 0:00:00

    @5259:这是emlog的使用方法

  5. 2025年前
    -0001-11-30 0:00:00

    @姜辰:也是哦,博客的意义就在于记录生活,像楼主这样整些没用的,就没意义了。

  6. 2025年前
    -0001-11-30 0:00:00

    @长安:你说这是什么意思?

  7. 2025年前
    -0001-11-30 0:00:00

    @5258:握草,发错博客了,不好意思

  8. 2025年前
    -0001-11-30 0:00:00

    @长安:你准备发哪个博客?

  9. 2025年前
    -0001-11-30 0:00:00

    测试回复

  10. 2025年前
    -0001-11-30 0:00:00

    @姜辰:我完全不知道你们说的是啥。。

  11. 2025年前
    -0001-11-30 0:00:00

    @Mr.Lin:不知道就对了

发送评论 编辑评论


|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇