English 中文(简体)
• 如何利用新的网站(www.un.org/Depts/DGACM/index_eng.htm
原标题:How to add profile image to event using the new php graph api

借助网站图表,我想在一次活动中增加图片。 因此,我想到一些新图表的例子!


如果问题不明确,我会感到担忧。 创建活动面图使用31个标准图象

缩略语

icon https://i.stack.imgur.com/w7tMp.png in monocolor and color

I ( and many other person ) want to replace this picture using php as you can do it via the facebook page. All descriptions in the internet fail. I use the following code

$name= $parameter[ betreff ];  
$beschreibung=$parameter[ thema ];
start_time = $parameter[ anfangsdatum ] . " " . $parameter[ anfangszeit ];
$ort="" . $parameter[ ort ];
$picture= http://www.tvwehen.de/facebook/facebook_plan_event/news.png ;  
$privacy="CLOSED";
$event_param = array( 
 access_token  => $access_token,
 page_id    =>$fanPageId,
 name  => $name,
 start_time  => $start_time,
 description  =>    $beschreibung, 
 location  => $ort,
 pic_big  => $picture,
 pic_small  => $picture,
 logo.png  => $picture,
 privacy    =>  $privacy
);
$event_id = $facebook->api($fanPageId . "/events", "POST", $event_param);

活动是在狂热的火上进行的,但没有任何照片! 为什么?

问题回答

Your question is a bit unclear, but assuming I ve understood you correctly, you simply want a users profile picture? That can be found here: http://graph.facebook.com/username/picture

So mine would be at http://graph.facebook.com/filip.soderholm/picture

也可使用用户 如果是这样的话,我不使用用户名称。

https://gist.github.com/1178154”rel=“nofollow”

<?php
/**
 * Implementation of hook_nodeapi
 */
function hps_the_hook_nodeapi (&$node, $op, $a3 = NULL, $a4 = NULL) {
  if ($node->type ==  event ) {
    if ($op ==  insert ) {
      dpm($node); 
      //require_once(drupal_get_path( module ,  hps_the_hook ) .  /lib/facebook-php-sdk/src/facebook.php );
      $facebook = new Facebook(array(
         appId   =>  193560340711521 ,
         secret  =>  secret ,
         fileUpload  => true,
       )); 
      $page_id = "161330440592966";
      $location = $node->field_location[0][ value ];
      $from_date = $node->field_date[0][ value ];
      $to_date = $node->field_date[0][ value2 ];
      $image_path = $node->field_image[0][ filepath ];
      $event_param = array(
          "access_token" =>   access_token ,
          "name" => $node->title,
          "start_time" => strtotime($from_date),
          "end_time" => strtotime($to_date),
          "location" => $location,
          "page_id" => $page_id,
          "picture" => "@".realpath($image_path),
          "source" => "@".realpath($image_path),
      );  
      $facebook->setFileUploadSupport(true);
      try {
        dpm($event_param);
        $event_id = $facebook->api("/161330440592966/events", "POST", $event_param);
        dpm($event_id);
      }   
      catch (Exception $ex) {
        dpm($ex);
      }   
    }   
  }
} 
?>




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签