本文整理汇总了PHP中log::setFeedPublishStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP log::setFeedPublishStatus方法的具体用法?PHP log::setFeedPublishStatus怎么用?PHP log::setFeedPublishStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类log
的用法示例。
在下文中一共展示了log::setFeedPublishStatus方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateMiniFeeds
function updateMiniFeeds()
{
require_once PATH_CORE . '/classes/systemStatus.class.php';
$ssObj = new systemStatus($this->db);
require_once PATH_CORE . '/classes/log.class.php';
$logObj = new log($this->db);
//get template bundle ids, store in array to compare with log actions
$translators = array();
$q = "select name,numValue from SystemStatus where name LIKE '%tbId_%'";
$query = $this->db->query($q);
while ($c = $this->db->readQ($query)) {
$translators[$c->name] = $c->numValue;
}
$problemSessionKeys = array();
//get log actions
$q = "select Log.id,fbId,t,fb_sig_session_key,userid,action,userid2,itemid,itemid2 from Log join fbSessions on Log.userid1=fbSessions.userid WHERE fb_sig_expires>NOW() and isFeedPublished='pending' and FIND_IN_SET(action,'signup,completedChallenge,redeemed,wonPrize,postStory,comment') order by fbId,action";
$query = $this->db->query($q);
while ($action = $this->db->readQ($query)) {
if (array_search($action->fbId, $problemSessionKeys) === false) {
echo 'trying' . $action->fbId;
//get feed elements
require_once PATH_FACEBOOK . '/classes/publisher.class.php';
$pubObj = new publisher($this->db, $this->session, $this->app);
$theItemid = $action->itemid;
switch ($action->action) {
case 'postBlog':
case 'postStory':
$pubType = 'story';
break;
case 'comment':
$pubType = 'story';
$theItemid = $action->itemid2;
break;
case 'signup':
$pubType = 'invite';
break;
case 'completedChallenge':
$pubType = 'challenge';
break;
// REDEEM: case 'redeemed': $pubType='reward'; break;
// REDEEM: case 'redeemed': $pubType='reward'; break;
case 'wonPrize':
$pubType = 'reward';
break;
}
$feedElements = $pubObj->fetchFeedElements($pubType, $theItemid);
if (trim($feedElements['title']) != '') {
$templateData = array("title" => $feedElements['title'], "headline" => $feedElements['title'], "storyLink" => $feedElements['storyLink'] . '?&referfbid=' . $action->fbId, "url" => URL_CANVAS . '?&referfbid=' . $action->fbId, "story" => $feedElements['story'], "pubType" => $feedElements['pubType'], "appName" => SITE_TITLE, "refId" => $action->fbid, "storyImage" => $feedElements['image'], "images" => array(array('src' => $feedElements['image'], 'href' => $feedElements['storyLink'] . '?&referfbid=' . $action->fbId)));
//echo '<br />---------<br />'; var_dump($templateData); echo '<br />';
//publish the feed
$this->facebook->set_user($action->fbId, $action->fb_sig_session_key);
$templateBundleId = $translators['tbId_' . $action->action];
// only try once for a problem session key
try {
$this->facebook->api_client->feed_publishUserAction($templateBundleId, json_encode($templateData), array(), '');
//update log
$logObj->setFeedPublishStatus($action->id, 'complete');
} catch (Exception $e) {
$problemSessionKeys[] = $action->fbId;
$this->db->log('Minifeed exception');
$this->db->log($action);
echo 'minifeed exception';
var_dump($action);
}
}
}
}
/*
//temp for dev
require_once(PATH_FACEBOOK.'/classes/publisher.class.php');
$pubObj=new publisher($this->db,$session,&$app);
$feedElements=$pubObj->fetchFeedElements('invite',0);
$templateData=array( "title"=>$feedElements['title'],
"headline"=>$feedElements['title'],
"storyLink"=>$feedElements['storyLink'],
"url"=>URL_CANVAS,
"story"=>$feedElements['story'], //THIS ISN'T WORKING FOR NEWSWIRE
"pubType"=>$feedElements['pubType'],
"appName"=>SITE_TITLE,
"refId"=>'756923320',
"storyImage"=>$feedElements['image'],
"images"=>array(array('src'=>$feedElements['image'], 'href'=>$feedElements['storyLink']))
);
$this->facebook->set_user('756923320', '2.zJxB_Pq21pR8KXtw7UtrSg__.3600.1234000800-756923320');
$targetIds = array();
$templateBundleId = $translators['tbId_signup'];
$this->facebook->api_client->feed_publishUserAction($templateBundleId,json_encode($templateData),$targetIds,'');*/
}