143 posts
  • Has referred 1+ members
  • Has sold $100+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Has been part of the Envato Community for over 5 years
+3 more
vanRijswijk says

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

3180 posts
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 5 years
  • Helped several times protecting Envato Market against copyright violations
  • Won a competition
+15 more
dtbaker Moderator says

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.

143 posts
  • Has referred 1+ members
  • Has sold $100+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Has been part of the Envato Community for over 5 years
+3 more
vanRijswijk says

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.

3180 posts
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 5 years
  • Helped several times protecting Envato Market against copyright violations
  • Won a competition
+15 more
dtbaker Moderator says

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:

[link]

enjoy!
dave.

143 posts
  • Has referred 1+ members
  • Has sold $100+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Has been part of the Envato Community for over 5 years
+3 more
vanRijswijk says

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.

3180 posts
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 5 years
  • Helped several times protecting Envato Market against copyright violations
  • Won a competition
+15 more
dtbaker Moderator says

I can now integrate my account verification for item support.

Feel free to share it when you have it working

143 posts
  • Has referred 1+ members
  • Has sold $100+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Has been part of the Envato Community for over 5 years
+3 more
vanRijswijk says

I will absolutely do that, ill keep you in touch ;)

181 posts
  • Has referred 10+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+3 more
MCStudios says

Is there any way to check if the user is logged in in the vanilla forum using a WordPress page template?

143 posts
  • Has referred 1+ members
  • Has sold $100+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Has been part of the Envato Community for over 5 years
+3 more
vanRijswijk says

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

143 posts
  • Has referred 1+ members
  • Has sold $100+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Has been part of the Envato Community for over 5 years
+3 more
vanRijswijk says


I can now integrate my account verification for item support.
Feel free to share it when you have it working

Cant share it here, it will be reported every time i do it ;)

by
by
by
by
by
by