views:

538

answers:

1

I want to get the logout hash for vBulletin so that I can link to the logout bit directly from my main site.

How can I do this? (in PHP)

+2  A: 

The logout hash is loaded into the global userinfo array, so it's available to you when you've included the "global.php" file.

A very basic example of creating a page with just the logout link might look like this (assuming your script is in the vBulletin directory):

<?php
include('./global.php');
if($vbulletin->userinfo['userid'] > 0){
    echo '<a href="login.php?' . $session[sessionurl] . 'do=logout&amp;logouthash=' . $vbulletin->userinfo['logouthash'] . '">Logout</a>';
}
?>
Ross Duggan
brilliant, cheers!
Tom