CommentLuv - Version 2.5

Version Description

Download this release

Release Info

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

Code changes from version 2.1.6 to 2.5

commentluv.mo CHANGED
Binary file
commentluv.php CHANGED
@@ -2,7 +2,7 @@
2
  Plugin Name: commentluv
3
  Plugin URI: http://www.commentluv.com/download/ajax-commentluv-installation/
4
  Description: Plugin to show a link to the last post from the commenters blog in their comment. Just activate and it's ready. Will parse a feed from most sites that have a feed location specified in its head html. See the <a href="options-general.php?page=commentluv">Settings Page</a> for styling and text output options.
5
- Version: 2.1.5
6
  Author: Andy Bailey
7
  Author URI: http://www.fiddyp.co.uk/
8
 
@@ -10,6 +10,10 @@ Author URI: http://www.fiddyp.co.uk/
10
  You can now edit the options from the dashboard
11
  *********************************************************************
12
  updates:
 
 
 
 
13
  2.1.6 27/9/8 make compatible for less that wp 2.5.1
14
  2.1.5 25/9/8 do the features ever stop?? Marco says we should had some option for html to be added before button and delete old selects if change url. done!
15
  also I am a dumbo for using wp_enqueue_script in the function called by wp_head, it should be before that. so sorry everyone! (retiredat47.com)
@@ -114,11 +118,32 @@ add_filter('whitelist_options','commentluv_alter_whitelist_options');
114
  register_activation_hook(__FILE__, 'commentluv_activation');
115
  wp_enqueue_script('jquery');
116
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
 
118
  // make compatible with Mu
119
  function commentluv_alter_whitelist_options($whitelist) {
120
  if(is_array($whitelist)) {
121
- $option_array = array('commentluv' => array('cl_comment_text','cl_default_on','cl_style','cl_author_id','cl_site_id','cl_comment_id','cl_commentform_id','cl_badge','cl_member_id','cl_click_track','cl_author_type','cl_url_type','cl_textarea_type','cl_reset','cl_showtext','cl_badge_pos','cl_prepend'));
122
  $whitelist = array_merge($whitelist,$option_array);
123
  }
124
  return $whitelist;
@@ -144,8 +169,9 @@ function commentluv_setup()
144
  function commentluv_activation(){
145
  // set version for future releases if they need to change a value
146
  $version=get_option('cl_version');
147
- if($version<213){
148
- update_option('cl_version','213');
 
149
  }
150
  }
151
 
@@ -202,6 +228,7 @@ function show_cl_options() {
202
  add_options_page('CommentLuv', 'CommentLuv', 8, 'commentluv', 'cl_options_page');
203
  add_option('cl_comment_text','[name]&#180;s last blog post..[lastpost]');
204
  add_option('cl_default_on','TRUE');
 
205
  add_option('cl_style','border:1px solid; display:block; padding:4px;');
206
  add_option('cl_author_id','author');
207
  add_option('cl_site_id','url');
@@ -209,15 +236,15 @@ function show_cl_options() {
209
  add_option('cl_commentform_id','#commentform');
210
  add_option('cl_badge','ACL88x31-white.gif');
211
  add_option('cl_member_id','');
212
- add_option('cl_author_type','ID');
213
- add_option('cl_url_type','ID');
214
- add_option('cl_textarea_type','ID');
215
  add_option('cl_click_track','on');
216
  add_option('cl_showtext','CommentLuv Enabled');
217
  add_option('cl_badge_pos','');
218
  add_option('cl_prepend','');
219
  commentluv_activation();
220
- add_option('cl_version','213');
221
  add_option('cl_select_text','choose a different post to show');
222
  }
223
 
@@ -238,7 +265,6 @@ function cl_style_script(){
238
  if ($cl_script_added) {
239
  return;
240
  }
241
- $cl_commentform_id=get_option('cl_commentform_id');
242
 
243
  $cl_comment_id=get_option('cl_comment_id');
244
  $cl_author_id=get_option('cl_author_id');
@@ -249,7 +275,7 @@ function cl_style_script(){
249
  $author_selector= (get_option('cl_author_type')=="name")? "\"input[name='$cl_author_id']\"" : "'#$cl_author_id'";
250
  $url_selector= (get_option('cl_url_type')=="name")? "\"input[name='$cl_site_id']\"" : "'#$cl_site_id'";
251
 
252
- $cl_comment_text=str_replace("'","&#180;",get_option('cl_comment_text'));
253
  $cl_default_on=get_option('cl_default_on');
254
  $cl_badge=get_option('cl_badge');
255
  $cl_member_id=get_option('cl_member_id');
@@ -260,145 +286,100 @@ function cl_style_script(){
260
  } else {
261
  $cl_badge_val="<img src=\"".WP_PLUGIN_URL."/commentluv/$cl_badge\"/>";
262
  }
263
-
264
  // check if user has set append ID differently
265
  $append_id=get_option('cl_badge_pos');
266
- if($append_id){
267
- $cl_commentform_id="#".$append_id;
268
- }
269
- // optional prepend
270
- $cl_prepend=get_option('cl_prepend');
271
-
272
- // select text
273
- $cl_select_text=get_option('cl_select_text');
274
-
275
- $script="\njQuery(document).ready(function() {\n".
276
- "jQuery('$cl_commentform_id').after('$cl_prepend<span id=\"mylastpost\" style=\"clear: both\"><a href=\"http://www.commentluv.com\">".
277
- "$cl_badge_val</a></span>' + '<br/><select name=\"lastposts\" id=\"lastposts\"><option value=0 ></option></select>');\n".
278
- "jQuery('$cl_commentform_id').append('<input type=\"hidden\" id=\"cl_post\" name=\"cl_post\"></input>');\n".
279
- "jQuery('#lastposts').hide();\n";
280
- if(get_option('cl_click_track')=="on"){
281
- $script.="jQuery('abbr em a').click(processclick);\n";
282
- }
283
- $script.="jQuery($comment_selector).focus(cl_dostuff); \n".
284
- "jQuery('#lastposts').change(function(){ \n".
285
- "jQuery('option').remove(\":contains('".$cl_select_text."')\");\n".
286
- "var url = jQuery(this).val();\n".
287
- "var title = jQuery('#lastposts option:selected').text(); \n".
288
- "jQuery('#mylastpost a').replaceWith('<a href=\"' + url + '\">' + title + '</a>');\n".
289
- "jQuery('#cl_post').val('<a href=\"' + url + '\">' + title + '</a>');\n".
290
- "});\n".
291
- "jQuery($url_selector).change(function(){ jQuery('#lastposts').empty(); jQuery($comment_selector).bind('focus',cl_dostuff);}); \n".
292
- "});\n";
293
-
294
- if(get_option('cl_click_track')=="on"){
295
- $script.="function processclick(){\n".
296
- "var url=jQuery(this).attr('href');\n".
297
- "var thelinkobj=jQuery(this);\n".
298
- "var cl_member_id=\"".get_option('cl_member_id')."\";\n".
299
- "var addit=url + \"&cl_member_id=\" + cl_member_id + \"&callback=?\";\n".
300
- "var clurl=\"http://www.commentluv.com/commentluvinc/ajaxcl_click821.php?url=\" + addit;\n".
301
- "jQuery.getJSON(clurl,function(data) {\n".
302
- "jQuery.each(data.msg,function(i,item) {\n".
303
- "jQuery(thelinkobj).text(data.msg[i].text);}) \n".
304
- "window.location=url;\n".
305
- "}); return false;}\n";
306
- }
307
- $script.="function cl_dostuff(){\n".
308
- "var check=jQuery($url_selector).val();\n".
309
- "if(!check) { return }\n".
310
- "var xyz=jQuery($url_selector).val(); \n".
311
- "var name=jQuery($author_selector).val(); \n".
312
- "var url=\"http://www.commentluv.com/commentluvinc/ajaxcl821.php?url=\"+xyz+\"";
313
- if($cl_member_id) {
314
- $script.="&memberid=$cl_member_id";
315
- }
316
- $script.="&callback=?\";\n".
317
- "jQuery.getJSON(url,function(data){ \n".
318
- "jQuery.each(data.links, function(i,item){ \n".
319
- "jQuery('#lastposts').append('<option value=\"'+data.links[i].url+'\">'+data.links[i].title+'</option>');\n".
320
- "});\n".
321
- "jQuery('#lastposts').append('<option value=0 ";
322
-
323
- // handle default off
324
- if($cl_default_on=="FALSE") {
325
- $script.="selected=selected";
326
- }
327
-
328
- $script.=">".__('Do Not Show','commentluv')."</option><option value=\"1\" ";
329
-
330
- // handle default on
331
- if($cl_default_on=="TRUE"){
332
- $script.="selected=selected";
333
- }
334
-
335
- $script.=">$cl_select_text</option>').fadeIn(1000);\n";
336
-
337
- // change output text to that set in the options page
338
- $search=array('[name]','[lastpost]');
339
- $replace=array("' + name + '","<a href=\"' + data.links[0].url + '\">' + data.links[0].title + '</a>");
340
- $cl_comment_text=str_replace($search,$replace,$cl_comment_text);
341
-
342
- $script.="jQuery('#mylastpost').html('<abbr><em>".$cl_comment_text."</em></abbr>').fadeIn(1000); \n".
343
- "jQuery('#cl_post').val('<a href=\"' + data.links[0].url + '\">' + data.links[0].title + '</a>');\n".
344
- "jQuery($comment_selector).unbind(); \n".
345
- "});\n".
346
- "}\n";
347
 
 
348
  if(is_single()) {
349
- echo '<!-- Styling and script added by commentluv 2.15 http://www.commentluv.com -->';
350
- echo '<style type="text/css">abbr em{'.get_option('cl_style').'} #lastposts { width: 300px; }</style>';
351
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
352
  echo "<script type=\"text/javascript\"><!--//--><![CDATA[//><!--";
353
- // add click tracking if enabled to head for admin
354
- if(current_user_can('edit_users')){
355
- $adminscript="\njQuery(document).ready(function() {\n";
356
- if(get_option('cl_click_track')=="on"){
357
- $adminscript.="jQuery('abbr em a').click(processclick);});\n".
358
- "function processclick(){\n".
359
- "var url=jQuery(this).attr('href');\n".
360
- "var thelinkobj=jQuery(this);\n".
361
- "var cl_member_id=\"".get_option('cl_member_id')."\";\n".
362
- "var addit=url + \"&cl_member_id=\" + cl_member_id + \"&callback=?\";\n".
363
- "var clurl=\"http://www.commentluv.com/commentluvinc/ajaxcl_click821.php?url=\" + addit;\n".
364
- "jQuery.getJSON(clurl,function(data) {\n".
365
- "jQuery.each(data.msg,function(i,item) {\n".
366
- "jQuery(thelinkobj).text(data.msg[i].text);}) \n".
367
- "window.location=url;\n".
368
- "}); return false;}\n";
369
- echo $adminscript;
370
- }
371
  } else {
372
- // normal user script (so admin doesn't get the badge below form)
373
- echo $script;
374
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
375
  echo "//--><!]]></script>";
376
 
377
  echo '<!-- end commentluv http://www.fiddyp.co.uk -->';
 
378
  }
379
 
380
-
381
-
382
- //wp_enqueue_script('jquery');
383
- $cl_script_added=1;
384
-
385
  }
386
  // function to add menu page under options
387
 
388
  function cl_options_page(){
 
 
 
 
 
 
 
 
 
 
389
  commentluv_setup();
390
  if(get_option('cl_reset')=="on"){
391
  update_option('cl_comment_text','[name]&#180;s last blog post..[lastpost]');
392
  update_option('cl_default_on','TRUE');
 
393
  update_option('cl_style','border:1px solid; display:block; padding:4px;');
394
  update_option('cl_author_id','author');
395
  update_option('cl_site_id','url');
396
  update_option('cl_comment_id','comment');
397
- update_option('cl_commentform_id','#commentform');
398
  update_option('cl_badge','ACL88x31-white.gif');
399
- update_option('cl_author_type','ID');
400
- update_option('cl_url_type','ID');
401
- update_option('cl_textarea_type','ID');
402
  update_option('cl_click_track','on');
403
  update_option('cl_showtext','CommentLuv Enabled');
404
  update_option('cl_reset','off');
@@ -440,6 +421,13 @@ function cl_options_page(){
440
  <option <?php if(get_option('cl_default_on')=="FALSE") { echo "selected=selected";}?> >FALSE</option>
441
  </select></td>
442
  </tr>
 
 
 
 
 
 
 
443
  </table>
444
  <h3><?php _e('Styling')?></h3>
445
  <p><?php _e('Wordpress doesn\'t allow a class to be applied to a paragraph in the comment area so we have to wrap the last blog post text in nested tags and apply styling to that instead.','commentluv')?></p>
@@ -454,10 +442,6 @@ function cl_options_page(){
454
  <p><?php _e('Check your comment form fields to see if they use ID= or NAME= and select the appropriate type below','commentluv')?><br/>
455
  <?php _e('Visit CommentLuv.com if you need instructions','commentluv')?></p>
456
  <table class="form-table">
457
- <td><?php _e('Comment Form ID','commentluv')?></td>
458
- <td>Precede with #</td>
459
- <td><input name="cl_commentform_id" value="<?php echo get_option('cl_commentform_id');?>"></td>
460
- </tr>
461
  <tr>
462
  <td><?php _e('Authors Name field ID','commentluv')?></td>
463
  <td><select name="cl_author_type">
@@ -508,7 +492,7 @@ function cl_options_page(){
508
  <td><input type="checkbox" name="cl_click_track" <?php if(get_option('cl_click_track')=="on"){echo "checked";};?> /></td>
509
  </tr>
510
  </table>
511
- <input type="hidden" name="page_options" value="cl_comment_text,cl_default_on,cl_style,cl_author_id,cl_site_id,cl_comment_id,cl_commentform_id,cl_badge,cl_member_id,cl_click_track,cl_form_type,cl_author_type,cl_url_type,cl_textarea_type,cl_reset,cl_showtext,cl_badge_pos,cl_prepend,cl_select_text" />
512
  <input type="hidden" name="action" value="update" />
513
  <input type="hidden" name="option_page" value="commentluv" />
514
  <p><input type="checkbox" name="cl_reset"/><?php _e('Reset to Default Settings','commentluv')?>
2
  Plugin Name: commentluv
3
  Plugin URI: http://www.commentluv.com/download/ajax-commentluv-installation/
4
  Description: Plugin to show a link to the last post from the commenters blog in their comment. Just activate and it's ready. Will parse a feed from most sites that have a feed location specified in its head html. See the <a href="options-general.php?page=commentluv">Settings Page</a> for styling and text output options.
5
+ Version: 2.5
6
  Author: Andy Bailey
7
  Author URI: http://www.fiddyp.co.uk/
8
 
10
  You can now edit the options from the dashboard
11
  *********************************************************************
12
  updates:
13
+ 2.5 2nd oct 08 - fix for the people that can rtfm and added checkbox for traditonal users to be happy. show badge but no action for admin (again for the !rtfm's)
14
+ 2.2 1st Oct 08 - the big fat update! fix all images for WP2.5 - 2.5.2 and added the luvheart info box option and made ready for luvcontests..
15
+ 2.1.7 28/9/8 change defaults from ID to name as that seems to be more prevalant in themes. Added constants compatibility to admin function
16
+ added sanitize function for troublesome special characters in text output
17
  2.1.6 27/9/8 make compatible for less that wp 2.5.1
18
  2.1.5 25/9/8 do the features ever stop?? Marco says we should had some option for html to be added before button and delete old selects if change url. done!
19
  also I am a dumbo for using wp_enqueue_script in the function called by wp_head, it should be before that. so sorry everyone! (retiredat47.com)
118
  register_activation_hook(__FILE__, 'commentluv_activation');
119
  wp_enqueue_script('jquery');
120
 
121
+ // clean input string
122
+ function cleanInput($input) {
123
+ return htmlentities(trim($input), ENT_QUOTES);
124
+ }
125
+
126
+ // sanatize function
127
+ function sanitize($input) {
128
+ if (is_array($input)) {
129
+ foreach($input as $var=>$val) {
130
+ $output[$var] = sanitize($val);
131
+ }
132
+ }
133
+ else {
134
+ if (get_magic_quotes_gpc()) {
135
+ $input = stripslashes($input);
136
+ }
137
+ $input = cleanInput($input);
138
+ $output = mysql_real_escape_string($input);
139
+ }
140
+ return $output;
141
+ }
142
 
143
  // make compatible with Mu
144
  function commentluv_alter_whitelist_options($whitelist) {
145
  if(is_array($whitelist)) {
146
+ $option_array = array('commentluv' => array('cl_comment_text','cl_default_on','cl_style','cl_author_id','cl_site_id','cl_comment_id','cl_commentform_id','cl_badge','cl_member_id','cl_click_track','cl_author_type','cl_url_type','cl_textarea_type','cl_reset','cl_showtext','cl_badge_pos','cl_prepend','cl_heart_tip'));
147
  $whitelist = array_merge($whitelist,$option_array);
148
  }
149
  return $whitelist;
169
  function commentluv_activation(){
170
  // set version for future releases if they need to change a value
171
  $version=get_option('cl_version');
172
+ if($version<250){
173
+ update_option('cl_version','250');
174
+ update_option('cl_commentform_id','');
175
  }
176
  }
177
 
228
  add_options_page('CommentLuv', 'CommentLuv', 8, 'commentluv', 'cl_options_page');
229
  add_option('cl_comment_text','[name]&#180;s last blog post..[lastpost]');
230
  add_option('cl_default_on','TRUE');
231
+ add_option('cl_heart_tip','TRUE');
232
  add_option('cl_style','border:1px solid; display:block; padding:4px;');
233
  add_option('cl_author_id','author');
234
  add_option('cl_site_id','url');
236
  add_option('cl_commentform_id','#commentform');
237
  add_option('cl_badge','ACL88x31-white.gif');
238
  add_option('cl_member_id','');
239
+ add_option('cl_author_type','name');
240
+ add_option('cl_url_type','name');
241
+ add_option('cl_textarea_type','name');
242
  add_option('cl_click_track','on');
243
  add_option('cl_showtext','CommentLuv Enabled');
244
  add_option('cl_badge_pos','');
245
  add_option('cl_prepend','');
246
  commentluv_activation();
247
+ add_option('cl_version','250');
248
  add_option('cl_select_text','choose a different post to show');
249
  }
250
 
265
  if ($cl_script_added) {
266
  return;
267
  }
 
268
 
269
  $cl_comment_id=get_option('cl_comment_id');
270
  $cl_author_id=get_option('cl_author_id');
275
  $author_selector= (get_option('cl_author_type')=="name")? "\"input[name='$cl_author_id']\"" : "'#$cl_author_id'";
276
  $url_selector= (get_option('cl_url_type')=="name")? "\"input[name='$cl_site_id']\"" : "'#$cl_site_id'";
277
 
278
+ $cl_comment_text=get_option('cl_comment_text');
279
  $cl_default_on=get_option('cl_default_on');
280
  $cl_badge=get_option('cl_badge');
281
  $cl_member_id=get_option('cl_member_id');
286
  } else {
287
  $cl_badge_val="<img src=\"".WP_PLUGIN_URL."/commentluv/$cl_badge\"/>";
288
  }
 
289
  // check if user has set append ID differently
290
  $append_id=get_option('cl_badge_pos');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
291
 
292
+ // start the javascript output
293
  if(is_single()) {
294
+ echo '<!-- Styling and script added by commentluv 2.5 http://www.commentluv.com -->';
295
+ echo '<style type="text/css">abbr em{'.get_option('cl_style').'} #lastposts { width: 300px; } </style>';
296
+ echo "\n<script type=\"text/javascript\" src=\"".WP_PLUGIN_URL."/commentluv/js/commentluv.js\"></script>";
297
+ if(get_option('cl_click_track')=="on"){
298
+ echo "\n<script type=\"text/javascript\" src=\"".WP_PLUGIN_URL."/commentluv/js/processclick.js\"></script>\n";
299
+ }
300
+ if(get_option('cl_heart_tip')==TRUE){
301
+ echo "<link rel=\"stylesheet\" href=\"".WP_PLUGIN_URL."/commentluv/include/tipstyle.css\" type=\"text/css\" />\n";
302
+ echo "<script type=\"text/javascript\"><!--//--><![CDATA[//><!--\n";
303
+ echo "jQuery(document).ready(function(){\n".
304
+ "jQuery(\"abbr em a\").each(function(i){\n".
305
+ "jQuery(this).after(' <a class=\'jTip\' id=\'' + i + '\' name=\'My CommentLuv Profile\' href=\'".
306
+ WP_PLUGIN_URL."/commentluv/include/tip.php?width=375&url=' + jQuery(this).attr('href') +'\'><img src=\'".
307
+ WP_PLUGIN_URL."/commentluv/images/littleheart.png\' alt=\'#\' /></a>');\n".
308
+ "});\n".
309
+ "JT_init();});\n";
310
+ echo "//--><!]]></script>\n";
311
+ echo "<script type='text/javascript' src='".WP_PLUGIN_URL."/commentluv/js/jtip.js'></script>\n";
312
+ }
313
  echo "<script type=\"text/javascript\"><!--//--><![CDATA[//><!--";
314
+ echo "\n var cl_settings=new Array();\n";
315
+ echo "cl_settings[0]=\"$append_id\";\n";
316
+ echo "cl_settings[1]=$author_selector;\n";
317
+ echo "cl_settings[2]=$url_selector;\n";
318
+ echo "cl_settings[3]=$comment_selector;\n";
319
+
320
+ // select text
321
+ $cl_select_text=get_option('cl_select_text');
322
+ echo "cl_settings[5]=\"$cl_select_text\";\n";
323
+ echo "cl_settings[6]=\"$cl_badge\";\n";
324
+ echo "cl_settings[7]=\"".addslashes($cl_badge_val)."\";\n";
325
+ echo "cl_settings[8]=\"".addslashes($cl_badge_val)."\";\n";
326
+ if($cl_default_on=="TRUE"){
327
+ $cl_default_on="checked";
 
 
 
 
328
  } else {
329
+ $cl_default_on="";
 
330
  }
331
+ echo "cl_settings[9]=\"$cl_default_on\";\n";
332
+ //click track
333
+ if(get_option('cl_click_track')=="on") {
334
+ $cl_click_track=1;
335
+ } else {
336
+ $cl_click_track=0;
337
+ }
338
+ echo "cl_settings[10]=\"$cl_click_track\";\n";
339
+ echo "cl_settings[11]=\"$cl_heart_tip\";\n";
340
+ // optional prepend
341
+ $cl_prepend=addslashes(get_option('cl_prepend'));
342
+ echo "cl_settings[12]=\"$cl_prepend\";\n";
343
+ // switch off for admin
344
+ if(current_user_can('edit_users')){
345
+ echo "cl_settings[13]=\"admin\";";
346
+ }
347
+ echo "commentluv(cl_settings);\n";
348
+
349
  echo "//--><!]]></script>";
350
 
351
  echo '<!-- end commentluv http://www.fiddyp.co.uk -->';
352
+ $cl_script_added=1;
353
  }
354
 
 
 
 
 
 
355
  }
356
  // function to add menu page under options
357
 
358
  function cl_options_page(){
359
+ // Pre-2.6 compatibility
360
+ if ( ! defined( 'WP_CONTENT_URL' ) )
361
+ define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' );
362
+ if ( ! defined( 'WP_CONTENT_DIR' ) )
363
+ define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
364
+ if ( ! defined( 'WP_PLUGIN_URL' ) )
365
+ define( 'WP_PLUGIN_URL', WP_CONTENT_URL. '/plugins' );
366
+ if ( ! defined( 'WP_PLUGIN_DIR' ) )
367
+ define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
368
+
369
  commentluv_setup();
370
  if(get_option('cl_reset')=="on"){
371
  update_option('cl_comment_text','[name]&#180;s last blog post..[lastpost]');
372
  update_option('cl_default_on','TRUE');
373
+ update_option('cl_heart_tip','TRUE');
374
  update_option('cl_style','border:1px solid; display:block; padding:4px;');
375
  update_option('cl_author_id','author');
376
  update_option('cl_site_id','url');
377
  update_option('cl_comment_id','comment');
378
+ update_option('cl_commentform_id','');
379
  update_option('cl_badge','ACL88x31-white.gif');
380
+ update_option('cl_author_type','name');
381
+ update_option('cl_url_type','name');
382
+ update_option('cl_textarea_type','name');
383
  update_option('cl_click_track','on');
384
  update_option('cl_showtext','CommentLuv Enabled');
385
  update_option('cl_reset','off');
421
  <option <?php if(get_option('cl_default_on')=="FALSE") { echo "selected=selected";}?> >FALSE</option>
422
  </select></td>
423
  </tr>
424
+ <tr>
425
+ <td width="29%"><?php _e('Choose to have CommentLuv Info box?','commentluv')?></td>
426
+ <td width="71%"><select name="cl_heart_tip">
427
+ <option <?php if(get_option('cl_heart_tip')=="TRUE") {echo "selected=selected";}?> >TRUE</option>
428
+ <option <?php if(get_option('cl_heart_tip')=="FALSE") { echo "selected=selected";}?> >FALSE</option>
429
+ </select></td>
430
+ </tr>
431
  </table>
432
  <h3><?php _e('Styling')?></h3>
433
  <p><?php _e('Wordpress doesn\'t allow a class to be applied to a paragraph in the comment area so we have to wrap the last blog post text in nested tags and apply styling to that instead.','commentluv')?></p>
442
  <p><?php _e('Check your comment form fields to see if they use ID= or NAME= and select the appropriate type below','commentluv')?><br/>
443
  <?php _e('Visit CommentLuv.com if you need instructions','commentluv')?></p>
444
  <table class="form-table">
 
 
 
 
445
  <tr>
446
  <td><?php _e('Authors Name field ID','commentluv')?></td>
447
  <td><select name="cl_author_type">
492
  <td><input type="checkbox" name="cl_click_track" <?php if(get_option('cl_click_track')=="on"){echo "checked";};?> /></td>
493
  </tr>
494
  </table>
495
+ <input type="hidden" name="page_options" value="cl_comment_text,cl_default_on,cl_style,cl_author_id,cl_site_id,cl_comment_id,cl_commentform_id,cl_badge,cl_member_id,cl_click_track,cl_form_type,cl_author_type,cl_url_type,cl_textarea_type,cl_reset,cl_showtext,cl_badge_pos,cl_prepend,cl_select_text,cl_heart_tip" />
496
  <input type="hidden" name="action" value="update" />
497
  <input type="hidden" name="option_page" value="commentluv" />
498
  <p><input type="checkbox" name="cl_reset"/><?php _e('Reset to Default Settings','commentluv')?>
commentluv.po CHANGED
@@ -2,7 +2,7 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: CommentLuv 2.0\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2008-09-25 20:13-0000\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: Andy Bailey <andy@teamplaylotto.com>\n"
8
  "Language-Team: <andy@teamplaylotto.com>\n"
@@ -15,147 +15,147 @@ msgstr ""
15
  "X-Poedit-Basepath: .\n"
16
  "X-Poedit-SearchPath-0: C:\\xampp\\htdocs\\wordpress\\wp-content\\plugins\\commentluv\n"
17
 
18
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:319
19
- msgid "Do Not Show"
20
- msgstr ""
21
-
22
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:410
23
  msgid "CommentLuv Wordpress Plugin"
24
  msgstr ""
25
 
26
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:411
27
  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"
28
  msgstr ""
29
 
30
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:412
31
  msgid "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"
32
  msgstr ""
33
 
34
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:412
35
  msgid "or"
36
  msgstr ""
37
 
38
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:412
39
  msgid "support forum"
40
  msgstr ""
41
 
42
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:412
43
  msgid "and let me know"
44
  msgstr ""
45
 
46
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:413
47
  msgid "Options"
48
  msgstr ""
49
 
50
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:414
51
  msgid "Enter the text you want displayed in the comment."
52
  msgstr ""
53
 
54
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:423
55
  msgid "Text displayed in the select box"
56
  msgstr ""
57
 
58
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:428
59
  msgid "Choose to have CommentLuv on by default?"
60
  msgstr ""
61
 
62
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:435
 
 
 
 
63
  msgid "Styling"
64
  msgstr ""
65
 
66
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:436
67
  msgid "Wordpress doesn't allow a class to be applied to a paragraph in the comment area so we have to wrap the last blog post text in nested tags and apply styling to that instead."
68
  msgstr ""
69
 
70
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:437
71
  msgid "Enter css styling to apply to comment"
72
  msgstr ""
73
 
74
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:437
75
  msgid "inserted as"
76
  msgstr ""
77
 
78
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:443
79
  msgid "Comment Form Identification"
80
  msgstr ""
81
 
82
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:444
83
  msgid "Enter the ID or NAME value for the input fields on your comment form."
84
  msgstr ""
85
 
86
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:445
87
  msgid "Check your comment form fields to see if they use ID= or NAME= and select the appropriate type below"
88
  msgstr ""
89
 
90
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:446
91
  msgid "Visit CommentLuv.com if you need instructions"
92
  msgstr ""
93
 
94
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:448
95
  msgid "Comment Form ID"
96
  msgstr ""
97
 
98
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:453
99
  msgid "Authors Name field ID"
100
  msgstr ""
101
 
102
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:461
103
  msgid "Authors URL field ID"
104
  msgstr ""
105
 
106
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:469
107
  msgid "Comment Text Area ID"
108
  msgstr ""
109
 
110
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:477
111
  msgid "Display Badge"
112
  msgstr ""
113
 
114
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:481
115
  msgid "Choose badge to display"
116
  msgstr ""
117
 
118
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:487
119
  msgid "Show nothing"
120
  msgstr ""
121
 
122
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:490
123
  msgid "Show text"
124
  msgstr ""
125
 
126
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:490
127
  msgid "Append badge to (DIV or object ID) optional"
128
  msgstr ""
129
 
130
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:490
131
  msgid "Prepend html before badge or text (optional)"
132
  msgstr ""
133
 
134
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:492
135
  msgid "CommentLuv Member ID"
136
  msgstr ""
137
 
138
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:493
139
  msgid "If you register your site for free at"
140
  msgstr ""
141
 
142
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:493
143
  msgid "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. Do NOT enter a number if you do not have one"
144
  msgstr ""
145
 
146
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:495
147
  msgid "Your CommentLuv.com member ID"
148
  msgstr ""
149
 
150
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:498
151
  msgid "Enable click tracking?"
152
  msgstr ""
153
 
154
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:505
155
  msgid "Reset to Default Settings"
156
  msgstr ""
157
 
158
- #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:506
159
  msgid "Update Options"
160
  msgstr ""
161
 
2
  msgstr ""
3
  "Project-Id-Version: CommentLuv 2.0\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2008-10-02 14:21-0000\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: Andy Bailey <andy@teamplaylotto.com>\n"
8
  "Language-Team: <andy@teamplaylotto.com>\n"
15
  "X-Poedit-Basepath: .\n"
16
  "X-Poedit-SearchPath-0: C:\\xampp\\htdocs\\wordpress\\wp-content\\plugins\\commentluv\n"
17
 
18
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:399
 
 
 
 
19
  msgid "CommentLuv Wordpress Plugin"
20
  msgstr ""
21
 
22
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:400
23
  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"
24
  msgstr ""
25
 
26
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:401
27
  msgid "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"
28
  msgstr ""
29
 
30
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:401
31
  msgid "or"
32
  msgstr ""
33
 
34
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:401
35
  msgid "support forum"
36
  msgstr ""
37
 
38
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:401
39
  msgid "and let me know"
40
  msgstr ""
41
 
42
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:402
43
  msgid "Options"
44
  msgstr ""
45
 
46
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:403
47
  msgid "Enter the text you want displayed in the comment."
48
  msgstr ""
49
 
50
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:412
51
  msgid "Text displayed in the select box"
52
  msgstr ""
53
 
54
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:417
55
  msgid "Choose to have CommentLuv on by default?"
56
  msgstr ""
57
 
58
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:424
59
+ msgid "Choose to have CommentLuv Info box?"
60
+ msgstr ""
61
+
62
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:431
63
  msgid "Styling"
64
  msgstr ""
65
 
66
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:432
67
  msgid "Wordpress doesn't allow a class to be applied to a paragraph in the comment area so we have to wrap the last blog post text in nested tags and apply styling to that instead."
68
  msgstr ""
69
 
70
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:433
71
  msgid "Enter css styling to apply to comment"
72
  msgstr ""
73
 
74
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:433
75
  msgid "inserted as"
76
  msgstr ""
77
 
78
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:439
79
  msgid "Comment Form Identification"
80
  msgstr ""
81
 
82
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:440
83
  msgid "Enter the ID or NAME value for the input fields on your comment form."
84
  msgstr ""
85
 
86
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:441
87
  msgid "Check your comment form fields to see if they use ID= or NAME= and select the appropriate type below"
88
  msgstr ""
89
 
90
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:442
91
  msgid "Visit CommentLuv.com if you need instructions"
92
  msgstr ""
93
 
94
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:444
95
  msgid "Comment Form ID"
96
  msgstr ""
97
 
98
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:449
99
  msgid "Authors Name field ID"
100
  msgstr ""
101
 
102
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:457
103
  msgid "Authors URL field ID"
104
  msgstr ""
105
 
106
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:465
107
  msgid "Comment Text Area ID"
108
  msgstr ""
109
 
110
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:473
111
  msgid "Display Badge"
112
  msgstr ""
113
 
114
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:477
115
  msgid "Choose badge to display"
116
  msgstr ""
117
 
118
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:483
119
  msgid "Show nothing"
120
  msgstr ""
121
 
122
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:486
123
  msgid "Show text"
124
  msgstr ""
125
 
126
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:486
127
  msgid "Append badge to (DIV or object ID) optional"
128
  msgstr ""
129
 
130
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:486
131
  msgid "Prepend html before badge or text (optional)"
132
  msgstr ""
133
 
134
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:488
135
  msgid "CommentLuv Member ID"
136
  msgstr ""
137
 
138
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:489
139
  msgid "If you register your site for free at"
140
  msgstr ""
141
 
142
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:489
143
  msgid "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. Do NOT enter a number if you do not have one"
144
  msgstr ""
145
 
146
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:491
147
  msgid "Your CommentLuv.com member ID"
148
  msgstr ""
149
 
150
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:494
151
  msgid "Enable click tracking?"
152
  msgstr ""
153
 
154
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:501
155
  msgid "Reset to Default Settings"
156
  msgstr ""
157
 
158
+ #: C:\xampp\htdocs\wordpress\wp-content\plugins\commentluv/commentluv.php:502
159
  msgid "Update Options"
160
  msgstr ""
161
 
images/arrow_left.gif ADDED
Binary file
images/arrow_right.gif ADDED
Binary file
images/littleheart.png ADDED
Binary file
images/loader.gif ADDED
Binary file
images/stripefadeback.png ADDED
Binary file
include/tip.php ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // include file for comemntluv to display tooltip for heart icon
3
+ class ReadFile{
4
+
5
+ var $targetFile;
6
+ var $error;
7
+ var $errorText;
8
+ var $data;
9
+ var $timeout;
10
+
11
+ function ReadFile($targetFile){
12
+ //INITIALIZE
13
+ $this->targetFile=$targetFile;
14
+ $this->error=false;
15
+ $this->timeout=10; //TIMEOUT IN SECONDS
16
+
17
+ if(!empty($this->targetFile)){
18
+ $this->downloadContents();
19
+ }
20
+ else{
21
+ $this->errorText="Filename not specififed in class constuctor";
22
+ $this->error=true;
23
+ }
24
+ }
25
+
26
+ function getFileContents(){
27
+ if(!$this->hasError()){
28
+ return $this->data;
29
+ }
30
+ return false;
31
+ }
32
+
33
+ function hasError(){
34
+ if($this->error){
35
+ return true;
36
+ }
37
+ return false;
38
+ }
39
+
40
+ function getError(){
41
+ return $this->errorText;
42
+ }
43
+
44
+ function downloadContents(){
45
+ $data=NULL;
46
+ //CHECK TO SEE IF WE ARE USING PHP 4.3+
47
+ if(function_exists('file_get_contents')){
48
+ $this->data=$this->openWithFileGetContents();
49
+ }
50
+ else{
51
+ $this->data=$this->openWithFOpen();
52
+ }
53
+ }
54
+
55
+ function openWithFileGetContents(){
56
+ $data=NULL;
57
+ //SET TIMEOUT (PHP 4.3+ ONLY)
58
+ ini_set('default_socket_timeout', $this->timeout);
59
+ //RETRIEVE FILE
60
+ if(!$data=@file_get_contents($this->targetFile)){
61
+ $this->errorText='file_get_contents of ' . $this->targetFile . ' failed.';
62
+ $this->error=true;
63
+ }
64
+ return $data;
65
+ }
66
+
67
+ function openWithFOpen(){
68
+ $data=NULL;
69
+ //RETRIEVE FILE
70
+ if($dataFile = @fopen($this->targetFile, "r" )){
71
+ while (!feof($dataFile)) {
72
+ $data.= fgets($dataFile, 4096);
73
+ }
74
+ fclose($dataFile);
75
+ }
76
+ else{
77
+ $this->errorText='fopen of ' . $this->targetFile . ' failed.';
78
+ $this->error=true;
79
+ }
80
+ return $data;
81
+ }
82
+ }
83
+
84
+ $url="http://www.commentluv.com/commentluvinc/clplus_tooltip.php?url=".$_GET['url'];
85
+ $myReadAccess=new ReadFile($url);
86
+
87
+ if(!$data=$myReadAccess->getFileContents()){
88
+
89
+ //ERROR, DISPLAY ERROR MESSAGE
90
+ echo "Error: " . $myReadAccess->getError();
91
+ }
92
+ else{
93
+
94
+ //SUCCESS, DISPLAY FILE CONTENTS
95
+ echo $data;
96
+ }
97
+
98
+ ?>
include/tipstyle.css ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* ---- jtip <<<---------------------------------------------------------------*/
2
+
3
+ #JT_arrow_left{
4
+ background-image: url(../images/arrow_left.gif);
5
+ background-repeat: no-repeat;
6
+ background-position: left top;
7
+ position: absolute;
8
+ z-index:101;
9
+ left:-12px;
10
+ height:23px;
11
+ width:10px;
12
+ top:-3px;
13
+ }
14
+
15
+ #JT_arrow_right{
16
+ background-image: url(../images/arrow_right.gif);
17
+ background-repeat: no-repeat;
18
+ background-position: left top;
19
+ position: absolute;
20
+ z-index:101;
21
+ height:23px;
22
+ width:11px;
23
+ top:-2px;
24
+ }
25
+
26
+ #JT {
27
+ position: absolute;
28
+ z-index:100;
29
+ border: 2px solid #CCCCCC;
30
+ }
31
+
32
+ #JT_copy{
33
+ padding:10px 10px 10px 10px;
34
+ color:#333333;
35
+ background-image:url(../images/stripefadeback.png);
36
+ }
37
+
38
+ .JT_loader{
39
+ background-image: url(../images/loader.gif);
40
+ background-repeat: no-repeat;
41
+ background-position: center center;
42
+ width:100%;
43
+ height:12px;
44
+ }
45
+
46
+ #JT_close_left{
47
+ background-color: #CCCCCC;
48
+ text-align: left;
49
+ padding-left: 8px;
50
+ padding-bottom: 5px;
51
+ padding-top: 2px;
52
+ font-weight:bold;
53
+ }
54
+
55
+ #JT_close_right{
56
+ background-color: #CCCCCC;
57
+ text-align: left;
58
+ padding-left: 8px;
59
+ padding-bottom: 5px;
60
+ padding-top: 2px;
61
+ font-weight:bold;
62
+ }
63
+
64
+ #JT_copy p{
65
+ margin:3px 0;
66
+ font-family:Arial, Helvetica, sans-serif;
67
+
68
+ }
69
+
70
+ #JT_copy img{
71
+ padding: 1px;
72
+ border: 1px solid #CCCCCC;
73
+ }
74
+
75
+ .jTip{
76
+ cursor:help;
77
+ }
js/commentluv.js ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function commentluv(cl_settings){
2
+ jQuery(document).ready(function() {
3
+ parentformname = jQuery(cl_settings[3]).parents("form").attr("id");
4
+ if(!cl_settings[0]){
5
+ cl_settings[0]=parentformname;
6
+ }
7
+ var cl_badge=cl_settings[7];
8
+ jQuery('#'+cl_settings[0]).after(cl_settings[12]+'<div id="mylastpostbox"><div style="float:left"><input type="checkbox" id="luv" '+cl_settings[9]+'"/></div><div style="float:left"><span id="mylastpost" style="clear: both"><a href="http://www.commentluv.com">'+cl_badge+'</a></span>' + '<br/><select name="lastposts" id="lastposts"></select></div></div>');
9
+ jQuery('#'+parentformname).append('<input type="hidden" id="cl_post" name="cl_post"></input>');
10
+ jQuery('#lastposts').hide();
11
+ if(cl_settings[10]){
12
+ jQuery('abbr em a').click(processclick);
13
+ }
14
+ jQuery(cl_settings[3]).focus(function(){
15
+ cl_dostuff(cl_settings);
16
+ });
17
+ jQuery('#lastposts').change(function(){
18
+ jQuery('option').remove(":contains('"+cl_settings[5]+"'");
19
+ var url = jQuery(this).val();
20
+ var title = jQuery('#lastposts option:selected').text();
21
+ jQuery('#mylastpost a').replaceWith('<a href="' + url + '">' + title + '</a>');
22
+ jQuery('#cl_post').val('<a href="' + url + '">' + title + '</a>');
23
+ });
24
+ jQuery(cl_settings[2]).change(function(){
25
+ if(jQuery('#luv').is(":checked")){
26
+ jQuery('#lastposts').empty();
27
+ jQuery(cl_settings[3]).bind('focus',cl_dostuff(cl_settings));
28
+ }
29
+ });
30
+ jQuery('#luv').click(function(){
31
+ if(jQuery(this).is(":checked")){
32
+ // was unchecked, now is checked
33
+ jQuery('#cl_post').val(jQuery('#mylastpost abbr em').html());
34
+ jQuery('#lastposts').attr("disabled", false);
35
+ jQuery('#mylastpost abbr em').fadeTo("slow", 1);
36
+
37
+ } else {
38
+ // was checked, user unchecked it so empty hidden field in form
39
+ jQuery('#cl_post').val("");
40
+ jQuery('#lastposts').attr("disabled", true);
41
+ jQuery('#mylastpost abbr em').fadeTo("slow", 0.33);
42
+ }
43
+ });
44
+
45
+ function cl_dostuff(cl_settings){
46
+ var check=jQuery(cl_settings[2]).val();
47
+ // return if no url or checkbox is unticked or is admin
48
+ if(!check || !jQuery('#luv').is(":checked") || cl_settings[13]) { return }
49
+ var xyz=jQuery(cl_settings[2]).val();
50
+ var name=jQuery(cl_settings[1]).val();
51
+ var url="http://www.commentluv.com/commentluvinc/ajaxcl821.php?url="+xyz+"&callback=?";
52
+ jQuery.getJSON(url,function(data){
53
+ jQuery.each(data.links, function(i,item){
54
+ jQuery('#lastposts').append('<option value="'+data.links[i].url+'">'+data.links[i].title+'</option>');
55
+ });
56
+ jQuery('#lastposts').append('<option value="0" selected=selected>'+cl_settings[5]+'</option>');
57
+ jQuery('#lastposts').fadeIn(1000);
58
+ jQuery('#mylastpost').html('<abbr><em><a href="' + data.links[0].url + '">' + data.links[0].title + '</a></em></abbr>').fadeIn(1000);
59
+ if(jQuery('#luv').is(":checked")){
60
+ jQuery('#cl_post').val('<a href="' + data.links[0].url + '">' + data.links[0].title + '</a>');
61
+ }
62
+ jQuery(cl_settings[3]).unbind();
63
+ });
64
+ }
65
+ });
66
+ }
js/jtip.js ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // JavaScript Document
2
+ /*
3
+ * JTip
4
+ * By Cody Lindley (http://www.codylindley.com)
5
+ * Under an Attribution, Share Alike License
6
+ * JTip is built on top of the very light weight jquery library.
7
+ */
8
+
9
+ //on page load (as soon as its ready) call JT_init
10
+
11
+
12
+ function JT_init(){
13
+
14
+ jQuery("a.jTip")
15
+ .hover(function(){JT_show(this.href,this.id,this.name)},function(){jQuery('#JT').remove()})
16
+ .click(function(){return false});
17
+ }
18
+
19
+ function JT_show(url,linkId,title){
20
+ if(title == false)title="&nbsp;";
21
+ var de = document.documentElement;
22
+ var w = self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
23
+ var hasArea = w - getAbsoluteLeft(linkId);
24
+ var clickElementy = getAbsoluteTop(linkId) - 3; //set y position
25
+
26
+ var queryString = url.replace(/^[^\?]+\??/,'');
27
+ var params = parseQuery( queryString );
28
+ if(params['width'] === undefined){params['width'] = 250};
29
+ if(params['link'] !== undefined){
30
+ jQuery('#' + linkId).bind('click',function(){window.location = params['link']});
31
+ jQuery('#' + linkId).css('cursor','pointer');
32
+ }
33
+
34
+ if(hasArea>((params['width']*1)+75)){
35
+ jQuery("body").append("<div id='JT' style='width:"+params['width']*1+"px'><div id='JT_arrow_left'></div><div id='JT_close_left'>"+title+"</div><div id='JT_copy'><div class='JT_loader'><div></div></div>");//right side
36
+ var arrowOffset = getElementWidth(linkId) + 11;
37
+ var clickElementx = getAbsoluteLeft(linkId) + arrowOffset; //set x position
38
+ }else{
39
+ jQuery("body").append("<div id='JT' style='width:"+params['width']*1+"px'><div id='JT_arrow_right' style='left:"+((params['width']*1)+1)+"px'></div><div id='JT_close_right'>"+title+"</div><div id='JT_copy'><div class='JT_loader'><div></div></div>");//left side
40
+ var clickElementx = getAbsoluteLeft(linkId) - ((params['width']*1) + 15); //set x position
41
+ }
42
+
43
+ jQuery('#JT').css({left: clickElementx+"px", top: clickElementy+"px"});
44
+ jQuery('#JT').show();
45
+ jQuery('#JT_copy').load(url);
46
+
47
+ }
48
+
49
+
50
+
51
+
52
+ function getElementWidth(objectId) {
53
+ x = document.getElementById(objectId);
54
+ return x.offsetWidth;
55
+ }
56
+
57
+ function getAbsoluteLeft(objectId) {
58
+ // Get an object left position from the upper left viewport corner
59
+ o = document.getElementById(objectId)
60
+ oLeft = o.offsetLeft // Get left position from the parent object
61
+ while(o.offsetParent!=null) { // Parse the parent hierarchy up to the document element
62
+ oParent = o.offsetParent // Get parent object reference
63
+ oLeft += oParent.offsetLeft // Add parent left position
64
+ o = oParent
65
+ }
66
+ return oLeft
67
+ }
68
+
69
+ function getAbsoluteTop(objectId) {
70
+ // Get an object top position from the upper left viewport corner
71
+ o = document.getElementById(objectId)
72
+ oTop = o.offsetTop // Get top position from the parent object
73
+ while(o.offsetParent!=null) { // Parse the parent hierarchy up to the document element
74
+ oParent = o.offsetParent // Get parent object reference
75
+ oTop += oParent.offsetTop // Add parent top position
76
+ o = oParent
77
+ }
78
+ return oTop
79
+ }
80
+
81
+ function parseQuery ( query ) {
82
+ var Params = new Object ();
83
+ if ( ! query ) return Params; // return empty object
84
+ var Pairs = query.split(/[;&]/);
85
+ for ( var i = 0; i < Pairs.length; i++ ) {
86
+ var KeyVal = Pairs[i].split('=');
87
+ if ( ! KeyVal || KeyVal.length != 2 ) continue;
88
+ var key = unescape( KeyVal[0] );
89
+ var val = unescape( KeyVal[1] );
90
+ val = val.replace(/\+/g, ' ');
91
+ Params[key] = val;
92
+ }
93
+ return Params;
94
+ }
95
+
96
+ function blockEvents(evt) {
97
+ if(evt.target){
98
+ evt.preventDefault();
99
+ }else{
100
+ evt.returnValue = false;
101
+ }
102
+ }
js/processclick.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ function processclick(cl_member_id){
2
+ var url=jQuery(this).attr('href');
3
+ var thelinkobj=jQuery(this);
4
+ var cl_member_id="";
5
+ var addit=url + "&cl_member_id=" + cl_member_id + "&callback=?";
6
+ var clurl="http://www.commentluv.com/commentluvinc/ajaxcl_click821.php?url=" + addit;
7
+ jQuery.getJSON(clurl,function(data) {
8
+ jQuery.each(data.msg,function(i,item) {
9
+ jQuery(thelinkobj).text(data.msg[i].text);})
10
+ window.location=url;
11
+ }); return false;}
js/tooltip.js ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ // JavaScript Document
2
+ // tool tips on last blog posts
3
+ jQuery(document).ready(function(){
4
+ jQuery("abbr em a").each(function(i){
5
+ jQuery(this).after(" <a class='jTip' id='"+i+"' name='My other posts' href='http://localhost/wordpress/wp-content/plugins/commentluv/include/tip.php?width=375&url=" +jQuery(this).attr('href')+"'>#</a>");
6
+ });
7
+ });
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: Andy Bailey
3
  Tags: comments, linkluv
4
  Requires at least: 2.5
5
  Tested up to: 2.6.2
6
- Stable tag: 2.1.6
7
 
8
  Appends a titled link using AJAX to the authors last blog post on their comment giving back some luv to the people that join your discussion. Compatible with logged on users and Wordpress MU. Visit CommentLuv.com for detailed instructions on features.
9
 
@@ -11,6 +11,8 @@ Appends a titled link using AJAX to the authors last blog post on their comment
11
 
12
  Pass a bit of luv onto your commenters by providing a titled link to their last blog post. This plugin attempts to parse the feed of the comment author by visiting their site and looking for their feed while they type their comment and appends it once they submit.
13
 
 
 
14
  It will start to work with any new comments posted after installation (it will not add last post links to comments made before CommentLuv has been activated). You can set the plugin to track the clicks made on the links received and see the stats at commentluv.com (free registration)
15
 
16
  It will not add your own last post if you are logged in as admin. You can test it by adding a comment to one of your posts (after loggin out) and using a different URL for the author site field (use http://www.fiddyp.co.uk if you want!)
@@ -30,6 +32,9 @@ You may want to test it after activation by logging out and adding a comment to
30
 
31
  == Frequently Asked Questions ==
32
 
 
 
 
33
  = All my comments are now being held in moderation, why? =
34
 
35
  You probably have your wordpress set to hold comments in moderation if they contain a link.
3
  Tags: comments, linkluv
4
  Requires at least: 2.5
5
  Tested up to: 2.6.2
6
+ Stable tag: 2.5
7
 
8
  Appends a titled link using AJAX to the authors last blog post on their comment giving back some luv to the people that join your discussion. Compatible with logged on users and Wordpress MU. Visit CommentLuv.com for detailed instructions on features.
9
 
11
 
12
  Pass a bit of luv onto your commenters by providing a titled link to their last blog post. This plugin attempts to parse the feed of the comment author by visiting their site and looking for their feed while they type their comment and appends it once they submit.
13
 
14
+ Entice them even more with the new info box ajax popup showing their descript, gravatar and other sites they visit.
15
+
16
  It will start to work with any new comments posted after installation (it will not add last post links to comments made before CommentLuv has been activated). You can set the plugin to track the clicks made on the links received and see the stats at commentluv.com (free registration)
17
 
18
  It will not add your own last post if you are logged in as admin. You can test it by adding a comment to one of your posts (after loggin out) and using a different URL for the author site field (use http://www.fiddyp.co.uk if you want!)
32
 
33
  == Frequently Asked Questions ==
34
 
35
+ = I don't see the badge in the comment form =
36
+ The badge will not show if your are logged in as admin. If you are not logged in but still cannot see the badge, check the settings for your comment form ID. You can see what it is set to in your themes `comments.php` file
37
+
38
  = All my comments are now being held in moderation, why? =
39
 
40
  You probably have your wordpress set to hold comments in moderation if they contain a link.