记录Typecho纯代码算术验证
2022-12-26
分类: typecho
简介:Typecho的垃圾评论还是比较多的,除了插件外,还可以通过PHP函数实现简单的算术验证码。第一步function.php如下函数//算术验证评论
function themeInit($comment){
$comment = spam_protection_pre($comment, $post, $result);
}
function spam_protection_math(){ $num1=rand(1,49); $num2=rand(1,49); echo "<label for=\"math\">请输入<code>$num1</code>+<code>$num2</code>的计算结果:</label>\n"; echo "<input type=\"text\" name=\"sum\" class=\"text\" value=\"\" size=\"25\" tabindex=\"4\" style=\"width:218px\" placeholder=\"计算结果:\">\n"; echo "<input type=\"hidden\" name=\"num1\" value=\"$num1\">\n"; echo "<input type=\"hidden\" name=\"num2\" value=\"$num2\">";
}
function spam_protection_pre($comment, $post, $result){ $sum=$_POST['sum']; switch($sum){ case $_POST['num1']+$_POST['num2']: break; case null: throw new Typecho_Widget_Exception(_t('对不起: 请输入验证码。<a href="javascript:history.back( 1)">返回上一页</a>','评论失败')); break; default: throw new Typecho_Widget_Exception(_t('对不起: 验证码错误,请<a href="javascript:history.back( 1)">返回</a>重试。','评论失败')); } return $comment;
}第二步comments.php添加函数打开主题comments.php文件,在适当为止插入如下代码:<?php spam_protection_math();?>如果觉得100以内太难了,请修复function.php中添加的代码中rand后面的数字范围。
typecho评论验证码插件
2022-12-24
分类: typecho
简介:很多用户受到垃圾评论的困扰,因为某些国内服务器无法连接到Akismet服务,所以垃圾评论肆虐。有的用户即使启用了Akismet插件,但成千上万条垃圾评论对服务器负载也造成了影响。因此我开发了一个验证码插件,有需要开发类似插件的用户也可以借鉴一下开发方法。使用方法很简单,下载插件解压后,将其上传至/usr/plugins/目录下,先在后台启用插件,然后编辑摸板,在评论的表单位置也就是comments的form标签之间的任何你认为合适的地方,加上如下代码<p><?php Captcha_Plugin::output(); ?></p>[hide]评论验证码插件.zip[/hide]
EMlog添加评论者邮箱等级
2021-01-22
分类: Emlog
简介:简介为你的EMlog博客 评论区添加评论者等级 评论者的等级由评论的QQ邮箱的次数来分配你的等级 评论的时候填写你的QQ邮箱 比如等级二 需要20次评论 评论20次就可以从1级升级到2级的 默认都是一级的 核心代码可以任意设置多少级 达到多少次评论升几级 任你设置 好了 不废话来 直接开始教程把 咋地了 嫌弃我嫌弃我的B话多了吗 嘿嘿 往下面看 小老弟们 呵呵!第一步你的模版/module.php增加如下代码 别放错了哦 <?php //邮箱输出评论者等级 function echo_levels($comment_author_email,$comment_author_url){ $DB = Database::getInstance(); global $CACHE; $user_cache = $CACHE >readCache('user'); $adminEmail = '"'.$user_cache[1]['mail'].'"'; if($comment_author_email==$adminEmail){ echo '<a class="admin" title="这货就是管理员"><img src="'.TEMPLATE_URL.'images/admin.png"></a>'; } $sql = "SELECT cid as author_count,mail FROM ".DB_PREFIX."comment WHERE mail != '' and mail = $comment_author_email and hide ='n'"; $res = $DB >query($sql); $author_count = $DB >num_rows($res); if($author_count>=0 && $author_count<5 && $comment_author_email!=$adminEmail) echo '<a class="vip1" title="VIP等级:初入联盟 LV.1"><i class="pro"></i><i class="level">Lv.1</i></a>'; else if($author_count>=5 && $author_count<10 && $comment_author_email!=$adminEmail) echo '<a class="vip2" title="VIP等级:英勇黄铜 LV.2"><i class="pro"></i><i class="level">Lv.2</i></a>'; else if($author_count>=10 && $author_count<20 && $comment_author_email!=$adminEmail) echo '<a class="vip3" title="VIP等级:不屈白银 LV.3"><i class="pro"></i><i class="level">Lv.3</i></a>'; else if($author_count>=20 && $author_count<30 && $comment_author_email!=$adminEmail) echo '<a class="vip4" title="VIP等级:华贵铂金 LV.4"><i class="pro"></i><i class="level">Lv.4</i></a>'; else if($author_count>=30 &&$author_count<40 && $comment_author_email!=$adminEmail) echo '<a class="vip5" title="VIP等级:璀璨钻石 LV.5"><i class="pro"></i><i class="level">Lv.5</i></a>'; else if($author_count>=40 && $author_coun<50 && $comment_author_email!=$adminEmail) echo '<a class="vip6" title="VIP等级:超凡大师 LV.6"><i class="pro"></i><i class="level">Lv.6</i></a>'; else if($author_count>=50 && $author_coun<60 && $comment_author_email!=$adminEmail) echo '<a class="vip7" title="VIP等级:最强王者 LV.7"><i class="pro"></i><i class="level">Lv.7</i></a>'; else if($author_count>=60 && $author_coun<70 && $comment_author_email!=$adminEmail) echo '<a class="vip8" title="VIP等级:职业选手 LV.8"><i class="pro"></i><i class="level">Lv.8</i></a>'; } ?>第二步放完第一步核心代码来 下来还是module.php文件这句代码 代表是评论等级在什么地方显示 放在你要显示的地方哦 <span class="comment reply"><?php echo echo_levels("\"".strip_tags($comment['mail'])."\"","\"".$isuserlink."\"");?></span>第三步上面的两步完成来 真的很不错来啊 还有最后一步哦 等级的css哦下面颜色代表是每个等级的颜色哦 可以自行设置哦 放在你的公用的Css文件如果还有什么不会的评论 或者直接联系我哦 .vip1 {margin left: 1px;font size: 12px;color: #fff;background color: #348be8;padding: 0 4px;border radius: 2px;font size: 12px;cursor: pointer; webkit transition: .3s; khtml opacity: .5;opacity: .5;line height: 150%;display: inline block;vertical align: middle;} .vip2 {margin left: 1px;font size: 12px;color: #fff;background color: #0bf;padding: 0 4px;border radius: 2px;font size: 12px;cursor: pointer; webkit transition: .3s; khtml opacity: .5;opacity: .5;line height: 150%;display: inline block;vertical align: middle;} .vip3 {margin left: 1px;font size: 12px;color: #fff;background color: #fd8edb;padding: 0 4px;border radius: 2px;font size: 12px;cursor: pointer; webkit transition: .3s; khtml opacity: .5;opacity: .5;line height: 150%;display: inline block;vertical align: middle;} .vip4 {margin left: 1px;font size: 12px;color: #fff;background color: #eb5055;padding: 0 4px;border radius: 2px;font size: 12px;cursor: pointer; webkit transition: .3s; khtml opacity: .5;opacity: .5;line height: 150%;display: inline block;vertical align: middle;} .vip5 {margin left: 1px;font size: 12px;color: #fff;background color: #6f8ec5;padding: 0 4px;border radius: 2px;font size: 12px;cursor: pointer; webkit transition: .3s; khtml opacity: .5;opacity: .5;line height: 150%;display: inline block;vertical align: middle;} .vip6 {margin left: 1px;font size: 12px;color: #fff;background color: #5fb878;padding: 0 4px;border radius: 2px;font size: 12px;cursor: pointer; webkit transition: .3s; khtml opacity: .5;opacity: .5;line height: 150%;display: inline block;vertical align: middle;} .vip7 {margin left: 1px;font size: 12px;color: #fff;background color: #c0c000;padding: 0 4px;border radius: 2px;font size: 12px;cursor: pointer; webkit transition: .3s; khtml opacity: .5;opacity: .5;line height: 150%;display: inline block;vertical align: middle;} .vip8 {margin left: 1px;font size: 12px;color: #fff;background color: #292929;padding: 0 4px;border radius: 2px;font size: 12px;cursor: pointer; webkit transition: .3s; khtml opacity: .5;opacity: .5;line height: 150%;display: inline block;vertical align: middle;}
typecho免插件开启评论@小尾巴
2020-10-11
分类: typecho
简介:在function里面加上这个//获取评论的锚点链接
function get_comment_at($coid)
{ $db = Typecho_Db::get(); $prow = $db >fetchRow($db >select('parent,status') >from('table.comments') >where('coid = ?', $coid));//当前评论 $mail = ""; $parent = @$prow['parent']; if ($parent != "0") {//子评论 $arow = $db >fetchRow($db >select('author,status,mail') >from('table.comments') >where('coid = ?', $parent));//查询该条评论的父评论的信息 @$author = @$arow['author'];//作者名称 $mail = @$arow['mail']; if(@$author && $arow['status'] == "approved"){//父评论作者存在且父评论已经审核通过 if (@$prow['status'] == "waiting"){ echo '<p class="commentReview">(评论正在审核中)</p>'; } echo '<a href="#comment ' . $parent . '">@' . $author . '</a>'; }else{//父评论作者不存在或者父评论没有审核通过 if (@$prow['status'] == "waiting"){ echo '<p class="commentReview">(评论正在审核中)</p>'; }else{ echo ''; } } } else {//母评论,无需输出锚点链接 if (@$prow['status'] == "waiting"){ echo '<p class="commentReview">(评论正在审核中)</p>'; }else{ echo ''; } }
}调用方法:在评论输出内容的地方前面放上就行了<?php $parentMail = get_comment_at($comments >coid)?><?php echo $parentMail;?>
typecho可用Emoji表情大全
2020-10-10
分类: typecho
简介:Smileys😀 😁 😂 🤣 😃 😄 😅 😆 😉 😊 😋 😎 😍 😘 😗 😙 😚 ☺️ 🙂 🤗 🤩 🤔 🤨 😐 😑 😶 🙄 😏 😣 😥 😮 🤐 😯 😪 😫 😴 😌 😛 😜 😝 🤤 😒 😓 😔 😕 🙃 🤑 😲 ☹️ 🙁 😖 😞 😟 😤 😢 😭 😦 😧 😨 😩 🤯 😬 😰 😱 😳 🤪 😵 😡 😠 🤬 😷 🤒 🤕 🤢 🤮 🤧 😇 🤠 🤡 🤥 🤫 🤭 🧐 🤓 😈 👿 👹 👺 💀 👻 👽 🤖 💩 😺 😸 😹 😻 😼 😽 🙀 😿 😾People and Fantasy👶 👧 🧒 👦 👩 🧑 👨 👵 🧓 👴 👲 👳♀️ 👳♂️ 🧕 👮♀️ 👮♂️ 👷♀️ 👷♂️ 💂♀️ 💂♂️ 🕵️♀️ 🕵️♂️ 👩⚕️ 👨⚕️ 👩🌾 👨🌾 👩🍳 👨🍳 👩🎓 👨🎓 👩🎤 👨🎤 👩🏫 👨🏫 👩🏭 👨🏭 👩💻 👨💻 👩💼 👨💼 👩🔧 👨🔧 👩🔬 👨🔬 👩🎨 👨🎨 👩🚒 👨🚒 👩✈️ 👨✈️ 👩🚀 👨🚀 👩⚖️ 👨⚖️ 👰 🤵 👸 🤴 🤶 🎅 🧙♀️ 🧙♂️ 🧝♀️ 🧝♂️ 🧛♀️ 🧛♂️ 🧟♀️ 🧟♂️ 🧞♀️ 🧞♂️ 🧜♀️ 🧜♂️ 🧚♀️ 🧚♂️ 👼 🤰 🤱 🙇♀️ 🙇♂️ 💁♀️ 💁♂️ 🙅♀️ 🙅♂️ 🙆♀️ 🙆♂️ 🙋♀️ 🙋♂️ 🤦♀️ 🤦♂️ 🤷♀️ 🤷♂️ 🙎♀️ 🙎♂️ 🙍♀️ 🙍♂️ 💇♀️ 💇♂️ 💆♀️ 💆♂️ 🧖♀️ 🧖♂️ 💅 🤳 💃 🕺 👯♀️ 👯♂️ 🕴 🚶♀️ 🚶♂️ 🏃♀️ 🏃♂️ 👫 👭 👬 💑 👩❤️👩 👨❤️👨 💏 👩❤️💋👩 👨❤️💋👨 👪 👨👩👧 👨👩👧👦 👨👩👦👦 👨👩👧👧 👩👩👦 👩👩👧 👩👩👧👦 👩👩👦👦 👩👩👧👧 👨👨👦 👨👨👧 👨👨👧👦 👨👨👦👦 👨👨👧👧 👩👦 👩👧 👩👧👦 👩👦👦 👩👧👧 👨👦 👨👧 👨👧👦 👨👦👦 👨👧👧 🤲 👐 🙌 👏 🤝 👍 👎 👊 ✊ 🤛 🤜 🤞 ✌️ 🤟 🤘 👌 👈 👉 👆 👇 ☝️ ✋ 🤚 🖐 🖖 👋 🤙 💪 🖕 ✍️ 🙏 💍 💄 💋 👄 👅 👂 👃 👣 👁 👀 🧠 🗣 👤 👥Clothing and Accessories🧥 👚 👕 👖 👔 👗 👙 👘 👠 👡 👢 👞 👟 🧦 🧤 🧣 🎩 🧢 👒 🎓 ⛑ 👑 👝 👛 👜 💼 🎒 👓 🕶 🌂Pale Emojis👶🏻 👦🏻 👧🏻 👨🏻 👩🏻 👱🏻♀️ 👱🏻 👴🏻 👵🏻 👲🏻 👳🏻♀️ 👳🏻 👮🏻♀️ 👮🏻 👷🏻♀️ 👷🏻 💂🏻♀️ 💂🏻 🕵🏻♀️ 🕵🏻 👩🏻⚕️ 👨🏻⚕️ 👩🏻🌾 👨🏻🌾 👩🏻🍳 👨🏻🍳 👩🏻🎓 👨🏻🎓 👩🏻🎤 👨🏻🎤 👩🏻🏫 👨🏻🏫 👩🏻🏭 👨🏻🏭 👩🏻💻 👨🏻💻 👩🏻💼 👨🏻💼 👩🏻🔧 👨🏻🔧 👩🏻🔬 👨🏻🔬 👩🏻🎨 👨🏻🎨 👩🏻🚒 👨🏻🚒 👩🏻✈️ 👨🏻✈️ 👩🏻🚀 👨🏻🚀 👩🏻⚖️ 👨🏻⚖️ 🤶🏻 🎅🏻 👸🏻 🤴🏻 👰🏻 🤵🏻 👼🏻 🤰🏻 🙇🏻♀️ 🙇🏻 💁🏻 💁🏻♂️ 🙅🏻 🙅🏻♂️ 🙆🏻 🙆🏻♂️ 🙋🏻 🙋🏻♂️ 🤦🏻♀️ 🤦🏻♂️ 🤷🏻♀️ 🤷🏻♂️ 🙎🏻 🙎🏻♂️ 🙍🏻 🙍🏻♂️ 💇🏻 💇🏻♂️ 💆🏻 💆🏻♂️ 🕴🏻 💃🏻 🕺🏻 🚶🏻♀️ 🚶🏻 🏃🏻♀️ 🏃🏻 🤲🏻 👐🏻 🙌🏻 👏🏻 🙏🏻 👍🏻 👎🏻 👊🏻 ✊🏻 🤛🏻 🤜🏻 🤞🏻 ✌🏻 🤟🏻 🤘🏻 👌🏻 👈🏻 👉🏻 👆🏻 👇🏻 ☝🏻 ✋🏻 🤚🏻 🖐🏻 🖖🏻 👋🏻 🤙🏻 💪🏻 🖕🏻 ✍🏻 🤳🏻 💅🏻 👂🏻 👃🏻Black Emojis👶🏿 👦🏿 👧🏿 👨🏿 👩🏿 👱🏿♀️ 👱🏿 👴🏿 👵🏿 👲🏿 👳🏿♀️ 👳🏿 👮🏿♀️ 👮🏿 👷🏿♀️ 👷🏿 💂🏿♀️ 💂🏿 🕵🏿♀️ 🕵🏿 👩🏿⚕️ 👨🏿⚕️ 👩🏿🌾 👨🏿🌾 👩🏿🍳 👨🏿🍳 👩🏿🎓 👨🏿🎓 👩🏿🎤 👨🏿🎤 👩🏿🏫 👨🏿🏫 👩🏿🏭 👨🏿🏭 👩🏿💻 👨🏿💻 👩🏿💼 👨🏿💼 👩🏿🔧 👨🏿🔧 👩🏿🔬 👨🏿🔬 👩🏿🎨 👨🏿🎨 👩🏿🚒 👨🏿🚒 👩🏿✈️ 👨🏿✈️ 👩🏿🚀 👨🏿🚀 👩🏿⚖️ 👨🏿⚖️ 🤶🏿 🎅🏿 👸🏿 🤴🏿 👰🏿 🤵🏿 👼🏿 🤰🏿 🙇🏿♀️ 🙇🏿 💁🏿 💁🏿♂️ 🙅🏿 🙅🏿♂️ 🙆🏿 🙆🏿♂️ 🙋🏿 🙋🏿♂️ 🤦🏿♀️ 🤦🏿♂️ 🤷🏿♀️ 🤷🏿♂️ 🙎🏿 🙎🏿♂️ 🙍🏿 🙍🏿♂️ 💇🏿 💇🏿♂️ 💆🏿 💆🏿♂️ 🕴🏿 💃🏿 🕺🏿 🚶🏿♀️ 🚶🏿 🏃🏿♀️ 🏃🏿 🤲🏿 👐🏿 🙌🏿 👏🏿 🙏🏿 👍🏿 👎🏿 👊🏿 ✊🏿 🤛🏿 🤜🏿 🤞🏿 ✌🏿 🤟🏿 🤘🏿 👌🏿 👈🏿 👉🏿 👆🏿 👇🏿 ☝🏿 ✋🏿 🤚🏿 🖐🏿 🖖🏿 👋🏿 🤙🏿 💪🏿 🖕🏿 ✍🏿 🤳🏿 💅🏿 👂🏿 👃🏿Animals & Nature🐶 🐱 🐭 🐹 🐰 🦊 🐻 🐼 🐨 🐯 🦁 🐮 🐷 🐽 🐸 🐵 🙈 🙉 🙊 🐒 🐔 🐧 🐦 🐤 🐣 🐥 🦆 🦅 🦉 🦇 🐺 🐗 🐴 🦄 🐝 🐛 🦋 🐌 🐚 🐞 🐜 🦗 🕷 🕸 🦂 🐢 🐍 🦎 🦖 🦕 🐙 🦑 🦐 🦀 🐡 🐠 🐟 🐬 🐳 🐋 🦈 🐊 🐅 🐆 🦓 🦍 🐘 🦏 🐪 🐫 🦒 🐃 🐂 🐄 🐎 🐖 🐏 🐑 🐐 🦌 🐕 🐩 🐈 🐓 🦃 🕊 🐇 🐁 🐀 🐿 🦔 🐾 🐉 🐲 🌵 🎄 🌲 🌳 🌴 🌱 🌿 ☘️ 🍀 🎍 🎋 🍃 🍂 🍁 🍄 🌾 💐 🌷 🌹 🥀 🌺 🌸 🌼 🌻 🌞 🌝 🌛 🌜 🌚 🌕 🌖 🌗 🌘 🌑 🌒 🌓 🌔 🌙 🌎 🌍 🌏 💫 ⭐️ 🌟 ✨ ⚡️ ☄️ 💥 🔥 🌪 🌈 ☀️ 🌤 ⛅️ 🌥 ☁️ 🌦 🌧 ⛈ 🌩 🌨 ❄️ ☃️ ⛄️ 🌬 💨 💧 💦 ☔️ ☂️ 🌊 🌫Food & Drink🍏 🍎 🍐 🍊 🍋 🍌 🍉 🍇 🍓 🍈 🍒 🍑 🍍 🥥 🥝 🍅 🍆 🥑 🥦 🥒 🌶 🌽 🥕 🥔 🍠 🥐 🍞 🥖 🥨 🧀 🥚 🍳 🥞 🥓 🥩 🍗 🍖 🌭 🍔 🍟 🍕 🥪 🥙 🌮 🌯 🥗 🥘 🥫 🍝 🍜 🍲 🍛 🍣 🍱 🥟 🍤 🍙 🍚 🍘 🍥 🥠 🍢 🍡 🍧 🍨 🍦 🥧 🍰 🎂 🍮 🍭 🍬 🍫 🍿 🍩 🍪 🌰 🥜 🍯 🥛 🍼 ☕️ 🍵 🥤 🍶 🍺 🍻 🥂 🍷 🥃 🍸 🍹 🍾 🥄 🍴 🍽 🥣 🥡 🥢Activity and Sports⚽️ 🏀 🏈 ⚾️ 🎾 🏐 🏉 🎱 🏓 🏸 🥅 🏒 🏑 🏏 ⛳️ 🏹 🎣 🥊 🥋 🎽 ⛸ 🥌 🛷 🎿 ⛷ 🏂 🏋️♀️ 🏋🏻♀️ 🏋🏼♀️ 🏋🏽♀️ 🏋🏾♀️ 🏋🏿♀️ 🏋️♂️ 🏋🏻♂️ 🏋🏼♂️ 🏋🏽♂️ 🏋🏾♂️ 🏋🏿♂️ 🤼♀️ 🤼♂️ 🤸♀️ 🤸🏻♀️ 🤸🏼♀️ 🤸🏽♀️ 🤸🏾♀️ 🤸🏿♀️ 🤸♂️ 🤸🏻♂️ 🤸🏼♂️ 🤸🏽♂️ 🤸🏾♂️ 🤸🏿♂️ ⛹️♀️ ⛹🏻♀️ ⛹🏼♀️ ⛹🏽♀️ ⛹🏾♀️ ⛹🏿♀️ ⛹️♂️ ⛹🏻♂️ ⛹🏼♂️ ⛹🏽♂️ ⛹🏾♂️ ⛹🏿♂️ 🤺 🤾♀️ 🤾🏻♀️ 🤾🏼♀️ 🤾🏾♀️ 🤾🏾♀️ 🤾🏿♀️ 🤾♂️ 🤾🏻♂️ 🤾🏼♂️ 🤾🏽♂️ 🤾🏾♂️ 🤾🏿♂️ 🏌️♀️ 🏌🏻♀️ 🏌🏼♀️ 🏌🏽♀️ 🏌🏾♀️ 🏌🏿♀️ 🏌️♂️ 🏌🏻♂️ 🏌🏼♂️ 🏌🏽♂️ 🏌🏾♂️ 🏌🏿♂️ 🏇 🏇🏻 🏇🏼 🏇🏽 🏇🏾 🏇🏿 🧘♀️ 🧘🏻♀️ 🧘🏼♀️ 🧘🏽♀️ 🧘🏾♀️ 🧘🏿♀️ 🧘♂️ 🧘🏻♂️ 🧘🏼♂️ 🧘🏽♂️ 🧘🏾♂️ 🧘🏿♂️ 🏄♀️ 🏄🏻♀️ 🏄🏼♀️ 🏄🏽♀️ 🏄🏾♀️ 🏄🏿♀️ 🏄♂️ 🏄🏻♂️ 🏄🏼♂️ 🏄🏽♂️ 🏄🏾♂️ 🏄🏿♂️ 🏊♀️ 🏊🏻♀️ 🏊🏼♀️ 🏊🏽♀️ 🏊🏾♀️ 🏊🏿♀️ 🏊♂️ 🏊🏻♂️ 🏊🏼♂️ 🏊🏽♂️ 🏊🏾♂️ 🏊🏿♂️ 🤽♀️ 🤽🏻♀️ 🤽🏼♀️ 🤽🏽♀️ 🤽🏾♀️ 🤽🏿♀️ 🤽♂️ 🤽🏻♂️ 🤽🏼♂️ 🤽🏽♂️ 🤽🏾♂️ 🤽🏿♂️ 🚣♀️ 🚣🏻♀️ 🚣🏼♀️ 🚣🏽♀️ 🚣🏾♀️ 🚣🏿♀️ 🚣♂️ 🚣🏻♂️ 🚣🏼♂️ 🚣🏽♂️ 🚣🏾♂️ 🚣🏿♂️ 🧗♀️ 🧗🏻♀️ 🧗🏼♀️ 🧗🏽♀️ 🧗🏾♀️ 🧗🏿♀️ 🧗♂️ 🧗🏻♂️ 🧗🏼♂️ 🧗🏽♂️ 🧗🏾♂️ 🧗🏿♂️ 🚵♀️ 🚵🏻♀️ 🚵🏼♀️ 🚵🏽♀️ 🚵🏾♀️ 🚵🏿♀️ 🚵♂️ 🚵🏻♂️ 🚵🏼♂️ 🚵🏽♂️ 🚵🏾♂️ 🚵🏿♂️ 🚴♀️ 🚴🏻♀️ 🚴🏼♀️ 🚴🏽♀️ 🚴🏾♀️ 🚴🏿♀️ 🚴♂️ 🚴🏻♂️ 🚴🏼♂️ 🚴🏽♂️ 🚴🏾♂️ 🚴🏿♂️ 🏆 🥇 🥈 🥉 🏅 🎖 🏵 🎗 🎫 🎟 🎪 🤹♀️ 🤹🏻♀️ 🤹🏼♀️ 🤹🏽♀️ 🤹🏾♀️ 🤹🏿♀️ 🤹♂️ 🤹🏻♂️ 🤹🏼♂️ 🤹🏽♂️ 🤹🏾♂️ 🤹🏿♂️ 🎭 🎨 🎬 🎤 🎧 🎼 🎹 🥁 🎷 🎺 🎸 🎻 🎲 🎯 🎳 🎮 🎰Travel & Places🚗 🚕 🚙 🚌 🚎 🏎 🚓 🚑 🚒 🚐 🚚 🚛 🚜 🛴 🚲 🛵 🏍 🚨 🚔 🚍 🚘 🚖 🚡 🚠 🚟 🚃 🚋 🚞 🚝 🚄 🚅 🚈 🚂 🚆 🚇 🚊 🚉 ✈️ 🛫 🛬 🛩 💺 🛰 🚀 🛸 🚁 🛶 ⛵️ 🚤 🛥 🛳 ⛴ 🚢 ⚓️ ⛽️ 🚧 🚦 🚥 🚏 🗺 🗿 🗽 🗼 🏰 🏯 🏟 🎡 🎢 🎠 ⛲️ ⛱ 🏖 🏝 🏜 🌋 ⛰ 🏔 🗻 🏕 ⛺️ 🏠 🏡 🏘 🏚 🏗 🏭 🏢 🏬 🏣 🏤 🏥 🏦 🏨 🏪 🏫 🏩 💒 🏛 ⛪️ 🕌 🕍 🕋 ⛩ 🛤 🛣 🗾 🎑 🏞 🌅 🌄 🌠 🎇 🎆 🌇 🌆 🏙 🌃 🌌 🌉 🌁Objects⌚️ 📱 📲 💻 ⌨️ 🖥 🖨 🖱 🖲 🕹 🗜 💽 💾 💿 📀 📼 📷 📸 📹 🎥 📽 🎞 📞 ☎️ 📟 📠 📺 📻 🎙 🎚 🎛 ⏱ ⏲ ⏰ 🕰 ⌛️ ⏳ 📡 🔋 🔌 💡 🔦 🕯 🗑 🛢 💸 💵 💴 💶 💷 💰 💳 💎 ⚖️ 🔧 🔨 ⚒ 🛠 ⛏ 🔩 ⚙️ ⛓ 🔫 💣 🔪 🗡 ⚔️ 🛡 🚬 ⚰️ ⚱️ 🏺 🔮 📿 💈 ⚗️ 🔭 🔬 🕳 💊 💉 🌡 🚽 🚰 🚿 🛁 🛀 🛀🏻 🛀🏼 🛀🏽 🛀🏾 🛀🏿 🛎 🔑 🗝 🚪 🛋 🛏 🛌 🖼 🛍 🛒 🎁 🎈 🎏 🎀 🎊 🎉 🎎 🏮 🎐 ✉️ 📩 📨 📧 💌 📥 📤 📦 🏷 📪 📫 📬 📭 📮 📯 📜 📃 📄 📑 📊 📈 📉 🗒 🗓 📆 📅 📇 🗃 🗳 🗄 📋 📁 📂 🗂 🗞 📰 📓 📔 📒 📕 📗 📘 📙 📚 📖 🔖 🔗 📎 🖇 📐 📏 📌 📍 ✂️ 🖊 🖋 ✒️ 🖌 🖍 📝 ✏️ 🔍 🔎 🔏 🔐 🔒 🔓Symbols❤️ 🧡 💛 💚 💙 💜 🖤 💔 ❣️ 💕 💞 💓 💗 💖 💘 💝 💟 ☮️ ✝️ ☪️ 🕉 ☸️ ✡️ 🔯 🕎 ☯️ ☦️ 🛐 ⛎ ♈️ ♉️ ♊️ ♋️ ♌️ ♍️ ♎️ ♏️ ♐️ ♑️ ♒️ ♓️ 🆔 ⚛️ 🉑 ☢️ ☣️ 📴 📳 🈶 🈚️ 🈸 🈺 🈷️ ✴️ 🆚 💮 🉐 ㊙️ ㊗️ 🈴 🈵 🈹 🈲 🅰️ 🅱️ 🆎 🆑 🅾️ 🆘 ❌ ⭕️ 🛑 ⛔️ 📛 🚫 💯 💢 ♨️ 🚷 🚯 🚳 🚱 🔞 📵 🚭 ❗️ ❕ ❓ ❔ ‼️ ⁉️ 🔅 🔆 〽️ ⚠️ 🚸 🔱 ⚜️ 🔰 ♻️ ✅ 🈯️ 💹 ❇️ ✳️ ❎ 🌐 💠 Ⓜ️ 🌀 💤 🏧 🚾 ♿️ 🅿️ 🈳 🈂️ 🛂 🛃 🛄 🛅 🚹 🚺 🚼 🚻 🚮 🎦 📶 🈁 🔣 ℹ️ 🔤 🔡 🔠 🆖 🆗 🆙 🆒 🆕 🆓 0️⃣ 1️⃣ 2️⃣ 3️⃣ 4️⃣ 5️⃣ 6️⃣ 7️⃣ 8️⃣ 9️⃣ 🔟 🔢 #️⃣ *️⃣ ⏏️ ▶️ ⏸ ⏯ ⏹ ⏺ ⏭ ⏮ ⏩ ⏪ ⏫ ⏬ ◀️ 🔼 🔽 ➡️ ⬅️ ⬆️ ⬇️ ↗️ ↘️ ↙️ ↖️ ↕️ ↔️ ↪️ ↩️ ⤴️ ⤵️ 🔀 🔁 🔂 🔄 🔃 🎵 🎶 ➕ ➖ ➗ ✖️ 💲 💱 ™️ ©️ ®️ 〰️ ➰ ➿ 🔚 🔙 🔛 🔝 🔜 ✔️ ☑️ 🔘 ⚪️ ⚫️ 🔴 🔵 🔺 🔻 🔸 🔹 🔶 🔷 🔳 🔲 ▪️ ▫️ ◾️ ◽️ ◼️ ◻️ ⬛️ ⬜️ 🔈 🔇 🔉 🔊 🔔 🔕 📣 📢 👁🗨 💬 💭 🗯 ♠️ ♣️ ♥️ ♦️ 🃏 🎴 🀄️ 🕐 🕑 🕒 🕓 🕔 🕕 🕖 🕗 🕘 🕙 🕚 🕛 🕜 🕝 🕞 🕟 🕠 🕡 🕢 🕣 🕤 🕥 🕦 🕧Flags🏳️ 🏴 🏁 🚩 🏳️🌈 🇦🇫 🇦🇽 🇦🇱 🇩🇿 🇦🇸 🇦🇩 🇦🇴 🇦🇮 🇦🇶 🇦🇬 🇦🇷 🇦🇲 🇦🇼 🇦🇺 🇦🇹 🇦🇿 🇧🇸 🇧🇭 🇧🇩 🇧🇧 🇧🇾 🇧🇪 🇧🇿 🇧🇯 🇧🇲 🇧🇹 🇧🇴 🇧🇦 🇧🇼 🇧🇷 🇮🇴 🇻🇬 🇧🇳 🇧🇬 🇧🇫 🇧🇮 🇰🇭 🇨🇲 🇨🇦 🇮🇨 🇨🇻 🇧🇶 🇰🇾 🇨🇫 🇹🇩 🇨🇱 🇨🇳 🇨🇽 🇨🇨 🇨🇴 🇰🇲 🇨🇬 🇨🇩 🇨🇰 🇨🇷 🇨🇮 🇭🇷 🇨🇺 🇨🇼 🇨🇾 🇨🇿 🇩🇰 🇩🇯 🇩🇲 🇩🇴 🇪🇨 🇪🇬 🇸🇻 🇬🇶 🇪🇷 🇪🇪 🇪🇹 🇪🇺 🇫🇰 🇫🇴 🇫🇯 🇫🇮 🇫🇷 🇬🇫 🇵🇫 🇹🇫 🇬🇦 🇬🇲 🇬🇪 🇩🇪 🇬🇭 🇬🇮 🇬🇷 🇬🇱 🇬🇩 🇬🇵 🇬🇺 🇬🇹 🇬🇬 🇬🇳 🇬🇼 🇬🇾 🇭🇹 🇭🇳 🇭🇰 🇭🇺 🇮🇸 🇮🇳 🇮🇩 🇮🇷 🇮🇶 🇮🇪 🇮🇲 🇮🇱 🇮🇹 🇯🇲 🇯🇵 🎌 🇯🇪 🇯🇴 🇰🇿 🇰🇪 🇰🇮 🇽🇰 🇰🇼 🇰🇬 🇱🇦 🇱🇻 🇱🇧 🇱🇸 🇱🇷 🇱🇾 🇱🇮 🇱🇹 🇱🇺 🇲🇴 🇲🇰 🇲🇬 🇲🇼 🇲🇾 🇲🇻 🇲🇱 🇲🇹 🇲🇭 🇲🇶 🇲🇷 🇲🇺 🇾🇹 🇲🇽 🇫🇲 🇲🇩 🇲🇨 🇲🇳 🇲🇪 🇲🇸 🇲🇦 🇲🇿 🇲🇲 🇳🇦 🇳🇷 🇳🇵 🇳🇱 🇳🇨 🇳🇿 🇳🇮 🇳🇪 🇳🇬 🇳🇺 🇳🇫 🇰🇵 🇲🇵 🇳🇴 🇴🇲 🇵🇰 🇵🇼 🇵🇸 🇵🇦 🇵🇬 🇵🇾 🇵🇪 🇵🇭 🇵🇳 🇵🇱 🇵🇹 🇵🇷 🇶🇦 🇷🇪 🇷🇴 🇷🇺 🇷🇼 🇼🇸 🇸🇲 🇸🇦 🇸🇳 🇷🇸 🇸🇨 🇸🇱 🇸🇬 🇸🇽 🇸🇰 🇸🇮 🇬🇸 🇸🇧 🇸🇴 🇿🇦 🇰🇷 🇸🇸 🇪🇸 🇱🇰 🇧🇱 🇸🇭 🇰🇳 🇱🇨 🇵🇲 🇻🇨 🇸🇩 🇸🇷 🇸🇿 🇸🇪 🇨🇭 🇸🇾 🇹🇼 🇹🇯 🇹🇿 🇹🇭 🇹🇱 🇹🇬 🇹🇰 🇹🇴 🇹🇹 🇹🇳 🇹🇷 🇹🇲 🇹🇨 🇹🇻 🇻🇮 🇺🇬 🇺🇦 🇦🇪 🇬🇧 🏴 🏴 🏴 🇺🇸 🇺🇾 🇺🇿 🇻🇺 🇻🇦 🇻🇪 🇻🇳 🇼🇫 🇪🇭 🇾🇪 🇿🇲 🇿🇼
Typecho基于评论数的评论等级
2020-09-29
分类: typecho
简介:今天发现了一个 Typecho 的评论等级,感觉很有意思就特地的分享出来了。代码[hide]function dengji($i){
$db=Typecho_Db::get();
$mail=$db >fetchAll($db >select(array('COUNT(cid)'=>'rbq')) >from('table.comments') >where('mail = ?', $i) >where('authorId = ?','0'));
foreach ($mail as $sl){
$rbq=$sl['rbq'];}
if($rbq<1){
echo 'Boss';
}elseif ($rbq<5 && $rbq>0) {
echo '朋友';
}elseif ($rbq<10 && $rbq>=5) {
echo '游客';
}elseif ($rbq<15 && $rbq>=10) {
echo '游客1';
}elseif ($rbq<20 && $rbq>=15) {
echo '游客2';
}elseif ($rbq<25 && $rbq>=20) {
echo '游客3';
}elseif ($rbq>=25) {
echo '游客4';
}
}[/hide]使用方法将以上代码加到functions.php里,然后在comments.php里找到如下位置(可能有的主题不一样):<span class=" <?php echo $commentAuthor; ?> "><?php $comments >author(false); ?>:</span>
<?php dengji($comments >mail);?> 在评论列表循环里加上这个引用,也就是这样:<span class=" <?php echo $commentAuthor; ?> ">【<?php dengji($comments >mail);?>】<?php $comments >author(false); ?>:</span>报错如果博主称号显示不是Boss而是游客,那么请在Mysql里执行如下:update typecho_comments set authorid='1' where mail='博主邮箱账号'
实现每评论一次自动排第一功能(Typecho版)
2020-09-28
分类: typecho
简介:下面是主要代码(插入到 functions.php 中):function Autofirst(){ $db = Typecho_Db::get(); $query = $db >select() >from('table.comments') >where('authorId = ?','0') >order('coid',Typecho_Db::SORT_DESC) >limit(100); $result = $db >fetchAll($query); $arrUrl = array(); $arrAuthor = array(); foreach ($result as $value) { if($value["url"]!==null){ array_push($arrUrl,$value["url"]); array_push($arrAuthor,$value["author"]); } } $su=array_filter(array_merge(array_unique($arrUrl))); $sa=array_filter(array_merge(array_unique($arrAuthor))); $num=0; for($i=0;$i<count(array_unique($su));$i++){ if($su[$i]!=="" && $num<16){ $num+=1; $db1 = Typecho_Db::get(); $query1 = $db1 >select() >from('table.comments') >where('url = ?',$su[$i]) >order('coid',Typecho_Db::SORT_DESC) >limit(100); $result1 = $db1 >fetchAll($query1); $arrAuthor1 = array(); foreach ($result1 as $value) { array_push($arrAuthor1,$value["author"]); } echo '<a href="'.$su[$i].'" rel="external nofollow" class="item col lg 3 col md 3 visible lg visible md" target="_blank"><i class="glyphicon glyphicon leaf"></i> '.$arrAuthor1[0].'</a>'; } }
}调用代码和 css:[hide]<div class="row autofirst visible lg visible md">
<p>
<i class="glyphicon glyphicon th"></i> 每评论一次就会自动排在本栏目第一位
</p> <?php Autofirst(100) ?>
</div>
<style>
.autofirst{ margin:20px 20px 5px 20px; padding:10px; box shadow: 0 1px 8px rgba(0,0,0,0.12), 0 1px 8px rgba(0,0,0,0.24); background color:white; border radius:3px;
}.item{ padding:5px 0px;
}
</style>[/hide]
typecho评论显示个性化自定义
2020-09-28
分类: typecho
简介:typecho的官方博客有一篇文章专门讲诉typecho的评论自定义显示的,官方的不够直观,方法如下:在 comments.php 开头部份加入如下方法即可实现自定义。(解说可以查看注释)<?php function threadedComments($comments, $singleCommentOptions) { $commentClass = '';
if ($comments >authorId) {
if ($comments >authorId == $comments >ownerId) {
$commentClass .= ' comment by author';
} else {
$commentClass .= ' comment by user';
}
} $commentLevelClass = $comments >_levels > 0 ? ' comment child' : ' comment parent';
?>
<li id="<?php $comments >theId(); ?>" class="comment body<?php
if ($comments >_levels > 0) {
echo ' comment child';
$comments >levelsAlt(' comment level odd', ' comment level even');
} else {
echo ' comment parent';
}
$comments >alt(' comment odd', ' comment even');
echo $commentClass;
//以上部份 不用理会,是判断一些奇偶数评论和作者类的,下面的才是需要修改的,根据需要修改吧, php部份不需要 修改,只需要修改 HTML 部分,下面是我现在用的
?>">
<div class="comment author">
<?php $comments >gravatar($singleCommentOptions >avatarSize, $singleCommentOptions >defaultAvatar); //头像 只输出 img 没有其它标签 ?>
<div class="comment info">
<cite class="fn"><?php $singleCommentOptions >beforeAuthor();
$comments >author();$singleCommentOptions >afterAuthor(); //输出评论者 ?>
</cite>
<em class="comment meta">
<a href="<?php $comments >permalink(); ?>"><?php $singleCommentOptions >beforeDate();
$comments >date($singleCommentOptions >dateFormat);
$singleCommentOptions >afterDate(); //输出评论日期 ?></a>
</em>
</div>
<div class="comment reply">
<?php $comments >reply($singleCommentOptions >replyWord); //输出 回复 链接?>
</div>
</div> <?php $comments >content(); //输出评论内容,包含 <p></p> 标签 ?>
<?php if ($comments >children) { ?>
<div class="comment children">
<?php $comments >threadedComments($singleCommentOptions); //评论嵌套?>
</div>
<?php } ?> </li>
<?php
}
?>下面是对应的CSS代码: - 隐藏 -
Typecho 侧边栏不显示zz本人评论内容
2020-09-16
分类: typecho
简介:Typecho侧边栏不显示zz评论,sidebar.php文件<?php $this >widget('Widget_Comments_Recent','pageSize=6&ignoreAuthor=true') >to($comments); ?>size=6<显示多少条》这个代码使用以下也是可以的。省的zz自己经常回复别人的问题,上面都是自己。