• lassrladd

    (@icanhazcookies)


    I’m trying to modify the social publisher module so that it posts events instead of wall posts, everything works great except for the event image which does not upload no matter what I try. Here’s the code modified inside social-publisher.php:

    $args = array('access_token' => $event_fan_page_info[0][3],
    		'name' => get_the_title(),
    		'description' => strip_tags ( apply_filters( 'the_excerpt', get_the_excerpt() ) ),
    		'picture' => '@' . realpath('wp-content/plugins/facebook/avatar.png'),
    		'start_time' => strtotime( $_POST['EventStartDate'] ),
    		'location' => $_POST['venue']['Venue'],
    		);
        $args['ref'] = 'fbwpp';
    
        if ( ! isset( $facebook ) )
          return;
    
        $status_messages = array();
    
        try {
          $publish_result = $facebook->api('/' . $event_fan_page_info[0][2] . '/events', 'POST', $args);

    I’ve looked into this for a while now and some people pointed out that fileUpload needs to be enabled, which I’ve done inside wp-core.php

    $args = apply_filters( 'fb_init', array(
    		'appId' => $options['app_id'],
    		'channelUrl' => add_query_arg( 'fb-channel-file', 1, site_url( '/' ) ),
    		'status' => true,
    		'fileUpload' => true,
    		'cookie' => true,
    		'xfbml' => true,
    		'oauth' => true
    	) );

    http://wordpress.org/extend/plugins/facebook/

  • The topic ‘[Plugin: Facebook] Image upload’ is closed to new replies.