update-ad
This commit is contained in:
88
static/ad-1.html
Normal file
88
static/ad-1.html
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh-CN">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>广告页面</title>
|
||||||
|
<style>
|
||||||
|
/* 让页面内容充满整个视口 */
|
||||||
|
html, body {
|
||||||
|
height: 100%;
|
||||||
|
margin: 10px;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 居中显示内容 */
|
||||||
|
body {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 使图片适应手机屏幕 */
|
||||||
|
img {
|
||||||
|
max-width: 100%;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 页脚样式 */
|
||||||
|
footer {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
width: 100%;
|
||||||
|
background-color: #f0f0f0;
|
||||||
|
text-align: center;
|
||||||
|
padding: 5px 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1>是兄弟就找我,无兄弟不传奇!</h1>
|
||||||
|
<a href="?hinas" onclick="trackVisit()">
|
||||||
|
<img id="adImage" src="ad.jpg" alt="广告图片">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<footer>
|
||||||
|
<p>点击链接访问次数: <span id="visitCount">加载中...</span></p>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// 获取并显示访问次数
|
||||||
|
function getVisitCount() {
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
xhr.onreadystatechange = function() {
|
||||||
|
if (xhr.readyState === XMLHttpRequest.DONE) {
|
||||||
|
if (xhr.status === 200) {
|
||||||
|
document.getElementById('visitCount').innerText = xhr.responseText;
|
||||||
|
} else {
|
||||||
|
console.error('获取访问次数失败');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
xhr.open('GET', 'ad_get_visit_count.php', true);
|
||||||
|
xhr.send();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 点击图片时触发的函数,用于向后端发送访问计数请求
|
||||||
|
function trackVisit() {
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
xhr.open('GET', 'ad_visit.php', true);
|
||||||
|
xhr.onreadystatechange = function() {
|
||||||
|
if (xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) {
|
||||||
|
getVisitCount(); // 更新访问次数显示
|
||||||
|
}
|
||||||
|
};
|
||||||
|
xhr.send();
|
||||||
|
|
||||||
|
// 更新图片的点击链接,可以将其指向实际的广告目标链接
|
||||||
|
document.getElementById('adImage').parentNode.href = "https://www.521f.com";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 页面加载完成后获取并显示访问次数
|
||||||
|
window.onload = function() {
|
||||||
|
getVisitCount();
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
169
static/ad.html
169
static/ad.html
@@ -1,88 +1,111 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="zh-CN">
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<title>广告页面</title>
|
<title>海纳思系统官方通告</title>
|
||||||
<style>
|
<style>
|
||||||
/* 让页面内容充满整个视口 */
|
body {
|
||||||
html, body {
|
width: 40em;
|
||||||
height: 100%;
|
margin: 0 auto;
|
||||||
margin: 10px;
|
font-family: Tahoma, Verdana, Arial, sans-serif;
|
||||||
|
}
|
||||||
|
.content pre{
|
||||||
|
position: relative;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border-radius: 4px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
pre .btn-pre-copy{
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
-khtml-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
position: absolute;
|
||||||
|
top: 10px;
|
||||||
|
right: 12px;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1;
|
||||||
|
cursor: pointer;
|
||||||
|
color: hsla(0,0%,54.9%,.8);
|
||||||
|
transition: color .1s;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
/* 居中显示内容 */
|
|
||||||
body {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 使图片适应手机屏幕 */
|
|
||||||
img {
|
|
||||||
max-width: 100%;
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 页脚样式 */
|
|
||||||
footer {
|
|
||||||
position: fixed;
|
|
||||||
bottom: 0;
|
|
||||||
width: 100%;
|
|
||||||
background-color: #f0f0f0;
|
|
||||||
text-align: center;
|
|
||||||
padding: 5px 0;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>是兄弟就找我,无兄弟不传奇!</h1>
|
<header>
|
||||||
<a href="?hinas" onclick="trackVisit()">
|
<h1>海纳思系统官方广告位招租</h1>
|
||||||
<img id="adImage" src="ad.jpg" alt="广告图片">
|
</header>
|
||||||
</a>
|
|
||||||
|
|
||||||
<footer>
|
<h2>22000+装机数</h2>
|
||||||
<p>点击链接访问次数: <span id="visitCount">加载中...</span></p>
|
<h2>日活6000+</h2>
|
||||||
</footer>
|
<h2>日增约100台</h2>
|
||||||
|
<h2>要求:符合海纳思服务器的环境需求</h2>
|
||||||
|
<h2>捐助并投放,与作者共赢!请联系本站</h2>
|
||||||
|
<br/>
|
||||||
|
<br/>
|
||||||
|
|
||||||
<script>
|
<script language="JavaScript">
|
||||||
// 获取并显示访问次数
|
<!--
|
||||||
function getVisitCount() {
|
var caution = false
|
||||||
var xhr = new XMLHttpRequest();
|
function setCookie(name, value, expires, path, domain, secure) {
|
||||||
xhr.onreadystatechange = function() {
|
var curCookie = name + "=" + escape(value) +
|
||||||
if (xhr.readyState === XMLHttpRequest.DONE) {
|
((expires) ? "; expires=" + expires.toGMTString() : "") +
|
||||||
if (xhr.status === 200) {
|
((path) ? "; path=" + path : "") +
|
||||||
document.getElementById('visitCount').innerText = xhr.responseText;
|
((domain) ? "; domain=" + domain : "") +
|
||||||
} else {
|
((secure) ? "; secure" : "")
|
||||||
console.error('获取访问次数失败');
|
if (!caution || (name + "=" + escape(value)).length <= 4000)
|
||||||
}
|
document.cookie = curCookie
|
||||||
}
|
else
|
||||||
};
|
if (confirm("Cookie exceeds 4KB and will be cut!"))
|
||||||
xhr.open('GET', 'ad_get_visit_count.php', true);
|
document.cookie = curCookie
|
||||||
xhr.send();
|
}
|
||||||
|
function getCookie(name) {
|
||||||
|
var prefix = name + "="
|
||||||
|
var cookieStartIndex = document.cookie.indexOf(prefix)
|
||||||
|
if (cookieStartIndex == -1)
|
||||||
|
return null
|
||||||
|
var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length)
|
||||||
|
if (cookieEndIndex == -1)
|
||||||
|
cookieEndIndex = document.cookie.length
|
||||||
|
return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex))
|
||||||
|
}
|
||||||
|
function deleteCookie(name, path, domain) {
|
||||||
|
if (getCookie(name)) {
|
||||||
|
document.cookie = name + "=" +
|
||||||
|
((path) ? "; path=" + path : "") +
|
||||||
|
((domain) ? "; domain=" + domain : "") +
|
||||||
|
"; expires=Thu, 01-Jan-70 00:00:01 GMT"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
function fixDate(date) {
|
||||||
|
var base = new Date(0)
|
||||||
|
var skew = base.getTime()
|
||||||
|
if (skew > 0)
|
||||||
|
date.setTime(date.getTime() - skew)
|
||||||
|
}
|
||||||
|
var now = new Date()
|
||||||
|
fixDate(now)
|
||||||
|
now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000)
|
||||||
|
var visits = getCookie("counter")
|
||||||
|
if (!visits)
|
||||||
|
visits = 1
|
||||||
|
else
|
||||||
|
visits = parseInt(visits) + 1
|
||||||
|
setCookie("counter", visits, now)
|
||||||
|
document.write("您是到访的第" + visits + "位用户!")
|
||||||
|
// -->
|
||||||
|
</script>
|
||||||
|
|
||||||
// 点击图片时触发的函数,用于向后端发送访问计数请求
|
|
||||||
function trackVisit() {
|
|
||||||
var xhr = new XMLHttpRequest();
|
|
||||||
xhr.open('GET', 'ad_visit.php', true);
|
|
||||||
xhr.onreadystatechange = function() {
|
|
||||||
if (xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) {
|
|
||||||
getVisitCount(); // 更新访问次数显示
|
|
||||||
}
|
|
||||||
};
|
|
||||||
xhr.send();
|
|
||||||
|
|
||||||
// 更新图片的点击链接,可以将其指向实际的广告目标链接
|
<footer>
|
||||||
document.getElementById('adImage').parentNode.href = "https://www.521f.com";
|
版权 © <span class="year">2023</span> <a href="http://www.ecoo.top/">www.ecoo.top</a>
|
||||||
}
|
</footer>
|
||||||
|
<br/><br/>
|
||||||
|
|
||||||
|
|
||||||
// 页面加载完成后获取并显示访问次数
|
|
||||||
window.onload = function() {
|
|
||||||
getVisitCount();
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
BIN
static/ad.jpg
BIN
static/ad.jpg
Binary file not shown.
|
Before Width: | Height: | Size: 675 KiB After Width: | Height: | Size: 86 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 675 KiB After Width: | Height: | Size: 86 KiB |
Reference in New Issue
Block a user