PHP API (Home) (Private) - JustDerb/Snack-Tack GitHub Wiki
Just include api/snacktack.php to use the API.
Connecting to the database: Put require_once('api/private/sql_functions.php');
with the includes in the file. See api/private/sql_functions.php for more info.
See api/private/core_user.php for information on functions.
After using the Facebook API to login successfully:
<?php
//$facebook is the object from the Facebook API
try {
// Proceed knowing you have a logged in user who's authenticated.
$user_profile = $facebook->api('/me');
} catch (FacebookApiException $e) {
error_log($e);
$user_profile = null;
}
if ($user_profile) {
if (st_user_isRegistered($user_profile['id'])) {
//User already registered
}
else {
$userArray = st_user_register($user_profile);
//User registered
}
}
?>
See Event Functions/Creating a new Event below.