function feed_them_settings_page() { $fts_functions = new feed_them_social_functions(); if (!function_exists('curl_init')) { print '<div class="error"><p>' . __('Warning: cURL is not installed on this server. It is required to use this plugin. Please contact your host provider to install this.', 'feed-them-social') . '</p></div>'; } ?> <div class="feed-them-social-admin-wrap"> <div class="fts-backg"></div> <div class="fts-content"> <h1><?php _e('Feed Them Social', 'feed-them-social'); ?> </h1> <div class="use-of-plugin"><?php _e('Please select what type of feed you would like to see. Then you can copy and paste the shortcode to a page, post or widget.', 'feed-them-social'); ?> </div> <div class="feed-them-icon-wrap"> <a href="#" class="youtube-icon"></a> <a href="#" class="vine-icon"></a> <a href="#" class="twitter-icon"></a> <a href="#" class="facebook-icon"></a> <a href="#" class="instagram-icon"></a> <a href="#" class="pinterest-icon"></a> <?php //show the js for the discount option under social icons on the settings page if (!is_plugin_active('feed-them-premium/feed-them-premium.php')) { ?> <div id="discount-for-review"><?php _e('15% off Premium Version', 'feed-them-social'); ?> </div> <div class="discount-review-text"><a href="http://www.slickremix.com/downloads/feed-them-social-premium-extension/" target="_blank"><?php _e('Share here', 'feed-them-social'); ?> </a> <?php _e('and receive 15% OFF your total order.', 'feed-them-social'); ?> </div> <?php } ?> </div> <form class="feed-them-social-admin-form"> <select id="shortcode-form-selector"> <option value=""><?php _e('Select a social network to get started', 'feed-them-social'); ?> </option> <option value="fb-page-shortcode-form"><?php _e('Facebook Feed', 'feed-them-social'); ?> </option> <option value="twitter-shortcode-form"><?php _e('Twitter Feed', 'feed-them-social'); ?> </option> <option value="vine-shortcode-form"><?php _e('Vine Feed', 'feed-them-social'); ?> </option> <option value="instagram-shortcode-form"><?php _e('Instagram Feed', 'feed-them-social'); ?> </option> <option value="youtube-shortcode-form"><?php _e('YouTube Feed'); ?> </option> <option value="pinterest-shortcode-form"><?php _e('Pinterest Feed', 'feed-them-social'); ?> </option> </select> </form><!--/feed-them-social-admin-form--> <?php //Add Facebook Event Form echo $fts_functions->fts_facebook_group_form(false); //Add Facebook Page Form echo $fts_functions->fts_facebook_page_form(false); //Add Facebook List of Events Form echo $fts_functions->fts_facebook_list_of_events_form(false); //Add Facebook Single Event Form echo $fts_functions->fts_facebook_event_form(false); //Add Twitter Form echo $fts_functions->fts_twitter_form(); //Add Vine Form echo $fts_functions->fts_vine_form(false); //Add Instagram Form echo $fts_functions->fts_instagram_form(false); //Add Youtube Form echo $fts_functions->fts_youtube_form(false); //Add Pinterest Form echo $fts_functions->fts_pinterest_form(false); ?> <div class="clear"></div> <div class="feed-them-clear-cache"> <h2><?php _e('Clear All Cache Options', 'feed-them-social'); ?> </h2> <div class="use-of-plugin"><?php _e('Please Clear Cache if you have changed a Feed Them Social Shortcode. This will Allow you to see the changes right away.', 'feed-them-social'); ?> </div> <?php if (isset($_GET['cache']) && $_GET['cache'] == 'clearcache') { echo '<div class="feed-them-clear-cache-text">' . $fts_functions->feed_them_clear_cache() . '</div>'; } isset($ftsDevModeCache) ? $ftsDevModeCache : ""; isset($ftsAdminBarMenu) ? $ftsAdminBarMenu : ""; $ftsDevModeCache = get_option('fts_clear_cache_developer_mode'); $ftsAdminBarMenu = get_option('fts_admin_bar_menu'); ?> <form method="post" action="?page=feed-them-settings-page&cache=clearcache"> <input class="feed-them-social-admin-submit-btn" type="submit" value="<?php _e('Clear All FTS Feeds Cache', 'feed-them-social'); ?> " /> </form> </div><!--/feed-them-clear-cache--> <!-- custom option for padding --> <form method="post" class="fts-color-settings-admin-form" action="options.php"> <p> <input name="fts_clear_cache_developer_mode" class="fts-color-settings-admin-input fts_clear_cache_developer_mode" type="checkbox" id="fts-color-options-settings-custom-css" value="1" <?php echo checked('1', get_option('fts_clear_cache_developer_mode')); ?> /> <?php if (get_option('fts_clear_cache_developer_mode') == '1') { ?> <?php _e('Cache will clear on every page load now', 'feed-them-social'); ?> <?php } else { ?> <?php _e('Developer Mode: Clear cache on every page load', 'feed-them-social'); ?> <?php } ?> </p> <select id="fts_admin_bar_menu" name="fts_admin_bar_menu"> <option value="show-admin-bar-menu" <?php if ($ftsAdminBarMenu == 'show-admin-bar-menu') { echo 'selected="selected"'; } ?> ><?php _e('Show Admin Bar Menu', 'feed-them-social'); ?> </option> <option value="hide-admin-bar-menu" <?php if ($ftsAdminBarMenu == 'hide-admin-bar-menu') { echo 'selected="selected"'; } ?> ><?php _e('Hide Admin Bar Menu', 'feed-them-social'); ?> </option> </select> <div class="feed-them-custom-css"> <?php // get our registered settings from the fts functions settings_fields('feed-them-social-settings'); ?> <?php isset($ftsDateTimeFormat) ? $ftsDateTimeFormat : ""; isset($ftsTimezone) ? $ftsTimezone : ""; $ftsDateTimeFormat = get_option('fts-date-and-time-format'); $ftsTimezone = get_option('fts-timezone'); date_default_timezone_set(get_option('fts-timezone', 'America/Los_Angeles')); ?> <div style="float:left; max-width:400px; margin-right:30px;"><h2><?php _e('FaceBook & Twitter Date Format', 'feed-them-social'); ?> </h2> <fieldset> <select id="fts-date-and-time-format" name="fts-date-and-time-format"> <option value="l, F jS, Y \a\t g:ia" <?php if ($ftsDateTimeFormat == 'l, F jS, Y \\a\\t g:ia') { echo 'selected="selected"'; } ?> ><?php echo date('l, F jS, Y \\a\\t g:ia'); ?> </option> <option value="F j, Y \a\t g:ia" <?php if ($ftsDateTimeFormat == 'F j, Y \\a\\t g:ia') { echo 'selected="selected"'; } ?> ><?php echo date('F j, Y \\a\\t g:ia'); ?> </option> <option value="F j, Y g:ia" <?php if ($ftsDateTimeFormat == 'F j, Y g:ia') { echo 'selected="selected"'; } ?> ><?php echo date('F j, Y g:ia'); ?> </option> <option value="F, Y \a\t g:ia" <?php if ($ftsDateTimeFormat == 'F, Y \\a\\t g:ia') { echo 'selected="selected"'; } ?> ><?php echo date('F, Y \\a\\t g:ia'); ?> </option> <option value="M j, Y @ g:ia" <?php if ($ftsDateTimeFormat == 'M j, Y @ g:ia') { echo 'selected="selected"'; } ?> ><?php echo date('M j, Y @ g:ia'); ?> </option> <option value="M j, Y @ G:i" <?php if ($ftsDateTimeFormat == 'M j, Y @ G:i') { echo 'selected="selected"'; } ?> ><?php echo date('M j, Y @ G:i'); ?> </option> <option value="m/d/Y \a\t g:ia" <?php if ($ftsDateTimeFormat == 'm/d/Y \\a\\t g:ia') { echo 'selected="selected"'; } ?> ><?php echo date('m/d/Y \\a\\t g:ia'); ?> </option> <option value="m/d/Y @ G:i" <?php if ($ftsDateTimeFormat == 'm/d/Y @ G:i') { echo 'selected="selected"'; } ?> ><?php echo date('m/d/Y @ G:i'); ?> </option> <option value="d/m/Y \a\t g:ia" <?php if ($ftsDateTimeFormat == 'd/m/Y \\a\\t g:ia') { echo 'selected="selected"'; } ?> ><?php echo date('d/m/Y \\a\\t g:ia'); ?> </option> <option value="d/m/Y @ G:i" <?php if ($ftsDateTimeFormat == 'd/m/Y @ G:i') { echo 'selected="selected"'; } ?> ><?php echo date('d/m/Y @ G:i'); ?> </option> <option value="Y/m/d \a\t g:ia" <?php if ($ftsDateTimeFormat == 'Y/m/d \\a\\t g:ia') { echo 'selected="selected"'; } ?> ><?php echo date('Y/m/d \\a\\t g:ia'); ?> </option> <option value="Y/m/d @ G:i" <?php if ($ftsDateTimeFormat == 'Y/m/d @ G:i') { echo 'selected="selected"'; } ?> ><?php echo date('Y/m/d @ G:i'); ?> </option> </select> </fieldset> </div> <div style="float:left; max-width:330px"> <h2><?php _e('TimeZone', 'feed-them-social'); ?> </h2> <fieldset> <select id="fts-timezone" name="fts-timezone"> <option value="Kwajalein" <?php if ($ftsTimezone == "Kwajalein") { echo 'selected="selected"'; } ?> > <?php _e('UTC-12:00'); ?> </option> <option value="Pacific/Midway" <?php if ($ftsTimezone == "Pacific/Midway") { echo 'selected="selected"'; } ?> > <?php _e('UTC-11:00'); ?> </option> <option value="Pacific/Honolulu" <?php if ($ftsTimezone == "Pacific/Honolulu") { echo 'selected="selected"'; } ?> > <?php _e('UTC-10:00'); ?> </option> <option value="America/Anchorage" <?php if ($ftsTimezone == "America/Anchorage") { echo 'selected="selected"'; } ?> > <?php _e('UTC-09:00'); ?> </option> <option value="America/Los_Angeles" <?php if ($ftsTimezone == "America/Los_Angeles") { echo 'selected="selected"'; } ?> > <?php _e('UTC-08:00'); ?> </option> <option value="America/Denver" <?php if ($ftsTimezone == "America/Denver") { echo 'selected="selected"'; } ?> > <?php _e('UTC-07:00'); ?> </option> <option value="America/Chicago" <?php if ($ftsTimezone == "America/Chicago") { echo 'selected="selected"'; } ?> > <?php _e('UTC-06:00'); ?> </option> <option value="America/New_York" <?php if ($ftsTimezone == "America/New_York") { echo 'selected="selected"'; } ?> > <?php _e('UTC-05:00'); ?> </option> <option value="America/Caracas" <?php if ($ftsTimezone == "America/Caracas") { echo 'selected="selected"'; } ?> > <?php _e('UTC-04:30'); ?> </option> <option value="America/Halifax" <?php if ($ftsTimezone == "America/Halifax") { echo 'selected="selected"'; } ?> > <?php _e('UTC-04:00'); ?> </option> <option value="America/St_Johns" <?php if ($ftsTimezone == "America/St_Johns") { echo 'selected="selected"'; } ?> > <?php _e('UTC-03:30'); ?> </option> <option value="America/Sao_Paulo" <?php if ($ftsTimezone == "America/Sao_Paulo") { echo 'selected="selected"'; } ?> > <?php _e('UTC-03:00'); ?> </option> <option value="America/Noronha" <?php if ($ftsTimezone == "America/Noronha") { echo 'selected="selected"'; } ?> > <?php _e('UTC-02:00'); ?> </option> <option value="Atlantic/Cape_Verde" <?php if ($ftsTimezone == "Atlantic/Cape_Verde") { echo 'selected="selected"'; } ?> > <?php _e('UTC-01:00'); ?> </option> <option value="Europe/Belfast" <?php if ($ftsTimezone == "Europe/Belfast") { echo 'selected="selected"'; } ?> > <?php _e('UTC'); ?> <option value="Europe/Amsterdam" <?php if ($ftsTimezone == "Europe/Amsterdam") { echo 'selected="selected"'; } ?> > <?php _e('UTC+01:00'); ?> </option> <option value="Asia/Beirut" <?php if ($ftsTimezone == "Asia/Beirut") { echo 'selected="selected"'; } ?> > <?php _e('UTC+02:00'); ?> </option> <option value="Europe/Moscow" <?php if ($ftsTimezone == "Europe/Moscow") { echo 'selected="selected"'; } ?> > <?php _e('UTC+03:00'); ?> </option> <option value="Asia/Tehran" <?php if ($ftsTimezone == "Asia/Tehran") { echo 'selected="selected"'; } ?> > <?php _e('UTC+03:30'); ?> </option> <option value="Asia/Yerevan" <?php if ($ftsTimezone == "Asia/Yerevan") { echo 'selected="selected"'; } ?> > <?php _e('UTC+04:00'); ?> </option> <option value="Asia/Kabul" <?php if ($ftsTimezone == "Asia/Kabul") { echo 'selected="selected"'; } ?> > <?php _e('UTC+04:30'); ?> </option> <option value="Asia/Tashkent" <?php if ($ftsTimezone == "Asia/Tashkent") { echo 'selected="selected"'; } ?> > <?php _e('UTC+05:00'); ?> </option> <option value="Asia/Kolkata" <?php if ($ftsTimezone == "Asia/Kolkata") { echo 'selected="selected"'; } ?> > <?php _e('UTC+05:30'); ?> </option> <option value="Asia/Katmandu" <?php if ($ftsTimezone == "Asia/Katmandu") { echo 'selected="selected"'; } ?> > <?php _e('UTC+05:45'); ?> </option> <option value="Asia/Dhaka" <?php if ($ftsTimezone == "Asia/Dhaka") { echo 'selected="selected"'; } ?> > <?php _e('UTC+06:00'); ?> </option> <option value="Asia/Novosibirsk" <?php if ($ftsTimezone == "Asia/Novosibirsk") { echo 'selected="selected"'; } ?> > <?php _e('UTC+06:00'); ?> </option> <option value="Asia/Rangoon" <?php if ($ftsTimezone == "Asia/Rangoon") { echo 'selected="selected"'; } ?> > <?php _e('UTC+06:30'); ?> </option> <option value="Asia/Bangkok" <?php if ($ftsTimezone == "Asia/Bangkok") { echo 'selected="selected"'; } ?> > <?php _e('UTC+07:00'); ?> </option> <option value="Australia/Perth" <?php if ($ftsTimezone == "Australia/Perth") { echo 'selected="selected"'; } ?> > <?php _e('UTC+08:00'); ?> </option> <option value="Australia/Eucla" <?php if ($ftsTimezone == "Australia/Eucla") { echo 'selected="selected"'; } ?> > <?php _e('UTC+08:45'); ?> </option> <option value="Asia/Tokyo" <?php if ($ftsTimezone == "Asia/Tokyo") { echo 'selected="selected"'; } ?> > <?php _e('UTC+09:00'); ?> </option> <option value="Australia/Adelaide" <?php if ($ftsTimezone == "Australia/Adelaide") { echo 'selected="selected"'; } ?> > <?php _e('UTC+09:30'); ?> </option> <option value="Australia/Hobart" <?php if ($ftsTimezone == "Australia/Hobart") { echo 'selected="selected"'; } ?> > <?php _e('UTC+10:00'); ?> </option> <option value="Australia/Lord_Howe" <?php if ($ftsTimezone == "Australia/Lord_Howe") { echo 'selected="selected"'; } ?> > <?php _e('UTC+10:30'); ?> </option> <option value="Asia/Magadan" <?php if ($ftsTimezone == "Asia/Magadan") { echo 'selected="selected"'; } ?> > <?php _e('UTC+11:00'); ?> </option> <option value="Pacific/Norfolk" <?php if ($ftsTimezone == "Pacific/Norfolk") { echo 'selected="selected"'; } ?> > <?php _e('UTC+11:30'); ?> </option> <option value="Asia/Anadyr" <?php if ($ftsTimezone == "Asia/Anadyr") { echo 'selected="selected"'; } ?> > <?php _e('UTC+12:00'); ?> </option> <option value="Pacific/Chatham" <?php if ($ftsTimezone == "Pacific/Chatham") { echo 'selected="selected"'; } ?> > <?php _e('UTC+12:45'); ?> </option> <option value="Pacific/Tongatapu" <?php if ($ftsTimezone == "Pacific/Tongatapu") { echo 'selected="selected"'; } ?> > <?php _e('UTC+13:00'); ?> </option> <option value="Pacific/Kiritimati" <?php if ($ftsTimezone == "Pacific/Kiritimati") { echo 'selected="selected"'; } ?> > <?php _e('UTC+14:00'); ?> </option> </select> </fieldset> </div> <div class="clear"></div> <br/> <h2><?php _e('Custom CSS Option', 'feed-them-social'); ?> </h2> <p> <input name="fts-color-options-settings-custom-css" class="fts-color-settings-admin-input" type="checkbox" id="fts-color-options-settings-custom-css" value="1" <?php echo checked('1', get_option('fts-color-options-settings-custom-css')); ?> /> <?php if (get_option('fts-color-options-settings-custom-css') == '1') { ?> <strong><?php _e('Checked:', 'feed-them-social'); ?> </strong> <?php _e('Custom CSS option is being used now.', 'feed-them-social'); ?> <?php } else { ?> <strong><?php _e('Not Checked:', 'feed-them-social'); ?> </strong> <?php _e('You are using the default CSS.', 'feed-them-social'); ?> <?php } ?> </p> <label class="toggle-custom-textarea-show"><span><?php _e('Show', 'feed-them-social'); ?> </span><span class="toggle-custom-textarea-hide"><?php _e('Hide', 'feed-them-social'); ?> </span> <?php _e('custom CSS', 'feed-them-social'); ?> </label> <div class="clear"></div> <div class="fts-custom-css-text"><?php _e('Thanks for using our plugin :) Add your custom CSS additions or overrides below.', 'feed-them-social'); ?> </div> <textarea name="fts-color-options-main-wrapper-css-input" class="fts-color-settings-admin-input" id="fts-color-options-main-wrapper-css-input"><?php echo get_option('fts-color-options-main-wrapper-css-input'); ?> </textarea> </div><!--/feed-them-custom-css--> <div class="feed-them-custom-logo-css"> <h2><?php _e('Disable Magnific Popup CSS', 'feed-them-social'); ?> </h2> <p> <input name="fts_fix_magnific" class="fts-powered-by-settings-admin-input" type="checkbox" id="fts_fix_magnific" value="1" <?php echo checked('1', get_option('fts_fix_magnific')); ?> /> <?php _e('Check this if you are experiencing problems with your theme(s) or other plugin(s) popups.', 'feed-them-social'); ?> </p> <br/> <?php if (is_plugin_active('feed-them-premium/feed-them-premium.php')) { ?> <h2><?php _e('Load More Options', 'feed-them-social'); ?> </h2> <p> <input name="fts_fix_loadmore" class="fts-powered-by-settings-admin-input" type="checkbox" id="fts_fix_loadmore" value="1" <?php echo checked('1', get_option('fts_fix_loadmore')); ?> /> <?php _e('Check this if you are using the loadmore button for Facebook or Instagram and are seeing a bunch of code under it.', 'feed-them-social'); ?> </p> <br/> <?php } ?> <h2><?php _e('Powered by Text', 'feed-them-social'); ?> </h2> <p> <input name="fts-powered-text-options-settings" class="fts-powered-by-settings-admin-input" type="checkbox" id="fts-powered-text-options-settings" value="1" <?php echo checked('1', get_option('fts-powered-text-options-settings')); ?> /> <?php if (get_option('fts-powered-text-options-settings') == '1') { ?> <strong><?php _e('Checked:', 'feed-them-social'); ?> </strong> <?php _e('You are not showing the Powered by Logo.', 'feed-them-social'); ?> <?php } else { ?> <strong><?php _e('Not Checked:', 'feed-them-social'); ?> </strong><?php _e('The Powered by text will appear in the site. Awesome! Thanks so much for sharing.', 'feed-them-social'); ?> <?php } ?> </p> <br/> <input type="submit" class="feed-them-social-admin-submit-btn" value="<?php _e('Save All Changes', 'feed-them-social'); ?> " /> <div class="clear"></div> </div><!--/feed-them-custom-logo-css--> </form> </div><!--/font-content--> </div><!--/feed-them-social-admin-wrap--> <h1 class="plugin-author-note"><?php _e('Plugin Authors Note', 'feed-them-social'); ?> </h1> <div class="fts-plugin-reviews"> <div class="fts-plugin-reviews-rate"><?php _e(' Feed Them Social was created by 2 Brothers, Spencer and Justin Labadie. That’s it, 2 people! We spend all our time creating and supporting this plugin. Show us some love if you like our plugin and leave a quick review for us, it will make our day!', 'feed-them-social'); ?> <a href="https://wordpress.org/support/view/plugin-reviews/feed-them-social" target="_blank"><?php _e('Leave us a Review', 'feed-them-social'); ?> ★★★★★</a> </div> <div class="fts-plugin-reviews-support"><?php _e('If you\'re having troubles getting setup please contact us. We will respond within 24hrs, but usually within 1-6hrs.', 'feed-them-social'); ?> <a href="http://www.slickremix.com/support-forum/forum/feed-them-social-2" target="_blank"><?php _e('Support Forum', 'feed-them-social'); ?> </a> <div class="fts-text-align-center"><a class="feed-them-social-admin-slick-logo" href="http://www.slickremix.com" target="_blank"></a></div> </div> </div> <script> jQuery(function() { // Master feed selector jQuery('#shortcode-form-selector').change(function(){ jQuery('.shortcode-generator-form').hide(); jQuery('.' + jQuery(this).val()).fadeIn('fast'); }); jQuery('#fb_hide_like_box_button').change(function(){ jQuery('.fb_align_likebox').toggle(); }); jQuery('#facebook_show_video_button').change(function(){ jQuery('.fb-video-play-btn-options-content').toggle(); }); // change the feed type 'how to' message when a feed type is selected jQuery('#facebook-messages-selector').change(function(){ jQuery('.facebook-message-generator').hide(); jQuery('.' + jQuery(this).val()).fadeIn('fast'); // if the facebook type select is changed we hide the shortcode code so not to confuse people jQuery('.final-shortcode-textarea').hide(); // only show the Super Gallery Options if the facebook ablum or album covers feed type is selected var facebooktype = jQuery("select#facebook-messages-selector").val(); // if (facebooktype == 'albums' || facebooktype == 'album_photos' || facebooktype == 'page' || facebooktype == 'group' || facebooktype == 'event' || facebooktype == 'events') { // // } <?php if (is_plugin_active('feed-them-premium/feed-them-premium.php')) { ?> if (facebooktype == 'album_videos') { jQuery('.fts-premium-options-message, .fts-photos-popup, #facebook_super_gallery_container, #facebook_super_gallery_animate').hide(); jQuery('.video, .fb-video-play-btn-options-wrap, #facebook_video_align_images_wrapper').show(); jQuery(".feed-them-social-admin-input-label:contains('Album')").html("<?php _e('Video Album ID (required)', 'feed-them-social'); ?> "); jQuery(".feed-them-social-admin-input-label:contains('# of Posts')").html("<?php _e('# of Videos', 'feed-them-social'); ?> "); } else { jQuery('.video, .fb-video-play-btn-options-wrap, #facebook_video_align_images_wrapper').hide(); jQuery('.fts-photos-popup, #facebook_super_gallery_container, #facebook_super_gallery_animate').show(); jQuery(".feed-them-social-admin-input-label:contains('Video Album ID (required)')").html("<?php _e('Album ID (required)', 'feed-them-social'); ?> "); jQuery(".feed-them-social-admin-input-label:contains('# of Videos')").html("<?php _e('# of Posts', 'feed-them-social'); ?> "); } <?php } else { ?> if (facebooktype == 'album_videos') { // we are hiding all fields in the free verison and adding am upgrade message, much easier this way as the options add up. jQuery('.fb-options-wrap').hide(); jQuery('.fts-premium-options-message').show(); } else { jQuery('.fb-options-wrap').show(); jQuery('.fts-premium-options-message, .video').hide(); } <?php } ?> if (facebooktype == 'events' || facebooktype == 'page' ) { jQuery('.inst-text-facebook-page').show(); } else { jQuery('.inst-text-facebook-page').hide(); } <?php if (is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php')) { ?> if (facebooktype == 'reviews') { jQuery('.fb-reviews, .inst-text-facebook-page, .reviews-options').show(); jQuery('.fb-page-title-option-hide, .fb-page-description-option-hide, .need-for-premium-fields-wrap').hide(); } else { jQuery('.fb-reviews, .reviews-options').hide(); jQuery('.fb-page-title-option-hide, .fb-page-description-option-hide, .need-for-premium-fields-wrap').show(); } <?php } else { ?> if (facebooktype == 'reviews' ) { // we are hiding all fields in the free verison and adding am upgrade message, much easier this way as the options add up. jQuery('.reviews-copy-text, .fb-options-wrap').hide(); jQuery('.fts-premium-options-message2').show(); } else { jQuery('.fts-premium-options-message2').hide(); jQuery('.fb-options-wrap').show(); } <?php } ?> if (facebooktype == 'albums' || facebooktype == 'album_photos' || facebooktype == 'album_videos') { jQuery('.fts-super-facebook-options-wrap').show(); jQuery('.fixed_height_option').hide(); jQuery('.fb-posts-in-grid-option-wrap').hide(); jQuery('.fixed_height_option').hide(); jQuery(".feed-them-social-admin-input-label:contains('<?php _e('Display Posts in Grid', 'feed-them-social'); ?> ')").parent('div').hide(); } else { jQuery('.fts-super-facebook-options-wrap').hide(); jQuery('.fixed_height_option').show(); jQuery('.fb-posts-in-grid-option-wrap').show(); jQuery(".feed-them-social-admin-input-label:contains('<?php _e('Display Posts in Grid', 'feed-them-social'); ?> ')").parent('div').show(); } // only show the post type visible if the facebook page feed type is selected jQuery('.facebook-post-type-visible').hide(); if (facebooktype == 'page' ) { jQuery('.facebook-post-type-visible').show(); } var fb_feed_type_option = jQuery("select#facebook-messages-selector").val(); if (fb_feed_type_option == 'album_photos' || fb_feed_type_option == 'album_videos') { jQuery('.fb_album_photos_id').show(); } else { jQuery('.fb_album_photos_id').hide(); } }); // Instagram Super Gallery option jQuery('#instagram-custom-gallery').bind('change', function (e) { if( jQuery('#instagram-custom-gallery').val() == 'yes') { jQuery('.fts-super-instagram-options-wrap').show(); } else{ jQuery('.fts-super-instagram-options-wrap').hide(); } }); jQuery('#instagram-messages-selector').bind('change', function (e) { if( jQuery('#instagram-messages-selector').val() == 'hashtag') { jQuery(".instagram-id-option-wrap").hide(); jQuery(".instagram-hashtag-option-text").show(); jQuery(".instagram-user-option-text").hide(); } else{ jQuery(".instagram-id-option-wrap").show(); jQuery(".instagram-hashtag-option-text").hide(); jQuery(".instagram-user-option-text").show(); } }); jQuery('#twitter-messages-selector').bind('change', function (e) { if( jQuery('#twitter-messages-selector').val() == 'hashtag') { jQuery(".hashtag-option-small-text").show(); jQuery(".twitter-hashtag-etc-wrap").show(); jQuery(".hashtag-option-not-required, .must-copy-twitter-name").hide(); } else{ jQuery(".hashtag-option-not-required, .must-copy-twitter-name").show(); jQuery(".twitter-hashtag-etc-wrap").hide(); jQuery(".hashtag-option-small-text").hide(); } }); // facebook show grid options jQuery('#fb-grid-option').bind('change', function (e) { if( jQuery('#fb-grid-option').val() == 'yes') { jQuery('.fts-facebook-grid-options-wrap').show(); jQuery(".feed-them-social-admin-input-label:contains('<?php _e('Center Facebook Container?', 'feed-them-social'); ?> ')").parent('div').show(); } else{ jQuery('.fts-facebook-grid-options-wrap').hide(); } }); // facebook Super Gallery option jQuery('#facebook-custom-gallery').bind('change', function (e) { if( jQuery('#facebook-custom-gallery').val() == 'yes') { jQuery('.fts-super-facebook-options-wrap').show(); } else{ jQuery('.fts-super-facebook-options-wrap').hide(); } }); // facebook show load more options jQuery('#fb_load_more_option').bind('change', function (e) { if( jQuery('#fb_load_more_option').val() == 'yes') { if(jQuery('#facebook-messages-selector').val() !== 'album_videos') { jQuery('.fts-facebook-load-more-options-wrap').show(); } jQuery('.fts-facebook-load-more-options2-wrap').show(); } else{ jQuery('.fts-facebook-load-more-options-wrap, .fts-facebook-load-more-options2-wrap').hide(); } }); // Instagram show load more options jQuery('#instagram_load_more_option').bind('change', function (e) { if( jQuery('#instagram_load_more_option').val() == 'yes') { jQuery('.fts-instagram-load-more-options-wrap').show(); } else{ jQuery('.fts-instagram-load-more-options-wrap').hide(); } }); // Pinterest options // hide this div till needed for free version jQuery(".feed-them-social-admin-input-label:contains('<?php _e('# of Pins', 'feed-them-social'); ?> ')").parent('div').hide(); jQuery('#pinterest-messages-selector').bind('change', function (e) { if( jQuery('#pinterest-messages-selector').val() == 'boards_list') { jQuery('.number-of-boards, .pinterest-name-text').show(); jQuery('.board-name, .show-pins-amount, .pinterest-board-and-name-text').hide(); jQuery(".feed-them-social-admin-input-label:contains('<?php _e('# of Boards', 'feed-them-social'); ?> ')").parent('div').show(); jQuery(".feed-them-social-admin-input-label:contains('<?php _e('# of Pins', 'feed-them-social'); ?> ')").parent('div').hide(); } }); // Pinterest options jQuery('#pinterest-messages-selector').bind('change', function (e) { if( jQuery('#pinterest-messages-selector').val() == 'single_board_pins') { jQuery('.board-name, .show-pins-amount, .pinterest-board-and-name-text').show(); jQuery('.number-of-boards, .pinterest-name-text').hide(); jQuery(".feed-them-social-admin-input-label:contains('<?php _e('# of Boards', 'feed-them-social'); ?> ')").parent('div').hide(); jQuery(".feed-them-social-admin-input-label:contains('<?php _e('# of Pins', 'feed-them-social'); ?> ')").parent('div').show(); } }) // Pinterest options jQuery('#pinterest-messages-selector').bind('change', function (e) { if( jQuery('#pinterest-messages-selector').val() == 'pins_from_user') { jQuery('.show-pins-amount, .pinterest-name-text').show(); jQuery('.number-of-boards, .board-name, .pinterest-board-and-name-text').hide(); jQuery(".feed-them-social-admin-input-label:contains('<?php _e('# of Boards', 'feed-them-social'); ?> ')").parent('div').hide(); jQuery(".feed-them-social-admin-input-label:contains('<?php _e('# of Pins', 'feed-them-social'); ?> ')").parent('div').show(); } }); }); // JS function updateTextArea_pinterest() { var pinterest_name = ' pinterest_name=' + jQuery("input#pinterest_name").val(); if (pinterest_name == " pinterest_name=") { jQuery(".pinterest_name").addClass('fts-empty-error'); jQuery("input#pinterest_name").focus(); return false; } if (pinterest_name != " pinterest_name=") { jQuery(".pinterest_name").removeClass('fts-empty-error'); } var pinterest_board_name = ' board_id=' + jQuery("input#pinterest_board_name").val(); if (pinterest_board_name == " board_id=" && jQuery("select#pinterest-messages-selector").val() == "single_board_pins") { jQuery(".board-name").addClass('fts-empty-error'); jQuery("input#pinterest_board_name").focus(); return false; } if (pinterest_board_name != " board_id=") { jQuery(".board-name").removeClass('fts-empty-error'); } if (pinterest_board_name == " board_id=") { var pinterest_board_name_final=''; } if (pinterest_board_name != " board_id="){ var pinterest_board_name_final = pinterest_board_name; } var type = ' type=' + jQuery("select#pinterest-messages-selector").val(); if (type == " type=") { var type_final=''; } if (type != " type="){ var type_final = type; } <?php //Premium Plugin if (is_plugin_active('feed-them-premium/feed-them-premium.php')) { include WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/pinterest-settings-js.js'; } else { ?> //Generate Pinterest Shortcode if (jQuery("select#pinterest-messages-selector").val() == "pins_from_user"){ var final_pinterest_shorcode = '[fts pinterest' + pinterest_name + type_final +']'; } else if (jQuery("select#pinterest-messages-selector").val() == "single_board_pins"){ var final_pinterest_shorcode = '[fts pinterest' + pinterest_name + pinterest_board_name_final + type_final +']'; } else { var final_pinterest_shorcode = '[fts pinterest' + pinterest_name + type_final + ']'; } <?php } ?> jQuery('.pinterest-final-shortcode').val(final_pinterest_shorcode); jQuery('.pinterest-shortcode-form .final-shortcode-textarea').slideDown(); } //End Pinterest function updateTextArea_fb_page() { var fb_feed_type = ' type=' + jQuery("select#facebook-messages-selector").val(); var fb_page_id = ' id=' + jQuery("input#fb_page_id").val(); var fb_album_id = ' album_id=' + jQuery("input#fb_album_id").val(); var fb_page_posts_displayed = ' posts_displayed=' + jQuery("select#fb_page_posts_displayed").val(); var facebook_height = jQuery("input#facebook_page_height").val(); // var super_gallery = ' super_gallery=' + jQuery("select#facebook-custom-gallery").val(); var image_width = ' image_width=' + jQuery("input#fts-slicker-facebook-container-image-width").val(); var image_height = ' image_height=' + jQuery("input#fts-slicker-facebook-container-image-height").val(); var space_between_photos = ' space_between_photos=' + jQuery("input#fts-slicker-facebook-container-margin").val(); var hide_date_likes_comments = ' hide_date_likes_comments=' + jQuery("select#fts-slicker-facebook-container-hide-date-likes-comments").val(); var center_container = ' center_container=' + jQuery("select#fts-slicker-facebook-container-position").val(); var image_stack_animation = ' image_stack_animation=' + jQuery("select#fts-slicker-facebook-container-animation").val(); var position_lr = ' image_position_lr=' + jQuery("input#fts-slicker-facebook-image-position-lr").val(); var position_top = ' image_position_top=' + jQuery("input#fts-slicker-facebook-image-position-top").val(); if (fb_page_id == " id=") { jQuery(".fb_page_id").addClass('fts-empty-error'); jQuery("input#fb_page_id").focus(); return false; } if (fb_page_id != " id=") { jQuery(".fb_page_id").removeClass('fts-empty-error'); } if (fb_album_id == " album_id=" && fb_feed_type == " type=album_photos" || fb_album_id == " album_id=" && fb_feed_type == " type=album_videos") { jQuery(".fb_album_photos_id").addClass('fts-empty-error'); jQuery("input#fb_album_id").focus(); return false; } if (fb_album_id != " album_id=") { jQuery(".fb_album_photos_id").removeClass('fts-empty-error'); } if (facebook_height) { var facebook_height_final = ' height=' + jQuery("input#facebook_page_height").val(); } else { var facebook_height_final = ''; } var super_gallery_option = jQuery("select#facebook-custom-gallery").val(); var albums_photos_option = jQuery("select#facebook-messages-selector").val(); <?php //Premium Plugin if (is_plugin_active('feed-them-premium/feed-them-premium.php') || is_plugin_active('feed-them-premium/feed-them-premium.php') && is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php')) { include WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/facebook-page-settings-js.js'; ?> if (albums_photos_option == "album_photos") { var final_fb_page_shortcode = '[fts facebook' + fb_page_id + fb_album_id + fb_page_post_count_final + fb_page_title_option + fb_page_description_option + fb_page_word_count_option + fb_feed_type + image_width + image_height + space_between_photos + hide_date_likes_comments + center_container + image_stack_animation + position_lr + position_top + load_more_posts_style_final + facebook_popup + fts_hide_like_option + fts_like_option_align + fts_loadmore_button_width + fts_loadmore_btn_margin +' ]'; } else if (albums_photos_option == "album_videos") { var final_fb_page_shortcode = '[fts facebook' + fb_page_id + ' video_album=yes' + fb_album_id + ' type=album_photos' + fb_page_post_count_final + fb_page_title_option + fb_page_description_option + fb_page_word_count_option + image_width + image_height + space_between_photos + fts_play_btn + fts_play_btn_size + fts_play_btn_visible + hide_date_likes_comments + center_container + image_stack_animation + position_lr + position_top + load_more_posts_style_final + ' popup=yes' + fts_hide_like_option + fts_like_option_align + fts_loadmore_button_width + fts_loadmore_btn_margin + fts_images_align +']'; } else if (albums_photos_option == "albums") { var final_fb_page_shortcode = '[fts facebook' + fb_page_id + fb_page_post_count_final + fb_page_title_option + fb_page_description_option + fb_page_word_count_option + fb_feed_type + image_width + image_height + space_between_photos + hide_date_likes_comments + center_container + image_stack_animation + position_lr + position_top + load_more_posts_style_final + facebook_popup + fts_hide_like_option + fts_like_option_align + fts_loadmore_button_width + fts_loadmore_btn_margin +']'; } else if (albums_photos_option == "page") { var final_fb_page_shortcode = '[fts facebook' + fb_page_id + fb_page_posts_displayed + fb_page_post_count_final + fb_page_title_option + fb_page_description_option + fb_page_word_count_option + facebook_height_final + fb_feed_type + load_more_posts_style_final + facebook_grid + facebook_grid_space_between_posts + facebook_grid_colmn_width + center_container + image_stack_animation + facebook_popup + fts_hide_like_option + fts_like_option_align + fts_loadmore_button_width + fts_loadmore_btn_margin +']'; } <?php //Premium Plugin if (is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php')) { include WP_CONTENT_DIR . '/plugins/feed-them-social-facebook-reviews/admin/js/facebook-page-reviews-js.js'; } ?> else { var final_fb_page_shortcode = '[fts facebook' + fb_page_id + fb_page_post_count_final + fb_page_title_option + fb_page_description_option + fb_page_word_count_option + facebook_height_final + fb_feed_type + load_more_posts_style_final + facebook_grid + facebook_grid_space_between_posts + facebook_grid_colmn_width + center_container + image_stack_animation + facebook_popup + fts_hide_like_option + fts_like_option_align + fts_loadmore_button_width + fts_loadmore_btn_margin +']'; } <?php } else { if (is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php')) { include WP_CONTENT_DIR . '/plugins/feed-them-social-facebook-reviews/admin/js/facebook-page-settings-js.js'; ?> <?php } ?> if (albums_photos_option == "album_photos") { var final_fb_page_shortcode = '[fts facebook' + fb_page_id + fb_album_id + fb_feed_type + image_width + image_height + space_between_photos + hide_date_likes_comments + center_container + image_stack_animation + position_lr + position_top +']'; } else if (albums_photos_option == "albums") { var final_fb_page_shortcode = '[fts facebook' + fb_page_id + fb_feed_type + image_width + image_height + space_between_photos + hide_date_likes_comments + center_container + image_stack_animation + position_lr + position_top +']'; } else if (albums_photos_option == "page") { var final_fb_page_shortcode = '[fts facebook' + fb_page_id + fb_page_posts_displayed + facebook_height_final + fb_feed_type + ']'; } <?php if (is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php')) { include WP_CONTENT_DIR . '/plugins/feed-them-social-facebook-reviews/admin/js/facebook-page-reviews-js.js'; ?> <?php } ?> else { var final_fb_page_shortcode = '[fts facebook' + fb_page_id + facebook_height_final + fb_feed_type + ']'; } <?php } ?> jQuery('.facebook-page-final-shortcode').val(final_fb_page_shortcode); jQuery('.fb-page-shortcode-form .final-shortcode-textarea').slideDown(); } //END Facebook Page// //START Facebook Group// function updateTextArea_fb_group() { var fb_group_id = ' id=' + jQuery("input#fb_group_id").val(); // var fb_group_custom_name = ' custom_name=' + jQuery("select#fb_group_custom_name").val(); var facebook_height = jQuery("input#facebook_group_height").val(); if (fb_group_id == " id=") { jQuery(".fb_group_id").addClass('fts-empty-error'); jQuery("input#fb_group_id").focus(); return false; } if (fb_group_id != " id=") { jQuery(".fb_group_id").removeClass('fts-empty-error'); } if (facebook_height) { var facebook_height_final = ' height=' + jQuery("input#facebook_group_height").val(); } else { var facebook_height_final = ''; } <?php //Premium Plugin if (is_plugin_active('feed-them-premium/feed-them-premium.php')) { include WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/facebook-group-settings-js.js'; } else { ?> var final_fb_group_shorcode = '[fts facebook group' + fb_group_id + facebook_height_final + ' type=group]'; <?php } ?> jQuery('.facebook-group-final-shortcode').val(final_fb_group_shorcode); jQuery('.fb-group-shortcode-form .final-shortcode-textarea').slideDown(); } //END Facebook Group// //START Facebook List of Events// function updateTextArea_fb_list_of_events() { var fb_event_id = ' id=' + jQuery("input#fb_page_list_of_events_id").val(); var facebook_height = jQuery("input#facebook_event_height").val(); if (fb_event_id == " id=") { jQuery(".fb_page_list_of_events_id").addClass('fts-empty-error'); jQuery("input#fb_page_list_of_events_id").focus(); return false; } if (fb_event_id != " id=") { jQuery(".fb_page_list_of_events_id").removeClass('fts-empty-error'); } if (facebook_height) { var facebook_height_final = ' height=' + jQuery("input#facebook_event_height").val(); } else { var facebook_height_final = ''; } <?php //Premium Plugin if (is_plugin_active('feed-them-premium/feed-them-premium.php')) { include WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/facebook-event-settings-js.js'; } else { ?> var final_fb_event_shorcode = '[fts facebook event' + fb_event_id + facebook_height_final + ' type=event]'; <?php } ?> jQuery('.facebook-list-of-events-final-shortcode').val(final_fb_event_shorcode); jQuery('.fb-event-shortcode-form .final-shortcode-textarea').slideDown(); } //END Facebook List of Events// //START Facebook Single Event// function updateTextArea_fb_event() { var fb_event_id = ' id=' + jQuery("input#fb_event_id").val(); var facebook_height = jQuery("input#facebook_event_height").val(); if (fb_event_id == " id=") { jQuery(".fb_event_id").addClass('fts-empty-error'); jQuery("input#fb_event_id").focus(); return false; } if (fb_event_id != " id=") { jQuery(".fb_event_id").removeClass('fts-empty-error'); } if (facebook_height) { var facebook_height_final = ' height=' + jQuery("input#facebook_event_height").val(); } else { var facebook_height_final = ''; } <?php //Premium Plugin if (is_plugin_active('feed-them-premium/feed-them-premium.php')) { include WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/facebook-event-settings-js.js'; } else { ?> var final_fb_event_shorcode = '[fts facebook event' + fb_event_id + facebook_height_final + ' type=event]'; <?php } ?> jQuery('.facebook-event-final-shortcode').val(final_fb_event_shorcode); jQuery('.fb-event-shortcode-form .final-shortcode-textarea').slideDown(); } //END Facebook Single Event// //START Twitter// function updateTextArea_twitter() { var twitter_name = jQuery("input#twitter_name").val(); var twitter_search = jQuery("input#twitter_hashtag_etc_name").val(); var twitter_height = jQuery("input#twitter_height").val(); jQuery('#twitter-messages-selector').bind('change', function (e) { if( jQuery('#twitter-messages-selector').val() == 'hashtag') { jQuery(".twitter_name").removeClass('fts-empty-error'); } }); if (twitter_name == "" && jQuery('#twitter-messages-selector').val() !== 'hashtag') { jQuery(".twitter_name").addClass('fts-empty-error'); jQuery("input#twitter_name").focus(); return false; } else if (twitter_name != "") { jQuery(".twitter_name").removeClass('fts-empty-error'); var twitter_name = ' twitter_name=' + jQuery("input#twitter_name").val(); } if (twitter_search == "" && jQuery('#twitter-messages-selector').val() == 'hashtag') { jQuery(".twitter_hashtag_etc_name").addClass('fts-empty-error'); jQuery("input#twitter_hashtag_etc_name").focus(); return false; } else if (twitter_search != "" && jQuery('#twitter-messages-selector').val() == 'hashtag') { jQuery(".twitter_search").removeClass('fts-empty-error'); var twitter_search_final = ' search=' + jQuery("input#twitter_hashtag_etc_name").val(); } else { var twitter_search_final = ''; } if (twitter_height) { var twitter_height_final = ' twitter_height=' + jQuery("input#twitter_height").val(); } else { var twitter_height_final = ''; } <?php if (is_plugin_active('feed-them-premium/feed-them-premium.php')) { include WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/twitter-settings-js.js'; } else { ?> var final_twitter_shorcode = '[fts twitter' + twitter_name + twitter_search_final + twitter_height_final + ']'; <?php } ?> jQuery('.twitter-final-shortcode').val(final_twitter_shorcode); jQuery('.twitter-shortcode-form .final-shortcode-textarea').slideDown(); } //END Twitter// //START Vine// function updateTextArea_vine() { var vine_id = ' id=' + jQuery("input#vine_id").val(); var vine_maxwidth = jQuery("input#vine_maxwidth").val(); var space_between_photos = jQuery("input#space_between_photos").val(); var round_thumb_corner_size = jQuery("input#round_thumb_corner_size").val(); if (vine_id == " id=") { jQuery(".vine_id").addClass('fts-empty-error'); jQuery("input#vine_id").focus(); return false; } if (vine_id != " id=") { jQuery(".vine_id").removeClass('fts-empty-error'); } if (vine_maxwidth) { var vine_maxwidth = ' maxwidth=' + jQuery("input#vine_maxwidth").val(); } else { var vine_maxwidth = ' maxwidth=200px'; } if (space_between_photos) { var space_between_photos = ' space_between_photos=' + jQuery("input#space_between_photos").val(); } else { var round_thumb_corner_size = ''; } if (round_thumb_corner_size) { var round_thumb_corner_size = ' round_thumb_corner_size=' + jQuery("input#round_thumb_corner_size").val(); } else { var round_thumb_corner_size = ''; } <?php if (is_plugin_active('feed-them-premium/feed-them-premium.php') && file_exists(WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/vine-settings-js.js')) { include WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/vine-settings-js.js'; } else { ?> var final_vine_shorcode = '[fts vine' + vine_id + vine_maxwidth + space_between_photos + round_thumb_corner_size +']'; <?php } ?> jQuery('.vine-final-shortcode').val(final_vine_shorcode); jQuery('.vine-shortcode-form .final-shortcode-textarea').slideDown(); } //END Vine// //START Instagram// function updateTextArea_instagram() { var instagram_id = ' instagram_id=' + jQuery("input#instagram_id").val(); var instagram_page_height = jQuery("input#instagram_page_height").val(); var super_gallery = ' super_gallery=' + jQuery("select#instagram-custom-gallery").val(); var image_size = ' image_size=' + jQuery("input#fts-slicker-instagram-container-image-size").val(); var icon_size = ' icon_size=' + jQuery("input#fts-slicker-instagram-icon-center").val(); var space_between_photos = ' space_between_photos=' + jQuery("input#fts-slicker-instagram-container-margin").val(); var hide_date_likes_comments = ' hide_date_likes_comments=' + jQuery("select#fts-slicker-instagram-container-hide-date-likes-comments").val(); var center_container = ' center_container=' + jQuery("select#fts-slicker-instagram-container-position").val(); var image_stack_animation = ' image_stack_animation=' + jQuery("select#fts-slicker-instagram-container-animation").val(); var instagram_feed_type = ' type=' + jQuery("select#instagram-messages-selector").val(); var instagram_popup_option = ' popup=' + jQuery("select#instagram-popup-option").val(); if (instagram_id == " instagram_id=") { jQuery(".instagram_name").addClass('fts-empty-error'); jQuery("input#instagram_id").focus(); return false; } if (instagram_id != " instagram_id=") { jQuery(".instagram_name").removeClass('fts-empty-error'); } if (instagram_page_height != "") { var instagram_page_height_final = ' height=' + jQuery("input#instagram_page_height").val(); } else { var instagram_page_height_final = ''; } <?php //Premium Plugin if (is_plugin_active('feed-them-premium/feed-them-premium.php') && WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/vine-settings-js.js') { include WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/instagram-settings-js.js'; } else { ?> if (jQuery("select#instagram-custom-gallery").val() == "no") { var final_instagram_shorcode = '[fts instagram' + instagram_id + instagram_feed_type + instagram_page_height_final +']'; } else { var final_instagram_shorcode = '[fts instagram' + instagram_id + super_gallery + image_size + icon_size + space_between_photos + hide_date_likes_comments + center_container + image_stack_animation + instagram_feed_type + instagram_page_height_final +']'; } <?php } ?> jQuery('.instagram-final-shortcode').val(final_instagram_shorcode); jQuery('.instagram-shortcode-form .final-shortcode-textarea').slideDown(); } //END Instagram// //START convert Instagram name to id// function converter_instagram_username() { var convert_instagram_username = jQuery("input#convert_instagram_username").val(); if (convert_instagram_username == "") { jQuery(".convert_instagram_username").addClass('fts-empty-error'); jQuery("input#convert_instagram_username").focus(); return false; } if (convert_instagram_username != "") { jQuery(".convert_instagram_username").removeClass('fts-empty-error'); var username = jQuery("input#convert_instagram_username").val(); console.log(username); <?php $fts_instagram_tokens_array = array('9844495a8c4c4c51a7c519d0e7e8f293', 'aae62105cc314f62ab9bb3a3e4302dc8'); $fts_instagram_access_token = $fts_instagram_tokens_array[array_rand($fts_instagram_tokens_array, 1)]; ?> jQuery.getJSON("https://api.instagram.com/v1/users/search?q="+username+"&client_id=<?php echo $fts_instagram_access_token; ?> &callback=?", { format: "json" }, function(data) { console.log(data); var final_instagram_us_id = data.data[0].id; jQuery('#instagram_id').val(final_instagram_us_id); jQuery('.final-instagram-user-id-textarea').slideDown(); }); } } //select all jQuery(".copyme").focus(function() { var jQuerythis = jQuery(this); jQuerythis.select(); // Work around Chrome's little problem jQuerythis.mouseup(function() { // Prevent further mouseup intervention jQuerythis.unbind("mouseup"); return false; }); }); jQuery( document ).ready(function() { jQuery( ".toggle-custom-textarea-show" ).click(function() { jQuery('textarea#fts-color-options-main-wrapper-css-input').slideToggle(); jQuery('.toggle-custom-textarea-show span').toggle(); jQuery('.fts-custom-css-text').toggle(); }); <?php //show the js for the discount option under social icons on the settings page if (is_plugin_active('feed-them-premium/feed-them-premium.php')) { // do not show the js below } else { ?> jQuery( "#discount-for-review" ).click(function() { jQuery('.discount-review-text').slideToggle(); }); <?php } ?> }); //end document ready <?php //Premium JS if (is_plugin_active('feed-them-premium/feed-them-premium.php')) { include WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/youtube-settings-js.js'; } ?> </script> <?php }
function feed_them_facebook_options_page() { $fts_functions = new feed_them_social_functions(); ?> <div class="feed-them-social-admin-wrap"> <h1> <?php _e('Facebook Feed Options', 'feed-them-social'); ?> </h1> <div class="use-of-plugin"> <?php _e('Change the language, color and more for your facebook feed using the options below.', 'feed-them-social'); ?> </div> <!-- custom option for padding --> <form method="post" class="fts-facebook-feed-options-form" action="options.php"> <br/> <?php // get our registered settings from the fts functions settings_fields('fts-facebook-feed-style-options'); //Language select $fb_language = get_option('fb_language', 'en_US'); //share button $fb_show_follow_btn = get_option('fb_show_follow_btn'); $fb_show_follow_btn_where = get_option('fb_show_follow_btn_where'); $fb_show_follow_btn_profile_pic = get_option('fb_show_follow_btn_profile_pic'); $fb_like_btn_color = get_option('fb_like_btn_color', 'light'); $fb_hide_shared_by_etc_text = get_option('fb_hide_shared_by_etc_text'); $fb_hide_images_in_posts = get_option('fb_hide_images_in_posts'); $lang_options_array = json_decode($fts_functions->xml_json_parse('https://www.facebook.com/translations/FacebookLocales.xml')); //echo'<pre>'; // print_r($lang_options_array); //echo'</pre>'; ?> <div class="feed-them-social-admin-input-wrap"> <div class="fts-title-description-settings-page" style="padding-top:0; border:none;"> <h3> <?php _e('Language Options', 'feed-them-social'); ?> </h3> <?php _e('You must have your Facebook API Token saved at the bottom of this page before this feature will work. This option will translate the FB Titles and Like Button or Box Text. It will not tranlate your actual post. To tranlate the Feed Them Social parts of this plugin just set your language on the <a href="options-general.php" target="_blank">wordpress settings</a> page. If would like to help translate please visit our', 'feed-them-social'); ?> <a href="http://glotpress.slickremix.com/projects" target="_blank">GlottPress</a>. </div> <div class="feed-them-social-admin-input-label fts-twitter-text-color-label"> <?php _e('Language For Facebook Feeds', 'feed-them-social'); ?> </div> <select name="fb_language" id="fb-lang-btn" class="feed-them-social-admin-input"> <option value="en_US"> <?php _e('Please Select Option', 'feed-them-social'); ?> </option> <?php foreach ($lang_options_array->locale as $language) { echo '<option ' . selected($fb_language, $language->codes->code->standard->representation, true) . ' value="' . $language->codes->code->standard->representation . '">' . $language->englishName . '</option>'; } ?> </select> <div class="clear"></div> </div> <!--/fts-twitter-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="fts-title-description-settings-page"> <h3> <?php _e('Like Button or Box Options', 'feed-them-social'); ?> </h3> </div> <div class="feed-them-social-admin-input-label fts-twitter-text-color-label"> <?php _e('Show Follow Button', 'feed-them-social'); ?> </div> <select name="fb_show_follow_btn" id="fb-show-follow-btn" class="feed-them-social-admin-input"> <option> <?php _e('Please Select Option', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_show_follow_btn, 'dont-display', false); ?> value="dont-display"> <?php _e('Don\'t Display a Button', 'feed-them-social'); ?> </option> <optgroup label="Like Box"> <option <?php echo selected($fb_show_follow_btn, 'like-box', false); ?> value="like-box"> <?php _e('Like Box', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_show_follow_btn, 'like-box-faces', false); ?> value="like-box-faces"> <?php _e('Like Box with Faces', 'feed-them-social'); ?> </option> </optgroup> <optgroup label="Like Button"> <option <?php echo selected($fb_show_follow_btn, 'like-button', false); ?> value="like-button"> <?php _e('Like Button', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_show_follow_btn, 'like-button-share', false); ?> value="like-button-share"> <?php _e('Like Button and Share Button', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_show_follow_btn, 'like-button-faces', false); ?> value="like-button-faces"> <?php _e('Like Button with Faces', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_show_follow_btn, 'like-button-share-faces', false); ?> value="like-button-share-faces"> <?php _e('Like Button and Share Button with Faces', 'feed-them-social'); ?> </option> </optgroup> </select> <div class="clear"></div> </div> <!--/fts-twitter-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap" style="display:none"> <div class="feed-them-social-admin-input-label fts-twitter-text-color-label"> <?php _e('Show Profile Icon next to social option above', 'feed-them-social'); ?> </div> <select name="fb_show_follow_like_box_cover" id="fb-show-follow-like-box-cover" class="feed-them-social-admin-input"> <option> <?php _e('Please Select Option', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_show_follow_btn_profile_pic, 'fb_like_box_cover-yes', false); ?> value="fb_like_box_cover-yes"> <?php _e('Display Cover Photo in Like Box', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_show_follow_btn_profile_pic, 'fb_like_box_cover-no', false); ?> value="fb_like_box_cover-no"> <?php _e('Hide Cover Photo in Like Box', 'feed-them-social'); ?> </option> </select> <div class="clear"></div> </div> <!--/fts-twitter-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-twitter-text-color-label"> <?php _e('Like Button Color', 'feed-them-social'); ?> </div> <select name="fb_like_btn_color" id="fb-like-btn-color" class="feed-them-social-admin-input"> <option value="light"> <?php _e('Please Select Option', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_like_btn_color, 'light', false); ?> value="light"> <?php _e('Light', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_like_btn_color, 'dark', false); ?> value="dark"> <?php _e('Dark', 'feed-them-social'); ?> </option> </select> <div class="clear"></div> </div> <!--/fts-twitter-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-twitter-text-color-label"> <?php _e('Placement of the Button(s)', 'feed-them-social'); ?> </div> <select name="fb_show_follow_btn_where" id="fb-show-follow-btn-where" class="feed-them-social-admin-input"> <option value=""> <?php _e('Please Select Option', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_show_follow_btn_where, 'fb-like-top-above-title', false); ?> value="fb-like-top-above-title"> <?php _e('Show Top of Feed Above Title', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_show_follow_btn_where, 'fb-like-top-below-title', false); ?> value="fb-like-top-below-title"> <?php _e('Show Top of Feed Below Title', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_show_follow_btn_where, 'fb-like-below', false); ?> value="fb-like-below"> <?php _e('Show Botton of Feed', 'feed-them-social'); ?> </option> </select> <div class="clear"></div> </div> <!--/fts-twitter-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-twitter-text-color-label"> <?php _e('Facebook APP ID<br/><small>View Step 3 to <a href="http://www.slickremix.com/docs/create-facebook-app-id-or-user-token" target="_blank">get APP ID</a>.</small>', 'feed-them-social'); ?> </div> <input type="text" name="fb_app_ID" class="feed-them-social-admin-input" id="fb-app-ID" value="<?php echo get_option('fb_app_ID'); ?> "/> <div class="clear"></div> </div> <div class="feed-them-social-admin-input-wrap"> <div class="fts-title-description-settings-page" style="margin-top:0;"> <h3> <?php _e('Style Options', 'feed-them-social'); ?> </h3> </div> <div class="feed-them-social-admin-input-label fts-twitter-text-color-label"> <?php _e('Text after your FB name <br/><small>ie* Shared by or New Photo Added etc.</small>', 'feed-them-social'); ?> </div> <select name="fb_hide_shared_by_etc_text" id="fb_hide_shared_by_etc_text" class="feed-them-social-admin-input"> <option value=""> <?php _e('Please Select Option', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_hide_shared_by_etc_text, 'no', false); ?> value="no"> <?php _e('No', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_hide_shared_by_etc_text, 'yes', false); ?> value="yes"> <?php _e('Yes', 'feed-them-social'); ?> </option> </select> <div class="clear"></div> </div> <!--/fts-twitter-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-twitter-text-color-label"> <?php _e('Hide Images in Posts', 'feed-them-social'); ?> </div> <select name="fb_hide_images_in_posts" id="fb_hide_images_in_posts" class="feed-them-social-admin-input"> <option value=""> <?php _e('Please Select Option', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_hide_images_in_posts, 'no', false); ?> value="no"> <?php _e('No', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_hide_images_in_posts, 'yes', false); ?> value="yes"> <?php _e('Yes', 'feed-them-social'); ?> </option> </select> <div class="clear"></div> </div> <!--/fts-twitter-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-text-color-label"> <?php _e('Max-width for Images & Videos', 'feed-them-social'); ?> </div> <input type="text" name="fb_max_image_width" class="feed-them-social-admin-input" placeholder="500px" value="<?php echo get_option('fb_max_image_width'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-text-color-label"> <?php _e('Feed Header Extra Text Color', 'feed-them-social'); ?> </div> <input type="text" name="fb_header_extra_text_color" class="feed-them-social-admin-input fb-text-color-input color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="fb-text-color-input" placeholder="#222" value="<?php echo get_option('fb_header_extra_text_color'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-text-color-label"> <?php _e('Feed Text Color', 'feed-them-social'); ?> </div> <input type="text" name="fb_text_color" class="feed-them-social-admin-input fb-text-color-input color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="fb-text-color-input" placeholder="#222" value="<?php echo get_option('fb_text_color'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-link-color-label"> <?php _e('Feed Link Color', 'feed-them-social'); ?> </div> <input type="text" name="fb_link_color" class="feed-them-social-admin-input fb-link-color-input color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="fb-link-color-input" placeholder="#222" value="<?php echo get_option('fb_link_color'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-link-color-hover-label"> <?php _e('Feed Link Color Hover', 'feed-them-social'); ?> </div> <input type="text" name="fb_link_color_hover" class="feed-them-social-admin-input fb-link-color-hover-input color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="fb-link-color-hover-input" placeholder="#ddd" value="<?php echo get_option('fb_link_color_hover'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-feed-width-label"> <?php _e('Feed Width', 'feed-them-social'); ?> </div> <input type="text" name="fb_feed_width" class="feed-them-social-admin-input fb-feed-width-input" id="fb-feed-width-input" placeholder="500px" value="<?php echo get_option('fb_feed_width'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-feed-margin-label"> <?php _e('Feed Margin <br/><small>To center feed type auto</small>', 'feed-them-social'); ?> </div> <input type="text" name="fb_feed_margin" class="feed-them-social-admin-input fb-feed-margin-input" id="fb-feed-margin-input" placeholder="10px" value="<?php echo get_option('fb_feed_margin'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-feed-padding-label"> <?php _e('Feed Padding', 'feed-them-social'); ?> </div> <input type="text" name="fb_feed_padding" class="feed-them-social-admin-input fb-feed-padding-input" id="fb-feed-padding-input" placeholder="10px" value="<?php echo get_option('fb_feed_padding'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-feed-background-color-label"> <?php _e('Feed Background Color', 'feed-them-social'); ?> </div> <input type="text" name="fb_feed_background_color" class="feed-them-social-admin-input fb-feed-background-color-input color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="fb-feed-background-color-input" placeholder="#ddd" value="<?php echo get_option('fb_feed_background_color'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-grid-posts-background-color-label"> <?php _e('Feed Grid Posts Background Color (Grid style feeds ONLY)', 'feed-them-social'); ?> </div> <input type="text" name="fb_grid_posts_background_color" class="feed-them-social-admin-input fb-grid-posts-background-color-input color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="fb-grid-posts-background-color-input" placeholder="#ddd" value="<?php echo get_option('fb_grid_posts_background_color'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-border-bottom-color-label"> <?php _e('Feed Border Bottom Color', 'feed-them-social'); ?> </div> <input type="text" name="fb_border_bottom_color" class="feed-them-social-admin-input fb-border-bottom-color-input color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="fb-border-bottom-color-input" placeholder="#ddd" value="<?php echo get_option('fb_border_bottom_color'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="fts-title-description-settings-page"> <h3> <?php _e('Event Style Options', 'feed-them-social'); ?> </h3> <?php _e('The styles above still apply, these are just some extra options for the Event List feed.', 'feed-them-social'); ?> </div> <div class="feed-them-social-admin-input-label fb-events-title-color-label"> <?php _e('Events Feed: Title Color', 'feed-them-social'); ?> </div> <input type="text" name="fb_events_title_color" class="feed-them-social-admin-input fb-events-title-color color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="fb-events-title-color-input" placeholder="#ddd" value="<?php echo get_option('fb_events_title_color'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fb-events-title-size-label"> <?php _e('Events Feed: Title Size', 'feed-them-social'); ?> </div> <input type="text" name="fb_events_title_size" class="feed-them-social-admin-input fb-events-title-size" id="fb-events-title-color-input" placeholder="20px" value="<?php echo get_option('fb_events_title_size'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fb-events-map-link-color-label"> <?php _e('Events Feed: Map Link Color', 'feed-them-social'); ?> </div> <input type="text" name="fb_events_map_link_color" class="feed-them-social-admin-input fb-events-map-link-color color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="fb-events-map-link-color-input" placeholder="#ddd" value="<?php echo get_option('fb_events_map_link_color'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="fts-title-description-settings-page" style="margin-bottom:0px;"> <h3> <?php _e('Facebook API Token', 'feed-them-social'); ?> </h3> <?php _e('Facebook App Token works for all facebook feeds. Not required to make the feed work BUT an APP Token will stop the feed from returning the error, Are you sure this is a Facebook ID... See how to <a href="http://www.slickremix.com/docs/create-facebook-app-id-or-user-token" target="_blank">Get APP Token or Extended User Token</a>.', 'feed-them-social'); ?> </div> <?php $test_app_token_id = get_option('fts_facebook_custom_api_token'); $test_app_token_id_biz = get_option('fts_facebook_custom_api_token_biz'); if (!empty($test_app_token_id) || !empty($test_app_token_id_biz)) { $fts_fb_access_token = '226916994002335|ks3AFvyAOckiTA1u_aDoI4HYuuw'; $test_app_token_URL = array('app_token_id' => 'https://graph.facebook.com/debug_token?input_token=' . $test_app_token_id . '&access_token=' . $test_app_token_id); $test_app_token_URL_biz = array('app_token_id_biz' => 'https://graph.facebook.com/debug_token?input_token=' . $test_app_token_id_biz . '&access_token=' . $test_app_token_id_biz); //Test App ID // Leave these for reference: // App token for FTS APP2: 358962200939086|lyXQ5-zqXjvYSIgEf8mEhE9gZ_M // App token for FTS APP3: 705020102908771|rdaGxW9NK2caHCtFrulCZwJNPyY $test_app_token_response = $fts_functions->fts_get_feed_json($test_app_token_URL); $test_app_token_response = json_decode($test_app_token_response['app_token_id']); $test_app_token_response_biz = $fts_functions->fts_get_feed_json($test_app_token_URL_biz); $test_app_token_response_biz = json_decode($test_app_token_response_biz['app_token_id_biz']); } ?> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-twitter-border-bottom-color-label"> <?php _e('APP Token', 'feed-them-social'); ?> </div> <input type="text" name="fts_facebook_custom_api_token" class="feed-them-social-admin-input" id="fts_facebook_custom_api_token" value="<?php echo get_option('fts_facebook_custom_api_token'); ?> "/> <div class="clear"></div> </div> <?php if (!empty($test_app_token_response)) { if (isset($test_app_token_response->data->is_valid)) { echo '<div class="fts-successful-api-token">' . __('Your APP Token is working!', 'feed-them-social') . '</div>'; } if (isset($test_app_token_response->data->error->message) || isset($test_app_token_response->error->message)) { if (isset($test_app_token_response->data->error->message)) { echo '<div class="fts-failed-api-token">' . __('Oh No something\'s wrong.', 'feed-them-social') . ' ' . $test_app_token_response->data->error->message . '</div>'; } if (isset($test_app_token_response->error->message)) { echo '<div class="fts-failed-api-token">' . __('Oh No something\'s wrong.', 'feed-them-social') . ' ' . $test_app_token_response->error->message . '</div>'; } } } else { echo '<div class="fts-successful-api-token">' . __('You are using our Default APP Token.', 'feed-them-social') . '</div>'; } ?> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <?php if (is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php')) { ?> <div class="feed-them-social-admin-input-wrap"> <div class="fts-title-description-settings-page"> <h3> <?php _e('Reviews Style Options', 'feed-them-social'); ?> </h3> <?php _e('The styles above still apply, these are just some extra options for the Reviews List feed.', 'feed-them-social'); ?> </div> <div class="feed-them-social-admin-input-label fb-events-title-color-label"> <?php _e('Stars Background Color', 'feed-them-social'); ?> </div> <input type="text" name="fb_reviews_backg_color" class="feed-them-social-admin-input fb-reviews-backg-color color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="fb-reviews-backg-color" placeholder="#4791FF" value="<?php echo get_option('fb_reviews_backg_color'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fb-events-map-link-color-label"> <?php _e('Stars Text Color', 'feed-them-social'); ?> </div> <input type="text" name="fb_reviews_text_color" class="feed-them-social-admin-input fb-reviews-text-color color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="fb-reviews-text-color" placeholder="#fff" value="<?php echo get_option('fb_reviews_text_color'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="fts-title-description-settings-page" style="margin-bottom:0px;"> <h3> <?php _e('Facebook Page Reviews Access Token', 'feed-them-social'); ?> </h3> <?php _e('This Facebook Access Token works for the Reviews feed only. <a href="http://www.slickremix.com/facebook-never-expiring-page-token" target="_blank">Get your Page Access Token here</a>.', 'feed-them-social'); ?> </div> <div class="feed-them-social-admin-input-label fts-twitter-border-bottom-color-label"> <?php _e('Page Reviews Access Token', 'feed-them-social'); ?> </div> <input type="text" name="fts_facebook_custom_api_token_biz" class="feed-them-social-admin-input" id="fts_facebook_custom_api_token_biz" value="<?php echo get_option('fts_facebook_custom_api_token_biz'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <?php if (!empty($test_app_token_response_biz)) { if (isset($test_app_token_response_biz->data->is_valid)) { echo '<div class="fts-successful-api-token">' . __('Your Reviews Page Access Token is working!', 'feed-them-social') . '</div>'; } if (isset($test_app_token_response_biz->data->error->message) || isset($test_app_token_response_biz->error->message)) { if (isset($test_app_token_response_biz->data->error->message)) { echo '<div class="fts-failed-api-token">' . __('Oh No something\'s wrong.', 'feed-them-social') . ' ' . $test_app_token_response_biz->data->error->message . '</div>'; } if (isset($test_app_token_response_biz->error->message)) { echo '<div class="fts-failed-api-token">' . __('Oh No something\'s wrong.', 'feed-them-social') . ' ' . $test_app_token_response_biz->error->message . '</div>'; } } } else { echo '<div class="fts-successful-api-token">' . __('You are using our Default APP Token.', 'feed-them-social') . '</div>'; } } ?> <div class="clear"></div> <input type="submit" class="feed-them-social-admin-submit-btn" value="<?php _e('Save All Changes'); ?> " /> </form> <div class="clear"></div> <a class="feed-them-social-admin-slick-logo" href="http://www.slickremix.com" target="_blank"></a> </div> <!--/feed-them-social-admin-wrap--> <?php }
function fts_twitter_func($atts) { global $connection; $twitter_show_follow_btn = get_option('twitter_show_follow_btn'); $twitter_show_follow_btn_where = get_option('twitter_show_follow_btn_where'); $twitter_show_follow_count = get_option('twitter_show_follow_count'); include_once ABSPATH . 'wp-admin/includes/plugin.php'; //$fts_functions = new feed_them_social_functions; $twitter_allow_shortlink_conversion = get_option('twitter_allow_shortlink_conversion'); $twitter_allow_videos = get_option('twitter_allow_videos'); if (isset($twitter_allow_shortlink_conversion) && $twitter_allow_shortlink_conversion == 'yes' && isset($twitter_allow_shortlink_conversion) && $twitter_allow_shortlink_conversion == 'yes') { wp_enqueue_script('fts-longurl-js', plugins_url('feed-them-social/feeds/js/jquery.longurl.js')); } // option to allow this action or not from the Twitter Options page if (is_plugin_active('feed-them-premium/feed-them-premium.php')) { include WP_CONTENT_DIR . '/plugins/feed-them-premium/feeds/twitter/twitter-feed.php'; if ($popup == 'yes') { // it's ok if these styles & scripts load at the bottom of the page $fts_fix_magnific = get_option('fts_fix_magnific') ? get_option('fts_fix_magnific') : ''; if (isset($fts_fix_magnific) && $fts_fix_magnific !== '1') { wp_enqueue_style('fts-popup', plugins_url('feed-them-social/feeds/css/magnific-popup.css')); } wp_enqueue_script('fts-popup-js', plugins_url('feed-them-social/feeds/js/magnific-popup.js')); } } else { extract(shortcode_atts(array('twitter_name' => '', 'twitter_height' => '', 'description_image' => '', 'search' => ''), $atts)); $tweets_count = '5'; } ob_start(); $numTweets = $tweets_count; $name = $twitter_name; $excludeReplies = true; if (!empty($search)) { $data_cache = 'twitter_data_cache_' . $search . '_num' . $numTweets . ''; } else { $data_cache = 'twitter_data_cache_' . $name . '_num' . $numTweets . ''; } //Check Cache if (false !== ($transient_exists = $this->fts_check_feed_cache_exists($data_cache))) { $fetchedTweets = $this->fts_get_feed_cache($data_cache); $cache_used = true; } else { include_once WP_CONTENT_DIR . '/plugins/feed-them-social/feeds/twitter/twitteroauth/twitteroauth.php'; $fts_twitter_custom_consumer_key = get_option('fts_twitter_custom_consumer_key'); $fts_twitter_custom_consumer_secret = get_option('fts_twitter_custom_consumer_secret'); $fts_twitter_custom_access_token = get_option('fts_twitter_custom_access_token'); $fts_twitter_custom_access_token_secret = get_option('fts_twitter_custom_access_token_secret'); //Use custom api info if (!empty($fts_twitter_custom_consumer_key) && !empty($fts_twitter_custom_consumer_secret) && !empty($fts_twitter_custom_access_token) && !empty($fts_twitter_custom_access_token_secret)) { $connection = new TwitterOAuthFTS($fts_twitter_custom_consumer_key, $fts_twitter_custom_consumer_secret, $fts_twitter_custom_access_token, $fts_twitter_custom_access_token_secret); } else { $connection = new TwitterOAuthFTS('dOIIcGrhWgooKquMWWXg', 'qzAE4t4xXbsDyGIcJxabUz3n6fgqWlg8N02B6zM', '1184502104-Cjef1xpCPwPobP5X8bvgOTbwblsmeGGsmkBzwdB', 'd789TWA8uwwfBDjkU0iJNPDz1UenRPTeJXbmZZ4xjY'); } // $videosDecode = 'https://api.twitter.com/1.1/statuses/oembed.json?id=507185938620219395'; // If excluding replies, we need to fetch more than requested as the // total is fetched first, and then replies removed. $totalToFetch = $excludeReplies ? max(50, $numTweets * 3) : $numTweets; $description_image = !empty($description_image) ? $description_image : ""; // $url_of_status = !empty($url_of_status) ? $url_of_status : ""; // $widget_type_for_videos = !empty($widget_type_for_videos) ? $widget_type_for_videos : ""; if (!empty($search)) { $fetchedTweets = $connection->get('search/tweets', array('q' => $search, 'count' => $totalToFetch, 'result_type' => 'recent')); } else { $fetchedTweets = $connection->get('statuses/user_timeline', array('screen_name' => $name, 'count' => $totalToFetch, 'exclude_replies' => $excludeReplies, 'images' => $description_image)); } // echo'<pre>'; // print_r($fetchedTweets); // echo'</pre>'; if (!empty($search)) { $fetchedTweets = $fetchedTweets->statuses; } else { $fetchedTweets = $fetchedTweets; } // $screen_name = $q; } //END ELSE //Error Check if (isset($fetchedTweets->errors)) { $error_check = '<div>Oops, Somethings wrong. ' . $fetchedTweets->errors[0]->message . '.</div>'; if ($fetchedTweets->errors[0]->code == 32) { $error_check .= ' Please check that you have entered your Twitter API token information correctly.'; } if ($fetchedTweets->errors[0]->code == 34) { $error_check .= ' Please check the Twitter Username you have entered is correct.'; } } elseif (empty($fetchedTweets) && !isset($fetchedTweets->errors)) { $error_check = '<div>This account has no tweets. Please Tweet to see this feed.</div>'; } //IS RATE LIMIT REACHED? if (isset($fetchedTweets->errors)) { echo '<pre>'; print_r($fetchedTweets->errors); echo 'If you are seeing Rate Limited Exceeded please go to our Twitter Options page and follow the instructions under the header Twitter API Token.'; echo '</pre>'; } // Did the fetch fail? if (isset($error_check)) { echo $error_check; } else { if (!empty($fetchedTweets)) { //Cache It if (!isset($cache_used)) { $this->fts_create_feed_cache($data_cache, $fetchedTweets); } // Fetch succeeded. // Now update the array to store just what we need. // (Done here instead of PHP doing this for every page load) $limitToDisplay = min($numTweets, count($fetchedTweets)); for ($i = 0; $i < $limitToDisplay; $i++) { $tweet = $fetchedTweets[$i]; // Core info. $name = isset($tweet->user->name) ? $tweet->user->name : ""; $screen_name = isset($tweet->user->screen_name) ? $tweet->user->screen_name : ""; $protocol = isset($_SERVER["HTTPS"]) ? 'https://' : 'http://'; $not_protocol = !isset($_SERVER["HTTPS"]) ? 'https://' : 'http://'; $permalink = $protocol . 'twitter.com/' . $screen_name . '/status/' . $tweet->id_str; $user_permalink = $protocol . 'twitter.com/#!/' . $screen_name; //Is Media Set if (isset($tweet->entities->media[0]->media_url)) { $media_url = $tweet->entities->media[0]->media_url; $media_url = str_replace($not_protocol, $protocol, $media_url); } else { $media_url = ''; } // $widget_type_for_videos = $tweet->widget_type_for_videos; /* Alternative image sizes method: http://dev.twitter.com/doc/get/users/profile_image/:screen_name */ $image = isset($tweet->user->profile_image_url) ? $tweet->user->profile_image_url : ""; $image = str_replace($not_protocol, $protocol, $image); // Message. Convert links to real links. $pattern = array('/http:(\\S)+/', '/https:(\\S)+/', '/([^a-zA-Z0-9-_&])@([0-9a-zA-Z_]+)/', '/([^a-zA-Z0-9-_&])#([0-9a-zA-Z_]+)/'); $replace = array(' <a href="${0}" target="_blank" rel="nofollow">${0}</a>', ' <a href="${0}" target="_blank" rel="nofollow">${0}</a>', ' <a href="' . $protocol . 'twitter.com/$2" target="_blank" rel="nofollow">@$2</a>', ' <a href="' . $protocol . 'twitter.com/search?q=%23$2&src=hash" target="_blank" rel="nofollow">#$2</a>'); $text = preg_replace($pattern, $replace, $tweet->text); // Need to get time in Unix format. $times = isset($tweet->created_at) ? $tweet->created_at : ""; $ftsCustomDate = get_option('fts-custom-date'); $ftsCustomTime = get_option('fts-custom-time'); $CustomDateCheck = get_option('fts-date-and-time-format'); if ($ftsCustomDate == '' && $ftsCustomTime == '') { $CustomDateFormatTwitter = get_option('fts-date-and-time-format'); } else { if ($ftsCustomDate !== '' || $ftsCustomTime !== '') { $CustomDateFormatTwitter = get_option('fts-custom-date') . ' ' . get_option('fts-custom-time'); } else { $CustomDateFormatTwitter = 'F jS, Y \\a\\t g:ia'; } } date_default_timezone_set(get_option('fts-timezone')); if ($CustomDateCheck == 'one-day-ago') { $times = strtotime($times) - 3 * 3600; $date = date_create(date('F jS, Y g:ia', $times)); $timestamp = date_timestamp_get($date); $getFtsAgo = new feed_them_social_functions(); $uTime = $getFtsAgo->fts_ago($times); } else { $uTime = date($CustomDateFormatTwitter, strtotime($times) - 3 * 3600); } $id = isset($tweet->id) ? $tweet->id : ""; $fts_twitter_full_width = get_option('twitter_full_width'); $followers_count = isset($tweet->user->followers_count) ? $tweet->user->followers_count : ""; // $urls string is used so we can parse out video files $urls = isset($tweet->entities->urls[0]->expanded_url) ? $tweet->entities->urls[0]->expanded_url : ""; // Now make the new array. $tweets[] = array('text' => $text, 'name' => $name, 'screen_name' => $screen_name, 'user_permalink' => $user_permalink, 'permalink' => $permalink, 'image' => $image, 'time' => $uTime, 'media_url' => $media_url, 'id' => $id, 'urls' => $urls); } //End FOR fts-twitter-full-width // echo '<pre>'; // print_r($tweets); // echo '</pre>'; $twitter_allow_shortlink_conversion = get_option('twitter_allow_shortlink_conversion'); ?> <div id="twitter-feed-<?php print $twitter_name; ?> " class="fts-twitter-div<?php if ($twitter_height !== 'auto' && empty($twitter_height) == NULL) { ?> fts-twitter-scrollable<?php } if (isset($popup) && $popup == 'yes') { ?> popup-gallery-twitter<?php } ?> " <?php if ($twitter_height !== 'auto' && empty($twitter_height) == NULL) { ?> style="height:<?php echo $twitter_height; ?> "<?php } ?> > <?php //****************** // SOCIAL BUTTON //****************** if (!empty($search)) { $screen_name = $twitter_name; } if (isset($twitter_show_follow_btn) && $twitter_show_follow_btn == 'yes' && $twitter_show_follow_btn_where == 'twitter-follow-above' && $twitter_name !== '') { echo '<div class="twitter-social-btn-top">'; $this->social_follow_button('twitter', $screen_name); echo '</div>'; } // option to allow the followers plus count to show if (isset($twitter_show_follow_count) && $twitter_show_follow_count == 'yes' && $search == '') { print '<div class="twitter-followers-fts"><a href="' . $user_permalink . '" target="_blank" class="black">' . __('Followers:', 'feed-them-social') . '</a> ' . number_format($followers_count) . '</div>'; } ?> <?php foreach ($tweets as $t) { $twitter_allow_videos = get_option('twitter_allow_videos'); if (!empty($t['urls']) && $twitter_allow_videos !== 'no') { $type = 'twitterFeed'; $fts_dynamic_vid_name_string = trim($this->rand_string_twitter(10) . '_' . $type); $fts_dynamic_name = ''; if (isset($fts_dynamic_vid_name_string)) { $fts_dynamic_name = 'feed_dynamic_class' . $fts_dynamic_vid_name_string; } // ajax part $time = time(); $nonce = wp_create_nonce($time . "load-more-nonce"); ?> <script type="text/javascript"> jQuery(document).ready(function () { <?php // option to allow this action or not from the Twitter Options page if (isset($twitter_allow_shortlink_conversion) && $twitter_allow_shortlink_conversion == 'yes') { // API that converts shortlinks. longurlplease.com print 'jQuery.longurlplease();'; } ?> jQuery('.<?php echo $fts_dynamic_name; ?> a.fts-twitter-load-video').click(function(){ var fts_link = jQuery(this).attr('href'); var fts_security = "<?php echo $nonce; ?> "; var fts_post_id = "<?php echo $t['id']; ?> "; var fts_time = "<?php echo $time; ?> "; console.log('Submit Function'); jQuery.ajax({ data: {action: "fts_load_videos", fts_link: fts_link, fts_security: fts_security, fts_time: fts_time, fts_post_id: fts_post_id}, type: 'GET', url: myAjaxFTS, beforeSend: function() { jQuery('.<?php echo $fts_dynamic_name; ?> .fts-video-loading-notice').fadeIn(); }, success: function(data) { jQuery('.<?php echo $fts_dynamic_name; ?> .fts-video-loading-notice').hide(); jQuery('.<?php echo $fts_dynamic_name; ?> .fts-video-wrapper').append(data).filter('.<?php echo $fts_dynamic_name; ?> .fts-video-wrapper').html(); jQuery('a.<?php echo $fts_dynamic_name; ?> .twitter-video').hide(); jQuery('a.<?php echo $fts_dynamic_name; ?> ').hide(); jQuery('a.<?php echo $fts_dynamic_name; ?> .fts-close-media').show(); jQuery('.<?php echo $fts_dynamic_name; ?> .fts-video-wrapper-padding').slideDown(); console.log('Well Done and got this from sever: ' + data); } }); // end of ajax() return false; }) jQuery('.<?php echo $fts_dynamic_name; ?> .fts-close-media').click(function(){ jQuery('a.<?php echo $fts_dynamic_name; ?> .fts-close-media span.fts-show-media-text').toggle(); jQuery('a.<?php echo $fts_dynamic_name; ?> .fts-close-media span.fts-hide-media-text').toggle(); jQuery('.<?php echo $fts_dynamic_name; ?> .fts-video-wrapper-padding').slideToggle(); return false; }) }); </script> <?php } // END if not empty $t['urls'] $fts_dynamic_name = isset($fts_dynamic_name) ? $fts_dynamic_name : ''; ?> <div class="fts-tweeter-wrap <?php echo $fts_dynamic_name; ?> "> <div class="tweeter-info"> <?php if ($fts_twitter_full_width !== 'yes') { ?> <div class="fts-twitter-image"><a href="<?php print $t['user_permalink']; ?> " target="_blank" class="black"><img class="twitter-image" src="<?php print $t['image']; ?> " alt="<?php print $t['screen_name']; ?> "/></a></div> <?php } ?> <div class="<?php if ($fts_twitter_full_width == 'yes') { ?> fts-twitter-full-width<?php } else { ?> right<?php } ?> "> <div class="uppercase bold"><a href="<?php print $t['user_permalink']; ?> " target="_blank" class="black">@<?php print $t['screen_name']; ?> </a></div> <span class="time"><a href="<?php print $t['permalink']; ?> " target="_blank"><?php print $t['time']; ?> </a></span><br/> <span class="fts-twitter-text"><?php print nl2br($t['text']); ?> <div class="fts-twitter-caption"><a href="<?php print $t['permalink']; ?> " class="fts-view-on-twitter-link" target="_blank"><?php echo _e('View on Twitter', 'feed-them-social'); ?> </a></div> </span> <?php if ($t['media_url'] !== '') { ?> <a href="<?php if (isset($popup) && $popup == 'yes') { print $t['media_url']; } else { print $t['permalink']; } ?> " class="fts-twitter-link-image" target="_blank"><img class="fts-twitter-description-image" src="<?php print $t['media_url']; ?> " alt="<?php print $t['screen_name']; ?> photo" /></a> <?php } $tFinal = $t['urls']; $twitter_allow_videos = get_option('twitter_allow_videos'); if ($twitter_allow_videos !== 'no') { if (!empty($tFinal)) { // && strpos($tFinal, 'vimeo') > 0 || strpos($tFinal, 'amp.twimg.com') > 0 || strpos($tFinal, 'youtube') > 0 || strpos($tFinal, 'youtu.be') > 0 print '<div class="fts-video-wrapper-padding"><div class="fts-video-wrapper"></div></div>'; print '<div class="fts-video-show-hide-btns-wrap ' . $fts_dynamic_name . '_bts_wrap" style="display:none">'; print '<a href="' . $tFinal . '" class="fts-twitter-load-video-wrapper fts-twitter-load-video ' . $fts_dynamic_name . '" onclick="return false;">' . __('Show Media', 'feed-them-social') . '<span class="fts-video-loading-notice" style="display:none; ">' . __(', Loading...', 'feed-them-social') . '</span></a>'; print '<a href="' . $tFinal . '" class="fts-twitter-load-video-wrapper fts-close-media ' . $fts_dynamic_name . '" onclick="return false;"><span class="fts-hide-media-text">' . __('Hide Media', 'feed-them-social') . '</span><span class="fts-show-media-text">' . __('Show Media', 'feed-them-social') . '</span></a>'; print '</div>'; ?> <script type="text/javascript"> setTimeout(function() { var url = jQuery("a.fts-twitter-load-video-wrapper.<?php echo $fts_dynamic_name; ?> ").attr("href"); if (url.indexOf("soundcloud") >= 0 || url.indexOf("vine") >= 0 || url.indexOf("vimeo") >= 0 || url.indexOf("youtube") >= 0 || url.indexOf("youtu.be") >= 0 || url.indexOf("amp.twimg.com") >= 0 || url.indexOf("vine") >= 0 ) { if(url.indexOf("vimeo.com/blog/") >= 0 || url.indexOf("vimeo.com/ondemand/") >= 0 || url.indexOf("-youtube") >= 0 || url.indexOf("-vine") >= 0 || url.indexOf("-soundcloud") >= 0){ jQuery('.fts-video-show-hide-btns-wrap.<?php echo $fts_dynamic_name; ?> _bts_wrap').hide(); } else { jQuery('.fts-video-show-hide-btns-wrap.<?php echo $fts_dynamic_name; ?> _bts_wrap').show(); } } }, 1000); </script> <?php } } ?> </div> <div class="fts-twitter-reply-wrap"> <a href="<?php print $t['permalink']; ?> " target="_blank"> <div class="fts-twitter-reply"></div> </a></div> <div class="clear"></div> </div> </div> <?php } ?> <div class="clear"></div> </div> <?php if ($twitter_height !== 'auto' && empty($twitter_height) == NULL) { ?> <script> // this makes it so the page does not scroll if you reach the end of scroll bar or go back to top jQuery.fn.isolatedScrollTwitter = function() { this.bind('mousewheel DOMMouseScroll', function (e) { var delta = e.wheelDelta || (e.originalEvent && e.originalEvent.wheelDelta) || -e.detail, bottomOverflow = this.scrollTop + jQuery(this).outerHeight() - this.scrollHeight >= 0, topOverflow = this.scrollTop <= 0; if ((delta < 0 && bottomOverflow) || (delta > 0 && topOverflow)) { e.preventDefault(); } }); return this; }; jQuery('.fts-twitter-scrollable').isolatedScrollTwitter(); </script> <?php } } // END IF $fetchedTweets } //END ELSE //****************** // SOCIAL BUTTON //****************** if (isset($twitter_show_follow_btn) && $twitter_show_follow_btn == 'yes' && $twitter_show_follow_btn_where == 'twitter-follow-below' && $twitter_name !== '') { echo '<div class="twitter-social-btn-bottom">'; $this->social_follow_button('twitter', $screen_name); echo '</div>'; } return ob_get_clean(); }
{ // Localization load_plugin_textdomain('feed-them-social', false, basename(dirname(__FILE__)) . '/languages'); } // Add actions add_action('init', 'fts_action_init'); $fts_plugin_rel_url = plugin_dir_path(__FILE__); // Include admin include $fts_plugin_rel_url . 'updates/update-functions.php'; include $fts_plugin_rel_url . 'admin/feed-them-system-info.php'; include $fts_plugin_rel_url . 'admin/feed-them-settings-page.php'; include $fts_plugin_rel_url . 'admin/feed-them-facebook-style-options-page.php'; include $fts_plugin_rel_url . 'admin/feed-them-twitter-style-options-page.php'; // Include core files and classes include $fts_plugin_rel_url . 'includes/feed-them-functions.php'; $load_fts = new feed_them_social_functions(); $load_fts->fts_get_check_plugin_version('feed-them-premium.php', '1.3.0'); $load_fts->init(); // Include feeds include $fts_plugin_rel_url . 'feeds/facebook/facebook-feed.php'; new FTS_Facebook_Feed(); include $fts_plugin_rel_url . 'feeds/twitter/twitter-feed.php'; include $fts_plugin_rel_url . 'feeds/instagram/instagram-feed.php'; /** * Returns current plugin version. SRL added * * @return string Plugin version */ function ftsystem_version() { $plugin_data = get_plugin_data(__FILE__);
function feed_them_facebook_options_page() { $fts_functions = new feed_them_social_functions(); ?> <link href='http://fonts.googleapis.com/css?family=Rambla:400,700' rel='stylesheet' type='text/css'> <div class="feed-them-social-admin-wrap"> <h1><?php _e('Facebook Feed Options', 'feed-them-social'); ?> </h1> <div class="use-of-plugin"><?php _e('Change the color of your facebook feed and more using the options below.', 'feed-them-social'); ?> </div> <!-- custom option for padding --> <form method="post" class="fts-facebook-feed-options-form" action="options.php"><br/> <?php // get our registered settings from the fts functions settings_fields('fts-facebook-feed-style-options'); ?> <?php if (!is_plugin_active('feed-them-premium/feed-them-premium.php')) { $FB_style_options = array(__('Feed Text Color', 'feed-them-social'), __('Feed Link Color', 'feed-them-social'), __('Feed Link Color Hover', 'feed-them-social'), __('Feed Width', 'feed-them-social'), __('Feed Margin ', 'feed-them-social'), __('Feed Padding', 'feed-them-social'), __('Feed Background Color', 'feed-them-social'), __('Feed Grid Posts Background Color (Grid style feeds ONLY)', 'feed-them-social'), __('Feed Border Bottom Color', 'feed-them-social')); echo $fts_functions->need_fts_premium_fields($FB_style_options); } else { ?> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-text-color-label"><?php _e('Feed Text Color', 'feed-them-social'); ?> </div> <input type="text" name="fb_text_color" class="feed-them-social-admin-input fb-text-color-input color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="fb-text-color-input" placeholder="#222" value="<?php echo get_option('fb_text_color'); ?> "/> <div class="clear"></div> </div><!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-link-color-label"><?php _e('Feed Link Color', 'feed-them-social'); ?> </div> <input type="text" name="fb_link_color" class="feed-them-social-admin-input fb-link-color-input color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="fb-link-color-input" placeholder="#222" value="<?php echo get_option('fb_link_color'); ?> "/> <div class="clear"></div> </div><!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-link-color-hover-label"><?php _e('Feed Link Color Hover', 'feed-them-social'); ?> </div> <input type="text" name="fb_link_color_hover" class="feed-them-social-admin-input fb-link-color-hover-input color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="fb-link-color-hover-input" placeholder="#ddd" value="<?php echo get_option('fb_link_color_hover'); ?> "/> <div class="clear"></div> </div><!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-feed-width-label"><?php _e('Feed Width', 'feed-them-social'); ?> </div> <input type="text" name="fb_feed_width" class="feed-them-social-admin-input fb-feed-width-input" id="fb-feed-width-input" placeholder="500px" value="<?php echo get_option('fb_feed_width'); ?> "/> <div class="clear"></div> </div><!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-feed-margin-label"><?php _e('Feed Margin <br/><small>To center feed type auto</small>', 'feed-them-social'); ?> </div> <input type="text" name="fb_feed_margin" class="feed-them-social-admin-input fb-feed-margin-input" id="fb-feed-margin-input" placeholder="10px" value="<?php echo get_option('fb_feed_margin'); ?> "/> <div class="clear"></div> </div><!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-feed-padding-label"><?php _e('Feed Padding', 'feed-them-social'); ?> </div> <input type="text" name="fb_feed_padding" class="feed-them-social-admin-input fb-feed-padding-input" id="fb-feed-padding-input" placeholder="10px" value="<?php echo get_option('fb_feed_padding'); ?> "/> <div class="clear"></div> </div><!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-feed-background-color-label"><?php _e('Feed Background Color', 'feed-them-social'); ?> </div> <input type="text" name="fb_feed_background_color" class="feed-them-social-admin-input fb-feed-background-color-input color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="fb-feed-background-color-input" placeholder="#ddd" value="<?php echo get_option('fb_feed_background_color'); ?> "/> <div class="clear"></div> </div><!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-grid-posts-background-color-label"><?php _e('Feed Grid Posts Background Color (Grid style feeds ONLY)', 'feed-them-social'); ?> </div> <input type="text" name="fb_grid_posts_background_color" class="feed-them-social-admin-input fb-grid-posts-background-color-input color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="fb-grid-posts-background-color-input" placeholder="#ddd" value="<?php echo get_option('fb_grid_posts_background_color'); ?> "/> <div class="clear"></div> </div><!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-border-bottom-color-label"><?php _e('Feed Border Bottom Color', 'feed-them-social'); ?> </div> <input type="text" name="fb_border_bottom_color" class="feed-them-social-admin-input fb-border-bottom-color-input color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="fb-border-bottom-color-input" placeholder="#ddd" value="<?php echo get_option('fb_border_bottom_color'); ?> "/> <div class="clear"></div> </div><!--/fts-facebook-feed-styles-input-wrap--> <?php } //END IF PREMIUM ?> <h2><?php _e('Facebook API Token', 'feed-them-social'); ?> </h2> <?php $test_app_token_id = get_option('fts_facebook_custom_api_token'); if (!empty($test_app_token_id)) { $fts_fb_access_token = '226916994002335|ks3AFvyAOckiTA1u_aDoI4HYuuw'; $test_app_token_URL = array('app_token_id' => 'https://graph.facebook.com/debug_token?input_token=' . $test_app_token_id . '&access_token=' . $test_app_token_id); //Test App ID // Leave these for reference: // App token for FTS APP2: 358962200939086|lyXQ5-zqXjvYSIgEf8mEhE9gZ_M // App token for FTS APP3: 705020102908771|rdaGxW9NK2caHCtFrulCZwJNPyY $test_app_token_response = $fts_functions->fts_get_feed_json($test_app_token_URL); $test_app_token_response = json_decode($test_app_token_response['app_token_id']); } ?> <div class="fts-facebook-custom-api-token-label"><?php _e('Facebook App ID or User Token (for all facebook feeds). Not required to make the feed work. A User Token however will allow you to see certain post types that may be returning the message, Undefined Attachment. See how to <a href="http://www.slickremix.com/docs/create-facebook-app-id-or-user-token" target="_blank">GET APP ID or USER TOKEN</a>.', 'feed-them-social'); ?> </div> <div class="feed-them-social-admin-input-wrap" style="margin-bottom:0px;"> <div class="feed-them-social-admin-input-label fts-twitter-border-bottom-color-label"><?php _e('APP ID or Token optional', 'feed-them-social'); ?> </div> <input type="text" name="fts_facebook_custom_api_token" class="feed-them-social-admin-input" id="fts_facebook_custom_api_token" value="<?php echo get_option('fts_facebook_custom_api_token'); ?> "/> <div class="clear"></div> </div> <?php if (!empty($test_app_token_response)) { if (isset($test_app_token_response->data->is_valid)) { echo '<div class="fts-successful-api-token">' . __('Your access token is working!', 'feed-them-social') . '</div>'; } if (isset($test_app_token_response->data->error->message) || isset($test_app_token_response->error->message)) { if (isset($test_app_token_response->data->error->message)) { echo '<div class="fts-failed-api-token">' . __('Oh No something\'s wrong.', 'feed-them-social') . ' ' . $test_app_token_response->data->error->message . '</div>'; } if (isset($test_app_token_response->error->message)) { echo '<div class="fts-failed-api-token">' . __('Oh No something\'s wrong.', 'feed-them-social') . ' ' . $test_app_token_response->error->message . '</div>'; } } } else { echo '<div class="fts-successful-api-token">' . __('You are using our Default Access Token.', 'feed-them-social') . '</div>'; } ?> <div class="clear"></div> <input type="submit" class="feed-them-social-admin-submit-btn" value="<?php _e('Save All Changes'); ?> " /> </form> <a class="feed-them-social-admin-slick-logo" href="http://www.slickremix.com" target="_blank"></a> </div><!--/feed-them-social-admin-wrap--> <?php }
function feed_post_types($set_zero, $FBtype, $post_data, $FB_Shortcode, $response_post_array, $single_event_array_response = null) { //Reviews Plugin if (is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php')) { $FTS_Facebook_Reviews = new FTS_Facebook_Reviews(); } $fts_dynamic_vid_name_string = trim($this->rand_string(10) . '_' . $FB_Shortcode['type']); if ($set_zero == $FB_Shortcode['posts']) { return; } //Create Facebook Variables $FBfinalstory = ''; $first_dir = ''; $FBpicture = isset($post_data->picture) ? $post_data->picture : ""; $FBlink = isset($post_data->link) ? $post_data->link : ""; $FBname = isset($post_data->name) ? $post_data->name : ''; $FBcaption = isset($post_data->caption) ? $post_data->caption : ""; $FBmessage = isset($post_data->message) ? $post_data->message : (isset($post_data->review_text) ? $post_data->review_text : '') . ''; $FBdescription = isset($post_data->description) ? $post_data->description : ""; $FBstory = isset($post_data->story) ? $post_data->story : ""; $FBicon = isset($post_data->icon) ? $post_data->icon : ""; $FBby = isset($post_data->properties->text) ? $post_data->properties->text : ""; $FBbylink = isset($post_data->properties->href) ? $post_data->properties->href : ""; $FBpost_share_count = isset($post_data->shares->count) ? $post_data->shares->count : ""; $FBpost_like_count_array = isset($post_data->likes->data) ? $post_data->likes->data : ""; $FBpost_comments_count_array = isset($post_data->comments->data) ? $post_data->comments->data : ""; $FBpost_object_id = isset($post_data->object_id) ? $post_data->object_id : ""; $FBalbum_photo_count = isset($post_data->count) ? $post_data->count : ""; $FBalbum_cover = isset($post_data->cover_photo->id) ? $post_data->cover_photo->id : ""; // youtube and vimeo embed url $FBvideo_embed = isset($post_data->source) ? $post_data->source : ""; $FBvideo = isset($post_data->embed_html) ? $post_data->embed_html : ""; $FBvideoPicture = isset($post_data->format[2]->picture) ? $post_data->format[2]->picture : ""; if ($FBalbum_cover) { $photo_data = json_decode($response_post_array[$FBalbum_cover . '_photo']); } if (isset($post_data->id)) { $FBpost_id = $post_data->id; $FBpost_full_ID = explode('_', $FBpost_id); if (isset($FBpost_full_ID[0])) { $FBpost_user_id = $FBpost_full_ID[0]; } if (isset($FBpost_full_ID[1])) { $FBpost_single_id = $FBpost_full_ID[1]; } } if ($FB_Shortcode['type'] == 'albums' && !$FBalbum_cover) { unset($post_data); continue; } //Create Post Data Key if (isset($post_data->object_id)) { $post_data_key = $post_data->object_id; } else { $post_data_key = $post_data->id; } //Count Likes/Shares/ $lcs_array = $this->get_likes_shares_comments($response_post_array, $post_data_key, $FBpost_share_count); $FBlocation = isset($post_data->location) ? $post_data->location : ""; $FBembed_vid = isset($post_data->embed_html) ? $post_data->embed_html : ""; $FBfromName = isset($post_data->from->name) ? $post_data->from->name : ""; $FBfromName = preg_quote($FBfromName, "/"); $FBstory = isset($post_data->story) ? $post_data->story : ""; $ftsCustomDate = get_option('fts-custom-date'); $ftsCustomTime = get_option('fts-custom-time'); $CustomDateCheck = get_option('fts-date-and-time-format'); if ($ftsCustomDate == '' && $ftsCustomTime == '') { $CustomDateFormat = get_option('fts-date-and-time-format'); } else { if ($ftsCustomDate !== '' || $ftsCustomTime !== '') { $CustomDateFormat = get_option('fts-custom-date') . ' ' . get_option('fts-custom-time'); } else { $CustomDateFormat = 'F jS, Y \\a\\t g:ia'; } } $createdTime = isset($post_data->created_time) ? $post_data->created_time : ''; $CustomTimeFormat = strtotime($createdTime); if (!empty($FBstory)) { $FBfinalstory = preg_replace('/\\b' . $FBfromName . 's*?\\b(?=([^"]*"[^"]*")*[^"]*$)/i', '', $FBstory, 1); } $FTS_FB_OUTPUT = ''; $fts_hide_photos_type = get_option('fb_hide_images_in_posts'); switch ($FBtype) { case 'video': $FTS_FB_OUTPUT .= '<div class="fts-jal-single-fb-post fts-fb-video-post-wrap" '; if (isset($FB_Shortcode['grid']) && $FB_Shortcode['grid'] == 'yes') { $FTS_FB_OUTPUT .= 'style="width:' . $FB_Shortcode['colmn_width'] . '; margin:' . $FB_Shortcode['space_between_posts'] . '"'; } $FTS_FB_OUTPUT .= '>'; break; case 'app': case 'cover': case 'profile': case 'mobile': case 'wall': case 'normal': case 'photo': $FTS_FB_OUTPUT .= '<div class="fts-jal-single-fb-post fts-fb-photo-post-wrap" '; if ($FB_Shortcode['type'] == 'album_photos' || $FB_Shortcode['type'] == 'albums') { $FTS_FB_OUTPUT .= 'style="width:' . $FB_Shortcode['image_width'] . ' !important; height:' . $FB_Shortcode['image_height'] . '!important; margin:' . $FB_Shortcode['space_between_photos'] . '!important"'; } if (isset($FB_Shortcode['grid']) && $FB_Shortcode['grid'] == 'yes') { $FTS_FB_OUTPUT .= 'style="width:' . $FB_Shortcode['colmn_width'] . '; margin:' . $FB_Shortcode['space_between_posts'] . '"'; } $FTS_FB_OUTPUT .= '>'; break; case 'album': default: $FTS_FB_OUTPUT .= '<div class="fts-jal-single-fb-post" '; if (isset($FB_Shortcode['grid']) && $FB_Shortcode['grid'] == 'yes') { $FTS_FB_OUTPUT .= 'style="width:' . $FB_Shortcode['colmn_width'] . '; margin:' . $FB_Shortcode['space_between_posts'] . '"'; } $FTS_FB_OUTPUT .= '>'; break; } //output Single Post Wrap //Don't $FTS_FB_OUTPUT .= if Events Feed if ($FB_Shortcode['type'] !== 'events') { //Right Wrap $FTS_FB_OUTPUT .= '<div class="fts-jal-fb-right-wrap">'; //Top Wrap (Exluding : albums, album_photos, and hiding) $FTS_FB_OUTPUT .= $FB_Shortcode['type'] == 'album_photos' && $FB_Shortcode['hide_date_likes_comments'] == 'yes' || $FB_Shortcode['type'] == 'albums' && $FB_Shortcode['hide_date_likes_comments'] == 'yes' ? '' : '<div class="fts-jal-fb-top-wrap">'; //User Thumbnail $FTS_FB_OUTPUT .= '<div class="fts-jal-fb-user-thumb">'; $FTS_FB_OUTPUT .= '<a href="http://facebook.com/' . ($FB_Shortcode['type'] == 'reviews' ? $post_data->reviewer->id : $post_data->from->id) . '" target="_blank"><img border="0" alt="' . ($FB_Shortcode['type'] == 'reviews' ? $post_data->reviewer->name : $post_data->from->name) . '" src="https://graph.facebook.com/' . ($FB_Shortcode['type'] == 'reviews' ? $post_data->reviewer->id : $post_data->from->id) . '/picture"/></a>'; $FTS_FB_OUTPUT .= '</div>'; if ($FB_Shortcode['type'] == 'album_photos' && $FB_Shortcode['hide_date_likes_comments'] == 'yes' || $FB_Shortcode['type'] == 'albums' && $FB_Shortcode['hide_date_likes_comments'] == 'yes') { } else { date_default_timezone_set(get_option('fts-timezone')); $fb_hide_shared_by_etc_text = get_option('fb_hide_shared_by_etc_text'); $fb_hide_shared_by_etc_text = isset($fb_hide_shared_by_etc_text) && $fb_hide_shared_by_etc_text == 'no' ? '' : $FBfinalstory; //UserName $FTS_FB_OUTPUT .= $FB_Shortcode['type'] == 'reviews' && is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php') ? '<span class="fts-jal-fb-user-name"><a href="http://facebook.com/' . $post_data->reviewer->id . '/" target="_blank">' . $post_data->reviewer->name . '</a>' . $FTS_Facebook_Reviews->reviews_rating_format($FB_Shortcode, $post_data->rating) . '</span>' : '<span class="fts-jal-fb-user-name"><a href="http://facebook.com/profile.php?id=' . $post_data->from->id . '" target="_blank">' . $post_data->from->name . '</a>' . $fb_hide_shared_by_etc_text . '</span>'; // custom one day ago check if ($CustomDateCheck == 'one-day-ago') { $date = date_create(date('F jS, Y g:ia', $CustomTimeFormat)); $timestamp = date_timestamp_get($date); $getFtsAgo = new feed_them_social_functions(); $fts_final_date = $getFtsAgo->fts_ago($timestamp); } else { $fts_final_date = date($CustomDateFormat, $CustomTimeFormat); } //PostTime $FTS_FB_OUTPUT .= '<span class="fts-jal-fb-post-time">' . $fts_final_date . '</span><div class="clear"></div>'; //Comments Count $FBpost_id_final = substr($FBpost_id, strpos($FBpost_id, "_") + 1); //filter messages to have urls //Output Message if ($FBmessage) { // here we trim the words for the premium version. The $FB_Shortcode['words'] string actually comes from the javascript if (is_plugin_active('feed-them-premium/feed-them-premium.php') && array_key_exists('words', $FB_Shortcode) || is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php') && array_key_exists('words', $FB_Shortcode)) { $more = isset($more) ? $more : ""; $trimmed_content = $this->fts_custom_trim_words($FBmessage, $FB_Shortcode['words'], $more); $FTS_FB_OUTPUT .= !empty($trimmed_content) ? '<div class="fts-jal-fb-message">' . $trimmed_content . '</div><div class="clear"></div>' : ''; //If POPUP //$FTS_FB_OUTPUT .= $FB_Shortcode['popup'] == 'yes' ? '<div class="fts-fb-caption"><a href="'.$FBlink.'" class="fts-view-on-facebook-link" target="_blank">'.__('View on Facebook', 'feed-them-social').'</a></div> ' : ''; } else { $FB_final_message = $this->fts_facebook_tag_filter($FBmessage); $FTS_FB_OUTPUT .= '<div class="fts-jal-fb-message">'; $FTS_FB_OUTPUT .= nl2br($FB_final_message); //If POPUP // $FTS_FB_OUTPUT .= $FB_Shortcode['popup'] == 'yes' ? '<div class="fts-fb-caption"><a href="'.$FBlink.'" class="fts-view-on-facebook-link" target="_blank">'.__('View on Facebook', 'feed-them-social').'</a></div> ' : ''; $FTS_FB_OUTPUT .= '<div class="clear"></div></div> '; } } elseif (!$FBmessage && $FB_Shortcode['type'] == 'album_photos' || !$FBmessage && $FB_Shortcode['type'] == 'albums') { $FTS_FB_OUTPUT .= '<div class="fts-jal-fb-description-wrap">'; $FTS_FB_OUTPUT .= $FBname ? $this->fts_facebook_post_desc($FBname, $FB_Shortcode, $FBtype, NULL, $FBby) : ''; //Output Photo Caption $FTS_FB_OUTPUT .= $FBcaption ? $this->fts_facebook_post_cap($FBcaption, $FB_Shortcode, $FBtype) : ''; //Photo Count $FTS_FB_OUTPUT .= $FBalbum_photo_count ? $FBalbum_photo_count . ' Photos' : ''; //Location $FTS_FB_OUTPUT .= $FBlocation ? $this->fts_facebook_location($FBtype, $FBlocation) : ''; //Output Photo Description $FTS_FB_OUTPUT .= $FBdescription ? $this->fts_facebook_post_desc($FBdescription, $FB_Shortcode, $FBtype, NULL, $FBby) : ''; //Output Photo Description if (isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'yes') { $FTS_FB_OUTPUT .= '<div class="fts-fb-caption fts-fb-album-view-link" style="display:block;">'; if ($FBalbum_cover) { $FTS_FB_OUTPUT .= '<a href="https://graph.facebook.com/' . $FBalbum_cover . '/picture" class="fts-view-album-photos-large" target="_blank">' . __('View Photo', 'feed-them-social') . '</a></div>'; } elseif (isset($FB_Shortcode['video_album']) && $FB_Shortcode['video_album'] == 'yes') { if ($FB_Shortcode['play_btn'] !== 'yes') { $FTS_FB_OUTPUT .= '<a href="' . $post_data->source . '" data-poster="' . $post_data->format[3]->picture . '" id="fts-view-vid1-' . $fts_dynamic_vid_name_string . '" class="fts-view-fb-videos-large fts-view-fb-videos-btn fb-video-popup-' . $fts_dynamic_vid_name_string . '">' . __('View Video', 'feed-them-social') . '</a>'; } $FTS_FB_OUTPUT .= '</div>'; } else { $FTS_FB_OUTPUT .= '<a href="https://graph.facebook.com/' . $FBpost_id . '/picture" class="fts-view-album-photos-large" target="_blank">' . __('View Photo', 'feed-them-social') . '</a></div>'; } $FTS_FB_OUTPUT .= '<div class="fts-fb-caption"><a class="view-on-facebook-albums-link" href="' . $FBlink . '" target="_blank">' . __('View on Facebook', 'feed-them-social') . '</a></div>'; } $FTS_FB_OUTPUT .= '<div class="clear"></div></div>'; } $FTS_FB_OUTPUT .= '</div>'; // end .fts-jal-fb-top-wrap } } //end if for show name date and comments //Post Type Build $fts_show_post = false; switch ($FBtype) { //************************************************** // START STATUS POST //************************************************** case 'status': // && !$FBpicture == '' makes it so the attachment unavailable message does not show up if (!$FBpicture && !$FBname && !$FBdescription && !$FBpicture == '') { $FTS_FB_OUTPUT .= '<div class="fts-jal-fb-link-wrap">'; //Output Link Picture $FTS_FB_OUTPUT .= $FBpicture ? $this->fts_facebook_post_photo($FBlink, $FB_Shortcode, $post_data->from->name, $post_data->picture) : ''; if ($FBname || $FBcaption || $FBdescription) { $FTS_FB_OUTPUT .= '<div class="fts-jal-fb-description-wrap">'; //Output Link Name $FTS_FB_OUTPUT .= $FBname ? $this->fts_facebook_post_name($FBlink, $FBname, $FBtype) : ''; //Output Link Caption if ($FBcaption == 'Attachment Unavailable. This attachment may have been removed or the person who shared it may not have permission to share it with you.') { $FTS_FB_OUTPUT .= '<div class="fts-jal-fb-caption" style="width:100% !important">'; _e('This user\'s permissions are keeping you from seeing this post. Please Click "View on Facebook" to view this post on this group\'s facebook wall.', 'feed-them-social'); $FTS_FB_OUTPUT .= '</div>'; } else { $FTS_FB_OUTPUT .= $this->fts_facebook_post_cap($FBcaption, $FB_Shortcode, $FBtype); } //Output Link Description $FTS_FB_OUTPUT .= $FBdescription ? $this->fts_facebook_post_desc($FBdescription, $FB_Shortcode, $FBtype) : ''; $FTS_FB_OUTPUT .= '<div class="clear"></div></div>'; } $FTS_FB_OUTPUT .= '<div class="clear"></div></div>'; } break; //************************************************** // Start Multiple Events //************************************************** //************************************************** // Start Multiple Events //************************************************** case 'events': $single_event_id = $post_data->id; $single_event_info = json_decode($single_event_array_response['event_single_' . $single_event_id . '_info']); $single_event_location = json_decode($single_event_array_response['event_single_' . $single_event_id . '_location']); $single_event_cover_photo = json_decode($single_event_array_response['event_single_' . $single_event_id . '_cover_photo']); //echo'<pre>'; //print_r($single_event_info); //echo'</pre>'; //Event Cover Photo $event_cover_photo = isset($single_event_cover_photo->cover->source) ? $single_event_cover_photo->cover->source : ""; $event_description = isset($single_event_info->description) ? $single_event_info->description : ""; $FTS_FB_OUTPUT .= '<div class="fts-jal-fb-right-wrap fts-events-list-wrap">'; //Link Picture $FB_event_name = isset($single_event_info->name) ? $single_event_info->name : ""; $FB_event_location = isset($single_event_location->place->name) ? $single_event_location->place->name : ""; $FB_event_city = isset($single_event_location->place->location->city) ? $single_event_location->place->location->city . ', ' : ""; $FB_event_state = isset($single_event_location->place->location->state) ? $single_event_location->place->location->state : ""; $FB_event_street = isset($single_event_location->place->location->street) ? $single_event_location->place->location->street : ""; $FB_event_zip = isset($single_event_location->place->location->zip) ? ' ' . $single_event_location->place->location->zip : ""; $FB_event_latitude = isset($single_event_location->place->location->latitude) ? $single_event_location->place->location->latitude : ""; $FB_event_longitude = isset($single_event_location->place->location->longitude) ? $single_event_location->place->location->longitude : ""; date_default_timezone_set(get_option('fts-timezone')); // custom one day ago check if ($CustomDateCheck == 'one-day-ago') { $FB_event_start_time = date('l, F jS, Y \\a\\t g:ia', strtotime($single_event_info->start_time)); } else { $FB_event_start_time = date($CustomDateFormat, strtotime($single_event_info->start_time)); } //Output Photo Description if (!empty($event_cover_photo)) { $FTS_FB_OUTPUT .= isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'yes' && is_plugin_active('feed-them-premium/feed-them-premium.php') ? '<a href="' . $event_cover_photo . '" class="fts-jal-fb-picture fts-fb-large-photo" target="_blank"><img class="fts-fb-event-photo" src="' . $event_cover_photo . '"></a>' : '<a href="http://facebook.com/events/' . $single_event_id . '" target="_blank" class="fts-jal-fb-picture fts-fb-large-photo"><img class="fts-fb-event-photo" src="' . $event_cover_photo . '" /></a>'; } $FTS_FB_OUTPUT .= '<div class="fts-jal-fb-message">'; //Link Name $FTS_FB_OUTPUT .= $FB_event_name ? $this->fts_facebook_post_name('http://facebook.com/events/' . $single_event_id . '', $FB_event_name, $FBtype) : ''; //Link Caption $FTS_FB_OUTPUT .= $FB_event_start_time ? '<div class="fts-fb-event-time">' . $FB_event_start_time . '</div>' : ''; //Link Description if (!empty($FB_event_location)) { $FTS_FB_OUTPUT .= '<div class="fts-fb-location"><span class="fts-fb-location-title">' . $FB_event_location . '</span>'; //Street Adress $FTS_FB_OUTPUT .= $FB_event_street; //City & State $FTS_FB_OUTPUT .= ($FB_event_city or $FB_event_state) ? '<br/>' . $FB_event_city . $FB_event_state . $FB_event_zip : ''; $FTS_FB_OUTPUT .= '</div>'; } //Get Directions if (!empty($FB_event_latitude) && !empty($FB_event_longitude)) { $FTS_FB_OUTPUT .= '<a target="_blank" class="fts-fb-get-directions" href="https://www.google.com/maps/dir/Current+Location/' . $FB_event_latitude . ',' . $FB_event_longitude . ' ">Get Directions</a>'; } if (!empty($single_event_ticket_info) && !empty($single_event_ticket_info)) { $FTS_FB_OUTPUT .= '<a target="_blank" class="fts-fb-ticket-info" href="' . $single_event_ticket_info->ticket_uri . '">Ticket Info</a>'; } //Output Message if (!empty($FB_Shortcode['words']) && $event_description && is_plugin_active('feed-them-premium/feed-them-premium.php')) { // here we trim the words for the premium version. The $FB_Shortcode['words'] string actually comes from the javascript $FTS_FB_OUTPUT .= $this->fts_facebook_post_desc($event_description, $FB_Shortcode, $FBtype, NULL, $FBby, $FB_Shortcode['type']); } else { $FTS_FB_OUTPUT .= $this->fts_facebook_post_desc($event_description, $FBtype, NULL, $FBby, $FB_Shortcode['type']); } $FTS_FB_OUTPUT .= '<div class="clear"></div></div>'; break; //************************************************** // START LINK POST //************************************************** //************************************************** // START LINK POST //************************************************** case 'link': $FTS_FB_OUTPUT .= '<div class="fts-jal-fb-link-wrap">'; //start url check $url = $FBlink; $url_parts = parse_url($url); $host = $url_parts['host']; if ($host == 'www.facebook.com') { $spliturl = $url_parts['path']; $path_components = explode('/', $spliturl); $first_dir = $path_components[1]; $event_id_number = isset($path_components[2]) && $path_components[2] ? $path_components[2] : ''; } //end url check if ($host == 'www.facebook.com' and $first_dir == 'events') { $event_url = 'https://graph.facebook.com/' . $event_id_number . '/?access_token=' . $access_token . ''; $event_data = json_decode(file_get_contents($event_url)); $FB_event_name = isset($event_data->name) ? $event_data->name : ""; $FB_event_location = isset($event_data->location) ? $event_data->location : ""; $FB_event_city = isset($event_data->venue->city) ? $event_data->venue->city : ""; $FB_event_state = isset($event_data->venue->state) ? $event_data->venue->state : ""; date_default_timezone_set(get_option('fts-timezone')); $date = date('Y-m-d'); // custom one day ago check if ($CustomDateCheck == 'one-day-ago') { $FB_event_start_time = date('l, F jS, Y \\a\\t g:ia', strtotime($event_data->start_time)); } else { $FB_event_start_time = date($CustomDateFormat, strtotime($event_data->start_time)); } //Link Wrap $FTS_FB_OUTPUT .= '<a href="' . $FBlink . '" target="_blank" class="fts-jal-fb-picture"><img class="fts-fb-event-photo" src="http://graph.facebook.com/' . $event_id_number . '/picture"></img></a>'; $FTS_FB_OUTPUT .= '<div class="fts-jal-fb-description-wrap">'; //Output Link Name $FTS_FB_OUTPUT .= $FB_event_name ? $this->fts_facebook_post_name($FBlink, $FB_event_name, $FBtype) : ''; //Output Link Caption $FTS_FB_OUTPUT .= $FB_event_start_time ? '<div class="fts-fb-event-time">' . $FB_event_start_time . '</div>' : ''; //Output Link Description if (!empty($FB_event_location)) { //Location $FTS_FB_OUTPUT .= '<div class="fts-fb-location">' . $FB_event_location; //City & State $FTS_FB_OUTPUT .= $FB_event_city || $FB_event_state ? ' in ' . $FB_event_city . ', ' . $FB_event_state . '' : ''; $FTS_FB_OUTPUT .= '</div>'; } $FTS_FB_OUTPUT .= '<div class="clear"></div></div>'; } //end if event //Output Link Picture $FTS_FB_OUTPUT .= $FBpicture ? $this->fts_facebook_post_photo($FBlink, $FB_Shortcode, $post_data->from->name, $post_data->picture) : ''; $FB_Shortcode['words'] = isset($FB_Shortcode['words']) ? $FB_Shortcode['words'] : ""; //Description Wrap $FTS_FB_OUTPUT .= '<div class="fts-jal-fb-description-wrap">'; //Output Link Name $FTS_FB_OUTPUT .= $FBname ? $this->fts_facebook_post_name($FBlink, $FBname, $FBtype) : ''; //Output Link Caption $FTS_FB_OUTPUT .= $FBcaption ? $this->fts_facebook_post_cap($FBcaption, $FB_Shortcode, $FBtype) : ''; //Output Link Description $FTS_FB_OUTPUT .= $FBdescription ? $this->fts_facebook_post_desc($FBdescription, $FB_Shortcode, $FBtype) : ''; $FTS_FB_OUTPUT .= '<div class="clear"></div></div>'; $FTS_FB_OUTPUT .= '<div class="clear"></div></div>'; break; //************************************************** // START VIDEO POST //************************************************** //************************************************** // START VIDEO POST //************************************************** case 'video': $video_data = json_decode($response_post_array[$post_data_key . '_video']); $FTS_FB_OUTPUT .= '<div class="fts-jal-fb-vid-wrap">'; if (!empty($FBpicture)) { if (strpos($FBvideo_embed, 'fbcdn') > 0 && !empty($video_data->format)) { if (!empty($video_data->format)) { foreach ($video_data->format as $video_data_format) { if ($video_data_format->filter == 'native') { $FTS_FB_OUTPUT .= '<div class="fts-fluid-videoWrapper-html5">'; $FTS_FB_OUTPUT .= '<video controls poster="' . $video_data_format->picture . '" width="100%;" style="max-width:100%;">'; $FTS_FB_OUTPUT .= '<source src="' . $video_data->source . '" type="video/mp4">'; $FTS_FB_OUTPUT .= '</video>'; $FTS_FB_OUTPUT .= '</div>'; } } $FTS_FB_OUTPUT .= '<div class="slicker-facebook-album-photoshadow"></div>'; } } else { if (strpos($FBvideo_embed, 'fbcdn') > 0 && empty($video_data->format)) { $fts_dynamic_vid_name_string = trim($this->rand_string(10) . '_' . $FB_Shortcode['type']); $fts_dynamic_vid_name = 'feed_dynamic_video_class' . $fts_dynamic_vid_name_string; $FTS_FB_OUTPUT .= '<div class="fts-jal-fb-vid-picture ' . $fts_dynamic_vid_name . '"><img border="0" alt="' . $post_data->from->name . '" src="' . $post_data->picture . '"/> <div class="fts-jal-fb-vid-play-btn"></div>'; $FTS_FB_OUTPUT .= '<div class="fts-fluid-videoWrapper-html5"><video id="' . $fts_dynamic_vid_name . '" controls width="100%;" style="max-width:100%;"><source src="" type="video/mp4"></video></div><div class="slicker-facebook-album-photoshadow"></div></div>'; $FTS_FB_OUTPUT .= '<script>jQuery(document).ready(function() {'; $FTS_FB_OUTPUT .= 'jQuery(".' . $fts_dynamic_vid_name . '").bind("click", function() {'; $FTS_FB_OUTPUT .= 'jQuery(this).addClass("fts-vid-div");'; $FTS_FB_OUTPUT .= 'if(jQuery(this).hasClass("fts-jal-fb-vid-picture")){var video = jQuery("#' . $fts_dynamic_vid_name . '"); video[0].src = "' . $video_data->source . '";video[0].load(); video[0].play();}'; $FTS_FB_OUTPUT .= 'jQuery(this).removeClass("fts-jal-fb-vid-picture"); '; if (isset($FB_Shortcode['grid']) && $FB_Shortcode['grid'] == 'yes') { $FTS_FB_OUTPUT .= 'jQuery(".fts-slicker-facebook-posts").masonry( "reloadItems");'; $FTS_FB_OUTPUT .= 'jQuery(".fts-slicker-facebook-posts").masonry( "layout" );'; } $FTS_FB_OUTPUT .= '});'; $FTS_FB_OUTPUT .= '});</script>'; } else { //Create Dynamic Class Name $fts_dynamic_vid_name_string = trim($this->rand_string(10) . '_' . $FB_Shortcode['type']); $fts_dynamic_vid_name = 'feed_dynamic_video_class' . $fts_dynamic_vid_name_string; $FTS_FB_OUTPUT .= '<div class="fts-jal-fb-vid-picture ' . $fts_dynamic_vid_name . '"><img border="0" alt="' . $post_data->from->name . '" src="' . $post_data->picture . '"/> <div class="fts-jal-fb-vid-play-btn"></div></div>'; // strip Youtube URL then ouput Iframe and script if (strpos($FBlink, 'youtube') > 0) { // $pattern = '#^(?:https?://)?(?:www\.)?(?:youtu\.be/|youtube\.com(?:/embed/|/v/|/watch\?v=|/watch\?.+&v=))([\w-]{11})(?:.+)?$#x'; // preg_match($pattern, $FBlink, $matches); // $youtubeURLfinal = $matches[1]; $FTS_FB_OUTPUT .= '<script>jQuery(document).ready(function() {'; $FTS_FB_OUTPUT .= 'jQuery(".' . $fts_dynamic_vid_name . '").click(function() {'; $FTS_FB_OUTPUT .= 'jQuery(this).addClass("fts-vid-div");'; $FTS_FB_OUTPUT .= 'jQuery(this).removeClass("fts-jal-fb-vid-picture");'; // $FTS_FB_OUTPUT .= 'jQuery(this).prepend(\'<div class="fts-fluid-videoWrapper"><iframe height="281" class="video'.$FBpost_id.'" src="https://www.youtube.com/embed/'.$youtubeURLfinal.'?autoplay=1" frameborder="0" allowfullscreen></iframe></div>\');'; $FTS_FB_OUTPUT .= 'jQuery(this).prepend(\'<div class="fts-fluid-videoWrapper"><iframe height="281" class="video' . $FBpost_id . '" src="' . $FBvideo_embed . '" frameborder="0" allowfullscreen></iframe></div>\');'; if (isset($FB_Shortcode['grid']) && $FB_Shortcode['grid'] == 'yes') { $FTS_FB_OUTPUT .= 'jQuery(".fts-slicker-facebook-posts").masonry( "reloadItems");'; $FTS_FB_OUTPUT .= 'jQuery(".fts-slicker-facebook-posts").masonry( "layout" );'; } $FTS_FB_OUTPUT .= '});'; $FTS_FB_OUTPUT .= '});</script>'; } else { if (strpos($FBlink, 'youtu.be') > 0) { // $pattern = '#^(?:https?://)?(?:www\.)?(?:youtu\.be/|youtube\.com(?:/embed/|/v/|/watch\?v=|/watch\?.+&v=))([\w-]{11})(?:.+)?$#x'; // preg_match($pattern, $FBlink, $matches); // $youtubeURLfinal = $matches[1]; $FTS_FB_OUTPUT .= '<script>'; $FTS_FB_OUTPUT .= 'jQuery(document).ready(function() {'; $FTS_FB_OUTPUT .= 'jQuery(".' . $fts_dynamic_vid_name . '").click(function() {'; $FTS_FB_OUTPUT .= 'jQuery(this).addClass("fts-vid-div");'; $FTS_FB_OUTPUT .= 'jQuery(this).removeClass("fts-jal-fb-vid-picture");'; // $FTS_FB_OUTPUT .= 'jQuery(this).prepend(\'<div class="fts-fluid-videoWrapper"><iframe height="281" class="video'.$FBpost_id.'" src="http://www.youtube.com/embed/'.$youtubeURLfinal.'?autoplay=1" frameborder="0" allowfullscreen></iframe></div>\');'; $FTS_FB_OUTPUT .= 'jQuery(this).prepend(\'<div class="fts-fluid-videoWrapper"><iframe height="281" class="video' . $FBpost_id . '" src="' . $FBvideo_embed . '" frameborder="0" allowfullscreen></iframe></div>\');'; if (isset($FB_Shortcode['grid']) && $FB_Shortcode['grid'] == 'yes') { $FTS_FB_OUTPUT .= 'jQuery(".fts-slicker-facebook-posts").masonry( "reloadItems");'; $FTS_FB_OUTPUT .= 'jQuery(".fts-slicker-facebook-posts").masonry( "layout" );'; } $FTS_FB_OUTPUT .= '});'; $FTS_FB_OUTPUT .= '});'; $FTS_FB_OUTPUT .= '</script>'; } else { if (strpos($FBlink, 'vimeo') > 0) { // $pattern = '/(\d+)/'; // preg_match($pattern, $FBlink, $matches); // $vimeoURLfinal = $matches[0]; $FTS_FB_OUTPUT .= '<script>'; $FTS_FB_OUTPUT .= 'jQuery(document).ready(function() {'; $FTS_FB_OUTPUT .= 'jQuery(".' . $fts_dynamic_vid_name . '").click(function() {'; $FTS_FB_OUTPUT .= 'jQuery(this).addClass("fts-vid-div");'; $FTS_FB_OUTPUT .= 'jQuery(this).removeClass("fts-jal-fb-vid-picture");'; // $FTS_FB_OUTPUT .= 'jQuery(this).prepend(\'<div class="fts-fluid-videoWrapper"><iframe src="http://player.vimeo.com/video/'.$vimeoURLfinal.'?autoplay=1" class="video'.$FBpost_id.'" height="390" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>\');'; $FTS_FB_OUTPUT .= 'jQuery(this).prepend(\'<div class="fts-fluid-videoWrapper"><iframe src="' . $FBvideo_embed . '" class="video' . $FBpost_id . '" height="390" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>\');'; if (isset($FB_Shortcode['grid']) && $FB_Shortcode['grid'] == 'yes') { $FTS_FB_OUTPUT .= 'jQuery(".fts-slicker-facebook-posts").masonry( "reloadItems");'; $FTS_FB_OUTPUT .= 'jQuery(".fts-slicker-facebook-posts").masonry( "layout" );'; } $FTS_FB_OUTPUT .= '});'; $FTS_FB_OUTPUT .= '});'; $FTS_FB_OUTPUT .= '</script>'; } else { if (strpos($FBlink, 'soundcloud') > 0) { //Get the SoundCloud URL $url = $FBlink; //Get the JSON data of song details with embed code from SoundCloud oEmbed $getValues = file_get_contents('http://soundcloud.com/oembed?format=js&url=' . $url . '&auto_play=true&iframe=true'); //Clean the Json to decode $decodeiFrame = substr($getValues, 1, -2); //json decode to convert it as an array $jsonObj = json_decode($decodeiFrame); //Change the height of the embed player if you want else uncomment below line // echo str_replace('height="400"', 'height="140"', $jsonObj->html); $FTS_FB_OUTPUT .= '<script>'; $FTS_FB_OUTPUT .= 'jQuery(document).ready(function() {'; $FTS_FB_OUTPUT .= 'jQuery(".' . $fts_dynamic_vid_name . '").click(function() {'; $FTS_FB_OUTPUT .= 'jQuery(this).addClass("fts-vid-div");'; $FTS_FB_OUTPUT .= 'jQuery(this).removeClass("fts-jal-fb-vid-picture");'; $FTS_FB_OUTPUT .= ' jQuery(this).prepend(\'<div class="fts-fluid-videoWrapper">' . $jsonObj->html . '</div>\');'; if (isset($FB_Shortcode['grid']) && $FB_Shortcode['grid'] == 'yes') { $FTS_FB_OUTPUT .= 'jQuery(".fts-slicker-facebook-posts").masonry( "reloadItems");'; $FTS_FB_OUTPUT .= 'jQuery(".fts-slicker-facebook-posts").masonry( "layout" );'; } $FTS_FB_OUTPUT .= '});'; $FTS_FB_OUTPUT .= '});'; $FTS_FB_OUTPUT .= '</script>'; } } } } } } } if ($FBname || $FBcaption || $FBdescription) { $FTS_FB_OUTPUT .= '<div class="fts-jal-fb-description-wrap fb-id' . $FBpost_id . '">'; //Output Video Name $FTS_FB_OUTPUT .= $FBname ? $this->fts_facebook_post_name($FBlink, $FBname, $FBtype, $FBpost_id) : ''; //Output Video Caption $FTS_FB_OUTPUT .= $FBcaption ? $this->fts_facebook_post_cap($FBcaption, $FB_Shortcode, $FBtype, $FBpost_id) : ''; //Output Video Description $FTS_FB_OUTPUT .= $FBdescription ? $this->fts_facebook_post_desc($FBdescription, $FB_Shortcode, $FBtype, $FBpost_id) : ''; $FTS_FB_OUTPUT .= '<div class="clear"></div></div>'; } $FTS_FB_OUTPUT .= '<div class="clear"></div></div>'; break; //************************************************** //START PHOTO POST //************************************************** //************************************************** //START PHOTO POST //************************************************** case 'photo': if (isset($fts_hide_photos_type) && $fts_hide_photos_type == 'yes' && $FB_Shortcode['type'] !== 'album_photos' && $FB_Shortcode['video_album'] !== 'yes') { break; } //Wrapping with if statement to prevent Notice on some facebook page feeds. if ($FB_Shortcode['type'] == 'group') { $photo_source = json_decode($response_post_array[$post_data_key . '_group_post_photo']); } //Group or page? $photo_source_final = isset($photo_source->full_picture) && $FB_Shortcode['type'] == 'group' ? $photo_source->full_picture : 'https://graph.facebook.com/' . $FBpost_object_id . '/picture'; $FTS_FB_OUTPUT .= '<div class="fts-jal-fb-link-wrap fts-album-photos-wrap"'; if ($FB_Shortcode['type'] == 'album_photos' || $FB_Shortcode['type'] == 'albums') { $FTS_FB_OUTPUT .= 'style="line-height:' . $FB_Shortcode['image_height'] . ' !important;"'; } $FTS_FB_OUTPUT .= '>'; $FTS_FB_OUTPUT .= isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'yes' ? '<div class="fts-fb-caption"><a href="' . $FBlink . '" class="fts-view-on-facebook-link" target="_blank">' . __('View on Facebook', 'feed-them-social') . '</a></div> ' : ''; //Output Photo Picture if ($FBpost_object_id) { if ($FBpost_object_id) { $FTS_FB_OUTPUT .= '<a href="' . (isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'yes' ? $photo_source_final : $FBlink) . '" target="_blank" class="fts-jal-fb-picture fts-fb-large-photo"><img border="0" alt="' . $post_data->from->name . '" src="' . $photo_source_final . '"></a>'; } else { $FTS_FB_OUTPUT .= '<a href="' . (isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'yes' ? $photo_source_final : $FBlink) . '" target="_blank" class="fts-jal-fb-picture fts-fb-large-photo"><img border="0" alt="' . $post_data->from->name . '" src="' . $photo_source_final . '"></a>'; } } elseif ($FBpicture) { if ($FBpost_object_id) { $FTS_FB_OUTPUT .= $this->fts_facebook_post_photo($FBlink, $FB_Shortcode, $post_data->from->name, 'https://graph.facebook.com/' . $FBpost_object_id . '/picture'); } else { $FTS_FB_OUTPUT .= isset($FB_Shortcode['video_album']) && $FB_Shortcode['video_album'] == 'yes' ? $this->fts_facebook_post_photo($FBlink, $FB_Shortcode, $post_data->from->name, $post_data->format[1]->picture) : $this->fts_facebook_post_photo($FBlink, $FB_Shortcode, $post_data->from->name, 'https://graph.facebook.com/' . $FBpost_id . '/picture/'); } } $FTS_FB_OUTPUT .= '<div class="slicker-facebook-album-photoshadow"></div>'; // FB Video play button for facebook videos. This button takes data from our a tag and along with additional js in the magnific-popup.js we can now load html5 videos. SO lightweight this way because no pre-loading of videos are on the page. We only show the posterboard on mobile devices because tablets and desktops will auto load the videos. SRL if (isset($FB_Shortcode['video_album']) && $FB_Shortcode['video_album'] == 'yes') { if ($FB_Shortcode['play_btn'] == 'yes') { $fb_play_btn_visible = isset($FB_Shortcode['play_btn_visible']) && $FB_Shortcode['play_btn_visible'] == 'yes' ? ' visible-video-button' : ''; $FTS_FB_OUTPUT .= '<a href="' . $post_data->source . '" data-poster="' . $post_data->format[3]->picture . '" id="fts-view-vid1-' . $fts_dynamic_vid_name_string . '" title="' . $FBdescription . '" class="fts-view-fb-videos-btn fb-video-popup-' . $fts_dynamic_vid_name_string . $fb_play_btn_visible . ' fts-slicker-backg" style="height:' . $FB_Shortcode['play_btn_size'] . ' !important; width:' . $FB_Shortcode['play_btn_size'] . '; line-height: ' . $FB_Shortcode['play_btn_size'] . '; font-size:' . $FB_Shortcode['play_btn_size'] . '"><span class="fts-fb-video-icon" style="height:' . $FB_Shortcode['play_btn_size'] . ' width:' . $FB_Shortcode['play_btn_size'] . '; line-height:' . $FB_Shortcode['play_btn_size'] . '; font-size:' . $FB_Shortcode['play_btn_size'] . '"></span></a>'; } } if (!$FB_Shortcode['type'] == 'album_photos') { $FTS_FB_OUTPUT .= '<div class="fts-jal-fb-description-wrap" style="display:none">'; //Output Photo Name $FTS_FB_OUTPUT .= $FBname ? $this->fts_facebook_post_name($FBlink, $FBname, $FBtype) : ''; //Output Photo Caption $FTS_FB_OUTPUT .= $FBcaption ? $this->fts_facebook_post_cap($FBcaption, $FB_Shortcode, $FBtype) : ''; //Output Photo Description $FTS_FB_OUTPUT .= $FBdescription ? $this->fts_facebook_post_desc($FBdescription, $FB_Shortcode, $FBtype, NULL, $FBby) : ''; $FTS_FB_OUTPUT .= '<div class="clear"></div></div>'; } $FTS_FB_OUTPUT .= '<div class="clear"></div></div>'; break; //************************************************** // START ALBUM POST //************************************************** //************************************************** // START ALBUM POST //************************************************** case 'app': case 'cover': case 'profile': case 'mobile': case 'wall': case 'normal': case 'album': $FTS_FB_OUTPUT .= '<div class="fts-jal-fb-link-wrap fts-album-photos-wrap"'; if ($FB_Shortcode['type'] == 'album_photos' || $FB_Shortcode['type'] == 'albums') { $FTS_FB_OUTPUT .= 'style="line-height:' . $FB_Shortcode['image_height'] . ' !important;"'; } $FTS_FB_OUTPUT .= '>'; //Output Photo Picture $FTS_FB_OUTPUT .= $FBalbum_cover ? $this->fts_facebook_post_photo($FBlink, $FB_Shortcode, $post_data->from->name, $post_data->cover_photo->id) : ''; $FTS_FB_OUTPUT .= '<div class="slicker-facebook-album-photoshadow"></div>'; if (!$FB_Shortcode['type'] == 'albums') { $FTS_FB_OUTPUT .= '<div class="fts-jal-fb-description-wrap">'; //Output Photo Name $FTS_FB_OUTPUT .= $FBname ? $this->fts_facebook_post_name($FBlink, $FBname, $FBtype) : ''; //Output Photo Caption $FTS_FB_OUTPUT .= $FBcaption ? $this->fts_facebook_post_cap($FBcaption, $FB_Shortcode, $FBtype) : ''; //Output Photo Description $FTS_FB_OUTPUT .= $FBdescription ? $this->fts_facebook_post_desc($FBdescription, $FB_Shortcode, $FBtype, NULL, $FBby) : ''; $FTS_FB_OUTPUT .= '<div class="clear"></div></div>'; } $FTS_FB_OUTPUT .= '<div class="clear"></div></div>'; break; } $FTS_FB_OUTPUT .= '<div class="clear"></div>'; $FTS_FB_OUTPUT .= '</div>'; $FBpost_single_id = isset($FBpost_single_id) ? $FBpost_single_id : ""; $final_FBpost_like_count = isset($final_FBpost_like_count) ? $final_FBpost_like_count : ""; $final_FBpost_comments_count = isset($final_FBpost_comments_count) ? $final_FBpost_comments_count : ""; $single_event_id = isset($single_event_id) ? $single_event_id : ""; $FTS_FB_OUTPUT .= $this->fts_facebook_post_see_more($FBlink, $lcs_array, $FBtype, $FBpost_id, $FB_Shortcode, $FBpost_user_id, $FBpost_single_id, $single_event_id, $post_data); $FTS_FB_OUTPUT .= '<div class="clear"></div>'; $FTS_FB_OUTPUT .= '</div>'; return $FTS_FB_OUTPUT; }
function feed_them_twitter_options_page() { $fts_functions = new feed_them_social_functions(); ?> <link href='http://fonts.googleapis.com/css?family=Rambla:400,700' rel='stylesheet' type='text/css'> <div class="feed-them-social-admin-wrap"> <h1><?php _e('Twitter Feed Options', 'feed-them-social'); ?> </h1> <div class="use-of-plugin"><?php _e('Change the color of your twitter feed and more using the options below.', 'feed-them-social'); ?> </div> <!-- custom option for padding --> <form method="post" class="fts-twitter-feed-options-form" action="options.php"><br/> <?php // get our registered settings from the fts functions settings_fields('fts-twitter-feed-style-options'); ?> <?php if (!is_plugin_active('feed-them-premium/feed-them-premium.php')) { $twitter_style_options = array(__('Hide Profile Photo', 'feed-them-social'), __('Feed Text Color', 'feed-them-social'), __('Feed Link Color', 'feed-them-social'), __('Feed Link Color Hover', 'feed-them-social'), __('Feed Width', 'feed-them-social'), __('Feed Margin ', 'feed-them-social'), __('Feed Padding', 'feed-them-social'), __('Feed Background Color', 'feed-them-social'), __('Feed Border Bottom Color', 'feed-them-social')); echo $fts_functions->need_fts_premium_fields($twitter_style_options); } else { $twitter_full_width = get_option('twitter_full_width'); ?> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-twitter-text-color-label"><?php _e('Hide Profile Photo', 'feed-them-social'); ?> </div> <select name="twitter_full_width" id="twitter-full-width" class="feed-them-social-admin-input"> <option '<?php echo selected($twitter_full_width, 'no', false); ?> ' value="no"><?php _e('No', 'feed-them-social'); ?> </option> <option '<?php echo selected($twitter_full_width, 'yes', false); ?> ' value="yes"><?php _e('Yes', 'feed-them-social'); ?> </option> </select> <div class="clear"></div> </div><!--/fts-twitter-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-twitter-text-color-label"><?php _e('Feed Text Color', 'feed-them-social'); ?> </div> <input type="text" name="twitter_text_color" class="feed-them-social-admin-input twitter-text-color-input color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="twitter-text-color-input" placeholder="#222" value="<?php echo get_option('twitter_text_color'); ?> "/> <div class="clear"></div> </div><!--/fts-twitter-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-twitter-link-color-label"><?php _e('Feed Link Color', 'feed-them-social'); ?> </div> <input type="text" name="twitter_link_color" class="feed-them-social-admin-input twitter-link-color-input color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="twitter-link-color-input" placeholder="#222" value="<?php echo get_option('twitter_link_color'); ?> "/> <div class="clear"></div> </div><!--/fts-twitter-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-twitter-link-color-hover-label"><?php _e('Feed Link Color Hover', 'feed-them-social'); ?> </div> <input type="text" name="twitter_link_color_hover" class="feed-them-social-admin-input twitter-link-color-hover-input color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="twitter-link-color-hover-input" placeholder="#ddd" value="<?php echo get_option('twitter_link_color_hover'); ?> "/> <div class="clear"></div> </div><!--/fts-twitter-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-twitter-feed-width-label"><?php _e('Feed Width', 'feed-them-social'); ?> </div> <input type="text" name="twitter_feed_width" class="feed-them-social-admin-input twitter-feed-width-input" id="twitter-feed-width-input" placeholder="500px" value="<?php echo get_option('twitter_feed_width'); ?> "/> <div class="clear"></div> </div><!--/fts-twitter-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-twitter-feed-margin-label"><?php _e('Feed Margin <br/><small>To center feed type auto</small>', 'feed-them-social'); ?> </div> <input type="text" name="twitter_feed_margin" class="feed-them-social-admin-input twitter-feed-margin-input" id="twitter-feed-margin-input" placeholder="10px" value="<?php echo get_option('twitter_feed_margin'); ?> "/> <div class="clear"></div> </div><!--/fts-twitter-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-twitter-feed-padding-label"><?php _e('Feed Padding', 'feed-them-social'); ?> </div> <input type="text" name="twitter_feed_padding" class="feed-them-social-admin-input twitter-feed-padding-input" id="twitter-feed-padding-input" placeholder="10px" value="<?php echo get_option('twitter_feed_padding'); ?> "/> <div class="clear"></div> </div><!--/fts-twitter-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-twitter-feed-background-color-label"><?php _e('Feed Background Color', 'feed-them-social'); ?> </div> <input type="text" name="twitter_feed_background_color" class="feed-them-social-admin-input twitter-feed-background-color-input color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="twitter-feed-background-color-input" placeholder="#ddd" value="<?php echo get_option('twitter_feed_background_color'); ?> "/> <div class="clear"></div> </div><!--/fts-twitter-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-twitter-border-bottom-color-label"><?php _e('Feed Border Bottom Color', 'feed-them-social'); ?> </div> <input type="text" name="twitter_border_bottom_color" class="feed-them-social-admin-input twitter-border-bottom-color-input color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="twitter-border-bottom-color-input" placeholder="#ddd" value="<?php echo get_option('twitter_border_bottom_color'); ?> "/> <div class="clear"></div> </div><!--/fts-twitter-feed-styles-input-wrap--> <?php } //END IF PREMIUM ?> <h2><?php _e('Twitter API Token', 'feed-them-social'); ?> </h2> <?php $test_fts_twitter_custom_consumer_key = get_option('fts_twitter_custom_consumer_key'); $test_fts_twitter_custom_consumer_secret = get_option('fts_twitter_custom_consumer_secret'); $test_fts_twitter_custom_access_token = get_option('fts_twitter_custom_access_token'); $test_fts_twitter_custom_access_token_secret = get_option('fts_twitter_custom_access_token_secret'); if (isset($_GET['page']) && $_GET['page'] == 'fts-twitter-feed-styles-submenu-page') { include WP_CONTENT_DIR . '/plugins/feed-them-social/feeds/twitter/twitteroauth/twitteroauth.php'; $test_connection = new TwitterOAuthFTS($test_fts_twitter_custom_consumer_key, $test_fts_twitter_custom_consumer_secret, $test_fts_twitter_custom_access_token, $test_fts_twitter_custom_access_token_secret); $fetchedTweets = $test_connection->get('statuses/user_timeline', array('screen_name' => 'twitter', 'count' => '1')); } ?> <div class="fts-facebook-custom-api-token-label"><?php _e('If you keep seeing the message \'sorry twitter is down and will be right back\', it may be a good idea to add your own tokens below. See how to <a href="http://www.slickremix.com/docs/how-to-get-api-keys-and-tokens-for-twitter/" target="_blank">get API Keys and Tokens for Twitter</a>. Leave the fields below empty to use our Default API access tokens. If you do add your own tokens, after Saving all Changes make sure and <a href="admin.php?page=feed-them-settings-page&cache=clearcache">click here to delete cache</a>.', 'feed-them-social'); ?> </div> <div class="twitter-api-wrap"> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-twitter-border-bottom-color-label"><?php _e('Consumer Key (API Key)', 'feed-them-social'); ?> </div> <input type="text" name="fts_twitter_custom_consumer_key" class="feed-them-social-admin-input" id="fts_facebook_custom_api_token" value="<?php echo get_option('fts_twitter_custom_consumer_key'); ?> "/> <div class="clear"></div> </div> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-twitter-border-bottom-color-label"><?php _e('Consumer Secret (API Secret)', 'feed-them-social'); ?> </div> <input type="text" name="fts_twitter_custom_consumer_secret" class="feed-them-social-admin-input" id="fts_facebook_custom_api_token" value="<?php echo get_option('fts_twitter_custom_consumer_secret'); ?> "/> <div class="clear"></div> </div> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-twitter-border-bottom-color-label"><?php _e('Access Token', 'feed-them-social'); ?> </div> <input type="text" name="fts_twitter_custom_access_token" class="feed-them-social-admin-input" id="fts_facebook_custom_api_token" value="<?php echo get_option('fts_twitter_custom_access_token'); ?> "/> <div class="clear"></div> </div> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-twitter-border-bottom-color-label"><?php _e('Access Token Secret', 'feed-them-social'); ?> </div> <input type="text" name="fts_twitter_custom_access_token_secret" class="feed-them-social-admin-input" id="fts_facebook_custom_api_token" value="<?php echo get_option('fts_twitter_custom_access_token_secret'); ?> "/> <div class="clear"></div> </div> </div><!--twitter-api-wrap--> <?php if (!empty($test_fts_twitter_custom_consumer_key) && !empty($test_fts_twitter_custom_consumer_secret) && !empty($test_fts_twitter_custom_access_token) && !empty($test_fts_twitter_custom_access_token_secret)) { if ($test_connection->http_code != 200 || $fetchedTweets->errors) { echo '<div class="fts-failed-api-token">' . __('Oh No something\'s wrong.', 'feed-them-social') . ''; foreach ($fetchedTweets->errors as $error) { echo ' <strong>' . $error->message . '. </strong> ' . __('You may have entered in the Access information incorrectly please re-enter and try again.', 'feed-them-social') . ''; } echo '</div>'; } else { echo '<div class="fts-successful-api-token">' . __('Your access token is working!', 'feed-them-social') . '</div>'; } } else { echo '<div class="fts-successful-api-token">' . __('You are using our Default Access info.', 'feed-them-social') . '</div>'; } ?> <div class="clear"></div> <input type="submit" class="feed-them-social-admin-submit-btn" value="<?php _e('Save All Changes'); ?> " /> </form> <a class="feed-them-social-admin-slick-logo" href="http://www.slickremix.com" target="_blank"></a> </div><!--/feed-them-social-admin-wrap--> <?php }
/** * Feed Them Facebook Options Page * * @since 1.9.6 */ function feed_them_facebook_options_page() { $fts_functions = new feed_them_social_functions(); ?> <div class="feed-them-social-admin-wrap"> <h1> <?php _e('Facebook Feed Options', 'feed-them-social'); ?> </h1> <div class="use-of-plugin"> <?php _e('Change the language, color and more for your facebook feed using the options below.', 'feed-them-social'); ?> </div> <!-- custom option for padding --> <form method="post" class="fts-facebook-feed-options-form" action="options.php" id="fts-facebook-feed-options-form"> <br/> <?php // get our registered settings from the fts functions settings_fields('fts-facebook-feed-style-options'); //Language select $fb_language = get_option('fb_language', 'en_US'); //share button $fb_show_follow_btn = get_option('fb_show_follow_btn'); $fb_show_follow_btn_where = get_option('fb_show_follow_btn_where'); $fb_show_follow_btn_profile_pic = get_option('fb_show_follow_btn_profile_pic'); $fb_like_btn_color = get_option('fb_like_btn_color', 'light'); $fb_hide_shared_by_etc_text = get_option('fb_hide_shared_by_etc_text'); $fb_hide_images_in_posts = get_option('fb_hide_images_in_posts'); $fb_hide_no_posts_message = get_option('fb_hide_no_posts_message'); $lang_options_array = json_decode($fts_functions->xml_json_parse('https://www.facebook.com/translations/FacebookLocales.xml')); //echo'<pre>'; // print_r($lang_options_array); //echo'</pre>'; ?> <div id="fb-token-master-wrap" class="feed-them-social-admin-input-wrap" style="padding-bottom:0px;"> <div class="fts-title-description-settings-page" style="padding-top:0; border:none; margin-bottom:0px;"> <h3> <?php _e('Facebook API Token', 'feed-them-social'); ?> </h3> <?php _e('Facebook App Token works for all facebook feeds. Not required, but an Access Token will stop the feed from returning any error messages. If you are having troubles with the button you can also get an APP Token <a href="http://www.slickremix.com/docs/create-facebook-app-id-or-user-token" target="_blank">here</a>. If you are trying to show a group feed but do not have a facebook page you will also need to go <a href="http://www.slickremix.com/docs/create-facebook-app-id-or-user-token" target="_blank">here</a>.', 'feed-them-social'); ?> <p> <a href="https://www.facebook.com/dialog/oauth?client_id=1123168491105924&redirect_uri=https://www.slickremix.com/facebook-token/&state=<?php echo admin_url('admin.php?page=fts-facebook-feed-styles-submenu-page'); ?> &scope=manage_pages%2Cpublic_profile%2Cuser_friends%2Cemail" class="fts-facebook-get-access-token">Login and get my Access Token</a></p> </div> <?php $test_app_token_id = get_option('fts_facebook_custom_api_token'); $test_app_token_id_biz = get_option('fts_facebook_custom_api_token_biz'); if (!empty($test_app_token_id) || !empty($test_app_token_id_biz)) { $fts_fb_access_token = '226916994002335|ks3AFvyAOckiTA1u_aDoI4HYuuw'; $test_app_token_URL = array('app_token_id' => 'https://graph.facebook.com/debug_token?input_token=' . $test_app_token_id . '&access_token=' . $test_app_token_id); $test_app_token_URL_biz = array('app_token_id_biz' => 'https://graph.facebook.com/debug_token?input_token=' . $test_app_token_id_biz . '&access_token=' . $test_app_token_id_biz); //Test App ID // Leave these for reference: // App token for FTS APP2: 358962200939086|lyXQ5-zqXjvYSIgEf8mEhE9gZ_M // App token for FTS APP3: 705020102908771|rdaGxW9NK2caHCtFrulCZwJNPyY $test_app_token_response = $fts_functions->fts_get_feed_json($test_app_token_URL); $test_app_token_response = json_decode($test_app_token_response['app_token_id']); $test_app_token_response_biz = $fts_functions->fts_get_feed_json($test_app_token_URL_biz); $test_app_token_response_biz = json_decode($test_app_token_response_biz['app_token_id_biz']); // echo'<pre>'; /// print_r($test_app_token_response); // echo'</pre>'; } ?> <div class="clear"></div> <div class="feed-them-social-admin-input-wrap fts-fb-token-wrap" id="fts-fb-token-wrap" style="margin-bottom:0px;"> <div class="feed-them-social-admin-input-label fts-twitter-border-bottom-color-label"> <?php _e('Access Token Required', 'feed-them-social'); ?> </div> <input type="text" name="fts_facebook_custom_api_token" class="feed-them-social-admin-input" id="fts_facebook_custom_api_token" value="<?php echo get_option('fts_facebook_custom_api_token'); ?> "/> <input type="text" hidden name="fts_facebook_custom_api_token_user_id" class="feed-them-social-admin-input" id="fts_facebook_custom_api_token_user_id" value="<?php echo get_option('fts_facebook_custom_api_token_user_id'); ?> " /> <input type="text" hidden name="fts_facebook_custom_api_token_user_name" class="feed-them-social-admin-input" id="fts_facebook_custom_api_token_user_name" value="<?php echo get_option('fts_facebook_custom_api_token_user_name'); ?> " /> <div class="clear"></div> <?php if (!empty($test_app_token_response) && !empty($test_app_token_id)) { if (isset($test_app_token_response->data->is_valid) || $test_app_token_response->error->message == "(#100) You must provide an app access token or a user access token that is an owner or developer of the app") { $fb_id = get_option('fts_facebook_custom_api_token_user_id'); $fb_name = get_option('fts_facebook_custom_api_token_user_name'); echo '<div class="fts-successful-api-token fts-special-working-wrap">'; if (!empty($fb_id) && !empty($fb_name) && !empty($test_app_token_id)) { echo '<img border="0" height="50" width="50" class="fts-fb-page-thumb" src="https://graph.facebook.com/' . $fb_id . '/picture"/><h3>' . $fb_name . '</h3>'; } echo __('Your Access Token is now working!', 'feed-them-social') . '</div>'; } if (isset($test_app_token_response->data->error->message) && !empty($test_app_token_id) || isset($test_app_token_response->error->message) && !empty($test_app_token_id) && $test_app_token_response->error->message !== "(#100) You must provide an app access token or a user access token that is an owner or developer of the app") { if (isset($test_app_token_response->data->error->message)) { echo '<div class="fts-failed-api-token">' . __('Oh No something\'s wrong.', 'feed-them-social') . ' ' . $test_app_token_response->data->error->message . ' ' . __('. Please click the button above to retrieve a new Access Token.', 'feed-them-social') . '</div>'; } if (isset($test_app_token_response->error->message)) { echo '<div class="fts-failed-api-token">' . __('Oh No something\'s wrong.', 'feed-them-social') . ' ' . $test_app_token_response->error->message . ' ' . __('. Please click the button above to retrieve a new Access Token.', 'feed-them-social') . '</div>'; } if (isset($test_app_token_response->data->error->message) && empty($test_app_token_id) || isset($test_app_token_response->error->message) && empty($test_app_token_id)) { echo '<div class="fts-failed-api-token">' . __('To get started, please click the button above to retrieve your Access Token.', 'feed-them-social') . '</div>'; } } } else { echo '<div class="fts-successful-api-token default-token">' . __('You are using our Default APP Token for testing purposes.', 'feed-them-social') . '</div>'; } ?> <div class="clear"></div> <?php if (isset($_GET['return_long_lived_token'])) { //Get Token for Facebook $fb_token_response = wp_remote_fopen('https://graph.facebook.com/me/accounts?access_token=' . $_GET['access_token'] . ''); //Error Check $test_fb_app_token_response = json_decode($fb_token_response); // echo'<pre>'; // print_r($test_fb_app_token_response); // echo'</pre>'; ?> <div id="fb-list-wrap" style="display: none"> <div class="fts-pages-info"> <?php _e('Click a page to add the access token above, then click save.', 'feed-them-social'); ?> </div> <ul class="fb-page-list"> <?php foreach ($test_fb_app_token_response->data as $data) { ?> <li> <div class="fb-image"><div class="fts-fb-id"><?php print $data->id; ?> </div> <img border="0" height="50" width="50" src="https://graph.facebook.com/<?php print $data->id; ?> /picture"/> </div> <div class="fb-name"><?php print $data->name; ?> </div> <div class="page-token"><?php print $data->access_token; ?> </div> <?php $facebook_input_token = get_option('fts_facebook_custom_api_token'); $facebook_access_token = $data->access_token; if ($facebook_input_token == $facebook_access_token) { ?> <div class="feed-them-social-admin-submit-btn " style="display: block !important;">Active</div> <?php } else { ?> <div class="feed-them-social-admin-submit-btn fts-token-save">Save</div> <?php } ?> <div class="clear"></div> </li> <?php } ?> </ul> <div class="clear"></div> </div> <script> if(document.querySelector('#fts-fb-token-wrap .fts-pages-info') !== null){ jQuery(".fts-successful-api-token.default-token").hide(); } <?php if (isset($_GET['reviews_token'])) { ?> if(document.querySelector('.default-token') !== null){ jQuery(".default-token").show(); } <?php } ?> jQuery(document).ready(function ($) { $(".feed-them-social-admin-submit-btn").click(function(){ // alert('test'); var newUrl = "<?php echo admin_url('admin.php?page=fts-facebook-feed-styles-submenu-page/'); ?> " history.replaceState({}, null, newUrl); $( "#fts-facebook-feed-options-form" ).submit(); }); <?php if (!isset($_GET['reviews_token'])) { ?> var fb = ".fb-page-list li"; $('#fb-list-wrap').show(); //alert("not set"); <?php } else { ?> var fb = "#reviews-fb-list-wrap .fb-page-list li"; $('#fb-list-wrap').appendTo('#reviews-fb-list-wrap'); $('#fts-fb-reviews-wrap #fb-list-wrap').show(); $('.fts-failed-api-token.get-started-message').hide(); //alert("reviews_token"); <?php } ?> $(fb).click(function () { var fb_page_id = $(this).find('.fts-fb-id').html(); var token = $(this).find('.page-token').html(); // alert(token); var name = $(this).find('.fb-name').html(); <?php if (!isset($_GET['reviews_token'])) { ?> $("#fts_facebook_custom_api_token").val(token); $("#fts_facebook_custom_api_token_user_id").val(fb_page_id); $("#fts_facebook_custom_api_token_user_name").val(name); <?php } else { ?> $("#fts_facebook_custom_api_token_biz").val(token); $("#fts_facebook_custom_api_token_user_id_biz").val(fb_page_id); $("#fts_facebook_custom_api_token_user_name_biz").val(name); <?php } ?> $('.fb-page-list .feed-them-social-admin-submit-btn').hide(); $(this).find('.feed-them-social-admin-submit-btn').toggle(); // alert(name + token) }) }); </script> <?php } ?> </div> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <?php if (is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php')) { ?> <!-- style="padding-top:0; border:none; margin-bottom:0px; --> <div id="fts-fb-reviews-wrap" class="feed-them-social-admin-input-wrap"> <div class="fts-title-description-settings-page" style="margin-bottom:0px;"> <h3> <?php _e('Facebook Page Reviews Access Token', 'feed-them-social'); ?> </h3> <?php _e('This Facebook Access Token works for the Reviews feed only and is simply used to display the feed. You must be an admin of the page to get your token. If you are having problems with the button you can manually create one <a href="http://www.slickremix.com/facebook-never-expiring-page-token" target="_blank">here</a>.', 'feed-them-social'); ?> <p> <a href="https://www.facebook.com/dialog/oauth?client_id=1123168491105924&redirect_uri=https://www.slickremix.com/facebook-token/&state=<?php echo admin_url('admin.php?page=fts-facebook-feed-styles-submenu-page'); ?> %26reviews_token=yes&scope=manage_pages%2Cpublic_profile%2Cuser_friends%2Cemail" class="fts-facebook-get-access-token">Login and get my Reviews Access Token</a></p> </div> <div class="clear"></div> <div class="feed-them-social-admin-input-label fts-twitter-border-bottom-color-label"> <?php _e('Page Reviews Access Token', 'feed-them-social'); ?> </div> <input type="text" name="fts_facebook_custom_api_token_biz" class="feed-them-social-admin-input" id="fts_facebook_custom_api_token_biz" value="<?php echo get_option('fts_facebook_custom_api_token_biz'); ?> "/> <input type="text" hidden name="fts_facebook_custom_api_token_user_id_biz" class="feed-them-social-admin-input" id="fts_facebook_custom_api_token_user_id_biz" value="<?php echo get_option('fts_facebook_custom_api_token_user_id_biz'); ?> " /> <input type="text" hidden name="fts_facebook_custom_api_token_user_name_biz" class="feed-them-social-admin-input" id="fts_facebook_custom_api_token_user_name_biz" value="<?php echo get_option('fts_facebook_custom_api_token_user_name_biz'); ?> " /> <div class="clear"></div> <?php if (!empty($test_app_token_response_biz) && !empty($test_app_token_id_biz)) { $fb_name_biz = get_option('fts_facebook_custom_api_token_user_name_biz'); $fb_id_biz = get_option('fts_facebook_custom_api_token_user_id_biz'); if (isset($test_app_token_response_biz->data->is_valid) || $test_app_token_response_biz->error->message == "(#100) You must provide an app access token or a user access token that is an owner or developer of the app") { echo '<div class="fts-successful-api-token fts-special-working-wrap">'; if (!empty($fb_id_biz) && !empty($fb_name_biz) && !empty($test_app_token_id_biz)) { echo '<img border="0" height="50" width="50" class="fts-fb-page-thumb" src="https://graph.facebook.com/' . $fb_id_biz . '/picture"/><h3>' . $fb_name_biz . '</h3>'; } echo __('Your Page Reviews Access Token is now working!', 'feed-them-social') . '</div>'; } if (isset($test_app_token_response_biz->data->error->message) && !empty($test_app_token_id_biz) || isset($test_app_token_response_biz->error->message) && !empty($test_app_token_id) && $test_app_token_response_biz->error->message !== "(#100) You must provide an app access token or a user access token that is an owner or developer of the app") { if (isset($test_app_token_response_biz->data->error->message)) { echo '<div class="fts-failed-api-token">' . __('Oh No something\'s wrong.', 'feed-them-social') . ' ' . $test_app_token_response_biz->data->error->message . ' ' . __('Please click the button above to retreive a new Access Token.', 'feed-them-social') . '</div>'; } if (isset($test_app_token_response_biz->error->message) && !empty($test_app_token_id_biz) && !isset($_GET["return_long_lived_token"])) { echo '<div class="fts-failed-api-token">' . __('Oh No something\'s wrong.', 'feed-them-social') . ' ' . $test_app_token_response_biz->error->message . ' ' . __('Please click the button above to retreive a new Access Token.', 'feed-them-social') . '</div>'; } } } if (empty($test_app_token_id_biz)) { echo '<div class="fts-failed-api-token get-started-message">' . __('To get started, please click the button above to retrieve your Page Reviews Access Token.', 'feed-them-social') . '</div>'; } ?> <div class="clear"></div> <div id="reviews-fb-list-wrap"></div> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="fts-title-description-settings-page"> <h3> <?php _e('Reviews Style Options', 'feed-them-social'); ?> </h3> <?php _e('The styles above still apply, these are just some extra options for the Reviews List feed.', 'feed-them-social'); ?> </div> <div class="feed-them-social-admin-input-label fb-events-title-color-label"> <?php _e('Stars Background Color', 'feed-them-social'); ?> </div> <input type="text" name="fb_reviews_backg_color" class="feed-them-social-admin-input fb-reviews-backg-color color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="fb-reviews-backg-color" placeholder="#4791FF" value="<?php echo get_option('fb_reviews_backg_color'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fb-events-map-link-color-label"> <?php _e('Stars Text Color', 'feed-them-social'); ?> </div> <input type="text" name="fb_reviews_text_color" class="feed-them-social-admin-input fb-reviews-text-color color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="fb-reviews-text-color" placeholder="#fff" value="<?php echo get_option('fb_reviews_text_color'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fb-events-map-link-color-label"> <?php _e('Change text for the word Star', 'feed-them-social'); ?> </div> <input type="text" name="fb_reviews_star_language" class="feed-them-social-admin-input" id="fb_reviews_star_language" placeholder="star" value="<?php echo get_option('fb_reviews_star_language'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fb-events-map-link-color-label"> <?php _e('Change text for See More Reviews', 'feed-them-social'); ?> </div> <input type="text" name="fb_reviews_see_more_reviews_language" class="feed-them-social-admin-input" id="fb_reviews_see_more_reviews_language" placeholder="See More Reviews" value="<?php echo get_option('fb_reviews_see_more_reviews_language'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <?php } // end if reviewsp plugin active ?> <div class="feed-them-social-admin-input-wrap"> <div class="fts-title-description-settings-page"> <h3> <?php _e('Language Options', 'feed-them-social'); ?> </h3> <?php _e('You must have your Facebook Access Token saved above before this feature will work. This option will translate the FB Titles and Like Button or Box Text. It will not translate your actual post. To translate the Feed Them Social parts of this plugin just set your language on the <a href="options-general.php" target="_blank">wordpress settings</a> page. If would like to help translate please visit our', 'feed-them-social'); ?> <a href="http://glotpress.slickremix.com/projects" target="_blank">GlottPress</a>. </div> <div class="feed-them-social-admin-input-label fts-twitter-text-color-label"> <?php _e('Language For Facebook Feeds', 'feed-them-social'); ?> </div> <select name="fb_language" id="fb-lang-btn" class="feed-them-social-admin-input"> <option value="en_US"> <?php _e('Please Select Option', 'feed-them-social'); ?> </option> <?php foreach ($lang_options_array->locale as $language) { echo '<option ' . selected($fb_language, $language->codes->code->standard->representation, true) . ' value="' . $language->codes->code->standard->representation . '">' . $language->englishName . '</option>'; } ?> </select> <div class="clear"></div> </div> <!--/fts-twitter-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="fts-title-description-settings-page"> <h3> <?php _e('Offset Post Limit', 'feed-them-social'); ?> </h3> <?php _e('<strong style="color:red">DO NOT USE UNLESS</strong> you are getting the message "Please go to the Facebook Options page of our plugin and look for the "Change Post Limit" option and add the number 7 or more." then adjust the number below so posts will show in your feed. Generally adding at least <strong>7</strong> is a good idea if you are getting that notice. This is only for Pages and Groups. We filter certain posts that do not have a story or message or if the shared content is not available via the API.', 'feed-them-social'); ?> </div> <div class="feed-them-social-admin-input-label"> <?php _e('Offset Quantity', 'feed-them-social'); ?> </div> <input type="text" name="fb_count_offset" class="feed-them-social-admin-input" id="fb_count_offset" value="<?php echo get_option('fb_count_offset'); ?> " placeholder="<?php _e('7 for example', 'feed-them-social'); ?> "/> <div class="clear"></div> </div> <!--/fts-twitter-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-twitter-text-color-label"> <?php _e('Hide Notice on Front End', 'feed-them-social'); ?> </div> <select name="fb_hide_no_posts_message" id="fb_hide_no_posts_message" class="feed-them-social-admin-input"> <option value=""> <?php _e('Please Select Option', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_hide_no_posts_message, 'yes', false); ?> value="yes"> <?php _e('Yes', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_hide_no_posts_message, 'no', false); ?> value="no"> <?php _e('No', 'feed-them-social'); ?> </option> </select> <div class="clear"></div> </div> <!--/fts-twitter-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="fts-title-description-settings-page"> <h3> <?php _e('Like Button or Box Options', 'feed-them-social'); ?> </h3> </div> <div class="feed-them-social-admin-input-label fts-twitter-text-color-label"> <?php _e('Show Follow Button', 'feed-them-social'); ?> </div> <select name="fb_show_follow_btn" id="fb-show-follow-btn" class="feed-them-social-admin-input"> <option> <?php _e('Please Select Option', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_show_follow_btn, 'dont-display', false); ?> value="dont-display"> <?php _e('Don\'t Display a Button', 'feed-them-social'); ?> </option> <optgroup label="Like Box"> <option <?php echo selected($fb_show_follow_btn, 'like-box', false); ?> value="like-box"> <?php _e('Like Box', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_show_follow_btn, 'like-box-faces', false); ?> value="like-box-faces"> <?php _e('Like Box with Faces', 'feed-them-social'); ?> </option> </optgroup> <optgroup label="Like Button"> <option <?php echo selected($fb_show_follow_btn, 'like-button', false); ?> value="like-button"> <?php _e('Like Button', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_show_follow_btn, 'like-button-share', false); ?> value="like-button-share"> <?php _e('Like Button and Share Button', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_show_follow_btn, 'like-button-faces', false); ?> value="like-button-faces"> <?php _e('Like Button with Faces', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_show_follow_btn, 'like-button-share-faces', false); ?> value="like-button-share-faces"> <?php _e('Like Button and Share Button with Faces', 'feed-them-social'); ?> </option> </optgroup> </select> <div class="clear"></div> </div> <!--/fts-twitter-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap" style="display:none"> <div class="feed-them-social-admin-input-label fts-twitter-text-color-label"> <?php _e('Show Profile Icon next to social option above', 'feed-them-social'); ?> </div> <select name="fb_show_follow_like_box_cover" id="fb-show-follow-like-box-cover" class="feed-them-social-admin-input"> <option> <?php _e('Please Select Option', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_show_follow_btn_profile_pic, 'fb_like_box_cover-yes', false); ?> value="fb_like_box_cover-yes"> <?php _e('Display Cover Photo in Like Box', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_show_follow_btn_profile_pic, 'fb_like_box_cover-no', false); ?> value="fb_like_box_cover-no"> <?php _e('Hide Cover Photo in Like Box', 'feed-them-social'); ?> </option> </select> <div class="clear"></div> </div> <!--/fts-twitter-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-twitter-text-color-label"> <?php _e('Like Button Color', 'feed-them-social'); ?> </div> <select name="fb_like_btn_color" id="fb-like-btn-color" class="feed-them-social-admin-input"> <option value="light"> <?php _e('Please Select Option', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_like_btn_color, 'light', false); ?> value="light"> <?php _e('Light', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_like_btn_color, 'dark', false); ?> value="dark"> <?php _e('Dark', 'feed-them-social'); ?> </option> </select> <div class="clear"></div> </div> <!--/fts-twitter-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-twitter-text-color-label"> <?php _e('Placement of the Button(s)', 'feed-them-social'); ?> </div> <select name="fb_show_follow_btn_where" id="fb-show-follow-btn-where" class="feed-them-social-admin-input"> <option value=""> <?php _e('Please Select Option', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_show_follow_btn_where, 'fb-like-top-above-title', false); ?> value="fb-like-top-above-title"> <?php _e('Show Top of Feed Above Title', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_show_follow_btn_where, 'fb-like-top-below-title', false); ?> value="fb-like-top-below-title"> <?php _e('Show Top of Feed Below Title', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_show_follow_btn_where, 'fb-like-below', false); ?> value="fb-like-below"> <?php _e('Show Botton of Feed', 'feed-them-social'); ?> </option> </select> <div class="clear"></div> </div> <!--/fts-twitter-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-twitter-text-color-label"> <?php _e('Facebook APP ID<br/><small>View Step 3 to <a href="http://www.slickremix.com/docs/create-facebook-app-id-or-user-token" target="_blank">get APP ID</a>.</small>', 'feed-them-social'); ?> </div> <input type="text" name="fb_app_ID" class="feed-them-social-admin-input" id="fb-app-ID" value="<?php echo get_option('fb_app_ID'); ?> "/> <div class="clear"></div> </div> <div class="feed-them-social-admin-input-wrap"> <div class="fts-title-description-settings-page" style="margin-top:0;"> <h3> <?php _e('Style Options', 'feed-them-social'); ?> </h3> </div> <div class="feed-them-social-admin-input-label fts-twitter-text-color-label"> <?php _e('Text after your FB name <br/><small>ie* Shared by or New Photo Added etc.</small>', 'feed-them-social'); ?> </div> <select name="fb_hide_shared_by_etc_text" id="fb_hide_shared_by_etc_text" class="feed-them-social-admin-input"> <option value=""> <?php _e('Please Select Option', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_hide_shared_by_etc_text, 'no', false); ?> value="no"> <?php _e('No', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_hide_shared_by_etc_text, 'yes', false); ?> value="yes"> <?php _e('Yes', 'feed-them-social'); ?> </option> </select> <div class="clear"></div> </div> <!--/fts-twitter-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-twitter-text-color-label"> <?php _e('Hide Images in Posts', 'feed-them-social'); ?> </div> <select name="fb_hide_images_in_posts" id="fb_hide_images_in_posts" class="feed-them-social-admin-input"> <option value=""> <?php _e('Please Select Option', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_hide_images_in_posts, 'no', false); ?> value="no"> <?php _e('No', 'feed-them-social'); ?> </option> <option <?php echo selected($fb_hide_images_in_posts, 'yes', false); ?> value="yes"> <?php _e('Yes', 'feed-them-social'); ?> </option> </select> <div class="clear"></div> </div> <!--/fts-twitter-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-text-color-label"> <?php _e('Max-width for Images & Videos', 'feed-them-social'); ?> </div> <input type="text" name="fb_max_image_width" class="feed-them-social-admin-input" placeholder="500px" value="<?php echo get_option('fb_max_image_width'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-text-color-label"> <?php _e('Feed Header Extra Text Color', 'feed-them-social'); ?> </div> <input type="text" name="fb_header_extra_text_color" class="feed-them-social-admin-input fb-text-color-input color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="fb-text-color-input" placeholder="#222" value="<?php echo get_option('fb_header_extra_text_color'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-text-color-label"> <?php _e('Feed Text Color', 'feed-them-social'); ?> </div> <input type="text" name="fb_text_color" class="feed-them-social-admin-input fb-text-color-input color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="fb-text-color-input" placeholder="#222" value="<?php echo get_option('fb_text_color'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-link-color-label"> <?php _e('Feed Link Color', 'feed-them-social'); ?> </div> <input type="text" name="fb_link_color" class="feed-them-social-admin-input fb-link-color-input color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="fb-link-color-input" placeholder="#222" value="<?php echo get_option('fb_link_color'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-link-color-hover-label"> <?php _e('Feed Link Color Hover', 'feed-them-social'); ?> </div> <input type="text" name="fb_link_color_hover" class="feed-them-social-admin-input fb-link-color-hover-input color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="fb-link-color-hover-input" placeholder="#ddd" value="<?php echo get_option('fb_link_color_hover'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-feed-width-label"> <?php _e('Feed Width', 'feed-them-social'); ?> </div> <input type="text" name="fb_feed_width" class="feed-them-social-admin-input fb-feed-width-input" id="fb-feed-width-input" placeholder="500px" value="<?php echo get_option('fb_feed_width'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-feed-margin-label"> <?php _e('Feed Margin <br/><small>To center feed type auto</small>', 'feed-them-social'); ?> </div> <input type="text" name="fb_feed_margin" class="feed-them-social-admin-input fb-feed-margin-input" id="fb-feed-margin-input" placeholder="10px" value="<?php echo get_option('fb_feed_margin'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-feed-padding-label"> <?php _e('Feed Padding', 'feed-them-social'); ?> </div> <input type="text" name="fb_feed_padding" class="feed-them-social-admin-input fb-feed-padding-input" id="fb-feed-padding-input" placeholder="10px" value="<?php echo get_option('fb_feed_padding'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-feed-background-color-label"> <?php _e('Feed Background Color', 'feed-them-social'); ?> </div> <input type="text" name="fb_feed_background_color" class="feed-them-social-admin-input fb-feed-background-color-input color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="fb-feed-background-color-input" placeholder="#ddd" value="<?php echo get_option('fb_feed_background_color'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-grid-posts-background-color-label"> <?php _e('Feed Grid Posts Background Color (Grid style feeds ONLY)', 'feed-them-social'); ?> </div> <input type="text" name="fb_grid_posts_background_color" class="feed-them-social-admin-input fb-grid-posts-background-color-input color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="fb-grid-posts-background-color-input" placeholder="#ddd" value="<?php echo get_option('fb_grid_posts_background_color'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fts-fb-border-bottom-color-label"> <?php _e('Feed Border Bottom Color', 'feed-them-social'); ?> </div> <input type="text" name="fb_border_bottom_color" class="feed-them-social-admin-input fb-border-bottom-color-input color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="fb-border-bottom-color-input" placeholder="#ddd" value="<?php echo get_option('fb_border_bottom_color'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="fts-title-description-settings-page"> <h3> <?php _e('Event Style Options', 'feed-them-social'); ?> </h3> <?php _e('The styles above still apply, these are just some extra options for the Event List feed.', 'feed-them-social'); ?> </div> <div class="feed-them-social-admin-input-label fb-events-title-color-label"> <?php _e('Events Feed: Title Color', 'feed-them-social'); ?> </div> <input type="text" name="fb_events_title_color" class="feed-them-social-admin-input fb-events-title-color color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="fb-events-title-color-input" placeholder="#ddd" value="<?php echo get_option('fb_events_title_color'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fb-events-title-size-label"> <?php _e('Events Feed: Title Size', 'feed-them-social'); ?> </div> <input type="text" name="fb_events_title_size" class="feed-them-social-admin-input fb-events-title-size" id="fb-events-title-color-input" placeholder="20px" value="<?php echo get_option('fb_events_title_size'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="feed-them-social-admin-input-wrap"> <div class="feed-them-social-admin-input-label fb-events-map-link-color-label"> <?php _e('Events Feed: Map Link Color', 'feed-them-social'); ?> </div> <input type="text" name="fb_events_map_link_color" class="feed-them-social-admin-input fb-events-map-link-color color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:'#eee',pickerFace:3,pickerBorder:0,pickerInsetColor:'white'}" id="fb-events-map-link-color-input" placeholder="#ddd" value="<?php echo get_option('fb_events_map_link_color'); ?> "/> <div class="clear"></div> </div> <!--/fts-facebook-feed-styles-input-wrap--> <div class="clear"></div> <input type="submit" class="feed-them-social-admin-submit-btn" value="<?php _e('Save All Changes'); ?> "/> </form> <div class="clear"></div> <a class="feed-them-social-admin-slick-logo" href="http://www.slickremix.com" target="_blank"></a></div> <!--/feed-them-social-admin-wrap--> <?php }
function feed_them_settings_page() { $fts_functions = new feed_them_social_functions(); ?> <link href='http://fonts.googleapis.com/css?family=Rambla:400,700' rel='stylesheet' type='text/css'> <div class="feed-them-social-admin-wrap"> <h1><?php _e('Feed Them Social', 'feed-them-social'); ?> </h1> <div class="use-of-plugin"><?php _e('Select what type of feed you would like to generate a shortcode for using the select option below. Then you\'ll copy that shortcode to a page or post.', 'feed-them-social'); ?> </div> <div class="feed-them-icon-wrap"> <a href="#" class="youtube-icon"></a> <a href="#" class="twitter-icon"></a> <a href="#" class="facebook-icon"></a> <a href="#" class="instagram-icon"></a> <a href="#" class="pinterest-icon"></a> <?php //show the js for the discount option under social icons on the settings page if (!is_plugin_active('feed-them-premium/feed-them-premium.php')) { ?> <div id="discount-for-review"><?php _e('15% off Premium Version', 'feed-them-social'); ?> </div> <div class="discount-review-text"><a href="http://www.slickremix.com/downloads/feed-them-social-premium-extension/" target="_blank"><?php _e('Share here', 'feed-them-social'); ?> </a> <?php _e('and receive 15% OFF your total order.', 'feed-them-social'); ?> </div> <?php } ?> </div> <form class="feed-them-social-admin-form"> <select id="shortcode-form-selector"> <option value=""><?php _e('Please Select Feed Type', 'feed-them-social'); ?> </option> <option value="fb-page-shortcode-form"><?php _e('Facebook Feed', 'feed-them-social'); ?> </option> <option value="twitter-shortcode-form"><?php _e('Twitter Feed', 'feed-them-social'); ?> </option> <option value="instagram-shortcode-form"><?php _e('Instagram Feed', 'feed-them-social'); ?> </option> <option value="youtube-shortcode-form"><?php _e('YouTube Feed'); ?> </option> <option value="pinterest-shortcode-form"><?php _e('Pinterest Feed', 'feed-them-social'); ?> </option> </select> </form><!--/feed-them-social-admin-form--> <?php //Add Facebook Event Form echo $fts_functions->fts_facebook_group_form(false); //Add Facebook Page Form echo $fts_functions->fts_facebook_page_form(false); //Add Facebook Event Form echo $fts_functions->fts_facebook_event_form(false); //Add Twitter Form echo $fts_functions->fts_twitter_form(false); //Add Instagram Form echo $fts_functions->fts_instagram_form(false); //Add Youtube Form echo $fts_functions->fts_youtube_form(false); //Add Pinterest Form echo $fts_functions->fts_pinterest_form(false); ?> <div class="clear"></div> <div class="feed-them-clear-cache"> <h2><?php _e('Clear All Cache Option', 'feed-them-social'); ?> </h2> <div class="use-of-plugin"><?php _e('Please Clear Cache if you have changed a FTS Shortcode. This will Allow you to see the NEW feed\'s options you just set!', 'feed-them-social'); ?> </div> <?php if (isset($_GET['cache']) && $_GET['cache'] == 'clearcache') { echo '<div class="feed-them-clear-cache-text">' . $fts_functions->feed_them_clear_cache() . '</div>'; } ?> <form method="post" action="?page=feed-them-settings-page&cache=clearcache"> <input class="feed-them-social-admin-submit-btn" type="submit" value="<?php _e('Clear All FTS Feeds Cache', 'feed-them-social'); ?> " /> </form> </div><!--/feed-them-clear-cache--> <!-- custom option for padding --> <form method="post" class="fts-color-settings-admin-form" action="options.php"> <div class="feed-them-custom-css"> <?php // get our registered settings from the fts functions settings_fields('feed-them-social-settings'); ?> <?php isset($ftsDateTimeFormat) ? $ftsDateTimeFormat : ""; isset($ftsTimezone) ? $ftsTimezone : ""; $ftsDateTimeFormat = get_option('fts-date-and-time-format'); $ftsTimezone = get_option('fts-timezone'); date_default_timezone_set(get_option('fts-timezone')); ?> <div style="float:left; max-width:400px; margin-right:30px;"><h2><?php _e('FaceBook & Twitter Date Format', 'feed-them-social'); ?> </h2> <fieldset> <select id="fts-date-and-time-format" name="fts-date-and-time-format"> <option value="l, F jS, Y \a\t g:ia" <?php if ($ftsDateTimeFormat == 'l, F jS, Y \\a\\t g:ia') { echo 'selected="selected"'; } ?> ><?php echo date('l, F jS, Y \\a\\t g:ia'); ?> </option> <option value="F j, Y \a\t g:ia" <?php if ($ftsDateTimeFormat == 'F j, Y \\a\\t g:ia') { echo 'selected="selected"'; } ?> ><?php echo date('F j, Y \\a\\t g:ia'); ?> </option> <option value="F j, Y g:ia" <?php if ($ftsDateTimeFormat == 'F j, Y g:ia') { echo 'selected="selected"'; } ?> ><?php echo date('F j, Y g:ia'); ?> </option> <option value="F, Y \a\t g:ia" <?php if ($ftsDateTimeFormat == 'F, Y \\a\\t g:ia') { echo 'selected="selected"'; } ?> ><?php echo date('F, Y \\a\\t g:ia'); ?> </option> <option value="M j, Y @ g:ia" <?php if ($ftsDateTimeFormat == 'M j, Y @ g:ia') { echo 'selected="selected"'; } ?> ><?php echo date('M j, Y @ g:ia'); ?> </option> <option value="M j, Y @ G:i" <?php if ($ftsDateTimeFormat == 'M j, Y @ G:i') { echo 'selected="selected"'; } ?> ><?php echo date('M j, Y @ G:i'); ?> </option> <option value="m/d/Y \a\t g:ia" <?php if ($ftsDateTimeFormat == 'm/d/Y \\a\\t g:ia') { echo 'selected="selected"'; } ?> ><?php echo date('m/d/Y \\a\\t g:ia'); ?> </option> <option value="m/d/Y @ G:i" <?php if ($ftsDateTimeFormat == 'm/d/Y @ G:i') { echo 'selected="selected"'; } ?> ><?php echo date('m/d/Y @ G:i'); ?> </option> <option value="d/m/Y \a\t g:ia" <?php if ($ftsDateTimeFormat == 'd/m/Y \\a\\t g:ia') { echo 'selected="selected"'; } ?> ><?php echo date('d/m/Y \\a\\t g:ia'); ?> </option> <option value="d/m/Y @ G:i" <?php if ($ftsDateTimeFormat == 'd/m/Y @ G:i') { echo 'selected="selected"'; } ?> ><?php echo date('d/m/Y @ G:i'); ?> </option> <option value="Y/m/d \a\t g:ia" <?php if ($ftsDateTimeFormat == 'Y/m/d \\a\\t g:ia') { echo 'selected="selected"'; } ?> ><?php echo date('Y/m/d \\a\\t g:ia'); ?> </option> <option value="Y/m/d @ G:i" <?php if ($ftsDateTimeFormat == 'Y/m/d @ G:i') { echo 'selected="selected"'; } ?> ><?php echo date('Y/m/d @ G:i'); ?> </option> </select> </fieldset> </div> <div style="float:left; max-width:330px"> <h2><?php _e('TimeZone', 'feed-them-social'); ?> </h2> <fieldset> <select id="fts-timezone" name="fts-timezone"> <option value="Pacific/Midway" <?php if ($ftsTimezone == "Pacific/Midway") { echo 'selected="selected"'; } ?> > <?php _e('UTC-11:00'); ?> </option> <option value="Etc/UTC+10" <?php if ($ftsTimezone == "Etc/UTC+10") { echo 'selected="selected"'; } ?> > <?php _e('UTC-10:00'); ?> </option> <option value="Pacific/Marquesas" <?php if ($ftsTimezone == "Pacific/Marquesas") { echo 'selected="selected"'; } ?> > <?php _e('UTC-09:30'); ?> </option> <option value="Pacific/Gambier" <?php if ($ftsTimezone == "Pacific/Gambier") { echo 'selected="selected"'; } ?> > <?php _e('UTC-09:00'); ?> </option> <option value="Etc/UTC+8" <?php if ($ftsTimezone == "Etc/UTC+8") { echo 'selected="selected"'; } ?> > <?php _e('UTC-08:00'); ?> </option> <option value="America/Denver" <?php if ($ftsTimezone == "America/Denver") { echo 'selected="selected"'; } ?> > <?php _e('UTC-07:00'); ?> </option> <option value="America/Chicago" <?php if ($ftsTimezone == "America/Chicago") { echo 'selected="selected"'; } ?> > <?php _e('UTC-06:00'); ?> </option> <option value="America/Havana" <?php if ($ftsTimezone == "America/Havana") { echo 'selected="selected"'; } ?> > <?php _e('UTC-05:00'); ?> </option> <option value="America/Caracas" <?php if ($ftsTimezone == "America/Caracas") { echo 'selected="selected"'; } ?> > <?php _e('UTC-04:30'); ?> </option> <option value="America/Glace_Bay" <?php if ($ftsTimezone == "America/Glace_Bay") { echo 'selected="selected"'; } ?> > <?php _e('UTC-04:00'); ?> </option> <option value="America/St_Johns" <?php if ($ftsTimezone == "America/St_Johns") { echo 'selected="selected"'; } ?> > <?php _e('UTC-03:30'); ?> </option> <option value="America/Sao_Paulo" <?php if ($ftsTimezone == "America/Sao_Paulo") { echo 'selected="selected"'; } ?> > <?php _e('UTC-03:00'); ?> </option> <option value="America/Noronha" <?php if ($ftsTimezone == "America/Noronha") { echo 'selected="selected"'; } ?> > <?php _e('UTC-02:00'); ?> </option> <option value="Atlantic/Cape_Verde" <?php if ($ftsTimezone == "Atlantic/Cape_Verde") { echo 'selected="selected"'; } ?> > <?php _e('UTC-01:00'); ?> </option> <option value="Europe/Belfast" <?php if ($ftsTimezone == "Europe/Belfast") { echo 'selected="selected"'; } ?> > <?php _e('UTC'); ?> <option value="Europe/Amsterdam" <?php if ($ftsTimezone == "Europe/Amsterdam") { echo 'selected="selected"'; } ?> > <?php _e('UTC+01:00'); ?> </option> <option value="Asia/Beirut" <?php if ($ftsTimezone == "Asia/Beirut") { echo 'selected="selected"'; } ?> > <?php _e('UTC+02:00'); ?> </option> <option value="Europe/Moscow" <?php if ($ftsTimezone == "Europe/Moscow") { echo 'selected="selected"'; } ?> > <?php _e('UTC+03:00'); ?> </option> <option value="Asia/Tehran" <?php if ($ftsTimezone == "Asia/Tehran") { echo 'selected="selected"'; } ?> > <?php _e('UTC+03:30'); ?> </option> <option value="Asia/Yerevan" <?php if ($ftsTimezone == "Asia/Yerevan") { echo 'selected="selected"'; } ?> > <?php _e('UTC+04:00'); ?> </option> <option value="Asia/Kabul" <?php if ($ftsTimezone == "Asia/Kabul") { echo 'selected="selected"'; } ?> > <?php _e('UTC+04:30'); ?> </option> <option value="Asia/Tashkent" <?php if ($ftsTimezone == "Asia/Tashkent") { echo 'selected="selected"'; } ?> > <?php _e('UTC+05:00'); ?> </option> <option value="Asia/Kolkata" <?php if ($ftsTimezone == "Asia/Kolkata") { echo 'selected="selected"'; } ?> > <?php _e('UTC+05:30'); ?> </option> <option value="Asia/Katmandu" <?php if ($ftsTimezone == "Asia/Katmandu") { echo 'selected="selected"'; } ?> > <?php _e('UTC+05:45'); ?> </option> <option value="Asia/Dhaka" <?php if ($ftsTimezone == "Asia/Dhaka") { echo 'selected="selected"'; } ?> > <?php _e('UTC+06:00'); ?> </option> <option value="Asia/Novosibirsk" <?php if ($ftsTimezone == "Asia/Novosibirsk") { echo 'selected="selected"'; } ?> > <?php _e('UTC+06:00'); ?> </option> <option value="Asia/Rangoon" <?php if ($ftsTimezone == "Asia/Rangoon") { echo 'selected="selected"'; } ?> > <?php _e('UTC+06:30'); ?> </option> <option value="Asia/Bangkok" <?php if ($ftsTimezone == "Asia/Bangkok") { echo 'selected="selected"'; } ?> > <?php _e('UTC+07:00'); ?> </option> <option value="Australia/Perth" <?php if ($ftsTimezone == "Australia/Perth") { echo 'selected="selected"'; } ?> > <?php _e('UTC+08:00'); ?> </option> <option value="Australia/Eucla" <?php if ($ftsTimezone == "Australia/Eucla") { echo 'selected="selected"'; } ?> > <?php _e('UTC+08:45'); ?> </option> <option value="Asia/Tokyo" <?php if ($ftsTimezone == "Asia/Tokyo") { echo 'selected="selected"'; } ?> > <?php _e('UTC+09:00'); ?> </option> <option value="Australia/Adelaide" <?php if ($ftsTimezone == "Australia/Adelaide") { echo 'selected="selected"'; } ?> > <?php _e('UTC+09:30'); ?> </option> <option value="Australia/Hobart" <?php if ($ftsTimezone == "Australia/Hobart") { echo 'selected="selected"'; } ?> > <?php _e('UTC+10:00'); ?> </option> <option value="Australia/Lord_Howe" <?php if ($ftsTimezone == "Australia/Lord_Howe") { echo 'selected="selected"'; } ?> > <?php _e('UTC+10:30'); ?> </option> <option value="Etc/UTC-11" <?php if ($ftsTimezone == "Etc/UTC-11") { echo 'selected="selected"'; } ?> > <?php _e('UTC+11:00'); ?> </option> <option value="Pacific/Norfolk" <?php if ($ftsTimezone == "Pacific/Norfolk") { echo 'selected="selected"'; } ?> > <?php _e('UTC+11:30'); ?> </option> <option value="Asia/Anadyr" <?php if ($ftsTimezone == "Asia/Anadyr") { echo 'selected="selected"'; } ?> > <?php _e('UTC+12:00'); ?> </option> <option value="Pacific/Chatham" <?php if ($ftsTimezone == "Pacific/Chatham") { echo 'selected="selected"'; } ?> > <?php _e('UTC+12:45'); ?> </option> <option value="Pacific/Tongatapu" <?php if ($ftsTimezone == "Pacific/Tongatapu") { echo 'selected="selected"'; } ?> > <?php _e('UTC+13:00'); ?> </option> <option value="Pacific/Kiritimati" <?php if ($ftsTimezone == "Pacific/Kiritimati") { echo 'selected="selected"'; } ?> > <?php _e('UTC+14:00'); ?> </option> </select> </fieldset> </div> <div class="clear"></div> <br/> <h2><?php _e('Custom CSS Option', 'feed-them-social'); ?> </h2> <p> <input name="fts-color-options-settings-custom-css" class="fts-color-settings-admin-input" type="checkbox" id="fts-color-options-settings-custom-css" value="1" <?php echo checked('1', get_option('fts-color-options-settings-custom-css')); ?> /> <?php if (get_option('fts-color-options-settings-custom-css') == '1') { ?> <strong><?php _e('Checked:', 'feed-them-social'); ?> </strong> <?php _e('Custom CSS option is being used now.', 'feed-them-social'); ?> <?php } else { ?> <strong><?php _e('Not Checked:', 'feed-them-social'); ?> </strong> <?php _e('You are using the default CSS.', 'feed-them-social'); ?> <?php } ?> </p> <label class="toggle-custom-textarea-show"><span><?php _e('Show', 'feed-them-social'); ?> </span><span class="toggle-custom-textarea-hide"><?php _e('Hide', 'feed-them-social'); ?> </span> <?php _e('custom CSS', 'feed-them-social'); ?> </label> <div class="clear"></div> <div class="fts-custom-css-text"><?php _e('Thanks for using our plugin :) Add your custom CSS additions or overrides below.', 'feed-them-social'); ?> </div> <textarea name="fts-color-options-main-wrapper-css-input" class="fts-color-settings-admin-input" id="fts-color-options-main-wrapper-css-input"><?php echo get_option('fts-color-options-main-wrapper-css-input'); ?> </textarea> </div><!--/feed-them-custom-css--> <div class="feed-them-custom-logo-css"> <h2><?php _e('Powered by Text', 'feed-them-social'); ?> </h2> <p> <input name="fts-powered-text-options-settings" class="fts-powered-by-settings-admin-input" type="checkbox" id="fts-powered-text-options-settings" value="1" <?php echo checked('1', get_option('fts-powered-text-options-settings')); ?> /> <?php if (get_option('fts-powered-text-options-settings') == '1') { ?> <strong><?php _e('Checked:', 'feed-them-social'); ?> </strong> <?php _e('You are not showing the Powered by Logo.', 'feed-them-social'); ?> <?php } else { ?> <strong><?php _e('Not Checked:', 'feed-them-social'); ?> </strong><?php _e('The Powered by text will appear in the site. Awesome! Thanks so much for sharing.', 'feed-them-social'); ?> <?php } ?> </p> <br/> <input type="submit" class="feed-them-social-admin-submit-btn" value="<?php _e('Save All Changes', 'feed-them-social'); ?> " /> <div class="clear"></div> </div><!--/feed-them-custom-logo-css--> </form> <a class="feed-them-social-admin-slick-logo" href="http://www.slickremix.com" target="_blank"></a> </div><!--/feed-them-social-admin-wrap--> <script> jQuery(function() { // Master feed selector jQuery('#shortcode-form-selector').change(function(){ jQuery('.shortcode-generator-form').hide(); jQuery('.' + jQuery(this).val()).fadeIn('fast'); }); // change the feed type 'how to' message when a feed type is selected jQuery('#facebook-messages-selector').change(function(){ jQuery('.facebook-message-generator').hide(); jQuery('.' + jQuery(this).val()).fadeIn('fast'); // if the facebook type select is changed we hide the shortcode code so not to confuse people jQuery('.final-shortcode-textarea').hide(); // only show the Super Gallery Options if the facebook ablum or album covers feed type is selected var facebooktype = jQuery("select#facebook-messages-selector").val(); if (facebooktype == 'albums' || facebooktype == 'album_photos') { jQuery('.fts-super-facebook-options-wrap').show(); jQuery('.fixed_height_option').hide(); jQuery('.fb-posts-in-grid-option-wrap').hide(); jQuery('.fixed_height_option').hide(); jQuery(".feed-them-social-admin-input-label:contains('<?php _e('Display Posts in Grid', 'feed-them-social'); ?> ')").parent('div').hide(); } else { jQuery('.fts-super-facebook-options-wrap').hide(); jQuery('.fixed_height_option').show(); jQuery('.fb-posts-in-grid-option-wrap').show(); jQuery(".feed-them-social-admin-input-label:contains('<?php _e('Display Posts in Grid', 'feed-them-social'); ?> ')").parent('div').show(); } // only show the post type visible if the facebook page feed type is selected jQuery('.facebook-post-type-visible').hide(); if (facebooktype == 'page' ) { jQuery('.facebook-post-type-visible').show(); } var fb_feed_type_option = jQuery("select#facebook-messages-selector").val(); if (fb_feed_type_option == 'album_photos') { jQuery('.fb_album_photos_id').show(); } else { jQuery('.fb_album_photos_id').hide(); } }); // Instagram Super Gallery option jQuery('#instagram-custom-gallery').bind('change', function (e) { if( jQuery('#instagram-custom-gallery').val() == 'yes') { jQuery('.fts-super-instagram-options-wrap').show(); } else{ jQuery('.fts-super-instagram-options-wrap').hide(); } }); jQuery('#instagram-messages-selector').bind('change', function (e) { if( jQuery('#instagram-messages-selector').val() == 'hashtag') { jQuery(".instagram-id-option-wrap").hide(); jQuery(".instagram-hashtag-option-text").show(); jQuery(".instagram-user-option-text").hide(); } else{ jQuery(".instagram-id-option-wrap").show(); jQuery(".instagram-hashtag-option-text").hide(); jQuery(".instagram-user-option-text").show(); } }); // facebook show grid options jQuery('#fb-grid-option').bind('change', function (e) { if( jQuery('#fb-grid-option').val() == 'yes') { jQuery('.fts-facebook-grid-options-wrap').show(); jQuery(".feed-them-social-admin-input-label:contains('<?php _e('Center Facebook Container?', 'feed-them-social'); ?> ')").parent('div').show(); } else{ jQuery('.fts-facebook-grid-options-wrap').hide(); } }); // facebook Super Gallery option jQuery('#facebook-custom-gallery').bind('change', function (e) { if( jQuery('#facebook-custom-gallery').val() == 'yes') { jQuery('.fts-super-facebook-options-wrap').show(); } else{ jQuery('.fts-super-facebook-options-wrap').hide(); } }); // facebook show load more options jQuery('#fb_load_more_option').bind('change', function (e) { if( jQuery('#fb_load_more_option').val() == 'yes') { jQuery('.fts-facebook-load-more-options-wrap').show(); } else{ jQuery('.fts-facebook-load-more-options-wrap').hide(); } }); }); //START Page JS/ function updateTextArea_fb_page() { var fb_feed_type = ' type=' + jQuery("select#facebook-messages-selector").val(); var fb_page_id = ' id=' + jQuery("input#fb_page_id").val(); var fb_album_id = ' album_id=' + jQuery("input#fb_album_id").val(); var fb_page_posts_displayed = ' posts_displayed=' + jQuery("select#fb_page_posts_displayed").val(); var facebook_height = jQuery("input#facebook_page_height").val(); // var super_gallery = ' super_gallery=' + jQuery("select#facebook-custom-gallery").val(); var image_width = ' image_width=' + jQuery("input#fts-slicker-facebook-container-image-width").val(); var image_height = ' image_height=' + jQuery("input#fts-slicker-facebook-container-image-height").val(); var space_between_photos = ' space_between_photos=' + jQuery("input#fts-slicker-facebook-container-margin").val(); var hide_date_likes_comments = ' hide_date_likes_comments=' + jQuery("select#fts-slicker-facebook-container-hide-date-likes-comments").val(); var center_container = ' center_container=' + jQuery("select#fts-slicker-facebook-container-position").val(); var image_stack_animation = ' image_stack_animation=' + jQuery("select#fts-slicker-facebook-container-animation").val(); var position_lr = ' image_position_lr=' + jQuery("input#fts-slicker-facebook-image-position-lr").val(); var position_top = ' image_position_top=' + jQuery("input#fts-slicker-facebook-image-position-top").val(); if (fb_page_id == " id=") { jQuery(".fb_page_id").addClass('fts-empty-error'); jQuery("input#fb_page_id").focus(); return false; } if (fb_page_id != " id=") { jQuery(".fb_page_id").removeClass('fts-empty-error'); } if (fb_album_id == " album_id=" && fb_feed_type == " type=album_photos") { jQuery(".fb_album_photos_id").addClass('fts-empty-error'); jQuery("input#fb_album_id").focus(); return false; } if (fb_album_id != " album_id=") { jQuery(".fb_album_photos_id").removeClass('fts-empty-error'); } if (facebook_height) { var facebook_height_final = ' height=' + jQuery("input#facebook_page_height").val(); } else { var facebook_height_final = ''; } var super_gallery_option = jQuery("select#facebook-custom-gallery").val(); var albums_photos_option = jQuery("select#facebook-messages-selector").val(); <?php //Premium Plugin if (is_plugin_active('feed-them-premium/feed-them-premium.php')) { include WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/facebook-page-settings-js.js'; } else { ?> if (albums_photos_option == "album_photos") { var final_fb_page_shortcode = '[fts facebook' + fb_page_id + fb_album_id + fb_feed_type + image_width + image_height + space_between_photos + hide_date_likes_comments + center_container + image_stack_animation + position_lr + position_top +']'; } else if (albums_photos_option == "albums") { var final_fb_page_shortcode = '[fts facebook' + fb_page_id + fb_feed_type + image_width + image_height + space_between_photos + hide_date_likes_comments + center_container + image_stack_animation + position_lr + position_top +']'; } else if (albums_photos_option == "page") { var final_fb_page_shortcode = '[fts facebook' + fb_page_id + fb_page_posts_displayed + facebook_height_final + fb_feed_type + ']'; } else { var final_fb_page_shortcode = '[fts facebook' + fb_page_id + facebook_height_final + fb_feed_type + ']'; } <?php } ?> jQuery('.facebook-page-final-shortcode').val(final_fb_page_shortcode); jQuery('.fb-page-shortcode-form .final-shortcode-textarea').slideDown(); } //END Facebook Page// //START Facebook Group// function updateTextArea_fb_group() { var fb_group_id = ' id=' + jQuery("input#fb_group_id").val(); // var fb_group_custom_name = ' custom_name=' + jQuery("select#fb_group_custom_name").val(); var facebook_height = jQuery("input#facebook_group_height").val(); if (fb_group_id == " id=") { jQuery(".fb_group_id").addClass('fts-empty-error'); jQuery("input#fb_group_id").focus(); return false; } if (fb_group_id != " id=") { jQuery(".fb_group_id").removeClass('fts-empty-error'); } if (facebook_height) { var facebook_height_final = ' height=' + jQuery("input#facebook_group_height").val(); } else { var facebook_height_final = ''; } <?php //Premium Plugin if (is_plugin_active('feed-them-premium/feed-them-premium.php')) { include WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/facebook-group-settings-js.js'; } else { ?> var final_fb_group_shorcode = '[fts facebook group' + fb_group_id + facebook_height_final + ' type=group]'; <?php } ?> jQuery('.facebook-group-final-shortcode').val(final_fb_group_shorcode); jQuery('.fb-group-shortcode-form .final-shortcode-textarea').slideDown(); } //END Facebook Group// //START Facebook Event// function updateTextArea_fb_event() { var fb_event_id = ' id=' + jQuery("input#fb_event_id").val(); var facebook_height = jQuery("input#facebook_event_height").val(); if (fb_event_id == " id=") { jQuery(".fb_event_id").addClass('fts-empty-error'); jQuery("input#fb_event_id").focus(); return false; } if (fb_event_id != " id=") { jQuery(".fb_event_id").removeClass('fts-empty-error'); } if (facebook_height) { var facebook_height_final = ' height=' + jQuery("input#facebook_event_height").val(); } else { var facebook_height_final = ''; } <?php //Premium Plugin if (is_plugin_active('feed-them-premium/feed-them-premium.php')) { include WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/facebook-event-settings-js.js'; } else { ?> var final_fb_event_shorcode = '[fts facebook event' + fb_event_id + facebook_height_final + ' type=event]'; <?php } ?> jQuery('.facebook-event-final-shortcode').val(final_fb_event_shorcode); jQuery('.fb-event-shortcode-form .final-shortcode-textarea').slideDown(); } //END Facebook Event// //START Twitter// function updateTextArea_twitter() { var twitter_name = ' twitter_name=' + jQuery("input#twitter_name").val(); var twitter_height = jQuery("input#twitter_height").val(); if (twitter_name == " twitter_name=") { jQuery(".twitter_name").addClass('fts-empty-error'); jQuery("input#twitter_name").focus(); return false; } if (twitter_name != " twitter_name=") { jQuery(".twitter_name").removeClass('fts-empty-error'); } if (twitter_height) { var twitter_height_final = ' twitter_height=' + jQuery("input#twitter_height").val(); } else { var twitter_height_final = ''; } <?php if (is_plugin_active('feed-them-premium/feed-them-premium.php')) { include WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/twitter-settings-js.js'; } else { ?> var final_twitter_shorcode = '[fts twitter' + twitter_name + twitter_height_final + ']'; <?php } ?> jQuery('.twitter-final-shortcode').val(final_twitter_shorcode); jQuery('.twitter-shortcode-form .final-shortcode-textarea').slideDown(); } //END Twitter// //START Instagram// function updateTextArea_instagram() { var instagram_id = ' instagram_id=' + jQuery("input#instagram_id").val(); var super_gallery = ' super_gallery=' + jQuery("select#instagram-custom-gallery").val(); var image_size = ' image_size=' + jQuery("input#fts-slicker-instagram-container-image-size").val(); var icon_size = ' icon_size=' + jQuery("input#fts-slicker-instagram-icon-center").val(); var space_between_photos = ' space_between_photos=' + jQuery("input#fts-slicker-instagram-container-margin").val(); var hide_date_likes_comments = ' hide_date_likes_comments=' + jQuery("select#fts-slicker-instagram-container-hide-date-likes-comments").val(); var center_container = ' center_container=' + jQuery("select#fts-slicker-instagram-container-position").val(); var image_stack_animation = ' image_stack_animation=' + jQuery("select#fts-slicker-instagram-container-animation").val(); var instagram_feed_type = ' type=' + jQuery("select#instagram-messages-selector").val(); var instagram_popup_option = ' popup=' + jQuery("select#instagram-popup-option").val(); if (instagram_id == " instagram_id=") { jQuery(".instagram_name").addClass('fts-empty-error'); jQuery("input#instagram_id").focus(); return false; } if (instagram_id != " instagram_id=") { jQuery(".instagram_name").removeClass('fts-empty-error'); } <?php //Premium Plugin if (is_plugin_active('feed-them-premium/feed-them-premium.php')) { include WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/instagram-settings-js.js'; } else { ?> if (jQuery("select#instagram-custom-gallery").val() == "no") { var final_instagram_shorcode = '[fts instagram' + instagram_id + instagram_feed_type +']'; } else { var final_instagram_shorcode = '[fts instagram' + instagram_id + super_gallery + image_size + icon_size + space_between_photos + hide_date_likes_comments + center_container + image_stack_animation + instagram_feed_type +']'; } <?php } ?> jQuery('.instagram-final-shortcode').val(final_instagram_shorcode); jQuery('.instagram-shortcode-form .final-shortcode-textarea').slideDown(); } //END Instagram// //START convert Instagram name to id// function converter_instagram_username() { var convert_instagram_username = jQuery("input#convert_instagram_username").val(); if (convert_instagram_username == "") { jQuery(".convert_instagram_username").addClass('fts-empty-error'); jQuery("input#convert_instagram_username").focus(); return false; } if (convert_instagram_username != "") { jQuery(".convert_instagram_username").removeClass('fts-empty-error'); var username = jQuery("input#convert_instagram_username").val(); console.log(username); jQuery.getJSON("https://api.instagram.com/v1/users/search?q="+username+"&access_token=267791236.f78cc02.bea846f3144a40acbf0e56b002c112f8&callback=?", { format: "json" }, function(data) { console.log(data); var final_instagram_us_id = data.data[0].id; jQuery('#instagram_id').val(final_instagram_us_id); jQuery('.final-instagram-user-id-textarea').slideDown(); }); } } //select all jQuery(".copyme").focus(function() { var jQuerythis = jQuery(this); jQuerythis.select(); // Work around Chrome's little problem jQuerythis.mouseup(function() { // Prevent further mouseup intervention jQuerythis.unbind("mouseup"); return false; }); }); jQuery( document ).ready(function() { jQuery( ".toggle-custom-textarea-show" ).click(function() { jQuery('textarea#fts-color-options-main-wrapper-css-input').slideToggle(); jQuery('.toggle-custom-textarea-show span').toggle(); jQuery('.fts-custom-css-text').toggle(); }); <?php //show the js for the discount option under social icons on the settings page if (is_plugin_active('feed-them-premium/feed-them-premium.php')) { // do not show the js below } else { ?> jQuery( "#discount-for-review" ).click(function() { jQuery('.discount-review-text').slideToggle(); }); <?php } ?> }); //end document ready </script> <?php //Premium JS if (is_plugin_active('feed-them-premium/feed-them-premium.php')) { include WP_CONTENT_DIR . '/plugins/feed-them-premium/admin/js/premium-js.php'; } }
function fts_twitter_func($atts) { include_once ABSPATH . 'wp-admin/includes/plugin.php'; $fts_functions = new feed_them_social_functions(); if (is_plugin_active('feed-them-premium/feed-them-premium.php')) { include WP_CONTENT_DIR . '/plugins/feed-them-premium/feeds/twitter/twitter-feed.php'; } else { extract(shortcode_atts(array('twitter_name' => '', 'twitter_height' => '', 'description_image' => ''), $atts)); $tweets_count = '5'; } ob_start(); $numTweets = $tweets_count; $name = $twitter_name; $excludeReplies = true; $data_cache = WP_CONTENT_DIR . '/plugins/feed-them-social/feeds/twitter/cache/twitter_data_cache-' . $name . '-num' . $numTweets . '.cache'; //Check Cache if (file_exists($data_cache) && !filesize($data_cache) == 0 && filemtime($data_cache) > time() - 1800 && false !== strpos($data_cache, '-num' . $numTweets . '')) { $fetchedTweets = $fts_functions->fts_get_feed_cache($data_cache); $cache_used = true; } else { include WP_CONTENT_DIR . '/plugins/feed-them-social/feeds/twitter/twitteroauth/twitteroauth.php'; $fts_twitter_custom_consumer_key = get_option('fts_twitter_custom_consumer_key'); $fts_twitter_custom_consumer_secret = get_option('fts_twitter_custom_consumer_secret'); $fts_twitter_custom_access_token = get_option('fts_twitter_custom_access_token'); $fts_twitter_custom_access_token_secret = get_option('fts_twitter_custom_access_token_secret'); //Use custom api info if (!empty($fts_twitter_custom_consumer_key) && !empty($fts_twitter_custom_consumer_secret) && !empty($fts_twitter_custom_access_token) && !empty($fts_twitter_custom_access_token_secret)) { $connection = new TwitterOAuthFTS($fts_twitter_custom_consumer_key, $fts_twitter_custom_consumer_secret, $fts_twitter_custom_access_token, $fts_twitter_custom_access_token_secret); } else { $connection = new TwitterOAuthFTS('dOIIcGrhWgooKquMWWXg', 'qzAE4t4xXbsDyGIcJxabUz3n6fgqWlg8N02B6zM', '1184502104-Cjef1xpCPwPobP5X8bvgOTbwblsmeGGsmkBzwdB', 'd789TWA8uwwfBDjkU0iJNPDz1UenRPTeJXbmZZ4xjY'); } // If excluding replies, we need to fetch more than requested as the // total is fetched first, and then replies removed. $totalToFetch = $excludeReplies ? max(50, $numTweets * 3) : $numTweets; $fetchedTweets = $connection->get('statuses/user_timeline', array('screen_name' => $name, 'count' => $totalToFetch, 'exclude_replies' => $excludeReplies, 'images' => $description_image)); } //END ELSE //Error Check if (isset($fetchedTweets->errors)) { $error_check = '<div>Oops, Somethings wrong. ' . $fetchedTweets->errors[0]->message . '.</div>'; if ($fetchedTweets->errors[0]->code == 32) { $error_check .= ' Please check that you have entered your Twitter API token information correctly.'; } if ($fetchedTweets->errors[0]->code == 34) { $error_check .= ' Please check the Twitter Username you have entered is correct.'; } } elseif (empty($fetchedTweets) && !isset($fetchedTweets->errors)) { $error_check = '<div>This account has no tweets. Please Tweet to see this feed.</div>'; } //Does Cache folder exists? If not make it! //IS RATE LIMIT REACHED? if (isset($fetchedTweets->errors)) { echo '<pre>'; print_r($fetchedTweets->errors); echo '</pre>'; } // Did the fetch fail? if (isset($error_check)) { echo $error_check; } else { if (!empty($fetchedTweets)) { //Cache It if (!isset($cache_used)) { $fts_functions->fts_create_feed_cache($data_cache, $fetchedTweets); } // Fetch succeeded. // Now update the array to store just what we need. // (Done here instead of PHP doing this for every page load) $limitToDisplay = min($numTweets, count($fetchedTweets)); for ($i = 0; $i < $limitToDisplay; $i++) { $tweet = $fetchedTweets[$i]; // Core info. $name = isset($tweet->user->name) ? $tweet->user->name : ""; $screen_name = isset($tweet->user->screen_name) ? $tweet->user->screen_name : ""; $protocol = isset($_SERVER["HTTPS"]) ? 'https://' : 'http://'; $not_protocol = !isset($_SERVER["HTTPS"]) ? 'https://' : 'http://'; $permalink = $protocol . 'twitter.com/' . $screen_name . '/status/' . $tweet->id_str; $user_permalink = $protocol . 'twitter.com/#!/' . $screen_name; //Is Media Set if (isset($tweet->entities->media[0]->media_url)) { $media_url = $tweet->entities->media[0]->media_url; $media_url = str_replace($not_protocol, $protocol, $media_url); } else { $media_url = ''; } // leaving this for another update, trying to get videos, and I know this ain't right! $url = $tweet->entities->media[0]->expanded_url; /* Alternative image sizes method: http://dev.twitter.com/doc/get/users/profile_image/:screen_name */ $image = isset($tweet->user->profile_image_url) ? $tweet->user->profile_image_url : ""; $image = str_replace($not_protocol, $protocol, $image); // Message. Convert links to real links. $pattern = array('/http:(\\S)+/', '/https:(\\S)+/', '/([^a-zA-Z0-9-_&])@([0-9a-zA-Z_]+)/', '/([^a-zA-Z0-9-_&])#([0-9a-zA-Z_]+)/'); $replace = array(' <a href="${0}" target="_blank" rel="nofollow">${0}</a>', ' <a href="${0}" target="_blank" rel="nofollow">${0}</a>', ' <a href="' . $protocol . 'twitter.com/$2" target="_blank" rel="nofollow">@$2</a>', ' <a href="' . $protocol . 'twitter.com/search?q=%23$2&src=hash" target="_blank" rel="nofollow">#$2</a>'); $text = preg_replace($pattern, $replace, $tweet->text); // Need to get time in Unix format. $times = isset($tweet->created_at) ? $tweet->created_at : ""; $CustomDateCheck = get_option('fts-date-and-time-format'); if ($CustomDateCheck) { $CustomDateFormatTwitter = get_option('fts-date-and-time-format'); } else { $CustomDateFormatTwitter = 'F jS, Y \\a\\t g:ia'; } date_default_timezone_set(get_option('fts-timezone')); $uTime = date($CustomDateFormatTwitter, strtotime($times) - 3 * 3600); $twitter_id = isset($tweet->id_str) ? $tweet->id_str : ""; $fts_twitter_full_width = get_option('twitter_full_width'); // Now make the new array. $tweets[] = array('text' => $text, 'name' => $name, 'screen_name' => $screen_name, 'user_permalink' => $user_permalink, 'permalink' => $permalink, 'image' => $image, 'time' => $uTime, 'media_url' => $media_url, 'id' => $twitter_id); } //End FOR fts-twitter-full-width ?> <div id="twitter-feed-<?php print $twitter_name; ?> " class="fts-twitter-div<?php if ($twitter_height !== 'auto' && empty($twitter_height) == NULL) { ?> fts-twitter-scrollable<?php } if ($popup == 'yes') { ?> popup-gallery-twitter<?php } ?> " <?php if ($twitter_height !== 'auto' && empty($twitter_height) == NULL) { ?> style="height:<?php echo $twitter_height; ?> "<?php } ?> > <?php foreach ($tweets as $t) { ?> <div class="fts-tweeter-wrap"> <div class="tweeter-info"> <?php if ($fts_twitter_full_width !== 'yes') { ?> <div class="fts-twitter-image"><a href="<?php print $t['user_permalink']; ?> " target="_blank" class="black"><img class="twitter-image" src="<?php print $t['image']; ?> " /></a></div> <?php } ?> <div class="<?php if ($fts_twitter_full_width == 'yes') { ?> fts-twitter-full-width<?php } else { ?> right<?php } ?> "> <div class="uppercase bold"><a href="<?php print $t['user_permalink']; ?> " target="_blank" class="black">@<?php print $t['screen_name']; ?> </a></div> <span class="time"><a href="<?php print $t['permalink']; ?> "><?php print $t['time']; ?> </a></span><br/> <span class="fts-twitter-text"><?php print $t['text']; ?> <div class="fts-fb-caption"><a href="<?php print $t['permalink']; ?> " class="fts-view-on-twitter-link" target="_blank">View on Twitter</a></div> </span> <?php if ($t['media_url']) { ?> <a href="<?php if ($popup == 'yes') { print $t['media_url']; } else { print $t['permalink']; } ?> " class="fts-twitter-link-image" target="_blank"><img class="fts-twitter-description-image" src="<?php print $t['media_url']; ?> " /></a> <?php } ?> </div> <div class="fts-twitter-reply-wrap"> <a href="<?php print $t['permalink']; ?> "> <div class="fts-twitter-reply"></div> </a></div> <div class="clear"></div> </div> </div> <?php } ?> <div class="clear"></div> </div> <?php if ($twitter_height !== 'auto' && empty($twitter_height) == NULL) { ?> <script> // this makes it so the page does not scroll if you reach the end of scroll bar or go back to top jQuery.fn.isolatedScrollTwitter = function() { this.bind('mousewheel DOMMouseScroll', function (e) { var delta = e.wheelDelta || (e.originalEvent && e.originalEvent.wheelDelta) || -e.detail, bottomOverflow = this.scrollTop + jQuery(this).outerHeight() - this.scrollHeight >= 0, topOverflow = this.scrollTop <= 0; if ((delta < 0 && bottomOverflow) || (delta > 0 && topOverflow)) { e.preventDefault(); } }); return this; }; jQuery('.fts-twitter-scrollable').isolatedScrollTwitter(); </script> <?php } ?> <?php } // END IF $fetchedTweets } //END ELSE return ob_get_clean(); }
function fts_instagram_func($atts) { $fts_functions = new feed_them_social_functions(); include_once ABSPATH . 'wp-admin/includes/plugin.php'; if (is_plugin_active('feed-them-premium/feed-them-premium.php')) { include WP_CONTENT_DIR . '/plugins/feed-them-premium/feeds/instagram/instagram-feed.php'; } else { extract(shortcode_atts(array('instagram_id' => '', 'type' => '', 'super_gallery' => '', 'image_size' => '', 'icon_size' => '', 'space_between_photos' => '', 'hide_date_likes_comments' => '', 'center_container' => '', 'image_stack_animation' => ''), $atts)); $pics_count = '6'; } $popup = isset($popup) ? $popup : ""; if ($popup == 'yes') { // it's ok if these styles & scripts load at the bottom of the page because they are just for the popup wp_enqueue_style('fts_instagram_css_popup', plugins_url('instagram/css/magnific-popup.css', dirname(__FILE__))); wp_enqueue_script('fts_instagram_popup_js', plugins_url('instagram/js/magnific-popup.js', dirname(__FILE__))); } ob_start(); $fts_instagram_tokens_array = array('267791236.df31d88.30e266dda9f84e9f97d9e603f41aaf9e', '267791236.14c1243.a5268d6ed4cf4d2187b0e98b365443af', '267791236.f78cc02.bea846f3144a40acbf0e56b002c112f8', '258559306.502d2c4.c5ff817f173547d89477a2bd2e6047f9'); $fts_instagram_access_token = $fts_instagram_tokens_array[array_rand($fts_instagram_tokens_array, 1)]; //URL to get Feeds if ($type == 'hashtag') { $insta_url = 'https://api.instagram.com/v1/tags/' . $instagram_id . '/media/recent/?access_token=' . $fts_instagram_access_token; } else { $insta_url = 'https://api.instagram.com/v1/users/' . $instagram_id . '/media/recent/?access_token=' . $fts_instagram_access_token; } $cache = WP_CONTENT_DIR . '/plugins/feed-them-social/feeds/instagram/cache/instagram-cache-' . $instagram_id . '.cache'; // https://api.instagram.com/v1/tags/snow/media/recent?access_token=ACCESS-TOKEN // https://instagram.com/oauth/authorize/?client_id=[CLIENT_ID_HERE]&redirect_uri=http://localhost&response_type=token //Get Data for Instagram $response = wp_remote_fopen($insta_url); //Error Check $error_check = json_decode($response); if (isset($error_check->meta->error_message)) { return $error_check->meta->error_message; } if (file_exists($cache) && !filesize($cache) == 0 && filemtime($cache) > time() - 900) { $insta_data = $fts_functions->fts_get_feed_cache($cache); } else { $insta_data = json_decode($response); //if Error DON'T Cache if (!isset($error_check->meta->error_message)) { $fts_functions->fts_create_feed_cache($cache, $insta_data); } } if ($super_gallery == 'yes') { ?> <div class="fts-slicker-instagram masonry js-masonry <?php if ($popup == 'yes') { print 'popup-gallery'; } ?> " style="margin:auto" data-masonry-options='{ "isFitWidth": <?php if ($center_container == 'no') { ?> false<?php } else { ?> true<?php } if ($image_stack_animation == 'no') { ?> , "transitionDuration": 0<?php } ?> }'> <?php } else { ?> <div class="fts-instagram <?php if ($popup == 'yes') { print 'popup-gallery'; } ?> "> <?php } $set_zero = 0; if (!isset($insta_data->data)) { return '<div style="padding-right:35px;">Looks like instagram\'s API down. Please try clearing cache and reloading this page in the near future.</div></div>'; } foreach ($insta_data->data as $insta_d) { if ($set_zero == $pics_count) { break; } //Create Instagram Variables $instagram_date = isset($insta_d->created_time) ? date('F j, Y', $insta_d->created_time) : ""; $instagram_link = isset($insta_d->link) ? $insta_d->link : ""; $instagram_thumb_url = isset($insta_d->images->thumbnail->url) ? $insta_d->images->thumbnail->url : ""; $instagram_lowRez_url = isset($insta_d->images->standard_resolution->url) ? $insta_d->images->standard_resolution->url : ""; if (isset($_SERVER["HTTPS"])) { $instagram_thumb_url = str_replace('http://', 'https://', $instagram_thumb_url); $instagram_lowRez_url = str_replace('http://', 'https://', $instagram_lowRez_url); } $instagram_likes = isset($insta_d->likes->count) ? $insta_d->likes->count : ""; $instagram_comments = isset($insta_d->comments->count) ? $insta_d->comments->count : ""; $instagram_caption_a_title = isset($insta_d->caption->text) ? $insta_d->caption->text : ""; //Create links from @mentions and regular links. $pattern = array('/http:(\\S)+/', '/https:(\\S)+/', '/([^a-zA-Z0-9-_&])@([0-9a-zA-Z_]+)/'); $replace = array(' <a href="${0}" target="_blank" rel="nofollow">${0}</a>', ' <a href="${0}" target="_blank" rel="nofollow">${0}</a>', ' <a href="http://instagram.com/$2" target="_blank" rel="nofollow">@$2</a>'); $instagram_caption = preg_replace($pattern, $replace, $instagram_caption_a_title); // Super Gallery If statement if ($super_gallery == 'yes') { ?> <div class='slicker-instagram-placeholder fts-instagram-wrapper' style="width:<?php print $image_size; ?> ; margin:<?php print $space_between_photos; ?> ;"> <?php if ($popup == 'yes') { ?> <div class="fts-instagram-caption"><?php if (!$instagram_caption == '') { print '' . $instagram_caption . '<br/>'; } ?> <a href='<?php print $instagram_link; ?> ' class="fts-view-on-instagram-link" target="_blank">View on Instagram</a></div> <?php } ?> <a href='<?php if ($popup == 'yes') { print $instagram_lowRez_url; } else { print $instagram_link; } ?> ' title='<?php print $instagram_caption_a_title; ?> ' target="_blank" class='fts-slicker-backg fts-instagram-img-link' style="height:<?php print $icon_size; ?> !important; width:<?php print $icon_size; ?> ; line-height:<?php print $icon_size; ?> ; font-size:<?php print $icon_size; ?> ;"><span class="fts-instagram-icon" style="height:<?php print $icon_size; ?> ; width:<?php print $icon_size; ?> ; line-height:<?php print $icon_size; ?> ; font-size:<?php print $icon_size; ?> ;"></span></a> <?php if ($hide_date_likes_comments == 'no') { ?> <div class='slicker-date'><?php print $instagram_date; ?> </div> <?php } ?> <div class='slicker-instaG-backg-link'> <div class='slicker-instagram-image'><img src="<?php print $instagram_lowRez_url; ?> " /></div> <div class='slicker-instaG-photoshadow'></div> </div> <?php if ($hide_date_likes_comments == 'no') { ?> <ul class='slicker-heart-comments-wrap'> <li class='slicker-instagram-image-likes'><?php print $instagram_likes; ?> </li> <li class='slicker-instagram-image-comments'><span class="fts-comment-instagram"></span><?php print $instagram_comments; ?> </li> </ul> <?php } ?> </div> <?php } else { ?> <div class='instagram-placeholder fts-instagram-wrapper'><?php if ($popup == 'yes') { print '<div class="fts-backg"></div>'; } else { ?> <a class='fts-backg' target='_blank' href='<?php print $instagram_link; ?> '></a> <?php } ?> <div class='date'><?php print $instagram_date; ?> </div> <?php if ($popup == 'yes') { ?> <div class="fts-instagram-caption"><?php if (!$instagram_caption == '') { print '' . $instagram_caption . '<br/>'; } ?> <a href='<?php print $instagram_link; ?> ' class="fts-view-on-instagram-link" target="_blank">View on Instagram</a></div> <?php } ?> <a href="<?php if ($popup == 'yes') { print $instagram_lowRez_url; } else { print $instagram_link; } ?> " class='instaG-backg-link fts-instagram-img-link' target='_blank' title="<?php print $instagram_caption_a_title; ?> "> <img src="<?php print $instagram_thumb_url; ?> " class="instagram-image" /> <div class='instaG-photoshadow'></div> </a> <ul class='heart-comments-wrap'> <li class='instagram-image-likes'><?php print $instagram_likes; ?> </li> <li class='instagram-image-comments'><?php print $instagram_comments; ?> </li> </ul> </div> <?php } $set_zero++; } ?> <div class="clear"></div> </div> <?php return ob_get_clean(); }