CommentLuv - Version 2.7.1

Version Description

Download this release

Release Info

Developer teamplaylotto
Plugin Icon 128x128 CommentLuv
Version 2.7.1
Comparing to
See all releases

Code changes from version 2.7.61 to 2.7.1

commentluv-manager.php CHANGED
@@ -8,7 +8,8 @@
8
  <form action="<?php echo $action_url ?>" method="POST">
9
  <input type="hidden" name="submitted" value="1" />
10
  <?php wp_nonce_field('commentluv-nonce');?>
11
- <p><?php _e('This plugin takes the url from the comment form and tries to parse the feed of the site and display the last entry made. If you have any questions, comments or if you have a good idea that you would like to see in the next version of CommentLuv, please visit http://comluv.com and let me know.',$this->plugin_domain);?></p>
 
12
  <h3><?php _e('Display Options',$this->plugin_domain);?></h3>
13
  <label for="cl_comment_text"><?php _e('Enter the text you want displayed in the comment',$this->plugin_domain);?></label> <br/>
14
  <input type="text" size="50" name="cl_comment_text" value="<?php echo stripslashes($comment_text);?>"/>
@@ -24,7 +25,7 @@
24
  </p>
25
  <p>
26
  <input type="checkbox" name="cl_use_template" <?php echo $use_template;?>/>
27
- <label for="cl_use_template"><?php _e('Use template insert to show badge and checkbox?',$this->plugin_domain);?> ( &lt;?php cl_display_badge(); ?&gt; )</label>
28
  </p>
29
  <h3><?php _e('Display Badge',$this->plugin_domain);?></h3>
30
  <p><?php _e('Many thanks to <a href="http://byteful.com">Byteful Traveller</a> for creating these images.',$this->plugin_domain);?></p>
@@ -65,7 +66,7 @@
65
  <td><input value="<?php echo $comment_name;?>" type="text" name="cl_comment_name"/></td>
66
  </tr>
67
  </tbody></table>
68
- <div class="submit" style="width: 70px; background-color: green; padding-left: 5px;"><input type="submit" name="Submit" value="update" /></div>
69
 
70
 
71
  </form>
8
  <form action="<?php echo $action_url ?>" method="POST">
9
  <input type="hidden" name="submitted" value="1" />
10
  <?php wp_nonce_field('commentluv-nonce');?>
11
+ <p><?php _e('This plugin takes the url from the comment form and tries to parse the feed of the site and display the last entry made.
12
+ If you have any questions, comments or if you have a good idea that you would like to see in the next version of CommentLuv, please visit http://comluv.com and let me know.',$this->plugin_domain);?></p>
13
  <h3><?php _e('Display Options',$this->plugin_domain);?></h3>
14
  <label for="cl_comment_text"><?php _e('Enter the text you want displayed in the comment',$this->plugin_domain);?></label> <br/>
15
  <input type="text" size="50" name="cl_comment_text" value="<?php echo stripslashes($comment_text);?>"/>
25
  </p>
26
  <p>
27
  <input type="checkbox" name="cl_use_template" <?php echo $use_template;?>/>
28
+ <label for="cl_use_template"><?php _e('Use template insert to show badge and checkbox?',$this->plugin_domain);?> ( &lt;?php cl_show_badge(); ?&gt; )</label>
29
  </p>
30
  <h3><?php _e('Display Badge',$this->plugin_domain);?></h3>
31
  <p><?php _e('Many thanks to <a href="http://byteful.com">Byteful Traveller</a> for creating these images.',$this->plugin_domain);?></p>
66
  <td><input value="<?php echo $comment_name;?>" type="text" name="cl_comment_name"/></td>
67
  </tr>
68
  </tbody></table>
69
+ <div class="submit"><input type="submit" name="Submit" value="update" /></div>
70
 
71
 
72
  </form>
commentluv.php CHANGED
@@ -2,249 +2,273 @@
2
  Plugin Name: CommentLuv
3
  Plugin URI: http://comluv.com/download/commentluv-wordpress/
4
  Description: Plugin to show a link to the last post from the commenters blog by parsing the feed at their given URL when they leave a comment. Rewards your readers and encourage more comments.
5
- Version: 2.7.61
6
  Author: Andy Bailey
7
  Author URI: http://fiddyp.comluv.com/
8
 
9
  26 Apr 2009 - Start the new version using a class and updated localization (thanks Vladimir Prelovac for your great book on Wordpress Plugin Development!)
10
  05 Jun 2009 - Finalized last functions and integrated API. big up to @wpmuguru for API coding!
11
- 10 Jun 2009 - Fix for php4 hosting. changed "public" to "var" and check function exists for json_decode
12
- 11 Jun 2009 - Small bug in using text as badge fixed. Changed strpos to strrpos to find last tag code in text. priority 1 for comment_text
13
- removed request id data from being inserted (too many complaints!) and adjusted the way comment status change is handled. approve is done at post submission and
14
- delete is done at change status (with no request id sent)
15
- 12 Jun 2009 - small fixes for valid xhtml on images and checkbox . remove identifying .-= / =-. from inserted link on display time. happy birthday to me
16
- 13 Jun 2009 - fix php4 from not allowing last string pos (strrpos) (thanks http://www.makeupandbeautyblog.com/ && http://jahangiri.us/news/)
17
- - validates for Kelson (speedforce.org) (had a big cake yesterday nomnom)
18
- 14 Jun 2009 - Italian translation added (and fix CR in string on manager page). Thanks go to Gianni Diurno http://gidibao.net
19
- 16 Jun 2009 - Bug fix, use_template checkbox not displaying when selected on settings page (breaker). typo in settings page now uses <?php cl_display_badge(); ?> (oops!)
20
- - added global variable for badgeshown to prevent mulitple instances (template contains function call AND use template check is off)
21
- - fixed output of prepend html using decode html and stripslashes. Added green background to update settings button.
22
- 19 Jun 2009 - fix for htmlspecialchars_decode causing error in wp < 2.8 (thanks @mitch_m for testing)
23
  */
24
  // Avoid name collision
25
- if (! class_exists ( 'commentluv' )) {
26
  // let class begin
27
- class commentluv {
 
28
  //localization domain
29
  var $plugin_domain = 'commentluv';
30
  var $plugin_url;
31
  var $db_option = 'commentluv_options';
32
- var $cl_version = 276;
33
  var $api_url;
34
 
35
  //initialize the plugin
36
- function commentluv() {
 
37
  global $wp_version, $pagenow;
38
  // pages where commentluv needs translation
39
- $local_pages = array ('plugins.php', 'commentluv.php' );
40
  // check if translation needed on current page
41
- if (in_array ( $pagenow, $local_pages ) || in_array ( $_GET ['page'], $local_pages )) {
42
- $this->handle_load_domain ();
43
  }
44
- $exit_msg = __ ( 'CommentLuv requires Wordpress 2.6.5 or newer.', $this->plugin_domain ) . '<a href="http://codex.wordpress.org/Upgrading_Wordpress">' . __ ( 'Please Update!', $this->plugin_domain ) . '</a>';
 
 
 
45
 
46
  // can you dig it?
47
- if (version_compare ( $wp_version, "2.6.5", "<" )) {
48
- exit ( $exit_msg ); // no diggedy
 
49
  }
50
 
51
  // action hooks
52
- $this->plugin_url = trailingslashit ( WP_PLUGIN_URL . '/' . dirname ( plugin_basename ( __FILE__ ) ) );
53
  $this->api_url = 'http://api.comluv.com/cl_api/commentluvapi.php';
54
- add_action ( 'admin_menu', array (&$this, 'admin_menu' ) );
55
- add_action ( 'template_redirect', array (&$this, 'commentluv_scripts' ) ); // template_redirect always called when page is displayed to user
56
- add_action ( 'wp_head', array (&$this, 'commentluv_style' ) ); // add style sheet to header
57
- add_action ( 'wp_set_comment_status', array (&$this, 'update_cl_status' ), 1, 3 ); // call when status of comment gets changed
58
- add_action ( 'comment_post', array (&$this, 'update_cl_status' ), 2, 3 ); // call when comment gets posted
59
- add_action ( 'comment_form', array (&$this, 'add_fields' ) ); // add hidden fields during comment form display time
60
- add_filter ( 'plugin_action_links', array (&$this, 'commentluv_action' ), - 10, 2 ); // add a settings page link to the plugin description. use 2 for allowed vars
61
- add_filter ( 'comment_text', array (&$this, 'do_shortcode' ), 10 ); // replace inserted data with hidden span on display time of comment
62
- add_filter ( 'pre_comment_content', array (&$this, 'cl_post' ), 10 ); // extract extra fields data and insert data to end of comment
 
 
 
63
  }
64
 
65
  // hook the options page
66
- function admin_menu() {
67
- $menutitle = '<img src="' . $this->plugin_url . 'images/littleheart.gif" alt=""/> ';
68
  $menutitle .= 'CommentLuv';
69
- add_options_page ( 'CommentLuv Settings', $menutitle, 8, basename ( __FILE__ ), array (&$this, 'handle_options' ) );
70
  }
71
  // add the settings link
72
- function commentluv_action($links, $file) {
73
- $this_plugin = plugin_basename ( __FILE__ );
74
- if ($file == $this_plugin) {
75
- $links [] = "<a href='options-general.php?page=commentluv.php'>" . '<img src="' . $this->plugin_url . 'images/littleheart.gif" alt=""/> ' . __ ( 'Settings', $this->plugin_domain ) . "</a>";
76
  }
77
  return $links;
78
  }
79
  // hook the template_redirect for inserting style and javascript (using wp_head would make it too late to add dependencies)
80
- function commentluv_scripts() {
81
  // only load scripts if on a single page
82
- if (is_single ()) {
83
- wp_enqueue_script ( 'jquery' );
84
  global $wp_version;
85
  // see if hoverintent library is already included (2.7 >)
86
- if (version_compare ( $wp_version, "2.8", "<" )) {
87
- wp_enqueue_script ( 'hoverIntent', '/' . PLUGINDIR . '/' . dirname ( plugin_basename ( __FILE__ ) ) . '/js/hoverIntent.js', array ('jquery' ) );
88
  } else {
89
- wp_enqueue_script ( 'hoverIntent', '/' . WPINC . '/js/hoverIntent.js', array ('jquery' ) );
90
  }
91
- wp_enqueue_script ( 'commentluv', $this->plugin_url . 'js/commentluv.js', array ('jquery' ) );
92
  // get options
93
- $options = $this->get_options ();
94
- foreach ( $options as $key => $value ) {
95
  $$key = $value;
96
  }
97
  // prepare options
98
- $default_on = $default_on == 'on' ? 'checked' : '';
99
  // untick the box if user is admin
100
  global $user_ID;
101
- if ($user_ID) {
102
- if (current_user_can ( 'create_users' )) {
103
  $default_on = '';
104
  }
105
  }
106
  $badge = $this->plugin_url . "images/" . $badge;
107
- $badge_text = $options ['badge'] == 'text' ? 'on' : '';
108
  // insert options to header
109
- wp_localize_script ( 'commentluv', 'cl_settings', array ('name' => $author_name, 'url' => $url_name, 'comment' => $comment_name, 'email' => $email_name, 'prepend' => $prepend, 'badge' => $badge, 'show_text' => $show_text, 'badge_text' => $badge_text, 'heart_tip' => $heart_tip, 'default_on' => $default_on, 'select_text' => $select_text, 'cl_version' => $this->cl_version, 'images' => $this->plugin_url . 'images/', 'api_url' => $this->api_url ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  }
111
  }
112
  // hook the head function for adding stylesheet
113
- function commentluv_style() {
114
- echo '<link rel="stylesheet" href="' . $this->plugin_url . 'style/cl_style.css" type="text/css" />';
115
  }
116
 
117
  // get plugin options
118
- function get_options() {
119
  // default values
120
- $options = array ('comment_text' => '[name]&#180;s last [type] ..[lastpost]', 'select_text' => 'choose a different post to show', 'default_on' => 'on', 'heart_tip' => 'on', 'use_template' => '', 'badge' => 'CL91x17-white2.gif', 'show_text' => 'CommentLuv Enabled', 'author_name' => 'author', 'url_name' => 'url', 'comment_name' => 'comment', 'email_name' => 'email', 'prepend' => '' );
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  // get saved options unless reset button was pressed
122
  $saved = '';
123
- if (! isset ( $_POST ['reset'] )) {
124
- $saved = get_option ( $this->db_option );
125
  }
126
 
127
  // assign values
128
- if (! empty ( $saved )) {
129
- foreach ( $saved as $key => $option ) {
130
- $options [$key] = $option;
 
131
  }
132
  }
133
  // update the options if necessary
134
- if ($saved != $options) {
135
- update_option ( $this->db_option, $options );
136
  }
137
  // return the options
138
  return $options;
139
  }
140
 
141
  // handle saving and displaying options
142
- function handle_options() {
143
- $options = $this->get_options ();
144
- if (isset ( $_POST ['submitted'] )) {
 
 
145
 
146
  // initialize the error class
147
- $errors = new WP_Error ( );
148
 
149
  // check security
150
- check_admin_referer ( 'commentluv-nonce' );
151
-
152
- $options = array ();
153
- $options ['comment_text'] = htmlspecialchars ( $_POST ['cl_comment_text'] );
154
- $options ['select_text'] = htmlspecialchars ( $_POST ['cl_select_text'] );
155
- $options ['default_on'] = $_POST ['cl_default_on'];
156
- $options ['heart_tip'] = $_POST ['cl_heart_tip'];
157
- $options ['badge'] = $_POST ['cl_badge'];
158
- $options ['show_text'] = htmlspecialchars ( $_POST ['cl_show_text'] );
159
- $options ['prepend'] = htmlspecialchars ( $_POST ['cl_prepend'] );
160
- $options ['author_name'] = $_POST ['cl_author_name'];
161
- $options ['url_name'] = $_POST ['cl_url_name'];
162
- $options ['comment_name'] = $_POST ['cl_comment_name'];
163
- $options ['email_name'] = $_POST ['cl_email_name'];
164
- $options ['use_template'] = $_POST['cl_use_template'];
165
 
166
  // check for errors
167
- if (count ( $errors->errors ) > 0) {
168
  echo '<div class="error"><h3>';
169
- _e ( 'There were errors with your chosen settings', $this->plugin_domain );
170
  echo '</h3>';
171
- foreach ( $errors->get_error_messages () as $message ) {
172
  echo $message;
173
  }
174
  echo '</div>';
175
  } else {
176
  //every-ting cool mon
177
- update_option ( $this->db_option, $options );
178
  echo '<div class="updated fade"><p>Plugin settings saved.</p></div>';
179
  }
180
 
181
  }
182
  // loop through each option and assign it as key=value
183
- foreach ( $options as $key => $value ) {
184
  $$key = $value;
185
  }
186
  // set value to checked if option is on (for showing correct status of checkbox and radio button in settings page)
187
- $default_on = $options ['default_on'] == 'on' ? 'checked' : '';
188
- $heart_tip = $options ['heart_tip'] == 'on' ? 'checked' : '';
189
- $badge1 = $options ['badge'] == 'ACL88x31-black2.gif' ? 'checked="checked"' : '';
190
- $badge2 = $options ['badge'] == 'ACL88x31-white2.gif' ? 'checked="checked"' : '';
191
- $badge3 = $options ['badge'] == 'CL91x17-black2.gif' ? 'checked="checked"' : '';
192
- $badge4 = $options ['badge'] == 'CL91x17-white2.gif' ? 'checked="checked"' : '';
193
- $badge5 = $options ['badge'] == 'nothing.gif' ? 'checked="checked"' : '';
194
- $use_template = $options ['use_template'] == 'on' ? 'checked="checked"' : '';
195
- $badge_text = $options ['badge'] == 'text' ? 'checked="checked"' : '';
196
 
197
  // url for form submit
198
- $action_url = $_SERVER ['REQUEST_URI'];
199
- include ('commentluv-manager.php');
200
  }
201
  // shortcode for showing badge and drop down box
202
- function display_badge() {
203
- if (is_single ()) {
204
- global $badgeshown;
205
- $options = get_option ( $this->db_option );
206
  // choose as image or as text
207
- $badge_text = $options ['badge'] == 'text' ? 'on' : '';
208
- $default_on = $options ['default_on'] == 'on' ? 'checked="checked"' : '';
209
  // untick the box if user is admin
210
  global $user_ID;
211
- if ($user_ID) {
212
- if (current_user_can ( 'create_users' )) {
213
  $default_on = '';
214
  }
215
  }
216
- $options ['badge'] = $this->plugin_url . 'images/' . $options ['badge'];
217
- if ($badge_text == '') {
218
- $badge = '<a href="http://comluv.com" target="_blank"><img src="' . $options ['badge'] . '" border="0" alt="' . $options ['show_text'] . '" title="' . $options ['show_text'] . '"/></a>';
219
  } else {
220
- $badge = '<a href="http://comluv.com" target="_blank">' . $options ['show_text'] . '</a>';
221
- }
222
- if($options['prepend']){
223
- $prepend = stripslashes($options['prepend']);
224
- $decodeprepend = htmlspecialchars_decode_own($prepend);
225
  }
226
- echo '<div id="commentluv">' . $decodeprepend . '<input type="checkbox" id="doluv" name="doluv" ' . $default_on . ' style="width:25px;"></input><span id="mylastpost" style="clear: both">' . $badge . '</span><img class="clarrow" id="showmore" src="' . $this->plugin_url . 'images/down-arrow.gif" alt="show more" style="display:none;"/></div><div id="lastposts" style="display: none;"></div>';
227
- $badgeshown = TRUE;
 
 
228
  }
229
  }
230
  // hook the comment form to add fields for url for logged in users
231
- function add_fields($id) {
232
- $options = get_option ( $this->db_option );
233
- $cl_author_id = $options ['author_name'];
234
- $cl_site_id = $options ['url_name'];
235
 
236
- if (is_user_logged_in ()) {
237
  // get options values and insert as hidden fields
238
  global $userdata;
239
- get_currentuserinfo ();
240
- $author = $userdata->display_name;
241
- $userid = $userdata->ID;
242
- $url = $userdata->user_url;
243
  // check for MU blog
244
- if (function_exists ( 'is_site_admin' )) {
245
- if (! $url || $url == "http://") {
246
- $userbloginfo = get_blogs_of_user ( $userid, 1 );
247
- $url = $userbloginfo [1]->siteurl;
248
  }
249
  }
250
 
@@ -257,201 +281,167 @@ if (! class_exists ( 'commentluv' )) {
257
  echo '<input type="hidden" name="request_id" />';
258
  echo '<input type="hidden" name="cl_post" id="cl_post"/>';
259
  // check if using php call comments.php or not
260
- global $badgeshown;
261
- if ($options ['use_template'] == '' && !$badgeshown) {
262
- $this->display_badge ();
263
  }
264
  return $id;
265
  }
266
 
267
- // hook the pre_comment_content to add the link
268
- function cl_post($commentdata) {
269
- if (isset ( $_POST ['cl_post'] ) && $_POST ['request_id'] != '' && is_numeric ( $_POST ['choice_id'] ) && isset ( $_POST ['cl_type'] )) {
270
  // get values posted
271
- $luvlink = $_POST ['cl_post'];
272
- if (strstr ( $luvlink, "commentluv.com/error-check" ) || $_POST ['request_id'] == 0) {
273
  return $commentdata;
274
  }
275
- $request_id = $_POST ['request_id'];
276
- $choice_id = $_POST ['choice_id'];
277
- $cl_type = $_POST ['cl_type'];
278
- // convert data to put into comment content
279
- $options = get_option ( $this->db_option );
280
- $prepend_text = $options ['comment_text'];
281
- $search = array ('[name]', '[type]', '[lastpost]' );
282
- $replace = array ($_POST ["{$options['author_name']}"], $cl_type, $luvlink );
283
- $inserted = str_replace ( $search, $replace, $prepend_text );
284
- // insert identifying data and insert text/link to end of comment
285
- $commentdata .= "\n.-= $inserted =-.";
286
- // tell comluv that the comment was submitted
287
- $luvlink = stripslashes ( $luvlink );
288
- $thelinkstart = strpos ( $luvlink, '="' );
289
- $cutit = substr ( $luvlink, $thelinkstart + 2 );
290
- $hrefend = strpos ( $cutit, '"' );
291
- $thelink = substr ( $cutit, 0, $hrefend );
292
- // got the url, construct url to tell comluv
293
- $url = $this->api_url . "?type=approve&request_id=$request_id&post_id=$choice_id&url=$thelink";
294
- $content = $this->call_comluv ( $url );
295
  }
296
  return $commentdata;
297
  }
298
  // hook the set comment status action
299
  function update_cl_status($cid, $status) {
300
  // get comment stuff from id
301
- if ($status != 'spam') {
302
- if ($status != 'delete') {
303
  $status = 'approve';
304
  }
305
- $comment = get_comment ( $cid );
306
- if (strpos ( $comment->comment_content, ".-=" )) {
307
  // comment can be approved or deleted in the comluv db
308
- $url = $this->api_url . "?type={$status}&url=";
309
- // get the link
310
  $commentcontent = $comment->comment_content;
311
- $start = $this->my_strrpos( $commentcontent, '.-=' );
312
- $thelink = substr ( $commentcontent, $start + 4, strlen ( $commentcontent ) - $start - 5 );
313
- $hrefstart = strpos ( $thelink, '="' );
314
- $cutit = substr ( $thelink, $hrefstart + 2 );
315
- $hrefend = strpos ( $cutit, '"' );
316
- $thelink = substr ( $cutit, 0, $hrefend );
317
- // get comment date
318
- $date = $comment->comment_date_gmt;
319
  // construct url with added params for approving comment to comluv
320
- $url .= $thelink . "&comment_date=$date&version=" . $this->cl_version;
321
  // call the url ..
322
- $content = $this->call_comluv ( $url );
323
- } // end if comment content contains a .-=
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
324
  }
325
  }
 
326
  // use my own shortcode that was inserted at submission time and hide the params
327
  function do_shortcode($commentcontent) {
328
- $options = get_option ( $this->db_option );
329
- if (strpos ( $commentcontent, ".-=" ) && strpos ( $commentcontent, "=-." )) {
330
- $last_pos = $this->my_strrpos ( $commentcontent, ".-=" ); // position number for last occurence of .-=
331
- $beforecltext = substr ( $commentcontent, 0, $last_pos ); // get text before last position of .-=
332
- $cltext = substr ( $commentcontent, $last_pos ); // get the bit between .-= and =-.
333
- $cltext = str_replace ( array (".-=", "=-." ), array ('<span class="cluv">', '' ), $cltext ); // replace .-= with span and chop off last =-.
334
- $commentcontent = $beforecltext . $cltext;
335
- // do heart info
336
- if ($options ['heart_tip'] == 'on') {
337
- $commentcontent .= '<span class="heart_tip_box"><img class="heart_tip" alt="My ComLuv Profile" border="0" width="16" height="14" src="' . $this->plugin_url . 'images/littleheart.gif"/></span>';
338
- }
339
- $commentcontent .= '</span>';
340
- }
341
-
342
- // remove old codes
343
- if (strpos ( $commentcontent, "[rq=" ) && strpos ( $commentcontent, "[/rq]" )) {
344
  // get bit that was added
345
- $start = strpos ( $commentcontent, '[rq=' );
346
- $end = strpos ( $commentcontent, '[/rq]' ) + 5;
347
- $params = substr ( $commentcontent, $start, $end - $start );
 
 
 
 
 
348
  global $comment;
349
  $author_name = $comment->comment_author;
350
  $author_url = $comment->comment_author_url;
351
  // get array of params
352
- $params_arr = explode ( ",", substr ( $params, 4, - 6 ) );
353
  // get and prepare the text specified by the user
354
- $prepend_text = $options ['comment_text'];
355
- $search = array ('[name]', '[type]', '[lastpost]' );
356
- $replace = array ($author_name, $params_arr [2], '' );
357
- $inserted = '<span class="cluv">';
358
- $inserted .= str_replace ( $search, $replace, $prepend_text );
359
- $commentcontent = str_replace ( $params, $inserted, $commentcontent );
360
- if ($options ['heart_tip'] == 'on') {
361
- $commentcontent .= '<span class="heart_tip_box"><img class="heart_tip" alt="My ComLuv Profile" border="0" width="16" height="14" src="' . $this->plugin_url . 'images/littleheart.gif"/></span>';
 
362
  }
363
  $commentcontent .= '</span>';
364
  }
365
  return $commentcontent;
366
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
367
 
368
  // set up default values
369
- function install() {
 
370
  // set default options
371
- $this->get_options ();
372
  }
373
 
374
  // Localization support
375
- function handle_load_domain() {
 
376
  // get current language
377
- $locale = get_locale ();
378
 
379
  // locate translation file
380
- $mofile = WP_PLUGIN_DIR . '/' . plugin_basename ( dirname ( __FILE__ ) ) . '/lang/' . $this->plugin_domain . '-' . $locale . '.mo';
381
 
382
  // load translation
383
- load_textdomain ( $this->plugin_domain, $mofile );
384
  }
385
- // call home to tell about comment submission or status
386
- function call_comluv($url) {
387
- if (function_exists ( "curl_init" )) {
388
- //setup curl values
389
- $curl = curl_init ();
390
- curl_setopt ( $curl, CURLOPT_URL, $url );
391
- curl_setopt ( $curl, CURLOPT_HEADER, 0 );
392
- curl_setopt ( $curl, CURLOPT_RETURNTRANSFER, TRUE );
393
- curl_setopt ( $curl, CURLOPT_TIMEOUT, 7 );
394
- $content = curl_exec ( $curl );
395
- if (! curl_error ( $curl )) {
396
- if (function_exists ( json_decode )) {
397
- $data = json_decode ( $content );
398
- if ($data->status != 200) {
399
- // unsuccessful confirmation.
400
- // have a tantrum here if you want.
401
- }
402
- }
403
- curl_close ( $curl );
404
 
405
- }
406
- } elseif (ini_get ( 'allow_url_fopen' )) {
407
- $content = @file_get_contents ( $url );
408
- }
409
- return $content;
410
- }
411
- // find last occurrence of string in string (for php 4)
412
- function my_strrpos($haystack, $needle, $offset = 0) {
413
- // same as strrpos, except $needle can be a string
414
- // http://www.webmasterworld.com/forum88/10570.htm
415
- $strrpos = false;
416
- if (is_string ( $haystack ) && is_string ( $needle ) && is_numeric ( $offset )) {
417
- $strlen = strlen ( $haystack );
418
- $strpos = strpos ( strrev ( substr ( $haystack, $offset ) ), strrev ( $needle ) );
419
- if (is_numeric ( $strpos )) {
420
- $strrpos = $strlen - $strpos - strlen ( $needle );
421
- }
422
- }
423
- return $strrpos;
424
- }
425
 
426
  }
427
  }
428
 
429
  // start commentluv class engines
430
- if (class_exists ( 'commentluv' )) :
431
- $badgeshown=FALSE;
432
- $commentluv = new commentluv ( );
433
 
434
  // confirm warp capability
435
- if (isset ( $commentluv )) {
 
436
  // engage
437
- register_activation_hook ( __FILE__, array (&$commentluv, 'install' ) );
438
 
439
  }
440
-
441
-
442
  endif;
443
 
444
-
445
  // function for template call
446
- function cl_display_badge() {
447
- $temp = new commentluv ( );
448
- $temp->display_badge ();
449
  }
450
 
451
- function htmlspecialchars_decode_own($string,$style=ENT_COMPAT)
452
- {
453
- $translation = array_flip(get_html_translation_table(HTML_SPECIALCHARS,$style));
454
- if($style === ENT_QUOTES){ $translation['&#039;'] = '\''; }
455
- return strtr($string,$translation);
456
- }
457
  ?>
2
  Plugin Name: CommentLuv
3
  Plugin URI: http://comluv.com/download/commentluv-wordpress/
4
  Description: Plugin to show a link to the last post from the commenters blog by parsing the feed at their given URL when they leave a comment. Rewards your readers and encourage more comments.
5
+ Version: 2.7.1
6
  Author: Andy Bailey
7
  Author URI: http://fiddyp.comluv.com/
8
 
9
  26 Apr 2009 - Start the new version using a class and updated localization (thanks Vladimir Prelovac for your great book on Wordpress Plugin Development!)
10
  05 Jun 2009 - Finalized last functions and integrated API. big up to @wpmuguru for API coding!
 
 
 
 
 
 
 
 
 
 
 
 
11
  */
12
  // Avoid name collision
13
+ if ( !class_exists('commentluv') ) {
14
  // let class begin
15
+ class commentluv
16
+ {
17
  //localization domain
18
  var $plugin_domain = 'commentluv';
19
  var $plugin_url;
20
  var $db_option = 'commentluv_options';
21
+ var $cl_version = 270;
22
  var $api_url;
23
 
24
  //initialize the plugin
25
+ function commentluv()
26
+ {
27
  global $wp_version, $pagenow;
28
  // pages where commentluv needs translation
29
+ $local_pages = array('plugins.php','commentluv.php');
30
  // check if translation needed on current page
31
+ if (in_array($pagenow, $local_pages) || in_array($_GET['page'],$local_pages)){
32
+ $this->handle_load_domain();
33
  }
34
+ $exit_msg = __('CommentLuv requires Wordpress 2.6.5 or newer.',$this->plugin_domain).
35
+ '<a href="http://codex.wordpress.org/Upgrading_Wordpress">'.
36
+ __('Please Update!', $this->plugin_domain).
37
+ '</a>';
38
 
39
  // can you dig it?
40
+ if (version_compare($wp_version,"2.6.5","<") )
41
+ {
42
+ exit ($exit_msg); // no diggedy
43
  }
44
 
45
  // action hooks
46
+ $this->plugin_url = trailingslashit( WP_PLUGIN_URL.'/'. dirname( plugin_basename(__FILE__) ));
47
  $this->api_url = 'http://api.comluv.com/cl_api/commentluvapi.php';
48
+ add_action('admin_menu', array(&$this, 'admin_menu'));
49
+ add_action('template_redirect', array(&$this, 'commentluv_scripts')); // template_redirect always called when page is displayed to user
50
+ add_action('wp_head',array(&$this, 'commentluv_style')); // add style sheet to header
51
+ add_action('wp_set_comment_status',array(&$this,'update_cl_status'), 1, 3); // call when status of comment gets changed
52
+ add_action('comment_post',array(&$this,'update_cl_status'), 2, 3); // call when comment gets posted
53
+ add_action('comment_form',array(&$this, 'add_fields')); // add hidden fields during comment form display time
54
+ add_filter('plugin_action_links', array(&$this,'commentluv_action'), -10, 2); // add a settings page link to the plugin description. use 2 for allowed vars
55
+ add_filter('comment_text', array(&$this,'do_shortcode')); // replace inserted data with hidden span on display time of comment
56
+ add_filter('pre_comment_content',array(&$this,'cl_post'),10); // extract extra fields data and insert data to end of comment
57
+ add_filter('get_comment_excerpt',array(&$this,'excerpt_tag_remove')); // remove the tags when get comment excerpt is used
58
+ add_filter('comment_excerpt',array(&$this,'excerpt_tag_remove')); // remove the tags when comment excerpt is used
59
+
60
  }
61
 
62
  // hook the options page
63
+ function admin_menu(){
64
+ $menutitle = '<img src="' . $this->plugin_url.'images/littleheart.gif" alt=""/> ';
65
  $menutitle .= 'CommentLuv';
66
+ add_options_page('CommentLuv Settings', $menutitle, 8, basename(__FILE__), array(&$this, 'handle_options'));
67
  }
68
  // add the settings link
69
+ function commentluv_action ($links, $file){
70
+ $this_plugin = plugin_basename(__FILE__);
71
+ if ($file == $this_plugin){
72
+ $links[] = "<a href='options-general.php?page=commentluv.php'>" . '<img src="' . $this->plugin_url.'images/littleheart.gif" alt=""/> ' . __('Settings', $this->plugin_domain) . "</a>";
73
  }
74
  return $links;
75
  }
76
  // hook the template_redirect for inserting style and javascript (using wp_head would make it too late to add dependencies)
77
+ function commentluv_scripts(){
78
  // only load scripts if on a single page
79
+ if(is_single()){
80
+ wp_enqueue_script('jquery');
81
  global $wp_version;
82
  // see if hoverintent library is already included (2.7 >)
83
+ if (version_compare($wp_version,"2.7","<")){
84
+ wp_enqueue_script('hoverIntent','/'.PLUGINDIR.'/'.dirname( plugin_basename(__FILE__)).'/js/hoverIntent.js',array('jquery'));
85
  } else {
86
+ wp_enqueue_script('hoverIntent','/'.WPINC.'/js/hoverIntent.js',array('jquery'));
87
  }
88
+ wp_enqueue_script('commentluv',$this->plugin_url.'js/commentluv.js',array('jquery'));
89
  // get options
90
+ $options=$this->get_options();
91
+ foreach ($options as $key =>$value){
92
  $$key = $value;
93
  }
94
  // prepare options
95
+ $default_on = $default_on == 'on'? 'checked':'';
96
  // untick the box if user is admin
97
  global $user_ID;
98
+ if( $user_ID ) {
99
+ if( current_user_can('create_users') ) {
100
  $default_on = '';
101
  }
102
  }
103
  $badge = $this->plugin_url . "images/" . $badge;
104
+ $badge_text = $options['badge'] == 'text'?'on':'';
105
  // insert options to header
106
+ wp_localize_script('commentluv','cl_settings',array(
107
+ 'name'=>$author_name,
108
+ 'url'=>$url_name,
109
+ 'comment'=>$comment_name,
110
+ 'email'=>$email_name,
111
+ 'prepend'=>$prepend,
112
+ 'badge'=>$badge,
113
+ 'show_text'=>$show_text,
114
+ 'badge_text'=>$badge_text,
115
+ 'heart_tip'=>$heart_tip,
116
+ 'default_on'=>$default_on,
117
+ 'select_text'=>$select_text,
118
+ 'cl_version'=>$this->cl_version,
119
+ 'images'=>$this->plugin_url . 'images/',
120
+ 'api_url'=>$this->api_url
121
+ ));
122
  }
123
  }
124
  // hook the head function for adding stylesheet
125
+ function commentluv_style (){
126
+ echo '<link rel="stylesheet" href="'.$this->plugin_url.'style/cl_style.css" type="text/css" />';
127
  }
128
 
129
  // get plugin options
130
+ function get_options(){
131
  // default values
132
+ $options = array(
133
+ 'comment_text' => '[name]&#180;s last [type] ..[lastpost]',
134
+ 'select_text' => 'choose a different post to show',
135
+ 'default_on' => 'on',
136
+ 'heart_tip' => 'on',
137
+ 'use_template' => '',
138
+ 'badge' => 'CL91x17-white2.gif',
139
+ 'show_text' => 'CommentLuv Enabled',
140
+ 'author_name' => 'author',
141
+ 'url_name' => 'url',
142
+ 'comment_name' => 'comment',
143
+ 'email_name' => 'email',
144
+ 'prepend' => ''
145
+ );
146
  // get saved options unless reset button was pressed
147
  $saved = '';
148
+ if(!isset($_POST['reset'])){
149
+ $saved = get_option($this->db_option);
150
  }
151
 
152
  // assign values
153
+ if (!empty($saved))
154
+ {
155
+ foreach ($saved as $key =>$option){
156
+ $options[$key] = $option;
157
  }
158
  }
159
  // update the options if necessary
160
+ if ($saved != $options){
161
+ update_option($this->db_option,$options);
162
  }
163
  // return the options
164
  return $options;
165
  }
166
 
167
  // handle saving and displaying options
168
+ function handle_options()
169
+ {
170
+ $options = $this->get_options();
171
+ if ( isset($_POST['submitted']) )
172
+ {
173
 
174
  // initialize the error class
175
+ $errors = new WP_Error();
176
 
177
  // check security
178
+ check_admin_referer('commentluv-nonce');
179
+
180
+ $options = array();
181
+ $options['comment_text']=htmlspecialchars($_POST['cl_comment_text']);
182
+ $options['select_text']=htmlspecialchars($_POST['cl_select_text']);
183
+ $options['default_on']=$_POST['cl_default_on'];
184
+ $options['heart_tip']=$_POST['cl_heart_tip'];
185
+ $options['badge']=$_POST['cl_badge'];
186
+ $options['show_text']=htmlspecialchars($_POST['cl_show_text']);
187
+ $options['prepend']=htmlspecialchars($_POST['cl_prepend']);
188
+ $options['author_name']=$_POST['cl_author_name'];
189
+ $options['url_name']=$_POST['cl_url_name'];
190
+ $options['comment_name']=$_POST['cl_comment_name'];
191
+ $options['email_name']=$_POST['cl_email_name'];
 
192
 
193
  // check for errors
194
+ if( count($errors->errors) > 0 ){
195
  echo '<div class="error"><h3>';
196
+ _e('There were errors with your chosen settings',$this->plugin_domain);
197
  echo '</h3>';
198
+ foreach( $errors->get_error_messages() as $message ){
199
  echo $message;
200
  }
201
  echo '</div>';
202
  } else {
203
  //every-ting cool mon
204
+ update_option($this->db_option, $options);
205
  echo '<div class="updated fade"><p>Plugin settings saved.</p></div>';
206
  }
207
 
208
  }
209
  // loop through each option and assign it as key=value
210
+ foreach ($options as $key =>$value){
211
  $$key = $value;
212
  }
213
  // set value to checked if option is on (for showing correct status of checkbox and radio button in settings page)
214
+ $default_on = $options['default_on'] == 'on'?'checked':'';
215
+ $heart_tip = $options['heart_tip'] == 'on'?'checked':'';
216
+ $badge1 = $options['badge'] == 'ACL88x31-black2.gif'?'checked':'';
217
+ $badge2 = $options['badge'] == 'ACL88x31-white2.gif'?'checked':'';
218
+ $badge3 = $options['badge'] == 'CL91x17-black2.gif'?'checked':'';
219
+ $badge4 = $options['badge'] == 'CL91x17-white2.gif'?'checked':'';
220
+ $badge5 = $options['badge'] == 'nothing.gif'?'checked':'';
221
+ $use_template = $options['use_template'] == 'on'?'checked':'';
222
+ $badge_text = $options['badge'] == 'text'?'checked':'';
223
 
224
  // url for form submit
225
+ $action_url = $_SERVER['REQUEST_URI'];
226
+ include('commentluv-manager.php');
227
  }
228
  // shortcode for showing badge and drop down box
229
+ function display_badge(){
230
+ if(is_single()){
231
+ $options = get_option($this->db_option);
 
232
  // choose as image or as text
233
+ $badge_text = $options['badge'] == 'text'?'on':'';
234
+ $default_on = $options['default_on'] == 'on'?'checked':'';
235
  // untick the box if user is admin
236
  global $user_ID;
237
+ if( $user_ID ) {
238
+ if( current_user_can('create_users') ) {
239
  $default_on = '';
240
  }
241
  }
242
+ $options['badge'] = $this->plugin_url . 'images/' . $options['badge'];
243
+ if($badge_text == ''){
244
+ $badge='<a href="http://comluv.com" target="_blank"><img src="' . $options['badge'] . '" border=0 alt="' . $options['show_text'] .'" title="'.$options['show_text'].'"/></a>';
245
  } else {
246
+ $badge='<a href="http://comluv.com" target="_blank">'.$options['show_text'].'</a>';
 
 
 
 
247
  }
248
+ echo '<div id="commentluv">' . $options['prepend'] . '<input type="checkbox" id="doluv" name="doluv" ' .
249
+ $default_on . ' style="width:25px;"></input><span id="mylastpost" style="clear: both">' .
250
+ $badge . '</span><img class="clarrow" id="showmore" src="' .
251
+ $this->plugin_url . 'images/down-arrow.gif" alt="show more" style="display:none;"/></div><div id="lastposts" style="display: none;"></div>';
252
  }
253
  }
254
  // hook the comment form to add fields for url for logged in users
255
+ function add_fields($id){
256
+ $options = get_option($this->db_option);
257
+ $cl_author_id=$options['author_name'];
258
+ $cl_site_id=$options['url_name'];
259
 
260
+ if (is_user_logged_in()){
261
  // get options values and insert as hidden fields
262
  global $userdata;
263
+ get_currentuserinfo();
264
+ $author=$userdata->display_name;
265
+ $userid=$userdata->ID;
266
+ $url=$userdata->user_url;
267
  // check for MU blog
268
+ if( function_exists( 'is_site_admin' ) ) {
269
+ if(!$url || $url=="http://"){
270
+ $userbloginfo = get_blogs_of_user($userid,1);
271
+ $url=$userbloginfo[1]->siteurl;
272
  }
273
  }
274
 
281
  echo '<input type="hidden" name="request_id" />';
282
  echo '<input type="hidden" name="cl_post" id="cl_post"/>';
283
  // check if using php call comments.php or not
284
+ if($options['use_template']==''){
285
+ $this->display_badge();
 
286
  }
287
  return $id;
288
  }
289
 
290
+ // hook the pre_comment_content to add the link using a tag after the user submits their comment but before it gets saved in db
291
+ function cl_post($commentdata){
292
+ if( isset($_POST['cl_post']) && $_POST['request_id'] !='' && is_numeric($_POST['choice_id']) && isset($_POST['cl_type']) ) {
293
  // get values posted
294
+ $luvlink = $_POST['cl_post'];
295
+ if(strstr($luvlink,"commentluv.com/error-check") || $_POST['request_id'] == 0){
296
  return $commentdata;
297
  }
298
+ $request_id = $_POST['request_id'];
299
+ $choice_id = $_POST['choice_id'];
300
+ $cl_type = $_POST['cl_type'];
301
+ // insert identifying data to end of comment
302
+ $commentdata.= "\n[rq=$request_id,$choice_id,$cl_type][/rq]$luvlink";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
303
  }
304
  return $commentdata;
305
  }
306
  // hook the set comment status action
307
  function update_cl_status($cid, $status) {
308
  // get comment stuff from id
309
+ if($status != 'spam') {
310
+ if($status != 'delete') {
311
  $status = 'approve';
312
  }
313
+ $comment = get_comment($cid);
314
+ if(strpos($comment->comment_content,"[rq=")){
315
  // comment can be approved or deleted in the comluv db
316
+ $url = $this->api_url ."?type={$status}&url=";
317
+ // get the added bits from comment
318
  $commentcontent = $comment->comment_content;
319
+ $start = strpos($commentcontent,'[rq=');
320
+ $end = strpos($commentcontent,'[/rq]');
321
+ $params = substr($commentcontent,$start+4,$end-$start-5);
322
+ $arr = explode(",",$params);
 
 
 
 
323
  // construct url with added params for approving comment to comluv
324
+ $url.=$comment->comment_author_url . "&request_id=" . $arr[0] . "&post_id=" . $arr[1] . "&version=" . $this->cl_version;
325
  // call the url ..
326
+ if(function_exists("curl_init")){
327
+ //setup curl values
328
+ $curl=curl_init();
329
+ curl_setopt($curl,CURLOPT_URL,$url);
330
+ curl_setopt($curl,CURLOPT_HEADER,0);
331
+ curl_setopt($curl,CURLOPT_RETURNTRANSFER,TRUE);
332
+ curl_setopt($curl,CURLOPT_TIMEOUT,7);
333
+ $content=curl_exec($curl);
334
+ if(!curl_error($curl)){
335
+ if(function_exists(json_decode)){
336
+ $data=json_decode($content);
337
+ if($data->status != 200){
338
+ // unsuccessful confirmation.
339
+ // have a tantrum here if you want.
340
+ }
341
+ }
342
+ curl_close($curl);
343
+
344
+ }
345
+ } elseif(ini_get('allow_url_fopen')){
346
+ $result = @file_get_contents($url);
347
+ }
348
+ } // end if comment content contains a rq var
349
  }
350
  }
351
+
352
  // use my own shortcode that was inserted at submission time and hide the params
353
  function do_shortcode($commentcontent) {
354
+ if(strpos($commentcontent,"[rq=")){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
355
  // get bit that was added
356
+ $start = strpos($commentcontent,'[rq=');
357
+ $end = strpos($commentcontent,'[/rq]') + 5;
358
+ $params = substr($commentcontent,$start,$end-$start);
359
+ $luvlink = substr($commentcontent,$end);
360
+ // insert hidden span for params and chop off luvlink for now
361
+ $commentcontent = substr($commentcontent,0,$start) . '<span class="cl_hidden" style="display:none;">' . $params . '</span>';
362
+ // get name and site of comment author
363
+ $options = get_option($this->db_option);
364
  global $comment;
365
  $author_name = $comment->comment_author;
366
  $author_url = $comment->comment_author_url;
367
  // get array of params
368
+ $params = explode(",",substr($params,4,-6));
369
  // get and prepare the text specified by the user
370
+ $prepend_text = $options['comment_text'];
371
+ $search = array('[name]','[type]','[lastpost]');
372
+ $replace = array($author_name,$params[2],$luvlink);
373
+ $inserted = str_replace($search,$replace,$prepend_text);
374
+ // append our doobries on the end of the hidden span
375
+ $commentcontent .= '<span class="cluv">'.$inserted;
376
+ // do heart info
377
+ if($options['heart_tip'] == 'on'){
378
+ $commentcontent .= '<span class="heart_tip_box"><img class="heart_tip" alt="My ComLuv Profile" border=0 width="16" height="14" src="'. $this->plugin_url . 'images/littleheart.gif"/></span>';
379
  }
380
  $commentcontent .= '</span>';
381
  }
382
  return $commentcontent;
383
  }
384
+ // hook the get_comment_excerpt filter to remove tags
385
+ function excerpt_tag_remove($theexcerpt){
386
+ if(strpos($theexcerpt,"[rq=")){
387
+ $start = strpos($theexcerpt,'[rq=');
388
+ if(strpos($theexcerpt,"[/rq]")) {
389
+ $end=strpos($theexcerpt,'[/rq]') + 5;
390
+ $params= substr($theexcerpt,$start,$end-$start);
391
+ $theexcerpt = str_replace($params,"",$theexcerpt);
392
+ } else {
393
+ $theexcerpt = substr($theexcerpt,0,$start) . '...';
394
+ }
395
+ }
396
+ return $theexcerpt;
397
+ }
398
 
399
  // set up default values
400
+ function install()
401
+ {
402
  // set default options
403
+ $this->get_options();
404
  }
405
 
406
  // Localization support
407
+ function handle_load_domain()
408
+ {
409
  // get current language
410
+ $locale = get_locale();
411
 
412
  // locate translation file
413
+ $mofile = WP_PLUGIN_DIR.'/'.plugin_basename(dirname(__FILE__)).'/lang/' . $this->plugin_domain . '-' . $locale . '.mo';
414
 
415
  // load translation
416
+ load_textdomain($this->plugin_domain, $mofile);
417
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
418
 
419
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
420
 
421
  }
422
  }
423
 
424
  // start commentluv class engines
425
+ if ( class_exists('commentluv') ) :
426
+ $commentluv = new commentluv();
 
427
 
428
  // confirm warp capability
429
+ if (isset($commentluv) )
430
+ {
431
  // engage
432
+ register_activation_hook( __FILE__, array(&$commentluv,'install') );
433
 
434
  }
 
 
435
  endif;
436
 
 
437
  // function for template call
438
+ function cl_display_badge(){
439
+ $temp = new commentluv();
440
+ $temp->display_badge();
441
  }
442
 
443
+
444
+
445
+
446
+
 
 
447
  ?>
js/commentluv.js CHANGED
@@ -1,4 +1,5 @@
1
  // commentluv.js 2.7
 
2
  (function($) {
3
  $(document).ready(function(){
4
  // get form object that is parent of textarea named "comment"
@@ -36,14 +37,18 @@
36
  });
37
  // set the event listener for the click action
38
  $('.cluv a').click(function(){
 
 
 
 
39
  var url=$(this).attr('href');
40
  // set link to open in a new window
41
- $(this).attr("target","_blank");
42
- var addit= "?type=click&url=" + url + "&callback=?";
43
  var clurl=cl_settings['api_url'] + addit;
44
  // call api, don't worry about returned data
45
  $.getJSON(clurl);
46
- return true;
47
  });
48
  // set the event listener for the click of the checkbox
49
  $('#doluv').click(function(){
@@ -63,12 +68,10 @@
63
  });
64
  // set hover event for heart tip
65
  if(cl_settings['heart_tip'] == "on"){
66
- $('.heart_tip_box').hoverIntent({over:heart_big,out: do_nowt,interval : 50,timeout: 50});
67
  }
68
- // set click on anywhere closes info box
69
- $(document).click(heart_small);
70
  function heart_big(){
71
- $("body").append('<span id="heart_tip_big" style="position:absolute; z-index: 101; background-color: pink; width: 62px;"><img src="' + cl_settings['images'] + 'loader.gif" alt="Loading" width="62" height="13" /></span>');
72
  // find where to put left edge of info box (in case at right hand side of screen
73
  //opera Netscape 6 Netscape 4x Mozilla
74
  if (window.innerWidth || window.innerHeight){
@@ -80,28 +83,19 @@
80
  docwidth = document.body.clientWidth;
81
  docheight = document.body.clientHeight;
82
  }
83
- var hasarea = docwidth - getAbsoluteLeft(this);
84
- if(hasarea > 350){
85
- var xpos = getAbsoluteLeft(this);
86
- } else {
87
- var xpos = getAbsoluteLeft(this) - 300;
88
- }
89
  if(xpos > (docwidth - 350)){
90
  xpos = xpos - 320;
91
  }
92
- var ypos = getAbsoluteTop(this);
93
- $('#heart_tip_big').css({'left':xpos + "px", 'top' :ypos + "px" });
94
- $('#heart_tip_big').hoverIntent({over:do_nowt,out: heart_small, interval : 50, timeout: 350});
95
- var linkspan = $(this).parents(".cluv");
96
  var link = $(linkspan).find("a:first").attr("href");
97
  var url = cl_settings['api_url'] + "?type=info&url=" + link + '&version='+ cl_settings['cl_version'] + '&callback=?';
98
  do_info(url);
99
  }
100
  function heart_small(){
101
- $("body").find("#heart_tip_big").remove();
102
- }
103
- function do_nowt(){
104
- return;
105
  }
106
 
107
 
@@ -118,17 +112,6 @@
118
  }
119
  return oLeft
120
  }
121
- function getAbsoluteTop(objectId) {
122
- // Get an object top position from the upper left viewport corner
123
- o = objectId;
124
- oTop = o.offsetTop // Get top position from the parent object
125
- while(o.offsetParent!=null) { // Parse the parent hierarchy up to the document element
126
- oParent = o.offsetParent // Get parent object reference
127
- oTop += oParent.offsetTop // Add parent top position
128
- o = oParent
129
- }
130
- return oTop
131
- }
132
 
133
  function do_info(url){
134
  $.getJSON(url,function(data){
@@ -178,7 +161,7 @@
178
  });
179
  // disable focus event
180
  $("textarea[name='" + cl_settings['comment'] + "']").unbind();
181
- }
182
  }
183
 
184
  })(jQuery);
1
  // commentluv.js 2.7
2
+ jQuery.noConflict();
3
  (function($) {
4
  $(document).ready(function(){
5
  // get form object that is parent of textarea named "comment"
37
  });
38
  // set the event listener for the click action
39
  $('.cluv a').click(function(){
40
+
41
+ // get request_id from within hidden span and url that was clicked
42
+ var str = $(this).parents("span").prev("span").text();
43
+ var params = str.substr(4).split(",");
44
  var url=$(this).attr('href');
45
  // set link to open in a new window
46
+ $(this).attr("target","_blank");
47
+ var addit= "?type=click&request_id=" + params[0] + "&url=" + url + "&callback=?";
48
  var clurl=cl_settings['api_url'] + addit;
49
  // call api, don't worry about returned data
50
  $.getJSON(clurl);
51
+ return true;
52
  });
53
  // set the event listener for the click of the checkbox
54
  $('#doluv').click(function(){
68
  });
69
  // set hover event for heart tip
70
  if(cl_settings['heart_tip'] == "on"){
71
+ $('.heart_tip_box').hoverIntent({over:heart_big,out: heart_small,interval : 250,timeout: 350});
72
  }
 
 
73
  function heart_big(){
74
+ $(this).append('<span id="heart_tip_big" style="position:absolute; z-index: 1000; background-color: pink; width: 62px;"><img src="' + cl_settings['images'] + 'loader.gif" alt="Loading" width="62" height="13" /></span>');
75
  // find where to put left edge of info box (in case at right hand side of screen
76
  //opera Netscape 6 Netscape 4x Mozilla
77
  if (window.innerWidth || window.innerHeight){
83
  docwidth = document.body.clientWidth;
84
  docheight = document.body.clientHeight;
85
  }
86
+
87
+ var xpos = getAbsoluteLeft(this);
 
 
 
 
88
  if(xpos > (docwidth - 350)){
89
  xpos = xpos - 320;
90
  }
91
+ $('#heart_tip_big').css({'left':xpos + "px", 'margin-top' : '-17px'});
92
+ var linkspan = $(this).parents(".cluv");
 
 
93
  var link = $(linkspan).find("a:first").attr("href");
94
  var url = cl_settings['api_url'] + "?type=info&url=" + link + '&version='+ cl_settings['cl_version'] + '&callback=?';
95
  do_info(url);
96
  }
97
  function heart_small(){
98
+ $(this).find("#heart_tip_big").remove();
 
 
 
99
  }
100
 
101
 
112
  }
113
  return oLeft
114
  }
 
 
 
 
 
 
 
 
 
 
 
115
 
116
  function do_info(url){
117
  $.getJSON(url,function(data){
161
  });
162
  // disable focus event
163
  $("textarea[name='" + cl_settings['comment'] + "']").unbind();
164
+ }
165
  }
166
 
167
  })(jQuery);
lang/commentluv-it_IT.mo DELETED
Binary file
lang/commentluv-it_IT.po DELETED
@@ -1,127 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: CommentLuv 2.7.5\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2009-06-19 10:27-0000\n"
6
- "PO-Revision-Date: \n"
7
- "Last-Translator: Andy Bailey <admin@comluv.com>\n"
8
- "Language-Team: @commentluv, Gianni Diurno <admin@comluv.com>\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "X-Poedit-Language: English\n"
13
- "X-Poedit-Country: UNITED KINGDOM\n"
14
- "X-Poedit-KeywordsList: __;_e\n"
15
- "X-Poedit-Basepath: .\n"
16
- "X-Poedit-SearchPath-0: ..\n"
17
-
18
- #: ../commentluv-manager.php:11
19
- msgid "This plugin takes the url from the comment form and tries to parse the feed of the site and display the last entry made. If you have any questions, comments or if you have a good idea that you would like to see in the next version of CommentLuv, please visit http://comluv.com and let me know."
20
- msgstr ""
21
- "Questo plugin ottiene l'url dal modulo dei commenti provando di conseguenza l'analisi del feed del sito facendo sì che sia possibile mostrarne i contenuti più recenti. \n"
22
- "Qualora avessi qualche domanda, commento o avessi una brillante idea da proporre per la prossima versione di CommentLuv, visita il FiddyP Blog oppure il forum di supporto e fammi sapere."
23
-
24
- #: ../commentluv-manager.php:12
25
- msgid "Display Options"
26
- msgstr "Mostra opzioni"
27
-
28
- #: ../commentluv-manager.php:13
29
- msgid "Enter the text you want displayed in the comment"
30
- msgstr "Inserisci il testo che desideri sia mostrato nel commento"
31
-
32
- #: ../commentluv-manager.php:16
33
- msgid "Text displayed in the select box"
34
- msgstr "Testo visibile nella casella di selezione"
35
-
36
- #: ../commentluv-manager.php:20
37
- msgid "CommentLuv on by default?"
38
- msgstr "CommentLuv attivo come predefinita?"
39
-
40
- #: ../commentluv-manager.php:23
41
- msgid "Show heart on links?"
42
- msgstr "Desideri mostrare il cuore nei link?"
43
-
44
- #: ../commentluv-manager.php:27
45
- msgid "Use template insert to show badge and checkbox?"
46
- msgstr "Desideri utilizzare il template per mostrare il badge e la casella di testo?"
47
-
48
- #: ../commentluv-manager.php:29
49
- msgid "Display Badge"
50
- msgstr "Mostra badge"
51
-
52
- #: ../commentluv-manager.php:30
53
- msgid "Many thanks to <a href=\"http://byteful.com\">Byteful Traveller</a> for creating these images."
54
- msgstr "Un grazie sincero a <a href=\"http://byteful.com\">Byteful Traveller</a> per avere realizzato queste immagini."
55
-
56
- #: ../commentluv-manager.php:33
57
- msgid "Choose badge to display"
58
- msgstr "Scegli il badge da mostrare"
59
-
60
- #: ../commentluv-manager.php:39
61
- msgid "Show nothing"
62
- msgstr "niente"
63
-
64
- #: ../commentluv-manager.php:42
65
- msgid "Show text"
66
- msgstr "Mostra testo"
67
-
68
- #: ../commentluv-manager.php:42
69
- msgid "Prepend html before badge or text (optional)"
70
- msgstr "Prefisso html per il badge o testo (facoltativo)"
71
-
72
- #: ../commentluv-manager.php:44
73
- msgid "CommentLuv Member Area"
74
- msgstr "Area membri CommentLuv"
75
-
76
- #: ../commentluv-manager.php:45
77
- msgid "If you register your site for free at <a href=\"http://comluv.com\">ComLuv.com</a> you will be able to open up lots of features that are for members only like link tracking so you can see which of the comments you make on CommentLuv blogs are getting the last blog post clicked and the ability to send back more than just blog posts. You can even create your own WP2.7 blog there with commentluv pre-installed!."
78
- msgstr "Qualora registrassi gratuitamente il tuo sito a <a href=\"http://comluv.com\">ComLuv.com</a>, avrai la possibilità di aggiungere delle ulteriori funzioni riservate esclusivamente ai soli membri: il tracciamento dei link in modo tale che tu possa vedere quali commenti effettuati sui blog CommentLuv abbiano generato delle visite al tuo ultimo articolo nonché la possibilità di rimandare non solo gli articoli. Potrai infine creare il tuo blog WP2.8 con commentluv pre-installato!."
79
-
80
- #: ../commentluv-manager.php:47
81
- msgid "Technical Settings"
82
- msgstr "Impostazioni tecniche"
83
-
84
- #: ../commentluv-manager.php:48
85
- msgid "In most cases you shouldn't need to change these settings unless you have a customized comment form"
86
- msgstr "Non dovrai modificare queste impostazioni sino a quando non avrai personalizzato il modulo dei commenti"
87
-
88
- #: ../commentluv-manager.php:52
89
- msgid "Authors Name field name"
90
- msgstr "Nome per il campo autore"
91
-
92
- #: ../commentluv-manager.php:56
93
- msgid "Email field name"
94
- msgstr "Nome per il campo email"
95
-
96
- #: ../commentluv-manager.php:60
97
- msgid "Authors URL field name"
98
- msgstr "Nome per il campo URL autore"
99
-
100
- #: ../commentluv-manager.php:64
101
- msgid "Comment Text Area name"
102
- msgstr "Nome per l'area di testo dei commenti"
103
-
104
- #: ../commentluv-manager.php:72
105
- msgid "Reset to Default Settings"
106
- msgstr "Ripristina alle impostazioni predefinite"
107
-
108
- #: ../commentluv-manager.php:77
109
- msgid "Are you sure you want to reset your settings? Press OK to continue"
110
- msgstr "Sei certo di volere ripristinare le tue impostazioni? Premi OK per proseguire"
111
-
112
- #: ../commentluv.php:44
113
- msgid "CommentLuv requires Wordpress 2.6.5 or newer."
114
- msgstr "CommentLuv richiede una versione di Wordpress 2.6.5 o superiore."
115
-
116
- #: ../commentluv.php:44
117
- msgid "Please Update!"
118
- msgstr "Aggiorna!"
119
-
120
- #: ../commentluv.php:75
121
- msgid "Settings"
122
- msgstr "Impostazioni"
123
-
124
- #: ../commentluv.php:169
125
- msgid "There were errors with your chosen settings"
126
- msgstr "Si sono verificati alcuni errori in relazione alle impostazioni che hai scelto"
127
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lang/commentluv.mo CHANGED
Binary file
lang/commentluv.pot CHANGED
@@ -1,125 +1,127 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: CommentLuv 2.7.5\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2009-06-19 10:27-0000\n"
6
- "PO-Revision-Date: \n"
7
- "Last-Translator: Andy Bailey <admin@comluv.com>\n"
8
- "Language-Team: @commentluv, Gianni Diurno <admin@comluv.com>\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "X-Poedit-Language: English\n"
13
- "X-Poedit-Country: UNITED KINGDOM\n"
14
- "X-Poedit-KeywordsList: __;_e\n"
15
- "X-Poedit-Basepath: .\n"
16
- "X-Poedit-SearchPath-0: ..\n"
17
-
18
- #: ../commentluv-manager.php:11
19
- msgid "This plugin takes the url from the comment form and tries to parse the feed of the site and display the last entry made. If you have any questions, comments or if you have a good idea that you would like to see in the next version of CommentLuv, please visit http://comluv.com and let me know."
20
- msgstr ""
21
-
22
- #: ../commentluv-manager.php:12
23
- msgid "Display Options"
24
- msgstr ""
25
-
26
- #: ../commentluv-manager.php:13
27
- msgid "Enter the text you want displayed in the comment"
28
- msgstr ""
29
-
30
- #: ../commentluv-manager.php:16
31
- msgid "Text displayed in the select box"
32
- msgstr ""
33
-
34
- #: ../commentluv-manager.php:20
35
- msgid "CommentLuv on by default?"
36
- msgstr ""
37
-
38
- #: ../commentluv-manager.php:23
39
- msgid "Show heart on links?"
40
- msgstr ""
41
-
42
- #: ../commentluv-manager.php:27
43
- msgid "Use template insert to show badge and checkbox?"
44
- msgstr ""
45
-
46
- #: ../commentluv-manager.php:29
47
- msgid "Display Badge"
48
- msgstr ""
49
-
50
- #: ../commentluv-manager.php:30
51
- msgid "Many thanks to <a href=\"http://byteful.com\">Byteful Traveller</a> for creating these images."
52
- msgstr ""
53
-
54
- #: ../commentluv-manager.php:33
55
- msgid "Choose badge to display"
56
- msgstr ""
57
-
58
- #: ../commentluv-manager.php:39
59
- msgid "Show nothing"
60
- msgstr ""
61
-
62
- #: ../commentluv-manager.php:42
63
- msgid "Show text"
64
- msgstr ""
65
-
66
- #: ../commentluv-manager.php:42
67
- msgid "Prepend html before badge or text (optional)"
68
- msgstr ""
69
-
70
- #: ../commentluv-manager.php:44
71
- msgid "CommentLuv Member Area"
72
- msgstr ""
73
-
74
- #: ../commentluv-manager.php:45
75
- msgid "If you register your site for free at <a href=\"http://comluv.com\">ComLuv.com</a> you will be able to open up lots of features that are for members only like link tracking so you can see which of the comments you make on CommentLuv blogs are getting the last blog post clicked and the ability to send back more than just blog posts. You can even create your own WP2.7 blog there with commentluv pre-installed!."
76
- msgstr ""
77
-
78
- #: ../commentluv-manager.php:47
79
- msgid "Technical Settings"
80
- msgstr ""
81
-
82
- #: ../commentluv-manager.php:48
83
- msgid "In most cases you shouldn't need to change these settings unless you have a customized comment form"
84
- msgstr ""
85
-
86
- #: ../commentluv-manager.php:52
87
- msgid "Authors Name field name"
88
- msgstr ""
89
-
90
- #: ../commentluv-manager.php:56
91
- msgid "Email field name"
92
- msgstr ""
93
-
94
- #: ../commentluv-manager.php:60
95
- msgid "Authors URL field name"
96
- msgstr ""
97
-
98
- #: ../commentluv-manager.php:64
99
- msgid "Comment Text Area name"
100
- msgstr ""
101
-
102
- #: ../commentluv-manager.php:72
103
- msgid "Reset to Default Settings"
104
- msgstr ""
105
-
106
- #: ../commentluv-manager.php:77
107
- msgid "Are you sure you want to reset your settings? Press OK to continue"
108
- msgstr ""
109
-
110
- #: ../commentluv.php:44
111
- msgid "CommentLuv requires Wordpress 2.6.5 or newer."
112
- msgstr ""
113
-
114
- #: ../commentluv.php:44
115
- msgid "Please Update!"
116
- msgstr ""
117
-
118
- #: ../commentluv.php:75
119
- msgid "Settings"
120
- msgstr ""
121
-
122
- #: ../commentluv.php:169
123
- msgid "There were errors with your chosen settings"
124
- msgstr ""
125
-
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: commentluv\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2009-05-30 09:54-0000\n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: Andy Bailey <andy@teamplaylotto.com>\n"
8
+ "Language-Team: \n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-Language: English\n"
13
+ "X-Poedit-Country: UNITED KINGDOM\n"
14
+ "X-Poedit-KeywordsList: __;_e\n"
15
+ "X-Poedit-Basepath: .\n"
16
+ "X-Poedit-SearchPath-0: ..\n"
17
+
18
+ #: ../commentluv-manager.php:11
19
+ msgid ""
20
+ "This plugin takes the url from the comment form and tries to parse the feed of the site and display the last entry made. \n"
21
+ "\t\t\t\t\tIf you have any questions, comments or if you have a good idea that you would like to see in the next version of CommentLuv, please visit FiddyP Blog or support forum and let me know."
22
+ msgstr ""
23
+
24
+ #: ../commentluv-manager.php:13
25
+ msgid "Display Options"
26
+ msgstr ""
27
+
28
+ #: ../commentluv-manager.php:14
29
+ msgid "Enter the text you want displayed in the comment"
30
+ msgstr ""
31
+
32
+ #: ../commentluv-manager.php:17
33
+ msgid "Text displayed in the select box"
34
+ msgstr ""
35
+
36
+ #: ../commentluv-manager.php:21
37
+ msgid "CommentLuv on by default?"
38
+ msgstr ""
39
+
40
+ #: ../commentluv-manager.php:24
41
+ msgid "Show heart on links?"
42
+ msgstr ""
43
+
44
+ #: ../commentluv-manager.php:28
45
+ msgid "Use template insert to show badge and checkbox?"
46
+ msgstr ""
47
+
48
+ #: ../commentluv-manager.php:30
49
+ msgid "Display Badge"
50
+ msgstr ""
51
+
52
+ #: ../commentluv-manager.php:31
53
+ msgid "Many thanks to <a href=\"http://byteful.com\">Byteful Traveller</a> for creating these images."
54
+ msgstr ""
55
+
56
+ #: ../commentluv-manager.php:34
57
+ msgid "Choose badge to display"
58
+ msgstr ""
59
+
60
+ #: ../commentluv-manager.php:40
61
+ msgid "Show nothing"
62
+ msgstr ""
63
+
64
+ #: ../commentluv-manager.php:43
65
+ msgid "Show text"
66
+ msgstr ""
67
+
68
+ #: ../commentluv-manager.php:43
69
+ msgid "Prepend html before badge or text (optional)"
70
+ msgstr ""
71
+
72
+ #: ../commentluv-manager.php:45
73
+ msgid "CommentLuv Member Area"
74
+ msgstr ""
75
+
76
+ #: ../commentluv-manager.php:46
77
+ msgid "If you register your site for free at <a href=\"http://comluv.com\">ComLuv.com</a> you will be able to open up lots of features that are for members only like link tracking so you can see which of the comments you make on CommentLuv blogs are getting the last blog post clicked and the ability to send back more than just blog posts. You can even create your own WP2.7 blog there with commentluv pre-installed!."
78
+ msgstr ""
79
+
80
+ #: ../commentluv-manager.php:48
81
+ msgid "Technical Settings"
82
+ msgstr ""
83
+
84
+ #: ../commentluv-manager.php:49
85
+ msgid "In most cases you shouldn't need to change these settings unless you have a customized comment form"
86
+ msgstr ""
87
+
88
+ #: ../commentluv-manager.php:53
89
+ msgid "Authors Name field name"
90
+ msgstr ""
91
+
92
+ #: ../commentluv-manager.php:57
93
+ msgid "Email field name"
94
+ msgstr ""
95
+
96
+ #: ../commentluv-manager.php:61
97
+ msgid "Authors URL field name"
98
+ msgstr ""
99
+
100
+ #: ../commentluv-manager.php:65
101
+ msgid "Comment Text Area name"
102
+ msgstr ""
103
+
104
+ #: ../commentluv-manager.php:73
105
+ msgid "Reset to Default Settings"
106
+ msgstr ""
107
+
108
+ #: ../commentluv-manager.php:78
109
+ msgid "Are you sure you want to reset your settings? Press OK to continue"
110
+ msgstr ""
111
+
112
+ #: ../commentluv.php:50
113
+ msgid "CommentLuv requires Wordpress 2.6.5 or newer."
114
+ msgstr ""
115
+
116
+ #: ../commentluv.php:52
117
+ msgid "Please Update!"
118
+ msgstr ""
119
+
120
+ #: ../commentluv.php:86
121
+ msgid "Settings"
122
+ msgstr ""
123
+
124
+ #: ../commentluv.php:205
125
+ msgid "There were errors with your chosen settings"
126
+ msgstr ""
127
+
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link:http://comluv.com/about/donate
4
  Tags: commentluv, comments, last blog post, linkluv
5
  Requires at least: 2.6.5
6
  Tested up to: 2.8
7
- Stable tag: 2.7.61
8
 
9
  Reward your readers by automatically placing a link to their last blog post at the end of their comment. Encourage a community and discover new posts.
10
 
@@ -23,18 +23,13 @@ You can visit http://comluv.com to find out more about this plugin.
23
  == Details ==
24
 
25
  CommentLuv functionality
26
- * Works with Wordpress 2.65, 2.7.1 and 2.8
27
- * Compatible with WPmu and logged on users
28
- * Language support
29
- * Communicates with remote API when comment is deleted or spammed
30
- * Uses WP includes for jQuery and hoverIntent for improved compatibility with other plugins
31
- * Auto configures to recognize comment form
32
 
33
  == Installation ==
34
 
35
  Wordpress : Extract the zip file and just drop the contents in the wp-content/plugins/ directory of your WordPress installation and then activate the Plugin from Plugins page.
36
 
37
- WordpressMu : Same as above
38
 
39
  == Configuration ==
40
 
@@ -42,7 +37,7 @@ Display Options :
42
  Enter the text you want displayed in the comment for the link that is added.
43
  [name] -> replaced with comment author name
44
  [type] -> replaced with blog, twitter or digg depending on what type of link the author chose to include.
45
- [lastpot] -> replaced with the titled link.
46
 
47
  Text displayed in the select box -> shows in the pull down box when a user has more than one post to choose from
48
 
@@ -58,8 +53,11 @@ CommentLuv member area -> for future use
58
 
59
  Technical Settings:
60
  Authors name field name -> The name value of the field used on your comment form for the comment authors name
 
61
  Email field name -> The name value of the field used on your comment form for the comment authors email
 
62
  Authors URL field name -> The name value of the field used on your comment form for the comment authors site URL
 
63
  Comments Text Area Name -> The name value of the field used on your comment form for the comment
64
 
65
  update -> updates the settings
@@ -67,7 +65,7 @@ update -> updates the settings
67
  reset -> if you get in trouble, click this to reset to default settings
68
 
69
  == Adding to your template ==
70
- Use &lt;php cl_show_badge(); ?&gt; in your comments.php file where you want the badge and checkbox to be shown
71
 
72
  == Frequently Asked Questions ==
73
 
@@ -87,26 +85,7 @@ You can submit a support ticket at http://comluv.com
87
  1. settings page
88
 
89
  2. in use
90
- This plugin inserts fields to the comment form at run time. If you find there is no badge shown on the comment form after you first install it, please check your comments.php file for the command &lt;?php do\_action('comment\_form', $post->ID); ?&gt; before the &lt;/form> tag
91
-
92
- For logged on users and administrators, be sure to check your profile on your own dashboard and make sure there is a url entered.
93
-
94
- == ChangeLog ==
95
- 05 Jun 2009 - Finalized last functions and integrated API. big up to @wpmuguru for API coding!
96
 
97
- 10 Jun 2009 - Fix for php4 hosting. changed "public" to "var" and check function exists for json_decode
98
-
99
- 11 Jun 2009 - Small bug in using text as badge fixed. Changed strpos to strrpos to find last tag code in text. priority 1 for comment_text
100
- removed request id data from being inserted (too many complaints!) and adjusted the way comment status change is handled. approve is done at post submission and delete is done at change status (with no request id sent)
101
-
102
- 12 Jun 2009 - small fixes for valid xhtml on images and checkbox . remove identifying .-= / =-. from inserted link on display time.
103
-
104
- 13 Jun 2009 - fix php4 from not allowing last string pos (strrpos)
105
- - validates for Kelson (speedforce.org) (had a big cake yesterday nomnom)
106
-
107
- 14 Jun 2009 - Italian translation added (and fix CR in string on manager page). Thanks go to Gianni Diurno
108
 
109
- 16 Jun 2009 - Bug fix, use_template checkbox not displaying when selected on settings page (breaker). typo in settings page now uses &lt;?php cl\_display\_badge(); ?&gt;
110
- - added global variable for badgeshown to prevent mulitple instances (template contains function call AND use template check is off)
111
- - fixed output of prepend html using decode html and stripslashes. Added green background to update settings button.
112
- 19 Jun 2009 - fix for htmlspecialchars\_decode causing error in wp < 2.8
4
  Tags: commentluv, comments, last blog post, linkluv
5
  Requires at least: 2.6.5
6
  Tested up to: 2.8
7
+ Stable tag: 2.7.6
8
 
9
  Reward your readers by automatically placing a link to their last blog post at the end of their comment. Encourage a community and discover new posts.
10
 
23
  == Details ==
24
 
25
  CommentLuv functionality
26
+ * Works with Wordpress 2.65, 2.7.1 and 2.8, Compatible with WPmu and logged on users, Language support, Communicates with remote API when comment is deleted or spammed, Uses WP includes for jQuery and hoverIntent for improved compatibility with other plugins, Auto configures to recognize comment form
 
 
 
 
 
27
 
28
  == Installation ==
29
 
30
  Wordpress : Extract the zip file and just drop the contents in the wp-content/plugins/ directory of your WordPress installation and then activate the Plugin from Plugins page.
31
 
32
+ WordpressMu : Same as above (do not place in mu-plugins)
33
 
34
  == Configuration ==
35
 
37
  Enter the text you want displayed in the comment for the link that is added.
38
  [name] -> replaced with comment author name
39
  [type] -> replaced with blog, twitter or digg depending on what type of link the author chose to include.
40
+ [lastpost] -> replaced with the titled link.
41
 
42
  Text displayed in the select box -> shows in the pull down box when a user has more than one post to choose from
43
 
53
 
54
  Technical Settings:
55
  Authors name field name -> The name value of the field used on your comment form for the comment authors name
56
+
57
  Email field name -> The name value of the field used on your comment form for the comment authors email
58
+
59
  Authors URL field name -> The name value of the field used on your comment form for the comment authors site URL
60
+
61
  Comments Text Area Name -> The name value of the field used on your comment form for the comment
62
 
63
  update -> updates the settings
65
  reset -> if you get in trouble, click this to reset to default settings
66
 
67
  == Adding to your template ==
68
+ Use &lt;php cl\_display\_badge(); ?&gt; in your comments.php file where you want the badge and checkbox to be shown
69
 
70
  == Frequently Asked Questions ==
71
 
85
  1. settings page
86
 
87
  2. in use
 
 
 
 
 
 
88
 
89
+ This plugin inserts fields to the comment form at run time. If you find there is no badge shown on the comment form after you first install it, please check your comments.php file for the command &lt;?php do\_action('comment\_form', $post->ID); ?&gt; before the &lt;/form> tag
 
 
 
 
 
 
 
 
 
 
90
 
91
+ For logged on users and administrators, be sure to check your profile on your own dashboard and make sure there is a url entered.
 
 
 
style/cl_style.css CHANGED
@@ -5,7 +5,7 @@
5
 
6
  }
7
  #commentluv {
8
- clear: both !important;
9
  }
10
  #commentluv img{
11
  border: 0 !important;
@@ -14,9 +14,7 @@
14
  .cluv {
15
  border:1px solid #fff;
16
  padding: 5px;
17
- display: block;
18
- font-size: 100% !important;
19
- text-transform: none !important;
20
  }
21
  #lastposts {
22
  width: 500px;
5
 
6
  }
7
  #commentluv {
8
+ clear: both;
9
  }
10
  #commentluv img{
11
  border: 0 !important;
14
  .cluv {
15
  border:1px solid #fff;
16
  padding: 5px;
17
+ display: block
 
 
18
  }
19
  #lastposts {
20
  width: 500px;