1 | <?php
|
---|
2 | /*
|
---|
3 | Plugin Name: BFA Recent Comments Widget
|
---|
4 | Plugin URI: http://wordpress.bytesforall.com/
|
---|
5 | Description: Highly configurable WordPress widget that shows a list of recent comments.
|
---|
6 | Version: 1.0
|
---|
7 | Author: BFA Webdesign
|
---|
8 | Author URI: http://www.bytesforall.com/
|
---|
9 | */
|
---|
10 |
|
---|
11 | /*
|
---|
12 | Based on v0.2.4 of Recent Comments Widget by Mika Perälä
|
---|
13 | http://mika.kfib.org/
|
---|
14 |
|
---|
15 | Based on v0.1.1 of the Simple Recent Comments-plugin by Raoul
|
---|
16 | http://www.raoul.shacknet.nu/
|
---|
17 |
|
---|
18 | License: GPL
|
---|
19 | Compatibility: WordPress 2.2 or newer.
|
---|
20 |
|
---|
21 | Installation:
|
---|
22 | Place the widget_simple_recent_comments.php file in your /wp-content/plugins/widgets/ directory
|
---|
23 | and activate through the administration panel, and then go to the widget panel and
|
---|
24 | drag it to where you would like to have it!
|
---|
25 | */
|
---|
26 |
|
---|
27 | /* Copyright BFA Webdesign - http://wordpress.bytesforall.com/
|
---|
28 |
|
---|
29 | This program is free software; you can redistribute it and/or modify
|
---|
30 | it under the terms of the GNU General Public License as published by
|
---|
31 | the Free Software Foundation; either version 2 of the License, or
|
---|
32 | (at your option) any later version.
|
---|
33 |
|
---|
34 | This program is distributed in the hope that it will be useful,
|
---|
35 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
36 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
37 | GNU General Public License for more details.
|
---|
38 |
|
---|
39 | You should have received a copy of the GNU General Public License
|
---|
40 | along with this program; if not, write to the Free Software
|
---|
41 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
42 | */
|
---|
43 |
|
---|
44 |
|
---|
45 | /* Changelog
|
---|
46 | * Fri Aug 22 2008 - v1.0
|
---|
47 | - Initial release
|
---|
48 | */
|
---|
49 |
|
---|
50 |
|
---|
51 |
|
---|
52 | // Check for the required plugin functions. This will prevent fatal
|
---|
53 | // errors occurring when you deactivate the dynamic-sidebar plugin.
|
---|
54 | if ( !function_exists('register_sidebar_widget') )
|
---|
55 | return;
|
---|
56 |
|
---|
57 | // This is the function that outputs our little widget
|
---|
58 | function widget_simple_recent_comments($args) {
|
---|
59 | extract($args);
|
---|
60 |
|
---|
61 | // Fetch our parameters
|
---|
62 | $bfa_rc_options = get_option('widget_simple_recent_comments');
|
---|
63 | $bfa_rc_title = $bfa_rc_options['bfa_rc_title'];
|
---|
64 | $bfa_rc_src_count = $bfa_rc_options['bfa_rc_src_count'];
|
---|
65 | $bfa_rc_src_length = $bfa_rc_options['bfa_rc_src_length'];
|
---|
66 | $bfa_rc_linking_scheme = $bfa_rc_options['bfa_rc_linking_scheme'];
|
---|
67 | $point_first_link = $bfa_rc_options['point_first_link'];
|
---|
68 | $point_second_link = $bfa_rc_options['point_second_link'];
|
---|
69 | $add_dots = $bfa_rc_options['add_dots'];
|
---|
70 | $limit_by = $bfa_rc_options['limit_by'];
|
---|
71 | $author_bold = $bfa_rc_options['author_bold'];
|
---|
72 | $author_em = $bfa_rc_options['author_em'];
|
---|
73 | $comment_bold = $bfa_rc_options['comment_bold'];
|
---|
74 | $comment_em = $bfa_rc_options['comment_em'];
|
---|
75 | $post_bold = $bfa_rc_options['post_bold'];
|
---|
76 | $post_em = $bfa_rc_options['post_em'];
|
---|
77 | $author_nofollow = $bfa_rc_options['author_nofollow'];
|
---|
78 | $bfa_rc_pre_HTML = $bfa_rc_options['bfa_rc_pre_HTML'];
|
---|
79 | $bfa_rc_post_HTML = $bfa_rc_options['bfa_rc_post_HTML'];
|
---|
80 | $bfa_rc_display_homepage = $bfa_rc_options['bfa_rc_display_homepage'];
|
---|
81 | $bfa_rc_display_category = $bfa_rc_options['bfa_rc_display_category'];
|
---|
82 | $bfa_rc_display_post = $bfa_rc_options['bfa_rc_display_post'];
|
---|
83 | $bfa_rc_display_page = $bfa_rc_options['bfa_rc_display_page'];
|
---|
84 | $bfa_rc_display_archive = $bfa_rc_options['bfa_rc_display_archive'];
|
---|
85 | $bfa_rc_display_tag = $bfa_rc_options['bfa_rc_display_tag'];
|
---|
86 | $bfa_rc_display_search = $bfa_rc_options['bfa_rc_display_search'];
|
---|
87 | $bfa_rc_display_author = $bfa_rc_options['bfa_rc_display_author'];
|
---|
88 | $bfa_rc_display_404 = $bfa_rc_options['bfa_rc_display_404'];
|
---|
89 |
|
---|
90 | global $wpdb;
|
---|
91 |
|
---|
92 | if ( (is_home() && $bfa_rc_display_homepage == "on") OR
|
---|
93 | (is_category() && $bfa_rc_display_category == "on") OR
|
---|
94 | (is_single() && $bfa_rc_display_post == "on") OR
|
---|
95 | (is_page() && $bfa_rc_display_page == "on") OR
|
---|
96 | (is_date() && $bfa_rc_display_archive == "on") OR
|
---|
97 | (is_tag() && $bfa_rc_display_tag == "on") OR
|
---|
98 | (is_search() && $bfa_rc_display_search == "on") OR
|
---|
99 | (is_author() && $bfa_rc_display_author == "on") OR
|
---|
100 | (is_404() && $bfa_rc_display_404 == "on")) {
|
---|
101 |
|
---|
102 | // Build the query and fetch the results
|
---|
103 | $sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_author_url, comment_content, comment_date_gmt, comment_approved, comment_type, ";
|
---|
104 |
|
---|
105 | if ($limit_by == "letters") {
|
---|
106 | $sql .= "SUBSTRING(comment_content,1,$bfa_rc_src_length) AS com_excerpt "; }
|
---|
107 | elseif ($limit_by == "words") {
|
---|
108 | $sql .= "SUBSTRING_INDEX(comment_content,' ',$bfa_rc_src_length) AS com_excerpt "; }
|
---|
109 | $sql .= "FROM $wpdb->comments
|
---|
110 | LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID)
|
---|
111 | WHERE comment_approved = '1' AND comment_type = '' AND post_password = ''
|
---|
112 | ORDER BY comment_date_gmt DESC
|
---|
113 | LIMIT $bfa_rc_src_count";
|
---|
114 | $comments = $wpdb->get_results($sql);
|
---|
115 |
|
---|
116 | // Generate the output string, prepend and append the HTML specified
|
---|
117 | $output = $bfa_rc_pre_HTML;
|
---|
118 | $output .= "\n<ul id=\"bfarecentcomments\">";
|
---|
119 | if (!empty($comments)) {
|
---|
120 | foreach ($comments as $comment) {
|
---|
121 | // Make a check if we need to print out '...' after the selected
|
---|
122 | // comment text. This needs to be done if the text is longer than
|
---|
123 | // the specified length.
|
---|
124 | $dots = '';
|
---|
125 | # if ( $bfa_rc_src_length <= strlen(strip_tags($comment->com_excerpt)) ) $dots = "...";
|
---|
126 | if ($limit_by == "letters") {
|
---|
127 | if ( $bfa_rc_src_length <= strlen(strip_tags($comment->comment_content)) ) {$dots = "...";}
|
---|
128 | }
|
---|
129 | elseif ($limit_by == "words") {
|
---|
130 | if ( $bfa_rc_src_length <= count(explode(" ", strip_tags($comment->comment_content))) ) {$dots = "...";}
|
---|
131 | }
|
---|
132 | // different comment link for WP 2.7 and newer / WP 2.6 and older
|
---|
133 | if (function_exists('wp_list_comments')) { $comment_link = get_comment_link($comment->comment_ID); } else {
|
---|
134 | $comment_link = get_permalink($comment->ID) . "#comment-" . $comment->comment_ID; }
|
---|
135 | $post_link = get_permalink($comment->ID);
|
---|
136 | $author_link = $comment->comment_author_url;
|
---|
137 | if ($author_nofollow == "on") {$author_link = $author_link . '" rel="nofollow'; }
|
---|
138 |
|
---|
139 | if ($point_first_link == "comment") {$first_link = $comment_link; }
|
---|
140 | elseif ($point_first_link == "post") {$first_link = $post_link; }
|
---|
141 | elseif ($point_first_link == "author") {$first_link = $author_link; }
|
---|
142 |
|
---|
143 | if ($point_second_link == "comment") {$second_link = $comment_link; }
|
---|
144 | elseif ($point_second_link == "post") {$second_link = $post_link; }
|
---|
145 | elseif ($point_second_link == "author") {$second_link = $author_link; }
|
---|
146 |
|
---|
147 | $comment_text = strip_tags($comment->com_excerpt);
|
---|
148 | if ($add_dots == "on") {$comment_text = $comment_text . $dots; }
|
---|
149 | if ($comment_bold == "on") {$comment_text2 = "<strong>$comment_text</strong>"; } else {$comment_text2 = $comment_text; }
|
---|
150 | if ($comment_em == "on") {$comment_text2 = "<em>$comment_text2</em>"; }
|
---|
151 | $post_text = apply_filters('the_title_rss', $comment->post_title);
|
---|
152 | if ($post_bold == "on") {$post_text2 = "<strong>$post_text</strong>"; } else {$post_text2 = $post_text; }
|
---|
153 | if ($post_em == "on") {$post_text2 = "<em>$post_text2</em>"; }
|
---|
154 | $author_text = $comment->comment_author;
|
---|
155 | if ($author_bold == "on") {$author_text2 = "<strong>$author_text</strong>"; } else {$author_text2 = $author_text; }
|
---|
156 | if ($author_em == "on") {$author_text2 = "<em>$author_text2</em>"; }
|
---|
157 |
|
---|
158 | $output .= "\n\t<li class=\"bfarecentcomments\">";
|
---|
159 |
|
---|
160 | if ( $bfa_rc_linking_scheme == "Author Comment link-1" ) {
|
---|
161 | $output .= "<a href=\"$first_link\" title=\"" . __('On: ','atahualpa') . "$post_text\">$author_text2</a>: $comment_text2";
|
---|
162 | } elseif ( $bfa_rc_linking_scheme == "Author Comment link-2" ) {
|
---|
163 | $output .= "$author_text2: <a href=\"$first_link\" title=\"" . __('On: ','atahualpa') . "$post_text\">$comment_text2</a>";
|
---|
164 | } elseif ( $bfa_rc_linking_scheme == "Author Comment link-1 link-2" ) {
|
---|
165 | $output .= "<a href=\"$first_link\">$author_text2</a>: <a href=\"$second_link\" title=\"" . __('On: ','atahualpa') . "$post_text\">$comment_text2</a>";
|
---|
166 | } elseif ( $bfa_rc_linking_scheme == "Author Comment link-all" ) {
|
---|
167 | $output .= "<a href=\"$first_link\" title=\"" . __('On: ','atahualpa') . "$post_text\">$author_text2: $comment_text2</a>";
|
---|
168 | } elseif ( $bfa_rc_linking_scheme == "Author on Post link-1" ) {
|
---|
169 | $output .= "<a href=\"$first_link\" title=\"$comment_text\">$author_text2</a>" . __(' on: ','atahualpa') . "$post_text2";
|
---|
170 | } elseif ( $bfa_rc_linking_scheme == "Author on Post link-2" ) {
|
---|
171 | $output .= "$author_text2" . __(' on: ','atahualpa') . "<a href=\"$first_link\" title=\"$comment_text\">$post_text2</a>";
|
---|
172 | } elseif ( $bfa_rc_linking_scheme == "Author on Post link-1 link-2" ) {
|
---|
173 | $output .= "<a href=\"$first_link\" title=\"$comment_text\">$author_text2</a>" . __(' on: ','atahualpa') . "<a href=\"$second_link\">$post_text2</a>";
|
---|
174 | } elseif ( $bfa_rc_linking_scheme == "Author on Post link-all" ) {
|
---|
175 | $output .= "<a href=\"$first_link\" title=\"$comment_text\">$author_text2" . __(' on: ','atahualpa') . "$post_text2</a>";
|
---|
176 | } elseif ( $bfa_rc_linking_scheme == "Post Comment link-1" ) {
|
---|
177 | $output .= "<a href=\"$first_link\" title=\"$author_text\">$post_text2</a>: $comment_text2";
|
---|
178 | } elseif ( $bfa_rc_linking_scheme == "Post Comment link-2" ) {
|
---|
179 | $output .= "$post_text2: <a href=\"$first_link\" title=\"$author_text\">$comment_text2</a>";
|
---|
180 | } elseif ( $bfa_rc_linking_scheme == "Post Comment link-1 link-2" ) {
|
---|
181 | $output .= "<a href=\"$first_link\">$post_text2</a>: <a href=\"$second_link\" title=\"$author_text\">$comment_text2</a>";
|
---|
182 | } elseif ( $bfa_rc_linking_scheme == "Post Comment link-all" ) {
|
---|
183 | $output .= "<a href=\"$first_link\" title=\"$author_text\">$post_text2: $comment_text2</a>";
|
---|
184 | }
|
---|
185 |
|
---|
186 | $output .= "</li>";
|
---|
187 |
|
---|
188 | }
|
---|
189 | } else {
|
---|
190 | $output .= 'No comments.';
|
---|
191 | }
|
---|
192 | $output .= "\n</ul>";
|
---|
193 | $output .= $bfa_rc_post_HTML;
|
---|
194 |
|
---|
195 | // remove empty author links
|
---|
196 | $output = preg_replace("/<a href=\"\"(.*?)>(.*?)<\/a>/i","\\2",$output);
|
---|
197 | $output = preg_replace("/<a href=\"http:\/\/\"(.*?)>(.*?)<\/a>/i","\\2",$output);
|
---|
198 |
|
---|
199 | // These lines generate the output
|
---|
200 |
|
---|
201 | echo $before_widget . $before_title . $bfa_rc_title . $after_title;
|
---|
202 | echo $output;
|
---|
203 | echo $after_widget;
|
---|
204 | }
|
---|
205 | }
|
---|
206 |
|
---|
207 |
|
---|
208 | // This is the function that outputs the form to let the users edit
|
---|
209 | // the widget's parameters.
|
---|
210 | function widget_simple_recent_comments_control() {
|
---|
211 |
|
---|
212 | // Fetch the options, check them and if need be, update the options array
|
---|
213 | $bfa_rc_options = $bfa_rc_newoptions = get_option('widget_simple_recent_comments');
|
---|
214 | if ( $_POST["bfa_rc_src-submit"] ) {
|
---|
215 | $bfa_rc_newoptions['bfa_rc_title'] = strip_tags(stripslashes($_POST["bfa_rc_src-title"]));
|
---|
216 | $bfa_rc_newoptions['bfa_rc_src_count'] = (int) $_POST["bfa_rc_src_count"];
|
---|
217 | $bfa_rc_newoptions['bfa_rc_src_length'] = (int) $_POST["bfa_rc_src_length"];
|
---|
218 | $bfa_rc_newoptions['bfa_rc_linking_scheme'] = strip_tags(stripslashes($_POST["bfa_rc_linking_scheme"]));
|
---|
219 | $bfa_rc_newoptions['point_first_link'] = $_POST["point_first_link"];
|
---|
220 | $bfa_rc_newoptions['point_second_link'] = $_POST["point_second_link"];
|
---|
221 | # $bfa_rc_newoptions['add_dots'] = $_POST["add_dots"];
|
---|
222 | $bfa_rc_newoptions['add_dots'] = !isset($_POST["add_dots"]) ? NULL : $_POST["add_dots"];
|
---|
223 | $bfa_rc_newoptions['limit_by'] = $_POST["limit_by"];
|
---|
224 | $bfa_rc_newoptions['author_bold'] = !isset($_POST["author_bold"]) ? NULL : $_POST["author_bold"];
|
---|
225 | $bfa_rc_newoptions['author_em'] = !isset($_POST["author_em"]) ? NULL : $_POST["author_em"];
|
---|
226 | $bfa_rc_newoptions['comment_bold'] = !isset($_POST["comment_bold"]) ? NULL : $_POST["comment_bold"];
|
---|
227 | $bfa_rc_newoptions['comment_em'] = !isset($_POST["comment_em"]) ? NULL : $_POST["comment_em"];
|
---|
228 | $bfa_rc_newoptions['post_bold'] = !isset($_POST["post_bold"]) ? NULL : $_POST["post_bold"];
|
---|
229 | $bfa_rc_newoptions['post_em'] = !isset($_POST["post_em"]) ? NULL : $_POST["post_em"];
|
---|
230 | $bfa_rc_newoptions['author_nofollow'] = !isset($_POST["author_nofollow"]) ? NULL : $_POST["author_nofollow"];
|
---|
231 | $bfa_rc_newoptions['bfa_rc_display_homepage'] = !isset($_POST["bfa_rc_display_homepage"]) ? NULL : $_POST["bfa_rc_display_homepage"];
|
---|
232 | $bfa_rc_newoptions['bfa_rc_display_category'] = !isset($_POST["bfa_rc_display_category"]) ? NULL : $_POST["bfa_rc_display_category"];
|
---|
233 | $bfa_rc_newoptions['bfa_rc_display_post'] = !isset($_POST["bfa_rc_display_post"]) ? NULL : $_POST["bfa_rc_display_post"];
|
---|
234 | $bfa_rc_newoptions['bfa_rc_display_page'] = !isset($_POST["bfa_rc_display_page"]) ? NULL : $_POST["bfa_rc_display_page"];
|
---|
235 | $bfa_rc_newoptions['bfa_rc_display_archive'] = !isset($_POST["bfa_rc_display_archive"]) ? NULL : $_POST["bfa_rc_display_archive"];
|
---|
236 | $bfa_rc_newoptions['bfa_rc_display_tag'] = !isset($_POST["bfa_rc_display_tag"]) ? NULL : $_POST["bfa_rc_display_tag"];
|
---|
237 | $bfa_rc_newoptions['bfa_rc_display_search'] = !isset($_POST["bfa_rc_display_search"]) ? NULL : $_POST["bfa_rc_display_search"];
|
---|
238 | $bfa_rc_newoptions['bfa_rc_display_author'] = !isset($_POST["bfa_rc_display_author"]) ? NULL : $_POST["bfa_rc_display_author"];
|
---|
239 | $bfa_rc_newoptions['bfa_rc_display_404'] = !isset($_POST["bfa_rc_display_404"]) ? NULL : $_POST["bfa_rc_display_404"];
|
---|
240 |
|
---|
241 | }
|
---|
242 | if ( $bfa_rc_options != $bfa_rc_newoptions ) {
|
---|
243 | $bfa_rc_options = $bfa_rc_newoptions;
|
---|
244 | update_option('widget_simple_recent_comments', $bfa_rc_options);
|
---|
245 | }
|
---|
246 |
|
---|
247 | // Default options to the parameters
|
---|
248 | if ( !$bfa_rc_options['bfa_rc_src_count'] ) $bfa_rc_options['bfa_rc_src_count'] = 7;
|
---|
249 | if ( !$bfa_rc_options['bfa_rc_src_length'] ) $bfa_rc_options['bfa_rc_src_length'] = 60;
|
---|
250 | if ( !$bfa_rc_options['bfa_rc_linking_scheme'] ) $bfa_rc_options['bfa_rc_linking_scheme'] = "Author Comment link-all";
|
---|
251 | if ( !$bfa_rc_options['point_first_link'] ) $bfa_rc_options['point_first_link'] = "author";
|
---|
252 | if ( !$bfa_rc_options['point_second_link'] ) $bfa_rc_options['point_second_link'] = "comment";
|
---|
253 | if ( !$bfa_rc_options['limit_by'] ) $bfa_rc_options['limit_by'] = "letters";
|
---|
254 | if ( !$bfa_rc_options['author_nofollow'] ) $bfa_rc_options['author_nofollow'] = "on";
|
---|
255 |
|
---|
256 | $bfa_rc_src_count = $bfa_rc_options['bfa_rc_src_count'];
|
---|
257 | $bfa_rc_src_length = $bfa_rc_options['bfa_rc_src_length'];
|
---|
258 | $bfa_rc_linking_scheme = $bfa_rc_options['bfa_rc_linking_scheme'];
|
---|
259 | $point_first_link = $bfa_rc_options['point_first_link'];
|
---|
260 | $point_second_link = $bfa_rc_options['point_second_link'];
|
---|
261 | $add_dots = $bfa_rc_options['add_dots'];
|
---|
262 | $limit_by = $bfa_rc_options['limit_by'];
|
---|
263 | $author_bold = $bfa_rc_options['author_bold'];
|
---|
264 | $author_em = $bfa_rc_options['author_em'];
|
---|
265 | $comment_bold = $bfa_rc_options['comment_bold'];
|
---|
266 | $comment_em = $bfa_rc_options['comment_em'];
|
---|
267 | $post_bold = $bfa_rc_options['post_bold'];
|
---|
268 | $post_em = $bfa_rc_options['post_em'];
|
---|
269 | $author_nofollow = $bfa_rc_options['author_nofollow'];
|
---|
270 | $bfa_rc_display_homepage = $bfa_rc_options['bfa_rc_display_homepage'];
|
---|
271 | $bfa_rc_display_category = $bfa_rc_options['bfa_rc_display_category'];
|
---|
272 | $bfa_rc_display_post = $bfa_rc_options['bfa_rc_display_post'];
|
---|
273 | $bfa_rc_display_page = $bfa_rc_options['bfa_rc_display_page'];
|
---|
274 | $bfa_rc_display_archive = $bfa_rc_options['bfa_rc_display_archive'];
|
---|
275 | $bfa_rc_display_tag = $bfa_rc_options['bfa_rc_display_tag'];
|
---|
276 | $bfa_rc_display_search = $bfa_rc_options['bfa_rc_display_search'];
|
---|
277 | $bfa_rc_display_author = $bfa_rc_options['bfa_rc_display_author'];
|
---|
278 | $bfa_rc_display_404 = $bfa_rc_options['bfa_rc_display_404'];
|
---|
279 |
|
---|
280 | // Deal with HTML in the parameters
|
---|
281 | $bfa_rc_pre_HTML = htmlspecialchars($bfa_rc_options['bfa_rc_pre_HTML'], ENT_QUOTES);
|
---|
282 | $bfa_rc_post_HTML = htmlspecialchars($bfa_rc_options['bfa_rc_post_HTML'], ENT_QUOTES);
|
---|
283 | $bfa_rc_title = htmlspecialchars($bfa_rc_options['bfa_rc_title'], ENT_QUOTES);
|
---|
284 |
|
---|
285 | ?>
|
---|
286 | Title: <input style="width: 450px;" id="bfa_rc_src-title" name="bfa_rc_src-title" type="text" value="<?php echo $bfa_rc_title; ?>" />
|
---|
287 | <hr noshade size="1" style="clear:left; color: #ccc">
|
---|
288 | <p style="text-align: left;">Show <input style="width: 40px;" id="bfa_rc_src_count" name="bfa_rc_src_count" type="text" value="<?php echo $bfa_rc_src_count; ?>" /> comments like this:</p>
|
---|
289 | <p style="float: left; width: 195px; text-align: left;"><input id="bfa_rc_linking_scheme" name="bfa_rc_linking_scheme" type="radio" value="Author Comment link-1" <?php if($bfa_rc_linking_scheme == "Author Comment link-1"){echo " CHECKED";}?> /> <a href="#" title="On: Post Title">Author Name</a>: Comment Text</p>
|
---|
290 | <p style="float: left; width: 195px; text-align: left;"><input id="bfa_rc_linking_scheme" name="bfa_rc_linking_scheme" type="radio" value="Author Comment link-2" <?php if($bfa_rc_linking_scheme == "Author Comment link-2"){echo " CHECKED";}?> /> Author Name: <a href="#" title="On: Post Title">Comment Text</a></p>
|
---|
291 | <p style="float: left; width: 195px; text-align: left;"><input id="bfa_rc_linking_scheme" name="bfa_rc_linking_scheme" type="radio" value="Author Comment link-1 link-2" <?php if($bfa_rc_linking_scheme == "Author Comment link-1 link-2"){echo " CHECKED";}?> /> <a href="#">Author Name</a>: <a href="#" title="On: Post Title">Comment Text</a></p>
|
---|
292 | <p style="float: left; width: 195px; text-align: left;"><input id="bfa_rc_linking_scheme" name="bfa_rc_linking_scheme" type="radio" value="Author Comment link-all" <?php if($bfa_rc_linking_scheme == "Author Comment link-all"){echo " CHECKED";}?> /> <a href="#" title="On: Post Title">Author Name: Comment Text</a></p>
|
---|
293 | <p style="float: left; width: 195px; text-align: left;"><input id="bfa_rc_linking_scheme" name="bfa_rc_linking_scheme" type="radio" value="Author on Post link-1" <?php if($bfa_rc_linking_scheme == "Author on Post link-1"){echo " CHECKED";}?> /> <a href="#" title="Comment Text">Author Name</a> on: Post Title</p>
|
---|
294 | <p style="float: left; width: 195px; text-align: left;"><input id="bfa_rc_linking_scheme" name="bfa_rc_linking_scheme" type="radio" value="Author on Post link-2" <?php if($bfa_rc_linking_scheme == "Author on Post link-2"){echo " CHECKED";}?> /> Author Name on: <a href="#" title="Comment Text">Post Title</a></p>
|
---|
295 | <p style="float: left; width: 195px; text-align: left;"><input id="bfa_rc_linking_scheme" name="bfa_rc_linking_scheme" type="radio" value="Author on Post link-1 link-2" <?php if($bfa_rc_linking_scheme == "Author on Post link-1 link-2"){echo " CHECKED";}?> /> <a href="#" title="Comment Text">Author Name</a> on: <a href="#">Post Title</a></p>
|
---|
296 | <p style="float: left; width: 195px; text-align: left;"><input id="bfa_rc_linking_scheme" name="bfa_rc_linking_scheme" type="radio" value="Author on Post link-all" <?php if($bfa_rc_linking_scheme == "Author on Post link-all"){echo " CHECKED";}?> /> <a href="#" title="Comment Text">Author Name on: Post Title</a></p>
|
---|
297 | <p style="float: left; width: 195px; text-align: left;"><input id="bfa_rc_linking_scheme" name="bfa_rc_linking_scheme" type="radio" value="Post Comment link-1" <?php if($bfa_rc_linking_scheme == "Post Comment link-1"){echo " CHECKED";}?> /> <a href="#" title="Author Name">Post Title</a>: Comment Text</p>
|
---|
298 | <p style="float: left; width: 195px; text-align: left;"><input id="bfa_rc_linking_scheme" name="bfa_rc_linking_scheme" type="radio" value="Post Comment link-2" <?php if($bfa_rc_linking_scheme == "Post Comment link-2"){echo " CHECKED";}?> /> Post Title: <a href="#" title="Author Name">Comment Text</a></p>
|
---|
299 | <p style="float: left; width: 195px; text-align: left;"><input id="bfa_rc_linking_scheme" name="bfa_rc_linking_scheme" type="radio" value="Post Comment link-1 link-2" <?php if($bfa_rc_linking_scheme == "Post Comment link-1 link-2"){echo " CHECKED";}?> /> <a href="#">Post Title</a>: <a href="#" title="Author Name">Comment Text</a></p>
|
---|
300 | <p style="float: left; width: 195px; text-align: left;"><input id="bfa_rc_linking_scheme" name="bfa_rc_linking_scheme" type="radio" value="Post Comment link-all" <?php if($bfa_rc_linking_scheme == "Post Comment link-all"){echo " CHECKED";}?> /> <a href="#" title="Author Name">Post Title: Comment Text</a></p>
|
---|
301 | <hr noshade size="1" style="clear:left; color: #ccc">
|
---|
302 | <p style="clear:left">Point the first link to:</p>
|
---|
303 | <p style="float: left; text-align: left;"><input id="point_first_link" name="point_first_link" type="radio" value="author" <?php if($point_first_link == "author"){echo " CHECKED";}?> /> the author's homepage (if any)</p>
|
---|
304 | <p style="float: left; margin-left: 10px; text-align: left;"><input id="point_first_link" name="point_first_link" type="radio" value="comment" <?php if($point_first_link == "comment"){echo " CHECKED";}?> /> the comments</p>
|
---|
305 | <p style="float: left; margin-left: 10px; text-align: left;"><input id="point_first_link" name="point_first_link" type="radio" value="post" <?php if($point_first_link == "post"){echo " CHECKED";}?> /> the post</p>
|
---|
306 | <p style="clear:left">Point the second link (if any) to:</p>
|
---|
307 | <p style="float: left; text-align: left;"><input id="point_second_link" name="point_second_link" type="radio" value="author" <?php if($point_second_link == "author"){echo " CHECKED";}?> /> the author's homepage (if any)</p>
|
---|
308 | <p style="float: left; margin-left: 10px; text-align: left;"><input id="point_second_link" name="point_second_link" type="radio" value="comment" <?php if($point_second_link == "comment"){echo " CHECKED";}?> /> the comments</p>
|
---|
309 | <p style="float: left; margin-left: 10px; text-align: left;"><input id="point_second_link" name="point_second_link" type="radio" value="post" <?php if($point_second_link == "post"){echo " CHECKED";}?> /> the post</p>
|
---|
310 | <hr noshade size="1" style="clear:left; color: #ccc">
|
---|
311 | <p><input id="author_nofollow" name="author_nofollow" type="checkbox" <?php if($author_nofollow == "on"){echo " CHECKED";}?> /> Set the link to the Author Homepage to "Nofollow"</p>
|
---|
312 | <hr noshade size="1" style="clear:left; color: #ccc">
|
---|
313 | Limit the comment text to <input style="width: 40px;" id="bfa_rc_src_length" name="bfa_rc_src_length" type="text" value="<?php echo $bfa_rc_src_length; ?>" /> <input id="limit_by" name="limit_by" type="radio" value="letters" <?php if($limit_by == "letters"){echo " CHECKED";}?> /> letters <input id="limit_by" name="limit_by" type="radio" value="words" <?php if($limit_by == "words"){echo " CHECKED";}?> /> words. <input id="add_dots" name="add_dots" type="checkbox" <?php if($add_dots == "on"){echo " CHECKED";}?> /> add "..." if the actual comment is longer than that.</p>
|
---|
314 | <hr noshade size="1" style="clear:left; color: #ccc">
|
---|
315 | <p>Make the Author Name <input id="author_bold" name="author_bold" type="checkbox" <?php if($author_bold == "on"){echo " CHECKED";}?> /> <strong>Bold</strong> <input id="author_em" name="author_em" type="checkbox" <?php if($author_em == "on"){echo " CHECKED";}?> /> <em>Emphasized</em></p>
|
---|
316 | <p>Make the Comment Text <input id="comment_bold" name="comment_bold" type="checkbox" <?php if($comment_bold == "on"){echo " CHECKED";}?> /> <strong>Bold</strong> <input id="comment_em" name="comment_em" type="checkbox" <?php if($comment_em == "on"){echo " CHECKED";}?> /> <em>Emphasized</em></p>
|
---|
317 | <p>Make the Post Title <input id="post_bold" name="post_bold" type="checkbox" <?php if($post_bold == "on"){echo " CHECKED";}?> /> <strong>Bold</strong> <input id="post_em" name="post_em" type="checkbox" <?php if($post_em == "on"){echo " CHECKED";}?> /> <em>Emphasized</em></p>
|
---|
318 | <hr noshade size="1" style="clear:left; color: #ccc">
|
---|
319 | <p>Display the list on:</p> <p style="float: left; width: 160px; text-align: left;"><input id="bfa_rc_display_homepage" name="bfa_rc_display_homepage" type="checkbox" <?php if($bfa_rc_display_homepage == "on"){echo " CHECKED";}?> /> Homepage</p>
|
---|
320 | <p style="float: left; width: 160px; text-align: left;"><input id="bfa_rc_display_category" name="bfa_rc_display_category" type="checkbox" <?php if($bfa_rc_display_category == "on"){echo " CHECKED";}?> /> Category Pages</p>
|
---|
321 | <p style="float: left; width: 160px; text-align: left;"><input id="bfa_rc_display_post" name="bfa_rc_display_post" type="checkbox" <?php if($bfa_rc_display_post == "on"){echo " CHECKED";}?> /> Single Post Pages</p>
|
---|
322 | <p style="float: left; width: 160px; text-align: left;"><input id="bfa_rc_display_page" name="bfa_rc_display_page" type="checkbox" <?php if($bfa_rc_display_page == "on"){echo " CHECKED";}?> /> "Page" Pages</p>
|
---|
323 | <p style="float: left; width: 160px; text-align: left;"><input id="bfa_rc_display_archive" name="bfa_rc_display_archive" type="checkbox" <?php if($bfa_rc_display_archive == "on"){echo " CHECKED";}?> /> Archive Pages</p>
|
---|
324 | <p style="float: left; width: 160px; text-align: left;"><input id="bfa_rc_display_tag" name="bfa_rc_display_tag" type="checkbox" <?php if($bfa_rc_display_tag == "on"){echo " CHECKED";}?> /> Tag Pages</p>
|
---|
325 | <p style="float: left; width: 160px; text-align: left;"><input id="bfa_rc_display_search" name="bfa_rc_display_search" type="checkbox" <?php if($bfa_rc_display_search == "on"){echo " CHECKED";}?> /> Search Result Pages</p>
|
---|
326 | <p style="float: left; width: 160px; text-align: left;"><input id="bfa_rc_display_author" name="bfa_rc_display_author" type="checkbox" <?php if($bfa_rc_display_author == "on"){echo " CHECKED";}?> /> Author Pages</p>
|
---|
327 | <p style="float: left; width: 160px; text-align: left;"><input id="bfa_rc_display_404" name="bfa_rc_display_404" type="checkbox" <?php if($bfa_rc_display_404 == "on"){echo " CHECKED";}?> /> 404 Not Found Pages</p>
|
---|
328 | <input type="hidden" id="bfa_rc_src-submit" name="bfa_rc_src-submit" value="1" />
|
---|
329 | <?php
|
---|
330 | }
|
---|
331 |
|
---|
332 | // This registers our widget so it appears with the other available
|
---|
333 | // widgets and can be dragged and dropped into any active sidebars.
|
---|
334 | register_sidebar_widget('BFA Recent Comments', 'widget_simple_recent_comments');
|
---|
335 |
|
---|
336 | // This registers our optional widget control form. Because of this
|
---|
337 | // our widget will have a button that reveals a 520x480 pixel form.
|
---|
338 | register_widget_control('BFA Recent Comments', 'widget_simple_recent_comments_control', 620, 520);
|
---|
339 | ?>
|
---|