本文整理汇总了PHP中app::loadFacebookLibrary方法的典型用法代码示例。如果您正苦于以下问题:PHP app::loadFacebookLibrary方法的具体用法?PHP app::loadFacebookLibrary怎么用?PHP app::loadFacebookLibrary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app
的用法示例。
在下文中一共展示了app::loadFacebookLibrary方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setupAppFramework
function setupAppFramework()
{
/* initialize the SMT Facebook appliation class, NO Facebook library */
require_once PATH_FACEBOOK . "/classes/app.class.php";
global $app, $db, $session;
$app = new app(NULL, true);
$app->loadFacebookLibrary();
// caution: do not assign globals by reference
$db = $app->db;
$session = $app->session;
return $app;
}
示例2: deliver_featured
public function deliver_featured()
{
// send feature notifications
global $init;
require_once PATH_FACEBOOK . "/classes/app.class.php";
$app = new app(NULL, true);
$facebook =& $app->loadFacebookLibrary();
require_once PATH_CORE . '/classes/subscriptions.class.php';
$subObj = new SubscriptionsManager($db);
$subObj->loadFacebook($facebook);
$subObj->deliverFeatures();
set_flash(array('notice' => "Feature notifications sent."));
redirect(url_for($this->name, 'index'));
}
示例3: downloadsettings
public function downloadsettings()
{
global $init;
/* initialize the SMT Facebook appliation class, NO Facebook library */
require_once PATH_CORE . '/classes/systemStatus.class.php';
$ssObj = new systemStatus();
require_once PATH_FACEBOOK . "/classes/app.class.php";
$app = new app(NULL, true);
$facebook =& $app->loadFacebookLibrary();
// 'default_action_fbml','default_fbml','post_install_url',
$propList = array('application_name', 'authorize_url', 'base_domain', 'callback_url', 'dashboard_url', 'default_column', 'description', 'desktop', 'dev_mode', 'edit_url', 'email', 'help_url', 'info_changed_url', 'installable', 'ip_list', 'is_mobile', 'message_action', 'message_url', 'post_authorize_redirect_url', 'privacy_url', 'private_install', 'profile_tab_url', 'publish_action', 'publish_self_action', 'publish_self_url', 'publish_url', 'see_all_url', 'tab_default_name', 'uninstall_url', 'use_iframe', 'wide_mode');
$props = $facebook->api_client->admin_getAppProperties($propList);
$this->set('props', $props);
$this->set('ssObj', $ssObj);
$this->render();
}
示例4: send
function send()
{
// only at 12 am hour
// gets a list of those who have registered between day x and day y
// sends them a promo notification in blocks of 100
require_once PATH_CORE . '/classes/template.class.php';
require_once PATH_FACEBOOK . "/classes/app.class.php";
$this->templateObj = new template($this->db);
$this->templateObj->registerTemplates(MODULE_ACTIVE, 'promos');
$app = new app(NULL, true);
$facebook =& $app->loadFacebookLibrary();
$whereStr = $this->buildQueryString(3);
$q = $this->db->query("SELECT count(userid) as cnt FROM User WHERE {$whereStr};");
$data = $this->db->readQ($q);
$cnt = $data->cnt;
if ($cnt > 0) {
// send cbd ringtones promo
$x = 0;
while ($x < ceil($cnt / 100)) {
$idList = $this->db->buildIdList("SELECT fbId as id FROM User,UserInfo WHERE User.userid=UserInfo.userid AND {$whereStr} LIMIT " . $x * 100 . ",100;");
$this->db->log('Send CBD promo notifications to' . $idList);
$apiResult = $facebook->api_client->notifications_send($idList, $this->templateObj->templates['cbdPromo'], 'app_to_user');
$x += 1;
}
}
// send EqEx Promo
$whereStr = $this->buildQueryString(6);
$q = $this->db->query("SELECT count(userid) as cnt FROM User WHERE {$whereStr};");
$data = $this->db->readQ($q);
$cnt = $data->cnt;
if ($cnt > 0) {
// send eqex ringtones promo
$x = 0;
while ($x < ceil($cnt / 100)) {
$idList = $this->db->buildIdList("SELECT fbId as id FROM User,UserInfo WHERE User.userid=UserInfo.userid AND {$whereStr} LIMIT " . $x * 100 . ",100;");
$this->db->log('Send EqEx promo notifications to' . $idList);
$apiResult = $facebook->api_client->notifications_send($idList, $this->templateObj->templates['eqexPromo'], 'app_to_user');
$x += 1;
}
}
}
示例5: getFacebookAPI
function getFacebookAPI()
{
$ssObj = new systemStatus($this->db);
/* initialize the SMT Facebook appliation class, NO Facebook library */
require_once PATH_FACEBOOK . "/classes/app.class.php";
$app = new app(NULL, true);
$facebook =& $app->loadFacebookLibrary();
return $facebook;
}
示例6: runJob
//.........这里部分代码省略.........
// only do this at 3 am on first day of week
if ($currentDayOfWeek = 0 and $currentHour == 3) {
// map to all the content from the last week, etc.
$smObj->buildMap('weekly');
}
// only do this at 2 am on first day of month
if ($currentDayOfMonth == 1 and $currentHour == 2) {
$smObj->buildMap('monthly');
}
// call buildIndexMap after updating any individual child maps above
// just the time stamps from each individual map file are updated in the indexmap
// warning: if a individual map hasn't been built - the index map won't include a reference to it
$smObj->buildIndexMap();
break;
case 'fetchFeeds':
// import stories from feeds
require_once 'feed.class.php';
$feedObj = new feed($this->db);
$feedObj->fetchBookmarks();
$feedObj->fetchFeeds();
$feedObj->fetchImages();
if ($feedObj->newStoryLoaded) {
// update features
}
break;
case 'logHourlyStats':
require_once 'statistics.class.php';
$statsObj = new statistics($this->db);
$statsObj->logHourlyStats();
break;
case 'facebookMinifeed':
require_once PATH_FACEBOOK . "/classes/app.class.php";
$app = new app(NULL, true);
$facebook =& $app->loadFacebookLibrary();
require_once PATH_FACEBOOK . '/classes/miniFeeds.class.php';
$feedObj = new miniFeeds($this->db);
$feedObj->loadFacebook($facebook);
$feedObj->updateMiniFeeds();
break;
case 'facebookProfileBoxes':
require_once PATH_FACEBOOK . "/classes/app.class.php";
$app = new app(NULL, true);
$facebook =& $app->loadFacebookLibrary();
require_once PATH_FACEBOOK . '/classes/profileBoxes.class.php';
$proObj = new profileBoxes($this->db);
$proObj->loadFacebook($facebook);
$proObj->updateProfileBoxes();
break;
case 'facebookEmailEngine':
// tbd
break;
case 'facebookAllocations':
// check nightly facebook allocations
$ssObj = new systemStatus($this->db);
/* initialize the SMT Facebook appliation class, NO Facebook library */
require_once PATH_FACEBOOK . "/classes/app.class.php";
$app = new app(NULL, true);
$facebook =& $app->loadFacebookLibrary();
$npd = $facebook->api_client->admin_getAllocation('notifications_per_day');
$ssObj->setState('notifications_per_day', $npd);
$ssObj->setState('announcement_notifications_per_week', $facebook->api_client->admin_getAllocation('announcement_notifications_per_week'));
$ssObj->setState('requests_per_day', $facebook->api_client->admin_getAllocation('requests_per_day'));
$ssObj->setState('emails_per_day', $facebook->api_client->admin_getAllocation('emails_per_day'));
break;
case 'facebookSendNotifications':
require_once PATH_FACEBOOK . "/classes/app.class.php";
示例7: sendNotification
function sendNotification($notObj)
{
/* initialize the SMT Facebook appliation class, NO Facebook library */
require_once PATH_FACEBOOK . "/classes/app.class.php";
$app = new app(NULL, true);
$facebook =& $app->loadFacebookLibrary();
$apiResult = $facebook->api_client->notifications_send($notObj->fbId, $notObj->body, 'app_to_user');
echo '<p>Facebook Notification returned ' . '<pre>' . print_r($apiResult, true) . '</pre></p>';
}
示例8: systemStatus
include_once PATH_CORE . "utilities/populateTestData.php";
break;
case 'removeTestData':
include_once PATH_CORE . "utilities/removeTestData.php";
break;
case 'uploadSettings':
echo 'Uploading settings in SystemStatus table up to Facebook Developer application<br />';
require_once PATH_CORE . '/classes/systemStatus.class.php';
$ssObj = new systemStatus();
$propList = $ssObj->loadFacebookProperties();
echo 'These settings will be uploaded:<br />';
print_r($propList);
echo '<br />';
require_once PATH_FACEBOOK . "/classes/app.class.php";
$app = new app(NULL, true);
$facebook =& $app->loadFacebookLibrary();
$props = $facebook->api_client->admin_setAppProperties($propList);
echo 'Completed settings upload. Visit the <a href="http://www.facebook.com/developers/apps.php?app_id=' . $init['fbAppId'] . '">Facebook Developer app</a> to review them.<br />';
break;
case 'populateSubscriptions':
require_once PATH_CORE . '/classes/subscriptions.class.php';
$subObj = new SubscriptionsManager($db);
$subObj->populateSubscriptions();
break;
case 'resetDB':
require_once PATH_CORE . '/classes/cleanup.class.php';
$cObj = new cleanup($db);
$cObj->flushDatabase();
if (MODULE_FACEBOOK) {
echo 'cleaning up fb tables<br />';
require_once PATH_FACEBOOK . '/classes/cleanupFacebook.class.php';