Events Made Easy Forums How do I … How to create FB events -> WordPress blog post auto sync?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #55273
    Anonymous
    Inactive

    Hi Franky,

    Thanks for allowing me to join your forum, I’m using the calendar feature now on my site and it works great. 🙂

    May I know if EME can auto-sync FB events and display them as individual WordPress blog post?

    I’m trying to have my blog auto-post events that I have created in FB (as blog posts, not a feed on a separate page), so I don’t have to double entry on both FB and the WordPress blog.

    Please advise,

    Thanks and regards,

    #55274
    Franky
    Keymaster

    events are not posts, but if wanted you can create a regular post when a new event gets created using a hook. See http://www.e-dynamics.be/wordpress/?topic=trigger-a-post
    Concerning the FB events: see the plugin EME sync facebook events

    #55306
    Anonymous
    Inactive

    Hi Franky,

    Thanks for directing me to that post. Right now my auto-imported blog post looks like this…
    http://www.pfp.sg/2016/02/04/laksa-appreciation-day/

    I need advice on the following:

    
    function make_shadow_eme_post($event_passed) {
    $new_post = array(
    'post_title' => $event_passed ['event_name'],
    
    // One can pass other EME event fields into content, particularly $event_passed ['event_notes']
    
    'post_content' => "<meta http-equiv="refresh" content="0;url=http://example.com/events/?event_id=" . $event_passed ['event_id'] . ""> Redirect to <a href="http://example.com/events/?event_id=" . $event_passed ['event_id'] . "">http://example.com/events/?event_id=" . $event_passed ['event_id'] . "</a> ...",
    
    'post_category' => array( 39 ),
    'post_status' => 'publish'
    );
    

    (1) regarding the ‘post_content’ portion of the array, what is she trying to achieve?
    Whenever I use this block, I’m always returned with a missing ‘)’ error. I replaced it with

    ‘post_content’ => $event_passed [‘event_notes’]

    and it works again.

    (2) I need to use a full-size image from FB. I asked you about this and you mentioned using #_EVENTIMAGE and it works beautifully when shown in list form as seen here.

    http://www.pfp.sg/events-2/

    How do I get this placeholder in PHP form to insert into the code above?
    Also, is it possible to point to the image on Facebook’s server instead of downloading the images into my site? Like to save some space…. 😀

    (3) Is there a list of some sort containing the name of the variables used in your plugin?

    For example, $event_passed [‘event_name’] and $event_passed [‘event_notes’], I can’t find these listed in your documentation.

    Reason is if I know the variables, I can straightaway attempt to format the contents for the event in the PHP, and assign the correct CSS IDs and classes.

    Not that good with WP development, hope you can spare me some slack 🙂

    (4) If you have any advice on how to insert the #_EVENTIMAGE as the featured image, it will be great!

    #55307
    Franky
    Keymaster

    I guess she tried to do an autoredirect to the real event page.
    Concerning the image: you can use shortcodes in your own code, and let wp do the rest (see the wp function do_shortcode), but for code concerning the image:
    $url = wp_get_attachment_url($event['event_image_id']);
    But indeed, it needs to be downloaded from fb, no reference to outside images is done.

    Concerning the variables: it’s a filter/hook, so doing a print_r($event_passed) will show you everything there is in there.

    #55403
    Anonymous
    Inactive

    Hi again Franky,

    Is does your code currently auto create blog posts whenever it syncs? I need to disable it. The posts created looks like this. The posts are authored by my own username.

    Please kindly advise.

    #55404
    Franky
    Keymaster

    Nope, it doesn’t. That means that some action hook in your theme’s function.php is doing this.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘How do I …’ is closed to new topics and replies.
Scroll to Top