Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Integrate Vanilla with existing website
is there any guide on how to integrate login and register buttons from vanilla header into my existing website.
Tagged:
1
Comments
If you mean creating them as popups, I'm not sure how to do that off the top of my head.
I conjecture it would require a standalone script to authenticate the user and get their data from the database. I don't know of a more elegant solution, but there may be one.
what is your website running? WordPress, Drupal or something else?
or consider other options such as openID, google, FaceBook,Twitter, i.e. SocialConnect etc see the release notes for V2.0.14
<?php
$Session = Gdn::Session();
$Authenticator = Gdn::Authenticator();
if ($Session->IsValid()) {
$Name = ''.$Session->User->Name.'';
$CountNotifications = $Session->User->CountNotifications;
if (is_numeric($CountNotifications) && $CountNotifications > 0)
$Name .= ''.$CountNotifications.'';
echo Anchor(
$Name,
$CountNotifications > 0 ? '/profile/notifications' : '/profile/'.$Session->UserID.'/'.$Session->User->Name,
'Username'
);
$Inbox = 'Inbox';
$CountUnreadConversations = $Session->User->CountUnreadConversations;
if (is_numeric($CountUnreadConversations) && $CountUnreadConversations > 0)
$Inbox .= ''.$CountUnreadConversations.'';
echo Anchor($Inbox, '/messages/all', 'Inbox');
if ($Session->CheckPermission('Garden.Settings.Manage')) {
echo Anchor('Dashboard', '/garden/settings', 'Dashboard');
} else if ($Session->CheckPermission(array('Garden.Users.Add', 'Garden.Users.Edit', 'Garden.Users.Delete'))) {
echo Anchor('Users', '/user/browse', 'Dashboard');
}
echo Anchor('Sign Out', str_replace('{Session_TransientKey}', $Session->TransientKey(), $Authenticator->SignOutUrl()), 'Leave');
} else {
echo Anchor('Sign In', $Authenticator->SignInUrl($this->SelfUrl), 'SignInPopup');
echo Anchor('Apply for Membership', $Authenticator->RegisterUrl($this->SelfUrl), 'Register');
}
?>
I DONT have any user registration system so that why I want to use my vanilla database and enable users to login/logout using existing vanilla system on my other parts of website. Hope somebody understood what I actually need. Thanks!
or its not that simple?
And then base the rest on whether it validates.