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

Emlog 自身的文章访问密码页面极为简陋,之前也分享过《美化 Emlog 的文章访问密码页面》

反正闲着没事,看到唐朝的网站加密插件,感觉挺好,移植到 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>
				<style type="text/css">
					* {margin: 0;padding: 0;}
					html, body {width: 100%;height: 100%}
					body, button, input {font: 14px/20px "Microsoft Yahei", "Helvetica Neue", Helvetica, Arial, sans-serif}
					body {background-color:#F4F6F9;color: #585858;letter-spacing: 1px}
					form{padding-bottom: 20px;}
					i {font-style: normal}
					a {color: #007aff;text-decoration: none}
					a:hover {color: #0065ea;text-decoration: none;}
					p{margin-bottom: 20px}
					.main {max-width: 500px;height: 300px;padding: 30px;background-color: #fff;border-radius: 2px;transition: all .12s ease-out;position: absolute;left: 0;top: 0;bottom: 0;right: 0;margin: auto;text-align: center;box-shadow:0 10px 60px 0 rgba(29,29,31,0.09);}
					.i1 {display: inline-block;width: 80px;height: 80px;border: 1px solid #007aff;-webkit-border-radius: 50%;-moz-border-radius: 50%;border-radius: 50%}
					.i1 img {margin-top: 18px}
					.i2 {position: absolute;margin-top: -1px;bottom: -.5em;color: #dcdcdc;font: 20px/1em Arial, Helvetica, sans-serif}
					.i2 span {position: absolute;color: #FFF;left: 0;top: 2px}
					.hd {width: 100%;margin-top: 2em;border-bottom: 1px solid #dcdcdc;position: relative}
					.int1 {border: 1px solid #DDD;line-height: 20px;padding: 5px 10px;width: 8em}
					.int1:focus {border-color: #007aff}
					.btn1 {cursor: pointer;width: 12em;line-height: 20px;padding: 5px 0;background-color: #007aff;color: #FFF;border: none 0}
					.btn1:hover {background-color: #0065ea}
					.home{margin-top:10px;color:#b1b1b1;font-size:16px}
					.home:hover{color:#1E9FFF;letter-spacing:5px}
					#error {color: red;margin-bottom: -20px;}
				</style>
			</head>
			<body>
			<div class="main">
				<p><i class="i1"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAAAn1BMVEUAAAAAeP8Aef8Aef8Aef8Aev8Aev8Aef8Aef8Aef8Ae/8AeP8AfP8AfP8Aef8Aef8Aef8AfP8Aev8Aev8Aef8Aef8Aev8Aev8Aff8Aef8Aev8Aev8Aef8Aef8Aev8Aef8Aev8Aef8Aef8Abv8Aev8Aev8Aef8Aef8AeP8Aef8Aef8Aef8AeP8Aev8Aef8Aev8Aef8Aef8Aef8Ae/8Aev8o9FrPAAAANHRSTlMAQMAxzmf68dWdURgQC/c3KweHcNy2q3cT7OaCXkvYvJiSVQTgsKNFHvSOe2s9xiVjWhUjKMYXBQAAA71JREFUeNrt2mtzmkAYhuGHAAoKCp7whOdTTI1J+v7/39YZoLPRaH0XdmU6w/WtM9v2FpdllwSVSqVSqfznvMHOR4mMMdGmjbKES0p01ijFaUYZq4yLMHTpm4WHJ7NHdGH8i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V4AnWX+M6QfrhCcKo/rVo2+FJ/Mm366CY6ME63hQSxYet42yDLuWZfuoVCqVSuW/9gcxKkzd9NTrtAAAAABJRU5ErkJggg==" width="48" height="48" src="22"></i></p>
				<p class="hd"><i class="i2">◆<span>◆</span></i></P>
				<form id="captcha_form" method="post" action="">
					<p>请输入密码,继续浏览文章!</p>
					<p><input type="text" name="logpwd" class="int1" autocomplete="off"></p>
					<p><button type="submit" class="btn1">提交密码</button></p>
					<?php if($postPwd): ?>
						<p id="error">密码不对哦~</p>
						<script>setTimeout(function() {document.getElementById("error").style.display = "none"}, 2000);</script>
					<?php endif; ?>
				</form>
				<a href="<?php echo $url; ?>" class="home" title="点击回到网站首页">- 返回首页 - </a>
			</div>
			</body>
			</html>
			<?php
			if ($cookiePwd) {
				setcookie('em_logpwd_' . $logid, ' ', time() - 31536000);
			}


Snipaste_2019-11-15_13-09-41.png


感谢唐朝、孟坤两位大佬,不喜欢的请自行美化。


版权声明:若无特殊注明,本文为《Dice》原创,转载请保留文章出处。
本文链接:https://blog.52linglong.com/skill/16.html
正文到此结束

热门推荐

发表吐槽

你肿么看?

你还可以输入 250 / 250 个字

嘻嘻 大笑 可怜 吃惊 害羞 调皮 鄙视 示爱 大哭 开心 偷笑 嘘 奸笑 委屈 抱抱 愤怒 思考 日了狗 胜利 不高兴 阴险 乖 酷 滑稽

评论信息框
可使用QQ号实时获取昵称+头像

私密评论

吃奶的力气提交吐槽中...


既然没有吐槽,那就赶紧抢沙发吧!