'111147385590325', 'secret' => '038c83a83ad47e120f50808894ad15c8', 'cookie' => true )); $urlToRedirect = ""; $forceRedirect = 0; //echo "xxx = ".$facebook->getLoginUrl(array('scope' => 'offline_access, read_stream, email')); $accessToken = '111147385590325|DDqZhFMUjWJshvEZcTA1e8e-Nrc'; $facebook->setAccessToken($accessToken); $user = $facebook->getUser(); if ($user) { try { // Proceed knowing you have a logged in user who's authenticated. $user_profile = $facebook->api('/me'); } catch (FacebookApiException $e) { $user = null; } } $isShared = in_array('shared', array_keys($_GET)) ? 1 : 0; $fromCache = 0; $idElements = explode("_", $_GET['q']); if ($isShared == 0) { try { $cacheFilename = "cache/".$_GET['q'].".fb"; if (file_exists($cacheFilename) && $_GET['fc'] == 1) { $handle = fopen($cacheFilename, "r"); $post = json_decode(fread($handle, filesize($cacheFilename)), true); fclose($handle); $fromCache = 1; } else { $post = $facebook->api('/'.$_GET['q'].'?access_token='.$facebook->getAccessToken()); echo ""; } } catch(Exception $ex) { echo ""; } } $idElements = explode("_", $_GET['ref'] != "" ? $_GET['ref'] : $_GET['q']); if ($post == null) { if ($_GET['u'] == "") { $_GET['u'] = date('Y-m-d H:i:s', time()); } $year = date('Y', strtotime(substr(str_replace('T', ' ', $_GET['u']), 0, 10))) ; $month = date('n', strtotime(substr(str_replace('T', ' ', $_GET['u']), 0, 10))) ; $psUrl = "http://app3.ditto.net.pl/lab/microsearch/Articles/Search?Index=mms_condor_".$year."_".$month."&Phrase=article.url:".$idElements[0]; $dataFromPS = json_decode(getPageContent($psUrl)); if ($dataFromPS->Rows > 0) { foreach($dataFromPS->Articles as $data) { if (strstr($_GET['u'], $data->UpdateDate)) { $postFromPS = $data; } } if ($postFromPS == null) { $postFromPS = $dataFromPS->Articles[0]; } if ($postFromPS != null) { $post['created_time'] = $postFromPS->CreateDate; $post['updated_time'] = $postFromPS->UpdateDate; $post['from']['id'] = $postFromPS->AuthorId; $post['from']['name'] = $postFromPS->Author; $post['message'] = $postFromPS->Text; } if ($isShared == 1) { $urlToRedirect = 'http://www.facebook.com/'.$postFromPS->OperatorId; } } else { $forceRedirect = 1; } } $allowedIp = array('77.65.2.110', '91.247.252.110'); if ($urlToRedirect == "") { if ($idElements[0] != "") { $urlToRedirect = 'http://www.facebook.com/'.$idElements[0]; } else { $urlToRedirect = 'http://www.facebook.com/'.$idElements[1]; } ///posts/'.$idElements[1].'?sk=wall#s'.$idElements[1]; } if (!in_array($_SERVER['HTTP_USER_AGENT'], $agents) || $_GET['redirect'] == 1 || $forceRedirect == 1) { header('Location:'.$urlToRedirect); } $comments = $post['comments']; if ($post['created_time'] == "" && $post['updated_time'] != "") { $post['created_time'] = $post['updated_time']; } if (count($comments['data']) > 0) { //$post['updated_time'] = $comments['data'][count($comments['data']) - 1]['created_time']; } else if ($post['updated_time'] == "") { $post['updated_time'] = $post['created_time']; } $refPost = null; if ($_GET['ref'] != "") { try { $refPost = $facebook->api('/'.$_GET['ref'].'?access_token='.$facebook->getAccessToken()); } catch(Exception $e) { } } ?>





    • 0): foreach($comments['data'] as $comment): $userData = $comment['from']['id']; ?>
    •  
      1970-01-01 03:00:00

Komentarz do wpisu: