CommentLuv - Version 2.7.6

Version Description

Download this release

Release Info

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

Code changes from version 2.7.4 to 2.7.6

commentluv-manager.php CHANGED
@@ -8,8 +8,7 @@
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,7 +24,7 @@
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,7 +65,7 @@
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>
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
  </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
  <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>
commentluv.php CHANGED
@@ -2,7 +2,7 @@
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.4
6
  Author: Andy Bailey
7
  Author URI: http://fiddyp.comluv.com/
8
 
@@ -13,268 +13,237 @@ Author URI: http://fiddyp.comluv.com/
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
 
17
  */
18
  // Avoid name collision
19
- if ( !class_exists('commentluv') ) {
20
  // let class begin
21
- class commentluv
22
- {
23
  //localization domain
24
  var $plugin_domain = 'commentluv';
25
  var $plugin_url;
26
  var $db_option = 'commentluv_options';
27
- var $cl_version = 274;
28
  var $api_url;
29
-
30
  //initialize the plugin
31
- function commentluv()
32
- {
33
  global $wp_version, $pagenow;
34
  // pages where commentluv needs translation
35
- $local_pages = array('plugins.php','commentluv.php');
36
  // check if translation needed on current page
37
- if (in_array($pagenow, $local_pages) || in_array($_GET['page'],$local_pages)){
38
- $this->handle_load_domain();
39
  }
40
- $exit_msg = __('CommentLuv requires Wordpress 2.6.5 or newer.',$this->plugin_domain).
41
- '<a href="http://codex.wordpress.org/Upgrading_Wordpress">'.
42
- __('Please Update!', $this->plugin_domain).
43
- '</a>';
44
-
45
  // can you dig it?
46
- if (version_compare($wp_version,"2.6.5","<") )
47
- {
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(
110
- 'name'=>$author_name,
111
- 'url'=>$url_name,
112
- 'comment'=>$comment_name,
113
- 'email'=>$email_name,
114
- 'prepend'=>$prepend,
115
- 'badge'=>$badge,
116
- 'show_text'=>$show_text,
117
- 'badge_text'=>$badge_text,
118
- 'heart_tip'=>$heart_tip,
119
- 'default_on'=>$default_on,
120
- 'select_text'=>$select_text,
121
- 'cl_version'=>$this->cl_version,
122
- 'images'=>$this->plugin_url . 'images/',
123
- 'api_url'=>$this->api_url
124
- ));
125
  }
126
  }
127
  // hook the head function for adding stylesheet
128
- function commentluv_style (){
129
- echo '<link rel="stylesheet" href="'.$this->plugin_url.'style/cl_style.css" type="text/css" />';
130
  }
131
-
132
  // get plugin options
133
- function get_options(){
134
  // default values
135
- $options = array(
136
- 'comment_text' => '[name]&#180;s last [type] ..[lastpost]',
137
- 'select_text' => 'choose a different post to show',
138
- 'default_on' => 'on',
139
- 'heart_tip' => 'on',
140
- 'use_template' => '',
141
- 'badge' => 'CL91x17-white2.gif',
142
- 'show_text' => 'CommentLuv Enabled',
143
- 'author_name' => 'author',
144
- 'url_name' => 'url',
145
- 'comment_name' => 'comment',
146
- 'email_name' => 'email',
147
- 'prepend' => ''
148
- );
149
  // get saved options unless reset button was pressed
150
  $saved = '';
151
- if(!isset($_POST['reset'])){
152
- $saved = get_option($this->db_option);
153
  }
154
-
155
  // assign values
156
- if (!empty($saved))
157
- {
158
- foreach ($saved as $key =>$option){
159
- $options[$key] = $option;
160
  }
161
  }
162
  // update the options if necessary
163
- if ($saved != $options){
164
- update_option($this->db_option,$options);
165
  }
166
  // return the options
167
  return $options;
168
  }
169
-
170
  // handle saving and displaying options
171
- function handle_options()
172
- {
173
- $options = $this->get_options();
174
- if ( isset($_POST['submitted']) )
175
- {
176
-
177
  // initialize the error class
178
- $errors = new WP_Error();
179
-
180
  // check security
181
- check_admin_referer('commentluv-nonce');
182
-
183
- $options = array();
184
- $options['comment_text']=htmlspecialchars($_POST['cl_comment_text']);
185
- $options['select_text']=htmlspecialchars($_POST['cl_select_text']);
186
- $options['default_on']=$_POST['cl_default_on'];
187
- $options['heart_tip']=$_POST['cl_heart_tip'];
188
- $options['badge']=$_POST['cl_badge'];
189
- $options['show_text']=htmlspecialchars($_POST['cl_show_text']);
190
- $options['prepend']=htmlspecialchars($_POST['cl_prepend']);
191
- $options['author_name']=$_POST['cl_author_name'];
192
- $options['url_name']=$_POST['cl_url_name'];
193
- $options['comment_name']=$_POST['cl_comment_name'];
194
- $options['email_name']=$_POST['cl_email_name'];
195
-
 
196
  // check for errors
197
- if( count($errors->errors) > 0 ){
198
  echo '<div class="error"><h3>';
199
- _e('There were errors with your chosen settings',$this->plugin_domain);
200
  echo '</h3>';
201
- foreach( $errors->get_error_messages() as $message ){
202
  echo $message;
203
  }
204
  echo '</div>';
205
  } else {
206
  //every-ting cool mon
207
- update_option($this->db_option, $options);
208
  echo '<div class="updated fade"><p>Plugin settings saved.</p></div>';
209
  }
210
-
211
  }
212
  // loop through each option and assign it as key=value
213
- foreach ($options as $key =>$value){
214
  $$key = $value;
215
  }
216
  // set value to checked if option is on (for showing correct status of checkbox and radio button in settings page)
217
- $default_on = $options['default_on'] == 'on'?'checked':'';
218
- $heart_tip = $options['heart_tip'] == 'on'?'checked':'';
219
- $badge1 = $options['badge'] == 'ACL88x31-black2.gif'?'checked':'';
220
- $badge2 = $options['badge'] == 'ACL88x31-white2.gif'?'checked':'';
221
- $badge3 = $options['badge'] == 'CL91x17-black2.gif'?'checked':'';
222
- $badge4 = $options['badge'] == 'CL91x17-white2.gif'?'checked':'';
223
- $badge5 = $options['badge'] == 'nothing.gif'?'checked':'';
224
- $use_template = $options['use_template'] == 'on'?'checked':'';
225
- $badge_text = $options['badge'] == 'text'?'checked':'';
226
-
227
  // url for form submit
228
- $action_url = $_SERVER['REQUEST_URI'];
229
- include('commentluv-manager.php');
230
  }
231
  // shortcode for showing badge and drop down box
232
- function display_badge(){
233
- if(is_single()){
234
- $options = get_option($this->db_option);
 
235
  // choose as image or as text
236
- $badge_text = $options['badge'] == 'text'?'on':'';
237
- $default_on = $options['default_on'] == 'on'?'checked="checked"':'';
238
  // untick the box if user is admin
239
  global $user_ID;
240
- if( $user_ID ) {
241
- if( current_user_can('create_users') ) {
242
  $default_on = '';
243
  }
244
  }
245
- $options['badge'] = $this->plugin_url . 'images/' . $options['badge'];
246
- if($badge_text == ''){
247
- $badge='<a href="http://comluv.com" target="_blank"><img src="' . $options['badge'] . '" border=0 alt="' . $options['show_text'] .'" title="'.$options['show_text'].'"/></a>';
248
  } else {
249
- $badge='<a href="http://comluv.com" target="_blank">'.$options['show_text'].'</a>';
250
  }
251
- echo '<div id="commentluv">' . $options['prepend'] . '<input type="checkbox" id="doluv" name="doluv" ' .
252
- $default_on . ' style="width:25px;"></input><span id="mylastpost" style="clear: both">' .
253
- $badge . '</span><img class="clarrow" id="showmore" src="' .
254
- $this->plugin_url . 'images/down-arrow.gif" alt="show more" style="display:none;"/></div><div id="lastposts" style="display: none;"></div>';
255
  }
256
  }
257
  // hook the comment form to add fields for url for logged in users
258
- function add_fields($id){
259
- $options = get_option($this->db_option);
260
- $cl_author_id=$options['author_name'];
261
- $cl_site_id=$options['url_name'];
262
-
263
- if (is_user_logged_in()){
264
  // get options values and insert as hidden fields
265
  global $userdata;
266
- get_currentuserinfo();
267
- $author=$userdata->display_name;
268
- $userid=$userdata->ID;
269
- $url=$userdata->user_url;
270
  // check for MU blog
271
- if( function_exists( 'is_site_admin' ) ) {
272
- if(!$url || $url=="http://"){
273
- $userbloginfo = get_blogs_of_user($userid,1);
274
- $url=$userbloginfo[1]->siteurl;
275
  }
276
  }
277
-
278
  echo "<input type='hidden' id='$cl_author_id' name='$cl_author_id' value='$author' />";
279
  echo "<input type='hidden' id='$cl_site_id' name='$cl_site_id' value='$url' />";
280
  }
@@ -284,185 +253,195 @@ if ( !class_exists('commentluv') ) {
284
  echo '<input type="hidden" name="request_id" />';
285
  echo '<input type="hidden" name="cl_post" id="cl_post"/>';
286
  // check if using php call comments.php or not
287
- if($options['use_template']==''){
288
- $this->display_badge();
 
289
  }
290
  return $id;
291
  }
292
-
293
  // hook the pre_comment_content to add the link
294
- function cl_post($commentdata){
295
- if( isset($_POST['cl_post']) && $_POST['request_id'] !='' && is_numeric($_POST['choice_id']) && isset($_POST['cl_type']) ) {
296
  // get values posted
297
- $luvlink = $_POST['cl_post'];
298
- if(strstr($luvlink,"commentluv.com/error-check") || $_POST['request_id'] == 0){
299
  return $commentdata;
300
  }
301
- $request_id = $_POST['request_id'];
302
- $choice_id = $_POST['choice_id'];
303
- $cl_type = $_POST['cl_type'];
304
  // convert data to put into comment content
305
- $options = get_option($this->db_option);
306
- $prepend_text = $options['comment_text'];
307
- $search = array('[name]','[type]','[lastpost]');
308
- $replace = array($_POST["{$options['author_name']}"],$cl_type,$luvlink);
309
- $inserted = str_replace($search,$replace,$prepend_text);
310
  // insert identifying data and insert text/link to end of comment
311
- $commentdata.= "\n.-= $inserted =-.";
312
  // tell comluv that the comment was submitted
313
- $luvlink = stripslashes($luvlink);
314
- $thelinkstart = strpos($luvlink,'="');
315
- $cutit = substr($luvlink,$thelinkstart+2);
316
- $hrefend=strpos($cutit,'"');
317
- $thelink = substr($cutit,0,$hrefend);
318
  // got the url, construct url to tell comluv
319
  $url = $this->api_url . "?type=approve&request_id=$request_id&post_id=$choice_id&url=$thelink";
320
- $content = $this->call_comluv($url);
321
  }
322
  return $commentdata;
323
  }
324
  // hook the set comment status action
325
  function update_cl_status($cid, $status) {
326
  // get comment stuff from id
327
- if($status != 'spam') {
328
- if($status != 'delete') {
329
  $status = 'approve';
330
  }
331
- $comment = get_comment($cid);
332
- if(strpos($comment->comment_content,".-=")){
333
  // comment can be approved or deleted in the comluv db
334
- $url = $this->api_url ."?type={$status}&url=";
335
  // get the link
336
  $commentcontent = $comment->comment_content;
337
- $start = strrpos($commentcontent,'.-=');
338
- $thelink = substr($commentcontent,$start+4,strlen($commentcontent)-$start-5);
339
- $hrefstart= strpos($thelink,'="');
340
- $cutit = substr($thelink,$hrefstart+2);
341
- $hrefend=strpos($cutit,'"');
342
- $thelink=substr($cutit,0,$hrefend);
343
  // get comment date
344
  $date = $comment->comment_date_gmt;
345
  // construct url with added params for approving comment to comluv
346
- $url.=$thelink . "&comment_date=$date&version=" . $this->cl_version;
347
  // call the url ..
348
- $content = $this->call_comluv($url);
349
  } // end if comment content contains a .-=
350
- }
351
  }
352
-
353
  // use my own shortcode that was inserted at submission time and hide the params
354
  function do_shortcode($commentcontent) {
355
- $options = get_option($this->db_option);
356
- if(strpos($commentcontent,".-=")){
357
- // get bit that was added
358
- $start = strrpos($commentcontent,'.-=');
359
- $beforelinktext = substr($commentcontent,0,$start);
360
- $thelinktext = substr($commentcontent,$start+3,-3);
361
- $commentcontent = $beforelinktext.'<span class="cluv">'.$thelinktext;
362
  // do heart info
363
- if($options['heart_tip'] == 'on'){
364
- $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>';
365
  }
366
  $commentcontent .= '</span>';
367
  }
 
368
  // remove old codes
369
- if(strpos($commentcontent,"[rq=") && strpos($commentcontent,"[/rq]")){
370
  // get bit that was added
371
- $start = strpos($commentcontent,'[rq=');
372
- $end = strpos($commentcontent,'[/rq]') + 5;
373
- $params = substr($commentcontent,$start,$end-$start);
374
  global $comment;
375
  $author_name = $comment->comment_author;
376
  $author_url = $comment->comment_author_url;
377
  // get array of params
378
- $params_arr = explode(",",substr($params,4,-6));
379
  // get and prepare the text specified by the user
380
- $prepend_text = $options['comment_text'];
381
- $search = array('[name]','[type]','[lastpost]');
382
- $replace = array($author_name,$params_arr[2],'');
383
  $inserted = '<span class="cluv">';
384
- $inserted .= str_replace($search,$replace,$prepend_text);
385
- $commentcontent = str_replace($params,$inserted,$commentcontent);
386
- if($options['heart_tip'] == 'on'){
387
- $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>';
388
  }
389
  $commentcontent .= '</span>';
390
  }
391
  return $commentcontent;
392
  }
393
-
394
  // set up default values
395
- function install()
396
- {
397
  // set default options
398
- $this->get_options();
399
  }
400
-
401
  // Localization support
402
- function handle_load_domain()
403
- {
404
  // get current language
405
- $locale = get_locale();
406
-
407
  // locate translation file
408
- $mofile = WP_PLUGIN_DIR.'/'.plugin_basename(dirname(__FILE__)).'/lang/' . $this->plugin_domain . '-' . $locale . '.mo';
409
-
410
  // load translation
411
- load_textdomain($this->plugin_domain, $mofile);
412
  }
413
  // call home to tell about comment submission or status
414
- function call_comluv($url){
415
- if(function_exists("curl_init")){
416
  //setup curl values
417
- $curl=curl_init();
418
- curl_setopt($curl,CURLOPT_URL,$url);
419
- curl_setopt($curl,CURLOPT_HEADER,0);
420
- curl_setopt($curl,CURLOPT_RETURNTRANSFER,TRUE);
421
- curl_setopt($curl,CURLOPT_TIMEOUT,7);
422
- $content=curl_exec($curl);
423
- if(!curl_error($curl)){
424
- if(function_exists(json_decode)){
425
- $data=json_decode($content);
426
- if($data->status != 200){
427
  // unsuccessful confirmation.
428
- // have a tantrum here if you want.
429
  }
430
  }
431
- curl_close($curl);
432
-
433
  }
434
- } elseif(ini_get('allow_url_fopen')){
435
- $content = @file_get_contents($url);
436
  }
437
  return $content;
438
  }
439
-
440
-
441
-
 
 
 
 
 
 
 
 
 
 
 
 
442
  }
443
  }
444
 
445
  // start commentluv class engines
446
- if ( class_exists('commentluv') ) :
447
- $commentluv = new commentluv();
 
 
 
 
 
 
 
 
448
 
449
- // confirm warp capability
450
- if (isset($commentluv) )
451
- {
452
- // engage
453
- register_activation_hook( __FILE__, array(&$commentluv,'install') );
454
 
455
- }
456
  endif;
457
 
 
458
  // function for template call
459
- function cl_display_badge(){
460
- $temp = new commentluv();
461
- $temp->display_badge();
462
  }
463
 
464
-
465
-
466
-
467
-
468
  ?>
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.6
6
  Author: Andy Bailey
7
  Author URI: http://fiddyp.comluv.com/
8
 
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
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
 
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
+ echo '<div id="commentluv">' . htmlspecialchars_decode(stripslashes($options ['prepend'])) . '<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>';
223
+ $badgeshown = TRUE;
 
 
224
  }
225
  }
226
  // hook the comment form to add fields for url for logged in users
227
+ function add_fields($id) {
228
+ $options = get_option ( $this->db_option );
229
+ $cl_author_id = $options ['author_name'];
230
+ $cl_site_id = $options ['url_name'];
231
+
232
+ if (is_user_logged_in ()) {
233
  // get options values and insert as hidden fields
234
  global $userdata;
235
+ get_currentuserinfo ();
236
+ $author = $userdata->display_name;
237
+ $userid = $userdata->ID;
238
+ $url = $userdata->user_url;
239
  // check for MU blog
240
+ if (function_exists ( 'is_site_admin' )) {
241
+ if (! $url || $url == "http://") {
242
+ $userbloginfo = get_blogs_of_user ( $userid, 1 );
243
+ $url = $userbloginfo [1]->siteurl;
244
  }
245
  }
246
+
247
  echo "<input type='hidden' id='$cl_author_id' name='$cl_author_id' value='$author' />";
248
  echo "<input type='hidden' id='$cl_site_id' name='$cl_site_id' value='$url' />";
249
  }
253
  echo '<input type="hidden" name="request_id" />';
254
  echo '<input type="hidden" name="cl_post" id="cl_post"/>';
255
  // check if using php call comments.php or not
256
+ global $badgeshown;
257
+ if ($options ['use_template'] == '' && !$badgeshown) {
258
+ $this->display_badge ();
259
  }
260
  return $id;
261
  }
262
+
263
  // hook the pre_comment_content to add the link
264
+ function cl_post($commentdata) {
265
+ if (isset ( $_POST ['cl_post'] ) && $_POST ['request_id'] != '' && is_numeric ( $_POST ['choice_id'] ) && isset ( $_POST ['cl_type'] )) {
266
  // get values posted
267
+ $luvlink = $_POST ['cl_post'];
268
+ if (strstr ( $luvlink, "commentluv.com/error-check" ) || $_POST ['request_id'] == 0) {
269
  return $commentdata;
270
  }
271
+ $request_id = $_POST ['request_id'];
272
+ $choice_id = $_POST ['choice_id'];
273
+ $cl_type = $_POST ['cl_type'];
274
  // convert data to put into comment content
275
+ $options = get_option ( $this->db_option );
276
+ $prepend_text = $options ['comment_text'];
277
+ $search = array ('[name]', '[type]', '[lastpost]' );
278
+ $replace = array ($_POST ["{$options['author_name']}"], $cl_type, $luvlink );
279
+ $inserted = str_replace ( $search, $replace, $prepend_text );
280
  // insert identifying data and insert text/link to end of comment
281
+ $commentdata .= "\n.-= $inserted =-.";
282
  // tell comluv that the comment was submitted
283
+ $luvlink = stripslashes ( $luvlink );
284
+ $thelinkstart = strpos ( $luvlink, '="' );
285
+ $cutit = substr ( $luvlink, $thelinkstart + 2 );
286
+ $hrefend = strpos ( $cutit, '"' );
287
+ $thelink = substr ( $cutit, 0, $hrefend );
288
  // got the url, construct url to tell comluv
289
  $url = $this->api_url . "?type=approve&request_id=$request_id&post_id=$choice_id&url=$thelink";
290
+ $content = $this->call_comluv ( $url );
291
  }
292
  return $commentdata;
293
  }
294
  // hook the set comment status action
295
  function update_cl_status($cid, $status) {
296
  // get comment stuff from id
297
+ if ($status != 'spam') {
298
+ if ($status != 'delete') {
299
  $status = 'approve';
300
  }
301
+ $comment = get_comment ( $cid );
302
+ if (strpos ( $comment->comment_content, ".-=" )) {
303
  // comment can be approved or deleted in the comluv db
304
+ $url = $this->api_url . "?type={$status}&url=";
305
  // get the link
306
  $commentcontent = $comment->comment_content;
307
+ $start = $this->my_strrpos( $commentcontent, '.-=' );
308
+ $thelink = substr ( $commentcontent, $start + 4, strlen ( $commentcontent ) - $start - 5 );
309
+ $hrefstart = strpos ( $thelink, '="' );
310
+ $cutit = substr ( $thelink, $hrefstart + 2 );
311
+ $hrefend = strpos ( $cutit, '"' );
312
+ $thelink = substr ( $cutit, 0, $hrefend );
313
  // get comment date
314
  $date = $comment->comment_date_gmt;
315
  // construct url with added params for approving comment to comluv
316
+ $url .= $thelink . "&comment_date=$date&version=" . $this->cl_version;
317
  // call the url ..
318
+ $content = $this->call_comluv ( $url );
319
  } // end if comment content contains a .-=
320
+ }
321
  }
 
322
  // use my own shortcode that was inserted at submission time and hide the params
323
  function do_shortcode($commentcontent) {
324
+ $options = get_option ( $this->db_option );
325
+ if (strpos ( $commentcontent, ".-=" ) && strpos ( $commentcontent, "=-." )) {
326
+ $last_pos = $this->my_strrpos ( $commentcontent, ".-=" ); // position number for last occurence of .-=
327
+ $beforecltext = substr ( $commentcontent, 0, $last_pos ); // get text before last position of .-=
328
+ $cltext = substr ( $commentcontent, $last_pos ); // get the bit between .-= and =-.
329
+ $cltext = str_replace ( array (".-=", "=-." ), array ('<span class="cluv">', '' ), $cltext ); // replace .-= with span and chop off last =-.
330
+ $commentcontent = $beforecltext . $cltext;
331
  // do heart info
332
+ if ($options ['heart_tip'] == 'on') {
333
+ $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>';
334
  }
335
  $commentcontent .= '</span>';
336
  }
337
+
338
  // remove old codes
339
+ if (strpos ( $commentcontent, "[rq=" ) && strpos ( $commentcontent, "[/rq]" )) {
340
  // get bit that was added
341
+ $start = strpos ( $commentcontent, '[rq=' );
342
+ $end = strpos ( $commentcontent, '[/rq]' ) + 5;
343
+ $params = substr ( $commentcontent, $start, $end - $start );
344
  global $comment;
345
  $author_name = $comment->comment_author;
346
  $author_url = $comment->comment_author_url;
347
  // get array of params
348
+ $params_arr = explode ( ",", substr ( $params, 4, - 6 ) );
349
  // get and prepare the text specified by the user
350
+ $prepend_text = $options ['comment_text'];
351
+ $search = array ('[name]', '[type]', '[lastpost]' );
352
+ $replace = array ($author_name, $params_arr [2], '' );
353
  $inserted = '<span class="cluv">';
354
+ $inserted .= str_replace ( $search, $replace, $prepend_text );
355
+ $commentcontent = str_replace ( $params, $inserted, $commentcontent );
356
+ if ($options ['heart_tip'] == 'on') {
357
+ $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>';
358
  }
359
  $commentcontent .= '</span>';
360
  }
361
  return $commentcontent;
362
  }
363
+
364
  // set up default values
365
+ function install() {
 
366
  // set default options
367
+ $this->get_options ();
368
  }
369
+
370
  // Localization support
371
+ function handle_load_domain() {
 
372
  // get current language
373
+ $locale = get_locale ();
374
+
375
  // locate translation file
376
+ $mofile = WP_PLUGIN_DIR . '/' . plugin_basename ( dirname ( __FILE__ ) ) . '/lang/' . $this->plugin_domain . '-' . $locale . '.mo';
377
+
378
  // load translation
379
+ load_textdomain ( $this->plugin_domain, $mofile );
380
  }
381
  // call home to tell about comment submission or status
382
+ function call_comluv($url) {
383
+ if (function_exists ( "curl_init" )) {
384
  //setup curl values
385
+ $curl = curl_init ();
386
+ curl_setopt ( $curl, CURLOPT_URL, $url );
387
+ curl_setopt ( $curl, CURLOPT_HEADER, 0 );
388
+ curl_setopt ( $curl, CURLOPT_RETURNTRANSFER, TRUE );
389
+ curl_setopt ( $curl, CURLOPT_TIMEOUT, 7 );
390
+ $content = curl_exec ( $curl );
391
+ if (! curl_error ( $curl )) {
392
+ if (function_exists ( json_decode )) {
393
+ $data = json_decode ( $content );
394
+ if ($data->status != 200) {
395
  // unsuccessful confirmation.
396
+ // have a tantrum here if you want.
397
  }
398
  }
399
+ curl_close ( $curl );
400
+
401
  }
402
+ } elseif (ini_get ( 'allow_url_fopen' )) {
403
+ $content = @file_get_contents ( $url );
404
  }
405
  return $content;
406
  }
407
+ // find last occurrence of string in string (for php 4)
408
+ function my_strrpos($haystack, $needle, $offset = 0) {
409
+ // same as strrpos, except $needle can be a string
410
+ // http://www.webmasterworld.com/forum88/10570.htm
411
+ $strrpos = false;
412
+ if (is_string ( $haystack ) && is_string ( $needle ) && is_numeric ( $offset )) {
413
+ $strlen = strlen ( $haystack );
414
+ $strpos = strpos ( strrev ( substr ( $haystack, $offset ) ), strrev ( $needle ) );
415
+ if (is_numeric ( $strpos )) {
416
+ $strrpos = $strlen - $strpos - strlen ( $needle );
417
+ }
418
+ }
419
+ return $strrpos;
420
+ }
421
+
422
  }
423
  }
424
 
425
  // start commentluv class engines
426
+ if (class_exists ( 'commentluv' )) :
427
+ $badgeshown=FALSE;
428
+ $commentluv = new commentluv ( );
429
+
430
+ // confirm warp capability
431
+ if (isset ( $commentluv )) {
432
+ // engage
433
+ register_activation_hook ( __FILE__, array (&$commentluv, 'install' ) );
434
+
435
+ }
436
 
 
 
 
 
 
437
 
 
438
  endif;
439
 
440
+
441
  // function for template call
442
+ function cl_display_badge() {
443
+ $temp = new commentluv ( );
444
+ $temp->display_badge ();
445
  }
446
 
 
 
 
 
447
  ?>
js/commentluv.js CHANGED
@@ -1,5 +1,4 @@
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"
@@ -66,6 +65,8 @@ jQuery.noConflict();
66
  if(cl_settings['heart_tip'] == "on"){
67
  $('.heart_tip_box').hoverIntent({over:heart_big,out: do_nowt,interval : 50,timeout: 50});
68
  }
 
 
69
  function heart_big(){
70
  $("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>');
71
  // find where to put left edge of info box (in case at right hand side of screen
1
  // commentluv.js 2.7
 
2
  (function($) {
3
  $(document).ready(function(){
4
  // get form object that is parent of textarea named "comment"
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
lang/commentluv-it_IT.mo ADDED
Binary file
lang/commentluv-it_IT.po ADDED
@@ -0,0 +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
+ "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,127 +1,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
-
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
+
 
 
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.4
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,6 +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.
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;
9
  }
10
  #commentluv img{
11
  border: 0 !important;
@@ -14,7 +14,9 @@
14
  .cluv {
15
  border:1px solid #fff;
16
  padding: 5px;
17
- display: block
 
 
18
  }
19
  #lastposts {
20
  width: 500px;
5
 
6
  }
7
  #commentluv {
8
+ clear: both !important;
9
  }
10
  #commentluv img{
11
  border: 0 !important;
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;