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.
Options

Site integration help

edited June 2011 in Vanilla 2.0 - 2.8
Is it possible for some one to show me how to do site integration with PHP

sudocode:

If (!loggedin){
echo "Login";
}else{
echo UserId;
echo Username;
echo UserDisplayName;
}

I want Vanilla to do all the authentication I just need to know how to pull that information. Or at least the userId. and I need this on the server side so I can do some other PHP stuff. Thanks

Comments

  • Options
    well this is what I did

    define('APPLICATION', 'Vanilla');
    define('APPLICATION_VERSION', '2.0.17.10');
    /*
    Copyright 2008, 2009 Vanilla Forums Inc.
    This file is part of Garden.
    Garden is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
    Garden is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
    You should have received a copy of the GNU General Public License along with Garden. If not, see .
    Contact Vanilla Forums Inc. at support [at] vanillaforums [dot] com
    */

    ob_start();

    // 1. Define the constants we need to get going.
    define('DS', '/');
    define('PATH_ROOT', dirname(__FILE__));

    // 2. Include the header.
    require_once(PATH_ROOT.DS.'bootstrap.php');

    $Session = Gdn::Session();
    $Name = $Session->User->Name;
    $CountNotifications = $Session->User->CountNotifications;

    echo "UserID = " . $Name . " " . $CountNotifications . " " . $Session->UserID;
Sign In or Register to comment.