简体   繁体   English

从vBulletin获取在线用户数

[英]Getting number of online users from vBulletin

I'm redesigning the template for a Wordpress based site which is bridged with a vBulletin forum. 我正在重新设计基于Wordpress的网站的模板,该模板与vBulletin论坛建立了桥梁。 How can I can I get the number of online users as they are shown on the forum's pages so that I can insert them in another page? 如何获得论坛页面上显示的在线用户数量,以便可以将其插入另一个页面? Is there some sort of API to interact with? 是否有某种与之交互的API?

As of vBulletin 3.8.4 there's no API for getting this information that I know of. 从vBulletin 3.8.4开始,没有API可以获取我所知道的信息。

I see two relatively straightforward options for solving this problem: 我看到了两个相对简单的解决方案:

  1. Query the vBulletin database the same way vBulletin does. 以与vBulletin相同的方式查询vBulletin数据库。 If you have a look inside forumdisplay.php and search for 'showforumusers' you'll see the code they use. 如果您在forumdisplay.php中浏览并搜索“ showforumusers”,您将看到他们使用的代码。
  2. Use memcached. 使用memcached。 Hack forumdisplay.php to cache the number of users viewing that forum and then read that out from Wordpress. 入侵forumdisplay.php以缓存查看该论坛的用户数量,然后从Wordpress中读取该用户数量。 If vBulletin is already set up to use memcached, you can access the Memcache object at $vbulletin->datastore->memcache . 如果已经将vBulletin设置为使用memcached,则可以在$vbulletin->datastore->memcache处访问Memcache对象。 Just make sure you call $vbulletin->datastore->connect(); 只要确保您调用$vbulletin->datastore->connect(); before using it. 在使用它之前。

Option 2 is probably the better bet unless your site & blog are quiet. 除非您的网站和博客安静,否则选择2可能是更好的选择。

I've never dealt with vBulletin, but just searching Google for "vbulletin api" brings me here: http://members.vbulletin.com/api/ 我从没有处理过vBulletin,但只在Google中搜索“ vbulletin api”就可以将我带到这里: http : //members.vbulletin.com/api/

Another search for "vbulletin api online users" will result in this: http://www.vbulletin.org/forum/showthread.php?t=57810 再次搜索“ vbulletin api在线用户”将导致以下结果: http ://www.vbulletin.org/forum/showthread.php?t=57810

I guess you can take whatever it needs from there ... 我想你可以从那里拿走任何需要的东西...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM