找到
1
篇与
java
相关的结果
-
Typecho实现评论时自动随机输入一条评论功能 第一步 修改 core/function.php 打开function.php文件,找到下方代码 function _getVersion() { return "7.7.1"; };将以下代码复制粘贴到后边 function random_comment() { $comments = array('对小白真的很友好,写的很全面', '终于找到这篇文章了,感谢作者的分享', '喜欢这篇文章,作者666,文章真棒', '支持博主,一定多分享', '这篇文章写的真不错,真详细,点个赞', '这篇文章肯定会火,作者666大顺', '受益匪浅,感谢博主', '学习到了,感谢博主'); return $comments[rand(0,count($comments)-1)]; }1.png图片 第二步 修改 public/comment.php 打开comment.php文件找到下方代码(在第33行左右),将下方代码 <textarea class="text joe_owo__target" name="text" value="" autocomplete="new-password" placeholder="说点什么吧,点击右上方切换成画图试试?"></textarea>替换为以下代码 <textarea class="text joe_owo__target" name="text" value="" autocomplete="new-password" placeholder="说点什么吧,点击右上方切换成画图试试?"><?php echo random_comment(); ?></textarea>2.png图片