• 欢迎 游客 您的光临,下载之前请先阅读 积分规则 。任何技术问题请在论坛提问,本站定制插件、模板主题。售前、售后问题请联系QQ:5916171
    本站自由发布资源可赚取积分及人民币(可提现)(保证资源真实可用,如被举报封号处理。谨慎分布)。
  • 即日起发表主题、回帖、发布&更新资源、创建&回复私信、发布&回复个人动态均需要验证手机号码,其它不受影响。如不便可进群提问。点击链接加入群聊【XenForo讨论社区】:群号1:143277648

已解决 网页显示用户头像插件修复

UID
382
注册
2019/06/17
消息
60
黄金
32,989G
@死了算了
刚好需要这个插件,去XF官方翻了一下。
给我找到,不过只适用于 XF 1.X 的版本。
官方原版的使用说明如下:

This script is useful when you have any HTML web page needing to show a user's avatar, and the user's username or userid is available to you. An HTML img tag will be the typical usage:
代码:
扩展 折叠 复制
<img src="avatar.php?userid=3" />

Installation:
- upload this script to your forum root. :coffee:

You have 3 GET parameters you can set:

userid - the userid number of the user.
username - the username of the user. Can be used instead of userid.
size - can be s, m, or l. The default is m if not specified.

Example usage:

代码:
扩展 折叠 复制
<img src="avatar.php?userid=3" />
<img src="avatar.php?userid=3&size=s" />
<img src="avatar.php?username=admin" />
<img src="avatar.php?username=admin&size=l" />

If the user is not found then it will output the default "no gender" avatar:
5aysK.png

This script supports all three types of avatars... default, custom, and gravatars.

Note that calling avatars like this doesn't have the usual cache-buster timestamp in the URL. So a hard refresh might be necessary to see a user's new avatar after they have changed it.


插件上传到附件了。
把后缀的.zip改成.php就可以了。
因为论坛不给上传.php文件。
 

附件

干嘛用 没理解到位
比如你链接到站外的程序,其他论坛啊,就可以直接调用这个接口显示头像了。
比如你要在其他人的Xenforo论坛引用这个人,就可以直接请求链接显示他的头像。
再比如你要链接到站外的程序,比如一个app,也可以通过这个PHP获取到论坛头像和其他信息。
 
api应该就可以
没研究过,但是我在Xenforo官方搜索的时候,没看到别人说有这个API啊。
我有那个正版账号,我特意去搜索了一下,没看到官方的人说要有API能实现这个。
这是我找到的唯一能实现这个的PHP,还是XF 1.X 版本用的。
 
api应该就可以
原版链接在这里,直接上传到根目录,请求他的PHP,按照格式就OK了。
 
好像不被支持了 :icon-confused: 上午测试了一下好像不被支持了
 
  • #10
已解决
 
解决方案
后退
顶部 底部