Beispiel #1
0
<?php

/*
Fotobook Management Panel
*/
// get facebook authorization token
$facebook = new FacebookAPI();
?>

<?php 
if (!$facebook->link_active()) {
    ?>
<div id="message" class="error fade"><p>There is no Facebook account linked to this plugin.  Change that in the <a href="<?php 
    echo FB_OPTIONS_URL;
    ?>
">settings panel</a>.</p></div>
<?php 
}
?>

<?php 
if ($fb_message) {
    ?>
<div id="message" class="<?php 
    echo $facebook->error ? 'error' : 'updated';
    ?>
 fade"><p><?php 
    echo $fb_message;
    ?>
</p></div>
<?php 
Beispiel #2
0
function fb_ajax_handler()
{
    if (!isset($_POST['action']) || $_POST['action'] != 'fotobook') {
        return false;
    }
    // handle hide/unhide requests
    if (isset($_POST['hide'])) {
        fb_toggle_album_hiding($_POST['hide']);
        echo 'success';
    } elseif (isset($_POST['order'])) {
        fb_update_album_order($_POST['order']);
        echo 'success';
    } elseif (isset($_POST['reset_order'])) {
        fb_reset_album_order();
        echo 'The albums have been ordered by their modification date.';
    } elseif (isset($_POST['remove_all'])) {
        fb_remove_all();
        echo 'All albums have been removed.';
    } elseif (isset($_POST['progress'])) {
        echo round(get_option('fb_update_progress'));
    } elseif (isset($_POST['update'])) {
        $facebook = new FacebookAPI();
        if ($facebook->link_active()) {
            $facebook->update_albums();
            echo $facebook->msg;
        } else {
            echo 'There are no accounts linked to Fotobook.';
        }
    } elseif (isset($_POST['albums_list'])) {
        fb_display_manage_list($_POST['message']);
    }
    exit;
}