print htmlspecialchars(print_r($user_profile, true)); ?> </pre> <?php } else { ?> <fb:login-button></fb:login-button> <?php } ?> <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({ appId: '<?php echo $facebook->getAppID(); ?> ', cookie: true, xfbml: true, oauth: true }); FB.Event.subscribe('auth.login', function(response) { window.location.reload(); }); FB.Event.subscribe('auth.logout', function(response) { window.location.reload(); }); }; (function() { var e = document.createElement('script'); e.async = true;
$fbObj = new Facebook($mysqli); $pluginObj->selectByName("Facebook Login"); if ($_POST['submit']) { $arrAPIKey = array('appID' => $_POST['appid'], 'appSecret' => $_POST['appsecret']); $jsonAPIKey = json_encode($arrAPIKey); if ($pluginObj->update(array("apikey"), array($jsonAPIKey))) { echo "\n\t\t\t\t<div style='display: none' id='successBox'>\n\t\t\t\t<p align='center'>\n\t\t\t\tSuccessfully Saved Facebook Login Settings!\n\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\tpopupDialog('Facebook Login', '" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "', 'successBox');\n\t\t\t\t</script>\n\t\t\t\t\n\t\t\t"; $member->logAction("Changed Facebook Login Plugin Settings."); } else { $countErrors++; $dispError .= " <b>·</b> Unable to save information to database! Please contact the website administrator.<br>"; } } if (!$_POST['submit']) { $dispNote = ""; $arrFacebookAPIKeys = array("App ID" => $fbObj->getAppID(), "App Secret" => $fbObj->getAppSecret()); foreach ($arrFacebookAPIKeys as $key => $value) { if ($value == "") { $dispNote .= " <b>·</b> " . $key . "<br>"; } $dispFacebookAPIKey[$key] = filterText($value); } echo "\n\t\t\t<p align='right' style='margin-bottom: 10px; margin-right: 20px;'>« <a href='" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "'>Return to Plugin Manager</a></p>\n\t\t\t\n\t\t\t<form action='" . $MAIN_ROOT . "plugins/facebook/settings.php' method='post'>\n\t\t\t<div class='formDiv'>\n\t\t\n\t\t\t"; if ($dispError != "") { echo "\n\t\t\t\t<div class='errorDiv'>\n\t\t\t\t<strong>Unable to save Facebook Login settings because the following errors occurred:</strong><br><br>\n\t\t\t\t{$dispError}\n\t\t\t\t</div>\n\t\t\t\t"; } if ($dispNote != "") { echo "\n\t\t\t\t\t<div class='errorDiv'>\n\t\t\t\t\t\t<strong><u>NOTE:</u> In order for Facebook Login to work you must set the following variables in the facebook.php plugin file.</strong><br><br>\n\t\t\t\t\t\t" . $dispNote . "\n\t\t\t\t\t</div>\n\t\t\t\t"; } echo "\n\t\t\t\t\n\t\t\t\tYour Facebook Login plugin settings are listed below. You must set App ID and App Secret in order for the plugin to work properly.\n\t\t\n\t\t\t\t<table class='formTable'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='formLabel'>App ID:</td>\n\t\t\t\t\t\t<td class='main'><input type='text' name='appid' class='textBox' value='" . $dispFacebookAPIKey['App ID'] . "'></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='formLabel'>App Secret:</td>\n\t\t\t\t\t\t<td class='main'><input type='text' name='appsecret' class='textBox' value='" . $dispFacebookAPIKey['App Secret'] . "'></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='main' align='center' colspan='2'><br>\n\t\t\t\t\t\t\t<input type='submit' name='submit' value='Save Settings' class='submitButton'>\n\t\t\t\t\t\t</td>\n\t\t\t\t</table>\n\t\n\t\t\t</div>\n\t\t\t</form>\n\t\t\t<p align='right' style='margin-bottom: 20px; margin-right: 20px;'>« <a href='" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "'>Return to Plugin Manager</a></p>\n\t\t"; }