vBulletin作为整个网站的登录(编辑:已进行一定量的进度) [英] vBulletin as login for entire website (edit: a certain amount of progress has been made)
问题描述
我在vBul论坛上看到了一个砖墙,如何做到这一点,所以我想我会问论坛,从来不让我失望。
I've come up against a bit of a brick wall in the vBul forums on how to do this, so I thought I'd ask the forum that's never let me down.
有没有人知道一个简单的方法,在EXTERNAL页面到论坛,以接受用户是否登录,并可能提取其用户ID,而它?我已经看到一些插件与这种意图,但都似乎已经失去了支持,vBul 4.1似乎已经打破他们的结果。
Does anyone know of a simple way, on an EXTERNAL page to the forum, to take in whether the user is logged in, and possibly extract their user ID while it's at it? I've seen a few plug ins with that intension but all seem to have fallen out of support, and vBul 4.1 seems to have "broken" them as a result.
任何和所有的帮助赞赏。一旦我有这些东西,我可以写自己的脚本与数据库工作。我只需要这两个变量:)
Any and all help appreciated. Once I have those too things I can write scripts myself that work with the database. I just need those two variables :)
我已经取得了一些进步。在备用页面上,以下代码似乎链接到vBuls用户经理:
I've made SOME progress anyway. On the alternate pages the following code seems to link into vBuls user manager:
<? 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,未注册,其中好像不是它将返回到空白。
I say its connecting in ok because it returns "Your vBul user id is: 0 and your username is Unregistered" where as if it wasn't it would return to blank spaces. The problem is its returning 0 and unregistered despite my definitely being logged in on the forums.
有任何建议吗?
推荐答案
只是意识到没有人回答这个问题,所以这里是我自己的解决方案:
Just realised no one ever answer this, so here is my own solution:
#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/");
这很好地排序,我知道我不需要像这样修改变量,
This sorts it nicely, I know I dont NEED to sanatize the variables like that, but its a personal preference.
这篇关于vBulletin作为整个网站的登录(编辑:已进行一定量的进度)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!