Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: ariens - maaliskuu 09, 2006, 11:27:21 AP

Otsikko: smf_api.php usage, basic questions.
Kirjoitti: ariens - maaliskuu 09, 2006, 11:27:21 AP
I've got a 1.0.6 SMF install, and inside the forum directory on the webserver I've placed a test.php file.

I'm attempting to have access to $smf_user_info to see if the person logged in is a guest, admin, etc...

After I log in, I view test.php, which contains...


<?
session_start();
include 'smf_api.php';
smf_loadSession();
global $smf_user_info;
print_r($smf_user_info);
?>


and $smf_user_info is an Array ( [session_id] => ff9a257dfbf0c4d4d5108906baf1b05a )

How does one get the info regarding their is_admin status and whatnot as described in the comments for smf_api.php?
Otsikko: Re: smf_api.php usage, basic questions.
Kirjoitti: H - maaliskuu 09, 2006, 03:57:34 IP
It may be easiest to do this with SSI.php

Search the forum for examples
Otsikko: Re: smf_api.php usage, basic questions.
Kirjoitti: ariens - maaliskuu 10, 2006, 09:51:09 AP
For the record...


<?
require_once('smf_api.php');

smf_authenticateUser();
smf_loadSession();

print_r($smf_user_info);
?>


was what i was looking for... thanks.