首页
网站数据统计
网站留言
友情链接
Search
1
搭建自己的随机图片API
98 阅读
2
通过使用CSS,为您的网站添加一个具有渐变效果的背景
87 阅读
3
本站已运行了多少天代码(js版+php版)
85 阅读
4
最新liunx宝塔面板9.4.0开心版 – 宝塔开心版脚本
83 阅读
5
Weibo:Typecho的仿新浪微博主题,经典再现!
81 阅读
精品源码
技术分享
typecho
登录
找到
1
篇与
joe主题
相关的结果
2025-03-09
给Joe主题添加隐私评论功能(其他主题部分通用)
前言 方法非全部原创(不懂 PHP),我只写了部分 Js 代码,思路和部分代码来自由小王先森 (xwsir.cn)基于 Joe 主题开发的 Word 主题 教程开始 将下面这段代码插入评论区(请自行美化样式),一般放在提交评论的按钮前 <input type="checkbox" name="is-private" id="PrivateComments"><label for="PrivateComments" class="PrivateCommentsLable">Joe 主题放在在 public\comment.php 下图位置前面 其他主题可以在 comment.php 搜索你主题提交评论按钮的汉字,并放入前方 插入 JS,将下面这段代码插入 comment.php 最下方 <script>document.addEventListener('DOMContentLoaded',()=>{var groupInfo='<?php echo $groupUserInfo ?>';if(groupInfo!='administrator'){$(".comment_operation").css("display","none")}var comments4Reception='<?php $this->options->Comments4Reception() ?>';if(!comments4Reception||comments4Reception=='off'){$(".comment_operation").css("display","none")}});$('.comment_btn_operation').click(function(){var type=$(this).data('type');var coid=$(this).data('coid');$('#comment_form_operation').append('<input type="hidden" name="type" value="'+type+'" />');$('#comment_form_operation').append('<input type="hidden" name="coid" value="'+coid+'" />');$('#comment_form_operation').submit()});document.getElementById('PrivateComments').addEventListener('click',function(){var commentField=document.getElementById('comment');if(document.getElementById('PrivateComments').checked){Qmsg.info('已开启密语');var currentValue=commentField.value;commentField.value='密语# '+currentValue;commentField.addEventListener('input',preventDeletingText)}else{Qmsg.info('已关闭密语');commentField.value=commentField.value.replace('密语# ','');commentField.removeEventListener('input',preventDeletingText)}});function preventDeletingText(){var commentField=document.getElementById('comment');if(!commentField.value.startsWith('密语# ')){commentField.value='密语# '+commentField.value.substring(3)}}</script>修改评论输出语句(以 Joe 主题为例) 在 comment.php 找到(其他主题请找到对应的实现相关功能的代码并修改,不会可以再评论区留言) 评论之后请刷新界面即可复制代码 隐藏内容,请前往内页查看详情 评论之后请刷新界面即可复制代码 修改文本输入框,给文本框添加 id=“comment”, 如果你的主题输入框已有 id 值,就将 js 中的’comment’修改为主题的 id 值
技术分享
# php
# css
# joe主题
白猫
昨天
1
27
0