Is there anybody here that works with vanilla forums? I want to use the vanilla forums authentication outside the forum. Does anybody know how to do this? I have searched the files for examples but no success, i even googled it but even that was without any success.
Hope someone can help me with this.
Greetz Dizcow
- Grew a moustache for the Envato Movember competition
- Community Moderator
- Contributed a Blog Post
- Author was Featured
- Item was Featured
- Won a Competition
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Has been a member for 4-5 years
so once they authenticate with the forum on your site, you would like to use that authentication in other parts of the site? eg: a members only area.
Yes correct, with wordpress its easy:
$UID = wp_validate_auth_cookie();
if(empty($UID)){
header("location: http://mainsite.com/");
}else{
$user_info = get_userdata($UID);
}
But i cannot find this on vanilla.
- Grew a moustache for the Envato Movember competition
- Community Moderator
- Contributed a Blog Post
- Author was Featured
- Item was Featured
- Won a Competition
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Has been a member for 4-5 years
Try something along the lines of:
define('APPLICATION', 'Vanilla');
define('APPLICATION_VERSION', '2.0.16');
define('DS', '/');
define('PATH_ROOT', 'path-to-forum');
ob_start();
require_once(PATH_ROOT.DS.'bootstrap.php');
ob_end_clean(); // clear any header output from vanila
$Session = Gdn::Session();
$Authenticator = Gdn::Authenticator();
if ($Session->IsValid()) {
$Name = $Session->User->Name;
echo "You are logged in as $Name";
}else{
echo "You are not logged in";
}
change path-to-forum above.
I’ve just put this on my site, it works from a php script outside of my vanilla forum:
enjoy!
dave.
Works perfectly, thank you very much for taking the time to help me with this 
I can now integrate my account verification for item support.
- Grew a moustache for the Envato Movember competition
- Community Moderator
- Contributed a Blog Post
- Author was Featured
- Item was Featured
- Won a Competition
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Has been a member for 4-5 years
DizCow said
I can now integrate my account verification for item support.
Feel free to share it when you have it working
I will absolutely do that, ill keep you in touch 
Is there any way to check if the user is logged in in the vanilla forum using a WordPress page template?
You can install plug in “php anywhere” if i am correct, then you can use this class to check if user is logged in 
http://code.google.com/p/dizcow/downloads/detail?name=vanilla_outdoors_1_0.rar
dtbaker said
DizCow saidFeel free to share it when you have it working
I can now integrate my account verification for item support.
Cant share it here, it will be reported every time i do it 
