Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 "<dt><div class='fb'><a href='http://facebook.com/".$eventID."' target='_BLANK'>Join event on <b>Facebook</b></a></div></dt>";
- }
- 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();}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement