// $Id: publisher_see.inc.php,v 1.50.2.1 2014-12-16 13:58:16 jpermanne Exp $ if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) { die("no access"); } // affichage du detail pour un auteur // inclusion de classe utiles require_once $base_path . '/classes/publisher.class.php'; require_once $base_path . '/includes/templates/publisher.tpl.php'; require_once "{$class_path}/aut_link.class.php"; print "<div id='aut_details'>\n\n\t\t<h3><span>" . $msg["publisher_see_title"] . "</span></h3>\n"; print "<div id='aut_details_container'>\n"; if ($id) { $id += 0; // affichage des informations sur l'éditeur print "<div id='aut_see'>\n"; $ourPublisher = new publisher($id); print pmb_bidi($ourPublisher->print_resume()); $aut_link = new aut_link(AUT_TABLE_PUBLISHERS, $id); print pmb_bidi($aut_link->get_display()); print "</div><!-- fermeture #aut_see -->\n"; // affichage des notices associées print "\t<div id='aut_details_liste'>\n\n\t\t\t<h3>{$msg['doc_editor_title']}</h3>\n"; //droits d'acces emprunteur/notice $acces_j = ''; if ($gestion_acces_active == 1 && $gestion_acces_empr_notice == 1) { require_once "{$class_path}/acces.class.php"; $ac = new acces(); $dom_2 = $ac->setDomain(2); $acces_j = $dom_2->getJoin($_SESSION['id_empr_session'], 4, 'notice_id'); } if ($acces_j) {
$code = $pubObj->fetchPublisherContent($_GET['tab']); break; case 'parseStory': if (isset($_POST['url']) && $_POST['url'] != '') { $url = $_POST['url']; } else { return false; } require_once PATH_CORE . '/classes/parseStory.class.php'; $psObj = new parseStory($url); $code = $psObj->parse(); break; case 'emailAttach': $app = setupAppFramework(); require_once PATH_FACEBOOK . '/classes/publisher.class.php'; $pubObj = new publisher($db, $session, &$app); $code = $pubObj->fetch('email', 'emailAttach'); break; case 'appTab': if (isset($_POST['fb_sig_profile_user'])) { $fbUserPageId = $_POST['fb_sig_profile_user']; } else { exit('<h2>Invalid facebook user</h2>'); } $app = setupAppFramework(); // TO DO: might later move this out of AJAX require_once PATH_FACEBOOK . '/classes/pages.class.php'; $pagesObj = new pages($app, 0, false); require_once PATH_FACEBOOK . '/pages/pageAppTab.class.php'; $tabObj = new pageAppTab($pagesObj, $fbUserPageId); $code = $tabObj->fetch();
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,'');*/ }