Re: Link back to the original Facebook event

Home Forums Calendar Products Event Aggregator Re: Link back to the original Facebook event

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #28217
    Dom
    Member

    I thought I would share this as a quick fix for the question asked on
    Link back to the original Facebook event forum post.

    I am sure the gurus at tribe will come up with a better, built in, solution in an update but this seems to be working for me. It creates a nice themed button to the original Facebook event at the bottom of the right meta column in the single event view page (under the event address) .

    Edit: looks like the forum is mistaking some code in a function as HTML so here is a link to the below steps: http://pastebin.com/yVAL8Mwp
    Step 1: Paste this into your theme’s functions.php file:
    ============================

    /**
    *Plugin: Tribe Facebook Events Importer
    *Checks if the event came from facebook
    */
    function is_fb_event(){
    $fbMeta=tribe_get_event_meta();
    $verifyString="facebook-importer";
    $result=true;
    if ($fbMeta['_EventOrigin']['0']==$verifyString){
    $result=true;
    return $result;
    }
    if ($fbMeta['_EventOrigin']['0']!=$verifyString){
    $result=false;
    return NULL;
    }
    }

    /**
    *Plugin: Tribe Facebook Events Importer
    *Builds a button to the original facebook event page in the event's info page
    */
    function build_fb_link(){
    $fbMeta=tribe_get_event_meta();
    $eventID=$fbMeta['_FacebookID']['0'];
    echo "Join event on Facebook";
    }

    Step 2: Paste this into your theme’s CSS file (or “events.css”)
    =============================

    #tribe-events-event-meta .fb {

    background: url(http://www.mricons.com/store/png/111375_28291_32_facebook_logo_icon.png) #3B5998 10px 5px no-repeat;
    background-size:22px 22px!important;
    float:left;
    clear:left;
    font-weight:bold;
    width:145px;
    height:23px;
    padding: 7px 0px 0px 38px;
    margin: 0 0 20px 30px;
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px;
    }

    #tribe-events-event-meta .fb a{
    color: #ffffff!important;
    }

    #tribe-events-event-meta .fb a:hover{
    text-decoration:underline;
    }


    Step 3: Paste this into your “single.php” file in your “plugins/the-events-calendar/views/” folder between line 84 and 85
    ==============================

    if (is_fb_event()==true){build_fb_link();}

    #28307
    Barry
    Member

    Thanks for posting this, it’s great to see community members sharing tips and tricks.

    And yes, the forum doesn’t handle code too nicely – so using Pastebin, Gist or a similar service as you have done is the best way to share code.

    #28730
    Jacinta
    Participant

    Hi Dom! Trying to make this work.The code keeps showing up on my event posts. Not sure what step I messed up. Where is the events.css file?

    #29148
    Leah
    Member

    Hi Jacinta,

    Sorry for the delayed response. You’ll find the events.css file at /wp-content/plugins/events/resources/events.css

    ~Leah

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Re: Link back to the original Facebook event’ is closed to new replies.