News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

smf_api.php usage, basic questions.

Started by ariens, March 09, 2006, 11:27:21 AM

Previous topic - Next topic

ariens

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?

H

It may be easiest to do this with SSI.php

Search the forum for examples
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

ariens

For the record...


<?
require_once('smf_api.php');

smf_authenticateUser();
smf_loadSession();

print_r($smf_user_info);
?>


was what i was looking for... thanks.

Advertisement: