140 posts
  • Has been a member for 4-5 years
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 100 and 1 000 dollars
  • Referred between 1 and 9 users
  • Bought between 100 and 499 items
  • Netherlands
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

2957 posts
  • Australia
  • Community Moderator
  • Elite Author
  • Author had a Free File of the Month
  • Most Wanted Bounty Winner
  • Author had a File in an Envato Bundle
  • Has been a member for 5-6 years
  • Contributed a Blog Post
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
+10 more
dtbaker Volunteer 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.

140 posts
  • Has been a member for 4-5 years
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 100 and 1 000 dollars
  • Referred between 1 and 9 users
  • Bought between 100 and 499 items
  • Netherlands
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.

2957 posts
  • Australia
  • Community Moderator
  • Elite Author
  • Author had a Free File of the Month
  • Most Wanted Bounty Winner
  • Author had a File in an Envato Bundle
  • Has been a member for 5-6 years
  • Contributed a Blog Post
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
+10 more
dtbaker Volunteer 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.

140 posts
  • Has been a member for 4-5 years
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 100 and 1 000 dollars
  • Referred between 1 and 9 users
  • Bought between 100 and 499 items
  • Netherlands
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.

2957 posts
  • Australia
  • Community Moderator
  • Elite Author
  • Author had a Free File of the Month
  • Most Wanted Bounty Winner
  • Author had a File in an Envato Bundle
  • Has been a member for 5-6 years
  • Contributed a Blog Post
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
+10 more
dtbaker Volunteer moderator says

I can now integrate my account verification for item support.

Feel free to share it when you have it working

140 posts
  • Has been a member for 4-5 years
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 100 and 1 000 dollars
  • Referred between 1 and 9 users
  • Bought between 100 and 499 items
  • Netherlands
vanRijswijk says

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

181 posts
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Exclusive Author
  • Mexico
  • Has been a member for 4-5 years
  • Bought between 100 and 499 items
  • Referred between 10 and 49 users
MCStudios says

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

140 posts
  • Has been a member for 4-5 years
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 100 and 1 000 dollars
  • Referred between 1 and 9 users
  • Bought between 100 and 499 items
  • Netherlands
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

140 posts
  • Has been a member for 4-5 years
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 100 and 1 000 dollars
  • Referred between 1 and 9 users
  • Bought between 100 and 499 items
  • Netherlands
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