Feed Them Social – Facebook, Instagram, Twitter, YouTube, Pinterest - Version 2.6.1

Version Description

Download this release

Release Info

Developer slickremix
Plugin Icon 128x128 Feed Them Social – Facebook, Instagram, Twitter, YouTube, Pinterest
Version 2.6.1
Comparing to
See all releases

Code changes from version 2.6.0 to 2.6.1

admin/class-fts-instagram-options-page.php CHANGED
@@ -30,12 +30,14 @@ class FTS_Instagram_Options_Page {
30
  public function __construct() {
31
  }
32
 
 
33
  /**
34
  * Feed Them Instagram Options Page
35
  *
36
  * @since 1.9.6
37
  */
38
  public function feed_them_instagram_options_page() {
 
39
  $fts_instagram_access_token = get_option( 'fts_instagram_custom_api_token' );
40
  $fts_instagram_custom_id = get_option( 'fts_instagram_custom_id' );
41
  $fts_instagram_show_follow_btn = get_option( 'instagram_show_follow_btn' );
@@ -82,7 +84,8 @@ class FTS_Instagram_Options_Page {
82
  </h3>
83
  <?php
84
 
85
- $insta_url = esc_url( 'https://api.instagram.com/v1/tags/slickremix/media/recent/?access_token=' . $fts_instagram_access_token );
 
86
  // Get Data for Instagram!
87
  $response = wp_remote_fopen( $insta_url );
88
  // Error Check!
@@ -90,13 +93,14 @@ class FTS_Instagram_Options_Page {
90
  ?>
91
  <p>
92
  <?php
93
- echo sprintf(
94
- esc_html( 'This is required to make the feed work. Just click the button below and it will connect to your Instagram to get an access token, then it will return it in the input below. Then just click the save button and you will now be able to generate your Instagram feed. If the button is not working for you and can always %1$s manually create an Access Token.%2$s', 'feed-them-social' ),
95
- '<a href="' . esc_url( 'https://www.slickremix.com/docs/how-to-create-instagram-access-token/' ) . '" target="_blank">',
96
- '</a>'
97
- );
98
- ?>
99
  </p>
 
 
 
 
 
100
  <p>
101
  <?php
102
  echo sprintf(
@@ -121,44 +125,54 @@ class FTS_Instagram_Options_Page {
121
 
122
  <div class="feed-them-social-admin-input-wrap">
123
  <div class="feed-them-social-admin-input-label fts-instagram-border-bottom-color-label">
124
- <?php esc_html_e( 'Access Token Required', 'feed-them-social' ); ?>
 
 
 
 
 
 
 
125
  </div>
126
 
127
  <input type="text" name="fts_instagram_custom_api_token" class="feed-them-social-admin-input" id="fts_instagram_custom_api_token" value="<?php echo esc_attr( $access_token ); ?>"/>
128
  <div class="fts-clear"></div>
129
  </div>
130
- <?php
131
- // Error Check
132
- // if the combined streams plugin is active we won't allow the settings page link to open up the Instagram Feed, instead we'll remove the #feed_type=instagram and just let the user manually select the combined streams or single instagram feed.
133
- if ( is_plugin_active( 'feed-them-social-combined-streams/feed-them-social-combined-streams.php' ) ) {
134
- $custom_instagram_link_hash = '';
135
- } else {
136
- $custom_instagram_link_hash = '#feed_type=instagram';
137
- }
138
- if ( ! isset( $test_app_token_response->meta->error_message ) && ! isset( $test_app_token_response->error_message ) && ! empty( $fts_instagram_access_token ) || isset( $test_app_token_response->meta->error_message ) && 'This client has not been approved to access this resource.' === $test_app_token_response->meta->error_message ) {
139
- echo sprintf(
140
- esc_html( '%1$sYour access token is working! Generate your shortcode on the %2$sSettings Page%3$s', 'feed-them-social' ),
141
- '<div class="fts-successful-api-token">',
142
- '<a href="' . esc_url( 'admin.php?page=feed-them-settings-page' . $custom_instagram_link_hash ) . '">',
143
- '</a></div>'
144
- );
145
- } elseif ( isset( $test_app_token_response->meta->error_message ) && ! empty( $fts_instagram_access_token ) || isset( $test_app_token_response->error_message ) && ! empty( $fts_instagram_access_token ) ) {
146
- $text = isset( $test_app_token_response->meta->error_message ) ? $test_app_token_response->meta->error_message : $test_app_token_response->error_message;
147
- echo sprintf(
148
- esc_html( '%1$sOh No something\'s wrong. %2$s. %3$s.', 'feed-them-social' ),
149
- '<div class="fts-failed-api-token">',
150
- esc_html( $text ),
151
- '</div>'
152
- );
153
- }
154
- if ( empty( $fts_instagram_access_token ) ) {
155
- echo sprintf(
156
- esc_html( '%1$sYou are required to get an access token to view your photos. Click Save all Changes after getting your Access Token.%2$s', 'feed-them-social' ),
157
- '<div class="fts-failed-api-token">',
158
- '</div>'
159
- );
160
- }
161
- ?>
 
 
 
162
  <div class="fts-clear"></div>
163
  </div>
164
 
30
  public function __construct() {
31
  }
32
 
33
+
34
  /**
35
  * Feed Them Instagram Options Page
36
  *
37
  * @since 1.9.6
38
  */
39
  public function feed_them_instagram_options_page() {
40
+ $fts_functions = new feed_them_social_functions();
41
  $fts_instagram_access_token = get_option( 'fts_instagram_custom_api_token' );
42
  $fts_instagram_custom_id = get_option( 'fts_instagram_custom_id' );
43
  $fts_instagram_show_follow_btn = get_option( 'instagram_show_follow_btn' );
84
  </h3>
85
  <?php
86
 
87
+
88
+ $insta_url = esc_url( 'https://api.instagram.com/v1/users/self/?access_token=' . $fts_instagram_access_token );
89
  // Get Data for Instagram!
90
  $response = wp_remote_fopen( $insta_url );
91
  // Error Check!
93
  ?>
94
  <p>
95
  <?php
96
+ echo esc_html( 'This is required to make the Instagram Feed work. Click the button below and it will connect to your Instagram Account to get an access token. It will then return to this page and save it in the inputs below. After it finishes you will be able to generate your Instagram feed.', 'feed-them-social' );
97
+ ?>
 
 
 
 
98
  </p>
99
+ <p>
100
+ <?php
101
+ echo esc_html( 'If you need to generate more than one feed simply remove the Instagram ID and Access Token and click the Save All Changes button at the bottom of the page. Make sure you are logged out of your current Instagram Account and click the button to get a new access token. You will be prompted to login to Instagram with your new account username and password. Once the new access token is returned you can then create another feed.', 'feed-them-social' );
102
+ ?>
103
+ </p>
104
  <p>
105
  <?php
106
  echo sprintf(
125
 
126
  <div class="feed-them-social-admin-input-wrap">
127
  <div class="feed-them-social-admin-input-label fts-instagram-border-bottom-color-label">
128
+ <?php esc_html_e( 'Access Token', 'feed-them-social' );
129
+
130
+
131
+ if ( isset( $_GET['access_token'] ) ) {
132
+ // START AJAX TO SAVE TOKEN TO DB
133
+ $fts_functions->feed_them_instagram_save_token();
134
+ }
135
+ ?>
136
  </div>
137
 
138
  <input type="text" name="fts_instagram_custom_api_token" class="feed-them-social-admin-input" id="fts_instagram_custom_api_token" value="<?php echo esc_attr( $access_token ); ?>"/>
139
  <div class="fts-clear"></div>
140
  </div>
141
+
142
+ <div class="feed-them-social-admin-input-wrap fts-instagram-last-row" style="margin-top: 0; padding-top: 0">
143
+ <?php
144
+ // Error Check
145
+ // if the combined streams plugin is active we won't allow the settings page link to open up the Instagram Feed, instead we'll remove the #feed_type=instagram and just let the user manually select the combined streams or single instagram feed.
146
+ if ( is_plugin_active( 'feed-them-social-combined-streams/feed-them-social-combined-streams.php' ) ) {
147
+ $custom_instagram_link_hash = '';
148
+ } else {
149
+ $custom_instagram_link_hash = '#feed_type=instagram';
150
+ }
151
+ if ( ! isset( $test_app_token_response->meta->error_message ) && ! isset( $test_app_token_response->error_message ) && ! empty( $fts_instagram_access_token ) || isset( $test_app_token_response->meta->error_message ) && 'This client has not been approved to access this resource.' === $test_app_token_response->meta->error_message ) {
152
+ echo sprintf(
153
+ esc_html( '%1$sYour access token is working! Generate your shortcode on the %2$sSettings Page%3$s', 'feed-them-social' ),
154
+ '<div class="fts-successful-api-token">',
155
+ '<a href="' . esc_url( 'admin.php?page=feed-them-settings-page' . $custom_instagram_link_hash ) . '">',
156
+ '</a></div>'
157
+ );
158
+ } elseif ( isset( $test_app_token_response->meta->error_message ) && ! empty( $fts_instagram_access_token ) || isset( $test_app_token_response->error_message ) && ! empty( $fts_instagram_access_token ) ) {
159
+ $text = isset( $test_app_token_response->meta->error_message ) ? $test_app_token_response->meta->error_message : $test_app_token_response->error_message;
160
+ echo sprintf(
161
+ esc_html( '%1$sOh No something\'s wrong. %2$s. Please try clicking the button again to get a new access token. If you need additional assistance please email us at support@slickremix.com %3$s', 'feed-them-social' ),
162
+ '<div class="fts-failed-api-token">',
163
+ esc_html( $text ),
164
+ '</div>'
165
+ );
166
+ }
167
+ if ( empty( $fts_instagram_access_token ) && empty($_GET['access_token']) ) {
168
+ echo sprintf(
169
+ esc_html( '%1$sYou are required to get an access token to view your photos.%2$s', 'feed-them-social' ),
170
+ '<div class="fts-failed-api-token">',
171
+ '</div>'
172
+ );
173
+ }
174
+ ?>
175
+ </div>
176
  <div class="fts-clear"></div>
177
  </div>
178
 
feed-them.php CHANGED
@@ -7,20 +7,20 @@
7
  * Plugin Name: Feed Them Social (Facebook, Instagram, Twitter, etc)
8
  * Plugin URI: https://feedthemsocial.com/
9
  * Description: Customize feeds for Facebook Pages, Album Photos, Videos & Covers, Instagram, Twitter, Pinterest & YouTube on pages, posts or widgets.
10
- * Version: 2.6.0
11
  * Author: SlickRemix
12
  * Author URI: https://www.slickremix.com/
13
  * Text Domain: feed-them-social
14
  * Domain Path: /languages
15
  * Requires at least: WordPress 4.0.0
16
- * Tested up to: WordPress 4.9.8
17
- * Stable tag: 2.6.0
18
  * License: GPLv2 or later
19
  * License URI: https://www.gnu.org/licenses/gpl-3.0.html
20
  *
21
- * @version 2.6.0
22
  * @package FeedThemSocial/Core
23
- * @copyright Copyright (c) 2012-2018 SlickRemix
24
  *
25
  * Need Support: https://wordpress.org/support/plugin/feed-them-social
26
  * Paid Extension Support: https://www.slickremix.com/my-account/#tab-support
@@ -31,7 +31,7 @@
31
  *
32
  * Makes sure any js or css changes are reloaded properly. Added to enqued css and js files throughout!
33
  */
34
- define( 'FTS_CURRENT_VERSION', '2.6.0' );
35
 
36
  define( 'FEED_THEM_SOCIAL_NOTICE_STATUS', get_option( 'rating_fts_slick_notice', false ) );
37
 
7
  * Plugin Name: Feed Them Social (Facebook, Instagram, Twitter, etc)
8
  * Plugin URI: https://feedthemsocial.com/
9
  * Description: Customize feeds for Facebook Pages, Album Photos, Videos & Covers, Instagram, Twitter, Pinterest & YouTube on pages, posts or widgets.
10
+ * Version: 2.6.1
11
  * Author: SlickRemix
12
  * Author URI: https://www.slickremix.com/
13
  * Text Domain: feed-them-social
14
  * Domain Path: /languages
15
  * Requires at least: WordPress 4.0.0
16
+ * Tested up to: WordPress 5.0.1
17
+ * Stable tag: 2.6.1
18
  * License: GPLv2 or later
19
  * License URI: https://www.gnu.org/licenses/gpl-3.0.html
20
  *
21
+ * @version 2.6.1
22
  * @package FeedThemSocial/Core
23
+ * @copyright Copyright (c) 2012-2019 SlickRemix
24
  *
25
  * Need Support: https://wordpress.org/support/plugin/feed-them-social
26
  * Paid Extension Support: https://www.slickremix.com/my-account/#tab-support
31
  *
32
  * Makes sure any js or css changes are reloaded properly. Added to enqued css and js files throughout!
33
  */
34
+ define( 'FTS_CURRENT_VERSION', '2.6.1' );
35
 
36
  define( 'FEED_THEM_SOCIAL_NOTICE_STATUS', get_option( 'rating_fts_slick_notice', false ) );
37
 
includes/feed-them-functions.php CHANGED
@@ -7,1151 +7,1292 @@ namespace feedthemsocial;
7
  * @package feedthemsocial
8
  * @since 1.9.6
9
  */
10
- class feed_them_social_functions {
11
-
12
- /**
13
- * Construct
14
- *
15
- * Functions constructor.
16
- *
17
- * @since 1.9.6
18
- */
19
- public function __construct() {
20
- $root_file = plugin_dir_path( dirname( __FILE__ ) );
21
- $this->premium = str_replace( 'feed-them-social/', 'feed-them-premium/', $root_file );
22
- $this->facebook_carousel_premium = str_replace( 'feed-them-social/', 'feed-them-carousel-premium/', $root_file );
23
- $this->facebook_reviews = str_replace( 'feed-them-social/', 'feed-them-social-facebook-reviews/', $root_file );
24
-
25
- // FTS Activation Function. Commenting out for future use. SRL!
26
- register_deactivation_hook( __FILE__, array( $this, 'fts_get_check_plugin_version' ) );
27
- // Widget Code!
28
- add_filter( 'widget_text', 'do_shortcode' );
29
- // This is for the fts_clear_cache_ajax submission!
30
- if ( 'show-admin-bar-menu' === get_option( 'fts_admin_bar_menu' ) ) {
31
- add_action( 'init', array( $this, 'fts_clear_cache_script' ) );
32
- add_action( 'wp_head', array( $this, 'my_fts_ajaxurl' ) );
33
- add_action( 'wp_ajax_fts_clear_cache_ajax', array( $this, 'fts_clear_cache_ajax' ) );
34
- }
35
-
36
- add_action( 'wp_ajax_fts_refresh_token_ajax', array( $this, 'fts_refresh_token_ajax' ) );
37
-
38
- if ( is_admin() || is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) || is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) || is_plugin_active( 'fts-bar/fts-bar.php' ) ) {
39
- // Load More Options!
40
- add_action( 'wp_ajax_my_fts_fb_load_more', array( $this, 'my_fts_fb_load_more' ) );
41
- add_action( 'wp_ajax_nopriv_my_fts_fb_load_more', array( $this, 'my_fts_fb_load_more' ) );
42
- add_action( 'wp_ajax_my_fts_fb_options_page_load_more', array( $this, 'my_fts_fb_options_page_load_more' ) );
43
- }
44
-
45
- add_shortcode( 'fts_fb_page_token', array( $this, 'fts_fb_page_token_func' ) );
46
- }
47
-
48
- /**
49
- * Init
50
- *
51
- * For Loading in the Admin.
52
- *
53
- * @since 1.9.6
54
- */
55
- public function init() {
56
- if ( is_admin() ) {
57
- // Register Settings!
58
- add_action( 'admin_init', array( $this, 'fts_settings_page_register_settings' ) );
59
- add_action( 'admin_init', array( $this, 'fts_facebook_style_options_page' ) );
60
- add_action( 'admin_init', array( $this, 'fts_twitter_style_options_page' ) );
61
- add_action( 'admin_init', array( $this, 'fts_instagram_style_options_page' ) );
62
- add_action( 'admin_init', array( $this, 'fts_pinterest_style_options_page' ) );
63
- add_action( 'admin_init', array( $this, 'fts_youtube_style_options_page' ) );
64
-
65
- // Adds setting page to FTS menu!
66
- add_action( 'admin_menu', array( $this, 'feed_them_main_menu' ) );
67
- add_action( 'admin_menu', array( $this, 'feed_them_submenu_pages' ) );
68
- // THIS GIVES US SOME OPTIONS FOR STYLING THE ADMIN AREA!
69
- add_action( 'admin_enqueue_scripts', array( $this, 'feed_them_admin_css' ) );
70
- // Main Settings Page!
71
- if ( isset( $_GET['page'] ) && 'feed-them-settings-page' === $_GET['page'] || isset( $_GET['page'] ) && 'fts-facebook-feed-styles-submenu-page' === $_GET['page'] || isset( $_GET['page'] ) && 'fts-twitter-feed-styles-submenu-page' === $_GET['page'] || isset( $_GET['page'] ) && 'fts-instagram-feed-styles-submenu-page' === $_GET['page'] || isset( $_GET['page'] ) && 'fts-pinterest-feed-styles-submenu-page' === $_GET['page'] || isset( $_GET['page'] ) && 'fts-youtube-feed-styles-submenu-page' === $_GET['page'] ) {
72
- add_action( 'admin_enqueue_scripts', array( $this, 'feed_them_settings' ) );
73
- }
74
- // System Info Page!
75
- if ( isset( $_GET['page'] ) && 'fts-system-info-submenu-page' === $_GET['page'] ) {
76
- add_action( 'admin_enqueue_scripts', array( $this, 'feed_them_system_info_css' ) );
77
- }
78
- // FTS License Page!
79
- if ( isset( $_GET['page'] ) && 'fts-license-page' === $_GET['page'] ) {
80
- add_action( 'admin_footer', array( $this, 'fts_plugin_license' ) );
81
- }
82
- }
83
-
84
- // FTS Admin Bar!
85
- add_action( 'wp_before_admin_bar_render', array( $this, 'fts_admin_bar_menu' ), 999 );
86
- // Settings option. Add Custom CSS to the header of FTS pages only!
87
- $fts_include_custom_css_checked_css = get_option( 'fts-color-options-settings-custom-css' );
88
- if ( '1' === $fts_include_custom_css_checked_css ) {
89
- add_action( 'wp_enqueue_scripts', array( $this, 'fts_color_options_head_css' ) );
90
- }
91
- // Facebook Settings option. Add Custom CSS to the header of FTS pages only!
92
- $fts_include_fb_custom_css_checked_css = '1';
93
- if ( '1' === $fts_include_fb_custom_css_checked_css ) {
94
- add_action( 'wp_enqueue_scripts', array( $this, 'fts_fb_color_options_head_css' ) );
95
- }
96
- // Settings option. Custom Powered by Feed Them Social Option!
97
- $fts_powered_text_options_settings = get_option( 'fts-powered-text-options-settings' );
98
- if ( '1' !== $fts_powered_text_options_settings ) {
99
- add_action( 'wp_enqueue_scripts', array( $this, 'fts_powered_by_js' ) );
100
- }
101
-
102
- if ( is_plugin_active( 'jetpack/jetpack.php' ) ) {
103
- add_filter( 'jetpack_photon_skip_image', array( $this, 'fts_jetpack_photon_exception' ), 10, 3 );
104
- }
105
- }
106
-
107
- /**
108
- * FTS JetPack Photon Option Exception
109
- *
110
- * This function resolves issues with images and JetPack
111
- *
112
- * @param string $val value.
113
- * @param string $src source.
114
- * @param string $tag tag.
115
- * @return bool
116
- * @since @since 1.9.6
117
- */
118
- public function fts_jetpack_photon_exception( $val, $src, $tag ) {
119
- if ( strpos( $src, 'fbcdn.net' ) ) {
120
- return true;
121
- }
122
- return $val;
123
- }
124
-
125
- /**
126
- * FTS Share Option
127
- *
128
- * @param string $fb_link link for social network.
129
- * @param string $description description field for some of the social networks.
130
- * @since
131
- */
132
- public function fts_share_option( $fb_link, $description ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
 
134
  $hide_share = get_option( 'fts_disable_share_button', true ) ? get_option( 'fts_disable_share_button', true ) : '';
135
 
136
- if ( isset($hide_share) && '1' !== $hide_share ) {
137
  // Social media sharing URLs
138
- $link = $fb_link;
139
- $description = wp_strip_all_tags( $description );
140
  $ft_gallery_share_linkedin = 'https://www.linkedin.com/shareArticle?mini=true&url=' . $link;
141
- $ft_gallery_share_email = 'mailto:?subject=Shared Link&body=' . $link . ' - ' . $description;
142
  $ft_gallery_share_facebook = 'https://www.facebook.com/sharer/sharer.php?u=' . $link;
143
- $ft_gallery_share_twitter = 'https://twitter.com/intent/tweet?text=' . $link . '+' . $description;
144
- $ft_gallery_share_google = 'https://plus.google.com/share?url=' . $link;
145
 
146
  // The share wrap and links
147
- $output = '<div class="fts-share-wrap">';
148
- $output .= '<a href="javascript:;" class="ft-gallery-link-popup">' . esc_html( '', 'feed-them-social' ) . '</a>';
149
- $output .= '<div class="ft-gallery-share-wrap">';
150
- $output .= '<a href="' . esc_attr( $ft_gallery_share_facebook ) . '" target="_blank" class="ft-galleryfacebook-icon"><i class="fa fa-facebook-square"></i></a>';
151
- $output .= '<a href="' . esc_attr( $ft_gallery_share_twitter ) . '" target="_blank" class="ft-gallerytwitter-icon"><i class="fa fa-twitter"></i></a>';
152
- $output .= '<a href="' . esc_attr( $ft_gallery_share_google ) . '" target="_blank" class="ft-gallerygoogle-icon"><i class="fa fa-google-plus"></i></a>';
153
- $output .= '<a href="' . esc_attr( $ft_gallery_share_linkedin ) . '" target="_blank" class="ft-gallerylinkedin-icon"><i class="fa fa-linkedin"></i></a>';
154
- $output .= '<a href="' . esc_attr( $ft_gallery_share_email ) . '" target="_blank" class="ft-galleryemail-icon"><i class="fa fa-envelope"></i></a>';
155
- $output .= '</div>';
156
- $output .= '</div>';
157
  return $output;
158
- }
159
- }
160
-
161
- /**
162
- * FTS FB Options Page Function
163
- *
164
- * Display FB Page tokens for users
165
- *
166
- * @return mixed
167
- * @since 2.1.4
168
- */
169
- public function fts_fb_page_token_func() {
170
- $fts_fb_page_token_users_nonce = wp_create_nonce( 'fts-fb-page-token-users-nonce' );
171
-
172
- if ( wp_verify_nonce( $fts_fb_page_token_users_nonce, 'fts-fb-page-token-users-nonce' ) ) {
173
-
174
- // Make sure it's not ajaxing!
175
- if ( ! isset( $_GET['load_more_ajaxing'] ) ) {
176
- $_REQUEST['fts_dynamic_name'] = sanitize_key( $this->feed_them_social_rand_string() );
177
- } //End make sure it's not ajaxing!
178
-
179
- ob_start();
180
-
181
- if ( ! isset( $_GET['locations'] ) ) {
182
- $fb_token_response = isset( $_REQUEST['next_url'] ) ? wp_remote_fopen( esc_url_raw( $_REQUEST['next_url'] ) ) : wp_remote_fopen( 'https://graph.facebook.com/me/accounts?fields=locations{name,id,page_username,locations,store_number,store_location_descriptor,access_token},name,id,link,access_token&access_token=' . $_GET['access_token'] . '&limit=25' );
183
- $test_fb_app_token_response = json_decode( $fb_token_response );
184
- $_REQUEST['next_url'] = isset( $test_fb_app_token_response->paging->next ) ? esc_url_raw( $test_fb_app_token_response->paging->next ) : '';
185
- } else {
186
- $fb_token_response = isset( $_REQUEST['next_location_url'] ) ? wp_remote_fopen( esc_url_raw( $_REQUEST['next_location_url'] ) ) : '';
187
- $test_fb_app_token_response = json_decode( $fb_token_response );
188
- }
189
-
190
- // echo '<pre>';
191
- // echo _r($test_fb_app_token_response);
192
- // echo '</pre>';
193
- // Make sure it's not ajaxing!
194
- if ( ! isset( $_GET['load_more_ajaxing'] ) ) {
195
- // ******************
196
- // Load More BUTTON Start
197
- // ******************
198
- ?>
199
- <div class="fts-clear"></div>
200
- <?php
201
- } //End make sure it's not ajaxing!
202
-
203
- $build_shortcode = 'fts_fb_page_token';
204
-
205
- // Make sure it's not ajaxing!
206
- if ( ! isset( $_GET['load_more_ajaxing'] ) ) {
207
-
208
- $reviews_token = isset( $_GET['reviews_token'] ) ? 'yes' : 'no';
209
- ?>
210
- <div id="fb-list-wrap">
211
- <div class="fts-pages-info"> <?php echo esc_html( 'Click on a page in the list below and it will add the Page ID and Access Token above, then click save.', 'feed-them-social' ); ?></div>
212
- <ul class="fb-page-list fb-page-master-list">
213
- <?php
214
- } //End make sure it's not ajaxing!
215
-
216
- foreach ( $test_fb_app_token_response->data as $data ) {
217
- ?>
218
- <li class="fts-fb-main-page-li">
219
- <div class="fb-click-wrapper" >
220
- <div class="fb-image">
221
- <img border="0" height="50" width="50" src="<?php echo esc_url( 'https://graph.facebook.com/' . $data->id . '/picture' ); ?>"/>
222
- </div>
223
- <div class="fb-name-wrap"><span class="fb-name">
 
 
224
  <?php
225
- echo esc_html( $data->name );
226
- if ( isset( $data->store_number, $data->store_location_descriptor ) ) {
227
- print '(' . $data->store_location_descriptor . ')'; }
228
- ?>
 
229
  </span></div>
230
- <div class="fb-other-wrap">
231
- <small>
232
- <?php echo esc_html( 'ID: ', 'feed-them-social' ); ?>
233
- <span class="fts-api-facebook-id"><?php echo esc_html( $data->id ); ?></span>
234
- <?php echo isset( $data->store_number ) ? esc_html( '| Location: ' . $data->store_number, 'feed-them-social' ) : ''; ?>
235
- </small>
236
- </div>
237
- <div class="page-token"><?php echo esc_attr( $data->access_token ); ?></div>
238
- <?php
239
- $facebook_input_token = get_option( 'fts_facebook_custom_api_token' );
240
- $facebook_access_token = $data->access_token;
241
- if ( $facebook_input_token === $facebook_access_token ) {
242
- ?>
243
- <div class="feed-them-social-admin-submit-btn " style="display: block !important;">Active</div>
244
- <?php } else { ?>
245
- <div class="feed-them-social-admin-submit-btn fts-token-save">Save</div>
246
- <?php } ?>
247
- <div class="fts-clear"></div>
248
- </div>
249
- <?php
250
- $_REQUEST['next_location_url'] = isset( $data->locations->paging->next ) ? esc_url_raw( $data->locations->paging->next ) : '';
251
- $remove_class_or_not = isset( $data->locations->paging->next ) ? 'fb-sublist-page-id-' . esc_attr( $data->id ) : '';
252
- if ( isset( $data->locations->data ) ) {
253
- $location_count = count( $data->locations->data );
254
- $location_plus_sign = isset( $data->locations->paging->next ) ? '+' : '';
255
- $location_text = 1 === $location_count ? esc_html( $location_count . ' ' . esc_html( 'Location for', 'feed-them-social' ) ) : esc_html( $location_count . $location_plus_sign . ' ' . esc_html( 'Locations for', 'feed-them-social' ) );
256
- // if the locations equal 3 or less we will set the location container height to auto so the scroll loadmore does not fire.
257
- $location_scroll_loadmore_needed_check = $location_count <= 3 ? 'height:auto !important' : 'height: 200px !important;';
258
- }
259
-
260
- if ( ! isset( $_GET['locations'] ) && isset( $data->locations->data ) ) {
261
- ?>
262
- <div class="fts-fb-location-text-wrap"><?php echo esc_html( $location_text . ' ' . $data->name ); ?></div>
263
- <ul class="fb-page-list fb-sublist <?php echo esc_attr( $remove_class_or_not ); ?>" style="<?php echo esc_attr( $location_scroll_loadmore_needed_check ); ?>">
264
- <?php foreach ( $data->locations->data as $location ) { ?>
265
- <li>
266
- <div class="fb-click-wrapper">
267
- <div class="fb-image">
268
- <img border="0" height="50" width="50" src="<?php echo esc_url( 'https://graph.facebook.com/' . $location->id . '/picture' ); ?>"/>
269
- </div>
270
- <div class="fb-name-wrap"><span class="fb-name"><?php echo esc_html( $location->name ); ?>
271
- <?php
272
- if ( isset( $location->store_location_descriptor ) ) {
273
- echo '(' . esc_html( $location->store_location_descriptor ) . ')'; }
274
- ?>
 
 
 
 
 
 
275
  </span></div>
276
- <div class="fb-other-wrap">
277
- <small>
278
- <?php echo esc_html( 'ID: ', 'feed-them-social' ); ?>
279
- <span class="fts-api-facebook-id"><?php echo esc_html( $location->id ); ?></span>
280
- <?php
281
- if ( isset( $location->store_number ) ) {
282
- print '| ';
283
- esc_html( 'Location:', 'feed-them-social' );
284
- print ' ' . esc_html( $location->store_number );
285
- }
286
- ?>
287
- </small></div>
288
-
289
- <div class="page-token"><?php echo esc_html( $location->access_token ); ?></div>
290
- <?php
291
- $facebook_input_token = get_option( 'fts_facebook_custom_api_token' );
292
- $facebook_access_token = $location->access_token;
293
- if ( $facebook_input_token === $facebook_access_token ) {
294
- ?>
295
- <div class="feed-them-social-admin-submit-btn " style="display: block !important;">Active
296
- </div>
297
- <?php } else { ?>
298
- <div class="feed-them-social-admin-submit-btn fts-token-save">Save</div>
299
- <?php } ?>
300
- <div class="fts-clear"></div>
301
- </div>
302
- </li>
303
- <?php } ?>
304
- </ul>
305
-
306
- <?php
307
- // Make sure it's not ajaxing locations!
308
- if ( ! isset( $_GET['locations'] ) && isset( $data->locations->paging->next ) ) {
309
- echo '<div id="loadMore_' . esc_attr( $data->id ) . '_location" class="fts-fb-load-more" style="background:none !Important;">' . esc_html( 'Scroll to view more Locations', 'feed-them-instagram' ) . '</div>';
310
- }//End Check
311
-
312
- // Make sure it's not ajaxing locations!
313
- if ( ! isset( $_GET['locations'] ) ) {
314
- $time = time();
315
- $nonce = wp_create_nonce( $time . 'load-more-nonce' );
316
- $fb_page_id = $data->id;
317
- ?>
318
- <script>
319
- jQuery(document).ready(function () {
320
- jQuery(".fb-sublist-page-id-<?php echo esc_js( $fb_page_id ); ?>").bind("scroll", function () {
321
- if (jQuery(this).scrollTop() + jQuery(this).innerHeight() >= jQuery(this)[0].scrollHeight) {
322
- if(!jQuery('.fts-no-more-locations-<?php echo esc_js( $fb_page_id ); ?>').length){
323
- jQuery("#loadMore_<?php echo esc_js( $fb_page_id ); ?>_location").addClass('fts-fb-spinner');
324
- var button = jQuery('#loadMore_<?php echo esc_js( $fb_page_id ); ?>_location').html('<div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div>');
325
- console.log(button);
326
- var build_shortcode = "<?php echo esc_js( $build_shortcode ); ?>";
327
- var yes_ajax = "yes";
328
- var fts_d_name = "<?php echo esc_js( $fb_page_id ); ?>";
329
- var fts_security = "<?php echo esc_js( $nonce ); ?>";
330
- var fts_time = "<?php echo esc_js( $time ); ?>";
331
- var fts_reviews_feed = "<?php echo esc_js( $reviews_token ); ?>";
332
- jQuery.ajax({
333
- data: {
334
- action: "my_fts_fb_load_more",
335
- next_location_url: nextURL_location_<?php echo esc_js( $fb_page_id ); ?>,
336
- fts_dynamic_name: fts_d_name,
337
- rebuilt_shortcode: build_shortcode,
338
- load_more_ajaxing: yes_ajax,
339
- fts_security: fts_security,
340
- fts_time: fts_time,
341
- feed_name: build_shortcode,
342
- fts_reviews_feed: fts_reviews_feed,
343
- locations: 'yes'
344
- },
345
- type: 'GET',
346
- url: ajaxurl,
347
- success: function (data) {
348
- console.log('Well Done and got this from sever: ' + data);
349
- jQuery('.fb-sublist-page-id-<?php echo esc_js( $fb_page_id ); ?>').append(data).filter('.fb-sublist-page-id-<?php echo esc_js( $fb_page_id ); ?>').html();
350
- jQuery('.fb-sublist-page-id-<?php echo esc_js( $fb_page_id ); ?>').animate({scrollTop: '+=100px'}, 800); // scroll down a 100px after new items are added
351
-
352
-
353
-
354
- <?php if ( isset( $data->locations->paging->next ) && $data->locations->paging->next === $_REQUEST['next_location_url'] ) { ?>
355
- jQuery('#loadMore_<?php echo esc_js( $fb_page_id ); ?>_location').replaceWith('<div class="fts-fb-load-more no-more-posts-fts-fb fts-no-more-locations-<?php echo esc_js( $fb_page_id ); ?>" style="background:none !important"><?php echo esc_html( 'All Locations loaded', 'feed-them-social' ); ?></div>');
356
- jQuery('#loadMore_<?php echo esc_js( $fb_page_id ); ?>_location').removeAttr('id');
357
- <?php } ?>
358
- jQuery("#loadMore_<?php echo esc_js( $fb_page_id ); ?>_location").removeClass('fts-fb-spinner');
359
- }
360
- }); // end of ajax()
361
- return false;
362
-
363
- } //stop ajax from submitting again if the fts-no-more-locations class is found
364
-
365
- }
366
- }); // end of form.submit
367
-
368
- }); // end of document.ready
369
- </script>
370
- <?php
371
- } //END Make sure it's not ajaxing locations
372
- ?>
373
- <script>var nextURL_location_<?php echo esc_js( $fb_page_id ); ?>= "<?php echo isset( $data->locations->paging->next ) ? esc_url_raw( $data->locations->paging->next ) : ''; ?>";</script>
374
- <?php } ?>
375
- </li>
376
-
377
- <?php
378
- } // foreach loop of locations
379
-
380
- // Make sure it's not ajaxing!
381
- if ( ! isset( $_GET['load_more_ajaxing'] ) ) {
382
- ?>
383
- </ul>
384
- <div class="fts-clear"></div>
385
- </div>
386
- <?php
387
- } //End make sure it's not ajaxing
388
-
389
- // Make sure it's not ajaxing!
390
- if ( ! isset( $_GET['load_more_ajaxing'] ) && ! isset( $_GET['locations'] ) ) {
391
- $fts_dynamic_name = isset( $_REQUEST['fts_dynamic_name'] ) ? sanitize_key( $_REQUEST['fts_dynamic_name'] ) : '';
392
- $time = time();
393
- $nonce = wp_create_nonce( $time . 'load-more-nonce' );
394
- ?>
395
- <script>
396
- jQuery(document).ready(function () {
397
-
398
- jQuery("#loadMore_<?php echo esc_js( $fts_dynamic_name ); ?>").click(function () {
399
-
400
- jQuery("#loadMore_<?php echo esc_js( $fts_dynamic_name ); ?>").addClass('fts-fb-spinner');
401
- var button = jQuery('#loadMore_<?php echo esc_js( $fts_dynamic_name ); ?>').html('<div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div>');
402
- console.log(button);
403
- var build_shortcode = "<?php echo esc_js( $build_shortcode ); ?>";
404
- var yes_ajax = "yes";
405
- var fts_d_name = "<?php echo esc_js( $fts_dynamic_name ); ?>";
406
- var fts_security = "<?php echo esc_js( $nonce ); ?>";
407
- var fts_time = "<?php echo esc_js( $time ); ?>";
408
- var fts_reviews_feed = "<?php echo esc_js( $reviews_token ); ?>";
409
- jQuery.ajax({
410
- data: {
411
- action: "my_fts_fb_load_more",
412
- next_url: nextURL_<?php echo esc_js( $fts_dynamic_name ); ?>,
413
- fts_dynamic_name: fts_d_name,
414
- rebuilt_shortcode: build_shortcode,
415
- load_more_ajaxing: yes_ajax,
416
- fts_security: fts_security,
417
- fts_time: fts_time,
418
- feed_name: build_shortcode,
419
- fts_reviews_feed: fts_reviews_feed
420
- },
421
- type: 'GET',
422
- url: ajaxurl,
423
- success: function (data) {
424
- console.log('Well Done and got this from sever: ' + data);
425
- jQuery('.fb-page-master-list').append(data).filter('.fb-page-list').html();
426
-
427
- if (!nextURL_<?php echo esc_js( sanitize_text_field( wp_unslash( $_REQUEST['fts_dynamic_name'] ) ) ); ?> || 'no more' === nextURL_<?php echo esc_js( sanitize_text_field( wp_unslash( $_REQUEST['fts_dynamic_name'] ) ) ); ?>) {
428
- jQuery('#loadMore_<?php echo esc_js( $fts_dynamic_name ); ?>').replaceWith('<div class="fts-fb-load-more no-more-posts-fts-fb"><?php echo esc_js( 'No More Pages', 'feed-them-social' ); ?></div>');
429
- jQuery('#loadMore_<?php echo esc_js( $fts_dynamic_name ); ?>').removeAttr('id');
430
- }
431
- jQuery('#loadMore_<?php echo esc_js( $fts_dynamic_name ); ?>').html('<?php echo esc_js( 'Load More', 'feed-them-social' ); ?>');
432
- // jQuery('#loadMore_< ?php echo $fts_dynamic_name ?>').removeClass('flip360-fts-load-more');
433
- jQuery("#loadMore_<?php echo esc_js( $fts_dynamic_name ); ?>").removeClass('fts-fb-spinner');
434
-
435
-
436
- }
437
- }); // end of ajax()
438
- return false;
439
- }); // end of form.submit
440
- }); // end of document.ready
441
- </script>
442
- <?php
443
-
444
- } //END Make sure it's not ajaxing
445
- ?>
446
- <script>
447
- <?php if ( ! isset( $_GET['locations'] ) ) { ?>
448
- var nextURL_<?php echo esc_js( sanitize_text_field( wp_unslash( $_REQUEST['fts_dynamic_name'] ) ) ); ?>= "<?php echo esc_url_raw( $_REQUEST['next_url'] ); ?>";
449
- // alert('nextURL_<?php echo esc_js( sanitize_text_field( wp_unslash( $_REQUEST['fts_dynamic_name'] ) ) ); ?>');
450
- <?php } ?>
451
-
452
-
453
- if (document.querySelector('#fts-fb-token-wrap .fts-pages-info') !== null) {
454
- jQuery(".fts-successful-api-token.default-token").hide();
455
- }
456
- <?php if ( 'yes' === $reviews_token || isset( $_GET['fts_reviews_feed'] ) && 'yes' === $_GET['fts_reviews_feed'] ) { ?>
457
- if (document.querySelector('.default-token') !== null) {
458
- jQuery(".default-token").show();
459
- }
460
-
461
- <?php } ?>
462
-
463
- jQuery(document).ready(function ($) {
464
- $(".feed-them-social-admin-submit-btn").click(function () {
465
- // alert('test');
466
- var newUrl = "<?php echo esc_url( admin_url( 'admin.php?page=fts-facebook-feed-styles-submenu-page/' ) ); ?>";
467
- history.replaceState({}, null, newUrl);
468
- $("#fts-facebook-feed-options-form").submit();
469
- });
470
-
471
- var fb = ".fb-page-list .fb-click-wrapper";
472
- $('#fb-list-wrap').show();
473
- //alert("reviews_token");
474
-
475
- $(fb).click(function () {
476
- var fb_page_id = $(this).find('.fts-api-facebook-id').html();
477
- var token = $(this).find('.page-token').html();
478
- // alert(token);
479
- var name = $(this).find('.fb-name').html();
480
- <?php if ( 'no' === $reviews_token || isset( $_GET['fts_reviews_feed'] ) && 'no' === $_GET['fts_reviews_feed'] ) { ?>
481
- $("#fts_facebook_custom_api_token").val(token);
482
- $("#fts_facebook_custom_api_token_user_id").val(fb_page_id);
483
- $("#fts_facebook_custom_api_token_user_name").val(name);
484
- <?php } else { ?>
485
- $("#fts_facebook_custom_api_token_biz").val(token);
486
- $("#fts_facebook_custom_api_token_user_id_biz").val(fb_page_id);
487
- $("#fts_facebook_custom_api_token_user_name_biz").val(name);
488
- <?php } ?>
489
- $('.fb-page-list .feed-them-social-admin-submit-btn').hide();
490
- $(this).find('.feed-them-social-admin-submit-btn').toggle();
491
- // alert(name + token)
492
- })
493
- });
494
- </script>
495
- <?php
496
- // Make sure it's not ajaxing!
497
- if ( ! isset( $_GET['load_more_ajaxing'] ) && isset( $test_fb_app_token_response->paging->next ) && ! isset( $_GET['locations'] ) ) {
498
- $fts_dynamic_name = sanitize_key( $_REQUEST['fts_dynamic_name'] );
499
- echo '<div class="fts-clear"></div>';
500
-
501
- echo '<div id="loadMore_' . esc_attr( $fts_dynamic_name ) . '" class="fts-fb-load-more">' . esc_html( 'Load More', 'feed-them-social' ) . '</div>';
502
- }//End make sure it's not ajaxing
503
-
504
- // Lastly if we can't find a next url we unset the next url from the page to not let the loadmore button be active.
505
- if ( isset( $_GET['locations'] ) ) {
506
- unset( $_REQUEST['next_location_url'] );
507
- } else {
508
- unset( $_REQUEST['next_url'] );
509
- }
510
- return ob_get_clean();
511
- }
512
- exit;
513
- }
514
-
515
-
516
- /**
517
- * My FTS Plugin License
518
- *
519
- * Put in place to only show the Activate Plugin license if the input has a value
520
- *
521
- * @since 2.1.4
522
- */
523
- public function fts_plugin_license() {
524
- wp_enqueue_script( 'jquery' );
525
- ?>
526
- <style>.fts-license-master-form th {
527
- background: #f9f9f9;
528
- padding: 14px;
529
- border-bottom: 1px solid #ccc;
530
- margin: -14px -14px 20px;
531
- width: 100%;
532
- display: block
533
- }
534
-
535
- .fts-license-master-form .form-table tr {
536
- float: left;
537
- margin: 0 15px 15px 0;
538
- background: #fff;
539
- border: 1px solid #ccc;
540
- width: 30.5%;
541
- max-width: 350px;
542
- padding: 14px;
543
- min-height: 220px;
544
- position: relative;
545
- box-sizing: border-box
546
- }
547
-
548
- .fts-license-master-form .form-table td {
549
- padding: 0;
550
- display: block
551
- }
552
-
553
- .fts-license-master-form td input.regular-text {
554
- margin: 0 0 8px;
555
- width: 100%
556
- }
557
-
558
- .fts-license-master-form .edd-license-data[class*=edd-license-] {
559
- position: absolute;
560
- background: #fafafa;
561
- padding: 14px;
562
- border-top: 1px solid #eee;
563
- margin: 20px -14px -14px;
564
- min-height: 67px;
565
- width: 100%;
566
- bottom: 14px;
567
- box-sizing: border-box
568
- }
569
-
570
- .fts-license-master-form .edd-license-data p {
571
- font-size: 13px;
572
- margin-top: 0
573
- }
574
-
575
- .fts-license-master-form tr {
576
- display: none
577
- }
578
-
579
- .fts-license-master-form tr.fts-license-wrap {
580
- display: block
581
- }
582
-
583
- .fts-license-master-form .edd-license-msg-error {
584
- background: rgba(255, 0, 0, 0.49)
585
- }
586
-
587
- .fts-license-master-form tr.fts-license-wrap {
588
- display: block
589
- }
590
-
591
- .fts-license-master-form .edd-license-msg-error {
592
- background: #e24e4e !important;
593
- color: #FFF
594
- }
595
-
596
- .fts-license-wrap .edd-license-data p {
597
- color: #1e981e
598
- }
599
-
600
- .edd-license-msg-error p {
601
- color: #FFF !important
602
- }
603
-
604
- .feed-them_page_fts-license-page .button-secondary {
605
- display: none;
606
- }</style>
607
- <script type="text/javascript">
608
- jQuery(document).ready(function () {
609
- if (jQuery('#feed_them_social_premium_license_key').val() !== '') {
610
- jQuery('#feed_them_social_premium_license_key').next('label').find('.button-secondary').show()
611
- }
612
- if (jQuery('#feed_them_social_combined_streams_license_key').val() !== '') {
613
- jQuery('#feed_them_social_combined_streams_license_key').next('label').find('.button-secondary').show()
614
- }
615
- if (jQuery('#feed-them-social-facebook-reviews_license_key').val() !== '') {
616
- jQuery('#feed-them-social-facebook-reviews_license_key').next('label').find('.button-secondary').show()
617
- }
618
- if (jQuery('#fts_bar_license_key').val() !== '') {
619
- jQuery('#fts_bar_license_key').next('label').find('.button-secondary').show()
620
- }
621
- if (jQuery('#feed_them_carousel_premium_license_key').val() !== '') {
622
- jQuery('#feed_them_carousel_premium_license_key').next('label').find('.button-secondary').show()
623
- }
624
- });
625
- </script>
626
- <?php
627
- }
628
-
629
- /**
630
- * My FTS Ajaxurl
631
- *
632
- * Ajax var on front end for twitter videos and loadmore button (if premium active.
633
- *
634
- * @since 1.9.6
635
- */
636
- public function my_fts_ajaxurl() {
637
- wp_enqueue_script( 'jquery' );
638
- }
639
-
640
- /**
641
- * My FTS FB Load More
642
- *
643
- * This function is being called from the fb feed... it calls the ajax in this case.
644
- *
645
- * @since 1.9.6
646
- * @updated 2.1.4 (fts_fb_page_token)
647
- */
648
- public function my_fts_fb_load_more() {
649
- if ( isset( $_REQUEST['fts_security'], $_REQUEST['fts_time'] ) && ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST['fts_security'] ) ), sanitize_text_field( wp_unslash( $_REQUEST['fts_time'] ) ) . 'load-more-nonce' ) ) {
650
- exit( 'Sorry, You can\'t do that!' );
651
- } else {
652
-
653
- if ( isset( $_REQUEST['feed_name'] ) && 'fts_fb_page_token' === $_REQUEST['feed_name'] ) {
654
- if ( isset( $_REQUEST['next_url'] ) && false === strpos( sanitize_text_field( wp_unslash( $_REQUEST['next_url'] ) ), 'https://graph.facebook.com/v3.1' ) ||
655
- isset( $_REQUEST['next_location_url'] ) && false === strpos( sanitize_text_field( wp_unslash( $_REQUEST['next_location_url'] ) ), 'https://graph.facebook.com/v3.1' ) ||
656
- isset( $_REQUEST['next_url'] ) && sanitize_text_field( wp_unslash( $_REQUEST['next_url'] ) ) !== sanitize_text_field( wp_unslash( $_REQUEST['next_url'] ) ) ||
657
- isset( $_REQUEST['next_location_url'] ) && sanitize_text_field( wp_unslash( $_REQUEST['next_location_url'] ) ) !== sanitize_text_field( wp_unslash( $_REQUEST['next_location_url'] ) ) ) {
658
-
659
- exit( 'That is not an FTS shortcode!' );
660
- }
661
- }
662
-
663
- if ( isset( $_REQUEST['feed_name'] ) && 'fts_fb_page_token' === $_REQUEST['feed_name'] ||
664
- isset( $_REQUEST['feed_name'] ) && 'fts_twitter' === $_REQUEST['feed_name'] ||
665
- isset( $_REQUEST['feed_name'] ) && 'fts_youtube' === $_REQUEST['feed_name'] ||
666
- isset( $_REQUEST['feed_name'] ) && 'fts_facebook' === $_REQUEST['feed_name'] ||
667
- isset( $_REQUEST['feed_name'] ) && 'fts_facebookbiz' === $_REQUEST['feed_name'] ||
668
- isset( $_REQUEST['feed_name'] ) && 'fts_instagram' === $_REQUEST['feed_name'] ) {
669
-
670
- $feed_atts = isset( $_REQUEST['feed_attributes'] ) ? array_map( 'sanitize_text_field', wp_unslash( $_REQUEST['feed_attributes'] ) ) : '';
671
-
672
- $build_shortcode = '[' . sanitize_text_field( wp_unslash( $_REQUEST['feed_name'] ) ) . '';
673
- foreach ( $feed_atts as $attribute => $value ) {
674
- $build_shortcode .= ' ' . $attribute . '=' . $value;
675
- }
676
-
677
- if ( 'fts_twitter' === $_REQUEST['feed_name'] ) {
678
- $loadmore_count = isset( $_REQUEST['loadmore_count'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['loadmore_count'] ) ) : '';
679
- $build_shortcode .= ' ' . $loadmore_count . ']';
680
- } elseif ( 'fts_youtube' === $_REQUEST['feed_name'] ) {
681
- $loadmore_count = isset( $_REQUEST['loadmore_count'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['loadmore_count'] ) ) : '';
682
- $build_shortcode .= ' ' . $loadmore_count . ']';
683
- } else {
684
- $build_shortcode .= ' ]';
685
- }
686
-
687
- echo do_shortcode( $build_shortcode );
688
-
689
- } else {
690
- exit( esc_html( 'That is not an FTS shortcode!' ) );
691
- }
692
- }
693
- die();
694
- }
695
-
696
- /**
697
- * FTS Clear Cache Script
698
- *
699
- * This is for the fts_clear_cache_ajax submission.
700
- *
701
- * @since 1.9.6
702
- */
703
- public function fts_clear_cache_script() {
704
-
705
- $fts_admin_activation_clear_cache = get_option( 'Feed_Them_Social_Activated_Plugin' );
706
- $fts_dev_mode_cache = get_option( 'fts_clear_cache_developer_mode' );
707
- if ( '1' === $fts_dev_mode_cache || 'feed-them-social' === $fts_admin_activation_clear_cache ) {
708
- wp_enqueue_script( 'fts_clear_cache_script', plugins_url( 'feed-them-social/admin/js/developer-admin.js' ), array( 'jquery' ), FTS_CURRENT_VERSION, false );
709
- wp_localize_script( 'fts_clear_cache_script', 'ftsAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );
710
- wp_enqueue_script( 'jquery' );
711
- wp_enqueue_script( 'fts_clear_cache_script' );
712
- }
713
- if ( 'hide-admin-bar-menu' !== $fts_dev_mode_cache && '1' !== $fts_dev_mode_cache ) {
714
- wp_enqueue_script( 'jquery' );
715
- wp_enqueue_script( 'fts_clear_cache_script', plugins_url( 'feed-them-social/admin/js/admin.js' ), array(), FTS_CURRENT_VERSION, false );
716
- wp_enqueue_script( 'fts_clear_cache_script', plugins_url( 'feed-them-social/admin/js/developer-admin.js' ), array( 'jquery' ), FTS_CURRENT_VERSION, false );
717
- wp_localize_script( 'fts_clear_cache_script', 'ftsAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );
718
- wp_enqueue_script( 'fts_clear_cache_script' );
719
- }
720
-
721
- // we delete this option if found so we only empty the cache once when the plugin is ever activated or updated!
722
- delete_option( 'Feed_Them_Social_Activated_Plugin' );
723
- }
724
-
725
- /**
726
- * Feed Them Main Menu
727
- *
728
- * Admin Submenu buttons // Add the word Settings in place of the default menu page name 'Feed Them'.
729
- *
730
- * @since 1.9.6
731
- */
732
- public function feed_them_main_menu() {
733
- // Main Settings Page!
734
- $main_settings_page = new FTS_Settings_Page();
735
- add_menu_page( 'Feed Them Social', 'Feed Them', 'manage_options', 'feed-them-settings-page', array( $main_settings_page, 'feed_them_settings_page' ), '' );
736
- add_submenu_page( 'feed-them-settings-page', esc_html( 'Settings', 'feed-them-social' ), esc_html( 'Settings', 'feed-them-social' ), 'manage_options', 'feed-them-settings-page' );
737
- }
738
-
739
- /**
740
- * Feed Them Submenu Pages
741
- *
742
- * @since 1.9.6
743
- */
744
- public function feed_them_submenu_pages() {
745
-
746
- // Facebook Options Page!
747
- $facebook_options_page = new FTS_Facebook_Options_Page();
748
- add_submenu_page(
749
- 'feed-them-settings-page',
750
- esc_html( 'Facebook Options', 'feed-them-social' ),
751
- esc_html( 'Facebook Options', 'feed-them-social' ),
752
- 'manage_options',
753
- 'fts-facebook-feed-styles-submenu-page',
754
- array( $facebook_options_page, 'feed_them_facebook_options_page' )
755
- );
756
- // Instagram Options Page!
757
- $instagram_options_page = new FTS_Instagram_Options_Page();
758
- add_submenu_page(
759
- 'feed-them-settings-page',
760
- esc_html( 'Instagram Options', 'feed-them-social' ),
761
- esc_html( 'Instagram Options', 'feed-them-social' ),
762
- 'manage_options',
763
- 'fts-instagram-feed-styles-submenu-page',
764
- array( $instagram_options_page, 'feed_them_instagram_options_page' )
765
- );
766
- // Twitter Options Page!
767
- $twitter_options_page = new FTS_Twitter_Options_Page();
768
- add_submenu_page(
769
- 'feed-them-settings-page',
770
- esc_html( 'Twitter Options', 'feed-them-social' ),
771
- esc_html( 'Twitter Options', 'feed-them-social' ),
772
- 'manage_options',
773
- 'fts-twitter-feed-styles-submenu-page',
774
- array( $twitter_options_page, 'feed_them_twitter_options_page' )
775
- );
776
- // Pinterest Options Page!
777
- $pinterest_options_page = new FTS_Pinterest_Options_Page();
778
- add_submenu_page(
779
- 'feed-them-settings-page',
780
- esc_html( 'Pinterest Options', 'feed-them-social' ),
781
- esc_html( 'Pinterest Options', 'feed-them-social' ),
782
- 'manage_options',
783
- 'fts-pinterest-feed-styles-submenu-page',
784
- array( $pinterest_options_page, 'feed_them_pinterest_options_page' )
785
- );
786
- // Youtube Options Page!
787
- $youtube_options_page = new FTS_Youtube_Options_Page();
788
- add_submenu_page(
789
- 'feed-them-settings-page',
790
- esc_html( 'YouTube Options', 'feed-them-social' ),
791
- esc_html( 'YouTube Options', 'feed-them-social' ),
792
- 'manage_options',
793
- 'fts-youtube-feed-styles-submenu-page',
794
- array( $youtube_options_page, 'feed_them_youtube_options_page' )
795
- );
796
- // System Info!
797
- $system_info_page = new FTS_System_Info_Page();
798
- add_submenu_page(
799
- 'feed-them-settings-page',
800
- esc_html( 'System Info', 'feed-them-social' ),
801
- esc_html( 'System Info', 'feed-them-social' ),
802
- 'manage_options',
803
- 'fts-system-info-submenu-page',
804
- array( $system_info_page, 'feed_them_system_info_page' )
805
- );
806
- }
807
-
808
- /**
809
- * Feed Them Admin CSS
810
- *
811
- * Admin CSS.
812
- *
813
- * @since 1.9.6
814
- */
815
- public function feed_them_admin_css() {
816
- wp_register_style( 'feed_them_admin', plugins_url( 'admin/css/admin.css', dirname( __FILE__ ) ), array(), FTS_CURRENT_VERSION );
817
- wp_enqueue_style( 'feed_them_admin' );
818
- }
819
-
820
- /**
821
- * Feed Them System Info CSS
822
- *
823
- * Admin System Info CSS.
824
- *
825
- * @since 1.9.6
826
- */
827
- public function feed_them_system_info_css() {
828
- wp_register_style( 'fts-settings-admin-css', plugins_url( 'admin/css/admin-settings.css', dirname( __FILE__ ) ), array(), FTS_CURRENT_VERSION );
829
- wp_enqueue_style( 'fts-settings-admin-css' );
830
- }
831
-
832
- /**
833
- * Feed Them Settings
834
- *
835
- * Admin Settings Scripts and CSS.
836
- *
837
- * @since 1.9.6
838
- */
839
- public function feed_them_settings() {
840
- $fts_functions_load_settings_nonce = wp_create_nonce( 'fts-functions-load-settings-nonce' );
841
-
842
- if ( wp_verify_nonce( $fts_functions_load_settings_nonce, 'fts-functions-load-settings-nonce' ) ) {
843
- wp_register_style( 'feed_them_settings_css', plugins_url( 'admin/css/settings-page.css', dirname( __FILE__ ) ), array(), FTS_CURRENT_VERSION, false );
844
- wp_enqueue_style( 'feed_them_settings_css' );
845
- if ( isset( $_GET['page'] ) && 'fts-youtube-feed-styles-submenu-page' === $_GET['page'] || isset( $_GET['page'] ) && 'fts-instagram-feed-styles-submenu-page' === $_GET['page'] || isset( $_GET['page'] ) && 'fts-facebook-feed-styles-submenu-page' === $_GET['page'] || isset( $_GET['page'] ) && 'fts-twitter-feed-styles-submenu-page' === $_GET['page'] || isset( $_GET['page'] ) && 'feed-them-settings-page' === $_GET['page'] || isset( $_GET['page'] ) && 'fts-pinterest-feed-styles-submenu-page' === $_GET['page'] ) {
846
- wp_enqueue_script( 'feed_them_style_options_color_js', plugins_url( 'admin/js/jscolor/jscolor.js', dirname( __FILE__ ) ), array(), FTS_CURRENT_VERSION, false );
847
- }
848
- }
849
- }
850
-
851
- /**
852
- * Need FTS Premium Fields
853
- *
854
- * Admin Premium Settings Fields.
855
- *
856
- * @param array $fields settings fields to display premium notice for.
857
- * @since 1.9.6
858
- */
859
- public function need_fts_premium_fields( $fields ) {
860
- foreach ( $fields as $key => $label ) {
861
- $output = '<div class="feed-them-social-admin-input-wrap">';
862
- $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( $label ) . '</div>';
863
- $output .= '<div class="feed-them-social-admin-input-default">';
864
- $output .= sprintf(
865
- esc_html( 'Must have %1$sPremium Extension%3$s to edit.', 'feed-them-social' ),
866
- '<a href="' . esc_url( 'https://www.slickremix.com/downloads/feed-them-social-premium-extension/' ) . '" target="_blank">',
867
- '</a>'
868
- );
869
- $output .= '</div>';
870
- $output .= '<div class="fts-clear"></div>';
871
- $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
872
- }//END Foreach
873
-
874
- return $output;
875
- }
876
-
877
-
878
- /**
879
- * Register Settings
880
- *
881
- * Generic Register Settings function.
882
- *
883
- * @param string $settings_name settings name.
884
- * @param array $settings settings parameters.
885
- * @since
886
- */
887
- public function register_settings( $settings_name, $settings ) {
888
- foreach ( $settings as $key => $setting ) {
889
- register_setting( $settings_name, $setting );
890
- }
891
- }
892
-
893
- /**
894
- * FTS Facebook Style Options Page
895
- *
896
- * Register Facebook Style Options.
897
- *
898
- * @since 1.9.6
899
- */
900
- public function fts_facebook_style_options_page() {
901
- $fb_style_options = array(
902
- 'fb_like_btn_color',
903
- 'fb_language',
904
- 'fb_show_follow_btn',
905
- 'fb_show_follow_like_box_cover',
906
- 'fb_show_follow_btn_where',
907
- 'fb_header_extra_text_color',
908
- 'fb_text_color',
909
- 'fb_link_color',
910
- 'fb_link_color_hover',
911
- 'fb_feed_width',
912
- 'fb_feed_margin',
913
- 'fb_feed_padding',
914
- 'fb_feed_background_color',
915
- 'fb_post_background_color',
916
- 'fb_grid_border_bottom_color',
917
- 'fb_grid_posts_background_color',
918
- 'fb_border_bottom_color',
919
- 'fts_facebook_custom_api_token',
920
- 'fb_event_title_color',
921
- 'fb_event_title_size',
922
- 'fb_event_maplink_color',
923
- 'fb_events_title_color',
924
- 'fb_events_title_size',
925
- 'fb_events_map_link_color',
926
- 'fb_hide_shared_by_etc_text',
927
- 'fts_facebook_custom_api_token_biz',
928
- 'fb_reviews_text_color',
929
- 'fb_reviews_backg_color',
930
- 'fb_reviews_star_language',
931
- 'fb_reviews_recommended_language',
932
- 'fb_reviews_see_more_reviews_language',
933
- 'fb_reviews_see_more_reviews_language',
934
- 'fb_reviews_overall_rating_background_border_hide',
935
- 'fb_reviews_overall_rating_background_color',
936
- 'fb_reviews_overall_rating_border_color',
937
- 'fb_reviews_overall_rating_text_color',
938
- 'fb_reviews_overall_rating_background_padding',
939
- 'fb_reviews_remove_see_reviews_link',
940
- 'fb_reviews_overall_rating_of_5_stars_text',
941
- 'fb_reviews_overall_rating_reviews_text',
942
- 'fb_max_image_width',
943
- 'fb_hide_images_in_posts',
944
- 'fb_hide_error_handler_message',
945
- 'fb_count_offset',
946
- 'fb_hide_no_posts_message',
947
- 'fts_facebook_custom_api_token_user_id',
948
- 'fts_facebook_custom_api_token_user_name',
949
- 'fts_facebook_custom_api_token_user_id_biz',
950
- 'fts_facebook_custom_api_token_user_name_biz',
951
- 'fb_loadmore_background_color',
952
- 'fb_loadmore_text_color',
953
- 'fb_load_more_text',
954
- 'fb_no_more_posts_text',
955
- 'fb_no_more_photos_text',
956
- 'fb_no_more_videos_text',
957
- 'fb_no_more_reviews_text',
958
- 'fb_text_size',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
959
  'fb_view_on_fb_fts',
960
- );
961
- $this->register_settings( 'fts-facebook-feed-style-options', $fb_style_options );
962
- }
963
-
964
- /**
965
- * FTS Twitter Style Options Page
966
- *
967
- * Register Twitter Style Options.
968
- *
969
- * @since 1.9.6
970
- */
971
- public function fts_twitter_style_options_page() {
972
- $twitter_style_options = array(
973
- 'twitter_show_follow_btn',
974
- 'twitter_show_follow_count',
975
- 'twitter_show_follow_btn_where',
976
- 'twitter_allow_videos',
977
- 'twitter_allow_shortlink_conversion',
978
- 'twitter_full_width',
979
- 'twitter_text_color',
980
- 'twitter_link_color',
981
- 'twitter_link_color_hover',
982
- 'twitter_feed_width',
983
- 'twitter_feed_margin',
984
- 'twitter_feed_padding',
985
- 'twitter_feed_background_color',
986
- 'twitter_border_bottom_color',
987
- 'twitter_grid_posts_background_color',
988
- 'twitter_grid_border_bottom_color',
989
- 'fts_twitter_custom_consumer_key',
990
- 'fts_twitter_custom_consumer_secret',
991
- 'fts_twitter_custom_access_token',
992
- 'fts_twitter_custom_access_token_secret',
993
- 'fts_twitter_hide_images_in_posts',
994
- 'twitter_max_image_width',
995
- 'twitter_loadmore_background_color',
996
- 'twitter_loadmore_text_color',
997
- 'twitter_load_more_text',
998
- 'twitter_no_more_tweets_text',
999
- 'twitter_text_size',
1000
- 'twitter_load_more_text',
1001
- 'fts_twitter_custom_tokens',
1002
- );
1003
- $this->register_settings( 'fts-twitter-feed-style-options', $twitter_style_options );
1004
- }
1005
-
1006
- /**
1007
- * FTS Instagram Style Options Page
1008
- *
1009
- * Register Instagram Options.
1010
- *
1011
- * @since 1.9.6
1012
- */
1013
- public function fts_instagram_style_options_page() {
1014
- $instagram_style_options = array(
1015
- 'fts_instagram_custom_api_token',
1016
- 'fts_instagram_custom_id',
1017
- 'instagram_show_follow_btn',
1018
- 'instagram_show_follow_btn_where',
1019
- 'instagram_loadmore_background_color',
1020
- 'instagram_loadmore_text_color',
1021
- 'instagram_load_more_text',
1022
- 'instagram_no_more_photos_text',
1023
- );
1024
- $this->register_settings( 'fts-instagram-feed-style-options', $instagram_style_options );
1025
- }
1026
-
1027
- /**
1028
- * FTS Pinterest Style Options Page
1029
- *
1030
- * Register Pinterest Options.
1031
- *
1032
- * @since 1.9.6
1033
- */
1034
- public function fts_pinterest_style_options_page() {
1035
- $pinterest_style_options = array(
1036
- 'fts_pinterest_custom_api_token',
1037
- 'pinterest_show_follow_btn',
1038
- 'pinterest_show_follow_btn_where',
1039
- 'pinterest_board_title_color',
1040
- 'pinterest_board_title_size',
1041
- 'pinterest_board_backg_hover_color',
1042
- );
1043
- $this->register_settings( 'fts-pinterest-feed-style-options', $pinterest_style_options );
1044
- }
1045
-
1046
- /**
1047
- * FTS Youtube Style Options Page
1048
- *
1049
- * Register YouTube Options.
1050
- *
1051
- * @since 1.9.6
1052
- */
1053
- public function fts_youtube_style_options_page() {
1054
- $youtube_style_options = array(
1055
- 'youtube_show_follow_btn',
1056
- 'youtube_show_follow_btn_where',
1057
- 'youtube_custom_api_token',
1058
- 'youtube_loadmore_background_color',
1059
- 'youtube_loadmore_text_color',
1060
- 'youtube_load_more_text',
1061
- 'youtube_no_more_videos_text',
1062
- 'youtube_custom_refresh_token',
1063
- 'youtube_custom_access_token',
1064
- 'youtube_custom_token_exp_time',
1065
- );
1066
- $this->register_settings( 'fts-youtube-feed-style-options', $youtube_style_options );
1067
- }
1068
-
1069
- /**
1070
- * FTS Settings Page Register Settings
1071
- *
1072
- * Register Free Version Settings.
1073
- *
1074
- * @since 1.9.6
1075
- */
1076
- public function fts_settings_page_register_settings() {
1077
- $settings = array(
1078
- 'fts_admin_bar_menu',
1079
- 'fts_clear_cache_developer_mode',
1080
- 'fts-date-and-time-format',
1081
- 'fts-timezone',
1082
- 'fts_fix_magnific',
1083
- 'fts-color-options-settings-custom-css',
1084
- 'fts-color-options-main-wrapper-css-input',
1085
- 'fts-powered-text-options-settings',
1086
- 'fts-slicker-instagram-icon-center',
1087
- 'fts-slicker-instagram-container-image-size',
1088
- 'fts-slicker-instagram-container-hide-date-likes-comments',
1089
- 'fts-slicker-instagram-container-position',
1090
- 'fts-slicker-instagram-container-animation',
1091
- 'fts-slicker-instagram-container-margin',
1092
- 'fts_fix_loadmore',
1093
- 'fts_curl_option',
1094
- 'fts-custom-date',
1095
- 'fts-custom-time',
1096
- 'fts_twitter_time_offset',
1097
- 'fts_language_second',
1098
- 'fts_language_seconds',
1099
- 'fts_language_minute',
1100
- 'fts_language_minutes',
1101
- 'fts_language_hour',
1102
- 'fts_language_hours',
1103
- 'fts_language_day',
1104
- 'fts_language_days',
1105
- 'fts_language_week',
1106
- 'fts_language_weeks',
1107
- 'fts_language_month',
1108
- 'fts_language_months',
1109
- 'fts_language_year',
1110
- 'fts_language_years',
1111
- 'fts_language_ago',
1112
- 'fts_disable_share_button',
1113
- 'fts_social_icons_color',
1114
- 'fts_social_icons_hover_color',
1115
- 'fts_social_icons_back_color',
1116
- 'fts_slick_rating_notice_waiting',
1117
- 'fts_slick_rating_notice',
1118
- 'fts_slick_ignore_rating_notice_nag',
1119
- );
1120
- $this->register_settings( 'feed-them-social-settings', $settings );
1121
- }
1122
- /**
1123
- * Social Follow Buttons
1124
- *
1125
- * @param string $feed feed type.
1126
- * @param string $user_id user id.
1127
- * @param null $access_token access token.
1128
- * @param null $fb_shortcode shortcode attribute.
1129
- * @since 1.9.6
1130
- */
1131
- public function social_follow_button( $feed, $user_id, $access_token = null, $fb_shortcode = null ) {
1132
- $fts_social_follow_nonce = wp_create_nonce( 'fts-social-follow-nonce' );
1133
-
1134
- if ( wp_verify_nonce( $fts_social_follow_nonce, 'fts-social-follow-nonce' ) ) {
1135
-
1136
- global $channel_id, $playlist_id, $username_subscribe_btn, $username;
1137
- switch ( $feed ) {
1138
- case 'facebook':
1139
- // Facebook settings options for follow button!
1140
- $fb_show_follow_btn = get_option( 'fb_show_follow_btn' );
1141
- $fb_show_follow_like_box_cover = get_option( 'fb_show_follow_like_box_cover' );
1142
- $language_option_check = get_option( 'fb_language' );
1143
-
1144
- if ( isset( $language_option_check ) && 'Please Select Option' !== $language_option_check ) {
1145
- $language_option = get_option( 'fb_language', 'en_US' );
1146
- } else {
1147
- $language_option = 'en_US';
1148
- }
1149
- $fb_like_btn_color = get_option( 'fb_like_btn_color', 'light' );
1150
- $show_faces = 'like-button-share-faces' === $fb_show_follow_btn || 'like-button-faces' === $fb_show_follow_btn || 'like-box-faces' === $fb_show_follow_btn ? 'true' : 'false';
1151
- $share_button = 'like-button-share-faces' === $fb_show_follow_btn || 'like-button-share' === $fb_show_follow_btn ? 'true' : 'false';
1152
- $page_cover = 'fb_like_box_cover-yes' === $fb_show_follow_like_box_cover ? 'true' : 'false';
1153
- if ( ! isset( $_POST['fts_facebook_script_loaded'] ) ) {
1154
- echo '<div id="fb-root"></div>
 
 
 
 
 
 
 
1155
  <script>jQuery(".fb-page").hide(); (function(d, s, id) {
1156
  var js, fjs = d.getElementsByTagName(s)[0];
1157
  if (d.getElementById(id)) return;
@@ -1159,2083 +1300,2120 @@ class feed_them_social_functions {
1159
  js.src = "//connect.facebook.net/' . esc_html( $language_option ) . '/sdk.js#xfbml=1&appId=&version=v3.1";
1160
  fjs.parentNode.insertBefore(js, fjs);
1161
  }(document, "script", "facebook-jssd"));</script>';
1162
- $_POST['fts_facebook_script_loaded'] = 'yes';
1163
- }
1164
-
1165
- // Page Box!
1166
- if ( 'like-box' === $fb_show_follow_btn || 'like-box-faces' === $fb_show_follow_btn ) {
1167
-
1168
- $like_box_width = isset( $fb_shortcode['like_box_width'] ) && '' !== $fb_shortcode['like_box_width'] ? $fb_shortcode['like_box_width'] : '500px';
1169
-
1170
- echo '<div class="fb-page" data-href="' . esc_url( 'https://www.facebook.com/' . $user_id ) . '" data-hide-cover="' . esc_html( $page_cover ) . '" data-width="' . esc_html( $like_box_width ) . '" data-show-facepile="' . esc_html( $show_faces ) . '" data-show-posts="false"></div>';
1171
- } else {
1172
- echo '<div class="fb-like" data-href="' . esc_url( 'https://www.facebook.com/' . $user_id ) . '" data-layout="standard" data-action="like" data-colorscheme="' . esc_html( $fb_like_btn_color ) . '" data-show-faces="' . esc_html( $show_faces ) . '" data-share="' . esc_html( $share_button ) . '" data-width:"100%"></div>';
1173
- }
1174
- break;
1175
- case 'instagram':
1176
- echo '<a href="' . esc_url( 'https://instagram.com/' . $user_id . '/' ) . '" target="_blank">' . esc_html( 'Follow on Instagram', 'feed-them-social' ) . '</a>';
1177
- break;
1178
- case 'twitter':
1179
- if ( ! isset( $_POST['fts_twitter_script_loaded'] ) ) {
1180
- echo "<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>";
1181
- $_POST['fts_twitter_script_loaded'] = 'yes';
1182
- }
1183
- // CAN't ESCAPE Twitter link because then JS doesn't work!
1184
- echo '<a class="twitter-follow-button" href="' . ' https://twitter.com/' . $user_id . ' " data-show-count="false" data-lang="en"> Follow @' . esc_html( $user_id ) . '</a>';
1185
- break;
1186
- case 'pinterest':
1187
- if ( ! isset( $_POST['fts_pinterest_script_loaded'] ) ) {
1188
- echo '<script>jQuery(function () {jQuery.getScript("//assets.pinterest.com/js/pinit.js");});</script>';
1189
- $_POST['fts_pinterest_script_loaded'] = 'yes';
1190
- }
1191
- // we return this one until we echo out the pinterest feed instead of $output.=.
1192
- return '<a data-pin-do="buttonFollow" href="https://www.pinterest.com/' . esc_html( $user_id ) . '/">' . esc_html( $user_id ) . '</a>';
1193
- break;
1194
- case 'youtube':
1195
- if ( ! isset( $_POST['fts_youtube_script_loaded'] ) ) {
1196
- echo '<script src="' . esc_url( 'https://apis.google.com/js/platform.js' ) . '"></script>';
1197
- $_POST['fts_youtube_script_loaded'] = 'yes';
1198
- }
1199
- if ( '' === $channel_id && '' === $playlist_id && '' !== $username || '' !== $playlist_id && '' !== $username_subscribe_btn ) {
1200
-
1201
- if ( '' !== $username_subscribe_btn ) {
1202
- echo '<div class="g-ytsubscribe" data-channel="' . esc_html( $username_subscribe_btn ) . '" data-layout="full" data-count="default"></div>';
1203
- } else {
1204
- echo '<div class="g-ytsubscribe" data-channel="' . esc_html( $user_id ) . '" data-layout="full" data-count="default"></div>';
1205
- }
1206
- } elseif ( '' !== $channel_id && '' !== $playlist_id || '' !== $channel_id ) {
1207
- echo '<div class="g-ytsubscribe" data-channelid="' . esc_html( $channel_id ) . '" data-layout="full" data-count="default"></div>';
1208
- }
1209
- break;
1210
- }
1211
- }
1212
- }
1213
-
1214
- /**
1215
- * FTS Color Options Head CSS
1216
- *
1217
- * @since 1.9.6
1218
- */
1219
- public function fts_color_options_head_css() {
1220
- ?>
1221
- <style type="text/css"><?php echo get_option( 'fts-color-options-main-wrapper-css-input' ); ?></style>
1222
- <?php
1223
- }
1224
-
1225
- /**
1226
- * FTS FB Color Options Head CSS
1227
- *
1228
- * Color Options CSS for Facebook.
1229
- *
1230
- * @since 1.9.6
1231
- */
1232
- public function fts_fb_color_options_head_css() {
1233
- $fb_hide_no_posts_message = get_option( 'fb_hide_no_posts_message' );
1234
- $fb_header_extra_text_color = get_option( 'fb_header_extra_text_color' );
1235
- $fb_text_color = get_option( 'fb_text_color' );
1236
- $fb_link_color = get_option( 'fb_link_color' );
1237
- $fb_link_color_hover = get_option( 'fb_link_color_hover' );
1238
- $fb_feed_width = get_option( 'fb_feed_width' );
1239
- $fb_feed_margin = get_option( 'fb_feed_margin' );
1240
- $fb_feed_padding = get_option( 'fb_feed_padding' );
1241
- $fb_feed_background_color = get_option( 'fb_feed_background_color' );
1242
- $fb_post_background_color = get_option( 'fb_post_background_color' );
1243
- $fb_grid_posts_background_color = get_option( 'fb_grid_posts_background_color' );
1244
- $fb_grid_border_bottom_color = get_option( 'fb_grid_border_bottom_color' );
1245
- $fb_loadmore_background_color = get_option( 'fb_loadmore_background_color' );
1246
- $fb_loadmore_text_color = get_option( 'fb_loadmore_text_color' );
1247
- $fb_border_bottom_color = get_option( 'fb_border_bottom_color' );
1248
- $fb_grid_posts_background_color = get_option( 'fb_grid_posts_background_color' );
1249
- $fb_reviews_backg_color = get_option( 'fb_reviews_backg_color' );
1250
- $fb_reviews_text_color = get_option( 'fb_reviews_text_color' );
1251
-
1252
- $fb_reviews_overall_rating_background_color = get_option( 'fb_reviews_overall_rating_background_color' );
1253
- $fb_reviews_overall_rating_border_color = get_option( 'fb_reviews_overall_rating_border_color' );
1254
- $fb_reviews_overall_rating_text_color = get_option( 'fb_reviews_overall_rating_text_color' );
1255
- $fb_reviews_overall_rating_background_padding = get_option( 'fb_reviews_overall_rating_background_padding' );
1256
-
1257
- $fb_max_image_width = get_option( 'fb_max_image_width' );
1258
-
1259
- $fb_events_title_color = get_option( 'fb_events_title_color' );
1260
- $fb_events_title_size = get_option( 'fb_events_title_size' );
1261
- $fb_events_maplink_color = get_option( 'fb_events_map_link_color' );
1262
-
1263
- $twitter_hide_profile_photo = get_option( 'twitter_hide_profile_photo' );
1264
- $twitter_text_color = get_option( 'twitter_text_color' );
1265
- $twitter_link_color = get_option( 'twitter_link_color' );
1266
- $twitter_link_color_hover = get_option( 'twitter_link_color_hover' );
1267
- $twitter_feed_width = get_option( 'twitter_feed_width' );
1268
- $twitter_feed_margin = get_option( 'twitter_feed_margin' );
1269
- $twitter_feed_padding = get_option( 'twitter_feed_padding' );
1270
- $twitter_feed_background_color = get_option( 'twitter_feed_background_color' );
1271
- $twitter_border_bottom_color = get_option( 'twitter_border_bottom_color' );
1272
- $twitter_max_image_width = get_option( 'twitter_max_image_width' );
1273
- $twitter_grid_border_bottom_color = get_option( 'twitter_grid_border_bottom_color' );
1274
- $twitter_grid_posts_background_color = get_option( 'twitter_grid_posts_background_color' );
1275
- $twitter_loadmore_background_color = get_option( 'twitter_loadmore_background_color' );
1276
- $twitter_loadmore_text_color = get_option( 'twitter_loadmore_text_color' );
1277
-
1278
- $instagram_loadmore_background_color = get_option( 'instagram_loadmore_background_color' );
1279
- $instagram_loadmore_text_color = get_option( 'instagram_loadmore_text_color' );
1280
-
1281
- $pinterest_board_title_color = get_option( 'pinterest_board_title_color' );
1282
- $pinterest_board_title_size = get_option( 'pinterest_board_title_size' );
1283
- $pinterest_board_backg_hover_color = get_option( 'pinterest_board_backg_hover_color' );
1284
-
1285
- $fts_social_icons_color = get_option( 'fts_social_icons_color' );
1286
- $fts_social_icons_hover_color = get_option( 'fts_social_icons_hover_color' );
1287
- $fts_social_icons_back_color = get_option( 'fts_social_icons_back_color' );
1288
-
1289
- $youtube_loadmore_background_color = get_option( 'youtube_loadmore_background_color' );
1290
- $youtube_loadmore_text_color = get_option( 'youtube_loadmore_text_color' );
1291
-
1292
- $fb_text_size = get_option( 'fb_text_size' );
1293
- $twitter_text_size = get_option( 'twitter_text_size' );
1294
- ?>
1295
- <style type="text/css"><?php if ( ! empty( $fb_header_extra_text_color ) ) { ?>
1296
-
1297
- <?php }if ( ! empty( $fb_hide_no_posts_message ) && 'yes' === $fb_hide_no_posts_message ) { ?>
1298
- .fts-facebook-add-more-posts-notice {
1299
- display: none !important;
1300
- }
1301
-
1302
- .fts-jal-single-fb-post .fts-jal-fb-user-name {
1303
- color: <?php echo esc_html( $fb_header_extra_text_color ); ?> !important;
1304
- }
1305
-
1306
- <?php }if ( ! empty( $fb_loadmore_background_color ) ) { ?>
1307
- .fts-fb-load-more-wrapper .fts-fb-load-more {
1308
- background: <?php echo esc_html( $fb_loadmore_background_color ); ?> !important;
1309
- }
1310
-
1311
- <?php }if ( ! empty( $fb_loadmore_text_color ) ) { ?>
1312
- .fts-fb-load-more-wrapper .fts-fb-load-more {
1313
- color: <?php echo esc_html( $fb_loadmore_text_color ); ?> !important;
1314
- }
1315
-
1316
- <?php }if ( ! empty( $fb_loadmore_text_color ) ) { ?>
1317
- .fts-fb-load-more-wrapper .fts-fb-spinner>div {
1318
- background: <?php echo esc_html( $fb_loadmore_text_color ); ?> !important;
1319
- }
1320
-
1321
- <?php }if ( ! empty( $fb_text_color ) ) { ?>
1322
- .fts-simple-fb-wrapper .fts-jal-single-fb-post,
1323
- .fts-simple-fb-wrapper .fts-jal-fb-description-wrap,
1324
- .fts-simple-fb-wrapper .fts-jal-fb-post-time,
1325
- .fts-slicker-facebook-posts .fts-jal-single-fb-post,
1326
- .fts-slicker-facebook-posts .fts-jal-fb-description-wrap,
1327
- .fts-slicker-facebook-posts .fts-jal-fb-post-time {
1328
- color: <?php echo esc_html( $fb_text_color ); ?> !important;
1329
- }
1330
-
1331
- <?php }if ( ! empty( $fb_link_color ) ) { ?>
1332
- .fts-simple-fb-wrapper .fts-jal-single-fb-post .fts-review-name,
1333
- .fts-simple-fb-wrapper .fts-jal-single-fb-post a,
1334
- .fts-slicker-facebook-posts .fts-jal-single-fb-post a,
1335
- .fts-jal-fb-group-header-desc a {
1336
- color: <?php echo esc_html( $fb_link_color ); ?> !important;
1337
- }
1338
-
1339
- <?php }if ( ! empty( $fb_link_color_hover ) ) { ?>
1340
- .fts-simple-fb-wrapper .fts-jal-single-fb-post a:hover,
1341
- .fts-simple-fb-wrapper .fts-fb-load-more:hover,
1342
- .fts-slicker-facebook-posts .fts-jal-single-fb-post a:hover,
1343
- .fts-slicker-facebook-posts .fts-fb-load-more:hover,
1344
- .fts-jal-fb-group-header-desc a:hover{
1345
- color: <?php echo esc_html( $fb_link_color_hover ); ?> !important;
1346
- }
1347
-
1348
- <?php }if ( ! empty( $fb_feed_width ) ) { ?>
1349
- .fts-simple-fb-wrapper, .fts-fb-header-wrapper, .fts-fb-load-more-wrapper, .fts-jal-fb-header, .fb-social-btn-top, .fb-social-btn-bottom, .fb-social-btn-below-description {
1350
- max-width: <?php echo esc_html( $fb_feed_width ); ?> !important;
1351
- }
1352
-
1353
- <?php }if ( ! empty( $fb_max_image_width ) ) { ?>
1354
- .fts-fb-large-photo, .fts-jal-fb-vid-picture, .fts-jal-fb-picture, .fts-fluid-videoWrapper-html5 {
1355
- max-width: <?php echo esc_html( $fb_max_image_width ); ?> !important;
1356
- float: left;
1357
- }
1358
-
1359
- <?php }if ( ! empty( $fb_events_title_color ) ) { ?>
1360
- .fts-simple-fb-wrapper .fts-events-list-wrap a.fts-jal-fb-name {
1361
- color: <?php echo esc_html( $fb_events_title_color ); ?> !important;
1362
- }
1363
-
1364
- <?php }if ( ! empty( $fb_events_title_size ) ) { ?>
1365
- .fts-simple-fb-wrapper .fts-events-list-wrap a.fts-jal-fb-name {
1366
- font-size: <?php echo esc_html( $fb_events_title_size ); ?> !important;
1367
- line-height: <?php echo esc_html( $fb_events_title_size ); ?> !important;
1368
- }
1369
-
1370
- <?php }if ( ! empty( $fb_events_maplink_color ) ) { ?>
1371
- .fts-simple-fb-wrapper a.fts-fb-get-directions {
1372
- color: <?php echo esc_html( $fb_events_maplink_color ); ?> !important;
1373
- }
1374
-
1375
- <?php }if ( ! empty( $fb_feed_margin ) ) { ?>
1376
- .fts-simple-fb-wrapper, .fts-fb-header-wrapper, .fts-fb-load-more-wrapper, .fts-jal-fb-header, .fb-social-btn-top, .fb-social-btn-bottom, .fb-social-btn-below-description {
1377
- margin: <?php echo esc_html( $fb_feed_margin ); ?> !important;
1378
- }
1379
-
1380
- <?php }if ( ! empty( $fb_feed_padding ) ) { ?>
1381
- .fts-simple-fb-wrapper {
1382
- padding: <?php echo esc_html( $fb_feed_padding ); ?> !important;
1383
- }
1384
-
1385
- <?php }if ( ! empty( $fb_feed_background_color ) ) { ?>
1386
- .fts-simple-fb-wrapper, .fts-fb-load-more-wrapper .fts-fb-load-more {
1387
- background: <?php echo esc_html( $fb_feed_background_color ); ?> !important;
1388
- }
1389
-
1390
- <?php }if ( ! empty( $fb_post_background_color ) ) { ?>
1391
- .fts-mashup-media-top .fts-jal-single-fb-post {
1392
- background: <?php echo esc_html( $fb_post_background_color ); ?> !important;
1393
- }
1394
-
1395
- <?php }if ( ! empty( $fb_grid_posts_background_color ) ) { ?>
1396
- .fts-slicker-facebook-posts .fts-jal-single-fb-post {
1397
- background: <?php echo esc_html( $fb_grid_posts_background_color ); ?> !important;
1398
- }
1399
-
1400
- <?php }if ( ! empty( $fb_border_bottom_color ) ) { ?>
1401
- .fts-jal-single-fb-post {
1402
- border-bottom-color: <?php echo esc_html( $fb_border_bottom_color ); ?> !important;
1403
- }
1404
-
1405
- <?php }if ( ! empty( $fb_grid_border_bottom_color ) ) { ?>
1406
- .fts-slicker-facebook-posts .fts-jal-single-fb-post {
1407
- border-bottom-color: <?php echo esc_html( $fb_grid_border_bottom_color ); ?> !important;
1408
- }
1409
-
1410
- <?php }if ( ! empty( $twitter_grid_posts_background_color ) ) { ?>
1411
- .fts-slicker-twitter-posts .fts-tweeter-wrap {
1412
- background: <?php echo esc_html( $twitter_grid_posts_background_color ); ?> !important;
1413
- }
1414
-
1415
- <?php }if ( ! empty( $twitter_grid_border_bottom_color ) ) { ?>
1416
- .fts-slicker-twitter-posts .fts-tweeter-wrap {
1417
- border-bottom-color: <?php echo esc_html( $twitter_grid_border_bottom_color ); ?> !important;
1418
- }
1419
-
1420
- <?php }if ( ! empty( $twitter_loadmore_background_color ) ) { ?>
1421
- .fts-twitter-load-more-wrapper .fts-fb-load-more {
1422
- background: <?php echo esc_html( $twitter_loadmore_background_color ); ?> !important;
1423
- }
1424
-
1425
- <?php }if ( ! empty( $twitter_loadmore_text_color ) ) { ?>
1426
- .fts-twitter-load-more-wrapper .fts-fb-load-more {
1427
- color: <?php echo esc_html( $twitter_loadmore_text_color ); ?> !important;
1428
- }
1429
-
1430
- <?php }if ( ! empty( $twitter_loadmore_text_color ) ) { ?>
1431
- .fts-twitter-load-more-wrapper .fts-fb-spinner>div {
1432
- background: <?php echo esc_html( $twitter_loadmore_text_color ); ?> !important;
1433
- }
1434
-
1435
- <?php }if ( ! empty( $fb_reviews_backg_color ) ) { ?>
1436
- .fts-review-star {
1437
- background: <?php echo esc_html( $fb_reviews_backg_color ); ?> !important;
1438
- }
1439
-
1440
- <?php }if ( ! empty( $fb_reviews_overall_rating_background_color ) ) { ?>
1441
- .fts-review-details-master-wrap {
1442
- background: <?php echo esc_html( $fb_reviews_overall_rating_background_color ); ?> !important;
1443
- }
1444
-
1445
- <?php }if ( ! empty( $fb_reviews_overall_rating_border_color ) ) { ?>
1446
- .fts-review-details-master-wrap {
1447
- border-bottom-color: <?php echo esc_html( $fb_reviews_overall_rating_border_color ); ?> !important;
1448
- }
1449
-
1450
- <?php }if ( ! empty( $fb_reviews_overall_rating_background_padding ) ) { ?>
1451
- .fts-review-details-master-wrap {
1452
- padding: <?php echo esc_html( $fb_reviews_overall_rating_background_padding ); ?> !important;
1453
- }
1454
-
1455
- <?php }if ( ! empty( $fb_reviews_overall_rating_text_color ) ) { ?>
1456
- .fts-review-details-master-wrap {
1457
- color: <?php echo esc_html( $fb_reviews_overall_rating_text_color ); ?> !important;
1458
- }
1459
-
1460
- <?php }if ( ! empty( $fb_reviews_text_color ) ) { ?>
1461
- .fts-review-star {
1462
- color: <?php echo esc_html( $fb_reviews_text_color ); ?> !important;
1463
- }
1464
-
1465
- <?php }if ( ! empty( $twitter_text_color ) ) { ?>
1466
- .tweeter-info .fts-twitter-text, .fts-twitter-reply-wrap:before, a span.fts-video-loading-notice {
1467
- color: <?php echo esc_html( $twitter_text_color ); ?> !important;
1468
- }
1469
-
1470
- <?php }if ( ! empty( $twitter_link_color ) ) { ?>
1471
- .tweeter-info .fts-twitter-text a, .tweeter-info .fts-twitter-text .time a, .fts-twitter-reply-wrap a, .tweeter-info a, .twitter-followers-fts a, body.fts-twitter-reply-wrap a {
1472
- color: <?php echo esc_html( $twitter_link_color ); ?> !important;
1473
- }
1474
-
1475
- <?php }if ( ! empty( $twitter_link_color_hover ) ) { ?>
1476
- .tweeter-info a:hover, .tweeter-info:hover .fts-twitter-reply, body.fts-twitter-reply-wrap a:hover {
1477
- color: <?php echo esc_html( $twitter_link_color_hover ); ?> !important;
1478
- }
1479
-
1480
- <?php }if ( ! empty( $twitter_feed_width ) ) { ?>
1481
- .fts-twitter-div {
1482
- max-width: <?php echo esc_html( $twitter_feed_width ); ?> !important;
1483
- }
1484
-
1485
- <?php }if ( ! empty( $twitter_feed_margin ) ) { ?>
1486
- .fts-twitter-div {
1487
- margin: <?php echo esc_html( $twitter_feed_margin ); ?> !important;
1488
- }
1489
-
1490
- <?php }if ( ! empty( $twitter_feed_padding ) ) { ?>
1491
- .fts-twitter-div {
1492
- padding: <?php echo esc_html( $twitter_feed_padding ); ?> !important;
1493
- }
1494
-
1495
- <?php }if ( ! empty( $twitter_feed_background_color ) ) { ?>
1496
- .fts-twitter-div {
1497
- background: <?php echo esc_html( $twitter_feed_background_color ); ?> !important;
1498
- }
1499
-
1500
- <?php }if ( ! empty( $twitter_border_bottom_color ) ) { ?>
1501
- .tweeter-info {
1502
- border-bottom: 1px solid <?php echo esc_html( $twitter_border_bottom_color ); ?> !important;
1503
- }
1504
-
1505
- <?php }if ( ! empty( $twitter_max_image_width ) ) { ?>
1506
- .fts-twitter-link-image {
1507
- max-width: <?php echo esc_html( $twitter_max_image_width ); ?> !important;
1508
- display: block;
1509
- }
1510
-
1511
- <?php }if ( ! empty( $instagram_loadmore_background_color ) ) { ?>
1512
- .fts-instagram-load-more-wrapper .fts-fb-load-more {
1513
- background: <?php echo esc_html( $instagram_loadmore_background_color ); ?> !important;
1514
- }
1515
-
1516
- <?php }if ( ! empty( $instagram_loadmore_text_color ) ) { ?>
1517
- .fts-instagram-load-more-wrapper .fts-fb-load-more {
1518
- color: <?php echo esc_html( $instagram_loadmore_text_color ); ?> !important;
1519
- }
1520
-
1521
- <?php }if ( ! empty( $instagram_loadmore_text_color ) ) { ?>
1522
- .fts-instagram-load-more-wrapper .fts-fb-spinner>div {
1523
- background: <?php echo esc_html( $instagram_loadmore_text_color ); ?> !important;
1524
- }
1525
-
1526
- <?php } if ( ! empty( $pinterest_board_backg_hover_color ) ) { ?>
1527
- a.fts-pin-board-wrap:hover {
1528
- background: <?php echo esc_html( $pinterest_board_backg_hover_color ); ?> !important;
1529
- }
1530
-
1531
- <?php } if ( ! empty( $pinterest_board_title_color ) ) { ?>
1532
- body h3.fts-pin-board-board_title {
1533
- color: <?php echo esc_html( $pinterest_board_title_color ); ?> !important;
1534
- }
1535
-
1536
- <?php } if ( ! empty( $pinterest_board_title_size ) ) { ?>
1537
- body h3.fts-pin-board-board_title {
1538
- font-size: <?php echo esc_html( $pinterest_board_title_size ); ?> !important;
1539
- }
1540
-
1541
- <?php
 
 
1542
  }
1543
  if ( ! empty( $fts_social_icons_color ) ) {
1544
  ?>
1545
- .ft-gallery-share-wrap a.ft-galleryfacebook-icon, .ft-gallery-share-wrap a.ft-gallerytwitter-icon, .ft-gallery-share-wrap a.ft-gallerygoogle-icon, .ft-gallery-share-wrap a.ft-gallerylinkedin-icon, .ft-gallery-share-wrap a.ft-galleryemail-icon {
1546
- color: <?php echo esc_html( $fts_social_icons_color ); ?> !important;
1547
- }
1548
- <?php
 
1549
  }
1550
  if ( ! empty( $fts_social_icons_hover_color ) ) {
1551
  ?>
1552
- .ft-gallery-share-wrap a.ft-galleryfacebook-icon:hover, .ft-gallery-share-wrap a.ft-gallerytwitter-icon:hover, .ft-gallery-share-wrap a.ft-gallerygoogle-icon:hover, .ft-gallery-share-wrap a.ft-gallerylinkedin-icon:hover, .ft-gallery-share-wrap a.ft-galleryemail-icon:hover {
1553
- color: <?php echo esc_html( $fts_social_icons_hover_color ); ?> !important;
1554
- }
1555
 
1556
- <?php
1557
  }
1558
  if ( ! empty( $fts_social_icons_back_color ) ) {
1559
  ?>
1560
- .ft-gallery-share-wrap {
1561
- background: <?php echo esc_html( $fts_social_icons_back_color ); ?> !important;
1562
- }
1563
 
1564
- <?php
1565
  }
1566
  if ( ! empty( $twitter_text_size ) ) {
1567
  ?>
1568
- span.fts-twitter-text {
1569
- font-size: <?php echo esc_html( $twitter_text_size ); ?> !important;
1570
- }
1571
 
1572
- <?php
1573
  }
1574
  if ( ! empty( $fb_text_size ) ) {
1575
  ?>
1576
- .fts-jal-fb-group-display .fts-jal-fb-message, .fts-jal-fb-group-display .fts-jal-fb-message p, .fts-jal-fb-group-header-desc, .fts-jal-fb-group-header-desc p, .fts-jal-fb-group-header-desc a {
1577
- font-size: <?php echo esc_html( $fb_text_size ); ?> !important;
1578
- }
1579
 
1580
- <?php
1581
  }
1582
  if ( ! empty( $youtube_loadmore_background_color ) ) {
1583
  ?>
1584
- .fts-youtube-load-more-wrapper .fts-fb-load-more {
1585
- background: <?php echo esc_html( $youtube_loadmore_background_color ); ?> !important;
1586
- }
1587
-
1588
- <?php }if ( ! empty( $youtube_loadmore_text_color ) ) { ?>
1589
- .fts-youtube-load-more-wrapper .fts-fb-load-more {
1590
- color: <?php echo esc_html( $youtube_loadmore_text_color ); ?> !important;
1591
- }
1592
- <?php
 
1593
  }
1594
  if ( ! empty( $youtube_loadmore_text_color ) ) {
1595
  ?>
1596
- .fts-youtube-load-more-wrapper .fts-fb-spinner>div {
1597
- background: <?php echo esc_html( $youtube_loadmore_text_color ); ?> !important;
1598
- }
1599
- <?php } ?>
1600
-
1601
- </style>
1602
- <?php
1603
- }
1604
-
1605
- /**
1606
- * FTS Powered By JS
1607
- *
1608
- * @since 1.9.6
1609
- */
1610
- public function fts_powered_by_js() {
1611
- wp_enqueue_script( 'fts_powered_by_js', plugins_url( 'feeds/js/powered-by.js', dirname( __FILE__ ) ), array( 'jquery' ), FTS_CURRENT_VERSION, false );
1612
- }
1613
-
1614
- /**
1615
- * Required Premium Field
1616
- *
1617
- * Admin Required Premium Settings Fields.
1618
- *
1619
- * @param array $fields_info fields info.
1620
- * @since 2.0.7
1621
- */
1622
- public function need_fts_premium_plugin_field( $fields_info ) {
1623
- $output = '<div class="feed-them-social-admin-input-default">' . wp_kses(
1624
- $fields_info['no_active_msg'],
1625
- array(
1626
- 'a' => array(
1627
- 'href' => array(),
1628
- 'title' => array(),
1629
- 'target' => array(),
1630
- ),
1631
- 'br' => array(),
1632
- 'em' => array(),
1633
- 'strong' => array(),
1634
- )
1635
- ) . '</div>';
1636
-
1637
- return $output;
1638
- }
1639
-
1640
- /**
1641
- * Settings Form Fields Output
1642
- *
1643
- * @param bool $save_options save options.
1644
- * @param array $feed_settings_array feed settings information.
1645
- * @param array $required_plugins The plugins that are required for this form.
1646
- * @since 2.0.8
1647
- */
1648
- public function fts_settings_html_form( $save_options = false, $feed_settings_array, $required_plugins ) {
1649
-
1650
- $output = '';
1651
-
1652
- // Start creation of fields for each Feed!
1653
- foreach ( $feed_settings_array as $section => $section_info ) {
1654
- $output .= '<div class="' . esc_attr( $section_info['section_wrap_class'] ) . '">';
1655
- $output .= '<form class="feed-them-social-admin-form shortcode-generator-form ' . esc_attr( $section_info['form_wrap_classes'] ) . '" id="' . esc_attr( $section_info['form_wrap_id'] ) . '">';
1656
-
1657
- // Check to see if token is in place otherwise show a message letting person no what they need to do!
1658
- if ( isset( $section_info['token_check'] ) ) {
1659
- foreach ( $section_info['token_check'] as $token_key => $token_info ) {
1660
- if ( ! isset( $token_info['req_plugin'] ) || isset( $token_info['req_plugin'] ) && is_plugin_active( $required_plugins[ $token_info['req_plugin'] ]['plugin_url'] ) ) {
1661
- $token_check = get_option( $token_info['option_name'] ) ? 'Yes' : 'No';
1662
- $output .= isset( $token_check ) && 'No' !== $token_check ? "\n" : '<div class="feed-them-social-admin-input-wrap fts-required-token-message">' . wp_kses(
1663
- $token_info['no_token_msg'],
1664
- array(
1665
- 'a' => array(
1666
- 'href' => array(),
1667
- 'title' => array(),
1668
- 'target' => array(),
1669
- ),
1670
- 'br' => array(),
1671
- 'em' => array(),
1672
- 'strong' => array(),
1673
- 'small' => array(),
1674
- )
1675
- ) . '</div>' . "\n";
1676
- }
1677
- }
1678
- }
1679
- // Section Title!
1680
- $output .= isset( $section_info['section_title'] ) ? '<h2>' . esc_html( $section_info['section_title'] ) . '</h2>' : '';
1681
- // Feed Types select!
1682
- if ( isset( $section_info['feeds_types'] ) ) {
1683
- $output .= '<div class="feed-them-social-admin-input-wrap ' . esc_attr( $section_info['feed_type_select']['select_wrap_classes'] ) . '">';
1684
- $output .= '<div class="feed-them-social-admin-input-label">' . wp_kses(
1685
- $section_info['feed_type_select']['label'],
1686
- array(
1687
- 'a' => array(
1688
- 'href' => array(),
1689
- 'title' => array(),
1690
- 'target' => array(),
1691
- ),
1692
- 'br' => array(),
1693
- 'em' => array(),
1694
- 'strong' => array(),
1695
- )
1696
- ) . '</div>';
1697
- $output .= '<select name="' . esc_attr( $section_info['feed_type_select']['select_name'] ) . '" id="' . esc_attr( $section_info['feed_type_select']['select_id'] ) . '" class="feed-them-social-admin-input ' . esc_attr( $section_info['feed_type_select']['select_classes'] ) . '">';
1698
- foreach ( $section_info['feeds_types'] as $feed_type_name => $feed_type ) {
1699
- if ( 'main_options' !== $feed_type_name ) {
1700
- $output .= '<option value="' . esc_attr( $feed_type['value'] ) . '">' . esc_html( $feed_type['title'] ) . '</option>';
1701
- }
1702
- }
1703
- $output .= '</select>';
1704
- $output .= '<div class="fts-clear"></div>';
1705
- $output .= '</div><!--/Feed Types Select Div Wrap-->';
1706
- }
1707
-
1708
- // Conversion Input!
1709
- if ( isset( $section_info['conversion_input'] ) ) {
1710
- $output .= '<div class="' . esc_attr( $section_info['conversion_input']['main_wrap_class'] ) . '">';
1711
- $output .= '<h2>' . esc_html( $section_info['conversion_input']['conv_section_title'] ) . '</h2>';
1712
- $output .= '<div class="feed-them-social-admin-input-wrap ' . esc_attr( $section_info['conversion_input']['input_wrap_class'] ) . '">';
1713
- // Instructional Text!
1714
- $output .= '<div class="instructional-text">' . esc_html( $section_info['conversion_input']['instructional-text'] ) . '</div>';
1715
- $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( $section_info['conversion_input']['label'] ) . '</div>';
1716
- // Input!
1717
- $output .= '<input type="input" name="' . esc_attr( $section_info['conversion_input']['name'] ) . '" id="' . esc_attr( $section_info['conversion_input']['id'] ) . '" class="feed-them-social-admin-input ' . ( isset( $section_info['conversion_input']['class'] ) ? esc_attr( $section_info['conversion_input']['class'] ) : '' ) . '" value="" />';
1718
- $output .= '<div class="fts-clear"></div>';
1719
- $output .= '</div><!--/Conversion Input Wrap-->';
1720
-
1721
- $output .= '<input type="button" class="feed-them-social-admin-submit-btn" value="' . esc_attr( $section_info['conversion_input']['btn-value'] ) . '" onclick="' . esc_js( $section_info['conversion_input']['onclick'] ) . '" tabindex="4" style="margin-right:1em;" />';
1722
- $output .= '</div>';
1723
-
1724
- }
1725
-
1726
- $output .= '</form>';
1727
-
1728
- // Feed Options!
1729
- $output .= '<form class="feed-them-social-admin-form shortcode-generator-form ' . esc_attr( $section_info['form_wrap_classes'] ) . ' ' . esc_attr( $section ) . '_options_wrap">';
1730
-
1731
- // Create settings fields for Feed OPTIONS!
1732
- foreach ( $section_info['main_options'] as $option ) {
1733
- if ( ! isset( $option['no_html'] ) || isset( $option['no_html'] ) && 'yes' !== $option['no_html'] ) {
1734
-
1735
- // Is a premium extension required?
1736
- $required_plugin = ( ! isset( $option['req_plugin'] ) || isset( $option['req_plugin'] ) && is_plugin_active( $required_plugins[ $option['req_plugin'] ]['plugin_url'] ) );
1737
- $or_required_plugin = ( isset( $option['or_req_plugin'] ) && is_plugin_active( $required_plugins[ $option['or_req_plugin'] ]['plugin_url'] ) );
1738
- $or_required_plugin_three = ( isset( $option['or_req_plugin_three'] ) && is_plugin_active( $required_plugins[ $option['or_req_plugin_three'] ]['plugin_url'] ) );
1739
-
1740
- // Sub option output START?
1741
- $output .= isset( $option['sub_options'] ) ? '<div class="' . esc_attr( $option['sub_options']['sub_options_wrap_class'] ) . ( ! $required_plugin ? ' not-active-premium-fields' : '' ) . '">' . ( isset( $option['sub_options']['sub_options_title'] ) ? '<h3>' . esc_html( $option['sub_options']['sub_options_title'] ) . '</h3>' : '' ) . ( isset( $option['sub_options']['sub_options_instructional_txt'] ) ? '<div class="instructional-text">' . esc_html( $option['sub_options']['sub_options_instructional_txt'] ) . '</div>' : '' ) : '';
1742
-
1743
- $output .= isset( $option['grouped_options_title'] ) ? '<h3 class="sectioned-options-title">' . esc_html( $option['grouped_options_title'] ) . '</h3>' : '';
1744
-
1745
- // Only on a few options generally!
1746
- $output .= isset( $option['outer_wrap_class'] ) || isset( $option['outer_wrap_display'] ) ? '<div ' . ( isset( $option['outer_wrap_class'] ) ? 'class="' . esc_attr( $option['outer_wrap_class'] ) . '"' : '' ) . ' ' . ( isset( $option['outer_wrap_display'] ) && ! empty( $option['outer_wrap_display'] ) ? 'style="display:' . esc_attr( $option['outer_wrap_display'] ) . '"' : '' ) . '>' : '';
1747
- // Main Input Wrap!
1748
- $output .= '<div class="feed-them-social-admin-input-wrap ' . ( isset( $option['input_wrap_class'] ) ? esc_attr( $option['input_wrap_class'] ) : '' ) . '" ' . ( isset( $section_info['input_wrap_id'] ) ? 'id="' . esc_attr( $section_info['input_wrap_id'] ) . '"' : '' ) . '>';
1749
- // Instructional Text!
1750
- $output .= ! empty( $option['instructional-text'] ) && ! is_array( $option['instructional-text'] ) ? '<div class="instructional-text ' . ( isset( $option['instructional-class'] ) ? esc_attr( $option['instructional-class'] ) : '' ) . '">' . wp_kses(
1751
- $option['instructional-text'],
1752
- array(
1753
- 'a' => array(
1754
- 'href' => array(),
1755
- 'title' => array(),
1756
- 'target' => array(),
1757
- ),
1758
- 'br' => array(),
1759
- 'em' => array(),
1760
- 'strong' => array(),
1761
- )
1762
- ) . '</div>' : '';
1763
-
1764
- if ( ! empty( $option['instructional-text'] ) && is_array( $option['instructional-text'] ) ) {
1765
- foreach ( $option['instructional-text'] as $instructional_txt ) {
1766
- // Instructional Text!
1767
- $output .= '<div class="instructional-text ' . ( isset( $instructional_txt['class'] ) ? esc_attr( $instructional_txt['class'] ) : '' ) . '">' . wp_kses(
1768
- $instructional_txt['text'],
1769
- array(
1770
- 'a' => array(
1771
- 'href' => array(),
1772
- 'title' => array(),
1773
- 'target' => array(),
1774
- ),
1775
- 'br' => array(),
1776
- 'em' => array(),
1777
- 'strong' => array(),
1778
- )
1779
- ) . '</div>';
1780
- }
1781
- }
1782
-
1783
- // Label Text!
1784
- $output .= isset( $option['label'] ) && ! is_array( $option['label'] ) ? '<div class="feed-them-social-admin-input-label ' . ( isset( $option['label_class'] ) ? esc_attr( $option['label_class'] ) : '' ) . '">' . wp_kses(
1785
- $option['label'],
1786
- array(
1787
- 'a' => array(
1788
- 'href' => array(),
1789
- 'title' => array(),
1790
- 'target' => array(),
1791
- ),
1792
- 'br' => array(),
1793
- 'em' => array(),
1794
- 'strong' => array(),
1795
- 'small' => array(),
1796
- )
1797
- ) . '</div>' : '';
1798
-
1799
- if ( ! empty( $option['label'] ) && is_array( $option['label'] ) ) {
1800
- foreach ( $option['label'] as $label_txt ) {
1801
- // Label Text!
1802
- $output .= '<div class="feed-them-social-admin-input-label ' . ( isset( $label_txt['class'] ) ? esc_attr( $label_txt['class'] ) : '' ) . '">' . wp_kses(
1803
- $label_txt['text'],
1804
- array(
1805
- 'a' => array(
1806
- 'href' => array(),
1807
- 'title' => array(),
1808
- 'target' => array(),
1809
- ),
1810
- 'br' => array(),
1811
- 'em' => array(),
1812
- 'strong' => array(),
1813
- 'small' => array(),
1814
- )
1815
- ) . '</div>';
1816
- }
1817
- }
1818
-
1819
- if ( $required_plugin || $or_required_plugin || $or_required_plugin_three ) {
1820
- // Option_Type = INPUT!
1821
- $output .= isset( $option['option_type'] ) && 'input' === $option['option_type'] ? '<input type="' . esc_attr( $option['type'] ) . '" name="' . esc_attr( $option['name'] ) . '" id="' . esc_attr( $option['id'] ) . '" class="' . ( isset( $option['color_picker'] ) && 'yes' === $option['color_picker'] ? 'color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:\'#eee\',pickerFace:3,pickerBorder:0,pickerInsetColor:\'white\'} ' : '' ) . 'feed-them-social-admin-input ' . ( isset( $option['class'] ) ? esc_attr( $option['class'] ) : '' ) . '" placeholder="' . ( isset( $option['placeholder'] ) ? esc_attr( $option['placeholder'] ) : '' ) . '" value="' . ( isset( $option['value'] ) ? '' . esc_html( $option['value'] ) : '' ) . '" />' : '';
1822
-
1823
- // Option_Type = Select!
1824
- if ( isset( $option['option_type'] ) && 'select' === $option['option_type'] ) {
1825
- $output .= '<select name="' . esc_attr( $option['name'] ) . '" id="' . esc_attr( $option['id'] ) . '" class="feed-them-social-admin-input">';
1826
- foreach ( $option['options'] as $select_option ) {
1827
- $output .= '<option value="' . esc_html( $select_option['value'] ) . '"' . ( isset( $option['default_value'] ) && $option['default_value'] === $select_option['value'] ? ' selected' : '' ) . '>' . esc_html( $select_option['label'] ) . '</option>';
1828
- }
1829
- $output .= '</select>';
1830
- }
1831
- } else {
1832
- // Create Required Plugin fields!
1833
- $output .= $this->need_fts_premium_plugin_field( $required_plugins[ $option['req_plugin'] ] );
1834
- }
1835
- $output .= '<div class="fts-clear"></div>';
1836
- $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
1837
-
1838
- $output .= isset( $option['outer_wrap_class'] ) || isset( $option['outer_wrap_display'] ) ? '</div>' : '';
1839
-
1840
- // Sub option output END?
1841
- if ( isset( $option['sub_options_end'] ) ) {
1842
- $output .= ! is_numeric( $option['sub_options_end'] ) ? '</div>' : '';
1843
- // Multiple Div needed?
1844
- if ( is_numeric( $option['sub_options_end'] ) ) {
1845
- $x = 1;
1846
- while ( $x <= $option['sub_options_end'] ) {
1847
- $output .= '</div>';
1848
- $x++;
1849
- }
1850
- }
1851
- }
1852
- }
1853
- }
1854
- $output .= $this->generate_shortcode( 'updateTextArea_' . $section . '();', $section_info['generator_title'], $section_info['generator_class'] );
1855
- $output .= '</form>';
1856
-
1857
- $output .= '</div> <!--/Section Wrap Class END (Main-Section-Div)-->';
1858
-
1859
- // Premium Message Boxes!
1860
- if ( isset( $section_info['premium_msg_boxes'] ) ) {
1861
- foreach ( $section_info['premium_msg_boxes'] as $key => $premium_msg ) {
1862
- if ( ! is_plugin_active( $required_plugins[ $premium_msg['req_plugin'] ]['plugin_url'] ) ) {
1863
- $output .= '<div class="feed-them-social-admin-input-wrap fts-premium-options-message" id="not_active_' . esc_attr( $key ) . '"><a class="not-active-title" href="' . esc_url( $required_plugins[ $premium_msg['req_plugin'] ]['slick_url'] ) . '" target="_blank">' .
1864
-
1865
- wp_kses(
1866
- $required_plugins[ $premium_msg['req_plugin'] ]['name'],
1867
- array(
1868
- 'h3' => array(),
1869
- )
1870
- ) .
1871
-
1872
- '</a>' . wp_kses(
1873
- $premium_msg['msg'],
1874
- array(
1875
- 'a' => array(
1876
- 'href' => array(),
1877
- 'title' => array(),
1878
- 'target' => array(),
1879
- ),
1880
- 'br' => array(),
1881
- 'em' => array(),
1882
- 'strong' => array(),
1883
- 'small' => array(),
1884
- )
1885
- ) . '</div>';
1886
- }
1887
- }
1888
- }
1889
- }
1890
- return $output;
1891
- }
1892
-
1893
- /**
1894
- * FTS Facebook Page Form
1895
- *
1896
- * @param bool $save_options save options.
1897
- * @since 1.9.6
1898
- */
1899
- public function fts_facebook_page_form( $save_options = false ) {
1900
- $fts_fb_page_form_nonce = wp_create_nonce( 'fts-facebook-page-form-nonce' );
1901
-
1902
- if ( wp_verify_nonce( $fts_fb_page_form_nonce, 'fts-facebook-page-form-nonce' ) ) {
1903
- if ( $save_options ) {
1904
- $fb_page_id_option = get_option( 'fb_page_id' );
1905
- $fb_page_posts_displayed_option = get_option( 'fb_page_posts_displayed' );
1906
- $fb_page_post_count_option = get_option( 'fb_page_post_count' );
1907
- $fb_page_title_option = get_option( 'fb_page_title_option' );
1908
- $fb_page_description_option = get_option( 'fb_page_description_option' );
1909
- $fb_page_word_count_option = get_option( 'fb_page_word_count_option' );
1910
- $fts_bar_fb_prefix = 'fb_page_';
1911
- $fb_load_more_option = get_option( 'fb_page_fb_load_more_option' );
1912
- $fb_load_more_style = get_option( 'fb_page_fb_load_more_style' );
1913
- $facebook_popup = get_option( 'fb_page_facebook_popup' );
1914
- }
1915
- $output = '<div class="fts-facebook_page-shortcode-form">';
1916
- if ( false === $save_options ) {
1917
- $output = '<form class="feed-them-social-admin-form shortcode-generator-form fb-page-shortcode-form" id="fts-fb-page-form">';
1918
-
1919
- // Check to see if token is in place otherwise show a message letting person no what they need to do!
1920
- $facebook_options = get_option( 'fts_facebook_custom_api_token' ) ? 'Yes' : 'No';
1921
- $output .= isset( $facebook_options ) && 'No' !== $facebook_options ? '' . "\n" : '<div class="feed-them-social-admin-input-wrap fts-required-token-message">Please get your Access Token on our <a href="admin.php?page=fts-facebook-feed-styles-submenu-page">Facebook Options</a> page.</div>' . "\n";
1922
- // end custom message for requiring token!
1923
- if ( is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) ) {
1924
- $facebook_options2 = get_option( 'fts_facebook_custom_api_token_biz' ) ? 'Yes' : 'No';
1925
- // Check to see if token is in place otherwise show a message letting person no what they need to do
1926
- // $output .= isset($facebook_options2) && $facebook_options2 !== 'No' ? '' . "\n" : '<div class="feed-them-social-admin-input-wrap fts-required-token-message">Please add a Facebook Page Reviews API Token to our <a href="admin.php?page=fts-facebook-feed-styles-submenu-page">Facebook Options</a> page before trying to view your Facebook Reviews feed.</div>' . "\n";
1927
- // end custom message for requiring token!
1928
- }
1929
-
1930
- $output .= '<h2>' . esc_html( 'Facebook Page Shortcode Generator', 'feed-them-social' ) . '</h2>';
1931
- }
1932
- $fb_page_id_option = isset( $fb_page_id_option ) ? $fb_page_id_option : '';
1933
- // ONLY SHOW SUPER GALLERY OPTIONS ON FTS SETTINGS PAGE FOR NOW, NOT FTS BAR!
1934
- if ( isset( $_GET['page'] ) && 'feed-them-settings-page' === $_GET['page'] ) {
1935
- // FACEBOOK FEED TYPE!
1936
- $output .= '<div class="feed-them-social-admin-input-wrap" id="fts-social-selector">';
1937
- $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Feed Type', 'feed-them-social' ) . '</div>';
1938
- $output .= '<select name="facebook-messages-selector" id="facebook-messages-selector" class="feed-them-social-admin-input">';
1939
- $output .= '<option value="page">' . esc_html( 'Facebook Page', 'feed-them-social' ) . '</option>';
1940
- $output .= '<option value="events">' . esc_html( 'Facebook Page List of Events', 'feed-them-social' ) . '</option>';
1941
- $output .= '<option value="event">' . esc_html( 'Facebook Page Single Event Posts', 'feed-them-social' ) . '</option>';
1942
- $output .= '<option value="group">' . esc_html( 'Facebook Group', 'feed-them-social' ) . '</option>';
1943
- $output .= '<option value="album_photos">' . esc_html( 'Facebook Album Photos', 'feed-them-social' ) . '</option>';
1944
- $output .= '<option value="albums">' . esc_html( 'Facebook Album Covers', 'feed-them-social' ) . '</option>';
1945
- $output .= '<option value="album_videos">' . esc_html( 'Facebook Videos', 'feed-them-social' ) . '</option>';
1946
- $output .= '<option value="reviews">' . esc_html( 'Facebook Page Reviews', 'feed-them-social' ) . '</option>';
1947
- $output .= '</select>';
1948
- $output .= '<div class="fts-clear"></div>';
1949
- $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
1950
- };
1951
- // INSTRUCTIONAL TEXT FOR FACEBOOK TYPE SELECTION. PAGE, GROUP, EVENT, ALBUMS, ALBUM COVERS AND HASH TAGS!
1952
- $output .= '<div class="instructional-text facebook-message-generator page inst-text-facebook-page" style="display:block;">' . esc_html( 'Copy your', 'feed-them-social' ) . ' <a href="http://www.slickremix.com/how-to-get-your-facebook-page-vanity-url/" target="_blank">' . esc_html( 'Facebook Page ID', 'feed-them-social' ) . '</a> ' . esc_html( 'and paste it in the first input below. You cannot use Personal Profiles it must be a Facebook Page. If your page ID looks something like, My-Page-Name-50043151918, only use the number portion, 50043151918.', 'feed-them-social' ) . ' <a href="https://feedthemsocial.com/?feedID=50043151918" target="_blank">' . esc_html( 'Test your Page ID on our demo', 'feed-them-social' ) . '</a></div>
 
 
 
 
 
1953
  <div class="instructional-text facebook-message-generator group inst-text-facebook-group">' . esc_html( 'Copy your', 'feed-them-social' ) . ' <a href="http://www.slickremix.com/how-to-get-your-facebook-group-id/" target="_blank">' . esc_html( 'Facebook Group ID', 'feed-them-social' ) . '</a> ' . esc_html( 'and paste it in the first input below.', 'feed-them-social' ) . '</div>
1954
  <div class="instructional-text facebook-message-generator event-list inst-text-facebook-event-list">' . esc_html( 'Copy your', 'feed-them-social' ) . ' <a href="http://www.slickremix.com/how-to-get-your-facebook-event-id/" target="_blank">' . esc_html( 'Facebook Event ID', 'feed-them-social' ) . '</a> ' . esc_html( 'and paste it in the first input below. PLEASE NOTE: This will only work with Facebook Page Events and you cannot have more than 25 events on Facebook.', 'feed-them-social' ) . '</div>
1955
  <div class="instructional-text facebook-message-generator event inst-text-facebook-event">' . esc_html( 'Copy your', 'feed-them-social' ) . ' <a href="http://www.slickremix.com/how-to-get-your-facebook-event-id/" target="_blank">' . esc_html( 'Facebook Event ID', 'feed-them-social' ) . '</a> ' . esc_html( 'and paste it in the first input below.', 'feed-them-social' ) . '</div>
1956
  <div class="instructional-text facebook-message-generator album_photos inst-text-facebook-album-photos">' . esc_html( 'To show a specific Album copy your', 'feed-them-social' ) . ' <a href="http://www.slickremix.com/docs/how-to-get-your-facebook-photo-gallery-id/" target="_blank">' . esc_html( 'Facebook Album ID', 'feed-them-social' ) . '</a> ' . esc_html( 'and paste it in the second input below. If you want to show all your uploaded photos leave the Album ID input blank.', 'feed-them-social' ) . '</div>
1957
  <div class="instructional-text facebook-message-generator albums inst-text-facebook-albums">' . esc_html( 'Copy your', 'feed-them-social' ) . ' <a href="http://www.slickremix.com/docs/how-to-get-your-facebook-photo-gallery-id/" target="_blank">' . esc_html( 'Facebook Album Covers ID', 'feed-them-social' ) . '</a> ' . esc_html( 'and paste it in the first input below.', 'feed-them-social' ) . '</div>
1958
  <div class="instructional-text facebook-message-generator video inst-text-facebook-video">' . esc_html( 'Copy your', 'feed-them-social' ) . ' <a href="http://www.slickremix.com/docs/how-to-get-your-facebook-id-and-video-gallery-id" target="_blank">' . esc_html( 'Facebook ID', 'feed-them-social' ) . '</a> ' . esc_html( 'and paste it in the first input below.', 'feed-them-social' ) . '</div>';
1959
- if ( isset( $_GET['page'] ) && 'feed-them-settings-page' === $_GET['page'] ) {
1960
- // this is for the facebook videos!
1961
- $output .= '<div class="feed-them-social-admin-input-wrap fts-premium-options-message" style="display:none;"><a target="_blank" href="http://www.slickremix.com/downloads/feed-them-social-premium-extension/">Premium Version Required</a><br/>The Facebook video feed allows you to view your uploaded videos from facebook. See these great examples and options of all the different ways you can bring new life to your WordPress site!<br/><a href="https://feedthemsocial.com/facebook-videos-demo/" target="_blank">View Demo</a><br/><br/>Additionally if you purchase the Carousel Plugin you can showcase your videos in a slideshow or carousel. Works with your Facebook Photos too!<br/><a href="https://feedthemsocial.com/facebook-carousels/" target="_blank">View Carousel Demo</a> </div>';
1962
- // this is for the facebook reviews!
1963
- $output .= '<div class="feed-them-social-admin-input-wrap fts-premium-options-message2" style="display:none;"><a target="_blank" href="http://www.slickremix.com/downloads/feed-them-social-facebook-reviews/">Facebook Reviews Required</a><br/>The Facebook Reviews feed allows you to view all of the reviews people have made on your Facebook Page. See these great examples and options of all the different ways you can display your Facebook Page Reviews on your website. <a href="https://feedthemsocial.com/facebook-page-reviews-demo/" target="_blank">View Demo</a></div>';
1964
- }
1965
- // FACEBOOK PAGE ID!
1966
- if ( isset( $_GET['page'] ) && 'fts-bar-settings-page' !== $_GET['page'] ) {
1967
- $output .= '<div class="fb-options-wrap">';
1968
- }
1969
- $output .= '<div class="feed-them-social-admin-input-wrap fb_page_id ">';
1970
- $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Facebook ID (required)', 'feed-them-social' ) . '</div>';
1971
- $output .= '<input type="text" name="fb_page_id" id="fb_page_id" class="feed-them-social-admin-input" value="' . esc_html( $fb_page_id_option ) . '" />';
1972
- $output .= '<div class="fts-clear"></div>';
1973
- $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
1974
- // FACEBOOK ALBUM PHOTOS ID!
1975
- $output .= '<div class="feed-them-social-admin-input-wrap fb_album_photos_id" style="display:none;">';
1976
- $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Album ID ', 'feed-them-social' ) . '<br/><small>' . esc_html( 'Leave blank to show all uploaded photos', 'feed-them-social' ) . '</small></div>';
1977
- $output .= '<input type="text" name="fb_album_id" id="fb_album_id" class="feed-them-social-admin-input" value="" />';
1978
- $output .= '<div class="fts-clear"></div>';
1979
- $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
1980
- $fb_page_posts_displayed_option = isset( $fb_page_posts_displayed_option ) ? $fb_page_posts_displayed_option : '';
1981
- // FACEBOOK PAGE POST TYPE VISIBLE!
1982
- $output .= '<div class="feed-them-social-admin-input-wrap facebook-post-type-visible">';
1983
- $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Post Type Visible', 'feed-them-social' ) . '</div>';
1984
- $output .= '<select name="fb_page_posts_displayed" id="fb_page_posts_displayed" class="feed-them-social-admin-input">';
1985
- $output .= '<option ' . selected( $fb_page_posts_displayed_option, 'page_only', false ) . ' value="page_only">' . esc_html( 'Display Posts made by Page only', 'feed-them-social' ) . '</option>';
1986
- $output .= '<option ' . selected( $fb_page_posts_displayed_option, 'page_and_others', false ) . ' value="page_and_others">' . esc_html( 'Display Posts made by Page and Others', 'feed-them-social' ) . '</option>';
1987
- $output .= '</select>';
1988
- $output .= '<div class="fts-clear"></div>';
1989
- $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
1990
-
1991
- $fb_page_post_count_option = isset( $fb_page_post_count_option ) ? $fb_page_post_count_option : '';
1992
- $output .= '<div class="feed-them-social-admin-input-wrap">';
1993
- $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( '# of Posts', 'feed-them-premium' );
1994
-
1995
- if ( ! is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) || ! is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) ) {
1996
- $output .= '<br/><small>' . esc_html( 'More than 6 Requires <a target="_blank" href="http://www.slickremix.com/downloads/feed-them-social-premium-extension/">Premium version</a>', 'feed-them-premium' ) . '</small>';
1997
- }
1998
- $output .= '</div>';
1999
- $output .= '<input type="text" name="fb_page_post_count" id="fb_page_post_count" class="feed-them-social-admin-input" value="' . esc_html( $fb_page_post_count_option ) . '" placeholder="5 ' . esc_html( 'is the default number', 'feed-them-premium' ) . '" />';
2000
- $output .= '<div class="fts-clear"></div>';
2001
- $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2002
-
2003
- // ONLY SHOW SUPER GALLERY OPTIONS ON FTS SETTINGS PAGE FOR NOW, NOT FTS BAR!
2004
- if ( isset( $_GET['page'] ) && 'feed-them-settings-page' === $_GET['page'] ) {
2005
- // FACEBOOK HEIGHT OPTION!
2006
- $output .= '<div class="feed-them-social-admin-input-wrap twitter_name fixed_height_option">';
2007
- $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Facebook Fixed Height', 'feed-them-social' ) . '<br/><small>' . esc_html( 'Leave blank for auto height', 'feed-them-social' ) . '</small></div>';
2008
- $output .= '<input type="text" name="facebook_page_height" id="facebook_page_height" class="feed-them-social-admin-input" value="" placeholder="450px ' . esc_html( 'for example', 'feed-them-social' ) . '" />';
2009
- $output .= '<div class="fts-clear"></div>';
2010
- $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2011
- }
2012
-
2013
- if ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) && ! is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) ) {
2014
-
2015
- include $this->premium . 'admin/facebook-page-settings-fields.php';
2016
- if ( isset( $_GET['page'] ) && 'fts-bar-settings-page' === $_GET['page'] ) {
2017
- // PREMIUM LOAD MORE SETTINGS & LOADS in FTS BAR!
2018
- include $this->premium . 'admin/facebook-loadmore-settings-fields.php';
2019
- }
2020
- } elseif ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) && is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) ) {
2021
-
2022
- // these are the new options for reviews only!
2023
- include $this->facebook_reviews . 'admin/facebook-review-settings-fields.php';
2024
-
2025
- include $this->premium . 'admin/facebook-page-settings-fields.php';
2026
- if ( isset( $_GET['page'] ) && 'fts-bar-settings-page' === $_GET['page'] ) {
2027
- // PREMIUM LOAD MORE SETTINGS & LOADS in FTS BAR!
2028
- include $this->premium . 'admin/facebook-loadmore-settings-fields.php';
2029
- }
2030
- } elseif ( is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) && ! is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) ) {
2031
- // include($this->facebook_reviews.'admin/facebook-page-settings-fields.php');
2032
- // these are the new options for reviews only!
2033
- include $this->facebook_reviews . 'admin/facebook-review-settings-fields.php';
2034
-
2035
- // these are the additional options only for reviews from premium!
2036
- include $this->facebook_reviews . 'admin/facebook-loadmore-settings-fields.php';
2037
-
2038
- // Create Need Premium Fields!
2039
- $fields = array(
2040
- esc_html( 'Show the Page Title', 'feed-them-social' ),
2041
- esc_html( 'Align Title', 'feed-them-social' ),
2042
- esc_html( 'Show the Page Description', 'feed-them-social' ),
2043
- esc_html( 'Amount of words per post', 'feed-them-social' ),
2044
- esc_html( 'Load More Posts', 'feed-them-social' ),
2045
- esc_html( 'Display Photos in Popup', 'feed-them-social' ),
2046
- esc_html( 'Display Posts in Grid', 'feed-them-social' ),
2047
- esc_html( 'Center Grid', 'feed-them-social' ),
2048
- esc_html( 'Grid Stack Animation', 'feed-them-social' ),
2049
- esc_html( 'Hide Like Button or Box', 'feed-them-social' ),
2050
- esc_html( 'Like Box Width', 'feed-them-social' ),
2051
- esc_html( 'Position Like Box', 'feed-them-social' ),
2052
- esc_html( 'Align Like Button or Box', 'feed-them-social' ),
2053
- );
2054
- $output .= '<div class="need-for-premium-fields-wrap">';
2055
- $output .= $this->need_fts_premium_fields( $fields );
2056
- $output .= '</div>';
2057
- } else {
2058
-
2059
- // Create Need Premium Fields!
2060
- $fields = array(
2061
- esc_html( 'Show the Page Title', 'feed-them-social' ),
2062
- esc_html( 'Align Title', 'feed-them-social' ),
2063
- esc_html( 'Show the Page Description', 'feed-them-social' ),
2064
- esc_html( 'Amount of words per post', 'feed-them-social' ),
2065
- esc_html( 'Load More Posts', 'feed-them-social' ),
2066
- esc_html( 'Display Photos in Popup', 'feed-them-social' ),
2067
- esc_html( 'Display Posts in Grid', 'feed-them-social' ),
2068
- esc_html( 'Center Grid', 'feed-them-social' ),
2069
- esc_html( 'Grid Stack Animation', 'feed-them-social' ),
2070
- esc_html( 'Hide Like Button or Box', 'feed-them-social' ),
2071
- esc_html( 'Like Box Width', 'feed-them-social' ),
2072
- esc_html( 'Position Like Box', 'feed-them-social' ),
2073
- esc_html( 'Align Like Button or Box', 'feed-them-social' ),
2074
- );
2075
- $output .= $this->need_fts_premium_fields( $fields );
2076
- }
2077
- // ONLY SHOW SUPER GALLERY OPTIONS ON FTS SETTINGS PAGE FOR NOW, NOT FTS BAR!
2078
- if ( isset( $_GET['page'] ) && 'feed-them-settings-page' === $_GET['page'] ) {
2079
- // SUPER FACEBOOK GALLERY OPTIONS!
2080
- $output .= '<div class="fts-super-facebook-options-wrap" style="display:none">';
2081
- // FACEBOOK IMAGE HEIGHT!
2082
- $output .= '<div class="feed-them-social-admin-input-wrap facebook_name"><div class="feed-them-social-admin-input-label">' . esc_html( 'Facebook Image Width', 'feed-them-social' ) . '<br/><small>' . esc_html( 'Max width is 640px', 'feed-them-social' ) . '</small></div>
2083
  <input type="text" name="fts-slicker-instagram-container-image-width" id="fts-slicker-facebook-container-image-width" class="feed-them-social-admin-input" value="250px" placeholder="">
2084
  <div class="fts-clear"></div> </div>';
2085
- // FACEBOOK IMAGE WIDTH!
2086
- $output .= '<div class="feed-them-social-admin-input-wrap facebook_name"><div class="feed-them-social-admin-input-label">' . esc_html( 'Facebook Image Height', 'feed-them-social' ) . '<br/><small>' . esc_html( 'Max width is 640px', 'feed-them-social' ) . '</small></div>
2087
  <input type="text" name="fts-slicker-instagram-container-image-height" id="fts-slicker-facebook-container-image-height" class="feed-them-social-admin-input" value="250px" placeholder="">
2088
  <div class="fts-clear"></div> </div>';
2089
- // FACEBOOK SPACE BETWEEN PHOTOS!
2090
- $output .= '<div class="feed-them-social-admin-input-wrap facebook_name"><div class="feed-them-social-admin-input-label">' . esc_html( 'The space between photos', 'feed-them-social' ) . '</div>
2091
  <input type="text" name="fts-slicker-facebook-container-margin" id="fts-slicker-facebook-container-margin" class="feed-them-social-admin-input" value="1px" placeholder="">
2092
  <div class="fts-clear"></div></div>';
2093
- // HIDE DATES, LIKES AND COMMENTS ETC!
2094
- $output .= '<div class="feed-them-social-admin-input-wrap facebook_name"><div class="feed-them-social-admin-input-label">' . esc_html( 'Hide Date, Likes and Comments', 'feed-them-social' ) . '<br/><small>' . esc_html( 'Good for image sizes under 120px', 'feed-them-social' ) . '</small></div>
2095
  <select id="fts-slicker-facebook-container-hide-date-likes-comments" name="fts-slicker-facebook-container-hide-date-likes-comments" class="feed-them-social-admin-input">
2096
  <option value="no">' . esc_html( 'No', 'feed-them-social' ) . '</option><option value="yes">' . esc_html( 'Yes', 'feed-them-social' ) . '</option></select><div class="fts-clear"></div></div>';
2097
 
2098
- // CENTER THE FACEBOOK CONTAINER!
2099
- $output .= '<div class="feed-them-social-admin-input-wrap" id="facebook_super_gallery_container"><div class="feed-them-social-admin-input-label">' . esc_html( 'Center Facebook Container', 'feed-them-social' ) . '</div>
2100
  <select id="fts-slicker-facebook-container-position" name="fts-slicker-facebook-container-position" class="feed-them-social-admin-input"><option value="no">' . esc_html( 'No', 'feed-them-social' ) . '</option><option value="yes">' . esc_html( 'Yes', 'feed-them-social' ) . '</option></select><div class="fts-clear"></div></div>';
2101
- // ANIMATE PHOTO POSITIONING!
2102
- $output .= ' <div class="feed-them-social-admin-input-wrap" id="facebook_super_gallery_animate"><div class="feed-them-social-admin-input-label">' . esc_html( 'Image Stacking Animation On', 'feed-them-social' ) . '<br/><small>' . esc_html( 'This happens when resizing browsert', 'feed-them-social' ) . '</small></div>
2103
  <select id="fts-slicker-facebook-container-animation" name="fts-slicker-facebook-container-animation" class="feed-them-social-admin-input"><option value="no">' . esc_html( 'No', 'feed-them-social' ) . '</option><option value="yes">' . esc_html( 'Yes', 'feed-them-social' ) . '</option></select><div class="fts-clear"></div></div>';
2104
- // POSITION IMAGE LEFT RIGHT!
2105
- $output .= '<div class="instructional-text" style="display: block;">' . esc_html( 'These options allow you to make the thumbnail larger if you do not want to see black bars above or below your photos.', 'feed-them-social' ) . ' <a href="http://www.slickremix.com/docs/fit-thumbnail-on-facebook-galleries/" target="_blank">' . esc_html( 'View Examples', 'feed-them-social' ) . '</a> ' . esc_html( 'and simple details or leave default options.', 'feed-them-social' ) . '</div>
2106
  <div class="feed-them-social-admin-input-wrap facebook_name"><div class="feed-them-social-admin-input-label">' . esc_html( 'Make photo larger', 'feed-them-social' ) . '<br/><small>' . esc_html( 'Helps with blackspace', 'feed-them-social' ) . '</small></div>
2107
  <input type="text" id="fts-slicker-facebook-image-position-lr" name="fts-slicker-facebook-image-position-lr" class="feed-them-social-admin-input" value="-0%" placeholder="eg. -50%. -0% ' . esc_html( 'is default', 'feed-them-social' ) . '">
2108
  <div class="fts-clear"></div></div>';
2109
- // POSITION IMAGE TOP!
2110
- $output .= ' <div class="feed-them-social-admin-input-wrap facebook_name"><div class="feed-them-social-admin-input-label">' . esc_html( 'Image Position Top', 'feed-them-social' ) . '<br/><small>' . esc_html( 'Helps center image', 'feed-them-social' ) . '</small></div>
2111
  <input type="text" id="fts-slicker-facebook-image-position-top" name="fts-slicker-facebook-image-position-top" class="feed-them-social-admin-input" value="-0%" placeholder="eg. -10%. -0% ' . esc_html( 'is default', 'feed-them-social' ) . '">
2112
  <div class="fts-clear"></div></div>';
2113
- $output .= '</div><!--fts-super-facebook-options-wrap-->';
2114
-
2115
- if ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) ) {
2116
- // PREMIUM LOAD MORE SETTINGS!
2117
- include $this->premium . 'admin/facebook-loadmore-settings-fields.php';
2118
- }
2119
-
2120
- // Slideshow Carousel Options!
2121
- $output .= '<div class="slideshow-wrap" style="display: none;">';
2122
- $output .= '<div class="instructional-text" style="display: block;">' . esc_html( 'Create a Carousel or Slideshow with these options.', 'feed-them-social' ) . ' <a href="https://feedthemsocial.com/facebook-carousels-or-sliders/" target="_blank">' . esc_html( 'View Demos', 'feed-them-social' ) . '</a> ' . esc_html( 'and copy easy to use shortcode examples.', 'feed-them-social' ) . '</div>';
2123
-
2124
- if ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) && is_plugin_active( 'feed-them-carousel-premium/feed-them-carousel-premium.php' ) ) {
2125
- include $this->facebook_carousel_premium . 'admin/facebook-carousel-options-settings-page.php';
2126
- } else {
2127
- // if slider plugin is active!
2128
- $output .= '<div class="feed-them-social-admin-input-wrap facebook_name"><div class="feed-them-social-admin-input-label">' . esc_html( 'Carousel or Slideshow', 'feed-them-social' ) . '<br/><small>' . esc_html( 'Many more options when active', 'feed-them-social' ) . '</small></div>
2129
  <div class="feed-them-social-admin-input-default" style="display: block !important;">' . esc_html( 'Must have ', 'feed-them-social' ) . ' <a target="_blank" href="http://www.slickremix.com/downloads/feed-them-social-premium-extension/">' . esc_html( 'premium', 'feed-them-social' ) . '</a> ' . esc_html( 'and', 'feed-them-social' ) . ' <a target="_blank" href="http://www.slickremix.com/downloads/feed-them-carousel-premium/">' . esc_html( 'carousel', 'feed-them-social' ) . '</a> ' . esc_html( 'plugin ', 'feed-them-social' ) . '</a> ' . esc_html( 'to edit.', 'feed-them-social' ) . '</div> <div class="fts-clear"></div></div>';
2130
- }
2131
-
2132
- // end slideshow wrap!
2133
- $output .= '</div>';
2134
-
2135
- }
2136
- if ( $save_options ) {
2137
- $output .= '<input type="submit" class="feed-them-social-admin-submit-btn" value="Save Changes" />';
2138
- } else {
2139
- $output .= $this->generate_shortcode( 'updateTextArea_fb_page();', 'Facebook Page Feed Shortcode', 'facebook-page-final-shortcode' );
2140
- if ( isset( $_GET['page'] ) && 'fts-bar-settings-page' !== $_GET['page'] ) {
2141
- $output .= '</div>';
2142
- // END fb-options-wrap!
2143
- }
2144
- $output .= '</form>';
2145
- }
2146
- $output .= '</div><!--/fts-facebook_page-shortcode-form-->';
2147
- }
2148
- return $output;
2149
- }
2150
-
2151
- /**
2152
- * FTS Twitter Form
2153
- *
2154
- * @param bool $save_options save options.
2155
- * @since 1.9.6
2156
- */
2157
- public function fts_twitter_form( $save_options = false ) {
2158
- $fts_twitter_form_nonce = wp_create_nonce( 'fts-twitter-form-nonce' );
2159
-
2160
- if ( wp_verify_nonce( $fts_twitter_form_nonce, 'fts-twitter-form-nonce' ) ) {
2161
-
2162
- if ( $save_options ) {
2163
- $twitter_name_option = get_option( 'twitter_name' );
2164
- $tweets_count_option = get_option( 'tweets_count' );
2165
- $twitter_popup_option = get_option( 'twitter_popup_option' );
2166
- $twitter_hashtag_etc_name = get_option( 'twitter_hashtag_etc_name' );
2167
- $twitter_load_more_option = get_option( 'twitter_load_more_option' );
2168
- }
2169
-
2170
- $twitter_name_option = isset( $twitter_name_option ) ? $twitter_name_option : '';
2171
- $tweets_count_option = isset( $tweets_count_option ) ? $tweets_count_option : '';
2172
- $twitter_hashtag_etc_name = isset( $twitter_hashtag_etc_name ) ? $twitter_hashtag_etc_name : '';
2173
- $output = '<div class="fts-twitter-shortcode-form">';
2174
- if ( false === $save_options ) {
2175
- $output .= '<form class="feed-them-social-admin-form shortcode-generator-form twitter-shortcode-form" id="fts-twitter-form">';
2176
-
2177
- // Check to see if token is in place otherwise show a message letting person no what they need to do!
2178
- $twitter_options4 = get_option( 'fts_twitter_custom_access_token_secret' ) ? 'Yes' : 'No';
2179
- $output .= isset( $twitter_options4 ) && 'No' !== $twitter_options4 ? '' . "\n" : '<div class="feed-them-social-admin-input-wrap fts-required-token-message">Please add Twitter API Tokens to our <a href="admin.php?page=fts-twitter-feed-styles-submenu-page">Twitter Options</a> page before trying to view your feed.</div>' . "\n";
2180
- // end custom message for requiring token!
2181
- $output .= '<h2>' . esc_html( 'Twitter Shortcode Generator', 'feed-them-social' ) . '</h2>';
2182
- }
2183
-
2184
- // TWITTER FEED TYPE!
2185
- $output .= '<div class="feed-them-social-admin-input-wrap twitter-gen-selection">';
2186
- $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Feed Type', 'feed-them-social' ) . '</div>';
2187
- $output .= '<select name="twitter-messages-selector" id="twitter-messages-selector" class="feed-them-social-admin-input">';
2188
- $output .= '<option value="user">' . esc_html( 'User Feed', 'feed-them-social' ) . '</option>';
2189
- $output .= '<option value="hashtag">' . esc_html( '#hashtag, @person, or single words', 'feed-them-social' ) . '</option>';
2190
- $output .= '</select>';
2191
- $output .= '<div class="fts-clear"></div>';
2192
- $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2193
-
2194
- $output .= '<div class="twitter-hashtag-etc-wrap">';
2195
- $output .= '<h3>' . esc_html( 'Twitter Search', 'feed-them-social' ) . '</h3>';
2196
- $output .= '<div class="instructional-text">';
2197
- $output .= sprintf(
2198
- esc_html( 'You can use #hashtag, @person, or single words. For example, weather or weather-channel.%1$sIf you want to filter a specific users hashtag copy this example into the first input below and replace the user_name and YourHashtag name. DO NOT remove the from: or %# characters. NOTE: Only displays last 7 days worth of Tweets. %2$sfrom:user_name%#YourHashtag%3$s', 'feed-them-social' ),
2199
- '<br/><br/>',
2200
- '<strong style="color:#225DE2;">',
2201
- '</strong>'
2202
- );
2203
- $output .= '</div>';
2204
- $output .= '<div class="feed-them-social-admin-input-wrap twitter_hashtag_etc_name">';
2205
- $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Twitter Search Name (required)', 'feed-them-social' ) . '</div>';
2206
- $output .= '<input type="text" name="twitter_hashtag_etc_name" id="twitter_hashtag_etc_name" class="feed-them-social-admin-input" value="' . esc_html( $twitter_hashtag_etc_name ) . '" />';
2207
- $output .= '<div class="fts-clear"></div>';
2208
- $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2209
- $output .= '</div><!--/twitter-hashtag-etc-wrap-->';
2210
-
2211
- $output .= '<div class="instructional-text"><span class="hashtag-option-small-text">' . esc_html( 'Twitter Name is only required if you want to show a', 'feed-them-social' ) . ' <a href="admin.php?page=fts-twitter-feed-styles-submenu-page">' . esc_html( 'Follow Button', 'feed-them-social' ) . '</a>.</span><span class="must-copy-twitter-name">' . esc_html( 'You must copy your', 'feed-them-social' ) . ' <a href="http://www.slickremix.com/how-to-get-your-twitter-name/" target="_blank">' . esc_html( 'Twitter Name', 'feed-them-social' ) . '</a> ' . esc_html( 'and paste it in the first input below.', 'feed-them-social' ) . '</span></div>';
2212
- $output .= '<div class="feed-them-social-admin-input-wrap twitter_name">';
2213
- $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Twitter Name', 'feed-them-social' ) . ' <span class="hashtag-option-not-required">' . esc_html( '(required)', 'feed-them-social' ) . '</span></div>';
2214
- $output .= '<input type="text" name="twitter_name" id="twitter_name" class="feed-them-social-admin-input" value="' . esc_html( $twitter_name_option ) . '" />';
2215
- $output .= '<div class="fts-clear"></div>';
2216
- $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2217
-
2218
- $output .= '<div class="feed-them-social-admin-input-wrap">';
2219
- $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( '# of Tweets (optional)', 'feed-them-premium' );
2220
- if ( ! is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) ) {
2221
- $output .= sprintf(
2222
- esc_html( '%1$s More than 6 Requires the %2$sPremium Extension%3$s', 'feed-them-social' ),
2223
- '<br/><small>',
2224
- '<a target="_blank" href="' . esc_url( 'http://www.slickremix.com/downloads/feed-them-social-premium-extension/' ) . '">',
2225
- '</a></small>'
2226
- );
2227
- }
2228
- $output .= '</div>';
2229
- $output .= '<input type="text" name="tweets_count" id="tweets_count" placeholder="5 is the default number" class="feed-them-social-admin-input" value="' . esc_html( $tweets_count_option ) . '" />';
2230
- $output .= '<div class="fts-clear"></div>';
2231
- $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2232
-
2233
- if ( isset( $_GET['page'] ) && 'feed-them-settings-page' === $_GET['page'] ) {
2234
- $output .= '<div class="feed-them-social-admin-input-wrap">';
2235
- $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Twitter Fixed Height', 'feed-them-social' ) . '<br/><small>' . esc_html( 'Leave blank for auto height', 'feed-them-social' ) . '</small></div>';
2236
- $output .= '<input type="text" name="twitter_height" id="twitter_height" class="feed-them-social-admin-input" value="" placeholder="450px ' . esc_html( 'for example', 'feed-them-social' ) . '" />';
2237
- $output .= '<div class="fts-clear"></div>';
2238
- $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2239
- }
2240
-
2241
- $output .= '<div class="feed-them-social-admin-input-wrap">';
2242
- $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Show Retweets', 'feed-them-social' ) . '</div>';
2243
- $output .= '<select name="twitter-show-retweets" id="twitter-show-retweets" class="feed-them-social-admin-input">';
2244
- $output .= '<option value="yes">' . esc_html( 'Yes', 'feed-them-social' ) . '</option>';
2245
- $output .= '<option value="no">' . esc_html( 'No', 'feed-them-social' ) . '</option>';
2246
- $output .= '</select>';
2247
- $output .= '<div class="fts-clear"></div>';
2248
- $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2249
-
2250
- if ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) ) {
2251
- include $this->premium . 'admin/twitter-settings-fields.php';
2252
- } else {
2253
- // Create Need Premium Fields!
2254
- $fields = array(
2255
- __( 'Display Photos in Popup', 'feed-them-social' ),
2256
- );
2257
- $output .= $this->need_fts_premium_fields( $fields );
2258
- }
2259
- if ( $save_options ) {
2260
- $output .= '<input type="submit" class="feed-them-social-admin-submit-btn" value="' . esc_html( 'Save Changes', 'feed-them-social' ) . '" />';
2261
- } else {
2262
- $output .= $this->generate_shortcode( 'updateTextArea_twitter();', 'Twitter Feed Shortcode', 'twitter-final-shortcode' );
2263
- $output .= '</form>';
2264
- }
2265
- $output .= '</div><!--/fts-twitter-shortcode-form-->';
2266
- }
2267
-
2268
- return $output;
2269
- }
2270
-
2271
- /**
2272
- * FTS Instagram Form
2273
- *
2274
- * @param bool $save_options save options.
2275
- * @since 1.9.7
2276
- */
2277
- public function fts_instagram_form( $save_options = false ) {
2278
- $fts_instagram_form_nonce = wp_create_nonce( 'fts-instagram-form-nonce' );
2279
-
2280
- if ( wp_verify_nonce( $fts_instagram_form_nonce, 'fts-instagram-form-nonce' ) ) {
2281
-
2282
- if ( $save_options ) {
2283
- $instagram_name_option = get_option( 'convert_instagram_username' );
2284
- $instagram_id_option = get_option( 'instagram_id' );
2285
- $pics_count_option = get_option( 'pics_count' );
2286
- $instagram_popup_option = get_option( 'instagram_popup_option' );
2287
- $instagram_load_more_option = get_option( 'instagram_load_more_option' );
2288
- }
2289
- $output = '<div class="fts-instagram-shortcode-form">';
2290
- if ( false === $save_options ) {
2291
- $output .= '<form class="feed-them-social-admin-form shortcode-generator-form instagram-shortcode-form" id="fts-instagram-form">';
2292
-
2293
- // Check to see if token is in place otherwise show a message letting person no what they need to do!
2294
- $instagram_options = get_option( 'fts_instagram_custom_api_token' ) ? 'Yes' : 'No';
2295
- $output .= isset( $instagram_options ) && 'No' !== $instagram_options ? '' . "\n" : '<div class="feed-them-social-admin-input-wrap fts-required-token-message">Please get your Access Token on the <a href="admin.php?page=fts-instagram-feed-styles-submenu-page">Instagram Options</a> page or you won\'t be able to view your photos.</div>' . "\n";
2296
- // end custom message for requiring token!
2297
- // ONLY SHOW SUPER GALLERY OPTIONS ON FTS SETTINGS PAGE FOR NOW, NOT FTS BAR!
2298
- if ( isset( $_GET['page'] ) && 'feed-them-settings-page' === $_GET['page'] ) {
2299
- // INSTAGRAM FEED TYPE!
2300
- $output .= '<h2>' . esc_html( 'Instagram Shortcode Generator', 'feed-them-social' ) . '</h2><div class="feed-them-social-admin-input-wrap instagram-gen-selection">';
2301
- $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Feed Type', 'feed-them-social' ) . '</div>';
2302
- $output .= '<select name="instagram-messages-selector" id="instagram-messages-selector" class="feed-them-social-admin-input">';
2303
- $output .= '<option value="user">' . esc_html( 'User Feed', 'feed-them-social' ) . '</option>';
2304
- $output .= '<option value="hashtag">' . esc_html( 'Hashtag Feed', 'feed-them-social' ) . '</option>';
2305
- $output .= '</select>';
2306
- $output .= '<div class="fts-clear"></div>';
2307
- $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2308
- };
2309
- $output .= '<div class="instagram-id-option-wrap">';
2310
- $output .= '<h3>' . esc_html( 'Convert Instagram Name to ID', 'feed-them-social' ) . '</h3>';
2311
- }
2312
- $instagram_name_option = isset( $instagram_name_option ) ? $instagram_name_option : '';
2313
- $instagram_id_option = isset( $instagram_id_option ) ? $instagram_id_option : '';
2314
- $output .= '<div class="instructional-text">' . esc_html( 'You must copy your', 'feed-them-social' ) . ' <a href="http://www.slickremix.com/how-to-get-your-instagram-name-and-convert-to-id/" target="_blank">' . esc_html( 'Instagram Name', 'feed-them-social' ) . '</a> ' . esc_html( 'and paste it in the first input below', 'feed-them-social' ) . '</div>';
2315
- $output .= '<div class="feed-them-social-admin-input-wrap convert_instagram_username">';
2316
- $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Instagram Name (required)', 'feed-them-social' ) . '</div>';
2317
- $output .= '<input type="text" id="convert_instagram_username" name="convert_instagram_username" class="feed-them-social-admin-input" value="' . esc_html( $instagram_name_option ) . '" />';
2318
- $output .= '<div class="fts-clear"></div>';
2319
- $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2320
- $output .= '<input type="button" class="feed-them-social-admin-submit-btn" value="' . esc_html( 'Convert Instagram Username', 'feed-them-social' ) . '" onclick="converter_instagram_username();" tabindex="4" style="margin-right:1em;" />';
2321
- // ONLY THIS DIV IF ON OUR SETTINGS PAGE!
2322
- if ( isset( $_GET['page'] ) && 'feed-them-settings-page' === $_GET['page'] ) {
2323
- $output .= '</div><!--instagram-id-option-wrap-->';
2324
- };
2325
- if ( false === $save_options ) {
2326
- $output .= '</form>';
2327
- }
2328
- if ( false === $save_options ) {
2329
- $output .= '<form class="feed-them-social-admin-form shortcode-generator-form instagram-shortcode-form">';
2330
- }
2331
- $output .= '<div class="instructional-text instagram-user-option-text" style="margin-top:12px;"><div class="fts-insta-info-plus-wrapper">' . esc_html( 'Choose a different ID if yours is not the first name below after clicking Convert Instagram Username button.', 'feed-them-social' ) . '</div><!-- the li list comes from an ajax call after looking up the user ID --><ul id="fts-instagram-username-picker-wrap" class="fts-instagram-username-picker-wrap"></ul></div>';
2332
- $output .= '<div class="instructional-text instagram-hashtag-option-text" style="display:none;margin-top:12px;">' . esc_html( 'Add your Hashtag below. Do not add the #, just the name.', 'feed-them-social' ) . '</div>';
2333
- $output .= '<div class="feed-them-social-admin-input-wrap instagram_name">';
2334
- $output .= '<div class="feed-them-social-admin-input-label instagram-user-option-text">' . esc_html( 'Instagram ID # (required)', 'feed-them-social' ) . '</div>';
2335
- $output .= '<div class="feed-them-social-admin-input-label instagram-hashtag-option-text" style="display:none;">' . esc_html( 'Hashtag (required)', 'feed-them-social' ) . '</div>';
2336
- $output .= '<input type="text" name="instagram_id" id="instagram_id" class="feed-them-social-admin-input" value="' . esc_html( $instagram_id_option ) . '" />';
2337
- $output .= '<div class="fts-clear"></div>';
2338
- $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2339
- // Super Instagram Options!
2340
- $pics_count_option = isset( $pics_count_option ) ? $pics_count_option : '';
2341
- // Pic Count Option!
2342
- $output .= '<div class="feed-them-social-admin-input-wrap">';
2343
- $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( '# of Pics (optional)', 'feed-them-premium' );
2344
- if ( ! is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) ) {
2345
- $output .= sprintf(
2346
- esc_html( '%1$s More than 6 Requires the %2$sPremium Extension%3$s', 'feed-them-social' ),
2347
- '<br/><small>',
2348
- '<a target="_blank" href="' . esc_url( 'http://www.slickremix.com/downloads/feed-them-social-premium-extension/' ) . '">',
2349
- '</a></small>'
2350
- );
2351
- }
2352
- $output .= '</div>';
2353
- $output .= '<input type="text" name="pics_count" id="pics_count" class="feed-them-social-admin-input" value="' . esc_html( $pics_count_option ) . '" placeholder="6 is the default number" />';
2354
- $output .= '<div class="fts-clear"></div>';
2355
- $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2356
-
2357
- if ( isset( $_GET['page'] ) && 'feed-them-settings-page' === $_GET['page'] ) {
2358
-
2359
- $output .= '<div class="feed-them-social-admin-input-wrap">';
2360
- $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Super Instagram Gallery', 'feed-them-social' ) . '</div>';
2361
- $output .= '<select id="instagram-custom-gallery" name="instagram-custom-gallery" class="feed-them-social-admin-input"><option value="no">' . esc_html( 'No', 'feed-them-social' ) . '</option><option value="yes">' . esc_html( 'Yes', 'feed-them-social' ) . '</option></select>';
2362
- $output .= '<div class="fts-clear"></div>';
2363
- $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2364
- $output .= '<div class="feed-them-social-admin-input-wrap"><div class="feed-them-social-admin-input-label">' . esc_html( 'Instagram Image Size', 'feed-them-social' ) . '<br/><small><a href="https://feedthemsocial.com/instagram-feed-demo/" target="_blank">' . esc_html( 'View demo', 'feed-them-social' ) . '</a></small></div>
 
 
2365
  <input type="text" name="fts-slicker-instagram-container-image-size" id="fts-slicker-instagram-container-image-size" class="feed-them-social-admin-input" value="250px" placeholder="">
2366
  <div class="fts-clear"></div> </div>';
2367
- $output .= '<div class="feed-them-social-admin-input-wrap"><div class="feed-them-social-admin-input-label">' . esc_html( 'Size of the Instagram Icon', 'feed-them-social' ) . '<br/><small>' . esc_html( 'Visible when you hover over photo', 'feed-them-social' ) . '</small></div>
2368
  <input type="text" name="fts-slicker-instagram-icon-center" id="fts-slicker-instagram-icon-center" class="feed-them-social-admin-input" value="65px" placeholder="">
2369
  <div class="fts-clear"></div></div>';
2370
- $output .= '<div class="feed-them-social-admin-input-wrap"><div class="feed-them-social-admin-input-label">' . esc_html( 'The space between photos', 'feed-them-social' ) . '</div>
2371
  <input type="text" name="fts-slicker-instagram-container-margin" id="fts-slicker-instagram-container-margin" class="feed-them-social-admin-input" value="1px" placeholder="">
2372
  <div class="fts-clear"></div></div>';
2373
- $output .= '<div class="feed-them-social-admin-input-wrap"><div class="feed-them-social-admin-input-label">' . esc_html( 'Hide Date, Likes and comments', 'feed-them-social' ) . '<br/><small>' . esc_html( 'Good for image sizes under 120px', 'feed-them-social' ) . '</small></div>
2374
  <select id="fts-slicker-instagram-container-hide-date-likes-comments" name="fts-slicker-instagram-container-hide-date-likes-comments" class="feed-them-social-admin-input">
2375
  <option value="no">' . esc_html( 'No', 'feed-them-social' ) . '</option><option value="yes">' . esc_html( 'Yes', 'feed-them-social' ) . '</option></select><div class="fts-clear"></div></div>';
2376
- $output .= '<div class="feed-them-social-admin-input-wrap"><div class="feed-them-social-admin-input-label">' . esc_html( 'Center Instagram Container', 'feed-them-social' ) . '</div>
2377
  <select id="fts-slicker-instagram-container-position" name="fts-slicker-instagram-container-position" class="feed-them-social-admin-input"><option value="no">' . esc_html( 'No', 'feed-them-social' ) . '</option><option value="yes">' . esc_html( 'Yes', 'feed-them-social' ) . '</option></select>
2378
  <div class="fts-clear"></div></div>';
2379
- $output .= ' <div class="feed-them-social-admin-input-wrap"><div class="feed-them-social-admin-input-label">' . esc_html( 'Image Stacking Animation On', 'feed-them-social' ) . '<br/><small>' . esc_html( 'This happens when resizing browser', 'feed-them-social' ) . '</small></div>
2380
  <select id="fts-slicker-instagram-container-animation" name="fts-slicker-instagram-container-animation" class="feed-them-social-admin-input"><option value="no">' . esc_html( 'No', 'feed-them-social' ) . '</option><option value="yes">' . esc_html( 'Yes', 'feed-them-social' ) . '</option></select><div class="fts-clear"></div></div>';
2381
 
2382
- // INSTAGRAM HEIGHT OPTION!
2383
- $output .= '<div class="feed-them-social-admin-input-wrap instagram_fixed_height_option">';
2384
- $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Instagram Fixed Height', 'feed-them-social' ) . '<br/><small>' . esc_html( 'Leave blank for auto height', 'feed-them-social' ) . '</small></div>';
2385
- $output .= '<input type="text" name="instagram_page_height" id="instagram_page_height" class="feed-them-social-admin-input" value="" placeholder="450px ' . esc_html( 'for example', 'feed-them-social' ) . '" />';
2386
- $output .= '<div class="fts-clear"></div>';
2387
- $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2388
-
2389
- $output .= '</div><!--fts-super-instagram-options-wrap-->';
2390
-
2391
- }
2392
-
2393
- if ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) ) {
2394
-
2395
- include $this->premium . 'admin/instagram-settings-fields.php';
2396
-
2397
- } else {
2398
- // Create Need Premium Fields!
2399
- $fields = array(
2400
- __( 'Display Photos & Videos in Popup', 'feed-them-social' ),
2401
- __( 'Load More Posts', 'feed-them-social' ),
2402
- );
2403
- $output .= $this->need_fts_premium_fields( $fields );
2404
- }
2405
- if ( $save_options ) {
2406
- $output .= '<input type="submit" class="feed-them-social-admin-submit-btn instagram-submit" value="' . esc_html( 'Save Changes', 'feed-them-social' ) . '" />';
2407
- } else {
2408
- $output .= $this->generate_shortcode( 'updateTextArea_instagram();', 'Instagram Feed Shortcode', 'instagram-final-shortcode' );
2409
- $output .= '</form>';
2410
- }
2411
- $output .= '</div> <!--/fts-instagram-shortcode-form-->';
2412
- }
2413
- return $output;
2414
- }
2415
-
2416
- /**
2417
- * FTS Youtube Form
2418
- *
2419
- * @param bool $save_options save options.
2420
- * @since 1.9.6
2421
- */
2422
- public function fts_youtube_form( $save_options = false ) {
2423
- $fts_youtube_form_nonce = wp_create_nonce( 'fts-youtube-form-nonce' );
2424
-
2425
- if ( wp_verify_nonce( $fts_youtube_form_nonce, 'fts-youtube-form-nonce' ) ) {
2426
- if ( $save_options ) {
2427
- $youtube_name_option = get_option( 'youtube_name' );
2428
- $youtube_vid_count_option = get_option( 'youtube_vid_count' );
2429
- $youtube_columns_option = get_option( 'youtube_columns' );
2430
- $youtube_first_video_option = get_option( 'youtube_first_video' );
2431
- }
2432
- $output = '<div class="fts-youtube-shortcode-form">';
2433
- if ( false === $save_options ) {
2434
- $output .= '<form class="feed-them-social-admin-form shortcode-generator-form youtube-shortcode-form" id="fts-youtube-form">';
2435
-
2436
- // Check to see if token is in place otherwise show a message letting person no what they need to do!
2437
- $youtube_options = get_option( 'youtube_custom_api_token' ) || get_option( 'youtube_custom_access_token' ) && get_option( 'youtube_custom_refresh_token' ) && get_option( 'youtube_custom_token_exp_time' ) ? 'Yes' : 'No';
2438
- $output .= isset( $youtube_options ) && 'No' !== $youtube_options ? '' . "\n" : '<div class="feed-them-social-admin-input-wrap fts-required-token-message">Please add a YouTube API Key to our <a href="admin.php?page=fts-youtube-feed-styles-submenu-page">YouTube Options</a> page before trying to view your feed.</div>' . "\n";
2439
- // end custom message for requiring token!
2440
- $output .= '<h2>' . esc_html( 'YouTube Shortcode Generator', 'feed-them-social' ) . '</h2>';
2441
- }
2442
- $output .= '<div class="instructional-text">' . esc_html( 'You must copy your YouTube ', 'feed-them-social' ) . ' <a href="http://www.slickremix.com/how-to-get-your-youtube-name/" target="_blank">' . esc_html( 'Username, Channel ID and or Playlist ID', 'feed-them-social' ) . '</a> ' . esc_html( 'and paste it below.', 'feed-them-social' ) . '</div>';
2443
- if ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) ) {
2444
- include $this->premium . 'admin/youtube-settings-fields.php';
2445
- } else {
2446
- // Create Need Premium Fields!
2447
- $fields = array(
2448
- __( 'YouTube Name', 'feed-them-social' ),
2449
- __( '# of videos', 'feed-them-social' ),
2450
- __( '# of videos in each row', 'feed-them-social' ),
2451
- __( 'Display First video full size', 'feed-them-social' ),
2452
- );
2453
- $output .= $this->need_fts_premium_fields( $fields );
2454
- $output .= '<a href="http://www.slickremix.com/downloads/feed-them-social-premium-extension/" target="_blank" class="feed-them-social-admin-submit-btn" style="margin-right:1em; margin-top: 15px; display:inline-block; text-decoration:none !important;">' . esc_html( 'Click to see Premium Version', 'feed-them-social' ) . '</a>';
2455
- $output .= '</form>';
2456
- }
2457
- $output .= '</div><!--/fts-youtube-shortcode-form-->';
2458
- }
2459
- return $output;
2460
- }
2461
-
2462
- /**
2463
- * FTS Pinterest Form
2464
- *
2465
- * @param bool $save_options save options.
2466
- * @since 1.9.6
2467
- */
2468
- public function fts_pinterest_form( $save_options = false ) {
2469
- $fts_pinterest_form_nonce = wp_create_nonce( 'fts-pinterest-form-nonce' );
2470
-
2471
- if ( wp_verify_nonce( $fts_pinterest_form_nonce, 'fts-pinterest-form-nonce' ) ) {
2472
- if ( $save_options ) {
2473
- $pinterest_name_option = get_option( 'pinterest_name' );
2474
- $boards_count_option = get_option( 'boards_count' );
2475
- }
2476
- $output = '<div class="fts-pinterest-shortcode-form">';
2477
- if ( false === $save_options ) {
2478
- $output = '<form class="feed-them-social-admin-form shortcode-generator-form pinterest-shortcode-form" id="fts-pinterest-form">';
2479
- }
2480
- // Pinterest FEED TYPE!
2481
- $output .= '<h2>' . esc_html( 'Pinterest Shortcode Generator', 'feed-them-social' ) . '</h2><div class="feed-them-social-admin-input-wrap pinterest-gen-selection">';
2482
- $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Feed Type', 'feed-them-social' ) . '</div>';
2483
- $output .= '<select name="pinterest-messages-selector" id="pinterest-messages-selector" class="feed-them-social-admin-input">';
2484
- $output .= '<option value="boards_list">' . esc_html( 'Board List', 'feed-them-social' ) . '</option>';
2485
- $output .= '<option value="single_board_pins">' . esc_html( 'Pins From a Specific Board', 'feed-them-social' ) . '</option>';
2486
- $output .= '<option value="pins_from_user">' . esc_html( 'Latest Pins from a User', 'feed-them-social' ) . '</option>';
2487
- $output .= '</select>';
2488
- $output .= '<div class="fts-clear"></div>';
2489
- $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2490
- $output .= '<h3>' . esc_html( 'Pinterest Feed', 'feed-them-social' ) . '</h3><div class="instructional-text pinterest-name-text">' . esc_html( 'Copy your', 'feed-them-social' ) . ' <a href="http://www.slickremix.com/how-to-get-your-pinterest-name/" target="_blank">' . esc_html( 'Pinterest Name', 'feed-them-social' ) . '</a> ' . esc_html( 'and paste it in the first input below.', 'feed-them-social' ) . '</div>';
2491
- $output .= '<div class="instructional-text pinterest-board-and-name-text" style="display:none;">' . esc_html( 'Copy your', 'feed-them-social' ) . ' <a href="http://www.slickremix.com/how-to-get-your-pinterest-name/" target="_blank">' . esc_html( 'Pinterest and Board Name', 'feed-them-social' ) . '</a> ' . esc_html( 'and paste them below.', 'feed-them-social' ) . '</div>';
2492
- $pinterest_name_option = isset( $pinterest_name_option ) ? $pinterest_name_option : '';
2493
- $boards_count_option = isset( $boards_count_option ) ? $boards_count_option : '';
2494
- $output .= '<div class="feed-them-social-admin-input-wrap pinterest_name">';
2495
- $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Pinterest Username (required)', 'feed-them-social' ) . '</div>';
2496
- $output .= '<input type="text" name="pinterest_name" id="pinterest_name" class="feed-them-social-admin-input" value="' . esc_html( $pinterest_name_option ) . '" />';
2497
- $output .= '<div class="fts-clear"></div>';
2498
- $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2499
- $output .= '<div class="feed-them-social-admin-input-wrap board-name" style="display:none;">';
2500
- $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Pinterest Board Name (required)', 'feed-them-premium' ) . '</div>';
2501
- $output .= '<input type="text" name="pinterest_board_name" id="pinterest_board_name" class="feed-them-social-admin-input" value="' . esc_html( $pinterest_name_option ) . '" />';
2502
- $output .= '<div class="fts-clear"></div>';
2503
- $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2504
- if ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) ) {
2505
- include $this->premium . 'admin/pinterest-settings-fields.php';
2506
- } else {
2507
- // Create Need Premium Fields!
2508
- $fields = array(
2509
- esc_html( '# of Boards (default 6)', 'feed-them-social' ),
2510
- esc_html( '# of Pins (default 6)', 'feed-them-social' ),
2511
- );
2512
- $output .= $this->need_fts_premium_fields( $fields );
2513
- }
2514
- if ( $save_options ) {
2515
- $output .= '<input type="submit" class="feed-them-social-admin-submit-btn" value="' . esc_html( 'Save Changes', 'feed-them-social' ) . '" />';
2516
- } else {
2517
- $output .= $this->generate_shortcode( 'updateTextArea_pinterest();', '' . esc_html( 'Pinterest Feed Shortcode', 'feed-them-social' ) . '', 'pinterest-final-shortcode' );
2518
- $output .= '</form>';
2519
- }
2520
- $output .= '</div><!--/fts-pinterest-shortcode-form-->';
2521
- }
2522
- return $output;
2523
- }
2524
-
2525
- /**
2526
- * Generate Shortcode
2527
- *
2528
- * Generate Shortcode Button and Input for FTS settings Page.
2529
- *
2530
- * @param string $onclick onclick.
2531
- * @param string $label label.
2532
- * @param string $input_class input class.
2533
- * @since 1.9.6
2534
- */
2535
- public function generate_shortcode( $onclick, $label, $input_class ) {
2536
- $output = '<input type="button" class="feed-them-social-admin-submit-btn" value="' . esc_html( 'Generate Shortcode', 'feed-them-social' ) . '" onclick="' . esc_js( $onclick ) . '" tabindex="4" style="margin-right:1em;" />';
2537
- $output .= '<div class="feed-them-social-admin-input-wrap final-shortcode-textarea">';
2538
- $output .= '<h4>' . esc_html( 'Copy the ShortCode below and paste it on a page or post that you want to display your feed.', 'feed-them-social' ) . '</h4>';
2539
- $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( $label ) . '</div>';
2540
- $output .= '<input class="copyme ' . esc_html( $input_class ) . ' feed-them-social-admin-input" value="" />';
2541
- $output .= '<div class="fts-clear"></div>';
2542
- $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2543
- return $output;
2544
- }
2545
-
2546
- /**
2547
- * FTS Get Feed json
2548
- *
2549
- * Generate Get Json (includes MultiCurl).
2550
- *
2551
- * @param array $feeds_mulit_data feeds data info.
2552
- * @return array
2553
- * @since 1.9.6
2554
- */
2555
- public function fts_get_feed_json( $feeds_mulit_data ) {
2556
- // Make Multiple Requests from array with more than 2 keys!
2557
- if ( is_array( $feeds_mulit_data ) && count( $feeds_mulit_data ) > 1 ) {
2558
- $new_feeds_mulit_data = array();
2559
-
2560
- foreach ( $feeds_mulit_data as $key => $url ) {
2561
- $new_feeds_mulit_data[ $key ]['url'] = $url;
2562
- $new_feeds_mulit_data[ $key ]['type'] = 'GET';
2563
- }
2564
- // Fetch Multiple Requests!
2565
- $responses = \Requests::request_multiple( $new_feeds_mulit_data );
2566
-
2567
- $data = array();
2568
- foreach ( $responses as $key => $response ) {
2569
-
2570
- if ( is_a( $response, 'Requests_Response' ) ) {
2571
- $data[ $key ] = $response->body;
2572
- }
2573
- }
2574
- } else {
2575
- // Make Single Requests from array with 1 keys!
2576
- if ( is_array( $feeds_mulit_data ) ) {
2577
- foreach ( $feeds_mulit_data as $key => $url ) {
2578
-
2579
- $single_response = \Requests::get( $url );
2580
-
2581
- $data = array();
2582
- if ( is_a( $single_response, 'Requests_Response' ) ) {
2583
- $data[ $key ] = $single_response->body;
2584
- }
2585
- }
2586
- } else {
2587
- // Make Single request from just url!
2588
- $single_response_url = $feeds_mulit_data;
2589
-
2590
- if ( ! empty( $single_response_url ) ) {
2591
- $single_response = \Requests::get( $single_response_url );
2592
-
2593
- if ( is_a( $single_response, 'Requests_Response' ) ) {
2594
- $data['data'] = $single_response->body;
2595
- }
2596
- }
2597
- }
2598
- }
2599
- // Do nothing if Curl was Successful!
2600
- return $data;
2601
- }
2602
-
2603
- /**
2604
- * FTS Create Feed Cache
2605
- *
2606
- * @param string $transient_name transient name.
2607
- * @param array $response Data returned from response.
2608
- * @since 1.9.6
2609
- */
2610
- public function fts_create_feed_cache( $transient_name, $response ) {
2611
- $cache_time_limit = true === get_option( 'fts_clear_cache_developer_mode' ) && '1' !== get_option( 'fts_clear_cache_developer_mode' ) ? get_option( 'fts_clear_cache_developer_mode' ) : '900';
2612
- set_transient( 'fts_' . $transient_name, $response, $cache_time_limit );
2613
- }
2614
-
2615
- /**
2616
- * FTS Get Feed Cache
2617
- *
2618
- * @param string $transient_name transient name.
2619
- * @return mixed
2620
- * @since 1.9.6
2621
- */
2622
- public function fts_get_feed_cache( $transient_name ) {
2623
- $returned_cache_data = get_transient( 'fts_' . $transient_name );
2624
- return $returned_cache_data;
2625
- }
2626
-
2627
- /**
2628
- * FTS Check Feed Cache Exists
2629
- *
2630
- * @param string $transient_name transient name.
2631
- * @return bool
2632
- * @since 1.9.6
2633
- */
2634
- public function fts_check_feed_cache_exists( $transient_name ) {
2635
- if ( false === get_transient( 'fts_' . $transient_name ) ) {
2636
- return false;
2637
- }
2638
- return true;
2639
- }
2640
-
2641
- /**
2642
- * FTS Clear Cache Ajax
2643
- *
2644
- * @since 1.9.6
2645
- */
2646
- public function fts_clear_cache_ajax() {
2647
- global $wpdb;
2648
- // Clear UnExpired!
2649
- $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->options WHERE option_name LIKE %s ", '_transient_fts_%' ) );
2650
- // Clear Exired Transients!
2651
- $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->options WHERE option_name LIKE %s ", '_transient_timeout_fts_%' ) );
2652
- wp_reset_query();
2653
- }
2654
-
2655
- /**
2656
- * Feed Them Clear Cache
2657
- *
2658
- * Clear Cache Folder.
2659
- *
2660
- * @return string
2661
- * @since 1.9.6
2662
- */
2663
- public function feed_them_clear_cache() {
2664
- global $wpdb;
2665
- // Clear UnExpired!
2666
- $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->options WHERE option_name LIKE %s ", '_transient_fts_%' ) );
2667
- // Clear Exired Transients!
2668
- $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->options WHERE option_name LIKE %s ", '_transient_timeout_fts_%' ) );
2669
- wp_reset_query();
2670
- return 'Cache for all FTS Feeds cleared!';
2671
- }
2672
-
2673
- /**
2674
- * FTS Admin Bar Menu
2675
- *
2676
- * Create our custom menu in the admin bar.
2677
- *
2678
- * @since 1.9.6
2679
- */
2680
- public function fts_admin_bar_menu() {
2681
- global $wp_admin_bar;
2682
-
2683
- $fts_admin_bar_menu = get_option( 'fts_admin_bar_menu' );
2684
- $fts_dev_mode_cache = get_option( 'fts_clear_cache_developer_mode' );
2685
- if ( ! is_super_admin() || ! is_admin_bar_showing() || 'hide-admin-bar-menu' === $fts_admin_bar_menu ) {
2686
- return;
2687
- }
2688
- $wp_admin_bar->add_menu(
2689
- array(
2690
- 'id' => 'feed_them_social_admin_bar',
2691
- 'title' => __( 'Feed Them Social', 'feed-them-social' ),
2692
- 'href' => false,
2693
- )
2694
- );
2695
- if ( '1' === $fts_dev_mode_cache ) {
2696
- $wp_admin_bar->add_menu(
2697
- array(
2698
- 'id' => 'feed_them_social_admin_bar_clear_cache',
2699
- 'parent' => 'feed_them_social_admin_bar',
2700
- 'title' => __( 'Cache clears on page refresh now', 'feed-them-social' ),
2701
- 'href' => false,
2702
- )
2703
- );
2704
- } else {
2705
- $wp_admin_bar->add_menu(
2706
- array(
2707
- 'id' => 'feed_them_social_admin_set_cache',
2708
- 'parent' => 'feed_them_social_admin_bar',
2709
- 'title' => __( 'Clear Cache', 'feed-them-social' ),
2710
- 'href' => '#',
2711
- )
2712
- );
2713
- }
2714
- $wp_admin_bar->add_menu(
2715
- array(
2716
- 'id' => 'feed_them_social_admin_bar_set_cache',
2717
- 'parent' => 'feed_them_social_admin_bar',
2718
- 'title' => sprintf(
2719
- __( 'Set Cache Time %1$s%2$s%3$s', 'feed-them-social' ),
2720
- '<span>',
2721
- $this->fts_cachetime_amount( get_option( 'fts_clear_cache_developer_mode' ) ),
2722
- '</span>'
2723
- ),
2724
- 'href' => admin_url( 'admin.php?page=feed-them-settings-page&tab=global_options' ),
2725
-
2726
- )
2727
- );
2728
- $wp_admin_bar->add_menu(
2729
- array(
2730
- 'id' => 'feed_them_social_admin_bar_settings',
2731
- 'parent' => 'feed_them_social_admin_bar',
2732
- 'title' => __( 'Settings', 'feed-them-social' ),
2733
- 'href' => admin_url( 'admin.php?page=feed-them-settings-page' ),
2734
- )
2735
- );
2736
- $wp_admin_bar->add_menu(
2737
- array(
2738
- 'id' => 'feed_them_social_admin_bar_global_options',
2739
- 'parent' => 'feed_them_social_admin_bar',
2740
- 'title' => __( 'Global Options', 'feed-them-social' ),
2741
- 'href' => admin_url( 'admin.php?page=feed-them-settings-page&tab=global_options' ),
2742
- )
2743
- );
2744
- }
2745
-
2746
- /**
2747
- * FTS Cachetime amount
2748
- *
2749
- * @param string $fts_cachetime Cache time.
2750
- * @return mixed
2751
- * @since
2752
- */
2753
- public function fts_cachetime_amount( $fts_cachetime ) {
2754
- switch ( $fts_cachetime ) {
2755
- case '1':
2756
- $fts_display_cache_time = __( 'Clear cache on every page load', 'feed-them-social' );
2757
- break;
2758
- default:
2759
- case '86400':
2760
- $fts_display_cache_time = __( '1 Day (Default)', 'feed-them-social' );
2761
- break;
2762
- case '172800':
2763
- $fts_display_cache_time = __( '2 Days', 'feed-them-social' );
2764
- break;
2765
- case '259200':
2766
- $fts_display_cache_time = __( '3 Days', 'feed-them-social' );
2767
- break;
2768
- case '604800':
2769
- $fts_display_cache_time = __( '1 Week', 'feed-them-social' );
2770
- break;
2771
- case '1209600':
2772
- $fts_display_cache_time = __( '2 Weeks', 'feed-them-social' );
2773
- break;
2774
- }
2775
- return $fts_display_cache_time;
2776
- }
2777
-
2778
- /**
2779
- * XML json Parse
2780
- *
2781
- * @param string $url string to parse the content for.
2782
- * @return mixed
2783
- * @since 1.9.6
2784
- */
2785
- public function xml_json_parse( $url ) {
2786
- $url_to_get['url'] = $url;
2787
- $file_contents_returned = $this->fts_get_feed_json( $url_to_get );
2788
- $file_contents = $file_contents_returned['url'];
2789
- $file_contents = str_replace( array( "\n", "\r", "\t" ), '', $file_contents );
2790
- $file_contents = trim( str_replace( '"', "'", $file_contents ) );
2791
- $simple_xml = simplexml_load_string( $file_contents );
2792
- $encoded_json = json_encode( $simple_xml );
2793
-
2794
- return $encoded_json;
2795
- }
2796
-
2797
- /**
2798
- * FTS Ago
2799
- *
2800
- * Create date format like fb and twitter. Thanks: http://php.quicoto.com/how-to-calculate-relative-time-like-facebook/ .
2801
- *
2802
- * @param string $timestamp Timestamp!
2803
- * @return string
2804
- * @since 1.9.6
2805
- */
2806
- function fts_ago( $timestamp ) {
2807
- // not setting isset'ing anything because you have to save the settings page to even enable this feature
2808
- $fts_language_second = get_option( 'fts_language_second' );
2809
- if ( empty( $fts_language_second ) ) {
2810
- $fts_language_second = 'second';
2811
- }
2812
- $fts_language_seconds = get_option( 'fts_language_seconds' );
2813
- if ( empty( $fts_language_seconds ) ) {
2814
- $fts_language_seconds = 'seconds';
2815
- }
2816
- $fts_language_minute = get_option( 'fts_language_minute' );
2817
- if ( empty( $fts_language_minute ) ) {
2818
- $fts_language_minute = 'minute';
2819
- }
2820
- $fts_language_minutes = get_option( 'fts_language_minutes' );
2821
- if ( empty( $fts_language_minute ) ) {
2822
- $fts_language_minute = 'minutes';
2823
- }
2824
- $fts_language_hour = get_option( 'fts_language_hour' );
2825
- if ( empty( $fts_language_hour ) ) {
2826
- $fts_language_hour = 'hour';
2827
- }
2828
- $fts_language_hours = get_option( 'fts_language_hours' );
2829
- if ( empty( $fts_language_hours ) ) {
2830
- $fts_language_hours = 'hours';
2831
- }
2832
- $fts_language_day = get_option( 'fts_language_day' );
2833
- if ( empty( $fts_language_day ) ) {
2834
- $fts_language_day = 'day';
2835
- }
2836
- $fts_language_days = get_option( 'fts_language_days' );
2837
- if ( empty( $fts_language_days ) ) {
2838
- $fts_language_days = 'days';
2839
- }
2840
- $fts_language_week = get_option( 'fts_language_week' );
2841
- if ( empty( $fts_language_week ) ) {
2842
- $fts_language_week = 'week';
2843
- }
2844
- $fts_language_weeks = get_option( 'fts_language_weeks' );
2845
- if ( empty( $fts_language_weeks ) ) {
2846
- $fts_language_weeks = 'weeks';
2847
- }
2848
- $fts_language_month = get_option( 'fts_language_month' );
2849
- if ( empty( $fts_language_month ) ) {
2850
- $fts_language_month = 'month';
2851
- }
2852
- $fts_language_months = get_option( 'fts_language_months' );
2853
- if ( empty( $fts_language_months ) ) {
2854
- $fts_language_months = 'months';
2855
- }
2856
- $fts_language_year = get_option( 'fts_language_year' );
2857
- if ( empty( $fts_language_year ) ) {
2858
- $fts_language_year = 'year';
2859
- }
2860
- $fts_language_years = get_option( 'fts_language_years' );
2861
- if ( empty( $fts_language_years ) ) {
2862
- $fts_language_years = 'years';
2863
- }
2864
- $fts_language_ago = get_option( 'fts_language_ago' );
2865
- if ( empty( $fts_language_ago ) ) {
2866
- $fts_language_ago = 'ago';
2867
- }
2868
-
2869
- // $periods = array( "sec", "min", "hour", "day", "week", "month", "years", "decade" );.
2870
- $periods = array( $fts_language_second, $fts_language_minute, $fts_language_hour, $fts_language_day, $fts_language_week, $fts_language_month, $fts_language_year, 'decade' );
2871
- $periods_plural = array( $fts_language_seconds, $fts_language_minutes, $fts_language_hours, $fts_language_days, $fts_language_weeks, $fts_language_months, $fts_language_years, 'decades' );
2872
-
2873
- if ( ! is_numeric( $timestamp ) ) {
2874
- $timestamp = strtotime( $timestamp );
2875
- if ( ! is_numeric( $timestamp ) ) {
2876
- return '';
2877
- }
2878
- }
2879
- $difference = time() - $timestamp;
2880
- // Customize in your own language. Why thank-you I will.
2881
- $lengths = array( '60', '60', '24', '7', '4.35', '12', '10' );
2882
-
2883
- if ( $difference > 0 ) {
2884
- // this was in the past
2885
- $ending = $fts_language_ago;
2886
- } else {
2887
- // this was in the future
2888
- $difference = -$difference;
2889
- // not doing dates in the future for posts
2890
- $ending = 'to go';
2891
- }
2892
- for ( $j = 0; $difference >= $lengths[ $j ] && $j < count( $lengths ) - 1; $j++ ) {
2893
- $difference /= $lengths[ $j ];
2894
- }
2895
-
2896
- $difference = round( $difference );
2897
-
2898
- if ( $difference > 1 ) {
2899
- $periods[ $j ] = $periods_plural[ $j ];
2900
- }
2901
-
2902
- return "$difference $periods[$j] $ending";
2903
- }
2904
-
2905
- /**
2906
- * FTS Custom Date
2907
- *
2908
- * @param string $created_time Created time.
2909
- * @param string $feed_type Feed type.
2910
- * @return string
2911
- * @since 1.9.6
2912
- */
2913
- public function fts_custom_date( $created_time, $feed_type ) {
2914
- $fts_custom_date = get_option( 'fts-custom-date' );
2915
- $fts_custom_time = get_option( 'fts-custom-time' );
2916
- $custom_date_check = get_option( 'fts-date-and-time-format' );
2917
- $fts_twitter_offset_time = get_option( 'fts_twitter_time_offset' );
2918
- $fts_timezone = get_option( 'fts-timezone' );
2919
-
2920
- if ( '' === $fts_custom_date && '' === $fts_custom_time ) {
2921
- $custom_date_check = $custom_date_check;
2922
- } elseif ( '' !== $fts_custom_date || '' !== $fts_custom_time ) {
2923
- $custom_date_check = $fts_custom_date . ' ' . $fts_custom_time;
2924
- } else {
2925
- $custom_date_check = 'F jS, Y \a\t g:ia';
2926
- }
2927
- if ( ! empty( $fts_timezone ) ) {
2928
- date_default_timezone_set( $fts_timezone );
2929
- }
2930
- // Twitter date time!
2931
- if ( 'twitter' === $feed_type ) {
2932
-
2933
- $fts_twitter_offset_time_final = 1 === $fts_twitter_offset_time ? strtotime( $created_time ) : strtotime( $created_time ) - 3 * 3600;
2934
-
2935
- if ( 'one-day-ago' === $custom_date_check ) {
2936
- $u_time = $this->fts_ago( $created_time );
2937
- } else {
2938
- $u_time = ! empty( $custom_date_check ) ? date_i18n( $custom_date_check, $fts_twitter_offset_time_final ) : $this->fts_ago( $created_time );
2939
- }
2940
- }
2941
- // Instagram date time!
2942
- if ( 'instagram' === $feed_type ) {
2943
- if ( 'one-day-ago' === $custom_date_check ) {
2944
- $u_time = $this->fts_ago( $created_time );
2945
- } else {
2946
- $u_time = ! empty( $custom_date_check ) ? date_i18n( $custom_date_check, $created_time ) : $this->fts_ago( $created_time );
2947
- }
2948
- }
2949
- // Youtube and Pinterest date time!
2950
- if ( 'pinterest' === $feed_type ) {
2951
- if ( 'one-day-ago' === $custom_date_check ) {
2952
- $u_time = $this->fts_ago( $created_time );
2953
- } else {
2954
- $u_time = ! empty( $custom_date_check ) ? date_i18n( $custom_date_check, strtotime( $created_time ) ) : $this->fts_ago( $created_time );
2955
- }
2956
- }
2957
- // WP Gallery and Pinterest date time!
2958
- if ( 'wp_gallery' === $feed_type ) {
2959
- if ( 'one-day-ago' === $custom_date_check ) {
2960
- $u_time = $this->fts_ago( $created_time );
2961
- } else {
2962
- $u_time = ! empty( $custom_date_check ) ? date_i18n( $custom_date_check, strtotime( $created_time ) ) : $this->fts_ago( $created_time );
2963
- }
2964
- }
2965
- // Facebook date time!
2966
- if ( 'facebook' === $feed_type ) {
2967
- $time_set = $fts_timezone;
2968
- $time_set_check = isset( $time_set ) ? $time_set : 'America/New_York';
2969
- date_default_timezone_set( $time_set_check );
2970
-
2971
- if ( 'one-day-ago' === $custom_date_check ) {
2972
- $u_time = $this->fts_ago( $created_time );
2973
- } else {
2974
- $u_time = ! empty( $custom_date_check ) ? date_i18n( $custom_date_check, $created_time ) : $this->fts_ago( $created_time );
2975
- }
2976
- }
2977
- // Instagram date time!
2978
- if ( 'youtube' === $feed_type ) {
2979
- if ( 'one-day-ago' === $custom_date_check ) {
2980
- $u_time = $this->fts_ago( $created_time );
2981
- } else {
2982
- $u_time = ! empty( $custom_date_check ) ? date_i18n( $custom_date_check, strtotime( $created_time ) ) : $this->fts_ago( $created_time );
2983
- }
2984
- }
2985
- // Return the time!
2986
- return $u_time;
2987
- }
2988
- /**
2989
- * Random String generator For All Feeds
2990
- *
2991
- * @param int $length Random string length.
2992
- * @return string
2993
- * @since 2.0.7
2994
- */
2995
- public function feed_them_social_rand_string( $length = 10 ) {
2996
- $characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
2997
- $characters_length = strlen( $characters );
2998
- $random_string = '';
2999
- for ( $i = 0; $i < $length; $i++ ) {
3000
- $random_string .= $characters[ wp_rand( 0, $characters_length - 1 ) ];
3001
- }
3002
- return $random_string;
3003
- }
3004
-
3005
- /**
3006
- * FTS Refresh YouTube Token
3007
- *
3008
- * @since 2.3.3
3009
- */
3010
- public function fts_refresh_token_ajax() {
3011
-
3012
- $fts_refresh_token_nonce = wp_create_nonce( 'fts_refresh_token_nonce' );
3013
-
3014
- if ( wp_verify_nonce( $fts_refresh_token_nonce, 'fts_refresh_token_nonce' ) ) {
3015
- if ( isset( $_REQUEST['refresh_token'], $_REQUEST['button_pushed'] ) && 'yes' === $_REQUEST['button_pushed'] ) {
3016
- update_option( 'youtube_custom_refresh_token', sanitize_text_field( wp_unslash( $_REQUEST['refresh_token'] ) ) );
3017
- }
3018
- if ( isset( $_REQUEST['access_token'] ) ) {
3019
- update_option( 'youtube_custom_access_token', sanitize_text_field( wp_unslash( $_REQUEST['access_token'] ) ) );
3020
- }
3021
- $startoftime = isset( $_REQUEST['expires_in'] ) ? strtotime( '+' . sanitize_text_field( wp_unslash( $_REQUEST['expires_in'] ) ) . ' seconds' ) : '';
3022
- $start_of_time_final = false !== $startoftime ? sanitize_key( $startoftime ) : '';
3023
- update_option( 'youtube_custom_token_exp_time', $start_of_time_final );
3024
-
3025
- // This only happens if the token is expired on the YouTube Options page and you go to re-save or refresh the page for some reason. It will also run this function if the cache is emptied and the token is found to be expired.
3026
- if ( 'no' === $_REQUEST['button_pushed'] ) {
3027
- return 'Token Refreshed';
3028
- // $output .= do_shortcode('[fts _youtube vid_count=3 large_vid=no large_vid_title=no large_vid_description=no thumbs_play_in_iframe=popup vids_in_row=3 space_between_videos=1px force_columns=yes maxres_thumbnail_images=yes thumbs_wrap_color=#000 wrap=none video_wrap_display=none comments_count=12 channel_id=UCqhnX4jA0A5paNd1v-zEysw loadmore=button loadmore_count=5 loadmore_btn_maxwidth=300px loadmore_btn_margin=10px]');
3029
- }
3030
- }
3031
-
3032
- }
3033
-
3034
- /**
3035
- * FTS Check YouTube Token Validity
3036
- *
3037
- * @since 2.3.3
3038
- */
3039
- public function feed_them_youtube_refresh_token() {
3040
-
3041
- $fts_refresh_token_nonce = wp_create_nonce( 'fts_refresh_token_nonce' );
3042
-
3043
- if ( wp_verify_nonce( $fts_refresh_token_nonce, 'fts_refresh_token_nonce' ) ) {
3044
-
3045
- // Used some methods from this link http://ieg.wnet.org/2015/09/using-oauth-in-wordpress-plugins-part-2-persistence/
3046
- // save all 3 get options: happens when clicking the get access token button on the youtube options page!
3047
- if ( isset( $_GET['refresh_token'], $_GET['access_token'] ) && isset( $_GET['expires_in'] ) ) {
3048
- $button_pushed = 'yes';
3049
- $clienttoken_post['refresh_token'] = sanitize_text_field( wp_unslash( $_GET['refresh_token'] ) );
3050
- $auth_obj['access_token'] = sanitize_text_field( wp_unslash( $_GET['access_token'] ) );
3051
- $auth_obj['expires_in'] = sanitize_key( wp_unslash( $_GET['expires_in'] ) );
3052
- } else {
3053
- // refresh token!
3054
- $button_pushed = 'no';
3055
- $oauth2token_url = 'https://accounts.google.com/o/oauth2/token';
3056
- $clienttoken_post = array(
3057
- 'client_id' => '802796800957-6nannpdq8h8l720ls430ahnnq063n22u.apps.googleusercontent.com',
3058
- 'client_secret' => 'CbieVhgOudjrpya1IDpv3uRa',
3059
- );
3060
- // The "refresh token" grant type is to use a refresh token to get a new access token!
3061
- $clienttoken_post['refresh_token'] = get_option( 'youtube_custom_refresh_token' );
3062
- $clienttoken_post['grant_type'] = 'refresh_token';
3063
-
3064
- $postargs = array(
3065
- 'body' => $clienttoken_post,
3066
- );
3067
- $response = wp_remote_post( $oauth2token_url, $postargs );
3068
- $auth_obj = json_decode( wp_remote_retrieve_body( $response ), true );
3069
- }
3070
- ?>
3071
- <script>
3072
- jQuery(document).ready(function() {
3073
- jQuery.ajax({
3074
- data: {
3075
- action: "fts_refresh_token_ajax",
3076
- refresh_token: '<?php echo esc_js( $clienttoken_post['refresh_token'] ); ?>',
3077
- access_token: '<?php echo esc_js( $auth_obj['access_token'] ); ?>',
3078
- expires_in: '<?php echo esc_js( $auth_obj['expires_in'] ); ?>',
3079
- button_pushed: '<?php echo esc_js( $button_pushed ); ?>'
3080
- },
3081
- type: 'POST',
3082
- url: ftsAjax.ajaxurl,
3083
- success: function( response ) {
3084
- console.log(response);
3085
- <?php
3086
- if ( isset( $_GET['page'] ) && 'fts-youtube-feed-styles-submenu-page' === $_GET['page'] ) {
3087
- foreach ( $auth_obj as $user_id ) {
3088
- if ( ! isset( $user_id->error->errors[0]->reason ) ) {
3089
- $type_of_key = __( 'API key', 'feed-them-social' );
3090
- } elseif ( ! isset( $user_id->error->errors[0]->reason ) && ! empty( $youtube_access_token ) ) {
3091
- $type_of_key = __( 'Access Token', 'feed-them-social' );
3092
- }
3093
-
3094
- // Error Check!
3095
- if ( ! isset( $auth_obj->error->errors[0]->reason ) ) {
3096
- $fts_youtube_message = sprintf(
3097
- esc_html( '%1$s Your %2$s is working! Generate your shortcode on the %3$s settings page.%4$s %5$s', 'feed-them-social' ),
3098
- '<div class="fts-successful-api-token">',
3099
- esc_html( $type_of_key ),
3100
- '<a href="' . esc_url( 'admin.php?page=feed-them-settings-page' ) . '">',
3101
- '</a>',
3102
- '</div><div class="clear"></div>'
3103
- );
3104
- } elseif ( isset( $user_id->error->errors[0]->reason ) ) {
3105
- $fts_youtube_message = sprintf(
3106
- esc_html( '%1$s This %2$s does not appear to be valid. YouTube responded with: %3$s %4$s ', 'feed-them-social' ),
3107
- '<div class="fts-failed-api-token">',
3108
- esc_html( $type_of_key ),
3109
- esc_html( $user_id->errors[0]->reason ),
3110
- '</div><div class="clear"></div>'
3111
- );
3112
- }
3113
-
3114
- break;
3115
- }
3116
-
3117
- ?>
3118
- jQuery('#youtube_custom_access_token, #youtube_custom_token_exp_time').val('');
3119
-
3120
- <?php if ( isset( $_GET['refresh_token'], $_GET['access_token'] ) && isset( $_GET['expires_in'] ) ) { ?>
3121
- jQuery('#youtube_custom_refresh_token').val(jQuery('#youtube_custom_refresh_token').val() + '<?php echo esc_js( $clienttoken_post['refresh_token'] ); ?>');
3122
- jQuery('.fts-failed-api-token').hide();
3123
-
3124
- if(!jQuery('.fts-successful-api-token').length) {
3125
- jQuery('.fts-youtube-last-row').append('<?php echo $fts_youtube_message; ?>');
3126
- }
3127
- <?php
3128
- } else {
3129
- ?>
3130
- if(jQuery('.fts-failed-api-token').length) {
3131
- jQuery('.fts-youtube-last-row').append('<?php echo $fts_youtube_message; ?>');
3132
- jQuery('.fts-failed-api-token').hide();
3133
- }
3134
- <?php } ?>
3135
-
3136
- jQuery('#youtube_custom_access_token').val(jQuery('#youtube_custom_access_token').val() + '<?php echo esc_js( $auth_obj['access_token'] ); ?>');
3137
- jQuery('#youtube_custom_token_exp_time').val(jQuery('#youtube_custom_token_exp_time').val() + '<?php echo esc_js( strtotime( '+' . $auth_obj['expires_in'] . ' seconds' ) ); ?>');
3138
- jQuery('<div class="fa fa-check-circle fa-3x fa-fw fts-success"></div>').insertBefore('.hide-button-tokens-options .feed-them-social-admin-input-wrap .fts-clear');
3139
- jQuery('.fts-success').fadeIn('slow');
3140
- <?php } ?>
3141
- return false;
3142
- }
3143
- }); // end of ajax()
3144
- return false;
3145
- }); // end of document.ready
3146
- </script>
3147
- <?php
3148
- return $auth_obj['access_token'];
3149
- }
3150
- }
3151
-
3152
-
3153
- /**
3154
- * FTS YouTube Link Filter
3155
- *
3156
- * @param string $youtube_description youtube description.
3157
- * @return string
3158
- * @since 1.9.6
3159
- */
3160
- public function fts_youtube_link_filter( $youtube_description ) {
3161
- // Converts URLs to Links!
3162
- $youtube_description = preg_replace( '@(?!(?!.*?<a)[^<]*<\/a>)(?:(?:https?|ftp|file)://|www\.|ftp\.)[-A-‌​Z0-9+&#/%=~_|$?!:,.]*[A-Z0-9+&#/%=~_|$]@i', '<a href="\0" target="_blank">\0</a>', $youtube_description );
3163
-
3164
- $splitano = explode( 'www', $youtube_description );
3165
- $count = count( $splitano );
3166
- $return_value = '';
3167
-
3168
- for ( $i = 0; $i < $count; $i++ ) {
3169
- if ( 'href=' === substr( $splitano[ $i ], -6, 5 ) ) {
3170
- $return_value .= $splitano[ $i ] . 'http://www';
3171
- } elseif ( $i < $count - 1 ) {
3172
- $return_value .= $splitano[ $i ] . 'www';
3173
- } else {
3174
- $return_value .= $splitano[ $i ];
3175
- }
3176
- }
3177
- return $return_value;
3178
- }
3179
-
3180
- /**
3181
- * FTS Youtube Video and Wrap
3182
- *
3183
- * @param object $post_data post data.
3184
- * @param string $username username.
3185
- * @param string $playlist_id playlist id.
3186
- * @since 1.9.6
3187
- */
3188
- public function fts_youtube_video_and_wrap( $post_data, $username, $playlist_id ) {
3189
- $ssl = is_ssl() ? 'https' : 'http';
3190
- $youtube_video_user_or_playlist_url = isset( $post_data->snippet->resourceId->videoId ) ? $post_data->snippet->resourceId->videoId : '';
3191
- $youtube_video_channel_url = isset( $post_data->id->videoId ) ? $post_data->id->videoId : '';
3192
-
3193
- if ( '' !== $username || '' !== $playlist_id ) {
3194
- $youtube_video_iframe = '<div class="fts-fluid-videoWrapper"><iframe src="' . esc_url( $ssl . '://www.youtube.com/embed/' . $youtube_video_user_or_playlist_url ) . '?wmode=transparent&HD=0&rel=0&showinfo=0&controls=1&autoplay=0" frameborder="0" allowfullscreen></iframe></div>';
3195
-
3196
- } else {
3197
- $youtube_video_iframe = '<div class="fts-fluid-videoWrapper"><iframe src="' . esc_url( $ssl . '://www.youtube.com/embed/' . $youtube_video_channel_url ) . '?wmode=transparent&HD=0&rel=0&showinfo=0&controls=1&autoplay=0" frameborder="0" allowfullscreen></iframe></div>';
3198
- }
3199
- return $youtube_video_iframe;
3200
- }
3201
-
3202
-
3203
- /**
3204
- * Youtube Description
3205
- *
3206
- * @param object $post_data post data.
3207
- * @return string
3208
- * @since 1.9.6
3209
- */
3210
- public function fts_youtube_description( $post_data ) {
3211
-
3212
- $pinterest_description = isset( $post_data->snippet->description ) ? $post_data->snippet->description : '';
3213
- return $pinterest_description;
3214
- }
3215
-
3216
- /**
3217
- * Youtube Title
3218
- *
3219
- * @param object $post_data post data.
3220
- * @return string
3221
- * @since 1.9.6
3222
- */
3223
- public function fts_youtube_title( $post_data ) {
3224
- $youtube_post_title = isset( $post_data->snippet->title ) ? $post_data->snippet->title : '';
3225
- return $youtube_post_title;
3226
- }
3227
-
3228
- /**
3229
- * FTS Facebook Group Form
3230
- *
3231
- * @param bool $save_options Save Options.
3232
- * @since 1.9.6
3233
- */
3234
- public function fts_facebook_group_form( $save_options = false ) {
3235
- // DEPRECIATED!
3236
- }
3237
- public function fts_facebook_event_form( $save_options = false ) {
3238
- // DEPRECIATED!
3239
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3240
  }//end class
3241
  ?>
7
  * @package feedthemsocial
8
  * @since 1.9.6
9
  */
10
+ class feed_them_social_functions
11
+ {
12
+
13
+ /**
14
+ * Construct
15
+ *
16
+ * Functions constructor.
17
+ *
18
+ * @since 1.9.6
19
+ */
20
+ public function __construct ()
21
+ {
22
+ $root_file = plugin_dir_path( dirname( __FILE__ ) );
23
+ $this->premium = str_replace( 'feed-them-social/', 'feed-them-premium/', $root_file );
24
+ $this->facebook_carousel_premium = str_replace( 'feed-them-social/', 'feed-them-carousel-premium/', $root_file );
25
+ $this->facebook_reviews = str_replace( 'feed-them-social/', 'feed-them-social-facebook-reviews/', $root_file );
26
+
27
+ // FTS Activation Function. Commenting out for future use. SRL!
28
+ register_deactivation_hook( __FILE__, array($this, 'fts_get_check_plugin_version') );
29
+ // Widget Code!
30
+ add_filter( 'widget_text', 'do_shortcode' );
31
+ // This is for the fts_clear_cache_ajax submission!
32
+ if ( 'show-admin-bar-menu' === get_option( 'fts_admin_bar_menu' ) ) {
33
+ add_action( 'init', array($this, 'fts_clear_cache_script') );
34
+ add_action( 'wp_head', array($this, 'my_fts_ajaxurl') );
35
+ add_action( 'wp_ajax_fts_clear_cache_ajax', array($this, 'fts_clear_cache_ajax') );
36
+ }
37
+ add_action( 'wp_ajax_fts_refresh_token_ajax', array($this, 'fts_refresh_token_ajax') );
38
+ add_action( 'wp_ajax_fts_instagram_token_ajax', array($this, 'fts_instagram_token_ajax') );
39
+
40
+ if ( is_admin() || is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) || is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) || is_plugin_active( 'fts-bar/fts-bar.php' ) ) {
41
+ // Load More Options!
42
+ add_action( 'wp_ajax_my_fts_fb_load_more', array($this, 'my_fts_fb_load_more') );
43
+ add_action( 'wp_ajax_nopriv_my_fts_fb_load_more', array($this, 'my_fts_fb_load_more') );
44
+ add_action( 'wp_ajax_my_fts_fb_options_page_load_more', array($this, 'my_fts_fb_options_page_load_more') );
45
+ }
46
+
47
+ add_shortcode( 'fts_fb_page_token', array($this, 'fts_fb_page_token_func') );
48
+ }
49
+
50
+ /**
51
+ * Init
52
+ *
53
+ * For Loading in the Admin.
54
+ *
55
+ * @since 1.9.6
56
+ */
57
+ public function init ()
58
+ {
59
+ if ( is_admin() ) {
60
+ // Register Settings!
61
+ add_action( 'admin_init', array($this, 'fts_settings_page_register_settings') );
62
+ add_action( 'admin_init', array($this, 'fts_facebook_style_options_page') );
63
+ add_action( 'admin_init', array($this, 'fts_twitter_style_options_page') );
64
+ add_action( 'admin_init', array($this, 'fts_instagram_style_options_page') );
65
+ add_action( 'admin_init', array($this, 'fts_pinterest_style_options_page') );
66
+ add_action( 'admin_init', array($this, 'fts_youtube_style_options_page') );
67
+
68
+ // Adds setting page to FTS menu!
69
+ add_action( 'admin_menu', array($this, 'feed_them_main_menu') );
70
+ add_action( 'admin_menu', array($this, 'feed_them_submenu_pages') );
71
+ // THIS GIVES US SOME OPTIONS FOR STYLING THE ADMIN AREA!
72
+ add_action( 'admin_enqueue_scripts', array($this, 'feed_them_admin_css') );
73
+ // Main Settings Page!
74
+ if ( isset( $_GET['page'] ) && 'feed-them-settings-page' === $_GET['page'] || isset( $_GET['page'] ) && 'fts-facebook-feed-styles-submenu-page' === $_GET['page'] || isset( $_GET['page'] ) && 'fts-twitter-feed-styles-submenu-page' === $_GET['page'] || isset( $_GET['page'] ) && 'fts-instagram-feed-styles-submenu-page' === $_GET['page'] || isset( $_GET['page'] ) && 'fts-pinterest-feed-styles-submenu-page' === $_GET['page'] || isset( $_GET['page'] ) && 'fts-youtube-feed-styles-submenu-page' === $_GET['page'] ) {
75
+ add_action( 'admin_enqueue_scripts', array($this, 'feed_them_settings') );
76
+ }
77
+ // System Info Page!
78
+ if ( isset( $_GET['page'] ) && 'fts-system-info-submenu-page' === $_GET['page'] ) {
79
+ add_action( 'admin_enqueue_scripts', array($this, 'feed_them_system_info_css') );
80
+ }
81
+ // FTS License Page!
82
+ if ( isset( $_GET['page'] ) && 'fts-license-page' === $_GET['page'] ) {
83
+ add_action( 'admin_footer', array($this, 'fts_plugin_license') );
84
+ }
85
+ }
86
+
87
+ // FTS Admin Bar!
88
+ add_action( 'wp_before_admin_bar_render', array($this, 'fts_admin_bar_menu'), 999 );
89
+ // Settings option. Add Custom CSS to the header of FTS pages only!
90
+ $fts_include_custom_css_checked_css = get_option( 'fts-color-options-settings-custom-css' );
91
+ if ( '1' === $fts_include_custom_css_checked_css ) {
92
+ add_action( 'wp_enqueue_scripts', array($this, 'fts_color_options_head_css') );
93
+ }
94
+ // Facebook Settings option. Add Custom CSS to the header of FTS pages only!
95
+ $fts_include_fb_custom_css_checked_css = '1';
96
+ if ( '1' === $fts_include_fb_custom_css_checked_css ) {
97
+ add_action( 'wp_enqueue_scripts', array($this, 'fts_fb_color_options_head_css') );
98
+ }
99
+ // Settings option. Custom Powered by Feed Them Social Option!
100
+ $fts_powered_text_options_settings = get_option( 'fts-powered-text-options-settings' );
101
+ if ( '1' !== $fts_powered_text_options_settings ) {
102
+ add_action( 'wp_enqueue_scripts', array($this, 'fts_powered_by_js') );
103
+ }
104
+
105
+ if ( is_plugin_active( 'jetpack/jetpack.php' ) ) {
106
+ add_filter( 'jetpack_photon_skip_image', array($this, 'fts_jetpack_photon_exception'), 10, 3 );
107
+ }
108
+ }
109
+
110
+ /**
111
+ * FTS Instagram Token Ajax
112
+ *
113
+ * This will save the returned token to the database.
114
+ *
115
+ * @since 2.3.3
116
+ */
117
+ public function fts_instagram_token_ajax ()
118
+ {
119
+
120
+ $fts_refresh_token_nonce = wp_create_nonce( 'fts_token_nonce' );
121
+ $access_token = $_REQUEST['access_token'];
122
+ if ( wp_verify_nonce( $fts_refresh_token_nonce, 'fts_token_nonce' ) ) {
123
+ if ( isset( $access_token ) ) {
124
+ update_option( 'fts_instagram_custom_api_token', sanitize_text_field( $access_token ) );
125
+ $insta_id = substr( $access_token, 0, strpos( $access_token, "." ) );
126
+ update_option( 'fts_instagram_custom_id', sanitize_text_field( $insta_id ) );
127
+ }
128
+ }
129
+ die;
130
+ }
131
+
132
+ /**
133
+ * Feed Them Instagram Save Token
134
+ *
135
+ * FTS Check and Save Instagram Token Validity.
136
+ *
137
+ * @return bool
138
+ * @since 2.6.1
139
+ */
140
+ public function feed_them_instagram_save_token ()
141
+ {
142
+
143
+ $fts_refresh_token_nonce = wp_create_nonce( 'access_token' );
144
+
145
+ if ( wp_verify_nonce( $fts_refresh_token_nonce, 'access_token' ) ) {
146
+
147
+ $auth_obj = $_GET['access_token'];
148
+
149
+ if ( isset( $auth_obj ) ) {
150
+ ?>
151
+ <script>
152
+ jQuery(document).ready(function () {
153
+ var access_token = '<?php echo sanitize_text_field( $auth_obj ) ?>';
154
+ jQuery.ajax({
155
+ data: {
156
+ action: 'fts_instagram_token_ajax',
157
+ access_token: access_token,
158
+ },
159
+ type: 'POST',
160
+ url: ftsAjax.ajaxurl,
161
+ success: function (response) {
162
+ <?php
163
+ $auth_obj = $_GET['access_token'];
164
+ $insta_url = esc_url( 'https://api.instagram.com/v1/users/self/?access_token=' . $auth_obj );
165
+ // Get Data for Instagram to check for errors
166
+ $response = wp_remote_fopen( $insta_url );
167
+ $test_app_token_response = json_decode( $response );
168
+
169
+ // if the combined streams plugin is active we won't allow the settings page link to open up the Instagram Feed, instead we'll remove the #feed_type=instagram and just let the user manually select the combined streams or single instagram feed.
170
+ if ( is_plugin_active( 'feed-them-social-combined-streams/feed-them-social-combined-streams.php' ) ) {
171
+ $custom_instagram_link_hash = '';
172
+ } else {
173
+ $custom_instagram_link_hash = '#feed_type=instagram';
174
+ }
175
+ if ( !isset( $test_app_token_response->meta->error_message ) && !isset( $test_app_token_response->error_message ) || isset( $test_app_token_response->meta->error_message ) && 'This client has not been approved to access this resource.' === $test_app_token_response->meta->error_message ) {
176
+ $fts_instagram_message = sprintf(
177
+ esc_html( '%1$sYour access token is working! Generate your shortcode on the %2$sSettings Page%3$s', 'feed-them-social' ),
178
+ '<div class="fts-successful-api-token">',
179
+ '<a href="' . esc_url( 'admin.php?page=feed-them-settings-page' . $custom_instagram_link_hash ) . '">',
180
+ '</a></div>'
181
+ );
182
+ ?>
183
+ jQuery('.fts-failed-api-token').hide();
184
+ if (!jQuery('.fts-successful-api-token').length) {
185
+ jQuery('.fts-instagram-last-row').append('<?php echo $fts_instagram_message; ?>');
186
+ }
187
+ jQuery('.fts-success').show();
188
+ <?php
189
+ } elseif ( isset( $test_app_token_response->meta->error_message ) || isset( $test_app_token_response->error_message ) ) {
190
+ $text = isset( $test_app_token_response->meta->error_message ) ? $test_app_token_response->meta->error_message : $test_app_token_response->error_message;
191
+ $fts_instagram_message = sprintf(
192
+ esc_html( '%1$sOh No something\'s wrong. %2$s. Please try clicking the button again to get a new access token. If you need additional assistance please email us at support@slickremix.com %3$s.', 'feed-them-social' ),
193
+ '<div class="fts-failed-api-token">',
194
+ esc_html( $text ),
195
+ '</div>'
196
+ );
197
+ ?>
198
+ if (jQuery('.fts-failed-api-token').length) {
199
+ jQuery('.fts-failed-api-token').hide();
200
+ jQuery('.fts-instagram-last-row').append('<?php echo $fts_instagram_message; ?>');
201
+ }
202
+ <?php
203
+ }
204
+ ?>
205
+ }
206
+ }); // end of ajax()
207
+ return false;
208
+ }); // end of document.ready
209
+ </script>
210
+ <?php
211
+ }
212
+ }
213
+ }
214
+
215
+ /**
216
+ * FTS JetPack Photon Option Exception
217
+ *
218
+ * This function resolves issues with images and JetPack
219
+ *
220
+ * @param string $val value.
221
+ * @param string $src source.
222
+ * @param string $tag tag.
223
+ * @return bool
224
+ * @since @since 1.9.6
225
+ */
226
+ public function fts_jetpack_photon_exception ($val, $src, $tag)
227
+ {
228
+ if ( strpos( $src, 'fbcdn.net' ) ) {
229
+ return true;
230
+ }
231
+ return $val;
232
+ }
233
+
234
+ /**
235
+ * FTS Share Option
236
+ *
237
+ * @param string $fb_link link for social network.
238
+ * @param string $description description field for some of the social networks.
239
+ * @since
240
+ */
241
+ public function fts_share_option ($fb_link, $description)
242
+ {
243
 
244
  $hide_share = get_option( 'fts_disable_share_button', true ) ? get_option( 'fts_disable_share_button', true ) : '';
245
 
246
+ if ( isset( $hide_share ) && '1' !== $hide_share ) {
247
  // Social media sharing URLs
248
+ $link = $fb_link;
249
+ $description = wp_strip_all_tags( $description );
250
  $ft_gallery_share_linkedin = 'https://www.linkedin.com/shareArticle?mini=true&url=' . $link;
251
+ $ft_gallery_share_email = 'mailto:?subject=Shared Link&body=' . $link . ' - ' . $description;
252
  $ft_gallery_share_facebook = 'https://www.facebook.com/sharer/sharer.php?u=' . $link;
253
+ $ft_gallery_share_twitter = 'https://twitter.com/intent/tweet?text=' . $link . '+' . $description;
254
+ $ft_gallery_share_google = 'https://plus.google.com/share?url=' . $link;
255
 
256
  // The share wrap and links
257
+ $output = '<div class="fts-share-wrap">';
258
+ $output .= '<a href="javascript:;" class="ft-gallery-link-popup">' . esc_html( '', 'feed-them-social' ) . '</a>';
259
+ $output .= '<div class="ft-gallery-share-wrap">';
260
+ $output .= '<a href="' . esc_attr( $ft_gallery_share_facebook ) . '" target="_blank" class="ft-galleryfacebook-icon"><i class="fa fa-facebook-square"></i></a>';
261
+ $output .= '<a href="' . esc_attr( $ft_gallery_share_twitter ) . '" target="_blank" class="ft-gallerytwitter-icon"><i class="fa fa-twitter"></i></a>';
262
+ $output .= '<a href="' . esc_attr( $ft_gallery_share_google ) . '" target="_blank" class="ft-gallerygoogle-icon"><i class="fa fa-google-plus"></i></a>';
263
+ $output .= '<a href="' . esc_attr( $ft_gallery_share_linkedin ) . '" target="_blank" class="ft-gallerylinkedin-icon"><i class="fa fa-linkedin"></i></a>';
264
+ $output .= '<a href="' . esc_attr( $ft_gallery_share_email ) . '" target="_blank" class="ft-galleryemail-icon"><i class="fa fa-envelope"></i></a>';
265
+ $output .= '</div>';
266
+ $output .= '</div>';
267
  return $output;
268
+ }
269
+ }
270
+
271
+ /**
272
+ * FTS FB Options Page Function
273
+ *
274
+ * Display FB Page tokens for users
275
+ *
276
+ * @return mixed
277
+ * @since 2.1.4
278
+ */
279
+ public function fts_fb_page_token_func ()
280
+ {
281
+ $fts_fb_page_token_users_nonce = wp_create_nonce( 'fts-fb-page-token-users-nonce' );
282
+
283
+ if ( wp_verify_nonce( $fts_fb_page_token_users_nonce, 'fts-fb-page-token-users-nonce' ) ) {
284
+
285
+ // Make sure it's not ajaxing!
286
+ if ( !isset( $_GET['load_more_ajaxing'] ) ) {
287
+ $_REQUEST['fts_dynamic_name'] = sanitize_key( $this->feed_them_social_rand_string() );
288
+ } //End make sure it's not ajaxing!
289
+
290
+ ob_start();
291
+
292
+ if ( !isset( $_GET['locations'] ) ) {
293
+ $fb_token_response = isset( $_REQUEST['next_url'] ) ? wp_remote_fopen( esc_url_raw( $_REQUEST['next_url'] ) ) : wp_remote_fopen( 'https://graph.facebook.com/me/accounts?fields=locations{name,id,page_username,locations,store_number,store_location_descriptor,access_token},name,id,link,access_token&access_token=' . $_GET['access_token'] . '&limit=25' );
294
+ $test_fb_app_token_response = json_decode( $fb_token_response );
295
+ $_REQUEST['next_url'] = isset( $test_fb_app_token_response->paging->next ) ? esc_url_raw( $test_fb_app_token_response->paging->next ) : '';
296
+ } else {
297
+ $fb_token_response = isset( $_REQUEST['next_location_url'] ) ? wp_remote_fopen( esc_url_raw( $_REQUEST['next_location_url'] ) ) : '';
298
+ $test_fb_app_token_response = json_decode( $fb_token_response );
299
+ }
300
+
301
+ // echo '<pre>';
302
+ // echo _r($test_fb_app_token_response);
303
+ // echo '</pre>';
304
+ // Make sure it's not ajaxing!
305
+ if ( !isset( $_GET['load_more_ajaxing'] ) ) {
306
+ // ******************
307
+ // Load More BUTTON Start
308
+ // ******************
309
+ ?>
310
+ <div class="fts-clear"></div>
311
+ <?php
312
+ } //End make sure it's not ajaxing!
313
+
314
+ $build_shortcode = 'fts_fb_page_token';
315
+
316
+ // Make sure it's not ajaxing!
317
+ if (!isset( $_GET['load_more_ajaxing'] )) {
318
+
319
+ $reviews_token = isset( $_GET['reviews_token'] ) ? 'yes' : 'no';
320
+ ?>
321
+ <div id="fb-list-wrap">
322
+ <div class="fts-pages-info"> <?php echo esc_html( 'Click on a page in the list below and it will add the Page ID and Access Token above, then click save.', 'feed-them-social' ); ?></div>
323
+ <ul class="fb-page-list fb-page-master-list">
324
+ <?php
325
+ } //End make sure it's not ajaxing!
326
+
327
+ foreach ( $test_fb_app_token_response->data as $data ) {
328
+ ?>
329
+ <li class="fts-fb-main-page-li">
330
+ <div class="fb-click-wrapper">
331
+ <div class="fb-image">
332
+ <img border="0" height="50" width="50"
333
+ src="<?php echo esc_url( 'https://graph.facebook.com/' . $data->id . '/picture' ); ?>"/>
334
+ </div>
335
+ <div class="fb-name-wrap"><span class="fb-name">
336
  <?php
337
+ echo esc_html( $data->name );
338
+ if ( isset( $data->store_number, $data->store_location_descriptor ) ) {
339
+ print '(' . $data->store_location_descriptor . ')';
340
+ }
341
+ ?>
342
  </span></div>
343
+ <div class="fb-other-wrap">
344
+ <small>
345
+ <?php echo esc_html( 'ID: ', 'feed-them-social' ); ?>
346
+ <span class="fts-api-facebook-id"><?php echo esc_html( $data->id ); ?></span>
347
+ <?php echo isset( $data->store_number ) ? esc_html( '| Location: ' . $data->store_number, 'feed-them-social' ) : ''; ?>
348
+ </small>
349
+ </div>
350
+ <div class="page-token"><?php echo esc_attr( $data->access_token ); ?></div>
351
+ <?php
352
+ $facebook_input_token = get_option( 'fts_facebook_custom_api_token' );
353
+ $facebook_access_token = $data->access_token;
354
+ if ( $facebook_input_token === $facebook_access_token ) {
355
+ ?>
356
+ <div class="feed-them-social-admin-submit-btn " style="display: block !important;">
357
+ Active
358
+ </div>
359
+ <?php } else { ?>
360
+ <div class="feed-them-social-admin-submit-btn fts-token-save">Save</div>
361
+ <?php } ?>
362
+ <div class="fts-clear"></div>
363
+ </div>
364
+ <?php
365
+ $_REQUEST['next_location_url'] = isset( $data->locations->paging->next ) ? esc_url_raw( $data->locations->paging->next ) : '';
366
+ $remove_class_or_not = isset( $data->locations->paging->next ) ? 'fb-sublist-page-id-' . esc_attr( $data->id ) : '';
367
+ if ( isset( $data->locations->data ) ) {
368
+ $location_count = count( $data->locations->data );
369
+ $location_plus_sign = isset( $data->locations->paging->next ) ? '+' : '';
370
+ $location_text = 1 === $location_count ? esc_html( $location_count . ' ' . esc_html( 'Location for', 'feed-them-social' ) ) : esc_html( $location_count . $location_plus_sign . ' ' . esc_html( 'Locations for', 'feed-them-social' ) );
371
+ // if the locations equal 3 or less we will set the location container height to auto so the scroll loadmore does not fire.
372
+ $location_scroll_loadmore_needed_check = $location_count <= 3 ? 'height:auto !important' : 'height: 200px !important;';
373
+ }
374
+
375
+ if ( !isset( $_GET['locations'] ) && isset( $data->locations->data ) ) {
376
+ ?>
377
+ <div class="fts-fb-location-text-wrap"><?php echo esc_html( $location_text . ' ' . $data->name ); ?></div>
378
+ <ul class="fb-page-list fb-sublist <?php echo esc_attr( $remove_class_or_not ); ?>"
379
+ style="<?php echo esc_attr( $location_scroll_loadmore_needed_check ); ?>">
380
+ <?php foreach ( $data->locations->data as $location ) { ?>
381
+ <li>
382
+ <div class="fb-click-wrapper">
383
+ <div class="fb-image">
384
+ <img border="0" height="50" width="50"
385
+ src="<?php echo esc_url( 'https://graph.facebook.com/' . $location->id . '/picture' ); ?>"/>
386
+ </div>
387
+ <div class="fb-name-wrap"><span
388
+ class="fb-name"><?php echo esc_html( $location->name ); ?>
389
+ <?php
390
+ if ( isset( $location->store_location_descriptor ) ) {
391
+ echo '(' . esc_html( $location->store_location_descriptor ) . ')';
392
+ }
393
+ ?>
394
  </span></div>
395
+ <div class="fb-other-wrap">
396
+ <small>
397
+ <?php echo esc_html( 'ID: ', 'feed-them-social' ); ?>
398
+ <span class="fts-api-facebook-id"><?php echo esc_html( $location->id ); ?></span>
399
+ <?php
400
+ if ( isset( $location->store_number ) ) {
401
+ print '| ';
402
+ esc_html( 'Location:', 'feed-them-social' );
403
+ print ' ' . esc_html( $location->store_number );
404
+ }
405
+ ?>
406
+ </small>
407
+ </div>
408
+
409
+ <div class="page-token"><?php echo esc_html( $location->access_token ); ?></div>
410
+ <?php
411
+ $facebook_input_token = get_option( 'fts_facebook_custom_api_token' );
412
+ $facebook_access_token = $location->access_token;
413
+ if ( $facebook_input_token === $facebook_access_token ) {
414
+ ?>
415
+ <div class="feed-them-social-admin-submit-btn "
416
+ style="display: block !important;">Active
417
+ </div>
418
+ <?php } else { ?>
419
+ <div class="feed-them-social-admin-submit-btn fts-token-save">Save
420
+ </div>
421
+ <?php } ?>
422
+ <div class="fts-clear"></div>
423
+ </div>
424
+ </li>
425
+ <?php } ?>
426
+ </ul>
427
+
428
+ <?php
429
+ // Make sure it's not ajaxing locations!
430
+ if ( !isset( $_GET['locations'] ) && isset( $data->locations->paging->next ) ) {
431
+ echo '<div id="loadMore_' . esc_attr( $data->id ) . '_location" class="fts-fb-load-more" style="background:none !Important;">' . esc_html( 'Scroll to view more Locations', 'feed-them-instagram' ) . '</div>';
432
+ }//End Check
433
+
434
+ // Make sure it's not ajaxing locations!
435
+ if (!isset( $_GET['locations'] )) {
436
+ $time = time();
437
+ $nonce = wp_create_nonce( $time . 'load-more-nonce' );
438
+ $fb_page_id = $data->id;
439
+ ?>
440
+ <script>
441
+ jQuery(document).ready(function () {
442
+ jQuery(".fb-sublist-page-id-<?php echo esc_js( $fb_page_id ); ?>").bind("scroll", function () {
443
+ if (jQuery(this).scrollTop() + jQuery(this).innerHeight() >= jQuery(this)[0].scrollHeight) {
444
+ if (!jQuery('.fts-no-more-locations-<?php echo esc_js( $fb_page_id ); ?>').length) {
445
+ jQuery("#loadMore_<?php echo esc_js( $fb_page_id ); ?>_location").addClass('fts-fb-spinner');
446
+ var button = jQuery('#loadMore_<?php echo esc_js( $fb_page_id ); ?>_location').html('<div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div>');
447
+ console.log(button);
448
+ var build_shortcode = "<?php echo esc_js( $build_shortcode ); ?>";
449
+ var yes_ajax = "yes";
450
+ var fts_d_name = "<?php echo esc_js( $fb_page_id ); ?>";
451
+ var fts_security = "<?php echo esc_js( $nonce ); ?>";
452
+ var fts_time = "<?php echo esc_js( $time ); ?>";
453
+ var fts_reviews_feed = "<?php echo esc_js( $reviews_token ); ?>";
454
+ jQuery.ajax({
455
+ data: {
456
+ action: "my_fts_fb_load_more",
457
+ next_location_url: nextURL_location_<?php echo esc_js( $fb_page_id ); ?>,
458
+ fts_dynamic_name: fts_d_name,
459
+ rebuilt_shortcode: build_shortcode,
460
+ load_more_ajaxing: yes_ajax,
461
+ fts_security: fts_security,
462
+ fts_time: fts_time,
463
+ feed_name: build_shortcode,
464
+ fts_reviews_feed: fts_reviews_feed,
465
+ locations: 'yes'
466
+ },
467
+ type: 'GET',
468
+ url: ajaxurl,
469
+ success: function (data) {
470
+ console.log('Well Done and got this from sever: ' + data);
471
+ jQuery('.fb-sublist-page-id-<?php echo esc_js( $fb_page_id ); ?>').append(data).filter('.fb-sublist-page-id-<?php echo esc_js( $fb_page_id ); ?>').html();
472
+ jQuery('.fb-sublist-page-id-<?php echo esc_js( $fb_page_id ); ?>').animate({scrollTop: '+=100px'}, 800); // scroll down a 100px after new items are added
473
+
474
+
475
+
476
+ <?php if ( isset( $data->locations->paging->next ) && $data->locations->paging->next === $_REQUEST['next_location_url'] ) { ?>
477
+ jQuery('#loadMore_<?php echo esc_js( $fb_page_id ); ?>_location').replaceWith('<div class="fts-fb-load-more no-more-posts-fts-fb fts-no-more-locations-<?php echo esc_js( $fb_page_id ); ?>" style="background:none !important"><?php echo esc_html( 'All Locations loaded', 'feed-them-social' ); ?></div>');
478
+ jQuery('#loadMore_<?php echo esc_js( $fb_page_id ); ?>_location').removeAttr('id');
479
+ <?php } ?>
480
+ jQuery("#loadMore_<?php echo esc_js( $fb_page_id ); ?>_location").removeClass('fts-fb-spinner');
481
+ }
482
+ }); // end of ajax()
483
+ return false;
484
+
485
+ } //stop ajax from submitting again if the fts-no-more-locations class is found
486
+
487
+ }
488
+ }); // end of form.submit
489
+
490
+ }); // end of document.ready
491
+ </script>
492
+ <?php
493
+ } //END Make sure it's not ajaxing locations
494
+ ?>
495
+ <script>var nextURL_location_<?php echo esc_js( $fb_page_id ); ?>= "<?php echo isset( $data->locations->paging->next ) ? esc_url_raw( $data->locations->paging->next ) : ''; ?>";</script>
496
+ <?php } ?>
497
+ </li>
498
+
499
+ <?php
500
+ } // foreach loop of locations
501
+
502
+ // Make sure it's not ajaxing!
503
+ if (!isset( $_GET['load_more_ajaxing'] )) {
504
+ ?>
505
+ </ul>
506
+ <div class="fts-clear"></div>
507
+ </div>
508
+ <?php
509
+ } //End make sure it's not ajaxing
510
+
511
+ // Make sure it's not ajaxing!
512
+ if ( !isset( $_GET['load_more_ajaxing'] ) && !isset( $_GET['locations'] ) ) {
513
+ $fts_dynamic_name = isset( $_REQUEST['fts_dynamic_name'] ) ? sanitize_key( $_REQUEST['fts_dynamic_name'] ) : '';
514
+ $time = time();
515
+ $nonce = wp_create_nonce( $time . 'load-more-nonce' );
516
+ ?>
517
+ <script>
518
+ jQuery(document).ready(function () {
519
+
520
+ jQuery("#loadMore_<?php echo esc_js( $fts_dynamic_name ); ?>").click(function () {
521
+
522
+ jQuery("#loadMore_<?php echo esc_js( $fts_dynamic_name ); ?>").addClass('fts-fb-spinner');
523
+ var button = jQuery('#loadMore_<?php echo esc_js( $fts_dynamic_name ); ?>').html('<div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div>');
524
+ console.log(button);
525
+ var build_shortcode = "<?php echo esc_js( $build_shortcode ); ?>";
526
+ var yes_ajax = "yes";
527
+ var fts_d_name = "<?php echo esc_js( $fts_dynamic_name ); ?>";
528
+ var fts_security = "<?php echo esc_js( $nonce ); ?>";
529
+ var fts_time = "<?php echo esc_js( $time ); ?>";
530
+ var fts_reviews_feed = "<?php echo esc_js( $reviews_token ); ?>";
531
+ jQuery.ajax({
532
+ data: {
533
+ action: "my_fts_fb_load_more",
534
+ next_url: nextURL_<?php echo esc_js( $fts_dynamic_name ); ?>,
535
+ fts_dynamic_name: fts_d_name,
536
+ rebuilt_shortcode: build_shortcode,
537
+ load_more_ajaxing: yes_ajax,
538
+ fts_security: fts_security,
539
+ fts_time: fts_time,
540
+ feed_name: build_shortcode,
541
+ fts_reviews_feed: fts_reviews_feed
542
+ },
543
+ type: 'GET',
544
+ url: ajaxurl,
545
+ success: function (data) {
546
+ console.log('Well Done and got this from sever: ' + data);
547
+ jQuery('.fb-page-master-list').append(data).filter('.fb-page-list').html();
548
+
549
+ if (!nextURL_<?php echo esc_js( sanitize_text_field( wp_unslash( $_REQUEST['fts_dynamic_name'] ) ) ); ?> || 'no more' === nextURL_<?php echo esc_js( sanitize_text_field( wp_unslash( $_REQUEST['fts_dynamic_name'] ) ) ); ?>) {
550
+ jQuery('#loadMore_<?php echo esc_js( $fts_dynamic_name ); ?>').replaceWith('<div class="fts-fb-load-more no-more-posts-fts-fb"><?php echo esc_js( 'No More Pages', 'feed-them-social' ); ?></div>');
551
+ jQuery('#loadMore_<?php echo esc_js( $fts_dynamic_name ); ?>').removeAttr('id');
552
+ }
553
+ jQuery('#loadMore_<?php echo esc_js( $fts_dynamic_name ); ?>').html('<?php echo esc_js( 'Load More', 'feed-them-social' ); ?>');
554
+ // jQuery('#loadMore_< ?php echo $fts_dynamic_name ?>').removeClass('flip360-fts-load-more');
555
+ jQuery("#loadMore_<?php echo esc_js( $fts_dynamic_name ); ?>").removeClass('fts-fb-spinner');
556
+
557
+
558
+ }
559
+ }); // end of ajax()
560
+ return false;
561
+ }); // end of form.submit
562
+ }); // end of document.ready
563
+ </script>
564
+ <?php
565
+
566
+ } //END Make sure it's not ajaxing
567
+ ?>
568
+ <script>
569
+ <?php if ( !isset( $_GET['locations'] ) ) { ?>
570
+ var nextURL_<?php echo esc_js( sanitize_text_field( wp_unslash( $_REQUEST['fts_dynamic_name'] ) ) ); ?>= "<?php echo esc_url_raw( $_REQUEST['next_url'] ); ?>";
571
+ // alert('nextURL_<?php echo esc_js( sanitize_text_field( wp_unslash( $_REQUEST['fts_dynamic_name'] ) ) ); ?>');
572
+ <?php } ?>
573
+
574
+
575
+ if (document.querySelector('#fts-fb-token-wrap .fts-pages-info') !== null) {
576
+ jQuery(".fts-successful-api-token.default-token").hide();
577
+ }
578
+ <?php if ( 'yes' === $reviews_token || isset( $_GET['fts_reviews_feed'] ) && 'yes' === $_GET['fts_reviews_feed'] ) { ?>
579
+ if (document.querySelector('.default-token') !== null) {
580
+ jQuery(".default-token").show();
581
+ }
582
+
583
+ <?php } ?>
584
+
585
+ jQuery(document).ready(function ($) {
586
+ $(".feed-them-social-admin-submit-btn").click(function () {
587
+ // alert('test');
588
+ var newUrl = "<?php echo esc_url( admin_url( 'admin.php?page=fts-facebook-feed-styles-submenu-page/' ) ); ?>";
589
+ history.replaceState({}, null, newUrl);
590
+ $("#fts-facebook-feed-options-form").submit();
591
+ });
592
+
593
+ var fb = ".fb-page-list .fb-click-wrapper";
594
+ $('#fb-list-wrap').show();
595
+ //alert("reviews_token");
596
+
597
+ $(fb).click(function () {
598
+ var fb_page_id = $(this).find('.fts-api-facebook-id').html();
599
+ var token = $(this).find('.page-token').html();
600
+ // alert(token);
601
+ var name = $(this).find('.fb-name').html();
602
+ <?php if ( 'no' === $reviews_token || isset( $_GET['fts_reviews_feed'] ) && 'no' === $_GET['fts_reviews_feed'] ) { ?>
603
+ $("#fts_facebook_custom_api_token").val(token);
604
+ $("#fts_facebook_custom_api_token_user_id").val(fb_page_id);
605
+ $("#fts_facebook_custom_api_token_user_name").val(name);
606
+ <?php } else { ?>
607
+ $("#fts_facebook_custom_api_token_biz").val(token);
608
+ $("#fts_facebook_custom_api_token_user_id_biz").val(fb_page_id);
609
+ $("#fts_facebook_custom_api_token_user_name_biz").val(name);
610
+ <?php } ?>
611
+ $('.fb-page-list .feed-them-social-admin-submit-btn').hide();
612
+ $(this).find('.feed-them-social-admin-submit-btn').toggle();
613
+ // alert(name + token)
614
+ })
615
+ });
616
+ </script>
617
+ <?php
618
+ // Make sure it's not ajaxing!
619
+ if ( !isset( $_GET['load_more_ajaxing'] ) && isset( $test_fb_app_token_response->paging->next ) && !isset( $_GET['locations'] ) ) {
620
+ $fts_dynamic_name = sanitize_key( $_REQUEST['fts_dynamic_name'] );
621
+ echo '<div class="fts-clear"></div>';
622
+
623
+ echo '<div id="loadMore_' . esc_attr( $fts_dynamic_name ) . '" class="fts-fb-load-more">' . esc_html( 'Load More', 'feed-them-social' ) . '</div>';
624
+ }//End make sure it's not ajaxing
625
+
626
+ // Lastly if we can't find a next url we unset the next url from the page to not let the loadmore button be active.
627
+ if ( isset( $_GET['locations'] ) ) {
628
+ unset( $_REQUEST['next_location_url'] );
629
+ } else {
630
+ unset( $_REQUEST['next_url'] );
631
+ }
632
+ return ob_get_clean();
633
+ }
634
+ exit;
635
+ }
636
+
637
+
638
+ /**
639
+ * My FTS Plugin License
640
+ *
641
+ * Put in place to only show the Activate Plugin license if the input has a value
642
+ *
643
+ * @since 2.1.4
644
+ */
645
+ public function fts_plugin_license ()
646
+ {
647
+ wp_enqueue_script( 'jquery' );
648
+ ?>
649
+ <style>.fts-license-master-form th {
650
+ background: #f9f9f9;
651
+ padding: 14px;
652
+ border-bottom: 1px solid #ccc;
653
+ margin: -14px -14px 20px;
654
+ width: 100%;
655
+ display: block
656
+ }
657
+
658
+ .fts-license-master-form .form-table tr {
659
+ float: left;
660
+ margin: 0 15px 15px 0;
661
+ background: #fff;
662
+ border: 1px solid #ccc;
663
+ width: 30.5%;
664
+ max-width: 350px;
665
+ padding: 14px;
666
+ min-height: 220px;
667
+ position: relative;
668
+ box-sizing: border-box
669
+ }
670
+
671
+ .fts-license-master-form .form-table td {
672
+ padding: 0;
673
+ display: block
674
+ }
675
+
676
+ .fts-license-master-form td input.regular-text {
677
+ margin: 0 0 8px;
678
+ width: 100%
679
+ }
680
+
681
+ .fts-license-master-form .edd-license-data[class*=edd-license-] {
682
+ position: absolute;
683
+ background: #fafafa;
684
+ padding: 14px;
685
+ border-top: 1px solid #eee;
686
+ margin: 20px -14px -14px;
687
+ min-height: 67px;
688
+ width: 100%;
689
+ bottom: 14px;
690
+ box-sizing: border-box
691
+ }
692
+
693
+ .fts-license-master-form .edd-license-data p {
694
+ font-size: 13px;
695
+ margin-top: 0
696
+ }
697
+
698
+ .fts-license-master-form tr {
699
+ display: none
700
+ }
701
+
702
+ .fts-license-master-form tr.fts-license-wrap {
703
+ display: block
704
+ }
705
+
706
+ .fts-license-master-form .edd-license-msg-error {
707
+ background: rgba(255, 0, 0, 0.49)
708
+ }
709
+
710
+ .fts-license-master-form tr.fts-license-wrap {
711
+ display: block
712
+ }
713
+
714
+ .fts-license-master-form .edd-license-msg-error {
715
+ background: #e24e4e !important;
716
+ color: #FFF
717
+ }
718
+
719
+ .fts-license-wrap .edd-license-data p {
720
+ color: #1e981e
721
+ }
722
+
723
+ .edd-license-msg-error p {
724
+ color: #FFF !important
725
+ }
726
+
727
+ .feed-them_page_fts-license-page .button-secondary {
728
+ display: none;
729
+ }</style>
730
+ <script type="text/javascript">
731
+ jQuery(document).ready(function () {
732
+ if (jQuery('#feed_them_social_premium_license_key').val() !== '') {
733
+ jQuery('#feed_them_social_premium_license_key').next('label').find('.button-secondary').show()
734
+ }
735
+ if (jQuery('#feed_them_social_combined_streams_license_key').val() !== '') {
736
+ jQuery('#feed_them_social_combined_streams_license_key').next('label').find('.button-secondary').show()
737
+ }
738
+ if (jQuery('#feed-them-social-facebook-reviews_license_key').val() !== '') {
739
+ jQuery('#feed-them-social-facebook-reviews_license_key').next('label').find('.button-secondary').show()
740
+ }
741
+ if (jQuery('#fts_bar_license_key').val() !== '') {
742
+ jQuery('#fts_bar_license_key').next('label').find('.button-secondary').show()
743
+ }
744
+ if (jQuery('#feed_them_carousel_premium_license_key').val() !== '') {
745
+ jQuery('#feed_them_carousel_premium_license_key').next('label').find('.button-secondary').show()
746
+ }
747
+ });
748
+ </script>
749
+ <?php
750
+ }
751
+
752
+ /**
753
+ * My FTS Ajaxurl
754
+ *
755
+ * Ajax var on front end for twitter videos and loadmore button (if premium active.
756
+ *
757
+ * @since 1.9.6
758
+ */
759
+ public function my_fts_ajaxurl ()
760
+ {
761
+ wp_enqueue_script( 'jquery' );
762
+ }
763
+
764
+ /**
765
+ * My FTS FB Load More
766
+ *
767
+ * This function is being called from the fb feed... it calls the ajax in this case.
768
+ *
769
+ * @since 1.9.6
770
+ * @updated 2.1.4 (fts_fb_page_token)
771
+ */
772
+ public function my_fts_fb_load_more ()
773
+ {
774
+ if ( isset( $_REQUEST['fts_security'], $_REQUEST['fts_time'] ) && !wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST['fts_security'] ) ), sanitize_text_field( wp_unslash( $_REQUEST['fts_time'] ) ) . 'load-more-nonce' ) ) {
775
+ exit( 'Sorry, You can\'t do that!' );
776
+ } else {
777
+
778
+ if ( isset( $_REQUEST['feed_name'] ) && 'fts_fb_page_token' === $_REQUEST['feed_name'] ) {
779
+ if ( isset( $_REQUEST['next_url'] ) && false === strpos( sanitize_text_field( wp_unslash( $_REQUEST['next_url'] ) ), 'https://graph.facebook.com/v3.1' ) ||
780
+ isset( $_REQUEST['next_location_url'] ) && false === strpos( sanitize_text_field( wp_unslash( $_REQUEST['next_location_url'] ) ), 'https://graph.facebook.com/v3.1' ) ||
781
+ isset( $_REQUEST['next_url'] ) && sanitize_text_field( wp_unslash( $_REQUEST['next_url'] ) ) !== sanitize_text_field( wp_unslash( $_REQUEST['next_url'] ) ) ||
782
+ isset( $_REQUEST['next_location_url'] ) && sanitize_text_field( wp_unslash( $_REQUEST['next_location_url'] ) ) !== sanitize_text_field( wp_unslash( $_REQUEST['next_location_url'] ) ) ) {
783
+
784
+ exit( 'That is not an FTS shortcode!' );
785
+ }
786
+ }
787
+
788
+ if ( isset( $_REQUEST['feed_name'] ) && 'fts_fb_page_token' === $_REQUEST['feed_name'] ||
789
+ isset( $_REQUEST['feed_name'] ) && 'fts_twitter' === $_REQUEST['feed_name'] ||
790
+ isset( $_REQUEST['feed_name'] ) && 'fts_youtube' === $_REQUEST['feed_name'] ||
791
+ isset( $_REQUEST['feed_name'] ) && 'fts_facebook' === $_REQUEST['feed_name'] ||
792
+ isset( $_REQUEST['feed_name'] ) && 'fts_facebookbiz' === $_REQUEST['feed_name'] ||
793
+ isset( $_REQUEST['feed_name'] ) && 'fts_instagram' === $_REQUEST['feed_name'] ) {
794
+
795
+ $feed_atts = isset( $_REQUEST['feed_attributes'] ) ? array_map( 'sanitize_text_field', wp_unslash( $_REQUEST['feed_attributes'] ) ) : '';
796
+
797
+ $build_shortcode = '[' . sanitize_text_field( wp_unslash( $_REQUEST['feed_name'] ) ) . '';
798
+ foreach ( $feed_atts as $attribute => $value ) {
799
+ $build_shortcode .= ' ' . $attribute . '=' . $value;
800
+ }
801
+
802
+ if ( 'fts_twitter' === $_REQUEST['feed_name'] ) {
803
+ $loadmore_count = isset( $_REQUEST['loadmore_count'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['loadmore_count'] ) ) : '';
804
+ $build_shortcode .= ' ' . $loadmore_count . ']';
805
+ } elseif ( 'fts_youtube' === $_REQUEST['feed_name'] ) {
806
+ $loadmore_count = isset( $_REQUEST['loadmore_count'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['loadmore_count'] ) ) : '';
807
+ $build_shortcode .= ' ' . $loadmore_count . ']';
808
+ } else {
809
+ $build_shortcode .= ' ]';
810
+ }
811
+
812
+ echo do_shortcode( $build_shortcode );
813
+
814
+ } else {
815
+ exit( esc_html( 'That is not an FTS shortcode!' ) );
816
+ }
817
+ }
818
+ die();
819
+ }
820
+
821
+ /**
822
+ * FTS Clear Cache Script
823
+ *
824
+ * This is for the fts_clear_cache_ajax submission.
825
+ *
826
+ * @since 1.9.6
827
+ */
828
+ public function fts_clear_cache_script ()
829
+ {
830
+
831
+ $fts_admin_activation_clear_cache = get_option( 'Feed_Them_Social_Activated_Plugin' );
832
+ $fts_dev_mode_cache = get_option( 'fts_clear_cache_developer_mode' );
833
+ if ( '1' === $fts_dev_mode_cache || 'feed-them-social' === $fts_admin_activation_clear_cache ) {
834
+ wp_enqueue_script( 'fts_clear_cache_script', plugins_url( 'feed-them-social/admin/js/developer-admin.js' ), array('jquery'), FTS_CURRENT_VERSION, false );
835
+ wp_localize_script( 'fts_clear_cache_script', 'ftsAjax', array('ajaxurl' => admin_url( 'admin-ajax.php' )) );
836
+ wp_enqueue_script( 'jquery' );
837
+ wp_enqueue_script( 'fts_clear_cache_script' );
838
+ }
839
+ if ( 'hide-admin-bar-menu' !== $fts_dev_mode_cache && '1' !== $fts_dev_mode_cache ) {
840
+ wp_enqueue_script( 'jquery' );
841
+ wp_enqueue_script( 'fts_clear_cache_script', plugins_url( 'feed-them-social/admin/js/admin.js' ), array(), FTS_CURRENT_VERSION, false );
842
+ wp_enqueue_script( 'fts_clear_cache_script', plugins_url( 'feed-them-social/admin/js/developer-admin.js' ), array('jquery'), FTS_CURRENT_VERSION, false );
843
+ wp_localize_script( 'fts_clear_cache_script', 'ftsAjax', array('ajaxurl' => admin_url( 'admin-ajax.php' )) );
844
+ wp_enqueue_script( 'fts_clear_cache_script' );
845
+ }
846
+
847
+ // we delete this option if found so we only empty the cache once when the plugin is ever activated or updated!
848
+ delete_option( 'Feed_Them_Social_Activated_Plugin' );
849
+ }
850
+
851
+ /**
852
+ * Feed Them Main Menu
853
+ *
854
+ * Admin Submenu buttons // Add the word Settings in place of the default menu page name 'Feed Them'.
855
+ *
856
+ * @since 1.9.6
857
+ */
858
+ public function feed_them_main_menu ()
859
+ {
860
+ // Main Settings Page!
861
+ $main_settings_page = new FTS_Settings_Page();
862
+ add_menu_page( 'Feed Them Social', 'Feed Them', 'manage_options', 'feed-them-settings-page', array($main_settings_page, 'feed_them_settings_page'), '' );
863
+ add_submenu_page( 'feed-them-settings-page', esc_html( 'Settings', 'feed-them-social' ), esc_html( 'Settings', 'feed-them-social' ), 'manage_options', 'feed-them-settings-page' );
864
+ }
865
+
866
+ /**
867
+ * Feed Them Submenu Pages
868
+ *
869
+ * @since 1.9.6
870
+ */
871
+ public function feed_them_submenu_pages ()
872
+ {
873
+
874
+ // Facebook Options Page!
875
+ $facebook_options_page = new FTS_Facebook_Options_Page();
876
+ add_submenu_page(
877
+ 'feed-them-settings-page',
878
+ esc_html( 'Facebook Options', 'feed-them-social' ),
879
+ esc_html( 'Facebook Options', 'feed-them-social' ),
880
+ 'manage_options',
881
+ 'fts-facebook-feed-styles-submenu-page',
882
+ array($facebook_options_page, 'feed_them_facebook_options_page')
883
+ );
884
+ // Instagram Options Page!
885
+ $instagram_options_page = new FTS_Instagram_Options_Page();
886
+ add_submenu_page(
887
+ 'feed-them-settings-page',
888
+ esc_html( 'Instagram Options', 'feed-them-social' ),
889
+ esc_html( 'Instagram Options', 'feed-them-social' ),
890
+ 'manage_options',
891
+ 'fts-instagram-feed-styles-submenu-page',
892
+ array($instagram_options_page, 'feed_them_instagram_options_page')
893
+ );
894
+ // Twitter Options Page!
895
+ $twitter_options_page = new FTS_Twitter_Options_Page();
896
+ add_submenu_page(
897
+ 'feed-them-settings-page',
898
+ esc_html( 'Twitter Options', 'feed-them-social' ),
899
+ esc_html( 'Twitter Options', 'feed-them-social' ),
900
+ 'manage_options',
901
+ 'fts-twitter-feed-styles-submenu-page',
902
+ array($twitter_options_page, 'feed_them_twitter_options_page')
903
+ );
904
+ // Pinterest Options Page!
905
+ $pinterest_options_page = new FTS_Pinterest_Options_Page();
906
+ add_submenu_page(
907
+ 'feed-them-settings-page',
908
+ esc_html( 'Pinterest Options', 'feed-them-social' ),
909
+ esc_html( 'Pinterest Options', 'feed-them-social' ),
910
+ 'manage_options',
911
+ 'fts-pinterest-feed-styles-submenu-page',
912
+ array($pinterest_options_page, 'feed_them_pinterest_options_page')
913
+ );
914
+ // Youtube Options Page!
915
+ $youtube_options_page = new FTS_Youtube_Options_Page();
916
+ add_submenu_page(
917
+ 'feed-them-settings-page',
918
+ esc_html( 'YouTube Options', 'feed-them-social' ),
919
+ esc_html( 'YouTube Options', 'feed-them-social' ),
920
+ 'manage_options',
921
+ 'fts-youtube-feed-styles-submenu-page',
922
+ array($youtube_options_page, 'feed_them_youtube_options_page')
923
+ );
924
+ // System Info!
925
+ $system_info_page = new FTS_System_Info_Page();
926
+ add_submenu_page(
927
+ 'feed-them-settings-page',
928
+ esc_html( 'System Info', 'feed-them-social' ),
929
+ esc_html( 'System Info', 'feed-them-social' ),
930
+ 'manage_options',
931
+ 'fts-system-info-submenu-page',
932
+ array($system_info_page, 'feed_them_system_info_page')
933
+ );
934
+ }
935
+
936
+ /**
937
+ * Feed Them Admin CSS
938
+ *
939
+ * Admin CSS.
940
+ *
941
+ * @since 1.9.6
942
+ */
943
+ public function feed_them_admin_css ()
944
+ {
945
+ wp_register_style( 'feed_them_admin', plugins_url( 'admin/css/admin.css', dirname( __FILE__ ) ), array(), FTS_CURRENT_VERSION );
946
+ wp_enqueue_style( 'feed_them_admin' );
947
+ }
948
+
949
+ /**
950
+ * Feed Them System Info CSS
951
+ *
952
+ * Admin System Info CSS.
953
+ *
954
+ * @since 1.9.6
955
+ */
956
+ public function feed_them_system_info_css ()
957
+ {
958
+ wp_register_style( 'fts-settings-admin-css', plugins_url( 'admin/css/admin-settings.css', dirname( __FILE__ ) ), array(), FTS_CURRENT_VERSION );
959
+ wp_enqueue_style( 'fts-settings-admin-css' );
960
+ }
961
+
962
+ /**
963
+ * Feed Them Settings
964
+ *
965
+ * Admin Settings Scripts and CSS.
966
+ *
967
+ * @since 1.9.6
968
+ */
969
+ public function feed_them_settings ()
970
+ {
971
+ $fts_functions_load_settings_nonce = wp_create_nonce( 'fts-functions-load-settings-nonce' );
972
+
973
+ if ( wp_verify_nonce( $fts_functions_load_settings_nonce, 'fts-functions-load-settings-nonce' ) ) {
974
+ wp_register_style( 'feed_them_settings_css', plugins_url( 'admin/css/settings-page.css', dirname( __FILE__ ) ), array(), FTS_CURRENT_VERSION, false );
975
+ wp_enqueue_style( 'feed_them_settings_css' );
976
+ if ( isset( $_GET['page'] ) && 'fts-youtube-feed-styles-submenu-page' === $_GET['page'] || isset( $_GET['page'] ) && 'fts-instagram-feed-styles-submenu-page' === $_GET['page'] || isset( $_GET['page'] ) && 'fts-facebook-feed-styles-submenu-page' === $_GET['page'] || isset( $_GET['page'] ) && 'fts-twitter-feed-styles-submenu-page' === $_GET['page'] || isset( $_GET['page'] ) && 'feed-them-settings-page' === $_GET['page'] || isset( $_GET['page'] ) && 'fts-pinterest-feed-styles-submenu-page' === $_GET['page'] ) {
977
+ wp_enqueue_script( 'feed_them_style_options_color_js', plugins_url( 'admin/js/jscolor/jscolor.js', dirname( __FILE__ ) ), array(), FTS_CURRENT_VERSION, false );
978
+ }
979
+ }
980
+ }
981
+
982
+ /**
983
+ * Need FTS Premium Fields
984
+ *
985
+ * Admin Premium Settings Fields.
986
+ *
987
+ * @param array $fields settings fields to display premium notice for.
988
+ * @since 1.9.6
989
+ */
990
+ public function need_fts_premium_fields ($fields)
991
+ {
992
+ foreach ( $fields as $key => $label ) {
993
+ $output = '<div class="feed-them-social-admin-input-wrap">';
994
+ $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( $label ) . '</div>';
995
+ $output .= '<div class="feed-them-social-admin-input-default">';
996
+ $output .= sprintf(
997
+ esc_html( 'Must have %1$sPremium Extension%3$s to edit.', 'feed-them-social' ),
998
+ '<a href="' . esc_url( 'https://www.slickremix.com/downloads/feed-them-social-premium-extension/' ) . '" target="_blank">',
999
+ '</a>'
1000
+ );
1001
+ $output .= '</div>';
1002
+ $output .= '<div class="fts-clear"></div>';
1003
+ $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
1004
+ }//END Foreach
1005
+
1006
+ return $output;
1007
+ }
1008
+
1009
+
1010
+ /**
1011
+ * Register Settings
1012
+ *
1013
+ * Generic Register Settings function.
1014
+ *
1015
+ * @param string $settings_name settings name.
1016
+ * @param array $settings settings parameters.
1017
+ * @since
1018
+ */
1019
+ public function register_settings ($settings_name, $settings)
1020
+ {
1021
+ foreach ( $settings as $key => $setting ) {
1022
+ register_setting( $settings_name, $setting );
1023
+ }
1024
+ }
1025
+
1026
+ /**
1027
+ * FTS Facebook Style Options Page
1028
+ *
1029
+ * Register Facebook Style Options.
1030
+ *
1031
+ * @since 1.9.6
1032
+ */
1033
+ public function fts_facebook_style_options_page ()
1034
+ {
1035
+ $fb_style_options = array(
1036
+ 'fb_like_btn_color',
1037
+ 'fb_language',
1038
+ 'fb_show_follow_btn',
1039
+ 'fb_show_follow_like_box_cover',
1040
+ 'fb_show_follow_btn_where',
1041
+ 'fb_header_extra_text_color',
1042
+ 'fb_text_color',
1043
+ 'fb_link_color',
1044
+ 'fb_link_color_hover',
1045
+ 'fb_feed_width',
1046
+ 'fb_feed_margin',
1047
+ 'fb_feed_padding',
1048
+ 'fb_feed_background_color',
1049
+ 'fb_post_background_color',
1050
+ 'fb_grid_border_bottom_color',
1051
+ 'fb_grid_posts_background_color',
1052
+ 'fb_border_bottom_color',
1053
+ 'fts_facebook_custom_api_token',
1054
+ 'fb_event_title_color',
1055
+ 'fb_event_title_size',
1056
+ 'fb_event_maplink_color',
1057
+ 'fb_events_title_color',
1058
+ 'fb_events_title_size',
1059
+ 'fb_events_map_link_color',
1060
+ 'fb_hide_shared_by_etc_text',
1061
+ 'fts_facebook_custom_api_token_biz',
1062
+ 'fb_reviews_text_color',
1063
+ 'fb_reviews_backg_color',
1064
+ 'fb_reviews_star_language',
1065
+ 'fb_reviews_recommended_language',
1066
+ 'fb_reviews_see_more_reviews_language',
1067
+ 'fb_reviews_see_more_reviews_language',
1068
+ 'fb_reviews_overall_rating_background_border_hide',
1069
+ 'fb_reviews_overall_rating_background_color',
1070
+ 'fb_reviews_overall_rating_border_color',
1071
+ 'fb_reviews_overall_rating_text_color',
1072
+ 'fb_reviews_overall_rating_background_padding',
1073
+ 'fb_reviews_remove_see_reviews_link',
1074
+ 'fb_reviews_overall_rating_of_5_stars_text',
1075
+ 'fb_reviews_overall_rating_reviews_text',
1076
+ 'fb_max_image_width',
1077
+ 'fb_hide_images_in_posts',
1078
+ 'fb_hide_error_handler_message',
1079
+ 'fb_count_offset',
1080
+ 'fb_hide_no_posts_message',
1081
+ 'fts_facebook_custom_api_token_user_id',
1082
+ 'fts_facebook_custom_api_token_user_name',
1083
+ 'fts_facebook_custom_api_token_user_id_biz',
1084
+ 'fts_facebook_custom_api_token_user_name_biz',
1085
+ 'fb_loadmore_background_color',
1086
+ 'fb_loadmore_text_color',
1087
+ 'fb_load_more_text',
1088
+ 'fb_no_more_posts_text',
1089
+ 'fb_no_more_photos_text',
1090
+ 'fb_no_more_videos_text',
1091
+ 'fb_no_more_reviews_text',
1092
+ 'fb_text_size',
1093
  'fb_view_on_fb_fts',
1094
+ );
1095
+ $this->register_settings( 'fts-facebook-feed-style-options', $fb_style_options );
1096
+ }
1097
+
1098
+ /**
1099
+ * FTS Twitter Style Options Page
1100
+ *
1101
+ * Register Twitter Style Options.
1102
+ *
1103
+ * @since 1.9.6
1104
+ */
1105
+ public function fts_twitter_style_options_page ()
1106
+ {
1107
+ $twitter_style_options = array(
1108
+ 'twitter_show_follow_btn',
1109
+ 'twitter_show_follow_count',
1110
+ 'twitter_show_follow_btn_where',
1111
+ 'twitter_allow_videos',
1112
+ 'twitter_allow_shortlink_conversion',
1113
+ 'twitter_full_width',
1114
+ 'twitter_text_color',
1115
+ 'twitter_link_color',
1116
+ 'twitter_link_color_hover',
1117
+ 'twitter_feed_width',
1118
+ 'twitter_feed_margin',
1119
+ 'twitter_feed_padding',
1120
+ 'twitter_feed_background_color',
1121
+ 'twitter_border_bottom_color',
1122
+ 'twitter_grid_posts_background_color',
1123
+ 'twitter_grid_border_bottom_color',
1124
+ 'fts_twitter_custom_consumer_key',
1125
+ 'fts_twitter_custom_consumer_secret',
1126
+ 'fts_twitter_custom_access_token',
1127
+ 'fts_twitter_custom_access_token_secret',
1128
+ 'fts_twitter_hide_images_in_posts',
1129
+ 'twitter_max_image_width',
1130
+ 'twitter_loadmore_background_color',
1131
+ 'twitter_loadmore_text_color',
1132
+ 'twitter_load_more_text',
1133
+ 'twitter_no_more_tweets_text',
1134
+ 'twitter_text_size',
1135
+ 'twitter_load_more_text',
1136
+ 'fts_twitter_custom_tokens',
1137
+ );
1138
+ $this->register_settings( 'fts-twitter-feed-style-options', $twitter_style_options );
1139
+ }
1140
+
1141
+ /**
1142
+ * FTS Instagram Style Options Page
1143
+ *
1144
+ * Register Instagram Options.
1145
+ *
1146
+ * @since 1.9.6
1147
+ */
1148
+ public function fts_instagram_style_options_page ()
1149
+ {
1150
+ $instagram_style_options = array(
1151
+ 'fts_instagram_custom_api_token',
1152
+ 'fts_instagram_custom_id',
1153
+ 'instagram_show_follow_btn',
1154
+ 'instagram_show_follow_btn_where',
1155
+ 'instagram_loadmore_background_color',
1156
+ 'instagram_loadmore_text_color',
1157
+ 'instagram_load_more_text',
1158
+ 'instagram_no_more_photos_text',
1159
+ );
1160
+ $this->register_settings( 'fts-instagram-feed-style-options', $instagram_style_options );
1161
+ }
1162
+
1163
+ /**
1164
+ * FTS Pinterest Style Options Page
1165
+ *
1166
+ * Register Pinterest Options.
1167
+ *
1168
+ * @since 1.9.6
1169
+ */
1170
+ public function fts_pinterest_style_options_page ()
1171
+ {
1172
+ $pinterest_style_options = array(
1173
+ 'fts_pinterest_custom_api_token',
1174
+ 'pinterest_show_follow_btn',
1175
+ 'pinterest_show_follow_btn_where',
1176
+ 'pinterest_board_title_color',
1177
+ 'pinterest_board_title_size',
1178
+ 'pinterest_board_backg_hover_color',
1179
+ );
1180
+ $this->register_settings( 'fts-pinterest-feed-style-options', $pinterest_style_options );
1181
+ }
1182
+
1183
+ /**
1184
+ * FTS Youtube Style Options Page
1185
+ *
1186
+ * Register YouTube Options.
1187
+ *
1188
+ * @since 1.9.6
1189
+ */
1190
+ public function fts_youtube_style_options_page ()
1191
+ {
1192
+ $youtube_style_options = array(
1193
+ 'youtube_show_follow_btn',
1194
+ 'youtube_show_follow_btn_where',
1195
+ 'youtube_custom_api_token',
1196
+ 'youtube_loadmore_background_color',
1197
+ 'youtube_loadmore_text_color',
1198
+ 'youtube_load_more_text',
1199
+ 'youtube_no_more_videos_text',
1200
+ 'youtube_custom_refresh_token',
1201
+ 'youtube_custom_access_token',
1202
+ 'youtube_custom_token_exp_time',
1203
+ );
1204
+ $this->register_settings( 'fts-youtube-feed-style-options', $youtube_style_options );
1205
+ }
1206
+
1207
+ /**
1208
+ * FTS Settings Page Register Settings
1209
+ *
1210
+ * Register Free Version Settings.
1211
+ *
1212
+ * @since 1.9.6
1213
+ */
1214
+ public function fts_settings_page_register_settings ()
1215
+ {
1216
+ $settings = array(
1217
+ 'fts_admin_bar_menu',
1218
+ 'fts_clear_cache_developer_mode',
1219
+ 'fts-date-and-time-format',
1220
+ 'fts-timezone',
1221
+ 'fts_fix_magnific',
1222
+ 'fts-color-options-settings-custom-css',
1223
+ 'fts-color-options-main-wrapper-css-input',
1224
+ 'fts-powered-text-options-settings',
1225
+ 'fts-slicker-instagram-icon-center',
1226
+ 'fts-slicker-instagram-container-image-size',
1227
+ 'fts-slicker-instagram-container-hide-date-likes-comments',
1228
+ 'fts-slicker-instagram-container-position',
1229
+ 'fts-slicker-instagram-container-animation',
1230
+ 'fts-slicker-instagram-container-margin',
1231
+ 'fts_fix_loadmore',
1232
+ 'fts_curl_option',
1233
+ 'fts-custom-date',
1234
+ 'fts-custom-time',
1235
+ 'fts_twitter_time_offset',
1236
+ 'fts_language_second',
1237
+ 'fts_language_seconds',
1238
+ 'fts_language_minute',
1239
+ 'fts_language_minutes',
1240
+ 'fts_language_hour',
1241
+ 'fts_language_hours',
1242
+ 'fts_language_day',
1243
+ 'fts_language_days',
1244
+ 'fts_language_week',
1245
+ 'fts_language_weeks',
1246
+ 'fts_language_month',
1247
+ 'fts_language_months',
1248
+ 'fts_language_year',
1249
+ 'fts_language_years',
1250
+ 'fts_language_ago',
1251
+ 'fts_disable_share_button',
1252
+ 'fts_social_icons_color',
1253
+ 'fts_social_icons_hover_color',
1254
+ 'fts_social_icons_back_color',
1255
+ 'fts_slick_rating_notice_waiting',
1256
+ 'fts_slick_rating_notice',
1257
+ 'fts_slick_ignore_rating_notice_nag',
1258
+ );
1259
+ $this->register_settings( 'feed-them-social-settings', $settings );
1260
+ }
1261
+
1262
+ /**
1263
+ * Social Follow Buttons
1264
+ *
1265
+ * @param string $feed feed type.
1266
+ * @param string $user_id user id.
1267
+ * @param null $access_token access token.
1268
+ * @param null $fb_shortcode shortcode attribute.
1269
+ * @since 1.9.6
1270
+ */
1271
+ public function social_follow_button ($feed, $user_id, $access_token = null, $fb_shortcode = null)
1272
+ {
1273
+ $fts_social_follow_nonce = wp_create_nonce( 'fts-social-follow-nonce' );
1274
+
1275
+ if ( wp_verify_nonce( $fts_social_follow_nonce, 'fts-social-follow-nonce' ) ) {
1276
+
1277
+ global $channel_id, $playlist_id, $username_subscribe_btn, $username;
1278
+ switch ($feed) {
1279
+ case 'facebook':
1280
+ // Facebook settings options for follow button!
1281
+ $fb_show_follow_btn = get_option( 'fb_show_follow_btn' );
1282
+ $fb_show_follow_like_box_cover = get_option( 'fb_show_follow_like_box_cover' );
1283
+ $language_option_check = get_option( 'fb_language' );
1284
+
1285
+ if ( isset( $language_option_check ) && 'Please Select Option' !== $language_option_check ) {
1286
+ $language_option = get_option( 'fb_language', 'en_US' );
1287
+ } else {
1288
+ $language_option = 'en_US';
1289
+ }
1290
+ $fb_like_btn_color = get_option( 'fb_like_btn_color', 'light' );
1291
+ $show_faces = 'like-button-share-faces' === $fb_show_follow_btn || 'like-button-faces' === $fb_show_follow_btn || 'like-box-faces' === $fb_show_follow_btn ? 'true' : 'false';
1292
+ $share_button = 'like-button-share-faces' === $fb_show_follow_btn || 'like-button-share' === $fb_show_follow_btn ? 'true' : 'false';
1293
+ $page_cover = 'fb_like_box_cover-yes' === $fb_show_follow_like_box_cover ? 'true' : 'false';
1294
+ if ( !isset( $_POST['fts_facebook_script_loaded'] ) ) {
1295
+ echo '<div id="fb-root"></div>
1296
  <script>jQuery(".fb-page").hide(); (function(d, s, id) {
1297
  var js, fjs = d.getElementsByTagName(s)[0];
1298
  if (d.getElementById(id)) return;
1300
  js.src = "//connect.facebook.net/' . esc_html( $language_option ) . '/sdk.js#xfbml=1&appId=&version=v3.1";
1301
  fjs.parentNode.insertBefore(js, fjs);
1302
  }(document, "script", "facebook-jssd"));</script>';
1303
+ $_POST['fts_facebook_script_loaded'] = 'yes';
1304
+ }
1305
+
1306
+ // Page Box!
1307
+ if ( 'like-box' === $fb_show_follow_btn || 'like-box-faces' === $fb_show_follow_btn ) {
1308
+
1309
+ $like_box_width = isset( $fb_shortcode['like_box_width'] ) && '' !== $fb_shortcode['like_box_width'] ? $fb_shortcode['like_box_width'] : '500px';
1310
+
1311
+ echo '<div class="fb-page" data-href="' . esc_url( 'https://www.facebook.com/' . $user_id ) . '" data-hide-cover="' . esc_html( $page_cover ) . '" data-width="' . esc_html( $like_box_width ) . '" data-show-facepile="' . esc_html( $show_faces ) . '" data-show-posts="false"></div>';
1312
+ } else {
1313
+ echo '<div class="fb-like" data-href="' . esc_url( 'https://www.facebook.com/' . $user_id ) . '" data-layout="standard" data-action="like" data-colorscheme="' . esc_html( $fb_like_btn_color ) . '" data-show-faces="' . esc_html( $show_faces ) . '" data-share="' . esc_html( $share_button ) . '" data-width:"100%"></div>';
1314
+ }
1315
+ break;
1316
+ case 'instagram':
1317
+ echo '<a href="' . esc_url( 'https://instagram.com/' . $user_id . '/' ) . '" target="_blank">' . esc_html( 'Follow on Instagram', 'feed-them-social' ) . '</a>';
1318
+ break;
1319
+ case 'twitter':
1320
+ if ( !isset( $_POST['fts_twitter_script_loaded'] ) ) {
1321
+ echo "<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>";
1322
+ $_POST['fts_twitter_script_loaded'] = 'yes';
1323
+ }
1324
+ // CAN't ESCAPE Twitter link because then JS doesn't work!
1325
+ echo '<a class="twitter-follow-button" href="' . ' https://twitter.com/' . $user_id . ' " data-show-count="false" data-lang="en"> Follow @' . esc_html( $user_id ) . '</a>';
1326
+ break;
1327
+ case 'pinterest':
1328
+ if ( !isset( $_POST['fts_pinterest_script_loaded'] ) ) {
1329
+ echo '<script>jQuery(function () {jQuery.getScript("//assets.pinterest.com/js/pinit.js");});</script>';
1330
+ $_POST['fts_pinterest_script_loaded'] = 'yes';
1331
+ }
1332
+ // we return this one until we echo out the pinterest feed instead of $output.=.
1333
+ return '<a data-pin-do="buttonFollow" href="https://www.pinterest.com/' . esc_html( $user_id ) . '/">' . esc_html( $user_id ) . '</a>';
1334
+ break;
1335
+ case 'youtube':
1336
+ if ( !isset( $_POST['fts_youtube_script_loaded'] ) ) {
1337
+ echo '<script src="' . esc_url( 'https://apis.google.com/js/platform.js' ) . '"></script>';
1338
+ $_POST['fts_youtube_script_loaded'] = 'yes';
1339
+ }
1340
+ if ( '' === $channel_id && '' === $playlist_id && '' !== $username || '' !== $playlist_id && '' !== $username_subscribe_btn ) {
1341
+
1342
+ if ( '' !== $username_subscribe_btn ) {
1343
+ echo '<div class="g-ytsubscribe" data-channel="' . esc_html( $username_subscribe_btn ) . '" data-layout="full" data-count="default"></div>';
1344
+ } else {
1345
+ echo '<div class="g-ytsubscribe" data-channel="' . esc_html( $user_id ) . '" data-layout="full" data-count="default"></div>';
1346
+ }
1347
+ } elseif ( '' !== $channel_id && '' !== $playlist_id || '' !== $channel_id ) {
1348
+ echo '<div class="g-ytsubscribe" data-channelid="' . esc_html( $channel_id ) . '" data-layout="full" data-count="default"></div>';
1349
+ }
1350
+ break;
1351
+ }
1352
+ }
1353
+ }
1354
+
1355
+ /**
1356
+ * FTS Color Options Head CSS
1357
+ *
1358
+ * @since 1.9.6
1359
+ */
1360
+ public function fts_color_options_head_css ()
1361
+ {
1362
+ ?>
1363
+ <style type="text/css"><?php echo get_option( 'fts-color-options-main-wrapper-css-input' ); ?></style>
1364
+ <?php
1365
+ }
1366
+
1367
+ /**
1368
+ * FTS FB Color Options Head CSS
1369
+ *
1370
+ * Color Options CSS for Facebook.
1371
+ *
1372
+ * @since 1.9.6
1373
+ */
1374
+ public function fts_fb_color_options_head_css ()
1375
+ {
1376
+ $fb_hide_no_posts_message = get_option( 'fb_hide_no_posts_message' );
1377
+ $fb_header_extra_text_color = get_option( 'fb_header_extra_text_color' );
1378
+ $fb_text_color = get_option( 'fb_text_color' );
1379
+ $fb_link_color = get_option( 'fb_link_color' );
1380
+ $fb_link_color_hover = get_option( 'fb_link_color_hover' );
1381
+ $fb_feed_width = get_option( 'fb_feed_width' );
1382
+ $fb_feed_margin = get_option( 'fb_feed_margin' );
1383
+ $fb_feed_padding = get_option( 'fb_feed_padding' );
1384
+ $fb_feed_background_color = get_option( 'fb_feed_background_color' );
1385
+ $fb_post_background_color = get_option( 'fb_post_background_color' );
1386
+ $fb_grid_posts_background_color = get_option( 'fb_grid_posts_background_color' );
1387
+ $fb_grid_border_bottom_color = get_option( 'fb_grid_border_bottom_color' );
1388
+ $fb_loadmore_background_color = get_option( 'fb_loadmore_background_color' );
1389
+ $fb_loadmore_text_color = get_option( 'fb_loadmore_text_color' );
1390
+ $fb_border_bottom_color = get_option( 'fb_border_bottom_color' );
1391
+ $fb_grid_posts_background_color = get_option( 'fb_grid_posts_background_color' );
1392
+ $fb_reviews_backg_color = get_option( 'fb_reviews_backg_color' );
1393
+ $fb_reviews_text_color = get_option( 'fb_reviews_text_color' );
1394
+
1395
+ $fb_reviews_overall_rating_background_color = get_option( 'fb_reviews_overall_rating_background_color' );
1396
+ $fb_reviews_overall_rating_border_color = get_option( 'fb_reviews_overall_rating_border_color' );
1397
+ $fb_reviews_overall_rating_text_color = get_option( 'fb_reviews_overall_rating_text_color' );
1398
+ $fb_reviews_overall_rating_background_padding = get_option( 'fb_reviews_overall_rating_background_padding' );
1399
+
1400
+ $fb_max_image_width = get_option( 'fb_max_image_width' );
1401
+
1402
+ $fb_events_title_color = get_option( 'fb_events_title_color' );
1403
+ $fb_events_title_size = get_option( 'fb_events_title_size' );
1404
+ $fb_events_maplink_color = get_option( 'fb_events_map_link_color' );
1405
+
1406
+ $twitter_hide_profile_photo = get_option( 'twitter_hide_profile_photo' );
1407
+ $twitter_text_color = get_option( 'twitter_text_color' );
1408
+ $twitter_link_color = get_option( 'twitter_link_color' );
1409
+ $twitter_link_color_hover = get_option( 'twitter_link_color_hover' );
1410
+ $twitter_feed_width = get_option( 'twitter_feed_width' );
1411
+ $twitter_feed_margin = get_option( 'twitter_feed_margin' );
1412
+ $twitter_feed_padding = get_option( 'twitter_feed_padding' );
1413
+ $twitter_feed_background_color = get_option( 'twitter_feed_background_color' );
1414
+ $twitter_border_bottom_color = get_option( 'twitter_border_bottom_color' );
1415
+ $twitter_max_image_width = get_option( 'twitter_max_image_width' );
1416
+ $twitter_grid_border_bottom_color = get_option( 'twitter_grid_border_bottom_color' );
1417
+ $twitter_grid_posts_background_color = get_option( 'twitter_grid_posts_background_color' );
1418
+ $twitter_loadmore_background_color = get_option( 'twitter_loadmore_background_color' );
1419
+ $twitter_loadmore_text_color = get_option( 'twitter_loadmore_text_color' );
1420
+
1421
+ $instagram_loadmore_background_color = get_option( 'instagram_loadmore_background_color' );
1422
+ $instagram_loadmore_text_color = get_option( 'instagram_loadmore_text_color' );
1423
+
1424
+ $pinterest_board_title_color = get_option( 'pinterest_board_title_color' );
1425
+ $pinterest_board_title_size = get_option( 'pinterest_board_title_size' );
1426
+ $pinterest_board_backg_hover_color = get_option( 'pinterest_board_backg_hover_color' );
1427
+
1428
+ $fts_social_icons_color = get_option( 'fts_social_icons_color' );
1429
+ $fts_social_icons_hover_color = get_option( 'fts_social_icons_hover_color' );
1430
+ $fts_social_icons_back_color = get_option( 'fts_social_icons_back_color' );
1431
+
1432
+ $youtube_loadmore_background_color = get_option( 'youtube_loadmore_background_color' );
1433
+ $youtube_loadmore_text_color = get_option( 'youtube_loadmore_text_color' );
1434
+
1435
+ $fb_text_size = get_option( 'fb_text_size' );
1436
+ $twitter_text_size = get_option( 'twitter_text_size' );
1437
+ ?>
1438
+ <style type="text/css"><?php if ( ! empty( $fb_header_extra_text_color ) ) { ?>
1439
+
1440
+ <?php }if ( ! empty( $fb_hide_no_posts_message ) && 'yes' === $fb_hide_no_posts_message ) { ?>
1441
+ .fts-facebook-add-more-posts-notice {
1442
+ display: none !important;
1443
+ }
1444
+
1445
+ .fts-jal-single-fb-post .fts-jal-fb-user-name {
1446
+ color: <?php echo esc_html( $fb_header_extra_text_color ); ?> !important;
1447
+ }
1448
+
1449
+ <?php }if ( ! empty( $fb_loadmore_background_color ) ) { ?>
1450
+ .fts-fb-load-more-wrapper .fts-fb-load-more {
1451
+ background: <?php echo esc_html( $fb_loadmore_background_color ); ?> !important;
1452
+ }
1453
+
1454
+ <?php }if ( ! empty( $fb_loadmore_text_color ) ) { ?>
1455
+ .fts-fb-load-more-wrapper .fts-fb-load-more {
1456
+ color: <?php echo esc_html( $fb_loadmore_text_color ); ?> !important;
1457
+ }
1458
+
1459
+ <?php }if ( ! empty( $fb_loadmore_text_color ) ) { ?>
1460
+ .fts-fb-load-more-wrapper .fts-fb-spinner > div {
1461
+ background: <?php echo esc_html( $fb_loadmore_text_color ); ?> !important;
1462
+ }
1463
+
1464
+ <?php }if ( ! empty( $fb_text_color ) ) { ?>
1465
+ .fts-simple-fb-wrapper .fts-jal-single-fb-post,
1466
+ .fts-simple-fb-wrapper .fts-jal-fb-description-wrap,
1467
+ .fts-simple-fb-wrapper .fts-jal-fb-post-time,
1468
+ .fts-slicker-facebook-posts .fts-jal-single-fb-post,
1469
+ .fts-slicker-facebook-posts .fts-jal-fb-description-wrap,
1470
+ .fts-slicker-facebook-posts .fts-jal-fb-post-time {
1471
+ color: <?php echo esc_html( $fb_text_color ); ?> !important;
1472
+ }
1473
+
1474
+ <?php }if ( ! empty( $fb_link_color ) ) { ?>
1475
+ .fts-simple-fb-wrapper .fts-jal-single-fb-post .fts-review-name,
1476
+ .fts-simple-fb-wrapper .fts-jal-single-fb-post a,
1477
+ .fts-slicker-facebook-posts .fts-jal-single-fb-post a,
1478
+ .fts-jal-fb-group-header-desc a {
1479
+ color: <?php echo esc_html( $fb_link_color ); ?> !important;
1480
+ }
1481
+
1482
+ <?php }if ( ! empty( $fb_link_color_hover ) ) { ?>
1483
+ .fts-simple-fb-wrapper .fts-jal-single-fb-post a:hover,
1484
+ .fts-simple-fb-wrapper .fts-fb-load-more:hover,
1485
+ .fts-slicker-facebook-posts .fts-jal-single-fb-post a:hover,
1486
+ .fts-slicker-facebook-posts .fts-fb-load-more:hover,
1487
+ .fts-jal-fb-group-header-desc a:hover {
1488
+ color: <?php echo esc_html( $fb_link_color_hover ); ?> !important;
1489
+ }
1490
+
1491
+ <?php }if ( ! empty( $fb_feed_width ) ) { ?>
1492
+ .fts-simple-fb-wrapper, .fts-fb-header-wrapper, .fts-fb-load-more-wrapper, .fts-jal-fb-header, .fb-social-btn-top, .fb-social-btn-bottom, .fb-social-btn-below-description {
1493
+ max-width: <?php echo esc_html( $fb_feed_width ); ?> !important;
1494
+ }
1495
+
1496
+ <?php }if ( ! empty( $fb_max_image_width ) ) { ?>
1497
+ .fts-fb-large-photo, .fts-jal-fb-vid-picture, .fts-jal-fb-picture, .fts-fluid-videoWrapper-html5 {
1498
+ max-width: <?php echo esc_html( $fb_max_image_width ); ?> !important;
1499
+ float: left;
1500
+ }
1501
+
1502
+ <?php }if ( ! empty( $fb_events_title_color ) ) { ?>
1503
+ .fts-simple-fb-wrapper .fts-events-list-wrap a.fts-jal-fb-name {
1504
+ color: <?php echo esc_html( $fb_events_title_color ); ?> !important;
1505
+ }
1506
+
1507
+ <?php }if ( ! empty( $fb_events_title_size ) ) { ?>
1508
+ .fts-simple-fb-wrapper .fts-events-list-wrap a.fts-jal-fb-name {
1509
+ font-size: <?php echo esc_html( $fb_events_title_size ); ?> !important;
1510
+ line-height: <?php echo esc_html( $fb_events_title_size ); ?> !important;
1511
+ }
1512
+
1513
+ <?php }if ( ! empty( $fb_events_maplink_color ) ) { ?>
1514
+ .fts-simple-fb-wrapper a.fts-fb-get-directions {
1515
+ color: <?php echo esc_html( $fb_events_maplink_color ); ?> !important;
1516
+ }
1517
+
1518
+ <?php }if ( ! empty( $fb_feed_margin ) ) { ?>
1519
+ .fts-simple-fb-wrapper, .fts-fb-header-wrapper, .fts-fb-load-more-wrapper, .fts-jal-fb-header, .fb-social-btn-top, .fb-social-btn-bottom, .fb-social-btn-below-description {
1520
+ margin: <?php echo esc_html( $fb_feed_margin ); ?> !important;
1521
+ }
1522
+
1523
+ <?php }if ( ! empty( $fb_feed_padding ) ) { ?>
1524
+ .fts-simple-fb-wrapper {
1525
+ padding: <?php echo esc_html( $fb_feed_padding ); ?> !important;
1526
+ }
1527
+
1528
+ <?php }if ( ! empty( $fb_feed_background_color ) ) { ?>
1529
+ .fts-simple-fb-wrapper, .fts-fb-load-more-wrapper .fts-fb-load-more {
1530
+ background: <?php echo esc_html( $fb_feed_background_color ); ?> !important;
1531
+ }
1532
+
1533
+ <?php }if ( ! empty( $fb_post_background_color ) ) { ?>
1534
+ .fts-mashup-media-top .fts-jal-single-fb-post {
1535
+ background: <?php echo esc_html( $fb_post_background_color ); ?> !important;
1536
+ }
1537
+
1538
+ <?php }if ( ! empty( $fb_grid_posts_background_color ) ) { ?>
1539
+ .fts-slicker-facebook-posts .fts-jal-single-fb-post {
1540
+ background: <?php echo esc_html( $fb_grid_posts_background_color ); ?> !important;
1541
+ }
1542
+
1543
+ <?php }if ( ! empty( $fb_border_bottom_color ) ) { ?>
1544
+ .fts-jal-single-fb-post {
1545
+ border-bottom-color: <?php echo esc_html( $fb_border_bottom_color ); ?> !important;
1546
+ }
1547
+
1548
+ <?php }if ( ! empty( $fb_grid_border_bottom_color ) ) { ?>
1549
+ .fts-slicker-facebook-posts .fts-jal-single-fb-post {
1550
+ border-bottom-color: <?php echo esc_html( $fb_grid_border_bottom_color ); ?> !important;
1551
+ }
1552
+
1553
+ <?php }if ( ! empty( $twitter_grid_posts_background_color ) ) { ?>
1554
+ .fts-slicker-twitter-posts .fts-tweeter-wrap {
1555
+ background: <?php echo esc_html( $twitter_grid_posts_background_color ); ?> !important;
1556
+ }
1557
+
1558
+ <?php }if ( ! empty( $twitter_grid_border_bottom_color ) ) { ?>
1559
+ .fts-slicker-twitter-posts .fts-tweeter-wrap {
1560
+ border-bottom-color: <?php echo esc_html( $twitter_grid_border_bottom_color ); ?> !important;
1561
+ }
1562
+
1563
+ <?php }if ( ! empty( $twitter_loadmore_background_color ) ) { ?>
1564
+ .fts-twitter-load-more-wrapper .fts-fb-load-more {
1565
+ background: <?php echo esc_html( $twitter_loadmore_background_color ); ?> !important;
1566
+ }
1567
+
1568
+ <?php }if ( ! empty( $twitter_loadmore_text_color ) ) { ?>
1569
+ .fts-twitter-load-more-wrapper .fts-fb-load-more {
1570
+ color: <?php echo esc_html( $twitter_loadmore_text_color ); ?> !important;
1571
+ }
1572
+
1573
+ <?php }if ( ! empty( $twitter_loadmore_text_color ) ) { ?>
1574
+ .fts-twitter-load-more-wrapper .fts-fb-spinner > div {
1575
+ background: <?php echo esc_html( $twitter_loadmore_text_color ); ?> !important;
1576
+ }
1577
+
1578
+ <?php }if ( ! empty( $fb_reviews_backg_color ) ) { ?>
1579
+ .fts-review-star {
1580
+ background: <?php echo esc_html( $fb_reviews_backg_color ); ?> !important;
1581
+ }
1582
+
1583
+ <?php }if ( ! empty( $fb_reviews_overall_rating_background_color ) ) { ?>
1584
+ .fts-review-details-master-wrap {
1585
+ background: <?php echo esc_html( $fb_reviews_overall_rating_background_color ); ?> !important;
1586
+ }
1587
+
1588
+ <?php }if ( ! empty( $fb_reviews_overall_rating_border_color ) ) { ?>
1589
+ .fts-review-details-master-wrap {
1590
+ border-bottom-color: <?php echo esc_html( $fb_reviews_overall_rating_border_color ); ?> !important;
1591
+ }
1592
+
1593
+ <?php }if ( ! empty( $fb_reviews_overall_rating_background_padding ) ) { ?>
1594
+ .fts-review-details-master-wrap {
1595
+ padding: <?php echo esc_html( $fb_reviews_overall_rating_background_padding ); ?> !important;
1596
+ }
1597
+
1598
+ <?php }if ( ! empty( $fb_reviews_overall_rating_text_color ) ) { ?>
1599
+ .fts-review-details-master-wrap {
1600
+ color: <?php echo esc_html( $fb_reviews_overall_rating_text_color ); ?> !important;
1601
+ }
1602
+
1603
+ <?php }if ( ! empty( $fb_reviews_text_color ) ) { ?>
1604
+ .fts-review-star {
1605
+ color: <?php echo esc_html( $fb_reviews_text_color ); ?> !important;
1606
+ }
1607
+
1608
+ <?php }if ( ! empty( $twitter_text_color ) ) { ?>
1609
+ .tweeter-info .fts-twitter-text, .fts-twitter-reply-wrap:before, a span.fts-video-loading-notice {
1610
+ color: <?php echo esc_html( $twitter_text_color ); ?> !important;
1611
+ }
1612
+
1613
+ <?php }if ( ! empty( $twitter_link_color ) ) { ?>
1614
+ .tweeter-info .fts-twitter-text a, .tweeter-info .fts-twitter-text .time a, .fts-twitter-reply-wrap a, .tweeter-info a, .twitter-followers-fts a, body.fts-twitter-reply-wrap a {
1615
+ color: <?php echo esc_html( $twitter_link_color ); ?> !important;
1616
+ }
1617
+
1618
+ <?php }if ( ! empty( $twitter_link_color_hover ) ) { ?>
1619
+ .tweeter-info a:hover, .tweeter-info:hover .fts-twitter-reply, body.fts-twitter-reply-wrap a:hover {
1620
+ color: <?php echo esc_html( $twitter_link_color_hover ); ?> !important;
1621
+ }
1622
+
1623
+ <?php }if ( ! empty( $twitter_feed_width ) ) { ?>
1624
+ .fts-twitter-div {
1625
+ max-width: <?php echo esc_html( $twitter_feed_width ); ?> !important;
1626
+ }
1627
+
1628
+ <?php }if ( ! empty( $twitter_feed_margin ) ) { ?>
1629
+ .fts-twitter-div {
1630
+ margin: <?php echo esc_html( $twitter_feed_margin ); ?> !important;
1631
+ }
1632
+
1633
+ <?php }if ( ! empty( $twitter_feed_padding ) ) { ?>
1634
+ .fts-twitter-div {
1635
+ padding: <?php echo esc_html( $twitter_feed_padding ); ?> !important;
1636
+ }
1637
+
1638
+ <?php }if ( ! empty( $twitter_feed_background_color ) ) { ?>
1639
+ .fts-twitter-div {
1640
+ background: <?php echo esc_html( $twitter_feed_background_color ); ?> !important;
1641
+ }
1642
+
1643
+ <?php }if ( ! empty( $twitter_border_bottom_color ) ) { ?>
1644
+ .tweeter-info {
1645
+ border-bottom: 1px solid <?php echo esc_html( $twitter_border_bottom_color ); ?> !important;
1646
+ }
1647
+
1648
+ <?php }if ( ! empty( $twitter_max_image_width ) ) { ?>
1649
+ .fts-twitter-link-image {
1650
+ max-width: <?php echo esc_html( $twitter_max_image_width ); ?> !important;
1651
+ display: block;
1652
+ }
1653
+
1654
+ <?php }if ( ! empty( $instagram_loadmore_background_color ) ) { ?>
1655
+ .fts-instagram-load-more-wrapper .fts-fb-load-more {
1656
+ background: <?php echo esc_html( $instagram_loadmore_background_color ); ?> !important;
1657
+ }
1658
+
1659
+ <?php }if ( ! empty( $instagram_loadmore_text_color ) ) { ?>
1660
+ .fts-instagram-load-more-wrapper .fts-fb-load-more {
1661
+ color: <?php echo esc_html( $instagram_loadmore_text_color ); ?> !important;
1662
+ }
1663
+
1664
+ <?php }if ( ! empty( $instagram_loadmore_text_color ) ) { ?>
1665
+ .fts-instagram-load-more-wrapper .fts-fb-spinner > div {
1666
+ background: <?php echo esc_html( $instagram_loadmore_text_color ); ?> !important;
1667
+ }
1668
+
1669
+ <?php } if ( ! empty( $pinterest_board_backg_hover_color ) ) { ?>
1670
+ a.fts-pin-board-wrap:hover {
1671
+ background: <?php echo esc_html( $pinterest_board_backg_hover_color ); ?> !important;
1672
+ }
1673
+
1674
+ <?php } if ( ! empty( $pinterest_board_title_color ) ) { ?>
1675
+ body h3.fts-pin-board-board_title {
1676
+ color: <?php echo esc_html( $pinterest_board_title_color ); ?> !important;
1677
+ }
1678
+
1679
+ <?php } if ( ! empty( $pinterest_board_title_size ) ) { ?>
1680
+ body h3.fts-pin-board-board_title {
1681
+ font-size: <?php echo esc_html( $pinterest_board_title_size ); ?> !important;
1682
+ }
1683
+
1684
+ <?php
1685
  }
1686
  if ( ! empty( $fts_social_icons_color ) ) {
1687
  ?>
1688
+ .ft-gallery-share-wrap a.ft-galleryfacebook-icon, .ft-gallery-share-wrap a.ft-gallerytwitter-icon, .ft-gallery-share-wrap a.ft-gallerygoogle-icon, .ft-gallery-share-wrap a.ft-gallerylinkedin-icon, .ft-gallery-share-wrap a.ft-galleryemail-icon {
1689
+ color: <?php echo esc_html( $fts_social_icons_color ); ?> !important;
1690
+ }
1691
+
1692
+ <?php
1693
  }
1694
  if ( ! empty( $fts_social_icons_hover_color ) ) {
1695
  ?>
1696
+ .ft-gallery-share-wrap a.ft-galleryfacebook-icon:hover, .ft-gallery-share-wrap a.ft-gallerytwitter-icon:hover, .ft-gallery-share-wrap a.ft-gallerygoogle-icon:hover, .ft-gallery-share-wrap a.ft-gallerylinkedin-icon:hover, .ft-gallery-share-wrap a.ft-galleryemail-icon:hover {
1697
+ color: <?php echo esc_html( $fts_social_icons_hover_color ); ?> !important;
1698
+ }
1699
 
1700
+ <?php
1701
  }
1702
  if ( ! empty( $fts_social_icons_back_color ) ) {
1703
  ?>
1704
+ .ft-gallery-share-wrap {
1705
+ background: <?php echo esc_html( $fts_social_icons_back_color ); ?> !important;
1706
+ }
1707
 
1708
+ <?php
1709
  }
1710
  if ( ! empty( $twitter_text_size ) ) {
1711
  ?>
1712
+ span.fts-twitter-text {
1713
+ font-size: <?php echo esc_html( $twitter_text_size ); ?> !important;
1714
+ }
1715
 
1716
+ <?php
1717
  }
1718
  if ( ! empty( $fb_text_size ) ) {
1719
  ?>
1720
+ .fts-jal-fb-group-display .fts-jal-fb-message, .fts-jal-fb-group-display .fts-jal-fb-message p, .fts-jal-fb-group-header-desc, .fts-jal-fb-group-header-desc p, .fts-jal-fb-group-header-desc a {
1721
+ font-size: <?php echo esc_html( $fb_text_size ); ?> !important;
1722
+ }
1723
 
1724
+ <?php
1725
  }
1726
  if ( ! empty( $youtube_loadmore_background_color ) ) {
1727
  ?>
1728
+ .fts-youtube-load-more-wrapper .fts-fb-load-more {
1729
+ background: <?php echo esc_html( $youtube_loadmore_background_color ); ?> !important;
1730
+ }
1731
+
1732
+ <?php }if ( ! empty( $youtube_loadmore_text_color ) ) { ?>
1733
+ .fts-youtube-load-more-wrapper .fts-fb-load-more {
1734
+ color: <?php echo esc_html( $youtube_loadmore_text_color ); ?> !important;
1735
+ }
1736
+
1737
+ <?php
1738
  }
1739
  if ( ! empty( $youtube_loadmore_text_color ) ) {
1740
  ?>
1741
+ .fts-youtube-load-more-wrapper .fts-fb-spinner > div {
1742
+ background: <?php echo esc_html( $youtube_loadmore_text_color ); ?> !important;
1743
+ }
1744
+
1745
+ <?php } ?>
1746
+
1747
+ </style>
1748
+ <?php
1749
+ }
1750
+
1751
+ /**
1752
+ * FTS Powered By JS
1753
+ *
1754
+ * @since 1.9.6
1755
+ */
1756
+ public function fts_powered_by_js ()
1757
+ {
1758
+ wp_enqueue_script( 'fts_powered_by_js', plugins_url( 'feeds/js/powered-by.js', dirname( __FILE__ ) ), array('jquery'), FTS_CURRENT_VERSION, false );
1759
+ }
1760
+
1761
+ /**
1762
+ * Required Premium Field
1763
+ *
1764
+ * Admin Required Premium Settings Fields.
1765
+ *
1766
+ * @param array $fields_info fields info.
1767
+ * @since 2.0.7
1768
+ */
1769
+ public function need_fts_premium_plugin_field ($fields_info)
1770
+ {
1771
+ $output = '<div class="feed-them-social-admin-input-default">' . wp_kses(
1772
+ $fields_info['no_active_msg'],
1773
+ array(
1774
+ 'a' => array(
1775
+ 'href' => array(),
1776
+ 'title' => array(),
1777
+ 'target' => array(),
1778
+ ),
1779
+ 'br' => array(),
1780
+ 'em' => array(),
1781
+ 'strong' => array(),
1782
+ )
1783
+ ) . '</div>';
1784
+
1785
+ return $output;
1786
+ }
1787
+
1788
+ /**
1789
+ * Settings Form Fields Output
1790
+ *
1791
+ * @param bool $save_options save options.
1792
+ * @param array $feed_settings_array feed settings information.
1793
+ * @param array $required_plugins The plugins that are required for this form.
1794
+ * @since 2.0.8
1795
+ */
1796
+ public function fts_settings_html_form ($save_options = false, $feed_settings_array, $required_plugins)
1797
+ {
1798
+
1799
+ $output = '';
1800
+
1801
+ // Start creation of fields for each Feed!
1802
+ foreach ( $feed_settings_array as $section => $section_info ) {
1803
+ $output .= '<div class="' . esc_attr( $section_info['section_wrap_class'] ) . '">';
1804
+ $output .= '<form class="feed-them-social-admin-form shortcode-generator-form ' . esc_attr( $section_info['form_wrap_classes'] ) . '" id="' . esc_attr( $section_info['form_wrap_id'] ) . '">';
1805
+
1806
+ // Check to see if token is in place otherwise show a message letting person no what they need to do!
1807
+ if ( isset( $section_info['token_check'] ) ) {
1808
+ foreach ( $section_info['token_check'] as $token_key => $token_info ) {
1809
+ if ( !isset( $token_info['req_plugin'] ) || isset( $token_info['req_plugin'] ) && is_plugin_active( $required_plugins[$token_info['req_plugin']]['plugin_url'] ) ) {
1810
+ $token_check = get_option( $token_info['option_name'] ) ? 'Yes' : 'No';
1811
+ $output .= isset( $token_check ) && 'No' !== $token_check ? "\n" : '<div class="feed-them-social-admin-input-wrap fts-required-token-message">' . wp_kses(
1812
+ $token_info['no_token_msg'],
1813
+ array(
1814
+ 'a' => array(
1815
+ 'href' => array(),
1816
+ 'title' => array(),
1817
+ 'target' => array(),
1818
+ ),
1819
+ 'br' => array(),
1820
+ 'em' => array(),
1821
+ 'strong' => array(),
1822
+ 'small' => array(),
1823
+ )
1824
+ ) . '</div>' . "\n";
1825
+ }
1826
+ }
1827
+ }
1828
+ // Section Title!
1829
+ $output .= isset( $section_info['section_title'] ) ? '<h2>' . esc_html( $section_info['section_title'] ) . '</h2>' : '';
1830
+ // Feed Types select!
1831
+ if ( isset( $section_info['feeds_types'] ) ) {
1832
+ $output .= '<div class="feed-them-social-admin-input-wrap ' . esc_attr( $section_info['feed_type_select']['select_wrap_classes'] ) . '">';
1833
+ $output .= '<div class="feed-them-social-admin-input-label">' . wp_kses(
1834
+ $section_info['feed_type_select']['label'],
1835
+ array(
1836
+ 'a' => array(
1837
+ 'href' => array(),
1838
+ 'title' => array(),
1839
+ 'target' => array(),
1840
+ ),
1841
+ 'br' => array(),
1842
+ 'em' => array(),
1843
+ 'strong' => array(),
1844
+ )
1845
+ ) . '</div>';
1846
+ $output .= '<select name="' . esc_attr( $section_info['feed_type_select']['select_name'] ) . '" id="' . esc_attr( $section_info['feed_type_select']['select_id'] ) . '" class="feed-them-social-admin-input ' . esc_attr( $section_info['feed_type_select']['select_classes'] ) . '">';
1847
+ foreach ( $section_info['feeds_types'] as $feed_type_name => $feed_type ) {
1848
+ if ( 'main_options' !== $feed_type_name ) {
1849
+ $output .= '<option value="' . esc_attr( $feed_type['value'] ) . '">' . esc_html( $feed_type['title'] ) . '</option>';
1850
+ }
1851
+ }
1852
+ $output .= '</select>';
1853
+ $output .= '<div class="fts-clear"></div>';
1854
+ $output .= '</div><!--/Feed Types Select Div Wrap-->';
1855
+ }
1856
+
1857
+ // Conversion Input!
1858
+ if ( isset( $section_info['conversion_input'] ) ) {
1859
+ $output .= '<div class="' . esc_attr( $section_info['conversion_input']['main_wrap_class'] ) . '">';
1860
+ $output .= '<h2>' . esc_html( $section_info['conversion_input']['conv_section_title'] ) . '</h2>';
1861
+ $output .= '<div class="feed-them-social-admin-input-wrap ' . esc_attr( $section_info['conversion_input']['input_wrap_class'] ) . '">';
1862
+ // Instructional Text!
1863
+ $output .= '<div class="instructional-text">' . esc_html( $section_info['conversion_input']['instructional-text'] ) . '</div>';
1864
+ $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( $section_info['conversion_input']['label'] ) . '</div>';
1865
+ // Input!
1866
+ $output .= '<input type="input" name="' . esc_attr( $section_info['conversion_input']['name'] ) . '" id="' . esc_attr( $section_info['conversion_input']['id'] ) . '" class="feed-them-social-admin-input ' . (isset( $section_info['conversion_input']['class'] ) ? esc_attr( $section_info['conversion_input']['class'] ) : '') . '" value="" />';
1867
+ $output .= '<div class="fts-clear"></div>';
1868
+ $output .= '</div><!--/Conversion Input Wrap-->';
1869
+
1870
+ $output .= '<input type="button" class="feed-them-social-admin-submit-btn" value="' . esc_attr( $section_info['conversion_input']['btn-value'] ) . '" onclick="' . esc_js( $section_info['conversion_input']['onclick'] ) . '" tabindex="4" style="margin-right:1em;" />';
1871
+ $output .= '</div>';
1872
+
1873
+ }
1874
+
1875
+ $output .= '</form>';
1876
+
1877
+ // Feed Options!
1878
+ $output .= '<form class="feed-them-social-admin-form shortcode-generator-form ' . esc_attr( $section_info['form_wrap_classes'] ) . ' ' . esc_attr( $section ) . '_options_wrap">';
1879
+
1880
+ // Create settings fields for Feed OPTIONS!
1881
+ foreach ( $section_info['main_options'] as $option ) {
1882
+ if ( !isset( $option['no_html'] ) || isset( $option['no_html'] ) && 'yes' !== $option['no_html'] ) {
1883
+
1884
+ // Is a premium extension required?
1885
+ $required_plugin = (!isset( $option['req_plugin'] ) || isset( $option['req_plugin'] ) && is_plugin_active( $required_plugins[$option['req_plugin']]['plugin_url'] ));
1886
+ $or_required_plugin = (isset( $option['or_req_plugin'] ) && is_plugin_active( $required_plugins[$option['or_req_plugin']]['plugin_url'] ));
1887
+ $or_required_plugin_three = (isset( $option['or_req_plugin_three'] ) && is_plugin_active( $required_plugins[$option['or_req_plugin_three']]['plugin_url'] ));
1888
+
1889
+ // Sub option output START?
1890
+ $output .= isset( $option['sub_options'] ) ? '<div class="' . esc_attr( $option['sub_options']['sub_options_wrap_class'] ) . (!$required_plugin ? ' not-active-premium-fields' : '') . '">' . (isset( $option['sub_options']['sub_options_title'] ) ? '<h3>' . esc_html( $option['sub_options']['sub_options_title'] ) . '</h3>' : '') . (isset( $option['sub_options']['sub_options_instructional_txt'] ) ? '<div class="instructional-text">' . esc_html( $option['sub_options']['sub_options_instructional_txt'] ) . '</div>' : '') : '';
1891
+
1892
+ $output .= isset( $option['grouped_options_title'] ) ? '<h3 class="sectioned-options-title">' . esc_html( $option['grouped_options_title'] ) . '</h3>' : '';
1893
+
1894
+ // Only on a few options generally!
1895
+ $output .= isset( $option['outer_wrap_class'] ) || isset( $option['outer_wrap_display'] ) ? '<div ' . (isset( $option['outer_wrap_class'] ) ? 'class="' . esc_attr( $option['outer_wrap_class'] ) . '"' : '') . ' ' . (isset( $option['outer_wrap_display'] ) && !empty( $option['outer_wrap_display'] ) ? 'style="display:' . esc_attr( $option['outer_wrap_display'] ) . '"' : '') . '>' : '';
1896
+ // Main Input Wrap!
1897
+ $output .= '<div class="feed-them-social-admin-input-wrap ' . (isset( $option['input_wrap_class'] ) ? esc_attr( $option['input_wrap_class'] ) : '') . '" ' . (isset( $section_info['input_wrap_id'] ) ? 'id="' . esc_attr( $section_info['input_wrap_id'] ) . '"' : '') . '>';
1898
+ // Instructional Text!
1899
+ $output .= !empty( $option['instructional-text'] ) && !is_array( $option['instructional-text'] ) ? '<div class="instructional-text ' . (isset( $option['instructional-class'] ) ? esc_attr( $option['instructional-class'] ) : '') . '">' . wp_kses(
1900
+ $option['instructional-text'],
1901
+ array(
1902
+ 'a' => array(
1903
+ 'href' => array(),
1904
+ 'title' => array(),
1905
+ 'target' => array(),
1906
+ ),
1907
+ 'br' => array(),
1908
+ 'em' => array(),
1909
+ 'strong' => array(),
1910
+ )
1911
+ ) . '</div>' : '';
1912
+
1913
+ if ( !empty( $option['instructional-text'] ) && is_array( $option['instructional-text'] ) ) {
1914
+ foreach ( $option['instructional-text'] as $instructional_txt ) {
1915
+ // Instructional Text!
1916
+ $output .= '<div class="instructional-text ' . (isset( $instructional_txt['class'] ) ? esc_attr( $instructional_txt['class'] ) : '') . '">' . wp_kses(
1917
+ $instructional_txt['text'],
1918
+ array(
1919
+ 'a' => array(
1920
+ 'href' => array(),
1921
+ 'title' => array(),
1922
+ 'target' => array(),
1923
+ ),
1924
+ 'br' => array(),
1925
+ 'em' => array(),
1926
+ 'strong' => array(),
1927
+ )
1928
+ ) . '</div>';
1929
+ }
1930
+ }
1931
+
1932
+ // Label Text!
1933
+ $output .= isset( $option['label'] ) && !is_array( $option['label'] ) ? '<div class="feed-them-social-admin-input-label ' . (isset( $option['label_class'] ) ? esc_attr( $option['label_class'] ) : '') . '">' . wp_kses(
1934
+ $option['label'],
1935
+ array(
1936
+ 'a' => array(
1937
+ 'href' => array(),
1938
+ 'title' => array(),
1939
+ 'target' => array(),
1940
+ ),
1941
+ 'br' => array(),
1942
+ 'em' => array(),
1943
+ 'strong' => array(),
1944
+ 'small' => array(),
1945
+ )
1946
+ ) . '</div>' : '';
1947
+
1948
+ if ( !empty( $option['label'] ) && is_array( $option['label'] ) ) {
1949
+ foreach ( $option['label'] as $label_txt ) {
1950
+ // Label Text!
1951
+ $output .= '<div class="feed-them-social-admin-input-label ' . (isset( $label_txt['class'] ) ? esc_attr( $label_txt['class'] ) : '') . '">' . wp_kses(
1952
+ $label_txt['text'],
1953
+ array(
1954
+ 'a' => array(
1955
+ 'href' => array(),
1956
+ 'title' => array(),
1957
+ 'target' => array(),
1958
+ ),
1959
+ 'br' => array(),
1960
+ 'em' => array(),
1961
+ 'strong' => array(),
1962
+ 'small' => array(),
1963
+ )
1964
+ ) . '</div>';
1965
+ }
1966
+ }
1967
+
1968
+ if ( $required_plugin || $or_required_plugin || $or_required_plugin_three ) {
1969
+ // Option_Type = INPUT!
1970
+ $output .= isset( $option['option_type'] ) && 'input' === $option['option_type'] ? '<input type="' . esc_attr( $option['type'] ) . '" name="' . esc_attr( $option['name'] ) . '" id="' . esc_attr( $option['id'] ) . '" class="' . (isset( $option['color_picker'] ) && 'yes' === $option['color_picker'] ? 'color {hash:true,caps:false,required:false,adjust:false,pickerFaceColor:\'#eee\',pickerFace:3,pickerBorder:0,pickerInsetColor:\'white\'} ' : '') . 'feed-them-social-admin-input ' . (isset( $option['class'] ) ? esc_attr( $option['class'] ) : '') . '" placeholder="' . (isset( $option['placeholder'] ) ? esc_attr( $option['placeholder'] ) : '') . '" value="' . (isset( $option['value'] ) ? '' . esc_html( $option['value'] ) : '') . '" />' : '';
1971
+
1972
+ // Option_Type = Select!
1973
+ if ( isset( $option['option_type'] ) && 'select' === $option['option_type'] ) {
1974
+ $output .= '<select name="' . esc_attr( $option['name'] ) . '" id="' . esc_attr( $option['id'] ) . '" class="feed-them-social-admin-input">';
1975
+ foreach ( $option['options'] as $select_option ) {
1976
+ $output .= '<option value="' . esc_html( $select_option['value'] ) . '"' . (isset( $option['default_value'] ) && $option['default_value'] === $select_option['value'] ? ' selected' : '') . '>' . esc_html( $select_option['label'] ) . '</option>';
1977
+ }
1978
+ $output .= '</select>';
1979
+ }
1980
+ } else {
1981
+ // Create Required Plugin fields!
1982
+ $output .= $this->need_fts_premium_plugin_field( $required_plugins[$option['req_plugin']] );
1983
+ }
1984
+ $output .= '<div class="fts-clear"></div>';
1985
+ $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
1986
+
1987
+ $output .= isset( $option['outer_wrap_class'] ) || isset( $option['outer_wrap_display'] ) ? '</div>' : '';
1988
+
1989
+ // Sub option output END?
1990
+ if ( isset( $option['sub_options_end'] ) ) {
1991
+ $output .= !is_numeric( $option['sub_options_end'] ) ? '</div>' : '';
1992
+ // Multiple Div needed?
1993
+ if ( is_numeric( $option['sub_options_end'] ) ) {
1994
+ $x = 1;
1995
+ while ($x <= $option['sub_options_end']) {
1996
+ $output .= '</div>';
1997
+ $x++;
1998
+ }
1999
+ }
2000
+ }
2001
+ }
2002
+ }
2003
+ $output .= $this->generate_shortcode( 'updateTextArea_' . $section . '();', $section_info['generator_title'], $section_info['generator_class'] );
2004
+ $output .= '</form>';
2005
+
2006
+ $output .= '</div> <!--/Section Wrap Class END (Main-Section-Div)-->';
2007
+
2008
+ // Premium Message Boxes!
2009
+ if ( isset( $section_info['premium_msg_boxes'] ) ) {
2010
+ foreach ( $section_info['premium_msg_boxes'] as $key => $premium_msg ) {
2011
+ if ( !is_plugin_active( $required_plugins[$premium_msg['req_plugin']]['plugin_url'] ) ) {
2012
+ $output .= '<div class="feed-them-social-admin-input-wrap fts-premium-options-message" id="not_active_' . esc_attr( $key ) . '"><a class="not-active-title" href="' . esc_url( $required_plugins[$premium_msg['req_plugin']]['slick_url'] ) . '" target="_blank">' .
2013
+
2014
+ wp_kses(
2015
+ $required_plugins[$premium_msg['req_plugin']]['name'],
2016
+ array(
2017
+ 'h3' => array(),
2018
+ )
2019
+ ) .
2020
+
2021
+ '</a>' . wp_kses(
2022
+ $premium_msg['msg'],
2023
+ array(
2024
+ 'a' => array(
2025
+ 'href' => array(),
2026
+ 'title' => array(),
2027
+ 'target' => array(),
2028
+ ),
2029
+ 'br' => array(),
2030
+ 'em' => array(),
2031
+ 'strong' => array(),
2032
+ 'small' => array(),
2033
+ )
2034
+ ) . '</div>';
2035
+ }
2036
+ }
2037
+ }
2038
+ }
2039
+ return $output;
2040
+ }
2041
+
2042
+ /**
2043
+ * FTS Facebook Page Form
2044
+ *
2045
+ * @param bool $save_options save options.
2046
+ * @since 1.9.6
2047
+ */
2048
+ public function fts_facebook_page_form ($save_options = false)
2049
+ {
2050
+ $fts_fb_page_form_nonce = wp_create_nonce( 'fts-facebook-page-form-nonce' );
2051
+
2052
+ if ( wp_verify_nonce( $fts_fb_page_form_nonce, 'fts-facebook-page-form-nonce' ) ) {
2053
+ if ( $save_options ) {
2054
+ $fb_page_id_option = get_option( 'fb_page_id' );
2055
+ $fb_page_posts_displayed_option = get_option( 'fb_page_posts_displayed' );
2056
+ $fb_page_post_count_option = get_option( 'fb_page_post_count' );
2057
+ $fb_page_title_option = get_option( 'fb_page_title_option' );
2058
+ $fb_page_description_option = get_option( 'fb_page_description_option' );
2059
+ $fb_page_word_count_option = get_option( 'fb_page_word_count_option' );
2060
+ $fts_bar_fb_prefix = 'fb_page_';
2061
+ $fb_load_more_option = get_option( 'fb_page_fb_load_more_option' );
2062
+ $fb_load_more_style = get_option( 'fb_page_fb_load_more_style' );
2063
+ $facebook_popup = get_option( 'fb_page_facebook_popup' );
2064
+ }
2065
+ $output = '<div class="fts-facebook_page-shortcode-form">';
2066
+ if ( false === $save_options ) {
2067
+ $output = '<form class="feed-them-social-admin-form shortcode-generator-form fb-page-shortcode-form" id="fts-fb-page-form">';
2068
+
2069
+ // Check to see if token is in place otherwise show a message letting person no what they need to do!
2070
+ $facebook_options = get_option( 'fts_facebook_custom_api_token' ) ? 'Yes' : 'No';
2071
+ $output .= isset( $facebook_options ) && 'No' !== $facebook_options ? '' . "\n" : '<div class="feed-them-social-admin-input-wrap fts-required-token-message">Please get your Access Token on our <a href="admin.php?page=fts-facebook-feed-styles-submenu-page">Facebook Options</a> page.</div>' . "\n";
2072
+ // end custom message for requiring token!
2073
+ if ( is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) ) {
2074
+ $facebook_options2 = get_option( 'fts_facebook_custom_api_token_biz' ) ? 'Yes' : 'No';
2075
+ // Check to see if token is in place otherwise show a message letting person no what they need to do
2076
+ // $output .= isset($facebook_options2) && $facebook_options2 !== 'No' ? '' . "\n" : '<div class="feed-them-social-admin-input-wrap fts-required-token-message">Please add a Facebook Page Reviews API Token to our <a href="admin.php?page=fts-facebook-feed-styles-submenu-page">Facebook Options</a> page before trying to view your Facebook Reviews feed.</div>' . "\n";
2077
+ // end custom message for requiring token!
2078
+ }
2079
+
2080
+ $output .= '<h2>' . esc_html( 'Facebook Page Shortcode Generator', 'feed-them-social' ) . '</h2>';
2081
+ }
2082
+ $fb_page_id_option = isset( $fb_page_id_option ) ? $fb_page_id_option : '';
2083
+ // ONLY SHOW SUPER GALLERY OPTIONS ON FTS SETTINGS PAGE FOR NOW, NOT FTS BAR!
2084
+ if ( isset( $_GET['page'] ) && 'feed-them-settings-page' === $_GET['page'] ) {
2085
+ // FACEBOOK FEED TYPE!
2086
+ $output .= '<div class="feed-them-social-admin-input-wrap" id="fts-social-selector">';
2087
+ $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Feed Type', 'feed-them-social' ) . '</div>';
2088
+ $output .= '<select name="facebook-messages-selector" id="facebook-messages-selector" class="feed-them-social-admin-input">';
2089
+ $output .= '<option value="page">' . esc_html( 'Facebook Page', 'feed-them-social' ) . '</option>';
2090
+ $output .= '<option value="events">' . esc_html( 'Facebook Page List of Events', 'feed-them-social' ) . '</option>';
2091
+ $output .= '<option value="event">' . esc_html( 'Facebook Page Single Event Posts', 'feed-them-social' ) . '</option>';
2092
+ $output .= '<option value="group">' . esc_html( 'Facebook Group', 'feed-them-social' ) . '</option>';
2093
+ $output .= '<option value="album_photos">' . esc_html( 'Facebook Album Photos', 'feed-them-social' ) . '</option>';
2094
+ $output .= '<option value="albums">' . esc_html( 'Facebook Album Covers', 'feed-them-social' ) . '</option>';
2095
+ $output .= '<option value="album_videos">' . esc_html( 'Facebook Videos', 'feed-them-social' ) . '</option>';
2096
+ $output .= '<option value="reviews">' . esc_html( 'Facebook Page Reviews', 'feed-them-social' ) . '</option>';
2097
+ $output .= '</select>';
2098
+ $output .= '<div class="fts-clear"></div>';
2099
+ $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2100
+ };
2101
+ // INSTRUCTIONAL TEXT FOR FACEBOOK TYPE SELECTION. PAGE, GROUP, EVENT, ALBUMS, ALBUM COVERS AND HASH TAGS!
2102
+ $output .= '<div class="instructional-text facebook-message-generator page inst-text-facebook-page" style="display:block;">' . esc_html( 'Copy your', 'feed-them-social' ) . ' <a href="http://www.slickremix.com/how-to-get-your-facebook-page-vanity-url/" target="_blank">' . esc_html( 'Facebook Page ID', 'feed-them-social' ) . '</a> ' . esc_html( 'and paste it in the first input below. You cannot use Personal Profiles it must be a Facebook Page. If your page ID looks something like, My-Page-Name-50043151918, only use the number portion, 50043151918.', 'feed-them-social' ) . ' <a href="https://feedthemsocial.com/?feedID=50043151918" target="_blank">' . esc_html( 'Test your Page ID on our demo', 'feed-them-social' ) . '</a></div>
2103
  <div class="instructional-text facebook-message-generator group inst-text-facebook-group">' . esc_html( 'Copy your', 'feed-them-social' ) . ' <a href="http://www.slickremix.com/how-to-get-your-facebook-group-id/" target="_blank">' . esc_html( 'Facebook Group ID', 'feed-them-social' ) . '</a> ' . esc_html( 'and paste it in the first input below.', 'feed-them-social' ) . '</div>
2104
  <div class="instructional-text facebook-message-generator event-list inst-text-facebook-event-list">' . esc_html( 'Copy your', 'feed-them-social' ) . ' <a href="http://www.slickremix.com/how-to-get-your-facebook-event-id/" target="_blank">' . esc_html( 'Facebook Event ID', 'feed-them-social' ) . '</a> ' . esc_html( 'and paste it in the first input below. PLEASE NOTE: This will only work with Facebook Page Events and you cannot have more than 25 events on Facebook.', 'feed-them-social' ) . '</div>
2105
  <div class="instructional-text facebook-message-generator event inst-text-facebook-event">' . esc_html( 'Copy your', 'feed-them-social' ) . ' <a href="http://www.slickremix.com/how-to-get-your-facebook-event-id/" target="_blank">' . esc_html( 'Facebook Event ID', 'feed-them-social' ) . '</a> ' . esc_html( 'and paste it in the first input below.', 'feed-them-social' ) . '</div>
2106
  <div class="instructional-text facebook-message-generator album_photos inst-text-facebook-album-photos">' . esc_html( 'To show a specific Album copy your', 'feed-them-social' ) . ' <a href="http://www.slickremix.com/docs/how-to-get-your-facebook-photo-gallery-id/" target="_blank">' . esc_html( 'Facebook Album ID', 'feed-them-social' ) . '</a> ' . esc_html( 'and paste it in the second input below. If you want to show all your uploaded photos leave the Album ID input blank.', 'feed-them-social' ) . '</div>
2107
  <div class="instructional-text facebook-message-generator albums inst-text-facebook-albums">' . esc_html( 'Copy your', 'feed-them-social' ) . ' <a href="http://www.slickremix.com/docs/how-to-get-your-facebook-photo-gallery-id/" target="_blank">' . esc_html( 'Facebook Album Covers ID', 'feed-them-social' ) . '</a> ' . esc_html( 'and paste it in the first input below.', 'feed-them-social' ) . '</div>
2108
  <div class="instructional-text facebook-message-generator video inst-text-facebook-video">' . esc_html( 'Copy your', 'feed-them-social' ) . ' <a href="http://www.slickremix.com/docs/how-to-get-your-facebook-id-and-video-gallery-id" target="_blank">' . esc_html( 'Facebook ID', 'feed-them-social' ) . '</a> ' . esc_html( 'and paste it in the first input below.', 'feed-them-social' ) . '</div>';
2109
+ if ( isset( $_GET['page'] ) && 'feed-them-settings-page' === $_GET['page'] ) {
2110
+ // this is for the facebook videos!
2111
+ $output .= '<div class="feed-them-social-admin-input-wrap fts-premium-options-message" style="display:none;"><a target="_blank" href="http://www.slickremix.com/downloads/feed-them-social-premium-extension/">Premium Version Required</a><br/>The Facebook video feed allows you to view your uploaded videos from facebook. See these great examples and options of all the different ways you can bring new life to your WordPress site!<br/><a href="https://feedthemsocial.com/facebook-videos-demo/" target="_blank">View Demo</a><br/><br/>Additionally if you purchase the Carousel Plugin you can showcase your videos in a slideshow or carousel. Works with your Facebook Photos too!<br/><a href="https://feedthemsocial.com/facebook-carousels/" target="_blank">View Carousel Demo</a> </div>';
2112
+ // this is for the facebook reviews!
2113
+ $output .= '<div class="feed-them-social-admin-input-wrap fts-premium-options-message2" style="display:none;"><a target="_blank" href="http://www.slickremix.com/downloads/feed-them-social-facebook-reviews/">Facebook Reviews Required</a><br/>The Facebook Reviews feed allows you to view all of the reviews people have made on your Facebook Page. See these great examples and options of all the different ways you can display your Facebook Page Reviews on your website. <a href="https://feedthemsocial.com/facebook-page-reviews-demo/" target="_blank">View Demo</a></div>';
2114
+ }
2115
+ // FACEBOOK PAGE ID!
2116
+ if ( isset( $_GET['page'] ) && 'fts-bar-settings-page' !== $_GET['page'] ) {
2117
+ $output .= '<div class="fb-options-wrap">';
2118
+ }
2119
+ $output .= '<div class="feed-them-social-admin-input-wrap fb_page_id ">';
2120
+ $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Facebook ID (required)', 'feed-them-social' ) . '</div>';
2121
+ $output .= '<input type="text" name="fb_page_id" id="fb_page_id" class="feed-them-social-admin-input" value="' . esc_html( $fb_page_id_option ) . '" />';
2122
+ $output .= '<div class="fts-clear"></div>';
2123
+ $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2124
+ // FACEBOOK ALBUM PHOTOS ID!
2125
+ $output .= '<div class="feed-them-social-admin-input-wrap fb_album_photos_id" style="display:none;">';
2126
+ $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Album ID ', 'feed-them-social' ) . '<br/><small>' . esc_html( 'Leave blank to show all uploaded photos', 'feed-them-social' ) . '</small></div>';
2127
+ $output .= '<input type="text" name="fb_album_id" id="fb_album_id" class="feed-them-social-admin-input" value="" />';
2128
+ $output .= '<div class="fts-clear"></div>';
2129
+ $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2130
+ $fb_page_posts_displayed_option = isset( $fb_page_posts_displayed_option ) ? $fb_page_posts_displayed_option : '';
2131
+ // FACEBOOK PAGE POST TYPE VISIBLE!
2132
+ $output .= '<div class="feed-them-social-admin-input-wrap facebook-post-type-visible">';
2133
+ $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Post Type Visible', 'feed-them-social' ) . '</div>';
2134
+ $output .= '<select name="fb_page_posts_displayed" id="fb_page_posts_displayed" class="feed-them-social-admin-input">';
2135
+ $output .= '<option ' . selected( $fb_page_posts_displayed_option, 'page_only', false ) . ' value="page_only">' . esc_html( 'Display Posts made by Page only', 'feed-them-social' ) . '</option>';
2136
+ $output .= '<option ' . selected( $fb_page_posts_displayed_option, 'page_and_others', false ) . ' value="page_and_others">' . esc_html( 'Display Posts made by Page and Others', 'feed-them-social' ) . '</option>';
2137
+ $output .= '</select>';
2138
+ $output .= '<div class="fts-clear"></div>';
2139
+ $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2140
+
2141
+ $fb_page_post_count_option = isset( $fb_page_post_count_option ) ? $fb_page_post_count_option : '';
2142
+ $output .= '<div class="feed-them-social-admin-input-wrap">';
2143
+ $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( '# of Posts', 'feed-them-premium' );
2144
+
2145
+ if ( !is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) || !is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) ) {
2146
+ $output .= '<br/><small>' . esc_html( 'More than 6 Requires <a target="_blank" href="http://www.slickremix.com/downloads/feed-them-social-premium-extension/">Premium version</a>', 'feed-them-premium' ) . '</small>';
2147
+ }
2148
+ $output .= '</div>';
2149
+ $output .= '<input type="text" name="fb_page_post_count" id="fb_page_post_count" class="feed-them-social-admin-input" value="' . esc_html( $fb_page_post_count_option ) . '" placeholder="5 ' . esc_html( 'is the default number', 'feed-them-premium' ) . '" />';
2150
+ $output .= '<div class="fts-clear"></div>';
2151
+ $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2152
+
2153
+ // ONLY SHOW SUPER GALLERY OPTIONS ON FTS SETTINGS PAGE FOR NOW, NOT FTS BAR!
2154
+ if ( isset( $_GET['page'] ) && 'feed-them-settings-page' === $_GET['page'] ) {
2155
+ // FACEBOOK HEIGHT OPTION!
2156
+ $output .= '<div class="feed-them-social-admin-input-wrap twitter_name fixed_height_option">';
2157
+ $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Facebook Fixed Height', 'feed-them-social' ) . '<br/><small>' . esc_html( 'Leave blank for auto height', 'feed-them-social' ) . '</small></div>';
2158
+ $output .= '<input type="text" name="facebook_page_height" id="facebook_page_height" class="feed-them-social-admin-input" value="" placeholder="450px ' . esc_html( 'for example', 'feed-them-social' ) . '" />';
2159
+ $output .= '<div class="fts-clear"></div>';
2160
+ $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2161
+ }
2162
+
2163
+ if ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) && !is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) ) {
2164
+
2165
+ include $this->premium . 'admin/facebook-page-settings-fields.php';
2166
+ if ( isset( $_GET['page'] ) && 'fts-bar-settings-page' === $_GET['page'] ) {
2167
+ // PREMIUM LOAD MORE SETTINGS & LOADS in FTS BAR!
2168
+ include $this->premium . 'admin/facebook-loadmore-settings-fields.php';
2169
+ }
2170
+ } elseif ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) && is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) ) {
2171
+
2172
+ // these are the new options for reviews only!
2173
+ include $this->facebook_reviews . 'admin/facebook-review-settings-fields.php';
2174
+
2175
+ include $this->premium . 'admin/facebook-page-settings-fields.php';
2176
+ if ( isset( $_GET['page'] ) && 'fts-bar-settings-page' === $_GET['page'] ) {
2177
+ // PREMIUM LOAD MORE SETTINGS & LOADS in FTS BAR!
2178
+ include $this->premium . 'admin/facebook-loadmore-settings-fields.php';
2179
+ }
2180
+ } elseif ( is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) && !is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) ) {
2181
+ // include($this->facebook_reviews.'admin/facebook-page-settings-fields.php');
2182
+ // these are the new options for reviews only!
2183
+ include $this->facebook_reviews . 'admin/facebook-review-settings-fields.php';
2184
+
2185
+ // these are the additional options only for reviews from premium!
2186
+ include $this->facebook_reviews . 'admin/facebook-loadmore-settings-fields.php';
2187
+
2188
+ // Create Need Premium Fields!
2189
+ $fields = array(
2190
+ esc_html( 'Show the Page Title', 'feed-them-social' ),
2191
+ esc_html( 'Align Title', 'feed-them-social' ),
2192
+ esc_html( 'Show the Page Description', 'feed-them-social' ),
2193
+ esc_html( 'Amount of words per post', 'feed-them-social' ),
2194
+ esc_html( 'Load More Posts', 'feed-them-social' ),
2195
+ esc_html( 'Display Photos in Popup', 'feed-them-social' ),
2196
+ esc_html( 'Display Posts in Grid', 'feed-them-social' ),
2197
+ esc_html( 'Center Grid', 'feed-them-social' ),
2198
+ esc_html( 'Grid Stack Animation', 'feed-them-social' ),
2199
+ esc_html( 'Hide Like Button or Box', 'feed-them-social' ),
2200
+ esc_html( 'Like Box Width', 'feed-them-social' ),
2201
+ esc_html( 'Position Like Box', 'feed-them-social' ),
2202
+ esc_html( 'Align Like Button or Box', 'feed-them-social' ),
2203
+ );
2204
+ $output .= '<div class="need-for-premium-fields-wrap">';
2205
+ $output .= $this->need_fts_premium_fields( $fields );
2206
+ $output .= '</div>';
2207
+ } else {
2208
+
2209
+ // Create Need Premium Fields!
2210
+ $fields = array(
2211
+ esc_html( 'Show the Page Title', 'feed-them-social' ),
2212
+ esc_html( 'Align Title', 'feed-them-social' ),
2213
+ esc_html( 'Show the Page Description', 'feed-them-social' ),
2214
+ esc_html( 'Amount of words per post', 'feed-them-social' ),
2215
+ esc_html( 'Load More Posts', 'feed-them-social' ),
2216
+ esc_html( 'Display Photos in Popup', 'feed-them-social' ),
2217
+ esc_html( 'Display Posts in Grid', 'feed-them-social' ),
2218
+ esc_html( 'Center Grid', 'feed-them-social' ),
2219
+ esc_html( 'Grid Stack Animation', 'feed-them-social' ),
2220
+ esc_html( 'Hide Like Button or Box', 'feed-them-social' ),
2221
+ esc_html( 'Like Box Width', 'feed-them-social' ),
2222
+ esc_html( 'Position Like Box', 'feed-them-social' ),
2223
+ esc_html( 'Align Like Button or Box', 'feed-them-social' ),
2224
+ );
2225
+ $output .= $this->need_fts_premium_fields( $fields );
2226
+ }
2227
+ // ONLY SHOW SUPER GALLERY OPTIONS ON FTS SETTINGS PAGE FOR NOW, NOT FTS BAR!
2228
+ if ( isset( $_GET['page'] ) && 'feed-them-settings-page' === $_GET['page'] ) {
2229
+ // SUPER FACEBOOK GALLERY OPTIONS!
2230
+ $output .= '<div class="fts-super-facebook-options-wrap" style="display:none">';
2231
+ // FACEBOOK IMAGE HEIGHT!
2232
+ $output .= '<div class="feed-them-social-admin-input-wrap facebook_name"><div class="feed-them-social-admin-input-label">' . esc_html( 'Facebook Image Width', 'feed-them-social' ) . '<br/><small>' . esc_html( 'Max width is 640px', 'feed-them-social' ) . '</small></div>
2233
  <input type="text" name="fts-slicker-instagram-container-image-width" id="fts-slicker-facebook-container-image-width" class="feed-them-social-admin-input" value="250px" placeholder="">
2234
  <div class="fts-clear"></div> </div>';
2235
+ // FACEBOOK IMAGE WIDTH!
2236
+ $output .= '<div class="feed-them-social-admin-input-wrap facebook_name"><div class="feed-them-social-admin-input-label">' . esc_html( 'Facebook Image Height', 'feed-them-social' ) . '<br/><small>' . esc_html( 'Max width is 640px', 'feed-them-social' ) . '</small></div>
2237
  <input type="text" name="fts-slicker-instagram-container-image-height" id="fts-slicker-facebook-container-image-height" class="feed-them-social-admin-input" value="250px" placeholder="">
2238
  <div class="fts-clear"></div> </div>';
2239
+ // FACEBOOK SPACE BETWEEN PHOTOS!
2240
+ $output .= '<div class="feed-them-social-admin-input-wrap facebook_name"><div class="feed-them-social-admin-input-label">' . esc_html( 'The space between photos', 'feed-them-social' ) . '</div>
2241
  <input type="text" name="fts-slicker-facebook-container-margin" id="fts-slicker-facebook-container-margin" class="feed-them-social-admin-input" value="1px" placeholder="">
2242
  <div class="fts-clear"></div></div>';
2243
+ // HIDE DATES, LIKES AND COMMENTS ETC!
2244
+ $output .= '<div class="feed-them-social-admin-input-wrap facebook_name"><div class="feed-them-social-admin-input-label">' . esc_html( 'Hide Date, Likes and Comments', 'feed-them-social' ) . '<br/><small>' . esc_html( 'Good for image sizes under 120px', 'feed-them-social' ) . '</small></div>
2245
  <select id="fts-slicker-facebook-container-hide-date-likes-comments" name="fts-slicker-facebook-container-hide-date-likes-comments" class="feed-them-social-admin-input">
2246
  <option value="no">' . esc_html( 'No', 'feed-them-social' ) . '</option><option value="yes">' . esc_html( 'Yes', 'feed-them-social' ) . '</option></select><div class="fts-clear"></div></div>';
2247
 
2248
+ // CENTER THE FACEBOOK CONTAINER!
2249
+ $output .= '<div class="feed-them-social-admin-input-wrap" id="facebook_super_gallery_container"><div class="feed-them-social-admin-input-label">' . esc_html( 'Center Facebook Container', 'feed-them-social' ) . '</div>
2250
  <select id="fts-slicker-facebook-container-position" name="fts-slicker-facebook-container-position" class="feed-them-social-admin-input"><option value="no">' . esc_html( 'No', 'feed-them-social' ) . '</option><option value="yes">' . esc_html( 'Yes', 'feed-them-social' ) . '</option></select><div class="fts-clear"></div></div>';
2251
+ // ANIMATE PHOTO POSITIONING!
2252
+ $output .= ' <div class="feed-them-social-admin-input-wrap" id="facebook_super_gallery_animate"><div class="feed-them-social-admin-input-label">' . esc_html( 'Image Stacking Animation On', 'feed-them-social' ) . '<br/><small>' . esc_html( 'This happens when resizing browsert', 'feed-them-social' ) . '</small></div>
2253
  <select id="fts-slicker-facebook-container-animation" name="fts-slicker-facebook-container-animation" class="feed-them-social-admin-input"><option value="no">' . esc_html( 'No', 'feed-them-social' ) . '</option><option value="yes">' . esc_html( 'Yes', 'feed-them-social' ) . '</option></select><div class="fts-clear"></div></div>';
2254
+ // POSITION IMAGE LEFT RIGHT!
2255
+ $output .= '<div class="instructional-text" style="display: block;">' . esc_html( 'These options allow you to make the thumbnail larger if you do not want to see black bars above or below your photos.', 'feed-them-social' ) . ' <a href="http://www.slickremix.com/docs/fit-thumbnail-on-facebook-galleries/" target="_blank">' . esc_html( 'View Examples', 'feed-them-social' ) . '</a> ' . esc_html( 'and simple details or leave default options.', 'feed-them-social' ) . '</div>
2256
  <div class="feed-them-social-admin-input-wrap facebook_name"><div class="feed-them-social-admin-input-label">' . esc_html( 'Make photo larger', 'feed-them-social' ) . '<br/><small>' . esc_html( 'Helps with blackspace', 'feed-them-social' ) . '</small></div>
2257
  <input type="text" id="fts-slicker-facebook-image-position-lr" name="fts-slicker-facebook-image-position-lr" class="feed-them-social-admin-input" value="-0%" placeholder="eg. -50%. -0% ' . esc_html( 'is default', 'feed-them-social' ) . '">
2258
  <div class="fts-clear"></div></div>';
2259
+ // POSITION IMAGE TOP!
2260
+ $output .= ' <div class="feed-them-social-admin-input-wrap facebook_name"><div class="feed-them-social-admin-input-label">' . esc_html( 'Image Position Top', 'feed-them-social' ) . '<br/><small>' . esc_html( 'Helps center image', 'feed-them-social' ) . '</small></div>
2261
  <input type="text" id="fts-slicker-facebook-image-position-top" name="fts-slicker-facebook-image-position-top" class="feed-them-social-admin-input" value="-0%" placeholder="eg. -10%. -0% ' . esc_html( 'is default', 'feed-them-social' ) . '">
2262
  <div class="fts-clear"></div></div>';
2263
+ $output .= '</div><!--fts-super-facebook-options-wrap-->';
2264
+
2265
+ if ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) ) {
2266
+ // PREMIUM LOAD MORE SETTINGS!
2267
+ include $this->premium . 'admin/facebook-loadmore-settings-fields.php';
2268
+ }
2269
+
2270
+ // Slideshow Carousel Options!
2271
+ $output .= '<div class="slideshow-wrap" style="display: none;">';
2272
+ $output .= '<div class="instructional-text" style="display: block;">' . esc_html( 'Create a Carousel or Slideshow with these options.', 'feed-them-social' ) . ' <a href="https://feedthemsocial.com/facebook-carousels-or-sliders/" target="_blank">' . esc_html( 'View Demos', 'feed-them-social' ) . '</a> ' . esc_html( 'and copy easy to use shortcode examples.', 'feed-them-social' ) . '</div>';
2273
+
2274
+ if ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) && is_plugin_active( 'feed-them-carousel-premium/feed-them-carousel-premium.php' ) ) {
2275
+ include $this->facebook_carousel_premium . 'admin/facebook-carousel-options-settings-page.php';
2276
+ } else {
2277
+ // if slider plugin is active!
2278
+ $output .= '<div class="feed-them-social-admin-input-wrap facebook_name"><div class="feed-them-social-admin-input-label">' . esc_html( 'Carousel or Slideshow', 'feed-them-social' ) . '<br/><small>' . esc_html( 'Many more options when active', 'feed-them-social' ) . '</small></div>
2279
  <div class="feed-them-social-admin-input-default" style="display: block !important;">' . esc_html( 'Must have ', 'feed-them-social' ) . ' <a target="_blank" href="http://www.slickremix.com/downloads/feed-them-social-premium-extension/">' . esc_html( 'premium', 'feed-them-social' ) . '</a> ' . esc_html( 'and', 'feed-them-social' ) . ' <a target="_blank" href="http://www.slickremix.com/downloads/feed-them-carousel-premium/">' . esc_html( 'carousel', 'feed-them-social' ) . '</a> ' . esc_html( 'plugin ', 'feed-them-social' ) . '</a> ' . esc_html( 'to edit.', 'feed-them-social' ) . '</div> <div class="fts-clear"></div></div>';
2280
+ }
2281
+
2282
+ // end slideshow wrap!
2283
+ $output .= '</div>';
2284
+
2285
+ }
2286
+ if ( $save_options ) {
2287
+ $output .= '<input type="submit" class="feed-them-social-admin-submit-btn" value="Save Changes" />';
2288
+ } else {
2289
+ $output .= $this->generate_shortcode( 'updateTextArea_fb_page();', 'Facebook Page Feed Shortcode', 'facebook-page-final-shortcode' );
2290
+ if ( isset( $_GET['page'] ) && 'fts-bar-settings-page' !== $_GET['page'] ) {
2291
+ $output .= '</div>';
2292
+ // END fb-options-wrap!
2293
+ }
2294
+ $output .= '</form>';
2295
+ }
2296
+ $output .= '</div><!--/fts-facebook_page-shortcode-form-->';
2297
+ }
2298
+ return $output;
2299
+ }
2300
+
2301
+ /**
2302
+ * FTS Twitter Form
2303
+ *
2304
+ * @param bool $save_options save options.
2305
+ * @since 1.9.6
2306
+ */
2307
+ public function fts_twitter_form ($save_options = false)
2308
+ {
2309
+ $fts_twitter_form_nonce = wp_create_nonce( 'fts-twitter-form-nonce' );
2310
+
2311
+ if ( wp_verify_nonce( $fts_twitter_form_nonce, 'fts-twitter-form-nonce' ) ) {
2312
+
2313
+ if ( $save_options ) {
2314
+ $twitter_name_option = get_option( 'twitter_name' );
2315
+ $tweets_count_option = get_option( 'tweets_count' );
2316
+ $twitter_popup_option = get_option( 'twitter_popup_option' );
2317
+ $twitter_hashtag_etc_name = get_option( 'twitter_hashtag_etc_name' );
2318
+ $twitter_load_more_option = get_option( 'twitter_load_more_option' );
2319
+ }
2320
+
2321
+ $twitter_name_option = isset( $twitter_name_option ) ? $twitter_name_option : '';
2322
+ $tweets_count_option = isset( $tweets_count_option ) ? $tweets_count_option : '';
2323
+ $twitter_hashtag_etc_name = isset( $twitter_hashtag_etc_name ) ? $twitter_hashtag_etc_name : '';
2324
+ $output = '<div class="fts-twitter-shortcode-form">';
2325
+ if ( false === $save_options ) {
2326
+ $output .= '<form class="feed-them-social-admin-form shortcode-generator-form twitter-shortcode-form" id="fts-twitter-form">';
2327
+
2328
+ // Check to see if token is in place otherwise show a message letting person no what they need to do!
2329
+ $twitter_options4 = get_option( 'fts_twitter_custom_access_token_secret' ) ? 'Yes' : 'No';
2330
+ $output .= isset( $twitter_options4 ) && 'No' !== $twitter_options4 ? '' . "\n" : '<div class="feed-them-social-admin-input-wrap fts-required-token-message">Please add Twitter API Tokens to our <a href="admin.php?page=fts-twitter-feed-styles-submenu-page">Twitter Options</a> page before trying to view your feed.</div>' . "\n";
2331
+ // end custom message for requiring token!
2332
+ $output .= '<h2>' . esc_html( 'Twitter Shortcode Generator', 'feed-them-social' ) . '</h2>';
2333
+ }
2334
+
2335
+ // TWITTER FEED TYPE!
2336
+ $output .= '<div class="feed-them-social-admin-input-wrap twitter-gen-selection">';
2337
+ $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Feed Type', 'feed-them-social' ) . '</div>';
2338
+ $output .= '<select name="twitter-messages-selector" id="twitter-messages-selector" class="feed-them-social-admin-input">';
2339
+ $output .= '<option value="user">' . esc_html( 'User Feed', 'feed-them-social' ) . '</option>';
2340
+ $output .= '<option value="hashtag">' . esc_html( '#hashtag, @person, or single words', 'feed-them-social' ) . '</option>';
2341
+ $output .= '</select>';
2342
+ $output .= '<div class="fts-clear"></div>';
2343
+ $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2344
+
2345
+ $output .= '<div class="twitter-hashtag-etc-wrap">';
2346
+ $output .= '<h3>' . esc_html( 'Twitter Search', 'feed-them-social' ) . '</h3>';
2347
+ $output .= '<div class="instructional-text">';
2348
+ $output .= sprintf(
2349
+ esc_html( 'You can use #hashtag, @person, or single words. For example, weather or weather-channel.%1$sIf you want to filter a specific users hashtag copy this example into the first input below and replace the user_name and YourHashtag name. DO NOT remove the from: or %# characters. NOTE: Only displays last 7 days worth of Tweets. %2$sfrom:user_name%#YourHashtag%3$s', 'feed-them-social' ),
2350
+ '<br/><br/>',
2351
+ '<strong style="color:#225DE2;">',
2352
+ '</strong>'
2353
+ );
2354
+ $output .= '</div>';
2355
+ $output .= '<div class="feed-them-social-admin-input-wrap twitter_hashtag_etc_name">';
2356
+ $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Twitter Search Name (required)', 'feed-them-social' ) . '</div>';
2357
+ $output .= '<input type="text" name="twitter_hashtag_etc_name" id="twitter_hashtag_etc_name" class="feed-them-social-admin-input" value="' . esc_html( $twitter_hashtag_etc_name ) . '" />';
2358
+ $output .= '<div class="fts-clear"></div>';
2359
+ $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2360
+ $output .= '</div><!--/twitter-hashtag-etc-wrap-->';
2361
+
2362
+ $output .= '<div class="instructional-text"><span class="hashtag-option-small-text">' . esc_html( 'Twitter Name is only required if you want to show a', 'feed-them-social' ) . ' <a href="admin.php?page=fts-twitter-feed-styles-submenu-page">' . esc_html( 'Follow Button', 'feed-them-social' ) . '</a>.</span><span class="must-copy-twitter-name">' . esc_html( 'You must copy your', 'feed-them-social' ) . ' <a href="http://www.slickremix.com/how-to-get-your-twitter-name/" target="_blank">' . esc_html( 'Twitter Name', 'feed-them-social' ) . '</a> ' . esc_html( 'and paste it in the first input below.', 'feed-them-social' ) . '</span></div>';
2363
+ $output .= '<div class="feed-them-social-admin-input-wrap twitter_name">';
2364
+ $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Twitter Name', 'feed-them-social' ) . ' <span class="hashtag-option-not-required">' . esc_html( '(required)', 'feed-them-social' ) . '</span></div>';
2365
+ $output .= '<input type="text" name="twitter_name" id="twitter_name" class="feed-them-social-admin-input" value="' . esc_html( $twitter_name_option ) . '" />';
2366
+ $output .= '<div class="fts-clear"></div>';
2367
+ $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2368
+
2369
+ $output .= '<div class="feed-them-social-admin-input-wrap">';
2370
+ $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( '# of Tweets (optional)', 'feed-them-premium' );
2371
+ if ( !is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) ) {
2372
+ $output .= sprintf(
2373
+ esc_html( '%1$s More than 6 Requires the %2$sPremium Extension%3$s', 'feed-them-social' ),
2374
+ '<br/><small>',
2375
+ '<a target="_blank" href="' . esc_url( 'http://www.slickremix.com/downloads/feed-them-social-premium-extension/' ) . '">',
2376
+ '</a></small>'
2377
+ );
2378
+ }
2379
+ $output .= '</div>';
2380
+ $output .= '<input type="text" name="tweets_count" id="tweets_count" placeholder="5 is the default number" class="feed-them-social-admin-input" value="' . esc_html( $tweets_count_option ) . '" />';
2381
+ $output .= '<div class="fts-clear"></div>';
2382
+ $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2383
+
2384
+ if ( isset( $_GET['page'] ) && 'feed-them-settings-page' === $_GET['page'] ) {
2385
+ $output .= '<div class="feed-them-social-admin-input-wrap">';
2386
+ $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Twitter Fixed Height', 'feed-them-social' ) . '<br/><small>' . esc_html( 'Leave blank for auto height', 'feed-them-social' ) . '</small></div>';
2387
+ $output .= '<input type="text" name="twitter_height" id="twitter_height" class="feed-them-social-admin-input" value="" placeholder="450px ' . esc_html( 'for example', 'feed-them-social' ) . '" />';
2388
+ $output .= '<div class="fts-clear"></div>';
2389
+ $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2390
+ }
2391
+
2392
+ $output .= '<div class="feed-them-social-admin-input-wrap">';
2393
+ $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Show Retweets', 'feed-them-social' ) . '</div>';
2394
+ $output .= '<select name="twitter-show-retweets" id="twitter-show-retweets" class="feed-them-social-admin-input">';
2395
+ $output .= '<option value="yes">' . esc_html( 'Yes', 'feed-them-social' ) . '</option>';
2396
+ $output .= '<option value="no">' . esc_html( 'No', 'feed-them-social' ) . '</option>';
2397
+ $output .= '</select>';
2398
+ $output .= '<div class="fts-clear"></div>';
2399
+ $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2400
+
2401
+ if ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) ) {
2402
+ include $this->premium . 'admin/twitter-settings-fields.php';
2403
+ } else {
2404
+ // Create Need Premium Fields!
2405
+ $fields = array(
2406
+ __( 'Display Photos in Popup', 'feed-them-social' ),
2407
+ );
2408
+ $output .= $this->need_fts_premium_fields( $fields );
2409
+ }
2410
+ if ( $save_options ) {
2411
+ $output .= '<input type="submit" class="feed-them-social-admin-submit-btn" value="' . esc_html( 'Save Changes', 'feed-them-social' ) . '" />';
2412
+ } else {
2413
+ $output .= $this->generate_shortcode( 'updateTextArea_twitter();', 'Twitter Feed Shortcode', 'twitter-final-shortcode' );
2414
+ $output .= '</form>';
2415
+ }
2416
+ $output .= '</div><!--/fts-twitter-shortcode-form-->';
2417
+ }
2418
+
2419
+ return $output;
2420
+ }
2421
+
2422
+ /**
2423
+ * FTS Instagram Form
2424
+ *
2425
+ * @param bool $save_options save options.
2426
+ * @since 1.9.7
2427
+ */
2428
+ public function fts_instagram_form ($save_options = false)
2429
+ {
2430
+ $fts_instagram_form_nonce = wp_create_nonce( 'fts-instagram-form-nonce' );
2431
+
2432
+ if ( wp_verify_nonce( $fts_instagram_form_nonce, 'fts-instagram-form-nonce' ) ) {
2433
+
2434
+ if ( $save_options ) {
2435
+ $instagram_name_option = get_option( 'convert_instagram_username' );
2436
+ $instagram_id_option = get_option( 'instagram_id' );
2437
+ $pics_count_option = get_option( 'pics_count' );
2438
+ $instagram_popup_option = get_option( 'instagram_popup_option' );
2439
+ $instagram_load_more_option = get_option( 'instagram_load_more_option' );
2440
+ }
2441
+ $output = '<div class="fts-instagram-shortcode-form">';
2442
+ if ( false === $save_options ) {
2443
+ $output .= '<form class="feed-them-social-admin-form shortcode-generator-form instagram-shortcode-form" id="fts-instagram-form">';
2444
+
2445
+ // Check to see if token is in place otherwise show a message letting person no what they need to do!
2446
+ $instagram_options = get_option( 'fts_instagram_custom_api_token' ) ? 'Yes' : 'No';
2447
+ $output .= isset( $instagram_options ) && 'No' !== $instagram_options ? '' . "\n" : '<div class="feed-them-social-admin-input-wrap fts-required-token-message">Please get your Access Token on the <a href="admin.php?page=fts-instagram-feed-styles-submenu-page">Instagram Options</a> page or you won\'t be able to view your photos.</div>' . "\n";
2448
+ // end custom message for requiring token!
2449
+ // ONLY SHOW SUPER GALLERY OPTIONS ON FTS SETTINGS PAGE FOR NOW, NOT FTS BAR!
2450
+ if ( isset( $_GET['page'] ) && 'feed-them-settings-page' === $_GET['page'] ) {
2451
+ // INSTAGRAM FEED TYPE!
2452
+ $output .= '<h2>' . esc_html( 'Instagram Shortcode Generator', 'feed-them-social' ) . '</h2><div class="feed-them-social-admin-input-wrap instagram-gen-selection">';
2453
+ $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Feed Type', 'feed-them-social' ) . '</div>';
2454
+ $output .= '<select name="instagram-messages-selector" id="instagram-messages-selector" class="feed-them-social-admin-input">';
2455
+ $output .= '<option value="user">' . esc_html( 'User Feed', 'feed-them-social' ) . '</option>';
2456
+ $output .= '<option value="hashtag">' . esc_html( 'Hashtag Feed', 'feed-them-social' ) . '</option>';
2457
+ $output .= '</select>';
2458
+ $output .= '<div class="fts-clear"></div>';
2459
+ $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2460
+ };
2461
+ $output .= '<div class="instagram-id-option-wrap">';
2462
+ $output .= '<h3>' . esc_html( 'Convert Instagram Name to ID', 'feed-them-social' ) . '</h3>';
2463
+ }
2464
+ $instagram_name_option = isset( $instagram_name_option ) ? $instagram_name_option : '';
2465
+ $instagram_id_option = isset( $instagram_id_option ) ? $instagram_id_option : '';
2466
+ $output .= '<div class="instructional-text">' . esc_html( 'You must copy your', 'feed-them-social' ) . ' <a href="http://www.slickremix.com/how-to-get-your-instagram-name-and-convert-to-id/" target="_blank">' . esc_html( 'Instagram Name', 'feed-them-social' ) . '</a> ' . esc_html( 'and paste it in the first input below', 'feed-them-social' ) . '</div>';
2467
+ $output .= '<div class="feed-them-social-admin-input-wrap convert_instagram_username">';
2468
+ $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Instagram Name (required)', 'feed-them-social' ) . '</div>';
2469
+ $output .= '<input type="text" id="convert_instagram_username" name="convert_instagram_username" class="feed-them-social-admin-input" value="' . esc_html( $instagram_name_option ) . '" />';
2470
+ $output .= '<div class="fts-clear"></div>';
2471
+ $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2472
+ $output .= '<input type="button" class="feed-them-social-admin-submit-btn" value="' . esc_html( 'Convert Instagram Username', 'feed-them-social' ) . '" onclick="converter_instagram_username();" tabindex="4" style="margin-right:1em;" />';
2473
+ // ONLY THIS DIV IF ON OUR SETTINGS PAGE!
2474
+ if ( isset( $_GET['page'] ) && 'feed-them-settings-page' === $_GET['page'] ) {
2475
+ $output .= '</div><!--instagram-id-option-wrap-->';
2476
+ };
2477
+ if ( false === $save_options ) {
2478
+ $output .= '</form>';
2479
+ }
2480
+ if ( false === $save_options ) {
2481
+ $output .= '<form class="feed-them-social-admin-form shortcode-generator-form instagram-shortcode-form">';
2482
+ }
2483
+ $output .= '<div class="instructional-text instagram-user-option-text" style="margin-top:12px;"><div class="fts-insta-info-plus-wrapper">' . esc_html( 'Choose a different ID if yours is not the first name below after clicking Convert Instagram Username button.', 'feed-them-social' ) . '</div><!-- the li list comes from an ajax call after looking up the user ID --><ul id="fts-instagram-username-picker-wrap" class="fts-instagram-username-picker-wrap"></ul></div>';
2484
+ $output .= '<div class="instructional-text instagram-hashtag-option-text" style="display:none;margin-top:12px;">' . esc_html( 'Add your Hashtag below. Do not add the #, just the name.', 'feed-them-social' ) . '</div>';
2485
+ $output .= '<div class="feed-them-social-admin-input-wrap instagram_name">';
2486
+ $output .= '<div class="feed-them-social-admin-input-label instagram-user-option-text">' . esc_html( 'Instagram ID # (required)', 'feed-them-social' ) . '</div>';
2487
+ $output .= '<div class="feed-them-social-admin-input-label instagram-hashtag-option-text" style="display:none;">' . esc_html( 'Hashtag (required)', 'feed-them-social' ) . '</div>';
2488
+ $output .= '<input type="text" name="instagram_id" id="instagram_id" class="feed-them-social-admin-input" value="' . esc_html( $instagram_id_option ) . '" />';
2489
+ $output .= '<div class="fts-clear"></div>';
2490
+ $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2491
+ // Super Instagram Options!
2492
+ $pics_count_option = isset( $pics_count_option ) ? $pics_count_option : '';
2493
+ // Pic Count Option!
2494
+ $output .= '<div class="feed-them-social-admin-input-wrap">';
2495
+ $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( '# of Pics (optional)', 'feed-them-premium' );
2496
+ if ( !is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) ) {
2497
+ $output .= sprintf(
2498
+ esc_html( '%1$s More than 6 Requires the %2$sPremium Extension%3$s', 'feed-them-social' ),
2499
+ '<br/><small>',
2500
+ '<a target="_blank" href="' . esc_url( 'http://www.slickremix.com/downloads/feed-them-social-premium-extension/' ) . '">',
2501
+ '</a></small>'
2502
+ );
2503
+ }
2504
+ $output .= '</div>';
2505
+ $output .= '<input type="text" name="pics_count" id="pics_count" class="feed-them-social-admin-input" value="' . esc_html( $pics_count_option ) . '" placeholder="6 is the default number" />';
2506
+ $output .= '<div class="fts-clear"></div>';
2507
+ $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2508
+
2509
+ if ( isset( $_GET['page'] ) && 'feed-them-settings-page' === $_GET['page'] ) {
2510
+
2511
+ $output .= '<div class="feed-them-social-admin-input-wrap">';
2512
+ $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Super Instagram Gallery', 'feed-them-social' ) . '</div>';
2513
+ $output .= '<select id="instagram-custom-gallery" name="instagram-custom-gallery" class="feed-them-social-admin-input"><option value="no">' . esc_html( 'No', 'feed-them-social' ) . '</option><option value="yes">' . esc_html( 'Yes', 'feed-them-social' ) . '</option></select>';
2514
+ $output .= '<div class="fts-clear"></div>';
2515
+ $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2516
+ $output .= '<div class="feed-them-social-admin-input-wrap"><div class="feed-them-social-admin-input-label">' . esc_html( 'Instagram Image Size', 'feed-them-social' ) . '<br/><small><a href="https://feedthemsocial.com/instagram-feed-demo/" target="_blank">' . esc_html( 'View demo', 'feed-them-social' ) . '</a></small></div>
2517
  <input type="text" name="fts-slicker-instagram-container-image-size" id="fts-slicker-instagram-container-image-size" class="feed-them-social-admin-input" value="250px" placeholder="">
2518
  <div class="fts-clear"></div> </div>';
2519
+ $output .= '<div class="feed-them-social-admin-input-wrap"><div class="feed-them-social-admin-input-label">' . esc_html( 'Size of the Instagram Icon', 'feed-them-social' ) . '<br/><small>' . esc_html( 'Visible when you hover over photo', 'feed-them-social' ) . '</small></div>
2520
  <input type="text" name="fts-slicker-instagram-icon-center" id="fts-slicker-instagram-icon-center" class="feed-them-social-admin-input" value="65px" placeholder="">
2521
  <div class="fts-clear"></div></div>';
2522
+ $output .= '<div class="feed-them-social-admin-input-wrap"><div class="feed-them-social-admin-input-label">' . esc_html( 'The space between photos', 'feed-them-social' ) . '</div>
2523
  <input type="text" name="fts-slicker-instagram-container-margin" id="fts-slicker-instagram-container-margin" class="feed-them-social-admin-input" value="1px" placeholder="">
2524
  <div class="fts-clear"></div></div>';
2525
+ $output .= '<div class="feed-them-social-admin-input-wrap"><div class="feed-them-social-admin-input-label">' . esc_html( 'Hide Date, Likes and comments', 'feed-them-social' ) . '<br/><small>' . esc_html( 'Good for image sizes under 120px', 'feed-them-social' ) . '</small></div>
2526
  <select id="fts-slicker-instagram-container-hide-date-likes-comments" name="fts-slicker-instagram-container-hide-date-likes-comments" class="feed-them-social-admin-input">
2527
  <option value="no">' . esc_html( 'No', 'feed-them-social' ) . '</option><option value="yes">' . esc_html( 'Yes', 'feed-them-social' ) . '</option></select><div class="fts-clear"></div></div>';
2528
+ $output .= '<div class="feed-them-social-admin-input-wrap"><div class="feed-them-social-admin-input-label">' . esc_html( 'Center Instagram Container', 'feed-them-social' ) . '</div>
2529
  <select id="fts-slicker-instagram-container-position" name="fts-slicker-instagram-container-position" class="feed-them-social-admin-input"><option value="no">' . esc_html( 'No', 'feed-them-social' ) . '</option><option value="yes">' . esc_html( 'Yes', 'feed-them-social' ) . '</option></select>
2530
  <div class="fts-clear"></div></div>';
2531
+ $output .= ' <div class="feed-them-social-admin-input-wrap"><div class="feed-them-social-admin-input-label">' . esc_html( 'Image Stacking Animation On', 'feed-them-social' ) . '<br/><small>' . esc_html( 'This happens when resizing browser', 'feed-them-social' ) . '</small></div>
2532
  <select id="fts-slicker-instagram-container-animation" name="fts-slicker-instagram-container-animation" class="feed-them-social-admin-input"><option value="no">' . esc_html( 'No', 'feed-them-social' ) . '</option><option value="yes">' . esc_html( 'Yes', 'feed-them-social' ) . '</option></select><div class="fts-clear"></div></div>';
2533
 
2534
+ // INSTAGRAM HEIGHT OPTION!
2535
+ $output .= '<div class="feed-them-social-admin-input-wrap instagram_fixed_height_option">';
2536
+ $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Instagram Fixed Height', 'feed-them-social' ) . '<br/><small>' . esc_html( 'Leave blank for auto height', 'feed-them-social' ) . '</small></div>';
2537
+ $output .= '<input type="text" name="instagram_page_height" id="instagram_page_height" class="feed-them-social-admin-input" value="" placeholder="450px ' . esc_html( 'for example', 'feed-them-social' ) . '" />';
2538
+ $output .= '<div class="fts-clear"></div>';
2539
+ $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2540
+
2541
+ $output .= '</div><!--fts-super-instagram-options-wrap-->';
2542
+
2543
+ }
2544
+
2545
+ if ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) ) {
2546
+
2547
+ include $this->premium . 'admin/instagram-settings-fields.php';
2548
+
2549
+ } else {
2550
+ // Create Need Premium Fields!
2551
+ $fields = array(
2552
+ __( 'Display Photos & Videos in Popup', 'feed-them-social' ),
2553
+ __( 'Load More Posts', 'feed-them-social' ),
2554
+ );
2555
+ $output .= $this->need_fts_premium_fields( $fields );
2556
+ }
2557
+ if ( $save_options ) {
2558
+ $output .= '<input type="submit" class="feed-them-social-admin-submit-btn instagram-submit" value="' . esc_html( 'Save Changes', 'feed-them-social' ) . '" />';
2559
+ } else {
2560
+ $output .= $this->generate_shortcode( 'updateTextArea_instagram();', 'Instagram Feed Shortcode', 'instagram-final-shortcode' );
2561
+ $output .= '</form>';
2562
+ }
2563
+ $output .= '</div> <!--/fts-instagram-shortcode-form-->';
2564
+ }
2565
+ return $output;
2566
+ }
2567
+
2568
+ /**
2569
+ * FTS Youtube Form
2570
+ *
2571
+ * @param bool $save_options save options.
2572
+ * @since 1.9.6
2573
+ */
2574
+ public function fts_youtube_form ($save_options = false)
2575
+ {
2576
+ $fts_youtube_form_nonce = wp_create_nonce( 'fts-youtube-form-nonce' );
2577
+
2578
+ if ( wp_verify_nonce( $fts_youtube_form_nonce, 'fts-youtube-form-nonce' ) ) {
2579
+ if ( $save_options ) {
2580
+ $youtube_name_option = get_option( 'youtube_name' );
2581
+ $youtube_vid_count_option = get_option( 'youtube_vid_count' );
2582
+ $youtube_columns_option = get_option( 'youtube_columns' );
2583
+ $youtube_first_video_option = get_option( 'youtube_first_video' );
2584
+ }
2585
+ $output = '<div class="fts-youtube-shortcode-form">';
2586
+ if ( false === $save_options ) {
2587
+ $output .= '<form class="feed-them-social-admin-form shortcode-generator-form youtube-shortcode-form" id="fts-youtube-form">';
2588
+
2589
+ // Check to see if token is in place otherwise show a message letting person no what they need to do!
2590
+ $youtube_options = get_option( 'youtube_custom_api_token' ) || get_option( 'youtube_custom_access_token' ) && get_option( 'youtube_custom_refresh_token' ) && get_option( 'youtube_custom_token_exp_time' ) ? 'Yes' : 'No';
2591
+ $output .= isset( $youtube_options ) && 'No' !== $youtube_options ? '' . "\n" : '<div class="feed-them-social-admin-input-wrap fts-required-token-message">Please add a YouTube API Key to our <a href="admin.php?page=fts-youtube-feed-styles-submenu-page">YouTube Options</a> page before trying to view your feed.</div>' . "\n";
2592
+ // end custom message for requiring token!
2593
+ $output .= '<h2>' . esc_html( 'YouTube Shortcode Generator', 'feed-them-social' ) . '</h2>';
2594
+ }
2595
+ $output .= '<div class="instructional-text">' . esc_html( 'You must copy your YouTube ', 'feed-them-social' ) . ' <a href="http://www.slickremix.com/how-to-get-your-youtube-name/" target="_blank">' . esc_html( 'Username, Channel ID and or Playlist ID', 'feed-them-social' ) . '</a> ' . esc_html( 'and paste it below.', 'feed-them-social' ) . '</div>';
2596
+ if ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) ) {
2597
+ include $this->premium . 'admin/youtube-settings-fields.php';
2598
+ } else {
2599
+ // Create Need Premium Fields!
2600
+ $fields = array(
2601
+ __( 'YouTube Name', 'feed-them-social' ),
2602
+ __( '# of videos', 'feed-them-social' ),
2603
+ __( '# of videos in each row', 'feed-them-social' ),
2604
+ __( 'Display First video full size', 'feed-them-social' ),
2605
+ );
2606
+ $output .= $this->need_fts_premium_fields( $fields );
2607
+ $output .= '<a href="http://www.slickremix.com/downloads/feed-them-social-premium-extension/" target="_blank" class="feed-them-social-admin-submit-btn" style="margin-right:1em; margin-top: 15px; display:inline-block; text-decoration:none !important;">' . esc_html( 'Click to see Premium Version', 'feed-them-social' ) . '</a>';
2608
+ $output .= '</form>';
2609
+ }
2610
+ $output .= '</div><!--/fts-youtube-shortcode-form-->';
2611
+ }
2612
+ return $output;
2613
+ }
2614
+
2615
+ /**
2616
+ * FTS Pinterest Form
2617
+ *
2618
+ * @param bool $save_options save options.
2619
+ * @since 1.9.6
2620
+ */
2621
+ public function fts_pinterest_form ($save_options = false)
2622
+ {
2623
+ $fts_pinterest_form_nonce = wp_create_nonce( 'fts-pinterest-form-nonce' );
2624
+
2625
+ if ( wp_verify_nonce( $fts_pinterest_form_nonce, 'fts-pinterest-form-nonce' ) ) {
2626
+ if ( $save_options ) {
2627
+ $pinterest_name_option = get_option( 'pinterest_name' );
2628
+ $boards_count_option = get_option( 'boards_count' );
2629
+ }
2630
+ $output = '<div class="fts-pinterest-shortcode-form">';
2631
+ if ( false === $save_options ) {
2632
+ $output = '<form class="feed-them-social-admin-form shortcode-generator-form pinterest-shortcode-form" id="fts-pinterest-form">';
2633
+ }
2634
+ // Pinterest FEED TYPE!
2635
+ $output .= '<h2>' . esc_html( 'Pinterest Shortcode Generator', 'feed-them-social' ) . '</h2><div class="feed-them-social-admin-input-wrap pinterest-gen-selection">';
2636
+ $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Feed Type', 'feed-them-social' ) . '</div>';
2637
+ $output .= '<select name="pinterest-messages-selector" id="pinterest-messages-selector" class="feed-them-social-admin-input">';
2638
+ $output .= '<option value="boards_list">' . esc_html( 'Board List', 'feed-them-social' ) . '</option>';
2639
+ $output .= '<option value="single_board_pins">' . esc_html( 'Pins From a Specific Board', 'feed-them-social' ) . '</option>';
2640
+ $output .= '<option value="pins_from_user">' . esc_html( 'Latest Pins from a User', 'feed-them-social' ) . '</option>';
2641
+ $output .= '</select>';
2642
+ $output .= '<div class="fts-clear"></div>';
2643
+ $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2644
+ $output .= '<h3>' . esc_html( 'Pinterest Feed', 'feed-them-social' ) . '</h3><div class="instructional-text pinterest-name-text">' . esc_html( 'Copy your', 'feed-them-social' ) . ' <a href="http://www.slickremix.com/how-to-get-your-pinterest-name/" target="_blank">' . esc_html( 'Pinterest Name', 'feed-them-social' ) . '</a> ' . esc_html( 'and paste it in the first input below.', 'feed-them-social' ) . '</div>';
2645
+ $output .= '<div class="instructional-text pinterest-board-and-name-text" style="display:none;">' . esc_html( 'Copy your', 'feed-them-social' ) . ' <a href="http://www.slickremix.com/how-to-get-your-pinterest-name/" target="_blank">' . esc_html( 'Pinterest and Board Name', 'feed-them-social' ) . '</a> ' . esc_html( 'and paste them below.', 'feed-them-social' ) . '</div>';
2646
+ $pinterest_name_option = isset( $pinterest_name_option ) ? $pinterest_name_option : '';
2647
+ $boards_count_option = isset( $boards_count_option ) ? $boards_count_option : '';
2648
+ $output .= '<div class="feed-them-social-admin-input-wrap pinterest_name">';
2649
+ $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Pinterest Username (required)', 'feed-them-social' ) . '</div>';
2650
+ $output .= '<input type="text" name="pinterest_name" id="pinterest_name" class="feed-them-social-admin-input" value="' . esc_html( $pinterest_name_option ) . '" />';
2651
+ $output .= '<div class="fts-clear"></div>';
2652
+ $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2653
+ $output .= '<div class="feed-them-social-admin-input-wrap board-name" style="display:none;">';
2654
+ $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( 'Pinterest Board Name (required)', 'feed-them-premium' ) . '</div>';
2655
+ $output .= '<input type="text" name="pinterest_board_name" id="pinterest_board_name" class="feed-them-social-admin-input" value="' . esc_html( $pinterest_name_option ) . '" />';
2656
+ $output .= '<div class="fts-clear"></div>';
2657
+ $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2658
+ if ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) ) {
2659
+ include $this->premium . 'admin/pinterest-settings-fields.php';
2660
+ } else {
2661
+ // Create Need Premium Fields!
2662
+ $fields = array(
2663
+ esc_html( '# of Boards (default 6)', 'feed-them-social' ),
2664
+ esc_html( '# of Pins (default 6)', 'feed-them-social' ),
2665
+ );
2666
+ $output .= $this->need_fts_premium_fields( $fields );
2667
+ }
2668
+ if ( $save_options ) {
2669
+ $output .= '<input type="submit" class="feed-them-social-admin-submit-btn" value="' . esc_html( 'Save Changes', 'feed-them-social' ) . '" />';
2670
+ } else {
2671
+ $output .= $this->generate_shortcode( 'updateTextArea_pinterest();', '' . esc_html( 'Pinterest Feed Shortcode', 'feed-them-social' ) . '', 'pinterest-final-shortcode' );
2672
+ $output .= '</form>';
2673
+ }
2674
+ $output .= '</div><!--/fts-pinterest-shortcode-form-->';
2675
+ }
2676
+ return $output;
2677
+ }
2678
+
2679
+ /**
2680
+ * Generate Shortcode
2681
+ *
2682
+ * Generate Shortcode Button and Input for FTS settings Page.
2683
+ *
2684
+ * @param string $onclick onclick.
2685
+ * @param string $label label.
2686
+ * @param string $input_class input class.
2687
+ * @since 1.9.6
2688
+ */
2689
+ public function generate_shortcode ($onclick, $label, $input_class)
2690
+ {
2691
+ $output = '<input type="button" class="feed-them-social-admin-submit-btn" value="' . esc_html( 'Generate Shortcode', 'feed-them-social' ) . '" onclick="' . esc_js( $onclick ) . '" tabindex="4" style="margin-right:1em;" />';
2692
+ $output .= '<div class="feed-them-social-admin-input-wrap final-shortcode-textarea">';
2693
+ $output .= '<h4>' . esc_html( 'Copy the ShortCode below and paste it on a page or post that you want to display your feed.', 'feed-them-social' ) . '</h4>';
2694
+ $output .= '<div class="feed-them-social-admin-input-label">' . esc_html( $label ) . '</div>';
2695
+ $output .= '<input class="copyme ' . esc_html( $input_class ) . ' feed-them-social-admin-input" value="" />';
2696
+ $output .= '<div class="fts-clear"></div>';
2697
+ $output .= '</div><!--/feed-them-social-admin-input-wrap-->';
2698
+ return $output;
2699
+ }
2700
+
2701
+ /**
2702
+ * FTS Get Feed json
2703
+ *
2704
+ * Generate Get Json (includes MultiCurl).
2705
+ *
2706
+ * @param array $feeds_mulit_data feeds data info.
2707
+ * @return array
2708
+ * @since 1.9.6
2709
+ */
2710
+ public function fts_get_feed_json ($feeds_mulit_data)
2711
+ {
2712
+ // Make Multiple Requests from array with more than 2 keys!
2713
+ if ( is_array( $feeds_mulit_data ) && count( $feeds_mulit_data ) > 1 ) {
2714
+ $new_feeds_mulit_data = array();
2715
+
2716
+ foreach ( $feeds_mulit_data as $key => $url ) {
2717
+ $new_feeds_mulit_data[$key]['url'] = $url;
2718
+ $new_feeds_mulit_data[$key]['type'] = 'GET';
2719
+ }
2720
+ // Fetch Multiple Requests!
2721
+ $responses = \Requests::request_multiple( $new_feeds_mulit_data );
2722
+
2723
+ $data = array();
2724
+ foreach ( $responses as $key => $response ) {
2725
+
2726
+ if ( is_a( $response, 'Requests_Response' ) ) {
2727
+ $data[$key] = $response->body;
2728
+ }
2729
+ }
2730
+ } else {
2731
+ // Make Single Requests from array with 1 keys!
2732
+ if ( is_array( $feeds_mulit_data ) ) {
2733
+ foreach ( $feeds_mulit_data as $key => $url ) {
2734
+
2735
+ $single_response = \Requests::get( $url );
2736
+
2737
+ $data = array();
2738
+ if ( is_a( $single_response, 'Requests_Response' ) ) {
2739
+ $data[$key] = $single_response->body;
2740
+ }
2741
+ }
2742
+ } else {
2743
+ // Make Single request from just url!
2744
+ $single_response_url = $feeds_mulit_data;
2745
+
2746
+ if ( !empty( $single_response_url ) ) {
2747
+ $single_response = \Requests::get( $single_response_url );
2748
+
2749
+ if ( is_a( $single_response, 'Requests_Response' ) ) {
2750
+ $data['data'] = $single_response->body;
2751
+ }
2752
+ }
2753
+ }
2754
+ }
2755
+ // Do nothing if Curl was Successful!
2756
+ return $data;
2757
+ }
2758
+
2759
+ /**
2760
+ * FTS Create Feed Cache
2761
+ *
2762
+ * @param string $transient_name transient name.
2763
+ * @param array $response Data returned from response.
2764
+ * @since 1.9.6
2765
+ */
2766
+ public function fts_create_feed_cache ($transient_name, $response)
2767
+ {
2768
+ $cache_time_limit = true === get_option( 'fts_clear_cache_developer_mode' ) && '1' !== get_option( 'fts_clear_cache_developer_mode' ) ? get_option( 'fts_clear_cache_developer_mode' ) : '900';
2769
+ set_transient( 'fts_' . $transient_name, $response, $cache_time_limit );
2770
+ }
2771
+
2772
+ /**
2773
+ * FTS Get Feed Cache
2774
+ *
2775
+ * @param string $transient_name transient name.
2776
+ * @return mixed
2777
+ * @since 1.9.6
2778
+ */
2779
+ public function fts_get_feed_cache ($transient_name)
2780
+ {
2781
+ $returned_cache_data = get_transient( 'fts_' . $transient_name );
2782
+ return $returned_cache_data;
2783
+ }
2784
+
2785
+ /**
2786
+ * FTS Check Feed Cache Exists
2787
+ *
2788
+ * @param string $transient_name transient name.
2789
+ * @return bool
2790
+ * @since 1.9.6
2791
+ */
2792
+ public function fts_check_feed_cache_exists ($transient_name)
2793
+ {
2794
+ if ( false === get_transient( 'fts_' . $transient_name ) ) {
2795
+ return false;
2796
+ }
2797
+ return true;
2798
+ }
2799
+
2800
+ /**
2801
+ * FTS Clear Cache Ajax
2802
+ *
2803
+ * @since 1.9.6
2804
+ */
2805
+ public function fts_clear_cache_ajax ()
2806
+ {
2807
+ global $wpdb;
2808
+ // Clear UnExpired!
2809
+ $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->options WHERE option_name LIKE %s ", '_transient_fts_%' ) );
2810
+ // Clear Exired Transients!
2811
+ $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->options WHERE option_name LIKE %s ", '_transient_timeout_fts_%' ) );
2812
+ wp_reset_query();
2813
+ }
2814
+
2815
+ /**
2816
+ * Feed Them Clear Cache
2817
+ *
2818
+ * Clear Cache Folder.
2819
+ *
2820
+ * @return string
2821
+ * @since 1.9.6
2822
+ */
2823
+ public function feed_them_clear_cache ()
2824
+ {
2825
+ global $wpdb;
2826
+ // Clear UnExpired!
2827
+ $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->options WHERE option_name LIKE %s ", '_transient_fts_%' ) );
2828
+ // Clear Exired Transients!
2829
+ $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->options WHERE option_name LIKE %s ", '_transient_timeout_fts_%' ) );
2830
+ wp_reset_query();
2831
+ return 'Cache for all FTS Feeds cleared!';
2832
+ }
2833
+
2834
+ /**
2835
+ * FTS Admin Bar Menu
2836
+ *
2837
+ * Create our custom menu in the admin bar.
2838
+ *
2839
+ * @since 1.9.6
2840
+ */
2841
+ public function fts_admin_bar_menu ()
2842
+ {
2843
+ global $wp_admin_bar;
2844
+
2845
+ $fts_admin_bar_menu = get_option( 'fts_admin_bar_menu' );
2846
+ $fts_dev_mode_cache = get_option( 'fts_clear_cache_developer_mode' );
2847
+ if ( !is_super_admin() || !is_admin_bar_showing() || 'hide-admin-bar-menu' === $fts_admin_bar_menu ) {
2848
+ return;
2849
+ }
2850
+ $wp_admin_bar->add_menu(
2851
+ array(
2852
+ 'id' => 'feed_them_social_admin_bar',
2853
+ 'title' => __( 'Feed Them Social', 'feed-them-social' ),
2854
+ 'href' => false,
2855
+ )
2856
+ );
2857
+ if ( '1' === $fts_dev_mode_cache ) {
2858
+ $wp_admin_bar->add_menu(
2859
+ array(
2860
+ 'id' => 'feed_them_social_admin_bar_clear_cache',
2861
+ 'parent' => 'feed_them_social_admin_bar',
2862
+ 'title' => __( 'Cache clears on page refresh now', 'feed-them-social' ),
2863
+ 'href' => false,
2864
+ )
2865
+ );
2866
+ } else {
2867
+ $wp_admin_bar->add_menu(
2868
+ array(
2869
+ 'id' => 'feed_them_social_admin_set_cache',
2870
+ 'parent' => 'feed_them_social_admin_bar',
2871
+ 'title' => __( 'Clear Cache', 'feed-them-social' ),
2872
+ 'href' => '#',
2873
+ )
2874
+ );
2875
+ }
2876
+ $wp_admin_bar->add_menu(
2877
+ array(
2878
+ 'id' => 'feed_them_social_admin_bar_set_cache',
2879
+ 'parent' => 'feed_them_social_admin_bar',
2880
+ 'title' => sprintf(
2881
+ __( 'Set Cache Time %1$s%2$s%3$s', 'feed-them-social' ),
2882
+ '<span>',
2883
+ $this->fts_cachetime_amount( get_option( 'fts_clear_cache_developer_mode' ) ),
2884
+ '</span>'
2885
+ ),
2886
+ 'href' => admin_url( 'admin.php?page=feed-them-settings-page&tab=global_options' ),
2887
+
2888
+ )
2889
+ );
2890
+ $wp_admin_bar->add_menu(
2891
+ array(
2892
+ 'id' => 'feed_them_social_admin_bar_settings',
2893
+ 'parent' => 'feed_them_social_admin_bar',
2894
+ 'title' => __( 'Settings', 'feed-them-social' ),
2895
+ 'href' => admin_url( 'admin.php?page=feed-them-settings-page' ),
2896
+ )
2897
+ );
2898
+ $wp_admin_bar->add_menu(
2899
+ array(
2900
+ 'id' => 'feed_them_social_admin_bar_global_options',
2901
+ 'parent' => 'feed_them_social_admin_bar',
2902
+ 'title' => __( 'Global Options', 'feed-them-social' ),
2903
+ 'href' => admin_url( 'admin.php?page=feed-them-settings-page&tab=global_options' ),
2904
+ )
2905
+ );
2906
+ }
2907
+
2908
+ /**
2909
+ * FTS Cachetime amount
2910
+ *
2911
+ * @param string $fts_cachetime Cache time.
2912
+ * @return mixed
2913
+ * @since
2914
+ */
2915
+ public function fts_cachetime_amount ($fts_cachetime)
2916
+ {
2917
+ switch ($fts_cachetime) {
2918
+ case '1':
2919
+ $fts_display_cache_time = __( 'Clear cache on every page load', 'feed-them-social' );
2920
+ break;
2921
+ default:
2922
+ case '86400':
2923
+ $fts_display_cache_time = __( '1 Day (Default)', 'feed-them-social' );
2924
+ break;
2925
+ case '172800':
2926
+ $fts_display_cache_time = __( '2 Days', 'feed-them-social' );
2927
+ break;
2928
+ case '259200':
2929
+ $fts_display_cache_time = __( '3 Days', 'feed-them-social' );
2930
+ break;
2931
+ case '604800':
2932
+ $fts_display_cache_time = __( '1 Week', 'feed-them-social' );
2933
+ break;
2934
+ case '1209600':
2935
+ $fts_display_cache_time = __( '2 Weeks', 'feed-them-social' );
2936
+ break;
2937
+ }
2938
+ return $fts_display_cache_time;
2939
+ }
2940
+
2941
+ /**
2942
+ * XML json Parse
2943
+ *
2944
+ * @param string $url string to parse the content for.
2945
+ * @return mixed
2946
+ * @since 1.9.6
2947
+ */
2948
+ public function xml_json_parse ($url)
2949
+ {
2950
+ $url_to_get['url'] = $url;
2951
+ $file_contents_returned = $this->fts_get_feed_json( $url_to_get );
2952
+ $file_contents = $file_contents_returned['url'];
2953
+ $file_contents = str_replace( array("\n", "\r", "\t"), '', $file_contents );
2954
+ $file_contents = trim( str_replace( '"', "'", $file_contents ) );
2955
+ $simple_xml = simplexml_load_string( $file_contents );
2956
+ $encoded_json = json_encode( $simple_xml );
2957
+
2958
+ return $encoded_json;
2959
+ }
2960
+
2961
+ /**
2962
+ * FTS Ago
2963
+ *
2964
+ * Create date format like fb and twitter. Thanks: http://php.quicoto.com/how-to-calculate-relative-time-like-facebook/ .
2965
+ *
2966
+ * @param string $timestamp Timestamp!
2967
+ * @return string
2968
+ * @since 1.9.6
2969
+ */
2970
+ function fts_ago ($timestamp)
2971
+ {
2972
+ // not setting isset'ing anything because you have to save the settings page to even enable this feature
2973
+ $fts_language_second = get_option( 'fts_language_second' );
2974
+ if ( empty( $fts_language_second ) ) {
2975
+ $fts_language_second = 'second';
2976
+ }
2977
+ $fts_language_seconds = get_option( 'fts_language_seconds' );
2978
+ if ( empty( $fts_language_seconds ) ) {
2979
+ $fts_language_seconds = 'seconds';
2980
+ }
2981
+ $fts_language_minute = get_option( 'fts_language_minute' );
2982
+ if ( empty( $fts_language_minute ) ) {
2983
+ $fts_language_minute = 'minute';
2984
+ }
2985
+ $fts_language_minutes = get_option( 'fts_language_minutes' );
2986
+ if ( empty( $fts_language_minute ) ) {
2987
+ $fts_language_minute = 'minutes';
2988
+ }
2989
+ $fts_language_hour = get_option( 'fts_language_hour' );
2990
+ if ( empty( $fts_language_hour ) ) {
2991
+ $fts_language_hour = 'hour';
2992
+ }
2993
+ $fts_language_hours = get_option( 'fts_language_hours' );
2994
+ if ( empty( $fts_language_hours ) ) {
2995
+ $fts_language_hours = 'hours';
2996
+ }
2997
+ $fts_language_day = get_option( 'fts_language_day' );
2998
+ if ( empty( $fts_language_day ) ) {
2999
+ $fts_language_day = 'day';
3000
+ }
3001
+ $fts_language_days = get_option( 'fts_language_days' );
3002
+ if ( empty( $fts_language_days ) ) {
3003
+ $fts_language_days = 'days';
3004
+ }
3005
+ $fts_language_week = get_option( 'fts_language_week' );
3006
+ if ( empty( $fts_language_week ) ) {
3007
+ $fts_language_week = 'week';
3008
+ }
3009
+ $fts_language_weeks = get_option( 'fts_language_weeks' );
3010
+ if ( empty( $fts_language_weeks ) ) {
3011
+ $fts_language_weeks = 'weeks';
3012
+ }
3013
+ $fts_language_month = get_option( 'fts_language_month' );
3014
+ if ( empty( $fts_language_month ) ) {
3015
+ $fts_language_month = 'month';
3016
+ }
3017
+ $fts_language_months = get_option( 'fts_language_months' );
3018
+ if ( empty( $fts_language_months ) ) {
3019
+ $fts_language_months = 'months';
3020
+ }
3021
+ $fts_language_year = get_option( 'fts_language_year' );
3022
+ if ( empty( $fts_language_year ) ) {
3023
+ $fts_language_year = 'year';
3024
+ }
3025
+ $fts_language_years = get_option( 'fts_language_years' );
3026
+ if ( empty( $fts_language_years ) ) {
3027
+ $fts_language_years = 'years';
3028
+ }
3029
+ $fts_language_ago = get_option( 'fts_language_ago' );
3030
+ if ( empty( $fts_language_ago ) ) {
3031
+ $fts_language_ago = 'ago';
3032
+ }
3033
+
3034
+ // $periods = array( "sec", "min", "hour", "day", "week", "month", "years", "decade" );.
3035
+ $periods = array($fts_language_second, $fts_language_minute, $fts_language_hour, $fts_language_day, $fts_language_week, $fts_language_month, $fts_language_year, 'decade');
3036
+ $periods_plural = array($fts_language_seconds, $fts_language_minutes, $fts_language_hours, $fts_language_days, $fts_language_weeks, $fts_language_months, $fts_language_years, 'decades');
3037
+
3038
+ if ( !is_numeric( $timestamp ) ) {
3039
+ $timestamp = strtotime( $timestamp );
3040
+ if ( !is_numeric( $timestamp ) ) {
3041
+ return '';
3042
+ }
3043
+ }
3044
+ $difference = time() - $timestamp;
3045
+ // Customize in your own language. Why thank-you I will.
3046
+ $lengths = array('60', '60', '24', '7', '4.35', '12', '10');
3047
+
3048
+ if ( $difference > 0 ) {
3049
+ // this was in the past
3050
+ $ending = $fts_language_ago;
3051
+ } else {
3052
+ // this was in the future
3053
+ $difference = -$difference;
3054
+ // not doing dates in the future for posts
3055
+ $ending = 'to go';
3056
+ }
3057
+ for ( $j = 0; $difference >= $lengths[$j] && $j < count( $lengths ) - 1; $j++ ) {
3058
+ $difference /= $lengths[$j];
3059
+ }
3060
+
3061
+ $difference = round( $difference );
3062
+
3063
+ if ( $difference > 1 ) {
3064
+ $periods[$j] = $periods_plural[$j];
3065
+ }
3066
+
3067
+ return "$difference $periods[$j] $ending";
3068
+ }
3069
+
3070
+ /**
3071
+ * FTS Custom Date
3072
+ *
3073
+ * @param string $created_time Created time.
3074
+ * @param string $feed_type Feed type.
3075
+ * @return string
3076
+ * @since 1.9.6
3077
+ */
3078
+ public function fts_custom_date ($created_time, $feed_type)
3079
+ {
3080
+ $fts_custom_date = get_option( 'fts-custom-date' );
3081
+ $fts_custom_time = get_option( 'fts-custom-time' );
3082
+ $custom_date_check = get_option( 'fts-date-and-time-format' );
3083
+ $fts_twitter_offset_time = get_option( 'fts_twitter_time_offset' );
3084
+ $fts_timezone = get_option( 'fts-timezone' );
3085
+
3086
+ if ( '' === $fts_custom_date && '' === $fts_custom_time ) {
3087
+ $custom_date_check = $custom_date_check;
3088
+ } elseif ( '' !== $fts_custom_date || '' !== $fts_custom_time ) {
3089
+ $custom_date_check = $fts_custom_date . ' ' . $fts_custom_time;
3090
+ } else {
3091
+ $custom_date_check = 'F jS, Y \a\t g:ia';
3092
+ }
3093
+ if ( !empty( $fts_timezone ) ) {
3094
+ date_default_timezone_set( $fts_timezone );
3095
+ }
3096
+ // Twitter date time!
3097
+ if ( 'twitter' === $feed_type ) {
3098
+
3099
+ $fts_twitter_offset_time_final = 1 === $fts_twitter_offset_time ? strtotime( $created_time ) : strtotime( $created_time ) - 3 * 3600;
3100
+
3101
+ if ( 'one-day-ago' === $custom_date_check ) {
3102
+ $u_time = $this->fts_ago( $created_time );
3103
+ } else {
3104
+ $u_time = !empty( $custom_date_check ) ? date_i18n( $custom_date_check, $fts_twitter_offset_time_final ) : $this->fts_ago( $created_time );
3105
+ }
3106
+ }
3107
+ // Instagram date time!
3108
+ if ( 'instagram' === $feed_type ) {
3109
+ if ( 'one-day-ago' === $custom_date_check ) {
3110
+ $u_time = $this->fts_ago( $created_time );
3111
+ } else {
3112
+ $u_time = !empty( $custom_date_check ) ? date_i18n( $custom_date_check, $created_time ) : $this->fts_ago( $created_time );
3113
+ }
3114
+ }
3115
+ // Youtube and Pinterest date time!
3116
+ if ( 'pinterest' === $feed_type ) {
3117
+ if ( 'one-day-ago' === $custom_date_check ) {
3118
+ $u_time = $this->fts_ago( $created_time );
3119
+ } else {
3120
+ $u_time = !empty( $custom_date_check ) ? date_i18n( $custom_date_check, strtotime( $created_time ) ) : $this->fts_ago( $created_time );
3121
+ }
3122
+ }
3123
+ // WP Gallery and Pinterest date time!
3124
+ if ( 'wp_gallery' === $feed_type ) {
3125
+ if ( 'one-day-ago' === $custom_date_check ) {
3126
+ $u_time = $this->fts_ago( $created_time );
3127
+ } else {
3128
+ $u_time = !empty( $custom_date_check ) ? date_i18n( $custom_date_check, strtotime( $created_time ) ) : $this->fts_ago( $created_time );
3129
+ }
3130
+ }
3131
+ // Facebook date time!
3132
+ if ( 'facebook' === $feed_type ) {
3133
+ $time_set = $fts_timezone;
3134
+ $time_set_check = isset( $time_set ) ? $time_set : 'America/New_York';
3135
+ date_default_timezone_set( $time_set_check );
3136
+
3137
+ if ( 'one-day-ago' === $custom_date_check ) {
3138
+ $u_time = $this->fts_ago( $created_time );
3139
+ } else {
3140
+ $u_time = !empty( $custom_date_check ) ? date_i18n( $custom_date_check, $created_time ) : $this->fts_ago( $created_time );
3141
+ }
3142
+ }
3143
+ // Instagram date time!
3144
+ if ( 'youtube' === $feed_type ) {
3145
+ if ( 'one-day-ago' === $custom_date_check ) {
3146
+ $u_time = $this->fts_ago( $created_time );
3147
+ } else {
3148
+ $u_time = !empty( $custom_date_check ) ? date_i18n( $custom_date_check, strtotime( $created_time ) ) : $this->fts_ago( $created_time );
3149
+ }
3150
+ }
3151
+ // Return the time!
3152
+ return $u_time;
3153
+ }
3154
+
3155
+ /**
3156
+ * Random String generator For All Feeds
3157
+ *
3158
+ * @param int $length Random string length.
3159
+ * @return string
3160
+ * @since 2.0.7
3161
+ */
3162
+ public function feed_them_social_rand_string ($length = 10)
3163
+ {
3164
+ $characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
3165
+ $characters_length = strlen( $characters );
3166
+ $random_string = '';
3167
+ for ( $i = 0; $i < $length; $i++ ) {
3168
+ $random_string .= $characters[wp_rand( 0, $characters_length - 1 )];
3169
+ }
3170
+ return $random_string;
3171
+ }
3172
+
3173
+
3174
+ /**
3175
+ * FTS Refresh YouTube Token
3176
+ *
3177
+ * @since 2.3.3
3178
+ */
3179
+ public function fts_refresh_token_ajax ()
3180
+ {
3181
+
3182
+ $fts_refresh_token_nonce = wp_create_nonce( 'fts_refresh_token_nonce' );
3183
+
3184
+ if ( wp_verify_nonce( $fts_refresh_token_nonce, 'fts_refresh_token_nonce' ) ) {
3185
+ if ( isset( $_REQUEST['refresh_token'], $_REQUEST['button_pushed'] ) && 'yes' === $_REQUEST['button_pushed'] ) {
3186
+ update_option( 'youtube_custom_refresh_token', sanitize_text_field( wp_unslash( $_REQUEST['refresh_token'] ) ) );
3187
+ }
3188
+ if ( isset( $_REQUEST['access_token'] ) ) {
3189
+ update_option( 'youtube_custom_access_token', sanitize_text_field( wp_unslash( $_REQUEST['access_token'] ) ) );
3190
+ }
3191
+ $startoftime = isset( $_REQUEST['expires_in'] ) ? strtotime( '+' . sanitize_text_field( wp_unslash( $_REQUEST['expires_in'] ) ) . ' seconds' ) : '';
3192
+ $start_of_time_final = false !== $startoftime ? sanitize_key( $startoftime ) : '';
3193
+ update_option( 'youtube_custom_token_exp_time', $start_of_time_final );
3194
+
3195
+ // This only happens if the token is expired on the YouTube Options page and you go to re-save or refresh the page for some reason. It will also run this function if the cache is emptied and the token is found to be expired.
3196
+ if ( 'no' === $_REQUEST['button_pushed'] ) {
3197
+ return 'Token Refreshed';
3198
+ // $output .= do_shortcode('[fts _youtube vid_count=3 large_vid=no large_vid_title=no large_vid_description=no thumbs_play_in_iframe=popup vids_in_row=3 space_between_videos=1px force_columns=yes maxres_thumbnail_images=yes thumbs_wrap_color=#000 wrap=none video_wrap_display=none comments_count=12 channel_id=UCqhnX4jA0A5paNd1v-zEysw loadmore=button loadmore_count=5 loadmore_btn_maxwidth=300px loadmore_btn_margin=10px]');
3199
+ }
3200
+ }
3201
+
3202
+ }
3203
+
3204
+ /**
3205
+ * FTS Check YouTube Token Validity
3206
+ *
3207
+ * @since 2.3.3
3208
+ */
3209
+ public function feed_them_youtube_refresh_token ()
3210
+ {
3211
+
3212
+ $fts_refresh_token_nonce = wp_create_nonce( 'fts_refresh_token_nonce' );
3213
+
3214
+ if ( wp_verify_nonce( $fts_refresh_token_nonce, 'fts_refresh_token_nonce' ) ) {
3215
+
3216
+ // Used some methods from this link http://ieg.wnet.org/2015/09/using-oauth-in-wordpress-plugins-part-2-persistence/
3217
+ // save all 3 get options: happens when clicking the get access token button on the youtube options page!
3218
+ if ( isset( $_GET['refresh_token'], $_GET['access_token'] ) && isset( $_GET['expires_in'] ) ) {
3219
+ $button_pushed = 'yes';
3220
+ $clienttoken_post['refresh_token'] = sanitize_text_field( wp_unslash( $_GET['refresh_token'] ) );
3221
+ $auth_obj['access_token'] = sanitize_text_field( wp_unslash( $_GET['access_token'] ) );
3222
+ $auth_obj['expires_in'] = sanitize_key( wp_unslash( $_GET['expires_in'] ) );
3223
+ } else {
3224
+ // refresh token!
3225
+ $button_pushed = 'no';
3226
+ $oauth2token_url = 'https://accounts.google.com/o/oauth2/token';
3227
+ $clienttoken_post = array(
3228
+ 'client_id' => '802796800957-6nannpdq8h8l720ls430ahnnq063n22u.apps.googleusercontent.com',
3229
+ 'client_secret' => 'CbieVhgOudjrpya1IDpv3uRa',
3230
+ );
3231
+ // The "refresh token" grant type is to use a refresh token to get a new access token!
3232
+ $clienttoken_post['refresh_token'] = get_option( 'youtube_custom_refresh_token' );
3233
+ $clienttoken_post['grant_type'] = 'refresh_token';
3234
+
3235
+ $postargs = array(
3236
+ 'body' => $clienttoken_post,
3237
+ );
3238
+ $response = wp_remote_post( $oauth2token_url, $postargs );
3239
+ $auth_obj = json_decode( wp_remote_retrieve_body( $response ), true );
3240
+ }
3241
+ ?>
3242
+ <script>
3243
+ jQuery(document).ready(function () {
3244
+ jQuery.ajax({
3245
+ data: {
3246
+ action: "fts_refresh_token_ajax",
3247
+ refresh_token: '<?php echo esc_js( $clienttoken_post['refresh_token'] ); ?>',
3248
+ access_token: '<?php echo esc_js( $auth_obj['access_token'] ); ?>',
3249
+ expires_in: '<?php echo esc_js( $auth_obj['expires_in'] ); ?>',
3250
+ button_pushed: '<?php echo esc_js( $button_pushed ); ?>'
3251
+ },
3252
+ type: 'POST',
3253
+ url: ftsAjax.ajaxurl,
3254
+ success: function (response) {
3255
+ console.log(response);
3256
+ <?php
3257
+ if ( isset( $_GET['page'] ) && 'fts-youtube-feed-styles-submenu-page' === $_GET['page'] ) {
3258
+ foreach ( $auth_obj as $user_id ) {
3259
+ if ( !isset( $user_id->error->errors[0]->reason ) ) {
3260
+ $type_of_key = __( 'API key', 'feed-them-social' );
3261
+ } elseif ( !isset( $user_id->error->errors[0]->reason ) && !empty( $youtube_access_token ) ) {
3262
+ $type_of_key = __( 'Access Token', 'feed-them-social' );
3263
+ }
3264
+
3265
+ // Error Check!
3266
+ if ( !isset( $auth_obj->error->errors[0]->reason ) ) {
3267
+ $fts_youtube_message = sprintf(
3268
+ esc_html( '%1$s Your %2$s is working! Generate your shortcode on the %3$s settings page.%4$s %5$s', 'feed-them-social' ),
3269
+ '<div class="fts-successful-api-token">',
3270
+ esc_html( $type_of_key ),
3271
+ '<a href="' . esc_url( 'admin.php?page=feed-them-settings-page' ) . '">',
3272
+ '</a>',
3273
+ '</div><div class="clear"></div>'
3274
+ );
3275
+ } elseif ( isset( $user_id->error->errors[0]->reason ) ) {
3276
+ $fts_youtube_message = sprintf(
3277
+ esc_html( '%1$s This %2$s does not appear to be valid. YouTube responded with: %3$s %4$s ', 'feed-them-social' ),
3278
+ '<div class="fts-failed-api-token">',
3279
+ esc_html( $type_of_key ),
3280
+ esc_html( $user_id->errors[0]->reason ),
3281
+ '</div><div class="clear"></div>'
3282
+ );
3283
+ }
3284
+
3285
+ break;
3286
+ }
3287
+
3288
+ ?>
3289
+ jQuery('#youtube_custom_access_token, #youtube_custom_token_exp_time').val('');
3290
+
3291
+ <?php if ( isset( $_GET['refresh_token'], $_GET['access_token'] ) && isset( $_GET['expires_in'] ) ) { ?>
3292
+ jQuery('#youtube_custom_refresh_token').val(jQuery('#youtube_custom_refresh_token').val() + '<?php echo esc_js( $clienttoken_post['refresh_token'] ); ?>');
3293
+ jQuery('.fts-failed-api-token').hide();
3294
+
3295
+ if (!jQuery('.fts-successful-api-token').length) {
3296
+ jQuery('.fts-youtube-last-row').append('<?php echo $fts_youtube_message; ?>');
3297
+ }
3298
+ <?php
3299
+ } else {
3300
+ ?>
3301
+ if (jQuery('.fts-failed-api-token').length) {
3302
+ jQuery('.fts-youtube-last-row').append('<?php echo $fts_youtube_message; ?>');
3303
+ jQuery('.fts-failed-api-token').hide();
3304
+ }
3305
+ <?php } ?>
3306
+
3307
+ jQuery('#youtube_custom_access_token').val(jQuery('#youtube_custom_access_token').val() + '<?php echo esc_js( $auth_obj['access_token'] ); ?>');
3308
+ jQuery('#youtube_custom_token_exp_time').val(jQuery('#youtube_custom_token_exp_time').val() + '<?php echo esc_js( strtotime( '+' . $auth_obj['expires_in'] . ' seconds' ) ); ?>');
3309
+ jQuery('<div class="fa fa-check-circle fa-3x fa-fw fts-success"></div>').insertBefore('.hide-button-tokens-options .feed-them-social-admin-input-wrap .fts-clear');
3310
+ jQuery('.fts-success').fadeIn('slow');
3311
+ <?php } ?>
3312
+ return false;
3313
+ }
3314
+ }); // end of ajax()
3315
+ return false;
3316
+ }); // end of document.ready
3317
+ </script>
3318
+ <?php
3319
+ return $auth_obj['access_token'];
3320
+ }
3321
+ }
3322
+
3323
+
3324
+ /**
3325
+ * FTS YouTube Link Filter
3326
+ *
3327
+ * @param string $youtube_description youtube description.
3328
+ * @return string
3329
+ * @since 1.9.6
3330
+ */
3331
+ public function fts_youtube_link_filter ($youtube_description)
3332
+ {
3333
+ // Converts URLs to Links!
3334
+ $youtube_description = preg_replace( '@(?!(?!.*?<a)[^<]*<\/a>)(?:(?:https?|ftp|file)://|www\.|ftp\.)[-A-‌​Z0-9+&#/%=~_|$?!:,.]*[A-Z0-9+&#/%=~_|$]@i', '<a href="\0" target="_blank">\0</a>', $youtube_description );
3335
+
3336
+ $splitano = explode( 'www', $youtube_description );
3337
+ $count = count( $splitano );
3338
+ $return_value = '';
3339
+
3340
+ for ( $i = 0; $i < $count; $i++ ) {
3341
+ if ( 'href=' === substr( $splitano[$i], -6, 5 ) ) {
3342
+ $return_value .= $splitano[$i] . 'http://www';
3343
+ } elseif ( $i < $count - 1 ) {
3344
+ $return_value .= $splitano[$i] . 'www';
3345
+ } else {
3346
+ $return_value .= $splitano[$i];
3347
+ }
3348
+ }
3349
+ return $return_value;
3350
+ }
3351
+
3352
+ /**
3353
+ * FTS Youtube Video and Wrap
3354
+ *
3355
+ * @param object $post_data post data.
3356
+ * @param string $username username.
3357
+ * @param string $playlist_id playlist id.
3358
+ * @since 1.9.6
3359
+ */
3360
+ public function fts_youtube_video_and_wrap ($post_data, $username, $playlist_id)
3361
+ {
3362
+ $ssl = is_ssl() ? 'https' : 'http';
3363
+ $youtube_video_user_or_playlist_url = isset( $post_data->snippet->resourceId->videoId ) ? $post_data->snippet->resourceId->videoId : '';
3364
+ $youtube_video_channel_url = isset( $post_data->id->videoId ) ? $post_data->id->videoId : '';
3365
+
3366
+ if ( '' !== $username || '' !== $playlist_id ) {
3367
+ $youtube_video_iframe = '<div class="fts-fluid-videoWrapper"><iframe src="' . esc_url( $ssl . '://www.youtube.com/embed/' . $youtube_video_user_or_playlist_url ) . '?wmode=transparent&HD=0&rel=0&showinfo=0&controls=1&autoplay=0" frameborder="0" allowfullscreen></iframe></div>';
3368
+
3369
+ } else {
3370
+ $youtube_video_iframe = '<div class="fts-fluid-videoWrapper"><iframe src="' . esc_url( $ssl . '://www.youtube.com/embed/' . $youtube_video_channel_url ) . '?wmode=transparent&HD=0&rel=0&showinfo=0&controls=1&autoplay=0" frameborder="0" allowfullscreen></iframe></div>';
3371
+ }
3372
+ return $youtube_video_iframe;
3373
+ }
3374
+
3375
+
3376
+ /**
3377
+ * Youtube Description
3378
+ *
3379
+ * @param object $post_data post data.
3380
+ * @return string
3381
+ * @since 1.9.6
3382
+ */
3383
+ public function fts_youtube_description ($post_data)
3384
+ {
3385
+
3386
+ $pinterest_description = isset( $post_data->snippet->description ) ? $post_data->snippet->description : '';
3387
+ return $pinterest_description;
3388
+ }
3389
+
3390
+ /**
3391
+ * Youtube Title
3392
+ *
3393
+ * @param object $post_data post data.
3394
+ * @return string
3395
+ * @since 1.9.6
3396
+ */
3397
+ public function fts_youtube_title ($post_data)
3398
+ {
3399
+ $youtube_post_title = isset( $post_data->snippet->title ) ? $post_data->snippet->title : '';
3400
+ return $youtube_post_title;
3401
+ }
3402
+
3403
+ /**
3404
+ * FTS Facebook Group Form
3405
+ *
3406
+ * @param bool $save_options Save Options.
3407
+ * @since 1.9.6
3408
+ */
3409
+ public function fts_facebook_group_form ($save_options = false)
3410
+ {
3411
+ // DEPRECIATED!
3412
+ }
3413
+
3414
+ public function fts_facebook_event_form ($save_options = false)
3415
+ {
3416
+ // DEPRECIATED!
3417
+ }
3418
  }//end class
3419
  ?>
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: slickremix
3
  Tags: Facebook, Instagram, Twitter, YouTube, Feed
4
  Requires at least: 3.6.0
5
- Tested up to: 4.9.8
6
- Stable tag: 2.6.0
7
  License: GPLv2 or later
8
 
9
  Custom feeds for Facebook Pages, Album Photos, Videos & Covers, Instagram, Twitter, Pinterest & YouTube on pages, posts or widgets.
@@ -75,6 +75,10 @@ Feed Them Social was Developed By SlickRemix --> [https://www.slickremix.com/](h
75
  * Log into WordPress dashboard then click **Plugins** > **Add new** > Then under the title "Install Plugins" click **Upload** > **choose the zip** > **Activate the plugin!**
76
 
77
  == Changelog ==
 
 
 
 
78
  = Version 2.6.0 Tuesday, December 4th, 2018 =
79
  * FIX: Global Options: Share button not hiding when option was checked.
80
  * FIX: Review Notice showing on activation.
2
  Contributors: slickremix
3
  Tags: Facebook, Instagram, Twitter, YouTube, Feed
4
  Requires at least: 3.6.0
5
+ Tested up to: 5.0.1
6
+ Stable tag: 2.6.1
7
  License: GPLv2 or later
8
 
9
  Custom feeds for Facebook Pages, Album Photos, Videos & Covers, Instagram, Twitter, Pinterest & YouTube on pages, posts or widgets.
75
  * Log into WordPress dashboard then click **Plugins** > **Add new** > Then under the title "Install Plugins" click **Upload** > **choose the zip** > **Activate the plugin!**
76
 
77
  == Changelog ==
78
+ = Version 2.6.1 Saturday, December 15th, 2018 =
79
+ * NEW: Instagram Options: After clicking the button to get an access token the information will now automatically save to the database.
80
+ * FIX: Instagram Options: Incorrect call to check error status.
81
+
82
  = Version 2.6.0 Tuesday, December 4th, 2018 =
83
  * FIX: Global Options: Share button not hiding when option was checked.
84
  * FIX: Review Notice showing on activation.