我在 vBul 论坛中遇到了关于如何执行此操作的一些障碍,所以我想我应该询问永远不会让我失望的论坛。
有谁知道一种简单的方法,在论坛的外部页面上,了解用户是否已登录,并可能在登录时提取他们的用户 ID?我见过一些具有这种意图的插件,但似乎所有插件都不再受支持,而 vBul 4.1 似乎因此“破坏”了它们。
感谢所有帮助。一旦我有了这些东西,我就可以自己编写与数据库一起使用的脚本。我只需要这两个变量:)
无论如何,我已经取得了一些进展。在备用页面上,以下代码似乎链接到 vBuls 用户管理器:
<? ini_set('display_errors', 1);
error_reporting(E_ALL); ?>
<? chdir("/home/sites/<sitename>/public_html/forum/");
require("./global.php"); ?>
<? echo "Your vBul user id is: ".$vbulletin->userinfo['userid']." and your username is ".$vbulletin->userinfo['username'].""; ?>
<? chdir("/home/sites/<sitename>/public_html/dev"); ?>
我说它连接正常,因为它返回“您的 vBul 用户 ID 是:0 并且您的用户名未注册”,如果不是,它会返回空白。问题是它返回 0 并且未注册,尽管我确实登录了论坛。
有什么建议吗?
最佳答案
刚刚意识到没有人回答这个问题,所以这是我自己的解决方案:
#grab global.php to access vbuls user systems
chdir("../forum/");
require("./global.php");
require_once('includes/functions_login.php');
#sanatize all variables for easier use
$username = $vbulletin->userinfo['username'];
$userid = $vbulletin->userinfo['userid'];
$loggouthash = $vbulletin->userinfo['logouthash'];
chdir("../dev/");
这很好地排序了,我知道我不需要像那样清理变量,但这是个人喜好。
关于php - vBulletin 作为整个网站的登录名(编辑 : a certain amount of progress has been made),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5888090/