把代码加到你的底部模板里“[!--temp.footer--]”
<script> document.addEventListener('DOMContentLoaded', function() { fetch('[!--news.url--]e/member/login/loginjs.php', { method: 'GET', headers: { 'Content-Type': 'text/html' } }) .then(response => { if (!response.ok) throw new Error('Failed to fetch loginjs.php'); return response.text(); }) .then(data => { if (data.includes('您有新消息')) { const button = document.createElement('a'); button.href = '[!--news.url--]e/member/msg/'; button.innerHTML = '<span>New</span>'; button.title = '您有新消息'; button.style.cssText = ` position: fixed; top: 60px; right: 20px; z-index: 1100; width: 35px; height: 20px; background: #ff4d4f; color: #fff; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 11.5px; text-decoration: none; box-shadow: 0 2px 5px rgba(0,0,0,0.3); `; const style = document.createElement('style'); style.textContent = ` @keyframes shake { 0%, 100% { transform: translateY(0); } 25% { transform: translateY(-5px); } 75% { transform: translateY(5px); } } .message-button.shake { animation: shake 0.5s ease-in-out infinite; } `; document.head.appendChild(style); button.classList.add('message-button', 'shake'); document.body.appendChild(button); } }) .catch(error => { console.error('Error fetching loginjs.php:', error); }); }); </script>
如果“e/member/login/loginjs.php”这个文件你修改过,建议把原始安装包内的文件复制一份改个名字引用到这段JS里: 这一行:fetch('[!--news.url--]e/member/login/loginjs.php', {
上传以下图片:

|