1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

php page to export json stuff

Discussion in 'Styling and Customization Questions' started by ghiboz, Feb 22, 2012.

  1. ghiboz

    ghiboz Member

    hi all!
    I need a php page that give me some json info about the user current logged into the forum...
    how can I start to do this? (i'm able to made the print out, but I need to learn how to retrieve the info from the forum)

    thanks in advance
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  3. ghiboz

    ghiboz Member

    thanks, but I don't need to connect directly to the db (how can I do which user is?)
    here is an example of my piece of code written for vBulletin:
    PHP:
    require("./includes/config.php");
    require(
    "./global.php");
     
    $this->member $vbulletin->userinfo;
    $this->member['last_visit'] = $vbulletin->userinfo['lastvisit'];
    $this->member['session_id'] = $vbulletin->session->vars['idhash'];       
     
    //$board_functions = "VB/vb_board_functions.php";
     
    //avatar ---------------
    require_once($FORUM_PATH."/includes/functions_user.php");
    $avatar fetch_avatar_url($this->member['userid']);
    $avatar $avatar[0];
    if (
    $avatar)
    {
        if (!
    strpos($avatar"ttp://"))
        {
            
    $avatar $GP_PATH.$FORUM_PATH."/".$avatar;
        }
        
    $avatar "<img src=\"$avatar\" border=\"0\" alt=\"\" />";
    }
    $this->member['avatar'] = $avatar;
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  5. ghiboz

    ghiboz Member

    thank you Jake, thank you very much! :rolleyes:
     

Share This Page