Emlog的文章页访问密码美化页面代码

发布日期: 作者:白杨seo

  • 正文内容
  • 相关推荐
转载

2018年emlog文章页访问密码美化页面教程(尾部提供下载)。

emlog美化页面

Emlog程序的钩子远不如 WordPress 这么丰富,因此这一美化只能通过直接修改 Emlog 代码来实现。

具体的位置在 include/model/log_model.php 文件末尾的 authPassword 函数。
一、将原来的函数里的

        if ($pwd !== addslashes($logPwd)) {
            echo <<<EOT
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>emlog message</title>
<style type="text/css">
<!--
body{background-color:#F7F7F7;font-family: Arial;font-size: 12px;line-height:150%;}
.main{background-color:#FFFFFF;margin-top:20px;font-size: 12px;color: #666666;width:580px;margin:10px 200px;padding:10px;list-style:none;border:#DFDFDF 1px solid;}
-->
</style>
</head>
<body>
<div class="main">
<form action="" method="post">
请输入该文章的访问密码<br>
<input type="password" name="logpwd" /><input type="submit" value="进入.." />
<br /><br /><a href="$url">&laquo;返回首页</a>
</form>
</div>
</body>
</html>
EOT;
            if ($cookiePwd) {
                setcookie('em_logpwd_' . $logid, ' ', time() - 31536000);
            }
二、替换为如下代码即可

		if ($pwd !== addslashes($logPwd)) {
			?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
<meta charset="UTF-8"> 
<meta http-equiv="X-UA-Compatible" content="IE=edge"> 
<meta name="renderer" content="webkit"> 
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>该文章已被加密</title>
</head>
<body>
    <div class="main">
        <img class="alert" alt="文章已被加密" src="http://uqseo.com/guanggao/20180819.png">
        <form action="" method="post" class="mk-side-form">
            <h2 class="pw-tip">该文章已被加密</h2>
            <input type="password" name="logpwd" placeholder="请输入访问密码查看" required><button type="submit">提交</button>
            <?php if($postPwd): ?>
            <p id="pw-error">Oops!密码不对哦~</p>
            <script>setTimeout(function() {document.getElementById("pw-error").style.display = "none"}, 2000);</script>
            <?php endif; ?>
        </form>
        <a href="<?php echo $url; ?>" class="return-home" title="点击回到网站首页">- 返回首页 - </a>
    </div>
    <style type="text/css">
    *{font-family:"Microsoft Yahei",微软雅黑,"Helvetica Neue",Helvetica,"Hiragino Sans GB","WenQuanYi Micro Hei",sans-serif;box-sizing:border-box;margin:0px;padding:0px;font-size:14px;-webkit-transition:.2s;-moz-transition:.2s;-ms-transition:.2s;-o-transition:.2s;transition:.2s}
    html,body{width:100%;height:100%}
    body{background-color:#F4F6F9;color:#768093}
    input,button{font-size:1em;border-radius:3px;-webkit-appearance:none}
    input{width:100%;padding:5px;box-sizing:border-box;border:1px solid #e5e9ef;background-color:#f4f5f7;resize:vertical}
    input:focus{background-color:#fff;outline:none}
    button{border:0;background:#6abd09;color:#fff;cursor:pointer;opacity:1;user-select:none}
    button:hover,button:focus{opacity:.9}
    button:active{opacity:1}
    .main{width:100%;max-width:500px;height:300px;padding:30px;background-color:#fff;border-radius:2px;box-shadow:0 10px 60px 0 rgba(29,29,31,0.09);transition:all .12s ease-out;position:absolute;left:0;top:0;bottom:0;right:0;margin:auto;text-align:center}
    .alert{width:80px}
    .mk-side-form{margin-bottom:28px}
    .mk-side-form input{float:left;padding:2px 10px;width:77%;height:37px;border:1px solid #ebebeb;border-right-color:transparent;border-radius:2px 0 0 2px;line-height:37px}
    .mk-side-form button{position:relative;overflow:visible;width:23%;height:37px;border-radius:0 2px 2px 0;text-transform:uppercase}
    .pw-tip{font-weight:normal;font-size:26px;text-align:center;margin:25px auto}
    #pw-error {color: red;margin-top: 15px;margin-bottom: -20px;}
    .return-home{text-decoration:none;color:#b1b1b1;font-size:16px}
    .return-home:hover{color:#1E9FFF;letter-spacing:5px}
    </style>
</body>
</html>
<?php
			if ($cookiePwd) {
				setcookie('em_logpwd_' . $logid, ' ', time() - 31536000);
			}



  文件名称:Emlog文章页访问密码美化页面

  更新时间:2018.08.20

  下载声明:emlog源码

立即下载

下载地址

极速下载网盘下载

emlog源码

特别声明

本文为 白杨seo 原创发布,仅代表作者观点,不代表冬镜博客网的观点或立场,冬镜博客网仅提供信息发布平台,合作供稿、侵权删除、反馈建议请联系520@520xx.cc

白杨SEO,专注网站优化多年.

标签:

标题:Emlog的文章页访问密码美化页面代码

链接:https://uqseo.com/emlog/227.html

版权:若无特殊标注皆为 白杨seo 原创版权,转载请以链接形式注明作者及原始出处

发表评论

电子邮件地址不会被公开。 必填项已用*标注

评论

2条评论
  1. avatar

    76543 Lv.1 Chrome 71.0.3578.10 Chrome 71.0.3578.10 Windows Windows 回复

    无耻,发现好多都是盗取别人的东西来自己博客标注原创!!!

    江苏省南京市 电信

    1. avatar

      豆本逗 Lv.1 Chrome 70.0.3514.0 Chrome 70.0.3514.0 Windows Windows 回复

      大佬 emlog6.0 改后  500错误

      江苏省 移动

      冬镜seo客服