Exemplo n.º 1
0
<?php

/* Optional external script to update cached Facebook user data.  Per
the API caching policy user data may only be cached for 24 hours.
Normally this happens in the first HTTP request on the 24th hour, but
for large sites this may slow down that request or even cause it to
timeout.

NOTE: This script is not required.  It is only intended for use on
sites with a large number of Facebook users.

This script is intended to be run from cron daily.

*/
include_once 'fbconnect.php';
echo "Updating user data...";
$res = fbc_update_facebook_data($force = true);
if ($res === -1) {
    echo "Error!\n";
    exit(1);
} else {
    echo "{$res} facebook users done.\n";
    exit(0);
}
Exemplo n.º 2
0
function fbc_footer()
{
    /*
     Normally this div is inserted by javascript via document.write(),
     but for XML documnts (XHTML) this fails.  Workaround by including
     the div at page generation time.
    */
    echo '<div style="position: absolute; top: -10000px; left: -10000px; ' . ' width: 0px; height: 0px;" id="FB_HiddenContainer"></div>';
    fbc_update_facebook_data();
    fbc_register_init();
    echo fbc_render_static_resource();
    /*
     Only render this if it hasn't already been done elsewhere.
    */
    if (FBC_USER_PROFILE_WINDOW && empty($GLOBALS['FBC_HAS_RENDERED_LOGIN_STATE'])) {
        echo '<div class="fbc_loginstate_top">' . fbc_render_login_state() . '</div>';
    }
    echo _fbc_flush_footer_js();
    echo fbc_render_debug_info();
}