哈哈大家好我终于又憋出来一篇了,一天没见是不是很想我!! 之前在小蝴蝶这里评论过的同志们应该已经看到效果了: 由于实在憋不出来东西写了,所以无聊检查了一下网站记录的cookies,其中有一个大家很熟悉,就是我们常见访客欢迎词要用到的 comment_author ,而另一
哈哈大家好我终于又憋出来一篇了,一天没见是不是很想我!!
之前在小蝴蝶这里评论过的同志们应该已经看到效果了:


由于实在憋不出来东西写了,所以无聊检查了一下网站记录的cookies,其中有一个大家很熟悉,就是我们常见访客欢迎词要用到的
comment_author
,而另一个很少有人用,就是comment_author_email
comment_author_email能用来干嘛内?用来抓头像咯.
好了上代码,以下代码扔到你要欢迎访客的地方:
<?php if($_COOKIE["comment_author_email_" . COOKIEHASH]!="") : $fkimg = $_COOKIE['comment_author_email_'.COOKIEHASH];?> <?php echo get_avatar($fkimg, 50);?> <?php endif; ?>
如果要实现小蝴蝶那样仿QQ视频的访客欢迎画面,则把代码改成如下(具体css值需要根据你的主题修改)
<?php if($_COOKIE["comment_author_email_" . COOKIEHASH]!="") : $fkimg = $_COOKIE['comment_author_email_'.COOKIEHASH];?> <div class="fkimg"><?php echo get_avatar($fkimg, 68);?></div> <img src="/static/imghwm/default1.png" data-src="/imgr?src=http%3A%2F%2Fxiaohudie.net%2F%E4%BD%A0%E7%9A%84%E5%A4%B4%E5%83%8F%E5%9B%BE%E7%89%87%E5%9C%B0%E5%9D%80" class="lazy" style="max-width:90%" alt="不一样的访客欢迎画面:利用cookies抓取访客头像" > <?php else: ?> <img src="/static/imghwm/default1.png" data-src="/imgr?src=http%3A%2F%2Fxiaohudie.net%2F%E4%BD%A0%E7%9A%84%E5%A4%B4%E5%83%8F%E5%9B%BE%E7%89%87%E5%9C%B0%E5%9D%80" class="lazy" style="max-width:90%" alt="不一样的访客欢迎画面:利用cookies抓取访客头像" > <?php endif; ?>
然后加上css
.fkimg{ float: left; box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.46); margin: 5px 10px 10px 0; width: 68px; height: 68px;}
好了就这么多,昨天那篇吐草被包子破了百,践行诺言来放福利了..
另外跪求大家还是不要破百了,因为我没有新衣服拍了
原文地址:不一样的访客欢迎画面:利用cookies抓取访客头像, 感谢原作者分享。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 English version
Recommended: Win version, supports code prompts!

Notepad++7.3.1
Easy-to-use and free code editor
