Facebook API post: How to get larger thumbnail?

旧巷老猫 提交于 2019-12-05 17:58:21

So now that it is IMPOSSIBLE to do this with the API I am using a workaround as frustrating as it may be. It is a share button system on the left of my content.

The result on facebook can be seen here (actually pretty cool because it shifts more results into each other): http://lightningsoul.com/media/img/screenshot/likes_on_facebook_share_content.png

// Will get your actual browser address and share it

<?php     $thisadress = $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; ?>

 <div id="fblikem">
      <!-- AddThis Button BEGIN -->
      <div class="addthis_toolbox addthis_default_style addthis_32x32_style">
      <a class="addthis_button_preferred_1" addthis:url="<?php echo $thisadress; ?>"></a>
      <a class="addthis_button_preferred_2" addthis:url="<?php echo $thisadress; ?>"></a>
      <a class="addthis_button_preferred_3" addthis:url="<?php echo $thisadress; ?>"></a>
      <a class="addthis_button_preferred_4" addthis:url="<?php echo $thisadress; ?>"></a>
      <a class="addthis_button_compact" addthis:url="<?php echo $thisadress; ?>"></a>
      <a class="addthis_counter addthis_bubble_style" addthis:url="<?php echo $thisadress; ?>"></a>
      </div>
    </div>
//And the CSS to make it stay on the left side of your content (centered 1280px wide)
 #fblikem_vertical
{
  position: fixed;
  top: 50%;
  left: 50%;
  height: 200px;
  width: 100px;
  margin-left: -715px;
  margin-top: -100px;
  z-index: 1000;
}

Hopefully FB will fix this at some point. If so I will, of course, inform you on here.

This is fixed with the design update immenent on the servers (I am using a beta server, so I am seeing things earlier).

Finally, thank you Facebook!

Abdullah

This code could work perfect for me:

 $appid = 'xxxxxxx';
 $appsecret = 'xxxxxxxx';
 $pageId = $pageid;    
 $msg = $title;

 $title = $facebook_title;

 $uri = $url;

 $desc = $intro_text;

 $pic = $todir;

 $action_name = 'Go to 1tvnews';

 $action_link = $url;

$facebook = new Facebook(array(
 'appId' => $appid,

 'secret' => $appsecret,

 'cookie' => false,
 ));

$user = $facebook->getUser();

// Contact Facebook and get token

 if ($user) {

 // you're logged in, and we'll get user acces token for posting on the wall

 try {

 $page_info = $facebook->api("/$pageId?fields=access_token");

 if (!empty($page_info['access_token'])) {

 $attachment = array(

 'access_token' => $page_info['access_token'],

  'message'=> $msg,

'from' => $appid,

'to' => $pageid,

'caption' =>'1tvnews.af', 


'name' =>$facebook_title ,

'link' => $uri,

'picture' => $todir2,
            'description' => $intro_text
 );

$status = $facebook->api("/$pageId/feed", "post", $attachment);

 } 
else
 {
 $status = 'No access token recieved';
 }
 } catch (FacebookApiException $e) {
 error_log($e);
 $user = null;
 }
 } 
else 
{
 // you're not logged in, the application will try to log in to get a access token

header("Location:{$facebook->getLoginUrl(array('scope' => 
'photo_upload,user_status,publish_stream,user_photos,manage_pages'))}");
 }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!