CommentLuv - Version 2.90.7

Version Description

  • added : more detailed error messages to javascript
  • added : update version number in db on activation if existing version is less
  • added : not authorized error in fetch function if nonce check fails
  • added : allow disabling of commentluv request detection (for those getting xml errors when commenting on other sites)
  • added : if w3 total cache active, clear cache on commentluv activation/upgrade.
  • added : German translation
  • added : warning if saving settings with 10 posts only for registered users but registration not enabled
  • added : include note about registration not enabled to drop down list (only for admin to see)
  • added : auto add commentluv to list of useragents to ignore for w3 pagecache
  • bugfix : prevent theme from outputting data before send_feed if commentluv useragent detected
  • added : Persian translation
Download this release

Release Info

Developer commentluv
Plugin Icon 128x128 CommentLuv
Version 2.90.7
Comparing to
See all releases

Code changes from version 2.90.6 to 2.90.7

commentluv.php CHANGED
@@ -1,1511 +1,1586 @@
1
- <?php /* commentluv
2
- Plugin Name: CommentLuv
3
- Plugin URI: http://comluv.com/
4
- Description: 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.
5
- Version: 2.90.6
6
- Author: Andy Bailey
7
- Author URI: http://www.commentluv.com
8
- Copyright (C) <2011> <Andy Bailey>
9
-
10
- This program is free software: you can redistribute it and/or modify
11
- it under the terms of the GNU General Public License as published by
12
- the Free Software Foundation, either version 3 of the License, or
13
- (at your option) any later version.
14
-
15
- This program is distributed in the hope that it will be useful,
16
- but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
- GNU General Public License for more details.
19
-
20
- You should have received a copy of the GNU General Public License
21
- along with this program. If not, see <http://www.gnu.org/licenses/>.
22
- */
23
-
24
- if (! class_exists ( 'commentluv' )) {
25
- // let class begin
26
- class commentluv {
27
- //localization domain
28
- var $plugin_domain = 'commentluv';
29
- var $plugin_url;
30
- var $plugin_dir;
31
- var $db_option = 'commentluv_options';
32
- var $version = "2.90.6";
33
- var $slug = 'commentluv-options';
34
- var $localize;
35
- var $is_commentluv_request = false;
36
-
37
- /** commentluv
38
- * This is the constructor, it runs as soon as the class is created
39
- * Use this to set up hooks, filters, menus and language config
40
- */
41
- function __construct() {
42
- global $wp_version, $pagenow;
43
- // pages where this plugin needs translation
44
- $local_pages = array ('plugins.php', 'options-general.php' );
45
- // check if translation needed on current page
46
- if (in_array ( $pagenow, $local_pages ) || in_array ( $_GET ['page'], $local_pages )) {
47
- $this->handle_load_domain ();
48
- }
49
- $exit_msg = __ ( 'CommentLuv requires Wordpress 3.0 or newer.', $this->plugin_domain ) . '<a href="http://codex.wordpress.org/Upgrading_Wordpress">' . __ ( 'Please Update!', $this->plugin_domain ) . '</a>';
50
- // can you dig it?
51
- if (version_compare ( $wp_version, "3.0", "<" )) {
52
- echo ( $exit_msg ); // no diggedy
53
- }
54
- // activation/deactivation
55
- register_activation_hook(__FILE__, array(&$this,'activation'));
56
- register_deactivation_hook(__FILE__, array(&$this,'deactivation'));
57
- // manual set install and activate, wordpress wont fire the activation hook on auto upgrade plugin
58
- $cl_version = get_option('cl_version');
59
- if($this->version != $cl_version){
60
- $this->install();
61
- $this->activation();
62
- }
63
- // plugin dir and url
64
- $this->plugin_url = trailingslashit ( WP_PLUGIN_URL . '/' . dirname ( plugin_basename ( __FILE__ ) ) );
65
- $this->plugin_dir = dirname(__FILE__);
66
- // hooks
67
- add_action ( 'clversion', array (&$this,'check_version') ); // check commentluv version
68
- add_action ( 'init', array (&$this,'init') ); // to register styles and scripts
69
- add_action ( 'admin_init', array (&$this, 'admin_init' ) ); // to register settings group
70
- add_action ( 'admin_menu', array (&$this, 'admin_menu' ) ); // to setup menu link for settings page
71
- add_action ( 'admin_print_scripts-settings_page_commentluv-options', array(&$this,'add_settings_page_script')); // script for settings page ajax function
72
- add_action ( 'admin_print_styles-settings_page_commentluv-options', array(&$this,'add_settings_page_style')); // script for settings page ajax function
73
- add_action ( 'wp_ajax_notify_signup', array(&$this,'notify_signup')); // ajax handler for settings page subscribe button
74
-
75
- // filters
76
- add_filter ( 'cron_schedules', array (&$this, 'cron_schedules') ); // for my own recurrence
77
- add_filter ( 'plugin_action_links', array (&$this, 'plugin_action_link' ), - 10, 2 ); // add a settings page link to the plugin description. use 2 for allowed vars
78
- add_filter ( 'found_posts', array(&$this,'send_feed'),10,2); // sends post titles and urls only
79
- add_filter ( 'kindergarten_html', array(&$this,'kindergarten_html')); // for cleaning html
80
- $options = $this->get_options();
81
- //DebugBreak();
82
- //$this->check_version();
83
- if($options['enable'] == 'yes'){
84
- $this->setup_hooks();
85
- }
86
- }
87
- /**
88
- * PHP4 constructor
89
- */
90
- function commentluv() {
91
- $this->__construct();
92
- }
93
- /** runs when plugin is activated
94
- * called by register_activation_hook
95
- *
96
- */
97
- function activation(){
98
- // only add if it doesn't exist yet
99
- $sched = wp_next_scheduled('clversion');
100
- if(false === $sched){
101
- // set up cron for version check
102
- $rnd = mt_rand(5,604800);
103
- wp_schedule_event(time() - $rnd,'clfortnightly','clversion');
104
- }
105
- }
106
- /**
107
- * Adds fields to comment area
108
- * called by add_action('comment_form
109
- */
110
- function add_fields(){
111
- global $clbadgeshown;
112
- $options = $this->get_options();
113
- if(!$this->is_enabled()){
114
- return;
115
- }
116
- $author_name = $options['author_name'];
117
- $email_name = $options['email_name'];
118
- $url_name = $options['url_name'];
119
- // handle logged on user
120
- if(is_user_logged_in()){
121
- global $userdata;
122
- get_currentuserinfo();
123
- $author = $userdata->display_name;
124
- $userid = $userdata->ID;
125
- $url = $userdata->user_url;
126
- if(!strstr($url,'http://') && $url != ''){
127
- $url = 'http://'.$url;
128
- }
129
- // check for s2 member pluin, add url from it's custom registration fields
130
- if(defined('WS_PLUGIN__S2MEMBER_VERSION') && isset($userdata->wp_s2member_custom_fields['website'])){
131
- $url = $userdata->wp_s2member_custom_fields['website'];
132
- }
133
- // check for multisite
134
- if(is_multisite()){
135
- if(!$url || $url == 'http://'){
136
- $userbloginfo = get_blogs_of_user($userid,1);
137
- $url = $userbloginfo[1] -> siteurl;
138
- }
139
- }
140
- // final check of url
141
- if($url == 'http://'){
142
- $url = '';
143
- }
144
- // spit out hidden fields
145
- echo '<input type="hidden" id="'.$author_name.'" name="'.$author_name.'" value="'.$author.'"/>';
146
- // if buddypress, don't hide field
147
- if(function_exists('bp_core_setup_globals')){
148
- $input_type = 'text';
149
- } else {
150
- $input_type = 'hidden';
151
- }
152
- echo '<input type="'.$input_type.'" id="'.$url_name.'" name="'.$url_name.'" value="'.$url.'"/>';
153
- }
154
- // add hidden fields for holding information about type,choice,html and request for every user
155
- echo '<input type="hidden" name="cl_post_title" id="cl_post_title"/>';
156
- echo '<input type="hidden" name="cl_post_url" id="cl_post_url"/>';
157
- echo '<input type="hidden" name="cl_prem" id="cl_prem"/>';
158
-
159
- // show badge (unless user set to manual insert)
160
- if($clbadgeshown == false && $options['template_insert'] != 'on'){
161
- $this->display_badge();
162
- }
163
- }
164
- function add_footer(){
165
- extract($this->get_options());
166
- if($minifying != 'on' || !$this->is_enabled()){
167
- return;
168
- }
169
- // from the excellent book wp-ajax (http://www.wpajax.com/)
170
- $data = "var cl_settings = {";
171
- $arr = array();
172
- $vars = $this->localize;
173
- foreach ($vars as $key => $value) {
174
- $arr[count($arr)] = $key . " : '" . esc_js($value) . "'";
175
- }
176
- $data .= implode(",",$arr); $data .= "};";
177
- echo "<script type='text/javascript'>\n";
178
- echo "/* <![CDATA[ */\n";
179
- echo $data;
180
- echo "\n/* ]]> */\n";
181
- echo "</script>\n";
182
- }
183
- /**
184
- * called by add_filter('comment_row_actions
185
- * adds another link to the comment row in admin for removing the luv link
186
- * @param array $actions - the existing actions
187
- */
188
- function add_removeluv_link($actions){
189
- global $post;
190
- $user_can = current_user_can('edit_posts', $post->ID);
191
- $cid = get_comment_ID();
192
- $data = get_comment_meta($cid,'cl_data');
193
- if($data && is_array($data)){
194
- if($user_can){
195
- $nonce= wp_create_nonce ('removeluv'.get_comment_ID());
196
- $actions['Remove-luv'] = '<a class="removeluv :'.$cid.':'.$nonce.'" href="javascript:">Remove Luv</a>';
197
- }
198
- }
199
- return $actions;
200
- }
201
- /**
202
- * called by add_action('admin_print_scripts-edit-comments.php'
203
- * load the script to handle the removluv link
204
- *
205
- */
206
- function add_removeluv_script(){
207
- wp_enqueue_script ( 'commentluv', $this->plugin_url . 'js/adminremoveluv.js', array ('jquery' ),$this->version );
208
- }
209
- /**
210
- * called by add_action('template_redirect in setup_hooks()
211
- * used to add the commentluv script and localized settings (if not using minifying compatibility)
212
- */
213
- function add_script(){
214
- $options = $this->get_options();
215
- extract($options);
216
- if(!$this->is_enabled()){
217
- return;
218
- }
219
-
220
- wp_enqueue_script('commentluv_script');
221
- $this->localize = array ('name' => $author_name, 'url' => $url_name, 'comment' => $comment_name, 'email' => $email_name,
222
- 'infopanel' => $infopanel, 'default_on' => $default_on, 'default_on_admin' => $default_on_admin,
223
- 'cl_version' => $this->version, 'images' => $this->plugin_url . 'images/', 'api_url' => $api_url,
224
- '_fetch' => wp_create_nonce('fetch'), '_info' => wp_create_nonce('info'),
225
- 'infoback' => $infoback, 'infotext'=>$infotext,'template_insert'=>$template_insert, 'logged_in'=>is_user_logged_in(),
226
- 'refer' => get_permalink(),
227
- 'no_url_message'=>__('Please enter a URL and then click the CommentLuv checkbox if you want to add your last blog post',$this->plugin_domain),
228
- 'no_http_message'=>__('Please use http:// in front of your url',$this->plugin_domain),
229
- 'no_url_logged_in_message'=>__('You need to visit your profile in the dashboard and update your details with your site URL',$this->plugin_domain),
230
- 'no_info_message'=>__('No info was available or an error occured',$this->plugin_domain));
231
- if($minifying != 'on'){
232
- wp_localize_script('commentluv_script','cl_settings',$this->localize);
233
- }
234
-
235
- }
236
- /**
237
- * called by add_action('wp_print_styles in setup_hooks()
238
- * Used to add the stylesheet for commentluv
239
- */
240
- function add_style(){
241
- if(!$this->is_enabled()){
242
- return;
243
- }
244
- wp_enqueue_style('commentluv_style');
245
- }
246
- /**
247
- * Adds scripts to settings page. Only loads scripts if the settings page is being shown
248
- * Called by add_action('admin_print_scripts-settings_page_commentluv-options'
249
- * use localize so messages in javascript are internationalized
250
- */
251
- function add_settings_page_script (){
252
- wp_enqueue_script ('notify_signup', $this->plugin_url . 'js/notify_signup.js', array('jquery'),$this->version );
253
- wp_localize_script ( 'notify_signup', 'notify_signup_settings', array('wait_message'=>__('Please wait',$this->plugin_domain),'notify_success1' => __('Please check your inbox, an email will be sent to',$this->plugin_domain), 'notify_success2'=>__('in the next few minutes with a confirmation link',$this->plugin_domain), 'notify_fail'=>__('An error happened with the request. Try signing up at the site',$this->plugin_domain),'image_url'=>$this->plugin_url.'images/','default'=>'CL91_default.png', 'white'=>'CL91_White.gif','black'=>'CL91_Black.gif','none'=>'nothing.gif'));
254
- wp_enqueue_script('thickbox',null,array('jquery'));
255
- echo "<link rel='stylesheet' href='/".WPINC."/js/thickbox/thickbox.css?ver=20080613' type='text/css' media='all' />\n";
256
- }
257
- /**
258
- * adds the thickbox style to header for commentluv settings page
259
- * called by add_action('admin_print_styles-settings_page_commentluv-options
260
- */
261
- function add_settings_page_style(){
262
- wp_enqueue_style('thickbox');
263
- }
264
- /** admin_init
265
- * This function registers the settings group
266
- * it is called by add_action admin_init
267
- * options in the options page will need to be named using $this->db_option[option]
268
- */
269
- function admin_init(){
270
- // whitelist options
271
- register_setting( 'commentluv_options_group', $this->db_option ,array(&$this,'options_sanitize' ) );
272
- $options = $this->get_options();
273
- if($options['upgrade']){
274
- add_action('admin_notices',array(&$this,'show_upgrade_notice'));
275
- }
276
- // has the comment meta table?
277
- global $wpdb;
278
- $query = $wpdb->prepare("SHOW tables LIKE '{$wpdb->commentmeta}'");
279
- $dbtable = $wpdb->get_var($query);
280
- $o['dbtable'] = $dbtable;
281
- if(!$dbtable){
282
- add_action('admin_notices',create_function('','echo "<div class=\"error\">'.__('Your Wordpress install is missing the <strong>wp_commentmeta</strong> table!',$pd).'<br>'.__(' CommentLuv cannot work without this table please see this wordpress forum post to learn how to add one ->',$pd).'<a target=\"_blank\" href=\"http://wordpress.org/support/topic/wp_commentmeta-table-a39xxxx2_blogwp_commentmeta-doesnt-exist?replies=7#post-1378281\">'.__('Missing wp_commentmeta table',$pd).'</a></div>";'));
283
- }
284
- }
285
-
286
- /** admin_menu
287
- * This function adds a link to the settings page to the admin menu
288
- * see http://codex.wordpress.org/Adding_Administration_Menus
289
- * it is called by add_action admin_menu
290
- */
291
- function admin_menu(){
292
- if(is_multisite()){
293
- $level = 'manage_options'; // for wpmu sub blog admins
294
- } else {
295
- $level = 'administrator'; // for single blog intalls
296
- }
297
- $menutitle = '<img src="' . $this->plugin_url . 'images/littleheart.gif" alt=""/> CommentLuv';
298
- add_options_page ( 'CommentLuv settings', $menutitle, $level, $this->slug, array (&$this, 'options_page' ) );
299
- }
300
- /**
301
- * ajax handler
302
- * setup by add_action ( 'wp_ajax_removeluv'
303
- * called when remove luv link is clicked in comments edit page
304
- * with POST['action'] of removeluv, receives cid and _wpnonce
305
- */
306
- function ajax_remove_luv(){
307
- // check user is allowed to do this
308
- $nonce=$_REQUEST['_wpnonce'];
309
- $cid = $_REQUEST['cid'];
310
- if (! wp_verify_nonce($nonce, 'removeluv'.$cid) ) die("Epic fail");
311
- // delete meta if comment id sent with request
312
- if($cid){
313
- // get meta and set vars if exists
314
- $cmeta =get_comment_meta($cid,'cl_data','true');
315
- if($cmeta) extract($cmeta);
316
- // delete it and call comluv to tell it what happened
317
- if(delete_comment_meta($cid,'cl_data')){
318
- // can call originator blog here maybe
319
- // return the comment id and status code for js processing to hide luv
320
- echo "$cid*200";
321
- }
322
- } else {
323
- echo '0';
324
- }
325
- exit;
326
- }
327
- /**
328
- * checks for a new version
329
- * called by a cron action
330
- */
331
- function check_version(){
332
- $version = $this->php_version($this->version);
333
- $options = $this->get_options();
334
- $url = 'http://version.commentluv.com/';
335
- $name = strip_tags(get_bloginfo('name'));
336
- $description = strip_tags(get_bloginfo('description'));
337
- $body = array('version'=>$version,'enabled'=>$options['enable'],'name'=>$name,'description'=>$description,'avatarmd5'=>md5(strtolower(get_bloginfo('admin_email'))));
338
- $response = wp_remote_head($url,array('method'=>'POST','body'=>$body));
339
- $latest = $this->php_version(wp_remote_retrieve_header($response,'version'));
340
- $message = wp_remote_retrieve_header($response,'message');
341
- if(version_compare($version,$latest,'<')){
342
- $options['upgrade'] = $latest;
343
- if($message){
344
- $options['upgrade_message'] = apply_filters('kindergarten_html',$message);
345
- }
346
- update_option($this->db_option,$options);
347
- }
348
- }
349
- /**
350
- * called by add_action('comment_post
351
- * runs just after comment has been saved to the database
352
- * will save the luv link to comment meta if it exists
353
- *
354
- * @param int $id - id of the comment
355
- * @param string $commentdata - status of comment
356
- */
357
- function comment_posted($id,$approved){
358
- if($_POST['cl_post_url'] && $_POST['cl_post_title']){
359
- $title = apply_filters('kses',$_POST['cl_post_title']);
360
- //$link = apply_filters('kses',$_POST['cl_post_url']);
361
- $link = esc_url($_POST['cl_post_url']);
362
- //$prem = apply_filters('kses',$_POST['cl_prem']);
363
- $prem = 'p' == $_POST['cl_prem'] ? 'p' : 'u';
364
- $data = array('cl_post_title'=>$title,'cl_post_url'=>$link,'cl_prem'=>$prem);
365
- add_comment_meta($id,'cl_data',$data,'true');
366
- }
367
- }
368
- /**
369
- * add my own recurrence schedule
370
- * called by add_filter('cron_schedules
371
- *
372
- * @param mixed $schedules - the current schedules
373
- */
374
- function cron_schedules($schedules){
375
- $schedules['clfortnightly'] = array(
376
- 'interval' => 1209600,
377
- 'display' => __('Twice Monthly')
378
- );
379
- return $schedules;
380
- }
381
- /** runs when plugin is deactivated
382
- * called by register_deactivation_hook
383
- *
384
- */
385
- function deactivation(){
386
- wp_clear_scheduled_hook('clversion');
387
- }
388
- /**
389
- * Called by add_fields or by manual insert
390
- * used to show the badge and extra bits for holding the ajax drop down box
391
- *
392
- */
393
- function display_badge(){
394
- global $clbadgeshown;
395
- $options = $this->get_options();
396
- if($clbadgeshown == true){
397
- return;
398
- }
399
- // link to commentluv?
400
- $before = '';
401
- $after = '';
402
- // link
403
- if($options['link']){
404
- $before = '<a href="http://www.commentluv.com" target="_blank" title="'.__('CommentLuv is enabled',$this->plugin_domain).'">';
405
- $after = '</a>';
406
- }
407
- // dropdown choice
408
- if($options['badge_choice'] == 'drop_down'){
409
- if($options['badge_type'] != 'none'){
410
- $badges = array('default'=>'CL91_default.png','white'=>'CL91_White.gif','black'=>'CL91_Black.gif');
411
- $imgurl = $this->plugin_url.'images/'.$badges[$options['badge_type']];
412
- }
413
- }
414
- // custom image
415
- if($options['badge_choice'] == 'custom'){
416
- if($options['custom_image_url'] != ''){
417
- if(!strstr($options['custom_image_url'],'http://')){
418
- $imgurl = 'http://'.$options['custom_image_url'];
419
- } else {
420
- $imgurl = $options['custom_image_url'];
421
- }
422
- }
423
- }
424
- // create badge code (if not chosen 'none')
425
- if($options['badge_choice'] == 'drop_down' && $options['badge_type'] == 'none'){
426
- $badgecode = '';
427
- } else {
428
- $badgecode = $before.'<img alt="CommentLuv badge" src="'.$imgurl.'"/>'.$after;
429
- }
430
- // or using text
431
- if($options['badge_choice'] == 'text'){
432
- $badgecode = $before.$options['badge_text'].$after;
433
- }
434
- // default on
435
- $default_on = '';
436
- if($options['default_on'] == 'on'){
437
- $default_on = ' checked="checked"';
438
- if(is_user_logged_in() && current_user_can('manage_options')){
439
- if($options['default_on_admin'] != 'on'){
440
- $default_on = '';
441
- }
442
- }
443
- }
444
- // spit out code
445
- echo '<div id="commentluv"><div id="cl_messages"></div><input type="checkbox" id="doluv" name="doluv"'.$default_on.' /><span id="mylastpost">'.$badgecode.'</span><span id="showmorespan"><img class="clarrow" id="showmore" src="'.$this->plugin_url.'images/down-arrow.gif" alt="'.__('Show more posts',$this->plugin_domain).'" title="'.__('Show more posts',$this->plugin_domain).'" style="display:none;"/></span></div><div id="lastposts" style="display:none;"></div>';
446
- $clbadgeshown = true;
447
- }
448
- /**
449
- * ajax handler.
450
- * called by add_action('wp_ajax_(nopriv_)ajax
451
- * handles all ajax requests, receives 'do' as POST var and calls relevant function
452
- *
453
- */
454
- function do_ajax(){
455
- switch($_POST['do']){
456
- case 'fetch' :
457
- $this->fetch_feed();
458
- break;
459
- case 'info' :
460
- $this->do_info();
461
- break;
462
- case 'click' :
463
- $this->do_click();
464
- break;
465
-
466
- }
467
- }
468
- /**
469
- * called by do_ajax
470
- * receives cid and nonce and cl_prem as POST vars
471
- * stores the click in the comment meta
472
- */
473
- function do_click(){
474
- $cid = intval($_POST['cid']);
475
- $nonce = $_POST['nonce'];
476
- $url = $_POST['url'];
477
- if(!wp_verify_nonce($nonce,$cid)){
478
- exit;
479
- }
480
- $data = get_comment_meta($cid,'cl_data',true);
481
- if(is_array($data)){
482
- $data['clicks'] = $data['clicks'] + 1;
483
- update_comment_meta($cid,'cl_data',$data);
484
- }
485
- if($_POST['cl_prem'] == 'true'){
486
- $comment = get_commentdata($cid);
487
- $refer = get_permalink($comment['comment_post_ID']);
488
- // set blocking to false because no response required
489
- $response = wp_remote_post($url,array('blocking'=>false,'body'=>array('cl_request'=>'click','refer'=>$refer,'version'=>$this->version)));
490
- }
491
- exit;
492
- }
493
- /**
494
- * called by do_ajax
495
- * receives cl_prem, url and cid as POST vars
496
- * sends back json encoded string for the content of the panel
497
- */
498
- function do_info(){
499
-
500
- check_ajax_referer('info');
501
- global $wpdb;
502
- $options = $this->get_options();
503
- $isreg = false;
504
- $cid = intval($_POST['cid']);
505
- $cl_prem = $_POST['cl_prem'];
506
- $link = $_POST['link'];
507
- // is registered user?
508
- $email = get_comment_author_email($cid);
509
- $user = get_user_by_email($email);
510
- if($user){
511
- $isreg = true;
512
- }
513
- // get comments and stats
514
- $query = $wpdb->prepare('SELECT m.meta_value, c.comment_post_ID FROM '.$wpdb->comments.' c JOIN '.$wpdb->commentmeta.' m ON c.comment_ID = m.comment_ID WHERE c.comment_approved = 1 AND c.comment_author_email = %s AND m.meta_key = %s ORDER BY c.comment_ID DESC',$email,'cl_data');
515
- $rows = $wpdb->get_results($query);
516
- $num_comments = $wpdb->num_rows;
517
- // get other comments and links left
518
- $appeared_on = array();
519
- $appeared_on_list = array();
520
- $my_other_posts = array();
521
- $my_other_posts_list = array();
522
-
523
- if($rows){
524
- foreach($rows as $row){
525
- $data = unserialize($row->meta_value);
526
- if(!in_array($data['cl_post_url'],$my_other_posts_list) && sizeof($my_other_posts) < 5){
527
- $my_other_posts[] = '<a target="_blank" href="'.$data['cl_post_url'].'">'.esc_js(substr($data['cl_post_title'],0,60)).'</a>';
528
- $my_other_posts_list[] = $data['cl_post_url'];
529
- }
530
- if(!in_array($row->comment_post_ID,$appeared_on_list) && sizeof($appeared_on) < 5){
531
- $appeared_on[] = '<a href="'.get_permalink($row->comment_post_ID).'">'.substr(get_the_title($row->comment_post_ID),0,60).'</a>';
532
- $appeared_on_list[] = $row->comment_post_ID;
533
- }
534
- // stop if both lists at 5
535
- if(count($appeared_on) >= 5 && count($my_other_posts) >= 5){
536
- break;
537
- }
538
- }
539
- }
540
- if(empty($appeared_on)){
541
- $appeared_on[] = __('I have only commented on this post',$this->plugin_domain);
542
- }
543
- if(empty($my_other_posts)){
544
- $my_other_posts[] = '<a>'.__('If I had made more comments on this site, you would see more of my other posts here',$this->plugin_domain).'</a>';
545
- }
546
- // get click count on local site
547
- $data = get_comment_meta($cid,'cl_data',true);
548
- $clickcount = $data['clicks'] ? $data['clicks'] : 0;
549
- //DebugBreak();
550
- // prem member, try remote fetch of info if not registered on this blog
551
- if($cl_prem == 'p' && $isreg == false){
552
- $response = wp_remote_post($link,array('body'=>array('cl_request'=>'info','version'=>$this->version,'clickcount'=>$clickcount,'num_comments'=>$num_comments,'appeared_on'=>$appeared_on)));
553
- $enabled = wp_remote_retrieve_header($response,'cl_info');
554
- if($enabled == 'enabled'){
555
- $panel = apply_filters('kindergarten_html',wp_remote_retrieve_body($response));
556
- $json = json_encode(array('panel'=>$panel));
557
- header ( "Content-Type: application/x-javascript; " );
558
- echo $json;
559
- exit;
560
- } else {
561
- $cl_prem = 'u';
562
- }
563
- }
564
- // show registered members panel
565
- if($isreg){
566
- // get users info
567
- $bio = $user->description;
568
- if($bio == ''){
569
- $bio = __('User has not saved a description in their profile page',$this->plugin_domain);
570
- }
571
- $username = $user->display_name;
572
- if(is_multisite()){
573
- $can = 'manage_options';
574
- } else {
575
- $can = 'administrator';
576
- }
577
- // find if user has cap, need to create new user object and use ->has_cap
578
- // from wp 3.1, you can use if(user_can($user,$cap))
579
- $user = new WP_User($user->ID);
580
- if($user->has_cap($can)){
581
- $reg_member = __('is the administrator of this site',$this->plugin_domain);
582
- } else {
583
- $reg_member = __('is a registered member of my site',$this->plugin_domain);
584
- }
585
- $gravatar = '<img src="http://www.gravatar.com/avatar/' . md5 ( strtolower($email) ) . '.jpg" alt="' . $username . '" align="left" />';
586
- $panel = $gravatar . "<p class=\"cl_title\"><span class=\"cl_username\">$username</span> ".$reg_member."</p><p class=\"cl_bio\">$bio</p><p class=\"cl_clicks\"> <span class=\"cl_clicks_count\">$clickcount</span> ".__('Clicks on this link on this comment',$this->plugin_domain)."</p><p class=\"cl_links\">".$num_comments.' '.__('approved comments on this site',$this->plugin_domain).'<br>'.__('Some other posts I have commented on',$this->plugin_domain)."</p><p class=\"cl_links_list\">".implode('<br>',$appeared_on)."</p><p class=\"cl_posts\">".__('Some of my other posts',$this->plugin_domain)."</p><p class=\"cl_posts_list\">".implode('<br>',$my_other_posts)."</p>";
587
- $json = json_encode(array('panel'=>$panel));
588
- header ( "Content-Type: application/x-javascript; " );
589
- echo $json;
590
- exit;
591
- }
592
- // show panel for everyone else
593
- $comment = get_comment($cid);
594
- $msg = '';
595
- $bio= get_comment_author_url($cid);
596
- $name = get_comment_author($cid);
597
- $gravatar = '<img src="http://www.gravatar.com/avatar/' . md5 ( strtolower($email) ) . '.jpg" alt="' . $name . '" align="left" />';
598
- if(get_option('users_can_register')){
599
- $msg = __('has not registered on this site',$this->plugin_domain);
600
- $bio = $options['unreg_user_text_panel'];
601
- }
602
- $panel = $gravatar . "<p class=\"cl_title\">
603
- <span class=\"cl_username\">".$comment->comment_author."</span> ".$msg."</p>
604
- <p class=\"cl_bio\">".$bio."</p>
605
- <p class=\"cl_clicks\"> <span class=\"cl_clicks_count\">$clickcount</span> ".__('Clicks on this link on this comment',$this->plugin_domain)."</p>
606
- <p class=\"cl_links\">".$num_comments.' '.__('approved comments on this site',$this->plugin_domain).
607
- '<br>'.__('Some other posts I have commented on',$this->plugin_domain)."</p>
608
- <p class=\"cl_links_list\">".implode('<br>',$appeared_on)."</p>";
609
- // dont show other links for non registered user to entice them to register
610
- //<p class=\"cl_posts\">".__('Some of my other posts',$this->plugin_domain)."</p>
611
- //<p class=\"cl_posts_list\">".implode('<br>',$my_other_posts)."</p>";
612
- $json = json_encode(array('panel'=>$panel));
613
- header ( "Content-Type: application/x-javascript; " );
614
- echo $json;
615
- exit;
616
- }
617
- /**
618
- * called by add_filter('comments_array
619
- * adds the link to the comments that are to be displayed
620
- * @param mixed $commentarray
621
- */
622
- function do_shortcode($commentarray){
623
- $isadminpage = false;
624
- $options= $this->get_options();
625
- if(!is_array($commentarray)){
626
- // if it's an array then it was called by comments_array filter,
627
- // otherwise it was called by comment_content (admin screen)
628
- // has it been done before?
629
- if(strpos($commentarray,'class="cluv"')){
630
- return $commentarray;
631
- }
632
- // make a fake array of 1 object so below treats the comment_content filter nicely for admin screen
633
- $temparray = array('comment_ID'=>get_comment_ID(),'comment_content'=>$commentarray,'comment_author'=>get_comment_author(), 'comment_author_email'=>get_comment_author_email());
634
- $tempobject = (object) $temparray;
635
- $commentarray = array($tempobject);
636
- $isadminpage = true;
637
- }
638
- // add link to comments (need to do it this way so thesis works with commentluv links, thesis wont use comment_text filter but it does get an array of comments)
639
- $new_commentarray = array();
640
- foreach($commentarray as $comment){
641
- $data = get_comment_meta($comment->comment_ID,'cl_data','true');
642
- $commentcontent = $comment->comment_content;
643
- // luvlink added?
644
- if($data && is_array($data)){
645
- // luvlink was saved to meta, dofollow the link?
646
- $nofollow = ' rel="nofollow"';
647
- $isreg = get_user_by_email($comment->comment_author_email);
648
- if($options['dofollow'] == 'everybody'){
649
- $nofollow = '';
650
- } elseif ($options['dofollow'] == 'registered' && $isreg){
651
- $nofollow = '';
652
- }
653
- // construct link
654
- $pclass = $data['cl_prem'] == 'p' ? ' p' : '';
655
- $ajaxnonce = wp_create_nonce($comment->comment_ID);
656
- $class = ' class="'.$ajaxnonce.' '.$comment->comment_ID.$pclass.'"';
657
- $luvlink = '<a'.$class.$nofollow.' href="'.$data['cl_post_url'].'">'.$data['cl_post_title'].'</a>';
658
- $search = array ('[name]', '[lastpost]' );
659
- $replace = array ($comment->comment_author, $luvlink );
660
- $prepend_text = $options ['comment_text'];
661
- $inserted = str_replace ( $search, $replace, $prepend_text );
662
- // construct string to be added to comment
663
- $commentcontent .= "\n<span class=\"cluv\">$inserted";
664
- // prepare heart icon if infopanel is on
665
- $hearticon = '';
666
- if($data['cl_prem'] == 'p' || $isreg) {
667
- // use PLUS heart for members
668
- $hearticon = 'plus';
669
- }
670
- if ($options ['infopanel'] == 'on') {
671
- $commentcontent .= '<span class="heart_tip_box"><img class="heart_tip '.$data['cl_prem'].' '.$comment->comment_ID.'" alt="My Profile" style="border:0" width="16" height="14" src="' . $this->plugin_url . 'images/littleheart'.$hearticon.'.gif"/></span>';
672
- }
673
- $commentcontent.= '</span>';
674
- }
675
- // store new content in this comments comment_content cell
676
- $comment->comment_content = $commentcontent;
677
- // fill new array with this comment
678
- $new_commentarray[] = $comment;
679
- }
680
- // admin page or public page?
681
- if($isadminpage){
682
- // is being called by comment_text filter so expecting just content
683
- return $commentcontent;
684
- } else {
685
- // called from comments_array filter so expecting array of objects
686
- return $new_commentarray;
687
- }
688
- }
689
- /**
690
- * called by do_ajax())
691
- * takes action when ajax request is made with URL from the comment form
692
- * send back 1 or 10 last posts depending on rules
693
- */
694
- function fetch_feed(){
695
- // check nonce
696
- check_ajax_referer('fetch');
697
- define('DOING_AJAX', true);
698
- include_once(ABSPATH.WPINC.'/class-simplepie.php');
699
- $options = $this->get_options();
700
- $num = 1;
701
- $url = strip_tags($_POST['url']);
702
- // fetch 10 last posts?
703
- if((is_user_logged_in() && $options['whogets'] == 'registered') || (!is_user_logged_in() && $options['whogets'] == 'everybody')){
704
- $num = 10;
705
- } elseif($options['whogets'] == 'everybody') {
706
- $num = 10;
707
- } elseif(current_user_can('manage_options')){
708
- $num = 10;
709
- }
710
- // check if request is for the blog we're on
711
- if(strstr($url, home_url())){
712
- //DebugBreak();
713
- $posts = get_posts(array('numberposts'=>10));
714
- $return = array();
715
- $error = '';
716
- if($posts){
717
- foreach($posts as $post){
718
- $return[] = array('type'=>'blog','title'=>$post->post_title,'link'=>get_permalink($post->ID),'p'=>'u');
719
- }
720
- } else {
721
- $error = __('Could not get posts for home blog',$this->plugin_domain);
722
- }
723
-
724
- $response = json_encode(array('error'=>$error,'items'=>$return));
725
- header( "Content-Type: application/json" );
726
- echo $response;
727
- exit;
728
- }
729
- // get simple pie ready
730
- $rss = new SimplePie();
731
- $rss->set_useragent('Commentluv /'.$this->version.' (Feed Parser; http://www.commentluv.com; Allow like Gecko) Build/20110502' );
732
- $rss->set_feed_url ( $url );
733
- $rss->enable_cache ( FALSE );
734
- // fetch the feed
735
- $rss->init();
736
- $rss->handle_content_type();
737
- $gen = $rss->get_channel_tags('','generator');
738
- $prem_msg = $rss->get_channel_tags('','prem_msg');
739
- $g = $num;
740
- $p = 'u';
741
- $meta = array();
742
- //DebugBreak();
743
- if($gen && strstr($gen[0]['data'],'commentluv')){
744
- $generator = $gen[0]['data'];
745
- $meta['generator'] = $generator;
746
- $pos=stripos($generator,'v=');
747
- if(substr($generator,$pos+2,1)=='3'){
748
- $g=15;
749
- $p='p';
750
- }
751
- }
752
- if($prem_msg){
753
- $prem_msg = $prem_msg[0]['data'];
754
- }
755
- //DebugBreak();
756
- $error = $rss->error();
757
- $meta['used_feed'] = $rss->subscribe_url();
758
- //DebugBreak();
759
- // no error, construct return json
760
- if(!$error){
761
-
762
- $arr = array();
763
-
764
- // save meta
765
- $meta['used_feed'] = $rss->subscribe_url ();
766
-
767
- $feed_items = $rss->get_items();
768
- foreach($feed_items as $item){
769
- $type = 'blog';
770
- $itemtags = $item->get_item_tags('','type');
771
- if($itemtags){
772
- $type = $itemtags[0]['data'];
773
- }
774
- $arr[] = array('type'=>$type,'title'=>$item->get_title(),'link'=>$item->get_permalink(),'p'=>$p);
775
- $g--;
776
- if($g < 1){
777
- break;
778
- }
779
- }
780
- // add message to unregistered user if set
781
- if(!is_user_logged_in() && $options['unreg_user_text'] && $options['whogets'] != 'everybody' && $p=='u'){
782
- if(get_option('users_can_register')){
783
- $arr[] = array('type'=>'message','title'=>$options['unreg_user_text'],'link'=>'');
784
- if(!strstr($options['unreg_user_text'],'action=register')){
785
- $register_link = apply_filters('register','<a href="' . site_url('wp-login.php?action=register', 'login') . '">' . __('Register') . '</a>');
786
- $arr[] = array('type'=>'message','title'=>$register_link,'link'=>'');
787
- }
788
- }
789
- if($options['whogets'] == 'registered' && get_option('users_can_regsiter')){
790
- $arr[] = array('type'=>'message','title'=>__('If you are registered, you need to log in to get 10 posts to choose from',$this->plugin_domain),'link'=>'');
791
- }
792
- }
793
- if($prem_msg){
794
- $arr[] = array('type'=>'alert','title'=>$prem_msg,'link'=>'');
795
- }
796
- $response = json_encode(array('error'=>'','items'=>$arr,'meta'=>$meta));
797
- } else {
798
- // had an error trying to read the feed
799
- $response = json_encode(array('error'=>$error,'meta'=>$meta));
800
- }
801
- unset($rss);
802
- header( "Content-Type: application/json" );
803
- echo $response;
804
- exit;
805
- }
806
- /** get_options
807
- * This function sets default options and handles a reset to default options
808
- * @param string $reset = 'no' - whether to return default settings
809
- * return array
810
- */
811
- function get_options($reset = 'no') {
812
- // see if we offer registration incentive
813
- $register_link = '';
814
- if(get_option('users_can_register')){
815
- $register_link = apply_filters('register','<a href="' . site_url('wp-login.php?action=register', 'login') . '">' . __('Register') . '</a>');
816
- }
817
- // default values
818
- $default = array ('version'=>$this->version,'enable'=>'yes','enable_for'=>'both', 'default_on' => 'on', 'default_on_admin'=>'on',
819
- 'badge_choice' => 'drop_down', 'badge_type'=>'default', 'link'=>'off','infopanel'=>'on', 'infoback'=>'white', 'infotext'=>'black',
820
- 'comment_text'=>'[name] '.__('recently posted',$pd).'..[lastpost]', 'whogets'=>'registered', 'dofollow' => 'registered',
821
- 'unreg_user_text'=>__('If you register as a user on my site, you can get your 10 most recent blog posts to choose from in this box.',$this->plugin_domain).' '.$register_link,
822
- 'unreg_user_text_panel'=>__('If this user had registered to my site then they could get 10 last posts to choose from when they comment and you would be able to see a list of their recent posts in this panel',$this->plugin_domain),
823
- 'template_insert'=>'','minifying'=>'','api_url'=>admin_url('admin-ajax.php'),'author_name'=>'author','email_name'=>'email','url_name'=>'url','comment_name'=>'comment');
824
- $options = get_option ( $this->db_option, $default);
825
- // return the options
826
- if($reset == 'yes'){
827
- return $default;
828
- }
829
- if(!$options['api_url']){
830
- $options['api_url'] = admin_url('admin-ajax.php');
831
- }
832
- return $options;
833
- }
834
- /** handle_load_domain
835
- * This function loads the localization files required for translations
836
- * It expects there to be a folder called /lang/ in the plugin directory
837
- * that has all the .mo files
838
- */
839
- function handle_load_domain() {
840
- // get current language
841
- $locale = get_locale ();
842
- // locate translation file
843
- $mofile = WP_PLUGIN_DIR . '/' . plugin_basename ( dirname ( __FILE__ ) ) . '/lang/' . $this->plugin_domain . '-' . $locale . '.mo';
844
- // load translation
845
- load_textdomain ( $this->plugin_domain, $mofile );
846
- }
847
- /** init
848
- * This function registers styles and scripts
849
- */
850
- function init(){
851
- wp_register_style( 'commentluv_style',$this->plugin_url.'css/commentluv.css' );
852
- wp_register_script( 'commentluv_script', $this->plugin_url.'js/commentluv.js',array('jquery') );
853
- }
854
- /** install
855
- * This function is called when the plugin activation hook is fired when
856
- * the plugin is first activated or when it is auto updated via admin.
857
- * use it to make any changes needed for updated version or to add/check
858
- * new database tables on first install.
859
- */
860
- function install(){
861
- $options = $this->get_options();
862
- if(!$installed_version = get_option('cl_version')){
863
- // no installed version yet, set to version that was before big change
864
- $installed_version = 2.8;
865
- } else {
866
- // convert existing version to php type version number
867
- $installed_version = $this->php_version($installed_version);
868
- }
869
- // for version before 2.9
870
- if(version_compare($installed_version,'2.9','<')){
871
- // make any changes to this new versions options if needed and update
872
- update_option($this->db_option,$this->get_options('yes'));
873
- update_option('cl_version',$this->version);
874
- }
875
- // new addition to technical settings after 2.90.1 release
876
- if(version_compare($installed_version,'2.9.0.1','<')){
877
- $options['api_url'] = admin_url('admin-ajax.php');
878
- update_option($this->db_option,$options);
879
- update_option('cl_version',$this->version);
880
- }
881
- }
882
- /**
883
- * helper function called by mulitple functions
884
- * used to determine if commentluv is enabled
885
- */
886
- function is_enabled(){
887
- $options = $this->get_options();
888
- // see if we need to add here or not
889
- if(($options['enable_for'] == 'posts' && is_page()) || ($options['enable_for'] == 'pages' && !is_page())){
890
- return false;
891
- }
892
- if($options['enable'] != 'yes'){
893
- return false;
894
- }
895
- return true;
896
- }
897
- /**
898
- * called by apply_filter('kindergarten_html
899
- * Used to clean $input to only allow a kiddy set of html tags
900
- *
901
- * @param string $input - the string to be cleaned
902
- * @return string
903
- */
904
- function kindergarten_html($input){
905
- $allowedtags = array(
906
- 'h1' => array(),
907
- 'br' => array(),
908
- 'a' => array('href' => array(),'title' => array(),'rel' => array(),'target'=>array(), 'class'=>array()),
909
- 'small' =>array(),
910
- 'p' =>array( 'class'=>array()),
911
- 'strong' => array(),
912
- 'img' => array('src' => array(),'alt' => array(),'width' => array(),'height' => array(),'align'=> array()),
913
- 'span' => array('class'=>array())
914
- );
915
- return wp_kses($input,$allowedtags);
916
- }
917
- /**
918
- * Ajax handler for the subscribe button on the settings page.
919
- * called by add_action ( 'wp_ajax_notify_signup'
920
- */
921
- function notify_signup(){
922
- //DebugBreak();
923
- global $current_user;
924
- $email = $current_user->user_email;
925
- $firstname = $current_user->first_name;
926
- if(!$firstname){
927
- $firstname = $current_user->user_nicename;
928
- }
929
- $message = "\n Email: ".$email."\n\n Name: ".$firstname."\n\n Meta: settings_page_289"."\n\n";
930
- $to = 'cl_notify29@aweber.com';
931
- $headers = 'From: '.$firstname.' <'.$email.'>'."\r\n\\";
932
- $mail = wp_mail($to,'cl_notify',$message,$headers);
933
- if($mail === true){
934
- $options = $this->get_options();
935
- $options['subscribed'] = true;
936
- update_option($this->db_option,$options);
937
- }
938
- $return = array('success'=>$mail,'email'=>$email);
939
- // return response
940
- $response = json_encode($return);
941
- // response output
942
- header( "Content-Type: application/json" );
943
- echo $response;
944
- // IMPORTANT: don't forget to "exit"
945
- exit;
946
- }
947
- /** options_sanitize
948
- * This is the callback function for when the settings get saved, use it to sanitize options
949
- * it is called by the callback setting of register_setting in admin_init
950
- * @param mixed $options - the options that were POST'ed
951
- * return mixed $options
952
- */
953
- function options_sanitize($options){
954
- //DebugBreak();
955
- $old_options = $this->get_options();
956
- // if not enabled, only save that so other settings remain unchanged
957
- if($options['enable'] == 'no'){
958
- $old_options['enable'] = 'no';
959
- return $old_options;
960
- }
961
- // check for reset
962
- if($options['reset'] == 'yes'){
963
- return $this->get_options('yes');
964
- }
965
- // if on multisite and this isnt super admin saving,
966
- // only allow kindergarten html.
967
- if(is_multisite() && !is_super_admin()){
968
- foreach($options as $key => $option){
969
- $options[$key] = apply_filters('kindergarten_html',$option);
970
- }
971
- }
972
- return $options;
973
- }
974
- /**
975
- * converts a string into a php type version number
976
- * eg. 2.81.2 will become 2.8.1.2
977
- * used to prepare a number to be used with version_compare
978
- *
979
- * @param mixed $string - the version to be converted to php type version
980
- * @return string
981
- */
982
- function php_version($string){
983
- if(empty($string)){
984
- return;
985
- }
986
- $version = str_replace('.','',$string);
987
- $std = array();
988
- for($i=0; $i < strlen($version); $i++){
989
- $std[] = $version[$i];
990
- }
991
- $php_version = implode('.',$std);
992
- return $php_version;
993
- }
994
- /** commentluv_action
995
- * This function adds a link to the settings page for the plugin on the plugins listing page
996
- * it is called by add filter plugin_action_links
997
- * @param $links - the links being filtered
998
- * @param $file - the name of the file
999
- * return array - the new array of links
1000
- */
1001
- function plugin_action_link($links, $file) {
1002
- $this_plugin = plugin_basename ( __FILE__ );
1003
- if ($file == $this_plugin) {
1004
- $links [] = "<a href='options-general.php?page={$this->slug}'>" . __ ( 'Settings', $this->plugin_domain ) . "</a>";
1005
- }
1006
- return $links;
1007
- }
1008
- /**
1009
- * Detects if a commentluv api or plugin is requesting a feed
1010
- * and sends back an xml feed of the post titles and links that were found for the query
1011
- * called by add_filter('found_posts' so we always have the posts found for the requested category/author/tag/ etc
1012
- * @param (int) $foundposts - the number of posts that were found
1013
- * @param (obj) $object - the query object
1014
- * @return $foundposts - need to return this if the request is not from a commentluv api or plugin
1015
- */
1016
- function send_feed($foundposts,$object){
1017
- if(headers_sent()){
1018
- return $foundposts;
1019
- }
1020
- $error = false;
1021
- if($foundposts < 1){
1022
- $error = true;
1023
- }
1024
- $options = $this->get_options();
1025
- $enabled = $options['enable'];
1026
- // General checking
1027
- if (preg_match("/Commentluv/i", $_SERVER['HTTP_USER_AGENT'])) {
1028
- $feed = '<?xml version="1.0" encoding="'.get_bloginfo('charset').'" ?>
1029
- <rss version="2.0">
1030
- <channel>
1031
- <title><![CDATA['. get_bloginfo('title') .']]></title>
1032
- <link>'. get_bloginfo('home') .'</link>
1033
- <description><![CDATA['. get_bloginfo('description') .']]></description>
1034
- <language>'.get_bloginfo('language').'</language>
1035
- <generator>commentluv?v='.$this->version.'</generator>
1036
- <commentluv>'.$enabled.'</commentluv>
1037
- <success>'.$error.'</success>';
1038
- if($object->posts){
1039
- foreach($object->posts as $post){
1040
- $feed .= '<item><title><![CDATA['.get_the_title($post->ID).']]></title>
1041
- <link>'.get_permalink($post->ID).'</link>
1042
- <type>blog</type>
1043
- </item>';
1044
- }
1045
- } else {
1046
- $feed .= '<item><title>'.__('No Posts Were Found!',$pd).'</title>
1047
- <link>'.get_permalink($post->ID).'</link>
1048
- </item>';
1049
- }
1050
- $feed .= '</channel></rss>';
1051
- header("Content-Type: application/xml; charset=".get_bloginfo('charset'));
1052
- echo $feed;
1053
- exit;
1054
- }
1055
- return $foundposts;
1056
- }
1057
- /**
1058
- * called by __construct
1059
- * used to setup hooks and filters for enabled plugin
1060
- */
1061
- function setup_hooks(){
1062
- add_action ( 'comment_form',array(&$this,'add_fields')); // add fields to form
1063
- add_action ( 'wp_print_styles',array(&$this,'add_style')); // add style
1064
- add_action ( 'template_redirect',array(&$this,'add_script')); // add commentluv script
1065
- add_action ( 'admin_print_scripts-edit-comments.php', array (&$this, 'add_removeluv_script') ); // add the removeluv script to admin page
1066
- add_action ( 'wp_footer',array(&$this,'add_footer')); // add localize to footer
1067
- add_action ( 'wp_ajax_removeluv', array (&$this, 'ajax_remove_luv') ); // handle the call to the admin-ajax for removing luv
1068
- add_action ( 'wp_ajax_nopriv_cl_ajax',array(&$this,'do_ajax'));
1069
- add_action ( 'wp_ajax_cl_ajax',array(&$this,'do_ajax'));
1070
- add_action ( 'wp_insert_comment', array (&$this, 'comment_posted'),1,2); // add member id and other data to comment meta priority 1, 2 vars
1071
-
1072
- add_filter ( 'comments_array', array (&$this, 'do_shortcode' ), 1 ); // add last blog post data to comment content
1073
- add_filter ( 'comment_text', array (&$this, 'do_shortcode' ), 1 ); // add last blog post data to comment content on admin screen
1074
- add_filter ( 'comment_row_actions', array (&$this,'add_removeluv_link')); // adds a link to remove the luv from a comment on the comments admin screen
1075
- }
1076
- /**
1077
- * called by add_action('admin_notices in admin_init()
1078
- * Used to show a notice if there is a new version of CommentLuv available
1079
- */
1080
- function show_upgrade_notice(){
1081
- $options = $this->get_options();
1082
- echo '<div id="clupgrade" class="error">';
1083
- if($options['upgrade_message']){
1084
- echo $options['upgrade_message'];
1085
- } else {
1086
- echo __('There is a new version of Commentluv available, please upgrade by visiting this site',$this->plugin_domain);
1087
- echo '<br><a href="http://www.commentluv.com" target="_blank">www.commentluv.com</a>';
1088
- }
1089
- echo '<span style="float:right"><a href="'.admin_url('options-general.php?page='.$this->slug.'&dismiss=true').'">'.__('Dismiss notice',$this->plugin_domain).'</a></span>';
1090
- echo '</div>';
1091
- }
1092
-
1093
- /** options_page
1094
- * This function shows the page for saving options
1095
- * it is called by add_options_page
1096
- * You can echo out or use further functions to display admin style widgets here
1097
- */
1098
- function options_page(){
1099
- $o = $this->get_options();
1100
- $dbo = $this->db_option;
1101
- $pd = $this->plugin_domain;
1102
- $badges = array('default'=>'CL91_default.png','white'=>'CL91_White.gif','black'=>'CL91_Black.gif','none'=> 'nothing.gif');
1103
- //DebugBreak();
1104
- // remove notice if requested
1105
- if(isset($_GET['dismiss'])){
1106
- unset($o['upgrade']);
1107
- if(array_key_exists('upgrade_message',$o)){
1108
- unset($o['upgrade_message']);
1109
- }
1110
- update_option($this->db_option,$o);
1111
- echo '<script>jQuery("#clupgrade").hide()</script>';
1112
- }
1113
-
1114
- ?>
1115
- <div class="wrap">
1116
- <h2><?php _e('CommentLuv Settings v',$this->plugin_domain);?><?php echo $this->version;?></h2>
1117
- <div id="poststuff" style="margin-top:10px; width: 965px;">
1118
- <div id="mainblock" style="float: left; width:710px">
1119
- <form method="post" action="options.php">
1120
- <?php settings_fields( 'commentluv_options_group' ); // the name given in admin init
1121
- // after here, put all the inputs and text fields needed
1122
- ?>
1123
- <div class="dbx-content">
1124
- <table class="widefat">
1125
- <thead>
1126
- <tr><th scope="col"><?php _e('Important!',$pd);?></th><th><?php _e('Subscription Information',$pd);?></th></tr>
1127
- </thead>
1128
- <tbody>
1129
- <tr>
1130
- <td width="250">
1131
- <h2 style="margin: 0 0 10px 0;"><?php _e('CommentLuv 3.0 Premium is coming soon!',$pd);?></h2>
1132
- <img align="left" src="<?php echo $this->plugin_url;?>images/privacy-guarantee.png"/><?php _e('I promise not to sell your details or send you spam. You will ONLY receive emails about plugin updates.',$pd);?>
1133
- </td>
1134
- <td>
1135
- <p><?php _e('There is a premium version of CommentLuv coming that will have much more control of how the plugin works as well as exclusive features like keyword name, inline registration and much much more!. Signup to find out as soon as it is ready',$pd);?></p>
1136
- <?php
1137
- if($o['subscribed']){
1138
- echo '<div class="submit">'.__('You have already subscribed, if you have not received the verification within 12 hours, please click the button to resend or try the form at',$pd).' <a target="_blank" href="http://www.commentluv.com/">www.commentluv.com</a><br><input style="margin:0 auto; display: block;" type="button" id="cl_notify" value="'.__('Resend Verification',$pd).'"/></div>';
1139
- } else {
1140
- echo '<div class="submit" style=" background-color: green; padding-left: 5px; padding-right: 5px; border-radius: 15px; -moz-border-radius: 15px; text-align: center;"><input style="margin: 0 auto; display:block" id="cl_notify" type="button" name="cl_notify" value="'.__('Click to register now!',$pd).'" /></div>';
1141
- }
1142
- ?>
1143
- <div id="notify_message"></div>
1144
- </td>
1145
- </tr>
1146
- </tbody>
1147
- </table>
1148
-
1149
-
1150
- <br/>
1151
-
1152
-
1153
- <table class="widefat">
1154
- <thead>
1155
- <tr><th><?php _e('Primary Setting',$pd);?></th><th colspan="3"></th><th style="text-align: center;"><?php _e('Help Video',$pd);?></th></tr>
1156
- </thead>
1157
- <tbody>
1158
- <tr>
1159
- <td colspan="2" style="width: 40%; vertical-align: middle; text-align: center; font-size: 1.3em; font-weight: bolder;"><label for="<?php echo $dbo;?>[enable]"><?php _e('Enable CommentLuv?',$pd);?></label></td>
1160
- <td style="width:20%; vertical-align: middle; font-size: 1.3em;"><input class="clenable" type="radio" name="<?php echo $dbo;?>[enable]" value="yes" <?php checked($o['enable'],'yes');?>/><?php _e('Yes',$pd);?></td>
1161
- <td style="width:20%; vertical-align: middle; font-size: 1.3em;"><input class="clenable" type="radio" name="<?php echo $dbo;?>[enable]" value="no" <?php checked($o['enable'],'no');?>/><?php _e('No',$pd);?></td>
1162
- <td style="text-align: center; border: 2px dotted;"><a onclick="return false;" href="<?php echo $this->plugin_url . 'videos/'; ?>primarysettings.php?KeepThis=true&amp;TB_iframe=true&amp;height=355&width=545" class="thickbox"><img src="<?php echo $this->plugin_url;?>images/playbuttonsmall.png"/></a></td>
1163
- </tr>
1164
- <tr class="ifenable">
1165
- <td style="text-align: center;" colspan="5">
1166
- <input type="radio" name="<?php echo $dbo;?>[enable_for]" value="posts" <?php checked($o['enable_for'],'posts');?>/><?php _e('On Posts',$pd);?>
1167
- <input style="margin-left: 100px;" type="radio" name="<?php echo $dbo;?>[enable_for]" value="pages" <?php checked($o['enable_for'],'pages');?>/><?php _e('On Pages',$pd);?>
1168
- <input style="margin-left: 100px;" type="radio" name="<?php echo $dbo;?>[enable_for]" value="both" <?php checked($o['enable_for'],'both');?>/><?php _e('On Both',$pd);?>
1169
- </td>
1170
- </tr>
1171
- <tr class="ifenable">
1172
- <td style="text-align: center;" colspan="2">
1173
- <input type="checkbox" name="<?php echo $dbo;?>[default_on]" <?php checked($o['default_on'],'on');?> value="on"/> <label for="<?php echo $dbo;?>[default_on]"><?php _e('On by default?',$pd);?></label>
1174
- </td>
1175
- <td></td>
1176
- <td style="text-align: center;" colspan="2">
1177
- <input type="checkbox" name="<?php echo $dbo;?>[default_on_admin]" <?php checked($o['default_on_admin'],'on');?> value="on"/><label for="<?php echo $dbo;?>[default_on_admin]"> <?php _e('On for admin?',$pd);?></label>
1178
- </td>
1179
- </tr>
1180
- </tbody>
1181
- </table>
1182
-
1183
-
1184
- <br>
1185
-
1186
-
1187
- <table class="widefat ifenable display-settings">
1188
- <thead>
1189
- <tr><th><?php _e('Appearance',$pd);?></th><th colspan="3"></th><th style="text-align: center;"><?php _e('Help Video',$pd);?></th></tr>
1190
- </thead>
1191
- <tbody>
1192
- <tr>
1193
- <td><h3><label for="<?php echo $dbo;?>[badge_choice]"><?php _e('Badge',$pd);?></label></h3></td>
1194
- <td><h3><label for="<?php echo $dbo;?>[badge_choice]"><?php _e('Custom Image URL',$pd);?></label></h3></td>
1195
- <td><h3><label for="<?php echo $dbo;?>[badge_choice]"><?php _e('Use Text',$pd);?></label></h3></td>
1196
- <td></td>
1197
- <td></td>
1198
- </tr>
1199
- <tr>
1200
- <td>
1201
- <input type="radio" class="radio" name="<?php echo $dbo;?>[badge_choice]" value="drop_down" <?php checked($o['badge_choice'],'drop_down');?>/>
1202
- <select id="badge_type" name="<?php echo $dbo;?>[badge_type]">
1203
- <option value="default" <?php selected($o['badge_type'],'default');?>><?php _e('Default',$pd);?></option>
1204
- <option value="white" <?php selected($o['badge_type'],'white');?>><?php _e('White',$pd);?></option>
1205
- <option value="black" <?php selected($o['badge_type'],'black');?>><?php _e('Black',$pd);?></option>
1206
- <option value="none" <?php selected($o['badge_type'],'none');?>><?php _e('None',$pd);?></option>
1207
- </select>
1208
- <p style="margin: 8px 0px 0px 8px;"><img id="display_badge" style="border: 1px solid #000; padding: 3px;" src="<?php echo $this->plugin_url;?>images/<?php echo $badges[$o['badge_type']];?>"/></p>
1209
- </td>
1210
- <td>
1211
- <input type="radio" class="radio" name="<?php echo $dbo;?>[badge_choice]" value="custom" <?php checked($o['badge_choice'],'custom');?>/>
1212
- <input type="text" name="<?php echo $dbo;?>[custom_image_url]" value="<?php echo $o['custom_image_url'];?>"/>
1213
- <?php
1214
- if($o['custom_image_url'] != ''){
1215
- // show image
1216
- echo '<p style="margin: 8px 0px 0px 8px;"><img id="custom_badge" style="border: 1px solid #000; padding: 3px;" src="'.$o['custom_image_url'].'"/></p>';
1217
- } ?>
1218
- </td>
1219
- <td>
1220
-
1221
- <input type="radio" class="radio" name="<?php echo $dbo;?>[badge_choice]" value="text" <?php checked($o['badge_choice'],'text');?>/>
1222
- <input type="text" name="<?php echo $dbo;?>[badge_text]" value="<?php echo $o['badge_text'];?>"/>
1223
- <p style="margin: 8px 0px 0px 8px;"><input type="checkbox" name="<?php echo $dbo;?>[link]" value="on" <?php checked($o['link'],'on');?>/> <label for="<?php echo $dbo;?>[link]"><?php _e('Link to Commentluv?',$pd);?></label>
1224
- </td>
1225
- <td></td>
1226
- <td style="text-align: center; border: 2px dotted; width:125px"><a onclick="return false;" href="<?php echo $this->plugin_url . 'videos/'; ?>appearancesettings.php?KeepThis=true&amp;TB_iframe=true&amp;height=355&width=545" class="thickbox"><img src="<?php echo $this->plugin_url;?>images/playbuttonsmall.png"/></a></td>
1227
- </tr>
1228
-
1229
- <tr>
1230
- <td><br><input type="checkbox" name="<?php echo $dbo;?>[infopanel]" <?php checked($o['infopanel'],'on');?> value="on"/><label for="<?php echo $dbo;?>[infopanel]"> <?php _e('Enable info panel?',$pd);?></label></td>
1231
- <td><label for="<?php echo $dbo;?>[infoback]"><?php _e('Info panel background color',$pd);?></label><br><input type="text" size="6" name="<?php echo $dbo;?>[infoback];?>" value="<?php echo $o['infoback'];?>"/></td>
1232
- <td><label for="<?php echo $dbo;?>[infotext]"><?php _e('Info panel text color',$pd);?></label><br><input type="text" size="6" name="<?php echo $dbo;?>[infotext];?>" value="<?php echo $o['infotext'];?>"/></td>
1233
- <td></td>
1234
- <?php
1235
- $tdstyle = '"border: 1px solid #dfdfdf; vertical-align: middle; text-align: center; background-color: '.$o['infoback'].'"';
1236
- $spanstyle = '"color: '.$o['infotext'].'"';
1237
- ?>
1238
- <td style=<?php echo $tdstyle;?>><span style=<?php echo $spanstyle;?>><?php _e('Example text and background color',$pd);?></span></td>
1239
- </tr>
1240
- </tbody>
1241
- </table>
1242
-
1243
- <br>
1244
-
1245
- <table class="widefat ifenable messages">
1246
- <thead>
1247
- <tr>
1248
- <th colspan="2"><?php _e('Messages',$pd);?></th><th scope="col"></th><th></th><th style="text-align: center;"><?php _e('Help Video',$pd);?></th>
1249
-
1250
- </tr>
1251
- </thead>
1252
- <tbody>
1253
- <tr>
1254
- <td colspan="2">
1255
- <label for="<?php echo $dbo;?>[comment_text]"><?php _e('Text to be displayed in the comment',$pd);?></label>
1256
- <br><input type="text" style="width: 95%" name="<?php echo $dbo;?>[comment_text]" value="<?php echo htmlentities($o['comment_text']);?>"/>
1257
- </td>
1258
- <td style="border: 1px dashed #dfdfdf;"><?php _e('[name] = The users name',$this->plugin_domain);?><br><?php _e('[lastpost] = The last blog post link',$this->plugin_domain);?></td>
1259
- <td>&nbsp;</td>
1260
- <td style="text-align: center; border: 2px dotted; width:125px"><a onclick="return false;" href="<?php echo $this->plugin_url . 'videos/'; ?>messagessettings.php?KeepThis=true&amp;TB_iframe=true&amp;height=355&width=545" class="thickbox"><img src="<?php echo $this->plugin_url;?>images/playbuttonsmall.png"/></a></td>
1261
- </tr>
1262
- <tr>
1263
- <td colspan="3">
1264
-
1265
- <?php _e('Message for unregistered user in the drop down box',$pd);?>
1266
- <br>(<?php _e('Message will not be shown if you do not have registrations enabled',$this->plugin_domain);?>)
1267
- <br><textarea rows="5" style="width: 95%" name="<?php echo $dbo;?>[unreg_user_text]"><?php echo htmlentities($o['unreg_user_text']);?></textarea>
1268
- <?php
1269
- if(get_option('users_can_register')){
1270
- _e('Your register link code',$pd);
1271
- echo '<br>';
1272
- _e('(this will be automatically added if you have not added it yourself to the textarea above)',$pd);
1273
- $register_link = apply_filters('register','<a href="' . site_url('wp-login.php?action=register', 'login') . '">' . __('Register') . '</a>');
1274
- echo ' : <input style="width:95%" type="text" value="'.htmlentities($register_link).'" disabled/>';
1275
- }
1276
- ?>
1277
- </td>
1278
- <td colspan="2" style="width:125px;">
1279
- <?php // show warning if registration is not enabled
1280
- if(!get_option('users_can_register')){
1281
- echo '<div style="border: 2px dashed red;">';
1282
- _e('You have NOT set your blog to allow registrations, you can do that in Settings/General',$pd);
1283
- echo ' <a href="'.admin_url('options-general.php').'">'.__('here',$pd).'</a>';
1284
- echo '</div>';
1285
- }
1286
- ?>
1287
- </td>
1288
- </tr>
1289
- <tr>
1290
- <td colspan="3">
1291
- <?php _e('Message for unregistered user in the info panel',$pd);?>
1292
- <br>(<?php _e('Message will not be shown if you do not have registrations enabled',$this->plugin_domain);?>)
1293
- <br><textarea rows="5" style="width:95%;" name="<?php echo $dbo;?>[unreg_user_text_panel]"><?php echo htmlentities($o['unreg_user_text_panel']);?></textarea>
1294
- </td>
1295
- <td></td>
1296
- <td></td>
1297
- </tr>
1298
- </tbody>
1299
- </table>
1300
-
1301
- <br>
1302
-
1303
- <table class="widefat ifenable operational-settings">
1304
- <thead>
1305
- <tr>
1306
- <th colspan="2"><?php _e('Operational Settings',$pd);?></th><th scope="col"></th><th></th><th style="text-align: center;"><?php _e('Help Video',$pd);?></th>
1307
-
1308
- </tr>
1309
- </thead>
1310
- <tbody>
1311
- <tr>
1312
- <td colspan="4">
1313
- <?php _e('Who to give 10 last posts to choose from when they comment?',$pd);?>
1314
- <p><input type="radio" name="<?php echo $dbo;?>[whogets]" value="registered" <?php checked($o['whogets'],'registered');?>/> <label for="<?php echo $dbo;?>[whogets]"><?php _e('Only Registered Members',$pd);?></label>
1315
- <input style="margin-left: 25px;" type="radio" name="<?php echo $dbo;?>[whogets]" value="everybody" <?php checked($o['whogets'],'everybody');?>/> <label for="<?php echo $dbo;?>[whogets]"><?php _e('Everybody',$pd);?></label>
1316
- <input style="margin-left: 25px;" type="radio" name="<?php echo $dbo;?>[whogets]" value="nobody" <?php checked($o['whogets'],'nobody');?>/> <label for="<?php echo $dbo;?>[whogets]"><?php _e('Nobody',$pd);?></label>
1317
-
1318
- </td>
1319
- <td style="text-align: center; border: 2px dotted; width:125px"><a onclick="return false;" href="<?php echo $this->plugin_url . 'videos/'; ?>operationalsettings.php?KeepThis=true&amp;TB_iframe=true&amp;height=355&width=545" class="thickbox"><img src="<?php echo $this->plugin_url;?>images/playbuttonsmall.png"/></a></td>
1320
- </tr>
1321
- <tr>
1322
- <td colspan="5">
1323
- <?php _e('Whose links should be dofollow?',$pd);?>
1324
- <p><input type="radio" name="<?php echo $dbo;?>[dofollow]" value="registered" <?php checked($o['dofollow'],'registered');?>/> <label for="<?php echo $dbo;?>[whogets]"><?php _e('Only Registered Members Links',$pd);?></label>
1325
- <input style="margin-left: 25px;" type="radio" name="<?php echo $dbo;?>[dofollow]" value="everybody" <?php checked($o['dofollow'],'everybody');?>/> <label for="<?php echo $dbo;?>[whogets]"><?php _e('Everybody gets dofollow links',$pd);?></label>
1326
- <input style="margin-left: 25px;" type="radio" name="<?php echo $dbo;?>[dofollow]" value="nobody" <?php checked($o['dofollow'],'nobody');?>/> <label for="<?php echo $dbo;?>[whogets]"><?php _e('Nobody gets dofollow links',$pd);?></label>
1327
- </td>
1328
- </tr>
1329
- </tbody>
1330
- </table>
1331
-
1332
- <br>
1333
-
1334
- <table class="widefat ifenable technical" style="border: 3px solid red">
1335
- <thead>
1336
- <tr>
1337
- <th colspan="2"><?php _e('Technical Settings',$pd);?></th><th scope="col"><span id="opentech" style="color: blue; cursor: pointer;"><?php _e('Click to open technical settings',$pd);?></span></th><th></th><th style="text-align: center;"><?php _e('Help Video',$pd);?></th>
1338
-
1339
- </tr>
1340
- </thead>
1341
- <tbody id="techbody" style="display:none">
1342
- <tr>
1343
- <td colspan="4">
1344
- <h3><?php _e('Please check the help video for this section before changing settings',$pd);?></h3>
1345
- <?php _e('In most cases, you will NOT need to change the settings in this box unless you have a custom comment form, template or you are using minifying or caching plugins',$pd);?>
1346
- </td>
1347
- <td style="text-align: center; border: 2px dotted; width:125px"><a onclick="return false;" href="<?php echo $this->plugin_url . 'videos/'; ?>technicalsettings.php?KeepThis=true&amp;TB_iframe=true&amp;height=355&width=545" class="thickbox"><img src="<?php echo $this->plugin_url;?>images/playbuttonsmall.png"/></a></td>
1348
- </tr>
1349
- <tr>
1350
- <td style="background-color: #dfdfdf; text-align: center; font-weight: bolder;" colspan="5"><?php _e('Compatibility',$pd);?></td>
1351
- </tr>
1352
- <tr>
1353
- <td colspan="2">
1354
- <input type="checkbox" name="<?php echo $dbo;?>[template_insert]" <?php checked($o['template_insert'],'on');?> value="on"/><label for="<?php echo $dbo;?>[template_insert]"> <?php _e('Use manual insert of badge code?',$pd);?></label>
1355
- <br>( <strong>&lt;?php cl_display_badge(); ?&gt;</strong> )
1356
- </td>
1357
- <td colspan="2">
1358
- <input type="checkbox" name="<?php echo $dbo;?>[minifying]" <?php checked($o['minifying'],'on');?> value="on"/><label for="<?php echo $dbo;?>[minifying]"> <?php _e('Enable minifying compatibility?',$pd);?></label>
1359
- <br><?php _e('For caching plugins (places localized code in footer)',$pd);?>
1360
- </td>
1361
- <td></td>
1362
- </tr>
1363
- <tr>
1364
- <td style="background-color: #dfdfdf; text-align: center; font-weight: bolder;" colspan="5"><?php _e('API URL',$pd);?></td>
1365
- </tr>
1366
- <tr>
1367
- <td colspan="4">
1368
- <input type="text" size="60" name="<?php echo $dbo;?>[api_url]" value="<?php echo $o['api_url'];?>"/><label for="<?php echo $dbo;?>[api_url]"> <?php _e('URL to use for API',$pd);?></label>
1369
- </td>
1370
- </tr>
1371
- <tr>
1372
- <td style="background-color: #dfdfdf; text-align: center; font-weight: bolder;" colspan="5"><?php _e('Comment Form Field Values',$pd);?></td>
1373
- </tr>
1374
- <tr>
1375
- <td colspan="2"><?php _e('Authors Name field name',$this->plugin_domain);?></td>
1376
- <td colspan="2"><input type="text" value="<?php echo $o['author_name'];?>" name="<?php echo $dbo;?>[author_name]"/></td>
1377
- <td></td>
1378
- </tr>
1379
- <tr>
1380
- <td colspan="2"><?php _e('Email field name',$this->plugin_domain);?></td>
1381
- <td colspan="2"><input value="<?php echo $o['email_name'];?>" type="text" name="<?php echo $dbo;?>[email_name]"/></td>
1382
- <td></td>
1383
- </tr>
1384
- <tr>
1385
- <td colspan="2"><?php _e('Authors URL field name',$this->plugin_domain);?></td>
1386
- <td colspan="2"><input value="<?php echo $o['url_name'];?>" type="text" name="<?php echo $dbo;?>[url_name]"/></td>
1387
- <td></td>
1388
- </tr>
1389
- <tr>
1390
- <td colspan="2"><?php _e('Comment Text Area name',$this->plugin_domain);?></td>
1391
- <td colspan="2"><input value="<?php echo $o['comment_name'];?>" type="text" name="<?php echo $dbo;?>[comment_name]"/></td>
1392
- <td></td>
1393
- </tr>
1394
- <tr>
1395
- <td style="background-color: #dfdfdf; text-align: center; font-weight: bolder;" colspan="5"><?php _e('Diagnostics Info',$pd);?></td>
1396
- </tr>
1397
- <tr>
1398
- <td colspan="4"><textarea style="width: 99%" rows="5">
1399
- <?php
1400
- $options = $this->get_options();
1401
- $options['version'] = $this->version;
1402
- $options['home_url'] = get_home_url();
1403
- $options['wp_version'] = get_bloginfo('version');
1404
- $options['charset'] = get_bloginfo('charset');
1405
- $options['curl'] = function_exists('curl_init')? 'yes': 'no';
1406
-
1407
- print_r($options);
1408
-
1409
- ?>
1410
- </textarea>
1411
- </td>
1412
- <td>
1413
- <?php _e('You can copy this information and send it to me if I request it',$pd);?>
1414
- </td>
1415
- </tr>
1416
- </tbody>
1417
- </table>
1418
-
1419
- </div>
1420
- <div class="submit"><input class="button-primary" id="clsubmit" type="submit" name="Submit" value="<?php _e('Save Settings',$this->plugin_domain);?>" /></div>
1421
- </form>
1422
- <h3><?php _e('Reset Settings',$this->plugin_domain);?></h3>
1423
- <form method="post" action="options.php">
1424
- <?php settings_fields( 'commentluv_options_group' ); // the name given in admin init
1425
- $javamsg = __('Are you sure you want to reset your settings? Press OK to continue',$this->plugin_domain);
1426
- ?>
1427
- <input type="hidden" name="<?php echo $this->db_option;?>[reset]" value="yes"/>
1428
- <input style="background-color: red;" type="submit" onclick="<?php echo 'if(confirm(\''.$javamsg.'\') != true) { return false; } else { return true; } ';?>" value="<?php _e('Reset',$this->plugin_domain);?>" name="submit"/>
1429
- </form>
1430
-
1431
-
1432
- </div> <!-- end main block div -->
1433
- <div style="float:left">
1434
- <table class="widefat" style="width: 230px; margin-left: 10px;">
1435
- <thead>
1436
- <tr><th scope="col"><?php _e('Plugin Info',$this->plugin_domain);?></th><th>&nbsp;</th></tr>
1437
- </thead>
1438
- <tbody>
1439
- <tr><td colspan="2"><div style="background: url(<?php echo $this->plugin_url;?>images/playbutton.png); text-align: center; font-size: 1.4em; width: 228px; height: 44px; overflow: hidden;"><br><?php _e('Start Here',$this->plugin_domain);?></div><div><a onclick="return false;" href="<?php echo $this->plugin_url . 'videos/'; ?>starthere.php?KeepThis=true&amp;TB_iframe=true&amp;height=355&width=545" class="thickbox"><img src="<?php echo $this->plugin_url;?>images/playbuttonfront.png"/></a></div></td></tr>
1440
- <tr><td><strong><?php _e('Author',$this->plugin_domain);?>:</strong></td><td>Andy Bailey</td></tr>
1441
- <tr><td><strong><?php _e('Home Page',$this->plugin_domain);?>:</strong></td><td><a title="<?php _e('Visit www.commentluv.com!',$this->plugin_domain);?>" href="http://www.commentluv.com/" target="_blank">commentluv.com</a></td></tr>
1442
- <tr><td><strong><?php _e('Social',$this->plugin_domain);?>:</strong></td><td><a title="Follow CommentLuv on Twitter" href="http://twitter.com/commentluv/" target="_blank"><img src="<?php echo $this->plugin_url;?>images/twitter.png"/></a> <a title="Join me on LinkedIn" href="http://uk.linkedin.com/in/commentluv" target="_blank"><img src="<?php echo $this->plugin_url;?>images/linkedin.png"/></a> <a title="Join me on Facebook" href="http://www.facebook.com/CommentLuv" target="_blank"><img src="<?php echo $this->plugin_url;?>images/facebook.png"/></a></td></tr>
1443
- <tr><td><strong><?php _e('Help',$this->plugin_domain);?>:</strong></td><td><a href="http://support.commentluv.com/" target="_blank"><?php _e('Help Desk',$this->plugin_domain);?></a></td></tr>
1444
- <tr class="alt"><td colspan="2"><?php _e('Do you like this plugin?',$this->plugin_domain);?></td></tr>
1445
- <tr><td colspan="2"><iframe src="http://www.facebook.com/plugins/like.php?app_id=156518444414150&amp;href=www.facebook.com%2Fcommentluv&amp;send=false&amp;layout=standard&amp;width=230&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=50" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:220px; height:50px;" allowTransparency="true"></iframe></td></tr>
1446
- <tr class="alt"><td colspan="2"><?php _e('News',$this->plugin_domain);?>:</td></tr>
1447
- <tr><td colspan="2">
1448
- <?php
1449
- include_once(ABSPATH . WPINC . '/rss.php');
1450
- wp_rss('http://comluv.com/category/newsletter/feed',3);?>
1451
- </td></tr>
1452
- <tr class="alt"><td colspan="2"><?php _e('Thanks to the following for translations',$this->plugin_domain);?>:</td></tr>
1453
- <tr><td><img src="<?php echo $this->plugin_url;?>images/it.png"/> <?php _e('Italian',$this->plugin_domain);?></td><td><a target="_blank" href="http://gidibao.net/">Gianni Diuno</a></td></tr>
1454
- <tr><td><img src="<?php echo $this->plugin_url;?>images/nl.png"/> <?php _e('Dutch',$this->plugin_domain);?></td><td><a target="_blank" href="http://wpwebshop.com/">Rene</a></td></tr>
1455
- <tr><td><img src="<?php echo $this->plugin_url;?>images/pl.png"/> <?php _e('Polish',$this->plugin_domain);?></td><td><a target="_blank" href="http://techformator.pl/">Mariusz Kolacz</a></td></tr>
1456
- <tr><td><img src="<?php echo $this->plugin_url;?>images/ge.png"/> <?php _e('Georgian',$this->plugin_domain);?></td><td><a target="_blank" href="http://www.findmyhosting.com">Kasia Ciszewski</a></td></tr>
1457
- <tr><td><img src="<?php echo $this->plugin_url;?>images/lt.png"/> <?php _e('Lithuanian',$this->plugin_domain);?></td><td><a target="_blank" href="http://mantas.malcius.lt/">Mantas Malcius</a></td></tr>
1458
- <tr><td><img src="<?php echo $this->plugin_url;?>images/br.png"/> <?php _e('Portuguese',$this->plugin_domain);?></td><td><a target="_blank" href="http://www.korvo.com.br/">Diego Uczak</a></td></tr>
1459
- <tr><td><img src="<?php echo $this->plugin_url;?>images/my.png"/> <?php _e('Malaysian',$this->plugin_domain);?></td><td><a target="_blank" href="http://ariffshah.com/">Ariff Shah</a></td></tr>
1460
- <tr><td><img src="<?php echo $this->plugin_url;?>images/in.png"/> <?php _e('Hindi',$this->plugin_domain);?></td><td><a target="_blank" href="http://outshinesolutions.com/">Outshine Solutions</a></td></tr>
1461
- <tr><td><img src="<?php echo $this->plugin_url;?>images/id.png"/> <?php _e('Indonesian',$this->plugin_domain);?></td><td><a target="_blank" href="http://rainerflame.com/">Mokhamad Oky</a></td></tr>
1462
- <tr><td><img src="<?php echo $this->plugin_url;?>images/cn.png"/> <?php _e('Chinese (simplified)',$this->plugin_domain);?></td><td><a target="_blank" href="http://obugs.net/">Third Eye</a></td></tr>
1463
- <tr><td><img src="<?php echo $this->plugin_url;?>images/es.png"/> <?php _e('Spanish',$this->plugin_domain);?></td><td><a target="_blank" href="http://www.activosenred.com/">Valentin Yonte</a></td></tr>
1464
- <tr><td><img src="<?php echo $this->plugin_url;?>images/ru.png"/> <?php _e('Russian',$this->plugin_domain);?></td><td><!--<a target="_blank" href="http://www.fatcow.com/">Fatcow</a>--></td></tr>
1465
-
1466
- <tr><td><img src="<?php echo $this->plugin_url;?>images/il.png"/> <?php _e('Hebrew',$this->plugin_domain);?></td><td><!--<a target="_blank" href="http://www.maorb.info/">Maor Barazany</a>--></td></tr>
1467
- <tr><td><img src="<?php echo $this->plugin_url;?>images/fr.png"/> <?php _e('French',$this->plugin_domain);?></td><td><!--<a target="_blank" href="http://referenceurfreelance.com/">Leo</a>--></td></tr>
1468
-
1469
- <tr><td><img src="<?php echo $this->plugin_url;?>images/ro.png"/> <?php _e('Romanian',$this->plugin_domain);?></td><td><!--<a target="_blank" href="http://www.mlb.ro/">Bogdan Martinescu</a>--></td></tr>
1470
- <tr><td><img src="<?php echo $this->plugin_url;?>images/de.png"/> <?php _e('German',$this->plugin_domain);?></td><td><!--<a target="_blank" href="http://www.macozoll.de/">Astrid Spitzenberg</a>--></td></tr>
1471
- <tr><td><img src="<?php echo $this->plugin_url;?>images/sa.png"/> <?php _e('Arabic',$this->plugin_domain);?></td><td><!--<a target="_blank" href="http://www.melzarei.be/">Muhammad Elzarei</a>--></td></tr>
1472
-
1473
- <tr><td><strong><?php _e('Want your link here?',$this->plugin_domain);?></strong></td><td><a target="_blank" href="http://support.commentluv.com/ticket/knowledgebase.php?article=1"><?php _e('How To Submit A Translation',$this->plugin_domain);?></a></td></tr>
1474
- <tr class="alt"><td colspan="2"><?php _e('Special thanks go to the following',$this->plugin_domain);?>:</td></tr>
1475
- <tr><td><strong><?php _e('CSS Help',$this->plugin_domain);?>:</strong></td><td><a href="http://www.famousbloggers.net" target="_blank">Hesham Zebida</a></td></tr>
1476
- <tr><td><strong><?php _e('Badge GFX',$this->plugin_domain);?>:</strong></td><td><a href="http://byteful.com/" target="_blank">Byteful Travel</a></td></tr>
1477
- </tbody>
1478
- </table>
1479
- </div>
1480
-
1481
-
1482
- </div>
1483
- <div class="clear"></div>
1484
- </div>
1485
- <?php
1486
-
1487
- }
1488
-
1489
-
1490
- } // end class
1491
- } // end if class not exists
1492
-
1493
- $clbadgeshown = false;
1494
- // start commentluv class engines
1495
- if (class_exists ( 'commentluv' )) :
1496
- $commentluv = new commentluv ( );
1497
- // confirm warp capability
1498
- if (isset ( $commentluv )) {
1499
- // engage
1500
- register_activation_hook ( __FILE__, array (&$commentluv, 'install' ) );
1501
- }
1502
- endif;
1503
-
1504
- function cl_display_badge(){
1505
- global $commentluv;
1506
- if(isset($commentluv)){
1507
- $commentluv->display_badge();
1508
- }
1509
-
1510
- }
1511
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php /* commentluv
2
+ Plugin Name: CommentLuv
3
+ Plugin URI: http://comluv.com/
4
+ Description: 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.
5
+ Version: 2.90.7
6
+ Author: Andy Bailey
7
+ Author URI: http://www.commentluv.com
8
+ Copyright (C) <2011> <Andy Bailey>
9
+
10
+ This program is free software: you can redistribute it and/or modify
11
+ it under the terms of the GNU General Public License as published by
12
+ the Free Software Foundation, either version 3 of the License, or
13
+ (at your option) any later version.
14
+
15
+ This program is distributed in the hope that it will be useful,
16
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
+ GNU General Public License for more details.
19
+
20
+ You should have received a copy of the GNU General Public License
21
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+ if (! class_exists ( 'commentluv' )) {
24
+ // let class begin
25
+ class commentluv {
26
+ //localization domain
27
+ var $plugin_domain = 'commentluv';
28
+ var $plugin_url;
29
+ var $plugin_dir;
30
+ var $db_option = 'commentluv_options';
31
+ var $version = "2.90.7";
32
+ var $slug = 'commentluv-options';
33
+ var $localize;
34
+ var $is_commentluv_request = false;
35
+
36
+ /** commentluv
37
+ * This is the constructor, it runs as soon as the class is created
38
+ * Use this to set up hooks, filters, menus and language config
39
+ */
40
+ function __construct() {
41
+ global $wp_version, $pagenow;
42
+ // pages where this plugin needs translation
43
+ $local_pages = array ('plugins.php', 'options-general.php' );
44
+ // check if translation needed on current page
45
+ if (in_array ( $pagenow, $local_pages ) || in_array ( $_GET ['page'], $local_pages )) {
46
+ $this->handle_load_domain ();
47
+ }
48
+ $exit_msg = __ ( 'CommentLuv requires Wordpress 3.0 or newer.', $this->plugin_domain ) . '<a href="http://codex.wordpress.org/Upgrading_Wordpress">' . __ ( 'Please Update!', $this->plugin_domain ) . '</a>';
49
+ // can you dig it?
50
+ if (version_compare ( $wp_version, "3.0", "<" )) {
51
+ echo ( $exit_msg ); // no diggedy
52
+ }
53
+ // activation/deactivation
54
+ register_activation_hook(__FILE__, array(&$this,'activation'));
55
+ register_deactivation_hook(__FILE__, array(&$this,'deactivation'));
56
+ // manual set install and activate, wordpress wont fire the activation hook on auto upgrade plugin
57
+ $cl_version = get_option('cl_version');
58
+ if($this->version != $cl_version){
59
+ $this->install();
60
+ $this->activation();
61
+ }
62
+ // plugin dir and url
63
+ $this->plugin_url = trailingslashit ( WP_PLUGIN_URL . '/' . dirname ( plugin_basename ( __FILE__ ) ) );
64
+ $this->plugin_dir = dirname(__FILE__);
65
+ // hooks
66
+ add_action ( 'clversion', array (&$this,'check_version') ); // check commentluv version
67
+ add_action ( 'init', array (&$this,'init') ); // to register styles and scripts
68
+ add_action ( 'admin_init', array (&$this, 'admin_init' ) ); // to register settings group
69
+ add_action ( 'admin_menu', array (&$this, 'admin_menu' ) ); // to setup menu link for settings page
70
+ add_action ( 'admin_print_scripts-settings_page_commentluv-options', array(&$this,'add_settings_page_script')); // script for settings page ajax function
71
+ add_action ( 'admin_print_styles-settings_page_commentluv-options', array(&$this,'add_settings_page_style')); // script for settings page ajax function
72
+ add_action ( 'wp_ajax_notify_signup', array(&$this,'notify_signup')); // ajax handler for settings page subscribe button
73
+ add_action ( 'init', array(&$this,'detect_useragent'));
74
+ // filters
75
+ add_filter ( 'cron_schedules', array (&$this, 'cron_schedules') ); // for my own recurrence
76
+ add_filter ( 'plugin_action_links', array (&$this, 'plugin_action_link' ), - 10, 2 ); // add a settings page link to the plugin description. use 2 for allowed vars
77
+ add_filter ( 'found_posts', array(&$this,'send_feed'),-1,2); // sends post titles and urls only
78
+ add_filter ( 'kindergarten_html', array(&$this,'kindergarten_html')); // for cleaning html
79
+ $options = $this->get_options();
80
+ //DebugBreak();
81
+ //$this->check_version();
82
+ if($options['enable'] == 'yes'){
83
+ $this->setup_hooks();
84
+ }
85
+ }
86
+ /**
87
+ * PHP4 constructor
88
+ */
89
+ function commentluv() {
90
+ $this->__construct();
91
+ }
92
+ /** runs when plugin is activated
93
+ * called by register_activation_hook
94
+ *
95
+ */
96
+ function activation(){
97
+ // only add if it doesn't exist yet
98
+ $sched = wp_next_scheduled('clversion');
99
+ if(false === $sched){
100
+ // set up cron for version check
101
+ $rnd = mt_rand(5,604800);
102
+ wp_schedule_event(time() - $rnd,'clfortnightly','clversion');
103
+ }
104
+ // see if this blog uses w3 total cache and flush the cache after activation and
105
+ // set the page cache ignore useragents to have Commentluv in it too
106
+ global $w3_plugin_totalcache;
107
+ if(is_object($w3_plugin_totalcache)){
108
+ // w3 object exists, flush the page cache
109
+ $w3_plugin_totalcache->flush_all();
110
+ // get config for page cache rejected useragents list
111
+ $config = new W3_Config();
112
+ $ua = $config->get_array('pgcache.reject.ua');
113
+ if(!in_array('Commentluv',$ua)){
114
+ // commentluv useragent not added yet, do it now
115
+ $ua[] = 'Commentluv';
116
+ }
117
+ // set it in config
118
+ $config->set('pgcache.reject.ua',$ua);
119
+ // set w3 object _config object to have _config var with useragent array (cannot use config->save() here because w3 saves it again from it's own stored values)
120
+ // this appears to work, I cannot get an answer from Fred so this will have to dooferfnaa
121
+ $w3_plugin_totalcache->_config->_config['pgcache.reject.ua'] = $ua;
122
+ // write cache rules
123
+ $w3_plugin_pgcache = & W3_Plugin_PgCache::instance();
124
+ $w3_plugin_pgcache->write_rules_core();
125
+
126
+ }
127
+
128
+ }
129
+ /**
130
+ * Adds fields to comment area
131
+ * called by add_action('comment_form
132
+ */
133
+ function add_fields(){
134
+ global $clbadgeshown;
135
+ $options = $this->get_options();
136
+ if(!$this->is_enabled()){
137
+ return;
138
+ }
139
+ $author_name = $options['author_name'];
140
+ $email_name = $options['email_name'];
141
+ $url_name = $options['url_name'];
142
+ // handle logged on user
143
+ if(is_user_logged_in()){
144
+ global $userdata;
145
+ get_currentuserinfo();
146
+ $author = $userdata->display_name;
147
+ $userid = $userdata->ID;
148
+ $url = $userdata->user_url;
149
+ if(!strstr($url,'http://') && $url != ''){
150
+ $url = 'http://'.$url;
151
+ }
152
+ // check for s2 member pluin, add url from it's custom registration fields
153
+ if(defined('WS_PLUGIN__S2MEMBER_VERSION') && isset($userdata->wp_s2member_custom_fields['website'])){
154
+ $url = $userdata->wp_s2member_custom_fields['website'];
155
+ }
156
+ // check for multisite
157
+ if(is_multisite()){
158
+ if(!$url || $url == 'http://'){
159
+ $userbloginfo = get_blogs_of_user($userid,1);
160
+ $url = $userbloginfo[1] -> siteurl;
161
+ }
162
+ }
163
+ // final check of url
164
+ if($url == 'http://'){
165
+ $url = '';
166
+ }
167
+ // spit out hidden fields
168
+ echo '<input type="hidden" id="'.$author_name.'" name="'.$author_name.'" value="'.$author.'"/>';
169
+ // if buddypress, don't hide field
170
+ if(function_exists('bp_core_setup_globals')){
171
+ $input_type = 'text';
172
+ } else {
173
+ $input_type = 'hidden';
174
+ }
175
+ echo '<input type="'.$input_type.'" id="'.$url_name.'" name="'.$url_name.'" value="'.$url.'"/>';
176
+ }
177
+ // add hidden fields for holding information about type,choice,html and request for every user
178
+ echo '<input type="hidden" name="cl_post_title" id="cl_post_title"/>';
179
+ echo '<input type="hidden" name="cl_post_url" id="cl_post_url"/>';
180
+ echo '<input type="hidden" name="cl_prem" id="cl_prem"/>';
181
+
182
+ // show badge (unless user set to manual insert)
183
+ if($clbadgeshown == false && $options['template_insert'] != 'on'){
184
+ $this->display_badge();
185
+ }
186
+ }
187
+ function add_footer(){
188
+ extract($this->get_options());
189
+ if($minifying != 'on' || !$this->is_enabled()){
190
+ return;
191
+ }
192
+ // from the excellent book wp-ajax (http://www.wpajax.com/)
193
+ $data = "var cl_settings = {";
194
+ $arr = array();
195
+ $vars = $this->localize;
196
+ foreach ($vars as $key => $value) {
197
+ $arr[count($arr)] = $key . " : '" . esc_js($value) . "'";
198
+ }
199
+ $data .= implode(",",$arr); $data .= "};";
200
+ echo "<script type='text/javascript'>\n";
201
+ echo "/* <![CDATA[ */\n";
202
+ echo $data;
203
+ echo "\n/* ]]> */\n";
204
+ echo "</script>\n";
205
+ }
206
+ /**
207
+ * called by add_filter('comment_row_actions
208
+ * adds another link to the comment row in admin for removing the luv link
209
+ * @param array $actions - the existing actions
210
+ */
211
+ function add_removeluv_link($actions){
212
+ global $post;
213
+ $user_can = current_user_can('edit_posts', $post->ID);
214
+ $cid = get_comment_ID();
215
+ $data = get_comment_meta($cid,'cl_data');
216
+ if($data && is_array($data)){
217
+ if($user_can){
218
+ $nonce= wp_create_nonce ('removeluv'.get_comment_ID());
219
+ $actions['Remove-luv'] = '<a class="removeluv :'.$cid.':'.$nonce.'" href="javascript:">Remove Luv</a>';
220
+ }
221
+ }
222
+ return $actions;
223
+ }
224
+ /**
225
+ * called by add_action('admin_print_scripts-edit-comments.php'
226
+ * load the script to handle the removluv link
227
+ *
228
+ */
229
+ function add_removeluv_script(){
230
+ wp_enqueue_script ( 'commentluv', $this->plugin_url . 'js/adminremoveluv.js', array ('jquery' ),$this->version );
231
+ }
232
+ /**
233
+ * called by add_action('template_redirect in setup_hooks()
234
+ * used to add the commentluv script and localized settings (if not using minifying compatibility)
235
+ */
236
+ function add_script(){
237
+ $options = $this->get_options();
238
+ extract($options);
239
+ if(!$this->is_enabled()){
240
+ return;
241
+ }
242
+
243
+ wp_enqueue_script('commentluv_script');
244
+ $this->localize = array ('name' => $author_name, 'url' => $url_name, 'comment' => $comment_name, 'email' => $email_name,
245
+ 'infopanel' => $infopanel, 'default_on' => $default_on, 'default_on_admin' => $default_on_admin,
246
+ 'cl_version' => $this->version, 'images' => $this->plugin_url . 'images/', 'api_url' => $api_url,
247
+ '_fetch' => wp_create_nonce('fetch'), '_info' => wp_create_nonce('info'),
248
+ 'infoback' => $infoback, 'infotext'=>$infotext,'template_insert'=>$template_insert, 'logged_in'=>is_user_logged_in(),
249
+ 'refer' => get_permalink(),
250
+ 'no_url_message'=>__('Please enter a URL and then click the CommentLuv checkbox if you want to add your last blog post',$this->plugin_domain),
251
+ 'no_http_message'=>__('Please use http:// in front of your url',$this->plugin_domain),
252
+ 'no_url_logged_in_message'=>__('You need to visit your profile in the dashboard and update your details with your site URL',$this->plugin_domain),
253
+ 'no_info_message'=>__('No info was available or an error occured',$this->plugin_domain));
254
+ if($minifying != 'on'){
255
+ wp_localize_script('commentluv_script','cl_settings',$this->localize);
256
+ }
257
+
258
+ }
259
+ /**
260
+ * called by add_action('wp_print_styles in setup_hooks()
261
+ * Used to add the stylesheet for commentluv
262
+ */
263
+ function add_style(){
264
+ if(!$this->is_enabled()){
265
+ return;
266
+ }
267
+ wp_enqueue_style('commentluv_style');
268
+ }
269
+ /**
270
+ * Adds scripts to settings page. Only loads scripts if the settings page is being shown
271
+ * Called by add_action('admin_print_scripts-settings_page_commentluv-options'
272
+ * use localize so messages in javascript are internationalized
273
+ */
274
+ function add_settings_page_script (){
275
+ wp_enqueue_script ('notify_signup', $this->plugin_url . 'js/notify_signup.js', array('jquery'),$this->version );
276
+ wp_localize_script ( 'notify_signup', 'notify_signup_settings', array('wait_message'=>__('Please wait',$this->plugin_domain),'notify_success1' => __('Please check your inbox, an email will be sent to',$this->plugin_domain), 'notify_success2'=>__('in the next few minutes with a confirmation link',$this->plugin_domain), 'notify_fail'=>__('An error happened with the request. Try signing up at the site',$this->plugin_domain),'image_url'=>$this->plugin_url.'images/','default'=>'CL91_default.png', 'white'=>'CL91_White.gif','black'=>'CL91_Black.gif','none'=>'nothing.gif'));
277
+ wp_enqueue_script('thickbox',null,array('jquery'));
278
+ echo "<link rel='stylesheet' href='/".WPINC."/js/thickbox/thickbox.css?ver=20080613' type='text/css' media='all' />\n";
279
+ }
280
+ /**
281
+ * adds the thickbox style to header for commentluv settings page
282
+ * called by add_action('admin_print_styles-settings_page_commentluv-options
283
+ */
284
+ function add_settings_page_style(){
285
+ wp_enqueue_style('thickbox');
286
+ }
287
+ /** admin_init
288
+ * This function registers the settings group
289
+ * it is called by add_action admin_init
290
+ * options in the options page will need to be named using $this->db_option[option]
291
+ */
292
+ function admin_init(){
293
+ // whitelist options
294
+ register_setting( 'commentluv_options_group', $this->db_option ,array(&$this,'options_sanitize' ) );
295
+ $options = $this->get_options();
296
+ if($options['upgrade']){
297
+ add_action('admin_notices',array(&$this,'show_upgrade_notice'));
298
+ }
299
+ // has the comment meta table?
300
+ global $wpdb;
301
+ $query = $wpdb->prepare("SHOW tables LIKE '{$wpdb->commentmeta}'");
302
+ $dbtable = $wpdb->get_var($query);
303
+ $o['dbtable'] = $dbtable;
304
+ if(!$dbtable){
305
+ add_action('admin_notices',create_function('','echo "<div class=\"error\">'.__('Your Wordpress install is missing the <strong>wp_commentmeta</strong> table!',$pd).'<br>'.__(' CommentLuv cannot work without this table please see this wordpress forum post to learn how to add one ->',$pd).'<a target=\"_blank\" href=\"http://wordpress.org/support/topic/wp_commentmeta-table-a39xxxx2_blogwp_commentmeta-doesnt-exist?replies=7#post-1378281\">'.__('Missing wp_commentmeta table',$pd).'</a></div>";'));
306
+ }
307
+ }
308
+
309
+ /** admin_menu
310
+ * This function adds a link to the settings page to the admin menu
311
+ * see http://codex.wordpress.org/Adding_Administration_Menus
312
+ * it is called by add_action admin_menu
313
+ */
314
+ function admin_menu(){
315
+ if(is_multisite()){
316
+ $level = 'manage_options'; // for wpmu sub blog admins
317
+ } else {
318
+ $level = 'administrator'; // for single blog intalls
319
+ }
320
+ $menutitle = '<img src="' . $this->plugin_url . 'images/littleheart.gif" alt=""/> CommentLuv';
321
+ add_options_page ( 'CommentLuv settings', $menutitle, $level, $this->slug, array (&$this, 'options_page' ) );
322
+ }
323
+ /**
324
+ * ajax handler
325
+ * setup by add_action ( 'wp_ajax_removeluv'
326
+ * called when remove luv link is clicked in comments edit page
327
+ * with POST['action'] of removeluv, receives cid and _wpnonce
328
+ */
329
+ function ajax_remove_luv(){
330
+ // check user is allowed to do this
331
+ $nonce=$_REQUEST['_wpnonce'];
332
+ $cid = $_REQUEST['cid'];
333
+ if (! wp_verify_nonce($nonce, 'removeluv'.$cid) ) die("Epic fail");
334
+ // delete meta if comment id sent with request
335
+ if($cid){
336
+ // get meta and set vars if exists
337
+ $cmeta =get_comment_meta($cid,'cl_data','true');
338
+ if($cmeta) extract($cmeta);
339
+ // delete it and call comluv to tell it what happened
340
+ if(delete_comment_meta($cid,'cl_data')){
341
+ // can call originator blog here maybe
342
+ // return the comment id and status code for js processing to hide luv
343
+ echo "$cid*200";
344
+ }
345
+ } else {
346
+ echo '0';
347
+ }
348
+ exit;
349
+ }
350
+ /**
351
+ * checks for a new version
352
+ * called by a cron action
353
+ */
354
+ function check_version(){
355
+ $version = $this->php_version($this->version);
356
+ $options = $this->get_options();
357
+ $url = 'http://version.commentluv.com/';
358
+ $name = strip_tags(get_bloginfo('name'));
359
+ $description = strip_tags(get_bloginfo('description'));
360
+ $body = array('version'=>$version,'enabled'=>$options['enable'],'name'=>$name,'description'=>$description,'avatarmd5'=>md5(strtolower(get_bloginfo('admin_email'))));
361
+ $response = wp_remote_head($url,array('method'=>'POST','body'=>$body));
362
+ $latest = $this->php_version(wp_remote_retrieve_header($response,'version'));
363
+ $message = wp_remote_retrieve_header($response,'message');
364
+ if(version_compare($version,$latest,'<')){
365
+ $options['upgrade'] = $latest;
366
+ if($message){
367
+ $options['upgrade_message'] = apply_filters('kindergarten_html',$message);
368
+ }
369
+ update_option($this->db_option,$options);
370
+ }
371
+ }
372
+ /**
373
+ * called by add_action('comment_post
374
+ * runs just after comment has been saved to the database
375
+ * will save the luv link to comment meta if it exists
376
+ *
377
+ * @param int $id - id of the comment
378
+ * @param string $commentdata - status of comment
379
+ */
380
+ function comment_posted($id,$approved){
381
+ if($_POST['cl_post_url'] && $_POST['cl_post_title']){
382
+ $title = apply_filters('kses',$_POST['cl_post_title']);
383
+ //$link = apply_filters('kses',$_POST['cl_post_url']);
384
+ $link = esc_url($_POST['cl_post_url']);
385
+ //$prem = apply_filters('kses',$_POST['cl_prem']);
386
+ $prem = 'p' == $_POST['cl_prem'] ? 'p' : 'u';
387
+ $data = array('cl_post_title'=>$title,'cl_post_url'=>$link,'cl_prem'=>$prem);
388
+ add_comment_meta($id,'cl_data',$data,'true');
389
+ }
390
+ }
391
+ /**
392
+ * add my own recurrence schedule
393
+ * called by add_filter('cron_schedules
394
+ *
395
+ * @param mixed $schedules - the current schedules
396
+ */
397
+ function cron_schedules($schedules){
398
+ $schedules['clfortnightly'] = array(
399
+ 'interval' => 1209600,
400
+ 'display' => __('Twice Monthly')
401
+ );
402
+ return $schedules;
403
+ }
404
+ /** runs when plugin is deactivated
405
+ * called by register_deactivation_hook
406
+ *
407
+ */
408
+ function deactivation(){
409
+ wp_clear_scheduled_hook('clversion');
410
+ }
411
+ /**
412
+ * detect if request is from a commentluv useragent
413
+ * called by add_action('init
414
+ * used to start the output buffer so the send_feed function can clear it before sending the xml feed
415
+ * this is for rare occasions where some themes cause output to be sent to the browser before send_feed can output its own
416
+ * ignore if user has set disable_detect in settings
417
+ */
418
+ function detect_useragent(){
419
+ $options = $this->get_options();
420
+ // dont do anything if detect is disabled
421
+ if($options['disable_detect'] == 'on'){
422
+ return;
423
+ }
424
+ // is this commentluv calling?
425
+ if (preg_match("/Commentluv/i", $_SERVER['HTTP_USER_AGENT'])){
426
+ $this->is_commentluv_request = true;
427
+ ob_start();
428
+ }
429
+ }
430
+ /**
431
+ * Called by add_fields or by manual insert
432
+ * used to show the badge and extra bits for holding the ajax drop down box
433
+ *
434
+ */
435
+ function display_badge(){
436
+ global $clbadgeshown;
437
+ $options = $this->get_options();
438
+ if($clbadgeshown == true){
439
+ return;
440
+ }
441
+ // link to commentluv?
442
+ $before = '';
443
+ $after = '';
444
+ // link
445
+ if($options['link']){
446
+ $before = '<a href="http://www.commentluv.com" target="_blank" title="'.__('CommentLuv is enabled',$this->plugin_domain).'">';
447
+ $after = '</a>';
448
+ }
449
+ // dropdown choice
450
+ if($options['badge_choice'] == 'drop_down'){
451
+ if($options['badge_type'] != 'none'){
452
+ $badges = array('default'=>'CL91_default.png','white'=>'CL91_White.gif','black'=>'CL91_Black.gif');
453
+ $imgurl = $this->plugin_url.'images/'.$badges[$options['badge_type']];
454
+ }
455
+ }
456
+ // custom image
457
+ if($options['badge_choice'] == 'custom'){
458
+ if($options['custom_image_url'] != ''){
459
+ if(!strstr($options['custom_image_url'],'http://')){
460
+ $imgurl = 'http://'.$options['custom_image_url'];
461
+ } else {
462
+ $imgurl = $options['custom_image_url'];
463
+ }
464
+ }
465
+ }
466
+ // create badge code (if not chosen 'none')
467
+ if($options['badge_choice'] == 'drop_down' && $options['badge_type'] == 'none'){
468
+ $badgecode = '';
469
+ } else {
470
+ $badgecode = $before.'<img alt="CommentLuv badge" src="'.$imgurl.'"/>'.$after;
471
+ }
472
+ // or using text
473
+ if($options['badge_choice'] == 'text'){
474
+ $badgecode = $before.$options['badge_text'].$after;
475
+ }
476
+ // default on
477
+ $default_on = '';
478
+ if($options['default_on'] == 'on'){
479
+ $default_on = ' checked="checked"';
480
+ if(is_user_logged_in() && current_user_can('manage_options')){
481
+ if($options['default_on_admin'] != 'on'){
482
+ $default_on = '';
483
+ }
484
+ }
485
+ }
486
+ // spit out code
487
+ echo '<div id="commentluv"><div id="cl_messages"></div><input type="checkbox" id="doluv" name="doluv"'.$default_on.' /><span id="mylastpost">'.$badgecode.'</span><span id="showmorespan"><img class="clarrow" id="showmore" src="'.$this->plugin_url.'images/down-arrow.gif" alt="'.__('Show more posts',$this->plugin_domain).'" title="'.__('Show more posts',$this->plugin_domain).'" style="display:none;"/></span></div><div id="lastposts" style="display:none;"></div>';
488
+ $clbadgeshown = true;
489
+ }
490
+ /**
491
+ * ajax handler.
492
+ * called by add_action('wp_ajax_(nopriv_)ajax
493
+ * handles all ajax requests, receives 'do' as POST var and calls relevant function
494
+ *
495
+ */
496
+ function do_ajax(){
497
+ switch($_POST['do']){
498
+ case 'fetch' :
499
+ $this->fetch_feed();
500
+ break;
501
+ case 'info' :
502
+ $this->do_info();
503
+ break;
504
+ case 'click' :
505
+ $this->do_click();
506
+ break;
507
+
508
+ }
509
+ }
510
+ /**
511
+ * called by do_ajax
512
+ * receives cid and nonce and cl_prem as POST vars
513
+ * stores the click in the comment meta
514
+ */
515
+ function do_click(){
516
+ $cid = intval($_POST['cid']);
517
+ $nonce = $_POST['nonce'];
518
+ $url = $_POST['url'];
519
+ if(!wp_verify_nonce($nonce,$cid)){
520
+ exit;
521
+ }
522
+ $data = get_comment_meta($cid,'cl_data',true);
523
+ if(is_array($data)){
524
+ $data['clicks'] = $data['clicks'] + 1;
525
+ update_comment_meta($cid,'cl_data',$data);
526
+ }
527
+ if($_POST['cl_prem'] == 'true'){
528
+ $comment = get_commentdata($cid);
529
+ $refer = get_permalink($comment['comment_post_ID']);
530
+ // set blocking to false because no response required
531
+ $response = wp_remote_post($url,array('blocking'=>false,'body'=>array('cl_request'=>'click','refer'=>$refer,'version'=>$this->version)));
532
+ }
533
+ exit;
534
+ }
535
+ /**
536
+ * called by do_ajax
537
+ * receives cl_prem, url and cid as POST vars
538
+ * sends back json encoded string for the content of the panel
539
+ */
540
+ function do_info(){
541
+
542
+ check_ajax_referer('info');
543
+ global $wpdb;
544
+ $options = $this->get_options();
545
+ $isreg = false;
546
+ $cid = intval($_POST['cid']);
547
+ $cl_prem = $_POST['cl_prem'];
548
+ $link = $_POST['link'];
549
+ // is registered user?
550
+ $email = get_comment_author_email($cid);
551
+ $user = get_user_by_email($email);
552
+ if($user){
553
+ $isreg = true;
554
+ }
555
+ // get comments and stats
556
+ $query = $wpdb->prepare('SELECT m.meta_value, c.comment_post_ID FROM '.$wpdb->comments.' c JOIN '.$wpdb->commentmeta.' m ON c.comment_ID = m.comment_ID WHERE c.comment_approved = 1 AND c.comment_author_email = %s AND m.meta_key = %s ORDER BY c.comment_ID DESC',$email,'cl_data');
557
+ $rows = $wpdb->get_results($query);
558
+ $num_comments = $wpdb->num_rows;
559
+ // get other comments and links left
560
+ $appeared_on = array();
561
+ $appeared_on_list = array();
562
+ $my_other_posts = array();
563
+ $my_other_posts_list = array();
564
+
565
+ if($rows){
566
+ foreach($rows as $row){
567
+ $data = unserialize($row->meta_value);
568
+ if(!in_array($data['cl_post_url'],$my_other_posts_list) && sizeof($my_other_posts) < 5){
569
+ $my_other_posts[] = '<a target="_blank" href="'.$data['cl_post_url'].'">'.esc_js(substr($data['cl_post_title'],0,60)).'</a>';
570
+ $my_other_posts_list[] = $data['cl_post_url'];
571
+ }
572
+ if(!in_array($row->comment_post_ID,$appeared_on_list) && sizeof($appeared_on) < 5){
573
+ $appeared_on[] = '<a href="'.get_permalink($row->comment_post_ID).'">'.substr(get_the_title($row->comment_post_ID),0,60).'</a>';
574
+ $appeared_on_list[] = $row->comment_post_ID;
575
+ }
576
+ // stop if both lists at 5
577
+ if(count($appeared_on) >= 5 && count($my_other_posts) >= 5){
578
+ break;
579
+ }
580
+ }
581
+ }
582
+ if(empty($appeared_on)){
583
+ $appeared_on[] = __('I have only commented on this post',$this->plugin_domain);
584
+ }
585
+ if(empty($my_other_posts)){
586
+ $my_other_posts[] = '<a>'.__('If I had made more comments on this site, you would see more of my other posts here',$this->plugin_domain).'</a>';
587
+ }
588
+ // get click count on local site
589
+ $data = get_comment_meta($cid,'cl_data',true);
590
+ $clickcount = $data['clicks'] ? $data['clicks'] : 0;
591
+ //DebugBreak();
592
+ // prem member, try remote fetch of info if not registered on this blog
593
+ if($cl_prem == 'p' && $isreg == false){
594
+ $response = wp_remote_post($link,array('body'=>array('cl_request'=>'info','version'=>$this->version,'clickcount'=>$clickcount,'num_comments'=>$num_comments,'appeared_on'=>$appeared_on)));
595
+ $enabled = wp_remote_retrieve_header($response,'cl_info');
596
+ if($enabled == 'enabled'){
597
+ $panel = apply_filters('kindergarten_html',wp_remote_retrieve_body($response));
598
+ $json = json_encode(array('panel'=>$panel));
599
+ header ( "Content-Type: application/x-javascript; " );
600
+ echo $json;
601
+ exit;
602
+ } else {
603
+ $cl_prem = 'u';
604
+ }
605
+ }
606
+ // show registered members panel
607
+ if($isreg){
608
+ // get users info
609
+ $bio = $user->description;
610
+ if($bio == ''){
611
+ $bio = __('User has not saved a description in their profile page',$this->plugin_domain);
612
+ }
613
+ $username = $user->display_name;
614
+ if(is_multisite()){
615
+ $can = 'manage_options';
616
+ } else {
617
+ $can = 'administrator';
618
+ }
619
+ // find if user has cap, need to create new user object and use ->has_cap
620
+ // from wp 3.1, you can use if(user_can($user,$cap))
621
+ $user = new WP_User($user->ID);
622
+ if($user->has_cap($can)){
623
+ $reg_member = __('is the administrator of this site',$this->plugin_domain);
624
+ } else {
625
+ $reg_member = __('is a registered member of my site',$this->plugin_domain);
626
+ }
627
+ $gravatar = '<img src="http://www.gravatar.com/avatar/' . md5 ( strtolower($email) ) . '.jpg" alt="' . $username . '" align="left" />';
628
+ $panel = $gravatar . "<p class=\"cl_title\"><span class=\"cl_username\">$username</span> ".$reg_member."</p><p class=\"cl_bio\">$bio</p><p class=\"cl_clicks\"> <span class=\"cl_clicks_count\">$clickcount</span> ".__('Clicks on this link on this comment',$this->plugin_domain)."</p><p class=\"cl_links\">".$num_comments.' '.__('approved comments on this site',$this->plugin_domain).'<br>'.__('Some other posts I have commented on',$this->plugin_domain)."</p><p class=\"cl_links_list\">".implode('<br>',$appeared_on)."</p><p class=\"cl_posts\">".__('Some of my other posts',$this->plugin_domain)."</p><p class=\"cl_posts_list\">".implode('<br>',$my_other_posts)."</p>";
629
+ $json = json_encode(array('panel'=>$panel));
630
+ header ( "Content-Type: application/x-javascript; " );
631
+ echo $json;
632
+ exit;
633
+ }
634
+ // show panel for everyone else
635
+ $comment = get_comment($cid);
636
+ $msg = '';
637
+ $bio= get_comment_author_url($cid);
638
+ $name = get_comment_author($cid);
639
+ $gravatar = '<img src="http://www.gravatar.com/avatar/' . md5 ( strtolower($email) ) . '.jpg" alt="' . $name . '" align="left" />';
640
+ if(get_option('users_can_register')){
641
+ $msg = __('has not registered on this site',$this->plugin_domain);
642
+ $bio = $options['unreg_user_text_panel'];
643
+ }
644
+ $panel = $gravatar . "<p class=\"cl_title\">
645
+ <span class=\"cl_username\">".$comment->comment_author."</span> ".$msg."</p>
646
+ <p class=\"cl_bio\">".$bio."</p>
647
+ <p class=\"cl_clicks\"> <span class=\"cl_clicks_count\">$clickcount</span> ".__('Clicks on this link on this comment',$this->plugin_domain)."</p>
648
+ <p class=\"cl_links\">".$num_comments.' '.__('approved comments on this site',$this->plugin_domain).
649
+ '<br>'.__('Some other posts I have commented on',$this->plugin_domain)."</p>
650
+ <p class=\"cl_links_list\">".implode('<br>',$appeared_on)."</p>";
651
+ // dont show other links for non registered user to entice them to register
652
+ //<p class=\"cl_posts\">".__('Some of my other posts',$this->plugin_domain)."</p>
653
+ //<p class=\"cl_posts_list\">".implode('<br>',$my_other_posts)."</p>";
654
+ $json = json_encode(array('panel'=>$panel));
655
+ header ( "Content-Type: application/x-javascript; " );
656
+ echo $json;
657
+ exit;
658
+ }
659
+ /**
660
+ * called by add_filter('comments_array
661
+ * adds the link to the comments that are to be displayed
662
+ * @param mixed $commentarray
663
+ */
664
+ function do_shortcode($commentarray){
665
+ $isadminpage = false;
666
+ $options= $this->get_options();
667
+ if(!is_array($commentarray)){
668
+ // if it's an array then it was called by comments_array filter,
669
+ // otherwise it was called by comment_content (admin screen)
670
+ // has it been done before?
671
+ if(strpos($commentarray,'class="cluv"')){
672
+ return $commentarray;
673
+ }
674
+ // make a fake array of 1 object so below treats the comment_content filter nicely for admin screen
675
+ $temparray = array('comment_ID'=>get_comment_ID(),'comment_content'=>$commentarray,'comment_author'=>get_comment_author(), 'comment_author_email'=>get_comment_author_email());
676
+ $tempobject = (object) $temparray;
677
+ $commentarray = array($tempobject);
678
+ $isadminpage = true;
679
+ }
680
+ // add link to comments (need to do it this way so thesis works with commentluv links, thesis wont use comment_text filter but it does get an array of comments)
681
+ $new_commentarray = array();
682
+ foreach($commentarray as $comment){
683
+ $data = get_comment_meta($comment->comment_ID,'cl_data','true');
684
+ $commentcontent = $comment->comment_content;
685
+ // luvlink added?
686
+ if($data && is_array($data)){
687
+ // luvlink was saved to meta, dofollow the link?
688
+ $nofollow = ' rel="nofollow"';
689
+ $isreg = get_user_by_email($comment->comment_author_email);
690
+ if($options['dofollow'] == 'everybody'){
691
+ $nofollow = '';
692
+ } elseif ($options['dofollow'] == 'registered' && $isreg){
693
+ $nofollow = '';
694
+ }
695
+ // construct link
696
+ $pclass = $data['cl_prem'] == 'p' ? ' p' : '';
697
+ $ajaxnonce = wp_create_nonce($comment->comment_ID);
698
+ $class = ' class="'.$ajaxnonce.' '.$comment->comment_ID.$pclass.'"';
699
+ $luvlink = '<a'.$class.$nofollow.' href="'.$data['cl_post_url'].'">'.$data['cl_post_title'].'</a>';
700
+ $search = array ('[name]', '[lastpost]' );
701
+ $replace = array ($comment->comment_author, $luvlink );
702
+ $prepend_text = $options ['comment_text'];
703
+ $inserted = str_replace ( $search, $replace, $prepend_text );
704
+ // construct string to be added to comment
705
+ $commentcontent .= "\n<span class=\"cluv\">$inserted";
706
+ // prepare heart icon if infopanel is on
707
+ $hearticon = '';
708
+ if($data['cl_prem'] == 'p' || $isreg) {
709
+ // use PLUS heart for members
710
+ $hearticon = 'plus';
711
+ }
712
+ if ($options ['infopanel'] == 'on') {
713
+ $commentcontent .= '<span class="heart_tip_box"><img class="heart_tip '.$data['cl_prem'].' '.$comment->comment_ID.'" alt="My Profile" style="border:0" width="16" height="14" src="' . $this->plugin_url . 'images/littleheart'.$hearticon.'.gif"/></span>';
714
+ }
715
+ $commentcontent.= '</span>';
716
+ }
717
+ // store new content in this comments comment_content cell
718
+ $comment->comment_content = $commentcontent;
719
+ // fill new array with this comment
720
+ $new_commentarray[] = $comment;
721
+ }
722
+ // admin page or public page?
723
+ if($isadminpage){
724
+ // is being called by comment_text filter so expecting just content
725
+ return $commentcontent;
726
+ } else {
727
+ // called from comments_array filter so expecting array of objects
728
+ return $new_commentarray;
729
+ }
730
+ }
731
+ /**
732
+ * called by do_ajax())
733
+ * takes action when ajax request is made with URL from the comment form
734
+ * send back 1 or 10 last posts depending on rules
735
+ */
736
+ function fetch_feed(){
737
+ // check nonce
738
+ $checknonce = check_ajax_referer('fetch',false,false);
739
+ if(!$checknonce){
740
+ die(' error! not authorized '.$_REQUEST['_ajax_nonce']);
741
+ }
742
+ define('DOING_AJAX', true);
743
+ include_once(ABSPATH.WPINC.'/class-simplepie.php');
744
+ $options = $this->get_options();
745
+ $num = 1;
746
+ $url = strip_tags($_POST['url']);
747
+ // fetch 10 last posts?
748
+ if((is_user_logged_in() && $options['whogets'] == 'registered') || (!is_user_logged_in() && $options['whogets'] == 'everybody')){
749
+ $num = 10;
750
+ } elseif($options['whogets'] == 'everybody') {
751
+ $num = 10;
752
+ } elseif(current_user_can('manage_options')){
753
+ $num = 10;
754
+ }
755
+ // check if request is for the blog we're on
756
+ if(strstr($url, home_url())){
757
+ //DebugBreak();
758
+ $posts = get_posts(array('numberposts'=>10));
759
+ $return = array();
760
+ $error = '';
761
+ if($posts){
762
+ foreach($posts as $post){
763
+ $return[] = array('type'=>'blog','title'=>$post->post_title,'link'=>get_permalink($post->ID),'p'=>'u');
764
+ }
765
+ } else {
766
+ $error = __('Could not get posts for home blog',$this->plugin_domain);
767
+ }
768
+ // check for admin only notices to add
769
+ $canreg = get_option('users_can_register');
770
+ $whogets = $options['whogets'];
771
+ if(!$canreg && $whogets == 'registered'){
772
+ $return[] = array('type'=>'message','title'=>__('Warning! You have set to show 10 posts for registered users but you have not enabled user registrations on your site. You should change the operational settings in the CommentLuv settings page to show 10 posts for everyone or enable user registrations',$this->plugin_domain),'link'=>'');
773
+ }
774
+ $response = json_encode(array('error'=>$error,'items'=>$return));
775
+ header( "Content-Type: application/json" );
776
+ echo $response;
777
+ exit;
778
+ }
779
+ // get simple pie ready
780
+ $rss = new SimplePie();
781
+ if(!$rss){
782
+ die(' error! no simplepie');
783
+ }
784
+ $rss->set_useragent('Commentluv /'.$this->version.' (Feed Parser; http://www.commentluv.com; Allow like Gecko) Build/20110502' );
785
+ $rss->set_feed_url ( $url );
786
+ $rss->enable_cache ( FALSE );
787
+ // fetch the feed
788
+ $rss->init();
789
+ $rss->handle_content_type();
790
+ $gen = $rss->get_channel_tags('','generator');
791
+ $prem_msg = $rss->get_channel_tags('','prem_msg');
792
+ $g = $num;
793
+ $p = 'u';
794
+ $meta = array();
795
+ //DebugBreak();
796
+ if($gen && strstr($gen[0]['data'],'commentluv')){
797
+ $generator = $gen[0]['data'];
798
+ $meta['generator'] = $generator;
799
+ $pos=stripos($generator,'v=');
800
+ if(substr($generator,$pos+2,1)=='3'){
801
+ $g=15;
802
+ $p='p';
803
+ }
804
+ }
805
+ if($prem_msg){
806
+ $prem_msg = $prem_msg[0]['data'];
807
+ }
808
+ //DebugBreak();
809
+ $error = $rss->error();
810
+ $meta['used_feed'] = $rss->subscribe_url();
811
+ //DebugBreak();
812
+ // no error, construct return json
813
+ if(!$error){
814
+
815
+ $arr = array();
816
+
817
+ // save meta
818
+ $meta['used_feed'] = $rss->subscribe_url ();
819
+
820
+ $feed_items = $rss->get_items();
821
+ foreach($feed_items as $item){
822
+ $type = 'blog';
823
+ $itemtags = $item->get_item_tags('','type');
824
+ if($itemtags){
825
+ $type = $itemtags[0]['data'];
826
+ }
827
+ $arr[] = array('type'=>$type,'title'=>$item->get_title(),'link'=>$item->get_permalink(),'p'=>$p);
828
+ $g--;
829
+ if($g < 1){
830
+ break;
831
+ }
832
+ }
833
+ // add message to unregistered user if set
834
+ if(!is_user_logged_in() && $options['unreg_user_text'] && $options['whogets'] != 'everybody' && $p=='u'){
835
+ if(get_option('users_can_register')){
836
+ $arr[] = array('type'=>'message','title'=>$options['unreg_user_text'],'link'=>'');
837
+ if(!strstr($options['unreg_user_text'],'action=register')){
838
+ $register_link = apply_filters('register','<a href="' . site_url('wp-login.php?action=register', 'login') . '">' . __('Register') . '</a>');
839
+ $arr[] = array('type'=>'message','title'=>$register_link,'link'=>'');
840
+ }
841
+ }
842
+ if($options['whogets'] == 'registered' && get_option('users_can_regsiter')){
843
+ $arr[] = array('type'=>'message','title'=>__('If you are registered, you need to log in to get 10 posts to choose from',$this->plugin_domain),'link'=>'');
844
+ }
845
+ }
846
+ if($prem_msg){
847
+ $arr[] = array('type'=>'alert','title'=>$prem_msg,'link'=>'');
848
+ }
849
+ $response = json_encode(array('error'=>'','items'=>$arr,'meta'=>$meta));
850
+ } else {
851
+ // had an error trying to read the feed
852
+ $response = json_encode(array('error'=>$error,'meta'=>$meta));
853
+ }
854
+ unset($rss);
855
+ header( "Content-Type: application/json" );
856
+ echo $response;
857
+ exit;
858
+ }
859
+ /** get_options
860
+ * This function sets default options and handles a reset to default options
861
+ * @param string $reset = 'no' - whether to return default settings
862
+ * return array
863
+ */
864
+ function get_options($reset = 'no') {
865
+ // see if we offer registration incentive
866
+ $register_link = '';
867
+ if(get_option('users_can_register')){
868
+ $register_link = apply_filters('register','<a href="' . site_url('wp-login.php?action=register', 'login') . '">' . __('Register') . '</a>');
869
+ }
870
+ // default values
871
+ $default = array ('version'=>$this->version,'enable'=>'yes','enable_for'=>'both', 'default_on' => 'on', 'default_on_admin'=>'on',
872
+ 'badge_choice' => 'drop_down', 'badge_type'=>'default', 'link'=>'off','infopanel'=>'on', 'infoback'=>'white', 'infotext'=>'black',
873
+ 'comment_text'=>'[name] '.__('recently posted',$this->plugin_domain).'..[lastpost]', 'whogets'=>'registered', 'dofollow' => 'registered',
874
+ 'unreg_user_text'=>__('If you register as a user on my site, you can get your 10 most recent blog posts to choose from in this box.',$this->plugin_domain).' '.$register_link,
875
+ 'unreg_user_text_panel'=>__('If this user had registered to my site then they could get 10 last posts to choose from when they comment and you would be able to see a list of their recent posts in this panel',$this->plugin_domain),
876
+ 'template_insert'=>'','minifying'=>'','api_url'=>admin_url('admin-ajax.php'),'author_name'=>'author','email_name'=>'email','url_name'=>'url','comment_name'=>'comment');
877
+ $options = get_option ( $this->db_option, $default);
878
+ // return the options
879
+ if($reset == 'yes'){
880
+ return $default;
881
+ }
882
+ if(!$options['api_url']){
883
+ $options['api_url'] = admin_url('admin-ajax.php');
884
+ }
885
+ return $options;
886
+ }
887
+ /** handle_load_domain
888
+ * This function loads the localization files required for translations
889
+ * It expects there to be a folder called /lang/ in the plugin directory
890
+ * that has all the .mo files
891
+ */
892
+ function handle_load_domain() {
893
+ // get current language
894
+ $locale = get_locale ();
895
+ // locate translation file
896
+ $mofile = WP_PLUGIN_DIR . '/' . plugin_basename ( dirname ( __FILE__ ) ) . '/lang/' . $this->plugin_domain . '-' . $locale . '.mo';
897
+ // load translation
898
+ load_textdomain ( $this->plugin_domain, $mofile );
899
+ }
900
+ /** init
901
+ * This function registers styles and scripts
902
+ */
903
+ function init(){
904
+ wp_register_style( 'commentluv_style',$this->plugin_url.'css/commentluv.css' );
905
+ wp_register_script( 'commentluv_script', $this->plugin_url.'js/commentluv.js',array('jquery') );
906
+ }
907
+ /** install
908
+ * This function is called when the plugin activation hook is fired when
909
+ * the plugin is first activated or when it is auto updated via admin.
910
+ * use it to make any changes needed for updated version or to add/check
911
+ * new database tables on first install.
912
+ */
913
+ function install(){
914
+ $options = $this->get_options();
915
+ if(!$installed_version = get_option('cl_version')){
916
+ // no installed version yet, set to version that was before big change
917
+ $installed_version = 2.8;
918
+ } else {
919
+ // convert existing version to php type version number
920
+ $installed_version = $this->php_version($installed_version);
921
+ }
922
+ // for version before 2.9
923
+ if(version_compare($installed_version,'2.9','<')){
924
+ // make any changes to this new versions options if needed and update
925
+ update_option($this->db_option,$this->get_options('yes'));
926
+ update_option('cl_version',$this->version);
927
+ }
928
+ // new addition to technical settings after 2.90.1 release
929
+ if(version_compare($installed_version,'2.9.0.1','<')){
930
+ $options['api_url'] = admin_url('admin-ajax.php');
931
+ update_option($this->db_option,$options);
932
+ update_option('cl_version',$this->version);
933
+ }
934
+ // update cl_version in db
935
+ if($this->version != $installed_version){
936
+ update_option('cl_version',$this->version);
937
+ }
938
+ }
939
+ /**
940
+ * helper function called by mulitple functions
941
+ * used to determine if commentluv is enabled
942
+ */
943
+ function is_enabled(){
944
+ $options = $this->get_options();
945
+ // see if we need to add here or not
946
+ if(($options['enable_for'] == 'posts' && is_page()) || ($options['enable_for'] == 'pages' && !is_page())){
947
+ return false;
948
+ }
949
+ if($options['enable'] != 'yes'){
950
+ return false;
951
+ }
952
+ return true;
953
+ }
954
+ /**
955
+ * called by apply_filter('kindergarten_html
956
+ * Used to clean $input to only allow a kiddy set of html tags
957
+ *
958
+ * @param string $input - the string to be cleaned
959
+ * @return string
960
+ */
961
+ function kindergarten_html($input){
962
+ $allowedtags = array(
963
+ 'h1' => array(),
964
+ 'br' => array(),
965
+ 'a' => array('href' => array(),'title' => array(),'rel' => array(),'target'=>array(), 'class'=>array()),
966
+ 'small' =>array(),
967
+ 'p' =>array( 'class'=>array()),
968
+ 'strong' => array(),
969
+ 'img' => array('src' => array(),'alt' => array(),'width' => array(),'height' => array(),'align'=> array()),
970
+ 'span' => array('class'=>array())
971
+ );
972
+ return wp_kses($input,$allowedtags);
973
+ }
974
+ /**
975
+ * Ajax handler for the subscribe button on the settings page.
976
+ * called by add_action ( 'wp_ajax_notify_signup'
977
+ */
978
+ function notify_signup(){
979
+ //DebugBreak();
980
+ global $current_user;
981
+ $email = $current_user->user_email;
982
+ $firstname = $current_user->first_name;
983
+ if(!$firstname){
984
+ $firstname = $current_user->user_nicename;
985
+ }
986
+ $message = "\n Email: ".$email."\n\n Name: ".$firstname."\n\n Meta: settings_page_289"."\n\n";
987
+ $to = 'cl_notify29@aweber.com';
988
+ $headers = 'From: '.$firstname.' <'.$email.'>'."\r\n\\";
989
+ $mail = wp_mail($to,'cl_notify',$message,$headers);
990
+ if($mail === true){
991
+ $options = $this->get_options();
992
+ $options['subscribed'] = true;
993
+ update_option($this->db_option,$options);
994
+ }
995
+ $return = array('success'=>$mail,'email'=>$email);
996
+ // return response
997
+ $response = json_encode($return);
998
+ // response output
999
+ header( "Content-Type: application/json" );
1000
+ echo $response;
1001
+ // IMPORTANT: don't forget to "exit"
1002
+ exit;
1003
+ }
1004
+ /** options_sanitize
1005
+ * This is the callback function for when the settings get saved, use it to sanitize options
1006
+ * it is called by the callback setting of register_setting in admin_init
1007
+ * @param mixed $options - the options that were POST'ed
1008
+ * return mixed $options
1009
+ */
1010
+ function options_sanitize($options){
1011
+ //DebugBreak();
1012
+ $old_options = $this->get_options();
1013
+ // if not enabled, only save that so other settings remain unchanged
1014
+ if($options['enable'] == 'no'){
1015
+ $old_options['enable'] = 'no';
1016
+ return $old_options;
1017
+ }
1018
+ // check for reset
1019
+ if($options['reset'] == 'yes'){
1020
+ return $this->get_options('yes');
1021
+ }
1022
+ // if on multisite and this isnt super admin saving,
1023
+ // only allow kindergarten html.
1024
+ if(is_multisite() && !is_super_admin()){
1025
+ foreach($options as $key => $option){
1026
+ $options[$key] = apply_filters('kindergarten_html',$option);
1027
+ }
1028
+ }
1029
+ // add error notices if any
1030
+ $canreg = get_option('users_can_register');
1031
+ if($options['whogets']=='registered' && !$canreg){
1032
+ add_settings_error('whogets','whogets',__('Warning! You have set to show 10 posts for registered users but you have not enabled user registrations on your site. You should change the operational settings in the CommentLuv settings page to show 10 posts for everyone or enable user registrations',$this->plugin_domain),'error');
1033
+ }
1034
+ return $options;
1035
+ }
1036
+ /**
1037
+ * converts a string into a php type version number
1038
+ * eg. 2.81.2 will become 2.8.1.2
1039
+ * used to prepare a number to be used with version_compare
1040
+ *
1041
+ * @param mixed $string - the version to be converted to php type version
1042
+ * @return string
1043
+ */
1044
+ function php_version($string){
1045
+ if(empty($string)){
1046
+ return;
1047
+ }
1048
+ $version = str_replace('.','',$string);
1049
+ $std = array();
1050
+ for($i=0; $i < strlen($version); $i++){
1051
+ $std[] = $version[$i];
1052
+ }
1053
+ $php_version = implode('.',$std);
1054
+ return $php_version;
1055
+ }
1056
+ /** commentluv_action
1057
+ * This function adds a link to the settings page for the plugin on the plugins listing page
1058
+ * it is called by add filter plugin_action_links
1059
+ * @param $links - the links being filtered
1060
+ * @param $file - the name of the file
1061
+ * return array - the new array of links
1062
+ */
1063
+ function plugin_action_link($links, $file) {
1064
+ $this_plugin = plugin_basename ( __FILE__ );
1065
+ if ($file == $this_plugin) {
1066
+ $links [] = "<a href='options-general.php?page={$this->slug}'>" . __ ( 'Settings', $this->plugin_domain ) . "</a>";
1067
+ }
1068
+ return $links;
1069
+ }
1070
+ /**
1071
+ * Detects if a commentluv api or plugin is requesting a feed
1072
+ * and sends back an xml feed of the post titles and links that were found for the query
1073
+ * called by add_filter('found_posts' so we always have the posts found for the requested category/author/tag/ etc
1074
+ * @param (int) $foundposts - the number of posts that were found
1075
+ * @param (obj) $object - the query object
1076
+ * @return $foundposts - need to return this if the request is not from a commentluv api or plugin
1077
+ */
1078
+ function send_feed($foundposts,$object){
1079
+ if(headers_sent() == true){
1080
+ return $foundposts;
1081
+ }
1082
+ $options = $this->get_options();
1083
+ // check if detection disabled
1084
+ if($options['disable_detect'] == 'on'){
1085
+ return $foundposts;
1086
+ }
1087
+ if($this->is_commentluv_request === true){
1088
+ // is commentluv useragent (set in init action)
1089
+ // get rid of any output (prevents some themes on some hosts from outputting code before commentluv can show xml feed)
1090
+ ob_clean();
1091
+ }
1092
+ $error = false;
1093
+ if($foundposts < 1){
1094
+ $error = true;
1095
+ }
1096
+ $enabled = $options['enable'];
1097
+ // General checking
1098
+ if (preg_match("/Commentluv/i", $_SERVER['HTTP_USER_AGENT'])) {
1099
+ $feed = '<?xml version="1.0" encoding="'.get_bloginfo('charset').'" ?>
1100
+ <rss version="2.0">
1101
+ <channel>
1102
+ <title><![CDATA['. get_bloginfo('title') .']]></title>
1103
+ <link>'. get_bloginfo('home') .'</link>
1104
+ <description><![CDATA['. get_bloginfo('description') .']]></description>
1105
+ <language>'.get_bloginfo('language').'</language>
1106
+ <generator>commentluv?v='.$this->version.'</generator>
1107
+ <commentluv>'.$enabled.'</commentluv>
1108
+ <success>'.$error.'</success>';
1109
+ if($object->posts){
1110
+ foreach($object->posts as $post){
1111
+ $feed .= '<item><title><![CDATA['.get_the_title($post->ID).']]></title>
1112
+ <link>'.get_permalink($post->ID).'</link>
1113
+ <type>blog</type>
1114
+ </item>';
1115
+ }
1116
+ } else {
1117
+ $feed .= '<item><title>'.__('No Posts Were Found!',$pd).'</title>
1118
+ <link>'.get_permalink($post->ID).'</link>
1119
+ </item>';
1120
+ }
1121
+ $feed .= '</channel></rss>';
1122
+ header("Content-Type: application/xml; charset=".get_bloginfo('charset'));
1123
+ echo $feed;
1124
+ exit;
1125
+ }
1126
+ return $foundposts;
1127
+ }
1128
+ /**
1129
+ * called by __construct
1130
+ * used to setup hooks and filters for enabled plugin
1131
+ */
1132
+ function setup_hooks(){
1133
+ add_action ( 'comment_form',array(&$this,'add_fields')); // add fields to form
1134
+ add_action ( 'wp_print_styles',array(&$this,'add_style')); // add style
1135
+ add_action ( 'template_redirect',array(&$this,'add_script')); // add commentluv script
1136
+ add_action ( 'admin_print_scripts-edit-comments.php', array (&$this, 'add_removeluv_script') ); // add the removeluv script to admin page
1137
+ add_action ( 'wp_footer',array(&$this,'add_footer')); // add localize to footer
1138
+ add_action ( 'wp_ajax_removeluv', array (&$this, 'ajax_remove_luv') ); // handle the call to the admin-ajax for removing luv
1139
+ add_action ( 'wp_ajax_nopriv_cl_ajax',array(&$this,'do_ajax'));
1140
+ add_action ( 'wp_ajax_cl_ajax',array(&$this,'do_ajax'));
1141
+ add_action ( 'wp_insert_comment', array (&$this, 'comment_posted'),1,2); // add member id and other data to comment meta priority 1, 2 vars
1142
+
1143
+ add_filter ( 'comments_array', array (&$this, 'do_shortcode' ), 1 ); // add last blog post data to comment content
1144
+ add_filter ( 'comment_text', array (&$this, 'do_shortcode' ), 1 ); // add last blog post data to comment content on admin screen
1145
+ add_filter ( 'comment_row_actions', array (&$this,'add_removeluv_link')); // adds a link to remove the luv from a comment on the comments admin screen
1146
+ }
1147
+ /**
1148
+ * called by add_action('admin_notices in admin_init()
1149
+ * Used to show a notice if there is a new version of CommentLuv available
1150
+ */
1151
+ function show_upgrade_notice(){
1152
+ $options = $this->get_options();
1153
+ echo '<div id="clupgrade" class="error">';
1154
+ if($options['upgrade_message']){
1155
+ echo $options['upgrade_message'];
1156
+ } else {
1157
+ echo __('There is a new version of Commentluv available, please upgrade by visiting this site',$this->plugin_domain);
1158
+ echo '<br><a href="http://www.commentluv.com" target="_blank">www.commentluv.com</a>';
1159
+ }
1160
+ echo '<span style="float:right"><a href="'.admin_url('options-general.php?page='.$this->slug.'&dismiss=true').'">'.__('Dismiss notice',$this->plugin_domain).'</a></span>';
1161
+ echo '</div>';
1162
+ }
1163
+
1164
+ /** options_page
1165
+ * This function shows the page for saving options
1166
+ * it is called by add_options_page
1167
+ * You can echo out or use further functions to display admin style widgets here
1168
+ */
1169
+ function options_page(){
1170
+ $o = $this->get_options();
1171
+ $dbo = $this->db_option;
1172
+ $pd = $this->plugin_domain;
1173
+ $badges = array('default'=>'CL91_default.png','white'=>'CL91_White.gif','black'=>'CL91_Black.gif','none'=> 'nothing.gif');
1174
+ //DebugBreak();
1175
+ // remove notice if requested
1176
+ if(isset($_GET['dismiss'])){
1177
+ unset($o['upgrade']);
1178
+ if(array_key_exists('upgrade_message',$o)){
1179
+ unset($o['upgrade_message']);
1180
+ }
1181
+ update_option($this->db_option,$o);
1182
+ echo '<script>jQuery("#clupgrade").hide()</script>';
1183
+ }
1184
+ ?>
1185
+ <div class="wrap">
1186
+ <h2><?php _e('CommentLuv Settings v',$this->plugin_domain);?><?php echo $this->version;?></h2>
1187
+ <div id="poststuff" style="margin-top:10px; width: 965px;">
1188
+ <div id="mainblock" style="float: left; width:710px">
1189
+ <form method="post" action="options.php">
1190
+ <?php settings_fields( 'commentluv_options_group' ); // the name given in admin init
1191
+ // after here, put all the inputs and text fields needed
1192
+ ?>
1193
+ <div class="dbx-content">
1194
+ <table class="widefat">
1195
+ <thead>
1196
+ <tr><th scope="col"><?php _e('Important!',$pd);?></th><th><?php _e('Subscription Information',$pd);?></th></tr>
1197
+ </thead>
1198
+ <tbody>
1199
+ <tr>
1200
+ <td width="250">
1201
+ <h2 style="margin: 0 0 10px 0;"><?php _e('CommentLuv 3.0 Premium is coming soon!',$pd);?></h2>
1202
+ <img align="left" src="<?php echo $this->plugin_url;?>images/privacy-guarantee.png"/><?php _e('I promise not to sell your details or send you spam. You will ONLY receive emails about plugin updates.',$pd);?>
1203
+ </td>
1204
+ <td>
1205
+ <p><?php _e('There is a premium version of CommentLuv coming that will have much more control of how the plugin works as well as exclusive features like keyword name, inline registration and much much more!. Signup to find out as soon as it is ready',$pd);?></p>
1206
+ <?php
1207
+ if($o['subscribed']){
1208
+ echo '<div class="submit">'.__('You have already subscribed, if you have not received the verification within 12 hours, please click the button to resend or try the form at',$pd).' <a target="_blank" href="http://www.commentluv.com/">www.commentluv.com</a><br><input style="margin:0 auto; display: block;" type="button" id="cl_notify" value="'.__('Resend Verification',$pd).'"/></div>';
1209
+ } else {
1210
+ echo '<div class="submit" style=" background-color: green; padding-left: 5px; padding-right: 5px; border-radius: 15px; -moz-border-radius: 15px; text-align: center;"><input style="margin: 0 auto; display:block" id="cl_notify" type="button" name="cl_notify" value="'.__('Click to register now!',$pd).'" /></div>';
1211
+ }
1212
+ ?>
1213
+ <div id="notify_message"></div>
1214
+ </td>
1215
+ </tr>
1216
+ </tbody>
1217
+ </table>
1218
+
1219
+
1220
+ <br/>
1221
+
1222
+
1223
+ <table class="widefat">
1224
+ <thead>
1225
+ <tr><th><?php _e('Primary Setting',$pd);?></th><th colspan="3"></th><th style="text-align: center;"><?php _e('Help Video',$pd);?></th></tr>
1226
+ </thead>
1227
+ <tbody>
1228
+ <tr>
1229
+ <td colspan="2" style="width: 40%; vertical-align: middle; text-align: center; font-size: 1.3em; font-weight: bolder;"><label for="<?php echo $dbo;?>[enable]"><?php _e('Enable CommentLuv?',$pd);?></label></td>
1230
+ <td style="width:20%; vertical-align: middle; font-size: 1.3em;"><input class="clenable" type="radio" name="<?php echo $dbo;?>[enable]" value="yes" <?php checked($o['enable'],'yes');?>/><?php _e('Yes',$pd);?></td>
1231
+ <td style="width:20%; vertical-align: middle; font-size: 1.3em;"><input class="clenable" type="radio" name="<?php echo $dbo;?>[enable]" value="no" <?php checked($o['enable'],'no');?>/><?php _e('No',$pd);?></td>
1232
+ <td style="text-align: center; border: 2px dotted;"><a onclick="return false;" href="<?php echo $this->plugin_url . 'videos/'; ?>primarysettings.php?KeepThis=true&amp;TB_iframe=true&amp;height=355&width=545" class="thickbox"><img src="<?php echo $this->plugin_url;?>images/playbuttonsmall.png"/></a></td>
1233
+ </tr>
1234
+ <tr class="ifenable">
1235
+ <td style="text-align: center;" colspan="5">
1236
+ <input type="radio" name="<?php echo $dbo;?>[enable_for]" value="posts" <?php checked($o['enable_for'],'posts');?>/><?php _e('On Posts',$pd);?>
1237
+ <input style="margin-left: 100px;" type="radio" name="<?php echo $dbo;?>[enable_for]" value="pages" <?php checked($o['enable_for'],'pages');?>/><?php _e('On Pages',$pd);?>
1238
+ <input style="margin-left: 100px;" type="radio" name="<?php echo $dbo;?>[enable_for]" value="both" <?php checked($o['enable_for'],'both');?>/><?php _e('On Both',$pd);?>
1239
+ </td>
1240
+ </tr>
1241
+ <tr class="ifenable">
1242
+ <td style="text-align: center;" colspan="2">
1243
+ <input type="checkbox" name="<?php echo $dbo;?>[default_on]" <?php checked($o['default_on'],'on');?> value="on"/> <label for="<?php echo $dbo;?>[default_on]"><?php _e('On by default?',$pd);?></label>
1244
+ </td>
1245
+ <td></td>
1246
+ <td style="text-align: center;" colspan="2">
1247
+ <input type="checkbox" name="<?php echo $dbo;?>[default_on_admin]" <?php checked($o['default_on_admin'],'on');?> value="on"/><label for="<?php echo $dbo;?>[default_on_admin]"> <?php _e('On for admin?',$pd);?></label>
1248
+ </td>
1249
+ </tr>
1250
+ </tbody>
1251
+ </table>
1252
+
1253
+
1254
+ <br>
1255
+
1256
+
1257
+ <table class="widefat ifenable display-settings">
1258
+ <thead>
1259
+ <tr><th><?php _e('Appearance',$pd);?></th><th colspan="3"></th><th style="text-align: center;"><?php _e('Help Video',$pd);?></th></tr>
1260
+ </thead>
1261
+ <tbody>
1262
+ <tr>
1263
+ <td><h3><label for="<?php echo $dbo;?>[badge_choice]"><?php _e('Badge',$pd);?></label></h3></td>
1264
+ <td><h3><label for="<?php echo $dbo;?>[badge_choice]"><?php _e('Custom Image URL',$pd);?></label></h3></td>
1265
+ <td><h3><label for="<?php echo $dbo;?>[badge_choice]"><?php _e('Use Text',$pd);?></label></h3></td>
1266
+ <td></td>
1267
+ <td></td>
1268
+ </tr>
1269
+ <tr>
1270
+ <td>
1271
+ <input type="radio" class="radio" name="<?php echo $dbo;?>[badge_choice]" value="drop_down" <?php checked($o['badge_choice'],'drop_down');?>/>
1272
+ <select id="badge_type" name="<?php echo $dbo;?>[badge_type]">
1273
+ <option value="default" <?php selected($o['badge_type'],'default');?>><?php _e('Default',$pd);?></option>
1274
+ <option value="white" <?php selected($o['badge_type'],'white');?>><?php _e('White',$pd);?></option>
1275
+ <option value="black" <?php selected($o['badge_type'],'black');?>><?php _e('Black',$pd);?></option>
1276
+ <option value="none" <?php selected($o['badge_type'],'none');?>><?php _e('None',$pd);?></option>
1277
+ </select>
1278
+ <p style="margin: 8px 0px 0px 8px;"><img id="display_badge" style="border: 1px solid #000; padding: 3px;" src="<?php echo $this->plugin_url;?>images/<?php echo $badges[$o['badge_type']];?>"/></p>
1279
+ </td>
1280
+ <td>
1281
+ <input type="radio" class="radio" name="<?php echo $dbo;?>[badge_choice]" value="custom" <?php checked($o['badge_choice'],'custom');?>/>
1282
+ <input type="text" name="<?php echo $dbo;?>[custom_image_url]" value="<?php echo $o['custom_image_url'];?>"/>
1283
+ <?php
1284
+ if($o['custom_image_url'] != ''){
1285
+ // show image
1286
+ echo '<p style="margin: 8px 0px 0px 8px;"><img id="custom_badge" style="border: 1px solid #000; padding: 3px;" src="'.$o['custom_image_url'].'"/></p>';
1287
+ } ?>
1288
+ </td>
1289
+ <td>
1290
+
1291
+ <input type="radio" class="radio" name="<?php echo $dbo;?>[badge_choice]" value="text" <?php checked($o['badge_choice'],'text');?>/>
1292
+ <input type="text" name="<?php echo $dbo;?>[badge_text]" value="<?php echo $o['badge_text'];?>"/>
1293
+ <p style="margin: 8px 0px 0px 8px;"><input type="checkbox" name="<?php echo $dbo;?>[link]" value="on" <?php checked($o['link'],'on');?>/> <label for="<?php echo $dbo;?>[link]"><?php _e('Link to Commentluv?',$pd);?></label>
1294
+ </td>
1295
+ <td></td>
1296
+ <td style="text-align: center; border: 2px dotted; width:125px"><a onclick="return false;" href="<?php echo $this->plugin_url . 'videos/'; ?>appearancesettings.php?KeepThis=true&amp;TB_iframe=true&amp;height=355&width=545" class="thickbox"><img src="<?php echo $this->plugin_url;?>images/playbuttonsmall.png"/></a></td>
1297
+ </tr>
1298
+
1299
+ <tr>
1300
+ <td><br><input type="checkbox" name="<?php echo $dbo;?>[infopanel]" <?php checked($o['infopanel'],'on');?> value="on"/><label for="<?php echo $dbo;?>[infopanel]"> <?php _e('Enable info panel?',$pd);?></label></td>
1301
+ <td><label for="<?php echo $dbo;?>[infoback]"><?php _e('Info panel background color',$pd);?></label><br><input type="text" size="6" name="<?php echo $dbo;?>[infoback];?>" value="<?php echo $o['infoback'];?>"/></td>
1302
+ <td><label for="<?php echo $dbo;?>[infotext]"><?php _e('Info panel text color',$pd);?></label><br><input type="text" size="6" name="<?php echo $dbo;?>[infotext];?>" value="<?php echo $o['infotext'];?>"/></td>
1303
+ <td></td>
1304
+ <?php
1305
+ $tdstyle = '"border: 1px solid #dfdfdf; vertical-align: middle; text-align: center; background-color: '.$o['infoback'].'"';
1306
+ $spanstyle = '"color: '.$o['infotext'].'"';
1307
+ ?>
1308
+ <td style=<?php echo $tdstyle;?>><span style=<?php echo $spanstyle;?>><?php _e('Example text and background color',$pd);?></span></td>
1309
+ </tr>
1310
+ </tbody>
1311
+ </table>
1312
+
1313
+ <br>
1314
+
1315
+ <table class="widefat ifenable messages">
1316
+ <thead>
1317
+ <tr>
1318
+ <th colspan="2"><?php _e('Messages',$pd);?></th><th scope="col"></th><th></th><th style="text-align: center;"><?php _e('Help Video',$pd);?></th>
1319
+
1320
+ </tr>
1321
+ </thead>
1322
+ <tbody>
1323
+ <tr>
1324
+ <td colspan="2">
1325
+ <label for="<?php echo $dbo;?>[comment_text]"><?php _e('Text to be displayed in the comment',$pd);?></label>
1326
+ <br><input type="text" style="width: 95%" name="<?php echo $dbo;?>[comment_text]" value="<?php echo htmlentities($o['comment_text']);?>"/>
1327
+ </td>
1328
+ <td style="border: 1px dashed #dfdfdf;"><?php _e('[name] = The users name',$this->plugin_domain);?><br><?php _e('[lastpost] = The last blog post link',$this->plugin_domain);?></td>
1329
+ <td>&nbsp;</td>
1330
+ <td style="text-align: center; border: 2px dotted; width:125px"><a onclick="return false;" href="<?php echo $this->plugin_url . 'videos/'; ?>messagessettings.php?KeepThis=true&amp;TB_iframe=true&amp;height=355&width=545" class="thickbox"><img src="<?php echo $this->plugin_url;?>images/playbuttonsmall.png"/></a></td>
1331
+ </tr>
1332
+ <tr>
1333
+ <td colspan="3">
1334
+
1335
+ <?php _e('Message for unregistered user in the drop down box',$pd);?>
1336
+ <br>(<?php _e('Message will not be shown if you do not have registrations enabled',$this->plugin_domain);?>)
1337
+ <br><textarea rows="5" style="width: 95%" name="<?php echo $dbo;?>[unreg_user_text]"><?php echo htmlentities($o['unreg_user_text']);?></textarea>
1338
+ <?php
1339
+ if(get_option('users_can_register')){
1340
+ _e('Your register link code',$pd);
1341
+ echo '<br>';
1342
+ _e('(this will be automatically added if you have not added it yourself to the textarea above)',$pd);
1343
+ $register_link = apply_filters('register','<a href="' . site_url('wp-login.php?action=register', 'login') . '">' . __('Register') . '</a>');
1344
+ echo ' : <input style="width:95%" type="text" value="'.htmlentities($register_link).'" disabled/>';
1345
+ }
1346
+ ?>
1347
+ </td>
1348
+ <td colspan="2" style="width:125px;">
1349
+ <?php // show warning if registration is not enabled
1350
+ if(!get_option('users_can_register')){
1351
+ echo '<div style="border: 2px dashed red;">';
1352
+ _e('You have NOT set your blog to allow registrations, you can do that in Settings/General',$pd);
1353
+ echo ' <a href="'.admin_url('options-general.php').'">'.__('here',$pd).'</a>';
1354
+ echo '</div>';
1355
+ }
1356
+ ?>
1357
+ </td>
1358
+ </tr>
1359
+ <tr>
1360
+ <td colspan="3">
1361
+ <?php _e('Message for unregistered user in the info panel',$pd);?>
1362
+ <br>(<?php _e('Message will not be shown if you do not have registrations enabled',$this->plugin_domain);?>)
1363
+ <br><textarea rows="5" style="width:95%;" name="<?php echo $dbo;?>[unreg_user_text_panel]"><?php echo htmlentities($o['unreg_user_text_panel']);?></textarea>
1364
+ </td>
1365
+ <td></td>
1366
+ <td></td>
1367
+ </tr>
1368
+ </tbody>
1369
+ </table>
1370
+
1371
+ <br>
1372
+
1373
+ <table class="widefat ifenable operational-settings">
1374
+ <thead>
1375
+ <tr>
1376
+ <th colspan="2"><?php _e('Operational Settings',$pd);?></th><th scope="col"></th><th></th><th style="text-align: center;"><?php _e('Help Video',$pd);?></th>
1377
+
1378
+ </tr>
1379
+ </thead>
1380
+ <tbody>
1381
+ <tr>
1382
+ <td colspan="4">
1383
+ <?php _e('Who to give 10 last posts to choose from when they comment?',$pd);?>
1384
+ <p><input type="radio" name="<?php echo $dbo;?>[whogets]" value="registered" <?php checked($o['whogets'],'registered');?>/> <label for="<?php echo $dbo;?>[whogets]"><?php _e('Only Registered Members',$pd);?></label>
1385
+ <input style="margin-left: 25px;" type="radio" name="<?php echo $dbo;?>[whogets]" value="everybody" <?php checked($o['whogets'],'everybody');?>/> <label for="<?php echo $dbo;?>[whogets]"><?php _e('Everybody',$pd);?></label>
1386
+ <input style="margin-left: 25px;" type="radio" name="<?php echo $dbo;?>[whogets]" value="nobody" <?php checked($o['whogets'],'nobody');?>/> <label for="<?php echo $dbo;?>[whogets]"><?php _e('Nobody',$pd);?></label>
1387
+
1388
+ </td>
1389
+ <td style="text-align: center; border: 2px dotted; width:125px"><a onclick="return false;" href="<?php echo $this->plugin_url . 'videos/'; ?>operationalsettings.php?KeepThis=true&amp;TB_iframe=true&amp;height=355&width=545" class="thickbox"><img src="<?php echo $this->plugin_url;?>images/playbuttonsmall.png"/></a></td>
1390
+ </tr>
1391
+ <tr>
1392
+ <td colspan="5">
1393
+ <?php _e('Whose links should be dofollow?',$pd);?>
1394
+ <p><input type="radio" name="<?php echo $dbo;?>[dofollow]" value="registered" <?php checked($o['dofollow'],'registered');?>/> <label for="<?php echo $dbo;?>[whogets]"><?php _e('Only Registered Members Links',$pd);?></label>
1395
+ <input style="margin-left: 25px;" type="radio" name="<?php echo $dbo;?>[dofollow]" value="everybody" <?php checked($o['dofollow'],'everybody');?>/> <label for="<?php echo $dbo;?>[whogets]"><?php _e('Everybody gets dofollow links',$pd);?></label>
1396
+ <input style="margin-left: 25px;" type="radio" name="<?php echo $dbo;?>[dofollow]" value="nobody" <?php checked($o['dofollow'],'nobody');?>/> <label for="<?php echo $dbo;?>[whogets]"><?php _e('Nobody gets dofollow links',$pd);?></label>
1397
+ </td>
1398
+ </tr>
1399
+ </tbody>
1400
+ </table>
1401
+
1402
+ <br>
1403
+
1404
+ <table class="widefat ifenable technical" style="border: 3px solid red">
1405
+ <thead>
1406
+ <tr>
1407
+ <th colspan="2"><?php _e('Technical Settings',$pd);?></th><th scope="col"><span id="opentech" style="color: blue; cursor: pointer;"><?php _e('Click to open technical settings',$pd);?></span></th><th></th><th style="text-align: center;"><?php _e('Help Video',$pd);?></th>
1408
+
1409
+ </tr>
1410
+ </thead>
1411
+ <tbody id="techbody" style="display:none">
1412
+ <tr>
1413
+ <td colspan="4">
1414
+ <h3><?php _e('Please check the help video for this section before changing settings',$pd);?></h3>
1415
+ <?php _e('In most cases, you will NOT need to change the settings in this box unless you have a custom comment form, template or you are using minifying or caching plugins',$pd);?>
1416
+ </td>
1417
+ <td style="text-align: center; border: 2px dotted; width:125px"><a onclick="return false;" href="<?php echo $this->plugin_url . 'videos/'; ?>technicalsettings.php?KeepThis=true&amp;TB_iframe=true&amp;height=355&width=545" class="thickbox"><img src="<?php echo $this->plugin_url;?>images/playbuttonsmall.png"/></a></td>
1418
+ </tr>
1419
+ <tr>
1420
+ <td style="background-color: #dfdfdf; text-align: center; font-weight: bolder;" colspan="5"><?php _e('Compatibility',$pd);?></td>
1421
+ </tr>
1422
+ <tr>
1423
+ <td colspan="2">
1424
+ <input type="checkbox" name="<?php echo $dbo;?>[template_insert]" <?php checked($o['template_insert'],'on');?> value="on"/><label for="<?php echo $dbo;?>[template_insert]"> <?php _e('Use manual insert of badge code?',$pd);?></label>
1425
+ <br>( <strong>&lt;?php cl_display_badge(); ?&gt;</strong> )
1426
+ </td>
1427
+ <td colspan="2">
1428
+ <input type="checkbox" name="<?php echo $dbo;?>[minifying]" <?php checked($o['minifying'],'on');?> value="on"/><label for="<?php echo $dbo;?>[minifying]"> <?php _e('Enable minifying compatibility?',$pd);?></label>
1429
+ <br><?php _e('For caching plugins (places localized code in footer)',$pd);?>
1430
+ </td>
1431
+ <td>
1432
+ <input type="checkbox" name="<?php echo $dbo;?>[disable_detect]" <?php checked($o['disable_detect'],'on');?> value="on"/><label for="<?php echo $dbo;?>[disable_detect]"> <?php _e('Disable Detection?',$pd);?></label>
1433
+ <br><?php _e('For XML errors',$pd);?>
1434
+ </td>
1435
+ </tr>
1436
+ <tr>
1437
+ <td style="background-color: #dfdfdf; text-align: center; font-weight: bolder;" colspan="5"><?php _e('API URL',$pd);?></td>
1438
+ </tr>
1439
+ <tr>
1440
+ <td colspan="4">
1441
+ <input type="text" size="60" name="<?php echo $dbo;?>[api_url]" value="<?php echo $o['api_url'];?>"/><label for="<?php echo $dbo;?>[api_url]"> <?php _e('URL to use for API',$pd);?></label>
1442
+ </td>
1443
+ </tr>
1444
+ <tr>
1445
+ <td style="background-color: #dfdfdf; text-align: center; font-weight: bolder;" colspan="5"><?php _e('Comment Form Field Values',$pd);?></td>
1446
+ </tr>
1447
+ <tr>
1448
+ <td colspan="2"><?php _e('Authors Name field name',$this->plugin_domain);?></td>
1449
+ <td colspan="2"><input type="text" value="<?php echo $o['author_name'];?>" name="<?php echo $dbo;?>[author_name]"/></td>
1450
+ <td></td>
1451
+ </tr>
1452
+ <tr>
1453
+ <td colspan="2"><?php _e('Email field name',$this->plugin_domain);?></td>
1454
+ <td colspan="2"><input value="<?php echo $o['email_name'];?>" type="text" name="<?php echo $dbo;?>[email_name]"/></td>
1455
+ <td></td>
1456
+ </tr>
1457
+ <tr>
1458
+ <td colspan="2"><?php _e('Authors URL field name',$this->plugin_domain);?></td>
1459
+ <td colspan="2"><input value="<?php echo $o['url_name'];?>" type="text" name="<?php echo $dbo;?>[url_name]"/></td>
1460
+ <td></td>
1461
+ </tr>
1462
+ <tr>
1463
+ <td colspan="2"><?php _e('Comment Text Area name',$this->plugin_domain);?></td>
1464
+ <td colspan="2"><input value="<?php echo $o['comment_name'];?>" type="text" name="<?php echo $dbo;?>[comment_name]"/></td>
1465
+ <td></td>
1466
+ </tr>
1467
+ <tr>
1468
+ <td style="background-color: #dfdfdf; text-align: center; font-weight: bolder;" colspan="5"><?php _e('Diagnostics Info',$pd);?></td>
1469
+ </tr>
1470
+ <tr>
1471
+ <td colspan="4"><textarea style="width: 99%" rows="5">
1472
+ <?php
1473
+ $options = $this->get_options();
1474
+ $options['version'] = $this->version;
1475
+ $options['home_url'] = get_home_url();
1476
+ $options['wp_version'] = get_bloginfo('version');
1477
+ $options['charset'] = get_bloginfo('charset');
1478
+ $options['curl'] = function_exists('curl_init')? 'yes': 'no';
1479
+
1480
+ print_r($options);
1481
+
1482
+ ?>
1483
+ </textarea>
1484
+ </td>
1485
+ <td>
1486
+ <?php _e('You can copy this information and send it to me if I request it',$pd);?>
1487
+ </td>
1488
+ </tr>
1489
+ </tbody>
1490
+ </table>
1491
+
1492
+ </div>
1493
+ <div class="submit"><input class="button-primary" id="clsubmit" type="submit" name="Submit" value="<?php _e('Save Settings',$this->plugin_domain);?>" /></div>
1494
+ </form>
1495
+ <h3><?php _e('Reset Settings',$this->plugin_domain);?></h3>
1496
+ <form method="post" action="options.php">
1497
+ <?php settings_fields( 'commentluv_options_group' ); // the name given in admin init
1498
+ $javamsg = __('Are you sure you want to reset your settings? Press OK to continue',$this->plugin_domain);
1499
+ ?>
1500
+ <input type="hidden" name="<?php echo $this->db_option;?>[reset]" value="yes"/>
1501
+ <input style="background-color: red;" type="submit" onclick="<?php echo 'if(confirm(\''.$javamsg.'\') != true) { return false; } else { return true; } ';?>" value="<?php _e('Reset',$this->plugin_domain);?>" name="submit"/>
1502
+ </form>
1503
+
1504
+
1505
+ </div> <!-- end main block div -->
1506
+ <div style="float:left">
1507
+ <table class="widefat" style="width: 230px; margin-left: 10px;">
1508
+ <thead>
1509
+ <tr><th scope="col"><?php _e('Plugin Info',$this->plugin_domain);?></th><th>&nbsp;</th></tr>
1510
+ </thead>
1511
+ <tbody>
1512
+ <tr><td colspan="2"><div style="background: url(<?php echo $this->plugin_url;?>images/playbutton.png); text-align: center; font-size: 1.4em; width: 228px; height: 44px; overflow: hidden;"><br><?php _e('Start Here',$this->plugin_domain);?></div><div><a onclick="return false;" href="<?php echo $this->plugin_url . 'videos/'; ?>starthere.php?KeepThis=true&amp;TB_iframe=true&amp;height=355&width=545" class="thickbox"><img src="<?php echo $this->plugin_url;?>images/playbuttonfront.png"/></a></div></td></tr>
1513
+ <tr><td><strong><?php _e('Author',$this->plugin_domain);?>:</strong></td><td>Andy Bailey</td></tr>
1514
+ <tr><td><strong><?php _e('Home Page',$this->plugin_domain);?>:</strong></td><td><a title="<?php _e('Visit www.commentluv.com!',$this->plugin_domain);?>" href="http://www.commentluv.com/" target="_blank">commentluv.com</a></td></tr>
1515
+ <tr><td><strong><?php _e('Social',$this->plugin_domain);?>:</strong></td><td><a title="Follow CommentLuv on Twitter" href="http://twitter.com/commentluv/" target="_blank"><img src="<?php echo $this->plugin_url;?>images/twitter.png"/></a> <a title="Join me on LinkedIn" href="http://uk.linkedin.com/in/commentluv" target="_blank"><img src="<?php echo $this->plugin_url;?>images/linkedin.png"/></a> <a title="Join me on Facebook" href="http://www.facebook.com/CommentLuv" target="_blank"><img src="<?php echo $this->plugin_url;?>images/facebook.png"/></a></td></tr>
1516
+ <tr><td><strong><?php _e('Help',$this->plugin_domain);?>:</strong></td><td><a href="http://support.commentluv.com/" target="_blank"><?php _e('Help Desk',$this->plugin_domain);?></a></td></tr>
1517
+ <tr class="alt"><td colspan="2"><?php _e('Do you like this plugin?',$this->plugin_domain);?></td></tr>
1518
+ <tr><td colspan="2"><iframe src="http://www.facebook.com/plugins/like.php?app_id=156518444414150&amp;href=www.facebook.com%2Fcommentluv&amp;send=false&amp;layout=standard&amp;width=230&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=50" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:220px; height:50px;" allowTransparency="true"></iframe></td></tr>
1519
+ <tr class="alt"><td colspan="2"><?php _e('News',$this->plugin_domain);?>:</td></tr>
1520
+ <tr><td colspan="2">
1521
+ <?php
1522
+ include_once(ABSPATH . WPINC . '/rss.php');
1523
+ wp_rss('http://comluv.com/category/newsletter/feed',3);?>
1524
+ </td></tr>
1525
+ <tr class="alt"><td colspan="2"><?php _e('Thanks to the following for translations',$this->plugin_domain);?>:</td></tr>
1526
+ <tr><td><img src="<?php echo $this->plugin_url;?>images/it.png"/> <?php _e('Italian',$this->plugin_domain);?></td><td><a target="_blank" href="http://gidibao.net/">Gianni Diuno</a></td></tr>
1527
+ <tr><td><img src="<?php echo $this->plugin_url;?>images/nl.png"/> <?php _e('Dutch',$this->plugin_domain);?></td><td><a target="_blank" href="http://wpwebshop.com/">Rene</a></td></tr>
1528
+ <tr><td><img src="<?php echo $this->plugin_url;?>images/pl.png"/> <?php _e('Polish',$this->plugin_domain);?></td><td><a target="_blank" href="http://techformator.pl/">Mariusz Kolacz</a></td></tr>
1529
+ <tr><td><img src="<?php echo $this->plugin_url;?>images/ge.png"/> <?php _e('Georgian',$this->plugin_domain);?></td><td><a target="_blank" href="http://www.findmyhosting.com">Kasia Ciszewski</a></td></tr>
1530
+ <tr><td><img src="<?php echo $this->plugin_url;?>images/lt.png"/> <?php _e('Lithuanian',$this->plugin_domain);?></td><td><a target="_blank" href="http://mantas.malcius.lt/">Mantas Malcius</a></td></tr>
1531
+ <tr><td><img src="<?php echo $this->plugin_url;?>images/br.png"/> <?php _e('Portuguese',$this->plugin_domain);?></td><td><a target="_blank" href="http://www.korvo.com.br/">Diego Uczak</a></td></tr>
1532
+ <tr><td><img src="<?php echo $this->plugin_url;?>images/my.png"/> <?php _e('Malaysian',$this->plugin_domain);?></td><td><a target="_blank" href="http://ariffshah.com/">Ariff Shah</a></td></tr>
1533
+ <tr><td><img src="<?php echo $this->plugin_url;?>images/in.png"/> <?php _e('Hindi',$this->plugin_domain);?></td><td><a target="_blank" href="http://outshinesolutions.com/">Outshine Solutions</a></td></tr>
1534
+ <tr><td><img src="<?php echo $this->plugin_url;?>images/id.png"/> <?php _e('Indonesian',$this->plugin_domain);?></td><td><a target="_blank" href="http://rainerflame.com/">Mokhamad Oky</a></td></tr>
1535
+ <tr><td><img src="<?php echo $this->plugin_url;?>images/cn.png"/> <?php _e('Chinese (s)',$this->plugin_domain);?></td><td><a target="_blank" href="http://obugs.net/">Third Eye</a></td></tr>
1536
+ <tr><td><img src="<?php echo $this->plugin_url;?>images/es.png"/> <?php _e('Spanish',$this->plugin_domain);?></td><td><a target="_blank" href="http://www.activosenred.com/">Valentin Yonte</a></td></tr>
1537
+ <tr><td><img src="<?php echo $this->plugin_url;?>images/de.png"/> <?php _e('German',$this->plugin_domain);?></td><td><a target="_blank" href="http://www.cloudliving.de/">Jan Ruehling</a></td></tr>
1538
+ <tr><td><img src="<?php echo $this->plugin_url;?>images/ir.png"/> <?php _e('Persian',$this->plugin_domain);?></td><td><a target="_blank" href="http://www.3eo.ir/">Amir heydari</a></td></tr>
1539
+ <tr><td><img src="<?php echo $this->plugin_url;?>images/ru.png"/> <?php _e('Russian',$this->plugin_domain);?></td><td><!--<a target="_blank" href="http://www.fatcow.com/">Fatcow</a>--></td></tr>
1540
+
1541
+ <tr><td><img src="<?php echo $this->plugin_url;?>images/il.png"/> <?php _e('Hebrew',$this->plugin_domain);?></td><td><!--<a target="_blank" href="http://www.maorb.info/">Maor Barazany</a>--></td></tr>
1542
+ <tr><td><img src="<?php echo $this->plugin_url;?>images/fr.png"/> <?php _e('French',$this->plugin_domain);?></td><td><!--<a target="_blank" href="http://referenceurfreelance.com/">Leo</a>--></td></tr>
1543
+
1544
+ <tr><td><img src="<?php echo $this->plugin_url;?>images/ro.png"/> <?php _e('Romanian',$this->plugin_domain);?></td><td><!--<a target="_blank" href="http://www.mlb.ro/">Bogdan Martinescu</a>--></td></tr>
1545
+
1546
+ <tr><td><img src="<?php echo $this->plugin_url;?>images/sa.png"/> <?php _e('Arabic',$this->plugin_domain);?></td><td><!--<a target="_blank" href="http://www.melzarei.be/">Muhammad Elzarei</a>--></td></tr>
1547
+
1548
+ <tr><td><strong><?php _e('Want your link here?',$this->plugin_domain);?></strong></td><td><a target="_blank" href="http://support.commentluv.com/ticket/knowledgebase.php?article=1"><?php _e('How To Submit A Translation',$this->plugin_domain);?></a></td></tr>
1549
+ <tr class="alt"><td colspan="2"><?php _e('Special thanks go to the following',$this->plugin_domain);?>:</td></tr>
1550
+ <tr><td><strong><?php _e('CSS Help',$this->plugin_domain);?>:</strong></td><td><a href="http://www.famousbloggers.net" target="_blank">Hesham Zebida</a></td></tr>
1551
+ <tr><td><strong><?php _e('Badge GFX',$this->plugin_domain);?>:</strong></td><td><a href="http://byteful.com/" target="_blank">Byteful Travel</a></td></tr>
1552
+ </tbody>
1553
+ </table>
1554
+ </div>
1555
+
1556
+
1557
+ </div>
1558
+ <div class="clear"></div>
1559
+ </div>
1560
+ <?php
1561
+
1562
+ }
1563
+
1564
+
1565
+ } // end class
1566
+ } // end if class not exists
1567
+
1568
+ $clbadgeshown = false;
1569
+ // start commentluv class engines
1570
+ if (class_exists ( 'commentluv' )) :
1571
+ $commentluv = new commentluv ( );
1572
+ // confirm warp capability
1573
+ if (isset ( $commentluv )) {
1574
+ // engage
1575
+ register_activation_hook ( __FILE__, array (&$commentluv, 'install' ) );
1576
+ }
1577
+ endif;
1578
+
1579
+ function cl_display_badge(){
1580
+ global $commentluv;
1581
+ if(isset($commentluv)){
1582
+ $commentluv->display_badge();
1583
+ }
1584
+
1585
+ }
1586
+ ?>
images/ir.png ADDED
Binary file
js/commentluv.js CHANGED
@@ -1,4 +1,4 @@
1
- // commentluv 2.90.6
2
  jQuery(document).ready(function(){
3
  // get the form object and fields
4
  var formObj = jQuery('#cl_post_title').parents('form');
@@ -177,19 +177,19 @@ function cl_dostuff(){
177
  if(cl_settings['api_url'].indexOf('https') == 0){
178
  cl_message('This blog has set the api url to use https , the commentluv technical settings need to be changed for the API url to use http');
179
  } else {
180
- cl_message('It appears that you are offline!!\n Please Check Your Network.');
181
  }
182
 
183
  }else if(x.status==404){
184
  cl_message('API URL not found.');
185
  }else if(x.status==500){
186
- cl_message('Internal Server Error.');
187
  }else if(e=='parsererror'){
188
  cl_message('Error.\nParsing JSON Request failed.' + x.response);
189
  }else if(e=='timeout'){
190
  cl_message('Request Time out.');
191
  }else {
192
- cl_message('Unknow Error. ' + x.statusText);
193
  }
194
  }
195
  });
1
+ // commentluv 2.90.7
2
  jQuery(document).ready(function(){
3
  // get the form object and fields
4
  var formObj = jQuery('#cl_post_title').parents('form');
177
  if(cl_settings['api_url'].indexOf('https') == 0){
178
  cl_message('This blog has set the api url to use https , the commentluv technical settings need to be changed for the API url to use http');
179
  } else {
180
+ cl_message('It appears that you are offline or another error occured contacting the API url, have you set it to use www or missed the www off the api url?? check the technical settings and add or remove www from the api url.');
181
  }
182
 
183
  }else if(x.status==404){
184
  cl_message('API URL not found.');
185
  }else if(x.status==500){
186
+ cl_message('Internal Server Error.' + x.response);
187
  }else if(e=='parsererror'){
188
  cl_message('Error.\nParsing JSON Request failed.' + x.response);
189
  }else if(e=='timeout'){
190
  cl_message('Request Time out.');
191
  }else {
192
+ cl_message('Unknow Error. ' + x.statusText + ' ' + x.response);
193
  }
194
  }
195
  });
lang/commentluv-de_DE.mo ADDED
Binary file
lang/commentluv-de_DE.po ADDED
@@ -0,0 +1,582 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: CommentLuv 2.8.9.8\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2011-06-12 18:43-0000\n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: Jan Ruehling <janruehling@gmail.com>\n"
8
+ "Language-Team: Jan Ruehling <janruehling@gmail.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-KeywordsList: __;_e\n"
13
+ "X-Poedit-Basepath: .\n"
14
+ "X-Poedit-Language: German\n"
15
+ "X-Poedit-Country: GERMANY\n"
16
+ "X-Poedit-SearchPath-0: ..\n"
17
+
18
+ #: ../commentluv.php:48
19
+ msgid "CommentLuv requires Wordpress 3.0 or newer."
20
+ msgstr "CommentLuv benötigt Wordpress 3.0 oder höher."
21
+
22
+ #: ../commentluv.php:48
23
+ msgid "Please Update!"
24
+ msgstr "Bitte updaten!"
25
+
26
+ #: ../commentluv.php:217
27
+ msgid "Please enter a URL and then click the CommentLuv checkbox if you want to add your last blog post"
28
+ msgstr "Bitte gib eine Url ein und setze den Haken bei CommentLuv, wenn Du Deinen letzten Artikel einfügen möchtest"
29
+
30
+ #: ../commentluv.php:218
31
+ msgid "Please use http:// in front of your url"
32
+ msgstr "Bitte füge http:// vor Deiner Url ein"
33
+
34
+ #: ../commentluv.php:219
35
+ msgid "You need to visit your profile in the dashboard and update your details with your site URL"
36
+ msgstr "Bitte bearbeite die Angaben in Deinem Profil und aktualisiere die Url Deiner Webseite"
37
+
38
+ #: ../commentluv.php:220
39
+ msgid "No info was available or an error occured"
40
+ msgstr "Wir haben keine Informationen gefunden oder es ist ein Fehler aufgetreten"
41
+
42
+ #: ../commentluv.php:243
43
+ msgid "Please wait"
44
+ msgstr "Bitte warten"
45
+
46
+ #: ../commentluv.php:243
47
+ msgid "Please check your inbox, an email will be sent to"
48
+ msgstr "Bitte schau in Deinen Posteingang. Du bekommst eine E-Mail"
49
+
50
+ #: ../commentluv.php:243
51
+ msgid "in the next few minutes with a confirmation link"
52
+ msgstr "in den nächsten paar Minuten mit einem Bestätigungslink"
53
+
54
+ #: ../commentluv.php:243
55
+ msgid "An error happened with the request. Try signing up at the site"
56
+ msgstr "Es gab einen Fehler bei der Anfrage. Bitte versuch Dich auf der Seite einzuloggen"
57
+
58
+ #: ../commentluv.php:272
59
+ msgid "Your Wordpress install is missing the <strong>wp_commentmeta</strong> table!"
60
+ msgstr "Bei Deiner Wordpress Installation fehlt die <strong>wp_commentmeta</strong> Tabelle!"
61
+
62
+ #: ../commentluv.php:272
63
+ msgid " CommentLuv cannot work without this table please see this wordpress forum post to learn how to add one ->"
64
+ msgstr "CommentLuv kann mit dieser Tabelle nicht arbeiten. Bitte schau in das Wordpress-Forum, wie Du eine Neue anlegen kannst ->"
65
+
66
+ #: ../commentluv.php:272
67
+ msgid "Missing wp_commentmeta table"
68
+ msgstr "wp_commentmeta Tabelle fehlt"
69
+
70
+ #: ../commentluv.php:365
71
+ msgid "Twice Monthly"
72
+ msgstr "Zweimal pro Monat"
73
+
74
+ #: ../commentluv.php:392
75
+ msgid "CommentLuv is enabled"
76
+ msgstr "CommentLuv ist aktiviert"
77
+
78
+ #: ../commentluv.php:433
79
+ msgid "Show more posts"
80
+ msgstr "Weitere Artikel zeigen"
81
+
82
+ #: ../commentluv.php:523
83
+ msgid "I have only commented on this post"
84
+ msgstr "Ich habe nur diesen Artikel kommentiert"
85
+
86
+ #: ../commentluv.php:526
87
+ msgid "If I had made more comments on this site, you would see more of my other posts here"
88
+ msgstr "Wenn ich auf dieser Seite noch weitere Kommentare hinterlassen hätte, dann könntest Du sie jetzt hier sehen"
89
+
90
+ #: ../commentluv.php:551
91
+ msgid "User has not saved a description in their profile page"
92
+ msgstr "Der Nutzer hat keine Beschreibung auf seiner Profilseite hinterlassen"
93
+
94
+ #: ../commentluv.php:563
95
+ msgid "is the administrator of this site"
96
+ msgstr "ist Administrator dieser Seite"
97
+
98
+ #: ../commentluv.php:565
99
+ msgid "is a registered member of my site"
100
+ msgstr "ist ein registriertes Mitglied meiner Seite"
101
+
102
+ #: ../commentluv.php:568
103
+ #: ../commentluv.php:587
104
+ msgid "Clicks on this link on this comment"
105
+ msgstr "Klicks auf den Link in diesem Kommentar"
106
+
107
+ #: ../commentluv.php:568
108
+ #: ../commentluv.php:588
109
+ msgid "approved comments on this site"
110
+ msgstr "genehmigte Kommentare auf dieser Seite"
111
+
112
+ #: ../commentluv.php:568
113
+ #: ../commentluv.php:589
114
+ msgid "Some other posts I have commented on"
115
+ msgstr "Andere Artikel, die ich kommentiert habe"
116
+
117
+ #: ../commentluv.php:568
118
+ msgid "Some of my other posts"
119
+ msgstr "Andere Artikel von mir"
120
+
121
+ #: ../commentluv.php:581
122
+ msgid "has not registered on this site"
123
+ msgstr "ist nicht auf dieser Seite registriert"
124
+
125
+ #: ../commentluv.php:703
126
+ msgid "Could not get posts for home blog"
127
+ msgstr "Konnte keine Artikel auf dem Blog finden"
128
+
129
+ #: ../commentluv.php:759
130
+ msgid "If you are registered, you need to log in to get 10 posts to choose from"
131
+ msgstr "Wenn Du registriert bist, dann logge Dich ein, um aus den letzte 10 Artikeln auswählen zu können"
132
+
133
+ #: ../commentluv.php:783
134
+ #: ../commentluv.php:1235
135
+ msgid "Register"
136
+ msgstr "Registrieren"
137
+
138
+ #: ../commentluv.php:788
139
+ msgid "recently posted"
140
+ msgstr "kürzlich veröffentlicht"
141
+
142
+ #: ../commentluv.php:789
143
+ msgid "If you register as a user on my site, you can get your 10 most recent blog posts to choose from in this box."
144
+ msgstr "Wenn Du Dich auf meiner Seite registrierst, dann kannst Du in dieser Box aus Deinen letzten 10 Artikeln auswählen"
145
+
146
+ #: ../commentluv.php:790
147
+ msgid "If this user had registered to my site then they could get 10 last posts to choose from when they comment and you would be able to see a list of their recent posts in this panel"
148
+ msgstr "Wenn sich dieser Nutzer auf meiner Seite registriert hätte, dann könnte er aus seinen letzten 10 Artikeln auswählen und Du könntest an dieser Stelle eine Liste seiner letzten Artikel sehen"
149
+
150
+ #: ../commentluv.php:971
151
+ msgid "Settings"
152
+ msgstr "Einstellungen"
153
+
154
+ #: ../commentluv.php:1010
155
+ msgid "No Posts Were Found!"
156
+ msgstr "Keine Artikel gefunden!"
157
+
158
+ #: ../commentluv.php:1050
159
+ msgid "There is a new version of Commentluv available, please upgrade by visiting this site"
160
+ msgstr "Es gibt eine neue Version von CommentLuv. Du findest das Upgrade auf dieser Seite"
161
+
162
+ #: ../commentluv.php:1053
163
+ msgid "Dismiss notice"
164
+ msgstr "Ignorieren"
165
+
166
+ #: ../commentluv.php:1080
167
+ msgid "CommentLuv Settings v"
168
+ msgstr "CommentLuv Einstellungen v"
169
+
170
+ #: ../commentluv.php:1090
171
+ msgid "Important!"
172
+ msgstr "Wichtig!"
173
+
174
+ #: ../commentluv.php:1090
175
+ msgid "Subscription Information"
176
+ msgstr "Konto Informationen"
177
+
178
+ #: ../commentluv.php:1095
179
+ msgid "CommentLuv 3.0 Premium is coming soon!"
180
+ msgstr "CommentLuv 3.0 kommt bald!"
181
+
182
+ #: ../commentluv.php:1096
183
+ msgid "I promise not to sell your details or send you spam. You will ONLY receive emails about plugin updates."
184
+ msgstr "Ich werde Deine Daten niemals verkaufen oder Dir Spam senden. Du wirst NUR E-Mails mit Informationen über Plugin-Updates bekommen."
185
+
186
+ #: ../commentluv.php:1099
187
+ msgid "There is a premium version of CommentLuv coming that will have much more control of how the plugin works as well as exclusive features like keyword name, inline registration and much much more!. Signup to find out as soon as it is ready"
188
+ msgstr "Es gibt demnächst eine Premiumversion von CommentLuv mit der Du mehr Kontrolle über die Funktionen des Plugins hast und das exklusive Features wie Keywort-Namen, Inline-Registrierungen und vieles mehr bietet! Trage Dich in die Liste ein und Du wirst benachrichtigt, sobald es fertig ist"
189
+
190
+ #: ../commentluv.php:1102
191
+ msgid "You have already subscribed, if you have not received the verification within 12 hours, please click the button to resend or try the form at"
192
+ msgstr "Du bist schon eingetragen. Wenn die Bestätigungsmail nach 12 Stunden noch nicht bekommen hast, klicke den Nochmal-Button oder nutze das Formular auf"
193
+
194
+ #: ../commentluv.php:1102
195
+ msgid "Resend Verification"
196
+ msgstr "Bestätigungsmail nochmal senden"
197
+
198
+ #: ../commentluv.php:1104
199
+ msgid "Click to register now!"
200
+ msgstr "Klicke um Dich zu registrieren"
201
+
202
+ #: ../commentluv.php:1119
203
+ msgid "Primary Setting"
204
+ msgstr "Grundeinstellungen"
205
+
206
+ #: ../commentluv.php:1119
207
+ #: ../commentluv.php:1153
208
+ #: ../commentluv.php:1212
209
+ #: ../commentluv.php:1268
210
+ #: ../commentluv.php:1299
211
+ msgid "Help Video"
212
+ msgstr "Hilfe Video"
213
+
214
+ #: ../commentluv.php:1123
215
+ msgid "Enable CommentLuv?"
216
+ msgstr "CommentLuv aktivieren?"
217
+
218
+ #: ../commentluv.php:1124
219
+ msgid "Yes"
220
+ msgstr "Ja"
221
+
222
+ #: ../commentluv.php:1125
223
+ msgid "No"
224
+ msgstr "Nein"
225
+
226
+ #: ../commentluv.php:1130
227
+ msgid "On Posts"
228
+ msgstr "Bei Artikeln"
229
+
230
+ #: ../commentluv.php:1131
231
+ msgid "On Pages"
232
+ msgstr "Bei Seiten"
233
+
234
+ #: ../commentluv.php:1132
235
+ msgid "On Both"
236
+ msgstr "Beides"
237
+
238
+ #: ../commentluv.php:1137
239
+ msgid "On by default?"
240
+ msgstr "Standardmäßig an?"
241
+
242
+ #: ../commentluv.php:1141
243
+ msgid "On for admin?"
244
+ msgstr "An für Admin?"
245
+
246
+ #: ../commentluv.php:1153
247
+ msgid "Appearance"
248
+ msgstr "Design"
249
+
250
+ #: ../commentluv.php:1157
251
+ msgid "Badge"
252
+ msgstr "Banner"
253
+
254
+ #: ../commentluv.php:1158
255
+ msgid "Custom Image URL"
256
+ msgstr "Eigene Bild-Url"
257
+
258
+ #: ../commentluv.php:1159
259
+ msgid "Use Text"
260
+ msgstr "Nur Text"
261
+
262
+ #: ../commentluv.php:1167
263
+ msgid "Default"
264
+ msgstr "Standard"
265
+
266
+ #: ../commentluv.php:1168
267
+ msgid "White"
268
+ msgstr "Weiss"
269
+
270
+ #: ../commentluv.php:1169
271
+ msgid "Black"
272
+ msgstr "Schwarz"
273
+
274
+ #: ../commentluv.php:1170
275
+ msgid "None"
276
+ msgstr "Keine"
277
+
278
+ #: ../commentluv.php:1187
279
+ msgid "Link to Commentluv?"
280
+ msgstr "Link zu CommentLuv?"
281
+
282
+ #: ../commentluv.php:1194
283
+ msgid "Enable info panel?"
284
+ msgstr "Info-Panel aktivieren?"
285
+
286
+ #: ../commentluv.php:1195
287
+ msgid "Info panel background color"
288
+ msgstr "Info-Panel Hintergrundfarbe"
289
+
290
+ #: ../commentluv.php:1196
291
+ msgid "Info panel text color"
292
+ msgstr "Info-Panel Textfarbe"
293
+
294
+ #: ../commentluv.php:1202
295
+ msgid "Example text and background color"
296
+ msgstr "Beispiel Text und Hintergrundfarbe"
297
+
298
+ #: ../commentluv.php:1212
299
+ msgid "Messages"
300
+ msgstr "Nachrichten"
301
+
302
+ #: ../commentluv.php:1219
303
+ msgid "Text to be displayed in the comment"
304
+ msgstr "Text, der in den Kommentaren angezeigt wird"
305
+
306
+ #: ../commentluv.php:1222
307
+ msgid "[name] = The users name"
308
+ msgstr "[name] = Der Name des Nutzers"
309
+
310
+ #: ../commentluv.php:1222
311
+ msgid "[lastpost] = The last blog post link"
312
+ msgstr "[lastpost] = Link zum letzten Artikel"
313
+
314
+ #: ../commentluv.php:1229
315
+ msgid "Message for unregistered user in the drop down box"
316
+ msgstr "Nachricht für Nicht-Registrierte Nutzer in der Dropdown-Box"
317
+
318
+ #: ../commentluv.php:1230
319
+ #: ../commentluv.php:1254
320
+ msgid "Message will not be shown if you do not have registrations enabled"
321
+ msgstr "Die Nachricht wird nicht angezeigt, wenn Du Registrierungen auf Deinem Blog deaktiviert hast"
322
+
323
+ #: ../commentluv.php:1234
324
+ msgid "Your register link code"
325
+ msgstr "Dein Registrierungslink"
326
+
327
+ #: ../commentluv.php:1244
328
+ msgid "You have NOT set your blog to allow registrations, you can do that in Settings/General"
329
+ msgstr "Du hast Registrierungen auf Deinem Blog deaktiviert. Du kannst das unter Einstellungen/Allgemein ändern"
330
+
331
+ #: ../commentluv.php:1245
332
+ msgid "here"
333
+ msgstr "hier"
334
+
335
+ #: ../commentluv.php:1253
336
+ msgid "Message for unregistered user in the info panel"
337
+ msgstr "Nachricht für Nicht-Registrierte Nutzer im Info-Panel"
338
+
339
+ #: ../commentluv.php:1268
340
+ msgid "Operational Settings"
341
+ msgstr "Operative Einstellungen"
342
+
343
+ #: ../commentluv.php:1275
344
+ msgid "Who to give 10 last posts to choose from when they comment?"
345
+ msgstr "Wer soll die Möglichkeit haben, aus den letzten 10 Artikeln auszuwählen?"
346
+
347
+ #: ../commentluv.php:1276
348
+ msgid "Only Registered Members"
349
+ msgstr "Nur registrierte Nutzer"
350
+
351
+ #: ../commentluv.php:1277
352
+ msgid "Everybody"
353
+ msgstr "Jeder"
354
+
355
+ #: ../commentluv.php:1278
356
+ msgid "Nobody"
357
+ msgstr "Niemand"
358
+
359
+ #: ../commentluv.php:1285
360
+ msgid "Whose links should be dofollow?"
361
+ msgstr "Wessen Links bekommen das dofollow - Attribut?"
362
+
363
+ #: ../commentluv.php:1286
364
+ msgid "Only Registered Members Links"
365
+ msgstr "Nur Links von registrierten Nutzern"
366
+
367
+ #: ../commentluv.php:1287
368
+ msgid "Everybody gets dofollow links"
369
+ msgstr "Jeder bekommt dofollow - Links"
370
+
371
+ #: ../commentluv.php:1288
372
+ msgid "Nobody gets dofollow links"
373
+ msgstr "Niemand bekommt dofollow - Links"
374
+
375
+ #: ../commentluv.php:1299
376
+ msgid "Technical Settings"
377
+ msgstr "Technische Einstellungen"
378
+
379
+ #: ../commentluv.php:1299
380
+ msgid "Click to open technical settings"
381
+ msgstr "Klicke, um die technischen Einstellungen zu öffnen"
382
+
383
+ #: ../commentluv.php:1306
384
+ msgid "Please check the help video for this section before changing settings"
385
+ msgstr "Bitte schaue Dir das Hilfe-Video an, bevor Du irgendetwas an den technischen Einstellungen änderst"
386
+
387
+ #: ../commentluv.php:1307
388
+ msgid "In most cases, you will NOT need to change the settings in this box unless you have a custom comment form, template or you are using minifying or caching plugins"
389
+ msgstr "In den meisten Fällen musst Du NICHTS an diesen Einstellungen ändern, es sei denn, Du verwendest eigene Formulare für die Kommentare, ein eigenes Template oder Cache- bzw Minifying - Plugins"
390
+
391
+ #: ../commentluv.php:1312
392
+ msgid "Compatibility"
393
+ msgstr "Kompatibilität"
394
+
395
+ #: ../commentluv.php:1316
396
+ msgid "Use manual insert of badge code?"
397
+ msgstr "Bannercode manuell eintragen?"
398
+
399
+ #: ../commentluv.php:1320
400
+ msgid "Enable minifying compatibility?"
401
+ msgstr "Minifying-Kompatibilität verwenden?"
402
+
403
+ #: ../commentluv.php:1321
404
+ msgid "For caching plugins (places localized code in footer)"
405
+ msgstr "Für Cache - Plugins (platziert den Code in den Footer)"
406
+
407
+ #: ../commentluv.php:1326
408
+ msgid "API URL"
409
+ msgstr "API URL"
410
+
411
+ #: ../commentluv.php:1330
412
+ msgid "URL to use for API"
413
+ msgstr "Die Url, die von der API benutzt wird"
414
+
415
+ #: ../commentluv.php:1334
416
+ msgid "Comment Form Field Values"
417
+ msgstr "Feldwerte des Formulars"
418
+
419
+ #: ../commentluv.php:1337
420
+ msgid "Authors Name field name"
421
+ msgstr "Name des Autors - Feld"
422
+
423
+ #: ../commentluv.php:1342
424
+ msgid "Email field name"
425
+ msgstr "E-Mail - Feld"
426
+
427
+ #: ../commentluv.php:1347
428
+ msgid "Authors URL field name"
429
+ msgstr "Url des Autors - Feld"
430
+
431
+ #: ../commentluv.php:1352
432
+ msgid "Comment Text Area name"
433
+ msgstr "Kommentar - Feld"
434
+
435
+ #: ../commentluv.php:1357
436
+ msgid "Diagnostics Info"
437
+ msgstr "Diagnose Info"
438
+
439
+ #: ../commentluv.php:1375
440
+ msgid "You can copy this information and send it to me if I request it"
441
+ msgstr "Bitte kopiere diese Informationen und sende sie mir zu, wenn ich Dich danach frage"
442
+
443
+ #: ../commentluv.php:1382
444
+ msgid "Save Settings"
445
+ msgstr "Einstellungen speichern"
446
+
447
+ #: ../commentluv.php:1384
448
+ msgid "Reset Settings"
449
+ msgstr "Einstellungen zurücksetzen"
450
+
451
+ #: ../commentluv.php:1387
452
+ msgid "Are you sure you want to reset your settings? Press OK to continue"
453
+ msgstr "Bist Du sicher, dass Du alle Einstellungen zurücksetzen möchtest? Bestätige mit OK"
454
+
455
+ #: ../commentluv.php:1390
456
+ msgid "Reset"
457
+ msgstr "Zurücksetzen"
458
+
459
+ #: ../commentluv.php:1398
460
+ msgid "Plugin Info"
461
+ msgstr "Plugin Info"
462
+
463
+ #: ../commentluv.php:1401
464
+ msgid "Start Here"
465
+ msgstr "Hier starten"
466
+
467
+ #: ../commentluv.php:1402
468
+ msgid "Author"
469
+ msgstr "Autor"
470
+
471
+ #: ../commentluv.php:1403
472
+ msgid "Home Page"
473
+ msgstr "Webseite"
474
+
475
+ #: ../commentluv.php:1403
476
+ msgid "Visit www.commentluv.com!"
477
+ msgstr "Besuche www.commentluv.com!"
478
+
479
+ #: ../commentluv.php:1404
480
+ msgid "Social"
481
+ msgstr "Social"
482
+
483
+ #: ../commentluv.php:1405
484
+ msgid "Help"
485
+ msgstr "Hilfe"
486
+
487
+ #: ../commentluv.php:1405
488
+ msgid "Help Desk"
489
+ msgstr "Help Desk"
490
+
491
+ #: ../commentluv.php:1406
492
+ msgid "Do you like this plugin?"
493
+ msgstr "Gefällt Dir dieses Plugin?"
494
+
495
+ #: ../commentluv.php:1408
496
+ msgid "News"
497
+ msgstr "News"
498
+
499
+ #: ../commentluv.php:1414
500
+ msgid "Thanks to the following for translations"
501
+ msgstr "Vielen Dank für die Übersetzungen an"
502
+
503
+ #: ../commentluv.php:1415
504
+ msgid "Italian"
505
+ msgstr "Italienisch"
506
+
507
+ #: ../commentluv.php:1416
508
+ msgid "Dutch"
509
+ msgstr "Niederländisch"
510
+
511
+ #: ../commentluv.php:1417
512
+ msgid "Polish"
513
+ msgstr "Polnisch"
514
+
515
+ #: ../commentluv.php:1418
516
+ msgid "Georgian"
517
+ msgstr "Georgisch"
518
+
519
+ #: ../commentluv.php:1419
520
+ msgid "Lithuanian"
521
+ msgstr "Litauisch"
522
+
523
+ #: ../commentluv.php:1420
524
+ msgid "Portuguese"
525
+ msgstr "Portugiesisch"
526
+
527
+ #: ../commentluv.php:1421
528
+ msgid "Malaysian"
529
+ msgstr "Malayisch"
530
+
531
+ #: ../commentluv.php:1422
532
+ msgid "Hindi"
533
+ msgstr "Hindi"
534
+
535
+ #: ../commentluv.php:1423
536
+ msgid "Russian"
537
+ msgstr "Russisch"
538
+
539
+ #: ../commentluv.php:1424
540
+ msgid "Chinese"
541
+ msgstr "Chinesisch"
542
+
543
+ #: ../commentluv.php:1425
544
+ msgid "Hebrew"
545
+ msgstr "Hebräisch"
546
+
547
+ #: ../commentluv.php:1426
548
+ msgid "French"
549
+ msgstr "Französisch"
550
+
551
+ #: ../commentluv.php:1428
552
+ msgid "Romanian"
553
+ msgstr "Rumänisch"
554
+
555
+ #: ../commentluv.php:1429
556
+ msgid "German"
557
+ msgstr "Deutsch"
558
+
559
+ #: ../commentluv.php:1430
560
+ msgid "Arabic"
561
+ msgstr "Arabisch"
562
+
563
+ #: ../commentluv.php:1432
564
+ msgid "Want your link here?"
565
+ msgstr "Möchtest Du auch einen Link?"
566
+
567
+ #: ../commentluv.php:1432
568
+ msgid "How To Submit A Translation"
569
+ msgstr "Wie Du eine Übersetzung einreichen kannst"
570
+
571
+ #: ../commentluv.php:1433
572
+ msgid "Special thanks go to the following"
573
+ msgstr "Besonderer Dank geht an"
574
+
575
+ #: ../commentluv.php:1434
576
+ msgid "CSS Help"
577
+ msgstr "CSS Hilfe"
578
+
579
+ #: ../commentluv.php:1435
580
+ msgid "Badge GFX"
581
+ msgstr "Banner Grafiken"
582
+
lang/commentluv-fa_IR.mo ADDED
Binary file
lang/commentluv-fa_IR.po ADDED
@@ -0,0 +1,582 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: CommentLuv 2.8.9.8\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2011-06-12 18:43-0000\n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: 3eo <soanmi777@yahoo.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.php:48
19
+ msgid "CommentLuv requires Wordpress 3.0 or newer."
20
+ msgstr "افزونه نیاز به وردپرس ورژن 3.0 به بالا دارد"
21
+
22
+ #: ../commentluv.php:48
23
+ msgid "Please Update!"
24
+ msgstr "!لطفا به روزرسانی کنید"
25
+
26
+ #: ../commentluv.php:217
27
+ msgid "Please enter a URL and then click the CommentLuv checkbox if you want to add your last blog post"
28
+ msgstr "لطفا آدرس را وارد کنید و اگر تمایل دارید که آخرین نوشته سایت شما در زیر نظرتان نمایش داده شود،بر روی نشان زیر کلیک کنید."
29
+
30
+ #: ../commentluv.php:218
31
+ msgid "Please use http:// in front of your url"
32
+ msgstr "استفاده کنید http:// لطفا قبل از آدرس خود از"
33
+
34
+ #: ../commentluv.php:219
35
+ msgid "You need to visit your profile in the dashboard and update your details with your site URL"
36
+ msgstr "لازم است که وارد پروفایل خود د داشبورد بشوید و اطلاعات خودتان را با آدرس سایتتان بروز کنید"
37
+
38
+ #: ../commentluv.php:220
39
+ msgid "No info was available or an error occured"
40
+ msgstr "اطلاعاتی در دسترس نیست و یا اینه مشکلی رخ داده است"
41
+
42
+ #: ../commentluv.php:243
43
+ msgid "Please wait"
44
+ msgstr "لطفا صبر کنید"
45
+
46
+ #: ../commentluv.php:243
47
+ msgid "Please check your inbox, an email will be sent to"
48
+ msgstr "لطفا ایمیل خود را چک کنید،ایمیلی برای شما ارسال خواهد شد"
49
+
50
+ #: ../commentluv.php:243
51
+ msgid "in the next few minutes with a confirmation link"
52
+ msgstr "که حاوی لینک فعال سازی می باشد"
53
+
54
+ #: ../commentluv.php:243
55
+ msgid "An error happened with the request. Try signing up at the site"
56
+ msgstr "مشکلی رخ داده است.سعی کنید که از طریق سایت عضو شوید"
57
+
58
+ #: ../commentluv.php:272
59
+ msgid "Your Wordpress install is missing the <strong>wp_commentmeta</strong> table!"
60
+ msgstr "وردپرس شما این جدول را ندارد <strong>wp_commentmeta</strong> "
61
+
62
+ #: ../commentluv.php:272
63
+ msgid " CommentLuv cannot work without this table please see this wordpress forum post to learn how to add one ->"
64
+ msgstr "<- افزونه بدون این جدول کار نمیکند.لطفا برای آموزش چگونگی ساخت این جدول به انجمن وردپرس مقابل مراجعه کنید"
65
+
66
+ #: ../commentluv.php:272
67
+ msgid "Missing wp_commentmeta table"
68
+ msgstr "از دست دادن جدول wp_commentmeta"
69
+
70
+ #: ../commentluv.php:365
71
+ msgid "Twice Monthly"
72
+ msgstr "دو بار ماهانه"
73
+
74
+ #: ../commentluv.php:392
75
+ msgid "CommentLuv is enabled"
76
+ msgstr "افزونه فعال است"
77
+
78
+ #: ../commentluv.php:433
79
+ msgid "Show more posts"
80
+ msgstr "نشان دادن نوشته های بیشتر"
81
+
82
+ #: ../commentluv.php:523
83
+ msgid "I have only commented on this post"
84
+ msgstr "من فقط در این پست نظر داده ام"
85
+
86
+ #: ../commentluv.php:526
87
+ msgid "If I had made more comments on this site, you would see more of my other posts here"
88
+ msgstr "اگر من در این سایت نظرات بیشتری دادم، شما میتوانید سایر نوشته های من را در این قسمت ببینید"
89
+
90
+ #: ../commentluv.php:551
91
+ msgid "User has not saved a description in their profile page"
92
+ msgstr "کاربر تا به حال توضیحات در صفحه شخصی خود را ذخیره ننموده است"
93
+
94
+ #: ../commentluv.php:563
95
+ msgid "is the administrator of this site"
96
+ msgstr "مدیر این سایت است"
97
+
98
+ #: ../commentluv.php:565
99
+ msgid "is a registered member of my site"
100
+ msgstr "کاربر عضو شده سایت من است"
101
+
102
+ #: ../commentluv.php:568
103
+ #: ../commentluv.php:587
104
+ msgid "Clicks on this link on this comment"
105
+ msgstr "تعداد کلیک ها برای این لینک"
106
+
107
+ #: ../commentluv.php:568
108
+ #: ../commentluv.php:588
109
+ msgid "approved comments on this site"
110
+ msgstr "نظرات تایید شده در این سایت"
111
+
112
+ #: ../commentluv.php:568
113
+ #: ../commentluv.php:589
114
+ msgid "Some other posts I have commented on"
115
+ msgstr "تعدای از نوشته هایی که من در آن نظر داده ام"
116
+
117
+ #: ../commentluv.php:568
118
+ msgid "Some of my other posts"
119
+ msgstr "تعدادی از سایر نوشته های من"
120
+
121
+ #: ../commentluv.php:581
122
+ msgid "has not registered on this site"
123
+ msgstr "در این سایت ثبت نام نکرده اید"
124
+
125
+ #: ../commentluv.php:703
126
+ msgid "Could not get posts for home blog"
127
+ msgstr "نمی تواند نوشته ها را برای صفحه اصلی دریافت کند"
128
+
129
+ #: ../commentluv.php:759
130
+ msgid "If you are registered, you need to log in to get 10 posts to choose from"
131
+ msgstr "اگر شما عضو سایت هستید،لازم است وارد شوید که 10 نوشته را انتخاب کنید"
132
+
133
+ #: ../commentluv.php:783
134
+ #: ../commentluv.php:1235
135
+ msgid "Register"
136
+ msgstr "عضویت"
137
+
138
+ #: ../commentluv.php:788
139
+ msgid "recently posted"
140
+ msgstr "آخرین نوشته سایت این دوست"
141
+
142
+ #: ../commentluv.php:789
143
+ msgid "If you register as a user on my site, you can get your 10 most recent blog posts to choose from in this box."
144
+ msgstr "اگر شما در سایت ما عضو باشید،میتوانید 10 نوشته اخیر سایت را از این جعبه انتخاب کنید."
145
+
146
+ #: ../commentluv.php:790
147
+ msgid "If this user had registered to my site then they could get 10 last posts to choose from when they comment and you would be able to see a list of their recent posts in this panel"
148
+ msgstr "اگر کاربران غیر عضو در سایت ما عضو شوند میتواندد 10 نوشته آخری را که در آن نظر داده اند را لیست کنند و شما میتوانید لیستی از آخرین نوشته های آن ها را در این پنل ببینید"
149
+
150
+ #: ../commentluv.php:971
151
+ msgid "Settings"
152
+ msgstr "تنظیمات"
153
+
154
+ #: ../commentluv.php:1010
155
+ msgid "No Posts Were Found!"
156
+ msgstr "!نوشته ای پیدا نشد"
157
+
158
+ #: ../commentluv.php:1050
159
+ msgid "There is a new version of Commentluv available, please upgrade by visiting this site"
160
+ msgstr "نسخه جدید افزونه موجود است.لطفا برای به روزرسانی افزونه با سیات مراجعه کنید"
161
+
162
+ #: ../commentluv.php:1053
163
+ msgid "Dismiss notice"
164
+ msgstr "بستن توجه"
165
+
166
+ #: ../commentluv.php:1080
167
+ msgid "CommentLuv Settings v"
168
+ msgstr "تنظیمات افزونه"
169
+
170
+ #: ../commentluv.php:1090
171
+ msgid "Important!"
172
+ msgstr "مهم!"
173
+
174
+ #: ../commentluv.php:1090
175
+ msgid "Subscription Information"
176
+ msgstr "عضویت"
177
+
178
+ #: ../commentluv.php:1095
179
+ msgid "CommentLuv 3.0 Premium is coming soon!"
180
+ msgstr "CommentLuv 3.0 Premium در راه است!"
181
+
182
+ #: ../commentluv.php:1096
183
+ msgid "I promise not to sell your details or send you spam. You will ONLY receive emails about plugin updates."
184
+ msgstr "ما به شما قول می دهیم که ایمیل شما فروخته نشود و هیچ اسپمی هم ارسال نشود و فقط ایمیل های مربوط به آپدیت افزونه را دریافت کنید"
185
+
186
+ #: ../commentluv.php:1099
187
+ msgid "There is a premium version of CommentLuv coming that will have much more control of how the plugin works as well as exclusive features like keyword name, inline registration and much much more!. Signup to find out as soon as it is ready"
188
+ msgstr "نسخه حرفه ای این افزونه نیز وجود دارد که امکانات بیشتری نسبت به این نسخه دارد.برای اطلاع از آماده شدن آن در خبرنامه عضو شوید."
189
+
190
+ #: ../commentluv.php:1102
191
+ msgid "You have already subscribed, if you have not received the verification within 12 hours, please click the button to resend or try the form at"
192
+ msgstr "شما قبلا عضو شده اید،اگه طی 12 ساعت آینده کد فعال سازی برای شما ارسال نشد،از دکمه زیر برای ارسال مجدد استفاده کنید و یا از طریق این فرم"
193
+
194
+ #: ../commentluv.php:1102
195
+ msgid "Resend Verification"
196
+ msgstr "ارسال مجدد کد فعال سازی"
197
+
198
+ #: ../commentluv.php:1104
199
+ msgid "Click to register now!"
200
+ msgstr "برای عضویت در خبرنامه کلیک کنید!"
201
+
202
+ #: ../commentluv.php:1119
203
+ msgid "Primary Setting"
204
+ msgstr "تنظیمات اولیه"
205
+
206
+ #: ../commentluv.php:1119
207
+ #: ../commentluv.php:1153
208
+ #: ../commentluv.php:1212
209
+ #: ../commentluv.php:1268
210
+ #: ../commentluv.php:1299
211
+ msgid "Help Video"
212
+ msgstr "راهنمای ویدئویی"
213
+
214
+ #: ../commentluv.php:1123
215
+ msgid "Enable CommentLuv?"
216
+ msgstr "فعال کردن افزونه؟"
217
+
218
+ #: ../commentluv.php:1124
219
+ msgid "Yes"
220
+ msgstr "بله"
221
+
222
+ #: ../commentluv.php:1125
223
+ msgid "No"
224
+ msgstr "خیر"
225
+
226
+ #: ../commentluv.php:1130
227
+ msgid "On Posts"
228
+ msgstr "در نوشته ها"
229
+
230
+ #: ../commentluv.php:1131
231
+ msgid "On Pages"
232
+ msgstr "در صفحات"
233
+
234
+ #: ../commentluv.php:1132
235
+ msgid "On Both"
236
+ msgstr "در هر دو"
237
+
238
+ #: ../commentluv.php:1137
239
+ msgid "On by default?"
240
+ msgstr "فعال بصورت پیش فرض؟"
241
+
242
+ #: ../commentluv.php:1141
243
+ msgid "On for admin?"
244
+ msgstr "فعال برای مدیران؟"
245
+
246
+ #: ../commentluv.php:1153
247
+ msgid "Appearance"
248
+ msgstr "ظاهر"
249
+
250
+ #: ../commentluv.php:1157
251
+ msgid "Badge"
252
+ msgstr "نشان"
253
+
254
+ #: ../commentluv.php:1158
255
+ msgid "Custom Image URL"
256
+ msgstr "آدرس اینترنتی تصویر سفارشی"
257
+
258
+ #: ../commentluv.php:1159
259
+ msgid "Use Text"
260
+ msgstr "استفاده از متن"
261
+
262
+ #: ../commentluv.php:1167
263
+ msgid "Default"
264
+ msgstr "پیش فرض"
265
+
266
+ #: ../commentluv.php:1168
267
+ msgid "White"
268
+ msgstr "سفید"
269
+
270
+ #: ../commentluv.php:1169
271
+ msgid "Black"
272
+ msgstr "مشکی"
273
+
274
+ #: ../commentluv.php:1170
275
+ msgid "None"
276
+ msgstr "هیچ کدام"
277
+
278
+ #: ../commentluv.php:1187
279
+ msgid "Link to Commentluv?"
280
+ msgstr "لینک به سایت افزونه؟"
281
+
282
+ #: ../commentluv.php:1194
283
+ msgid "Enable info panel?"
284
+ msgstr "فعال کردن پنل اطلاعات ؟"
285
+
286
+ #: ../commentluv.php:1195
287
+ msgid "Info panel background color"
288
+ msgstr "رنگ پس زمینه پنل اطلاعات"
289
+
290
+ #: ../commentluv.php:1196
291
+ msgid "Info panel text color"
292
+ msgstr "رنگ متن پنل اطلاعات"
293
+
294
+ #: ../commentluv.php:1202
295
+ msgid "Example text and background color"
296
+ msgstr "نمونه رنگ نوشته و پس زمینه"
297
+
298
+ #: ../commentluv.php:1212
299
+ msgid "Messages"
300
+ msgstr "پیام ها"
301
+
302
+ #: ../commentluv.php:1219
303
+ msgid "Text to be displayed in the comment"
304
+ msgstr "این متن در زیر نظر نمایش داده می شود"
305
+
306
+ #: ../commentluv.php:1222
307
+ msgid "[name] = The users name"
308
+ msgstr "[name] = نام کاربری"
309
+
310
+ #: ../commentluv.php:1222
311
+ msgid "[lastpost] = The last blog post link"
312
+ msgstr "[lastpost] = آخرین نوشته سایت کاربر"
313
+
314
+ #: ../commentluv.php:1229
315
+ msgid "Message for unregistered user in the drop down box"
316
+ msgstr "پیام برای کاربران غیر عضو در جعبه کشویی"
317
+
318
+ #: ../commentluv.php:1230
319
+ #: ../commentluv.php:1254
320
+ msgid "Message will not be shown if you do not have registrations enabled"
321
+ msgstr "اگر شما امکان عضویت را به کاربران نداده باشید، این پیام نمایش داده نخواهد شد"
322
+
323
+ #: ../commentluv.php:1234
324
+ msgid "Your register link code"
325
+ msgstr "لینک کد فعال سازی شما"
326
+
327
+ #: ../commentluv.php:1244
328
+ msgid "You have NOT set your blog to allow registrations, you can do that in Settings/General"
329
+ msgstr "شما در سایتتان اجازه ثبت نام به کاربران نداده اید،برای اینکار به قسمت تنظیمات همگانی بروید"
330
+
331
+ #: ../commentluv.php:1245
332
+ msgid "here"
333
+ msgstr "اینجا"
334
+
335
+ #: ../commentluv.php:1253
336
+ msgid "Message for unregistered user in the info panel"
337
+ msgstr "پیام برای کاربران غیر عضو در پنل اطلاعات"
338
+
339
+ #: ../commentluv.php:1268
340
+ msgid "Operational Settings"
341
+ msgstr "تنظیمات عملیاتی"
342
+
343
+ #: ../commentluv.php:1275
344
+ msgid "Who to give 10 last posts to choose from when they comment?"
345
+ msgstr "چه کسانی میتوانند 10 نوشته آخری را که درآن نظر داده اند انتخاب کنند؟"
346
+
347
+ #: ../commentluv.php:1276
348
+ msgid "Only Registered Members"
349
+ msgstr "فقط کاربران عضو"
350
+
351
+ #: ../commentluv.php:1277
352
+ msgid "Everybody"
353
+ msgstr "همه افراد"
354
+
355
+ #: ../commentluv.php:1278
356
+ msgid "Nobody"
357
+ msgstr "هیچ کس"
358
+
359
+ #: ../commentluv.php:1285
360
+ msgid "Whose links should be dofollow?"
361
+ msgstr "لینک های چه کسانی dofollow شود؟"
362
+
363
+ #: ../commentluv.php:1286
364
+ msgid "Only Registered Members Links"
365
+ msgstr "فقط لینک اعضا"
366
+
367
+ #: ../commentluv.php:1287
368
+ msgid "Everybody gets dofollow links"
369
+ msgstr "لینک همه افراد dofollow شود"
370
+
371
+ #: ../commentluv.php:1288
372
+ msgid "Nobody gets dofollow links"
373
+ msgstr " لینک هیچ کسی dofollow نشود"
374
+
375
+ #: ../commentluv.php:1299
376
+ msgid "Technical Settings"
377
+ msgstr "تنظیمات فنی"
378
+
379
+ #: ../commentluv.php:1299
380
+ msgid "Click to open technical settings"
381
+ msgstr "برای بازکردن قسمت تنظیمات فنی کلیک کنید"
382
+
383
+ #: ../commentluv.php:1306
384
+ msgid "Please check the help video for this section before changing settings"
385
+ msgstr "لطفا راهنمای ویدئویی را قبل از تغییر تنظیمات این قسمت مشاهده کنید"
386
+
387
+ #: ../commentluv.php:1307
388
+ msgid "In most cases, you will NOT need to change the settings in this box unless you have a custom comment form, template or you are using minifying or caching plugins"
389
+ msgstr "هیچ نیازی به تغییر این قسمت نمی باشد،مگر اینکه از یک فرم و یا قالب سفارشی برای قسمت نظرات استفاده میکنید."
390
+
391
+ #: ../commentluv.php:1312
392
+ msgid "Compatibility"
393
+ msgstr "سازگاری"
394
+
395
+ #: ../commentluv.php:1316
396
+ msgid "Use manual insert of badge code?"
397
+ msgstr "استفاده دستی از کد برای نشان؟"
398
+
399
+ #: ../commentluv.php:1320
400
+ msgid "Enable minifying compatibility?"
401
+ msgstr "فعال کردن سازگاری minifying?"
402
+
403
+ #: ../commentluv.php:1321
404
+ msgid "For caching plugins (places localized code in footer)"
405
+ msgstr "برای ذخیره پلاگین ( کد مکان های موضعی در پایین صفحه)"
406
+
407
+ #: ../commentluv.php:1326
408
+ msgid "API URL"
409
+ msgstr " لینک API"
410
+
411
+ #: ../commentluv.php:1330
412
+ msgid "URL to use for API"
413
+ msgstr " آدرس اینترنتی برای استفاده از API"
414
+
415
+ #: ../commentluv.php:1334
416
+ msgid "Comment Form Field Values"
417
+ msgstr "مقادیر فیلد فرم نظرات"
418
+
419
+ #: ../commentluv.php:1337
420
+ msgid "Authors Name field name"
421
+ msgstr "فیلد نام نویسنده"
422
+
423
+ #: ../commentluv.php:1342
424
+ msgid "Email field name"
425
+ msgstr "فیلد ایمیل"
426
+
427
+ #: ../commentluv.php:1347
428
+ msgid "Authors URL field name"
429
+ msgstr "فیلد سایت نویسنده"
430
+
431
+ #: ../commentluv.php:1352
432
+ msgid "Comment Text Area name"
433
+ msgstr "فیلد نظر"
434
+
435
+ #: ../commentluv.php:1357
436
+ msgid "Diagnostics Info"
437
+ msgstr "اطلاعات کد"
438
+
439
+ #: ../commentluv.php:1375
440
+ msgid "You can copy this information and send it to me if I request it"
441
+ msgstr "شما می توانید این اطلاعات را کپی کنید و در صورت نیاز برای ما ارسال کنید"
442
+
443
+ #: ../commentluv.php:1382
444
+ msgid "Save Settings"
445
+ msgstr "ذخیره تنظیمات"
446
+
447
+ #: ../commentluv.php:1384
448
+ msgid "Reset Settings"
449
+ msgstr "بازنشانی تنظیمات"
450
+
451
+ #: ../commentluv.php:1387
452
+ msgid "Are you sure you want to reset your settings? Press OK to continue"
453
+ msgstr "آیا مطمئن هستید که می خواهید تنظیمات را بازنشانی کنید؟برای ادامه کلیک کنید"
454
+
455
+ #: ../commentluv.php:1390
456
+ msgid "Reset"
457
+ msgstr "بازنشاندن"
458
+
459
+ #: ../commentluv.php:1398
460
+ msgid "Plugin Info"
461
+ msgstr "اطلاعات افزونه"
462
+
463
+ #: ../commentluv.php:1401
464
+ msgid "Start Here"
465
+ msgstr "از اینجا شروع کنید"
466
+
467
+ #: ../commentluv.php:1402
468
+ msgid "Author"
469
+ msgstr "نویسنده"
470
+
471
+ #: ../commentluv.php:1403
472
+ msgid "Home Page"
473
+ msgstr "صفحه نخست"
474
+
475
+ #: ../commentluv.php:1403
476
+ msgid "Visit www.commentluv.com!"
477
+ msgstr "www.commentluv.com مشاهده"
478
+
479
+ #: ../commentluv.php:1404
480
+ msgid "Social"
481
+ msgstr "صفحه افزونه در شبکه های اجتماعی"
482
+
483
+ #: ../commentluv.php:1405
484
+ msgid "Help"
485
+ msgstr "راهنما"
486
+
487
+ #: ../commentluv.php:1405
488
+ msgid "Help Desk"
489
+ msgstr "راهنمای افزونه"
490
+
491
+ #: ../commentluv.php:1406
492
+ msgid "Do you like this plugin?"
493
+ msgstr "آیا به این افزونه علاقه دارید؟"
494
+
495
+ #: ../commentluv.php:1408
496
+ msgid "News"
497
+ msgstr "اخبار"
498
+
499
+ #: ../commentluv.php:1414
500
+ msgid "Thanks to the following for translations"
501
+ msgstr "با تشکر از افراد زیر برای ترجمه افزونه"
502
+
503
+ #: ../commentluv.php:1415
504
+ msgid "Italian"
505
+ msgstr "ایتالیایی"
506
+
507
+ #: ../commentluv.php:1416
508
+ msgid "Dutch"
509
+ msgstr "هلندی"
510
+
511
+ #: ../commentluv.php:1417
512
+ msgid "Polish"
513
+ msgstr "لهستانی"
514
+
515
+ #: ../commentluv.php:1418
516
+ msgid "Georgian"
517
+ msgstr "گرجستانی"
518
+
519
+ #: ../commentluv.php:1419
520
+ msgid "Lithuanian"
521
+ msgstr "لیتوانی"
522
+
523
+ #: ../commentluv.php:1420
524
+ msgid "Portuguese"
525
+ msgstr "پرتقالی"
526
+
527
+ #: ../commentluv.php:1421
528
+ msgid "Malaysian"
529
+ msgstr "مالایی"
530
+
531
+ #: ../commentluv.php:1422
532
+ msgid "Hindi"
533
+ msgstr "هندی"
534
+
535
+ #: ../commentluv.php:1423
536
+ msgid "Russian"
537
+ msgstr "روسی"
538
+
539
+ #: ../commentluv.php:1424
540
+ msgid "Chinese"
541
+ msgstr "چینی"
542
+
543
+ #: ../commentluv.php:1425
544
+ msgid "Hebrew"
545
+ msgstr "عبری"
546
+
547
+ #: ../commentluv.php:1426
548
+ msgid "French"
549
+ msgstr "فرانسوی"
550
+
551
+ #: ../commentluv.php:1428
552
+ msgid "Romanian"
553
+ msgstr "رومانیایی"
554
+
555
+ #: ../commentluv.php:1429
556
+ msgid "German"
557
+ msgstr "آلمانی"
558
+
559
+ #: ../commentluv.php:1430
560
+ msgid "Arabic"
561
+ msgstr "عربی"
562
+
563
+ #: ../commentluv.php:1432
564
+ msgid "Want your link here?"
565
+ msgstr "میخواهید لینک شما هم اینجا قرار بگیرد؟"
566
+
567
+ #: ../commentluv.php:1432
568
+ msgid "How To Submit A Translation"
569
+ msgstr "چگونگی ترجمه کردن افزونه"
570
+
571
+ #: ../commentluv.php:1433
572
+ msgid "Special thanks go to the following"
573
+ msgstr "با تشکر فراوان از"
574
+
575
+ #: ../commentluv.php:1434
576
+ msgid "CSS Help"
577
+ msgstr "راهنمای CSS"
578
+
579
+ #: ../commentluv.php:1435
580
+ msgid "Badge GFX"
581
+ msgstr "طراحی نشان"
582
+
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link:http://comluv.com/about/donate
4
  Tags: commentluv, comments, last blog post, linkluv, comment luv , commentlove, comment love
5
  Requires at least: 3.0
6
  Tested up to: 3.2
7
- Stable tag: 2.90.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
 
@@ -33,6 +33,8 @@ Hindi [Outshine Solutions](http://outshinesolutions.com/ "Hindi Translation")
33
  Indonesian [Mokhamad Oky](http://rainerflame.com/ "Indonesian Translation")
34
  Chinese (simplified) [Third Eye](http://obugs.net "Simplified Chinese Translation")
35
  Spanish [Valentin Yonte](http://www.activosenred.com/ "Spanish Translation")
 
 
36
 
37
  == Installation ==
38
 
@@ -61,6 +63,20 @@ Please see the videos in the settings page for explanations of how they work.
61
  4. edit post comments
62
 
63
  == ChangeLog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  = 2.90.6 =
65
  * bugfix : causing fatal error on upgrade to 2.90.5 sorry!! It was all my fault
66
  * bugfix : escape titles of other posts when showing info panel.
4
  Tags: commentluv, comments, last blog post, linkluv, comment luv , commentlove, comment love
5
  Requires at least: 3.0
6
  Tested up to: 3.2
7
+ Stable tag: 2.90.7
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
 
33
  Indonesian [Mokhamad Oky](http://rainerflame.com/ "Indonesian Translation")
34
  Chinese (simplified) [Third Eye](http://obugs.net "Simplified Chinese Translation")
35
  Spanish [Valentin Yonte](http://www.activosenred.com/ "Spanish Translation")
36
+ German [Jan Ruehling](http://www.cloudliving.de/ "German Translation")
37
+ Persian [Amir Heydari](http://www.3eo.ir/ "Persian Translation")
38
 
39
  == Installation ==
40
 
63
  4. edit post comments
64
 
65
  == ChangeLog ==
66
+
67
+ = 2.90.7 =
68
+ * added : more detailed error messages to javascript
69
+ * added : update version number in db on activation if existing version is less
70
+ * added : not authorized error in fetch function if nonce check fails
71
+ * added : allow disabling of commentluv request detection (for those getting xml errors when commenting on other sites)
72
+ * added : if w3 total cache active, clear cache on commentluv activation/upgrade.
73
+ * added : German translation
74
+ * added : warning if saving settings with 10 posts only for registered users but registration not enabled
75
+ * added : include note about registration not enabled to drop down list (only for admin to see)
76
+ * added : auto add commentluv to list of useragents to ignore for w3 pagecache
77
+ * bugfix : prevent theme from outputting data before send_feed if commentluv useragent detected
78
+ * added : Persian translation
79
+
80
  = 2.90.6 =
81
  * bugfix : causing fatal error on upgrade to 2.90.5 sorry!! It was all my fault
82
  * bugfix : escape titles of other posts when showing info panel.