Custom Facebook Feed - Version 1.2.7

Version Description

  • Prevented likes and comments by the page author showing up in the feed
Download this release

Release Info

Developer smashballoon
Plugin Icon 128x128 Custom Facebook Feed
Version 1.2.7
Comparing to
See all releases

Code changes from version 1.2.5 to 1.2.7

README.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: smashballoon
3
  Tags: facebook, custom, customizable, feed, seo, search engine, responsive, mobile, shortcode, social, status
4
  Requires at least: 3.0
5
  Tested up to: 3.5.1
6
- Stable tag: 1.2.5
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -74,6 +74,12 @@ Yep. Comments will show up if you use the Access Token from an account which ha
74
 
75
  == Changelog ==
76
 
 
 
 
 
 
 
77
  = 1.2.5 =
78
  * Added clear fix
79
 
3
  Tags: facebook, custom, customizable, feed, seo, search engine, responsive, mobile, shortcode, social, status
4
  Requires at least: 3.0
5
  Tested up to: 3.5.1
6
+ Stable tag: 1.2.7
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
74
 
75
  == Changelog ==
76
 
77
+ = 1.2.7 =
78
+ * Prevented likes and comments by the page author showing up in the feed
79
+
80
+ = 1.2.6 =
81
+ * Added help link to settings page
82
+
83
  = 1.2.5 =
84
  * Added clear fix
85
 
custom-facebook-feed-admin.php CHANGED
@@ -140,8 +140,10 @@ function cff_settings_page() {
140
 
141
  </table>
142
 
143
- <?php submit_button(); ?>
144
-
 
 
145
 
146
  </form>
147
 
@@ -160,7 +162,7 @@ function cff_settings_page() {
160
  <br /><br /><a href="http://smashballoon.com/custom-facebook-feed/" target="_blank">Plugin Support</a>
161
 
162
  <br /><br /><br />
163
- <a href="http://smashballoon.com/custom-facebook-feed/" target="_blank"><img src="<?php echo plugins_url( 'img/pro.jpg' , __FILE__ ) ?>" /></a>
164
 
165
  <?php
166
  } //End Settings_Page
140
 
141
  </table>
142
 
143
+ <p style="margin: 25px 0 40px 0;">
144
+ <input type="submit" name="submit" id="submit" class="button button-primary" value="Save Changes">
145
+ &nbsp;&nbsp;<a href="http://smashballoon.com/custom-facebook-feed/troubleshooting" target="_blank"><b>HELP!</b> My feed is not showing up</a>
146
+ </p>
147
 
148
  </form>
149
 
162
  <br /><br /><a href="http://smashballoon.com/custom-facebook-feed/" target="_blank">Plugin Support</a>
163
 
164
  <br /><br /><br />
165
+ <a href="http://smashballoon.com/custom-facebook-feed/troubleshooting" target="_blank"><img src="<?php echo plugins_url( 'img/pro.jpg' , __FILE__ ) ?>" /></a>
166
 
167
  <?php
168
  } //End Settings_Page
custom-facebook-feed.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Custom Facebook Feed
4
  Plugin URI: http://smashballoon.com/custom-facebook-feed
5
  Description: Add a completely customizable Facebook feed to your WordPress site
6
- Version: 1.2.5
7
  Author: Smash Balloon
8
  Author URI: http://smashballoon.com/
9
  License: GPLv2 or later
@@ -73,72 +73,77 @@ function display_cff($atts) {
73
  //Explode News and Page ID's into 2 values
74
  $StatusID = explode("_", $news->id);
75
 
76
- //Start the container
77
- $content .= '<div class="cff-item">';
78
-
79
- //Text/title/description/date
80
- //Get text limits
81
- $title_limit = $atts['titlelength'];
82
- $body_limit = $atts['bodylength'];
83
-
84
- if (!empty($news->story)) {
85
- $story_text = $news->story;
86
- if (isset($title_limit) && $title_limit !== '') {
87
- if (strlen($story_text) > $title_limit) $story_text = substr($story_text, 0, $title_limit) . '...';
 
 
 
 
 
88
  }
89
- $content .= '<h4>' . $story_text . '</h4>';
90
- }
91
- if (!empty($news->message)) {
92
- $message_text = $news->message;
93
- if (isset($title_limit) && $title_limit !== '') {
94
- if (strlen($message_text) > $title_limit) $message_text = substr($message_text, 0, $title_limit) . '...';
95
  }
96
- $content .= '<h4>' . $message_text . '</h4>';
97
- }
98
- if (!empty($news->description)) {
99
- $description_text = $news->description;
100
- if (isset($body_limit) && $body_limit !== '') {
101
- if (strlen($description_text) > $body_limit) $description_text = substr($description_text, 0, $body_limit) . '...';
102
  }
103
- $content .= '<p>' . $description_text . '</p>';
104
- }
105
 
106
 
107
- //Posted on
108
- $content .= '<p class="cff-date">Posted '. timeSince(strtotime($news->created_time)) . ' ago</p>';
109
 
110
 
111
- //Check whether it's a shared link
112
- if ($news->type == 'link') {
113
- $content .= '<a href="'.$news->link.'"><img src="'. $picture_b .'" border="0" style="padding-right:10px;" /></a>';
114
 
115
- //Display link name and description
116
- if (!empty($news->description)) {
117
- $content .= '<a href="'.$news->link.'">'. '<b>' . $news->name . '</b></a>';
 
118
  }
119
- }
120
 
121
 
122
- //Show link
123
- if (!empty($news->link)) {
124
- $link = $news->link;
125
 
126
- //Check whether it links to facebook or somewhere else
127
- $facebook_str = 'facebook.com';
128
 
129
- if(stripos($link, $facebook_str) !== false) {
130
- $link_text = 'View on Facebook';
131
- } else {
132
- $link_text = 'View Link';
 
 
133
  }
134
- $content .= '<a class="cff-viewpost" href="' . $link . '" title="' . $link_text . '">' . $link_text . '</a>';
135
- }
136
 
137
 
138
- //End item
139
- $content .= '</div> <!-- end .cff-item -->';
 
 
140
 
141
- };
142
 
143
 
144
  //Add the Like Box
3
  Plugin Name: Custom Facebook Feed
4
  Plugin URI: http://smashballoon.com/custom-facebook-feed
5
  Description: Add a completely customizable Facebook feed to your WordPress site
6
+ Version: 1.2.7
7
  Author: Smash Balloon
8
  Author URI: http://smashballoon.com/
9
  License: GPLv2 or later
73
  //Explode News and Page ID's into 2 values
74
  $StatusID = explode("_", $news->id);
75
 
76
+ //Check whether it's a status (author comment or like)
77
+ if ($news->type !== 'status') {
78
+ //If it isn't then create the post
79
+ //Start the container
80
+ $content .= '<div class="cff-item">';
81
+
82
+ //Text/title/description/date
83
+ //Get text limits
84
+ $title_limit = $atts['titlelength'];
85
+ $body_limit = $atts['bodylength'];
86
+
87
+ if (!empty($news->story)) {
88
+ $story_text = $news->story;
89
+ if (isset($title_limit) && $title_limit !== '') {
90
+ if (strlen($story_text) > $title_limit) $story_text = substr($story_text, 0, $title_limit) . '...';
91
+ }
92
+ $content .= '<h4>' . $story_text . '</h4>';
93
  }
94
+ if (!empty($news->message)) {
95
+ $message_text = $news->message;
96
+ if (isset($title_limit) && $title_limit !== '') {
97
+ if (strlen($message_text) > $title_limit) $message_text = substr($message_text, 0, $title_limit) . '...';
98
+ }
99
+ $content .= '<h4>' . $message_text . '</h4>';
100
  }
101
+ if (!empty($news->description)) {
102
+ $description_text = $news->description;
103
+ if (isset($body_limit) && $body_limit !== '') {
104
+ if (strlen($description_text) > $body_limit) $description_text = substr($description_text, 0, $body_limit) . '...';
105
+ }
106
+ $content .= '<p>' . $description_text . '</p>';
107
  }
 
 
108
 
109
 
110
+ //Posted on
111
+ $content .= '<p class="cff-date">Posted '. timeSince(strtotime($news->created_time)) . ' ago</p>';
112
 
113
 
114
+ //Check whether it's a shared link
115
+ if ($news->type == 'link') {
116
+ $content .= '<a href="'.$news->link.'"><img src="'. $picture_b .'" border="0" style="padding-right:10px;" /></a>';
117
 
118
+ //Display link name and description
119
+ if (!empty($news->description)) {
120
+ $content .= '<a href="'.$news->link.'">'. '<b>' . $news->name . '</b></a>';
121
+ }
122
  }
 
123
 
124
 
125
+ //Show link
126
+ if (!empty($news->link)) {
127
+ $link = $news->link;
128
 
129
+ //Check whether it links to facebook or somewhere else
130
+ $facebook_str = 'facebook.com';
131
 
132
+ if(stripos($link, $facebook_str) !== false) {
133
+ $link_text = 'View on Facebook';
134
+ } else {
135
+ $link_text = 'View Link';
136
+ }
137
+ $content .= '<a class="cff-viewpost" href="' . $link . '" title="' . $link_text . '">' . $link_text . '</a>';
138
  }
 
 
139
 
140
 
141
+ //End item
142
+ $content .= '</div> <!-- end .cff-item -->';
143
+
144
+ } //End status check
145
 
146
+ } //End the loop
147
 
148
 
149
  //Add the Like Box