Yet Another Related Posts Plugin (YARPP) - Version 2.1.6

Version Description

Download this release

Release Info

Developer mitchoyoshitaka
Plugin Icon 128x128 Yet Another Related Posts Plugin (YARPP)
Version 2.1.6
Comparing to
See all releases

Code changes from version 3.0b7 to 2.1.6

i/close.gif DELETED
Binary file
i/spin.gif DELETED
Binary file
includes.php CHANGED
@@ -3,20 +3,11 @@
3
  require_once('magic.php');
4
  require_once('keywords.php');
5
  require_once('intl.php');
6
- require_once('services.php');
7
-
8
- if ( !defined('WP_CONTENT_URL') )
9
- define('WP_CONTENT_URL', get_option('siteurl') . '/wp-content');
10
- if ( !defined('WP_CONTENT_DIR') )
11
- define('WP_CONTENT_DIR', ABSPATH . 'wp-content');
12
 
13
  // here's a list of all the options YARPP uses (except version), as well as their default values, sans the yarpp_ prefix, split up into binary options and value options. These arrays are used in updating settings (options.php) and other tasks.
14
  $yarpp_value_options = array('threshold' => 5,
15
  'limit' => 5,
16
- 'template_file' => '', // new in 2.2
17
  'excerpt_length' => 10,
18
- 'recent_number' => 12,
19
- 'recent_units' => 'month',
20
  'before_title' => '<li>',
21
  'after_title' => '</li>',
22
  'before_post' => ' <small>',
@@ -26,7 +17,6 @@ $yarpp_value_options = array('threshold' => 5,
26
  'no_results' => '<p>No related posts.</p>',
27
  'order' => 'score DESC',
28
  'rss_limit' => 3,
29
- 'rss_template_file' => '', // new in 2.2
30
  'rss_excerpt_length' => 10,
31
  'rss_before_title' => '<li>',
32
  'rss_after_title' => '</li>',
@@ -44,31 +34,20 @@ $yarpp_value_options = array('threshold' => 5,
44
  'discats' => '');
45
  $yarpp_binary_options = array('past_only' => true,
46
  'show_excerpt' => false,
47
- 'recent_only' => false, // new in 3.0
48
- 'use_template' => false, // new in 2.2
49
  'rss_show_excerpt' => false,
50
- 'rss_use_template' => false, // new in 2.2
51
  'show_pass_post' => false,
52
  'cross_relate' => false,
53
  'auto_display' => true,
54
  'rss_display' => true,
55
  'rss_excerpt_display' => true,
56
  'promote_yarpp' => false,
57
- 'rss_promote_yarpp' => false,
58
- 'ad_hoc_caching' => false);
59
 
60
  function yarpp_enabled() {
61
  global $wpdb;
62
  $indexdata = $wpdb->get_results("show index from $wpdb->posts");
63
  foreach ($indexdata as $index) {
64
- if ($index->Key_name == 'yarpp_title') {
65
- // now check for the cache tables
66
- $tabledata = $wpdb->get_col("show tables");
67
- if (array_search("{$wpdb->prefix}yarpp_related_cache",$tabledata) !== false and array_search("{$wpdb->prefix}yarpp_keyword_cache",$tabledata) !== false)
68
- return 1;
69
- else
70
- return 0;
71
- };
72
  }
73
  return 0;
74
  }
@@ -90,6 +69,7 @@ function yarpp_activate() {
90
  add_option("yarpp_$option",$yarpp_binary_options[$option]." ");
91
  }
92
  if (!yarpp_enabled()) {
 
93
  if (!$wpdb->query("ALTER TABLE $wpdb->posts ADD FULLTEXT `yarpp_title` ( `post_title`)")) {
94
  echo "<!--".__('MySQL error on adding yarpp_title','yarpp').": ";
95
  $wpdb->print_error();
@@ -100,34 +80,12 @@ function yarpp_activate() {
100
  $wpdb->print_error();
101
  echo "-->";
102
  }
103
- if (!$wpdb->query("CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}yarpp_keyword_cache` (
104
- `ID` bigint(20) unsigned NOT NULL default '0',
105
- `body` text collate utf8_unicode_ci NOT NULL,
106
- `title` text collate utf8_unicode_ci NOT NULL,
107
- `date` timestamp NOT NULL default CURRENT_TIMESTAMP,
108
- PRIMARY KEY (`ID`)
109
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='YARPP''s keyword cache table';")) {
110
- echo "<!--".__('MySQL error on creating yarpp_keyword_cache table','yarpp').": ";
111
- $wpdb->print_error();
112
- echo "-->";
113
- }
114
- if (!$wpdb->query("CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}yarpp_related_cache` (
115
- `reference_ID` bigint(20) unsigned NOT NULL default '0',
116
- `ID` bigint(20) unsigned NOT NULL default '0',
117
- `score` float unsigned NOT NULL default '0',
118
- `date` timestamp NOT NULL default CURRENT_TIMESTAMP,
119
- PRIMARY KEY (`reference_ID`,`ID`)
120
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;")) {
121
- echo "<!--".__('MySQL error on creating yarpp_related_cache table','yarpp').": ";
122
- $wpdb->print_error();
123
- echo "-->";
124
- }
125
  if (!yarpp_enabled()) {
126
  return 0;
127
  }
128
  }
129
- add_option('yarpp_version','3.0b7');
130
- update_option('yarpp_version','3.0b7');
131
  return 1;
132
  }
133
 
@@ -161,7 +119,7 @@ function yarpp_upgrade_check($inuse = false) {
161
  update_option('yarpp_version','1.5');
162
  }
163
 
164
- if (eregi_replace('[a-z].*$','',get_option('yarpp_version')) < 2) {
165
  foreach (array_keys($yarpp_value_options) as $option) {
166
  if (!get_option("yarpp_$option"))
167
  add_option("yarpp_$option",$yarpp_value_options[$option].' ');
@@ -171,18 +129,17 @@ function yarpp_upgrade_check($inuse = false) {
171
  add_option("yarpp_$option",$yarpp_binary_options[$option]);
172
  }
173
 
 
 
174
  }
175
 
176
- if (eregi_replace('[a-z].*$','',get_option('yarpp_version')) < 2.03) {
177
  $wpdb->query("ALTER TABLE $wpdb->posts ADD FULLTEXT `yarpp_title` ( `post_title`)");
178
  $wpdb->query("ALTER TABLE $wpdb->posts ADD FULLTEXT `yarpp_content` ( `post_content`)"); update_option('yarpp_version','2.03');
179
  }
180
 
181
- if (eregi_replace('[a-z].*$','',get_option('yarpp_version')) < 3.0 or get_option('yarpp_version') != '3.0b7') {
182
- update_option('yarpp_version','3.0b7');
183
-
184
- //if (!$inuse)
185
- // echo '<div id="message" class="updated fade" style="background-color: rgb(207, 235, 247);">'.__('<h3>An important message from YARPP:</h3><p>Thank you for upgrading to YARPP 2. YARPP 2.0 adds the much requested ability to limit related entry results by certain tags or categories. 2.0 also brings more fine tuned control of the magic algorithm, letting you specify how the algorithm should consider or not consider entry content, titles, tags, and categories. Make sure to adjust the new settings to your liking and perhaps readjust your threshold.</p><p>For more information, check out the <a href="http://mitcho.com/code/yarpp/">YARPP documentation</a>. (This message will not be displayed again.)</p>','yarpp').'</div>';
186
  }
187
 
188
  // just in case, try to add the index one more time.
@@ -194,16 +151,8 @@ function yarpp_upgrade_check($inuse = false) {
194
  }
195
 
196
  function yarpp_admin_menu() {
197
- $hook = add_options_page(__('Related Posts (YARPP)','yarpp'),__('Related Posts (YARPP)','yarpp'), 8, 'yet-another-related-posts-plugin/options.php', 'yarpp_options_page');
198
  //if (function_exists('add_submenu_page')) add_submenu_page('options-general.php', 'Related Posts (YARPP)', 'Related Posts (YARPP)', 8, 'yet-another-related-posts-plugin/options.php');
199
- add_action("load-$hook",'yarpp_load_thickbox');
200
- }
201
-
202
- function yarpp_load_thickbox() {
203
- wp_enqueue_script( 'thickbox' );
204
- if (function_exists('wp_enqueue_style')) {
205
- wp_enqueue_style( 'thickbox' );
206
- }
207
  }
208
 
209
  function yarpp_options_page() {
@@ -234,7 +183,7 @@ function yarpp_default($content) {
234
  if (is_feed())
235
  return yarpp_rss($content);
236
  elseif (yarpp_get_option('auto_display') and is_single())
237
- return $content.yarpp_related(array('post'),array(),false,false,'website');
238
  else
239
  return $content;
240
  }
@@ -242,15 +191,15 @@ function yarpp_default($content) {
242
  function yarpp_rss($content) {
243
  global $wpdb, $post;
244
  if (yarpp_get_option('rss_display'))
245
- return $content.yarpp_related(array('post'),array(),false,false,'rss');
246
  else
247
  return $content;
248
  }
249
 
250
  function yarpp_rss_excerpt($content) {
251
  global $wpdb, $post;
252
- if (yarpp_get_option('rss_excerpt_display') && yarpp_get_option('rss_display'))
253
- return $content.clean_pre(yarpp_related(array('post'),array(),false,false,'rss'));
254
  else
255
  return $content;
256
  }
@@ -333,7 +282,7 @@ function apply_filters_if_white($tag, $value) {
333
  // upgrade to 1.5!
334
  function yarpp_upgrade_one_five() {
335
  global $wpdb;
336
- $migrate_options = array('past_only','show_excerpt','show_pass_post','cross_relate','limit','threshold','before_title','after_title','before_post','after_post');
337
  foreach ($migrate_options as $option) {
338
  if (get_option($option)) {
339
  update_option("yarpp_$option",get_option($option));
@@ -377,10 +326,4 @@ function yarpp_get_option($option,$escapehtml = false) {
377
  return $return;
378
  }
379
 
380
- function yarpp_microtime_float()
381
- {
382
- list($usec, $sec) = explode(" ", microtime());
383
- return ((float)$usec + (float)$sec);
384
- }
385
-
386
  ?>
3
  require_once('magic.php');
4
  require_once('keywords.php');
5
  require_once('intl.php');
 
 
 
 
 
 
6
 
7
  // here's a list of all the options YARPP uses (except version), as well as their default values, sans the yarpp_ prefix, split up into binary options and value options. These arrays are used in updating settings (options.php) and other tasks.
8
  $yarpp_value_options = array('threshold' => 5,
9
  'limit' => 5,
 
10
  'excerpt_length' => 10,
 
 
11
  'before_title' => '<li>',
12
  'after_title' => '</li>',
13
  'before_post' => ' <small>',
17
  'no_results' => '<p>No related posts.</p>',
18
  'order' => 'score DESC',
19
  'rss_limit' => 3,
 
20
  'rss_excerpt_length' => 10,
21
  'rss_before_title' => '<li>',
22
  'rss_after_title' => '</li>',
34
  'discats' => '');
35
  $yarpp_binary_options = array('past_only' => true,
36
  'show_excerpt' => false,
 
 
37
  'rss_show_excerpt' => false,
 
38
  'show_pass_post' => false,
39
  'cross_relate' => false,
40
  'auto_display' => true,
41
  'rss_display' => true,
42
  'rss_excerpt_display' => true,
43
  'promote_yarpp' => false,
44
+ 'rss_promote_yarpp' => false);
 
45
 
46
  function yarpp_enabled() {
47
  global $wpdb;
48
  $indexdata = $wpdb->get_results("show index from $wpdb->posts");
49
  foreach ($indexdata as $index) {
50
+ if ($index->Key_name == 'yarpp_title') return 1;
 
 
 
 
 
 
 
51
  }
52
  return 0;
53
  }
69
  add_option("yarpp_$option",$yarpp_binary_options[$option]." ");
70
  }
71
  if (!yarpp_enabled()) {
72
+ // $wpdb->query("ALTER TABLE `wp_posts` DROP INDEX `yarpp_cache`");
73
  if (!$wpdb->query("ALTER TABLE $wpdb->posts ADD FULLTEXT `yarpp_title` ( `post_title`)")) {
74
  echo "<!--".__('MySQL error on adding yarpp_title','yarpp').": ";
75
  $wpdb->print_error();
80
  $wpdb->print_error();
81
  echo "-->";
82
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  if (!yarpp_enabled()) {
84
  return 0;
85
  }
86
  }
87
+ add_option('yarpp_version','2.16');
88
+ update_option('yarpp_version','2.16');
89
  return 1;
90
  }
91
 
119
  update_option('yarpp_version','1.5');
120
  }
121
 
122
+ if (get_option('yarpp_version') < 2) {
123
  foreach (array_keys($yarpp_value_options) as $option) {
124
  if (!get_option("yarpp_$option"))
125
  add_option("yarpp_$option",$yarpp_value_options[$option].' ');
129
  add_option("yarpp_$option",$yarpp_binary_options[$option]);
130
  }
131
 
132
+ if (!$inuse)
133
+ echo '<div id="message" class="updated fade" style="background-color: rgb(207, 235, 247);">'.__('<h3>An important message from YARPP:</h3><p>Thank you for upgrading to YARPP 2. YARPP 2.0 adds the much requested ability to limit related entry results by certain tags or categories. 2.0 also brings more fine tuned control of the magic algorithm, letting you specify how the algorithm should consider or not consider entry content, titles, tags, and categories. Make sure to adjust the new settings to your liking and perhaps readjust your threshold.</p><p>For more information, check out the <a href="http://mitcho.com/code/yarpp/">YARPP documentation</a>. (This message will not be displayed again.)</p>','yarpp').'</div>';
134
  }
135
 
136
+ if (get_option('yarpp_version') < 2.03) {
137
  $wpdb->query("ALTER TABLE $wpdb->posts ADD FULLTEXT `yarpp_title` ( `post_title`)");
138
  $wpdb->query("ALTER TABLE $wpdb->posts ADD FULLTEXT `yarpp_content` ( `post_content`)"); update_option('yarpp_version','2.03');
139
  }
140
 
141
+ if (get_option('yarpp_version') < 2.16) {
142
+ update_option('yarpp_version','2.16');
 
 
 
143
  }
144
 
145
  // just in case, try to add the index one more time.
151
  }
152
 
153
  function yarpp_admin_menu() {
154
+ add_options_page(__('Related Posts (YARPP)','yarpp'),__('Related Posts (YARPP)','yarpp'), 8, 'yet-another-related-posts-plugin/options.php', 'yarpp_options_page');
155
  //if (function_exists('add_submenu_page')) add_submenu_page('options-general.php', 'Related Posts (YARPP)', 'Related Posts (YARPP)', 8, 'yet-another-related-posts-plugin/options.php');
 
 
 
 
 
 
 
 
156
  }
157
 
158
  function yarpp_options_page() {
183
  if (is_feed())
184
  return yarpp_rss($content);
185
  elseif (yarpp_get_option('auto_display') and is_single())
186
+ return $content.yarpp_related(array('post'),array(),false,'website');
187
  else
188
  return $content;
189
  }
191
  function yarpp_rss($content) {
192
  global $wpdb, $post;
193
  if (yarpp_get_option('rss_display'))
194
+ return $content.yarpp_related(array('post'),array(),false,'rss');
195
  else
196
  return $content;
197
  }
198
 
199
  function yarpp_rss_excerpt($content) {
200
  global $wpdb, $post;
201
+ if (yarpp_get_option('rss_excerpt_display') and yarpp_get_option('rss_display'))
202
+ return $content.clean_pre(yarpp_related(array('post'),array(),false,'rss'));
203
  else
204
  return $content;
205
  }
282
  // upgrade to 1.5!
283
  function yarpp_upgrade_one_five() {
284
  global $wpdb;
285
+ $migrate_options = array('past_only','show_score','show_excerpt','show_pass_post','cross_relate','limit','threshold','before_title','after_title','before_post','after_post');
286
  foreach ($migrate_options as $option) {
287
  if (get_option($option)) {
288
  update_option("yarpp_$option",get_option($option));
326
  return $return;
327
  }
328
 
 
 
 
 
 
 
329
  ?>
install.txt DELETED
@@ -1,21 +0,0 @@
1
- === Yet Another Related Posts Plugin ===
2
- by mitcho (Michael Yoshitaka Erlewine)
3
- Twitter: http://twitter.com/yarpp/
4
-
5
- == INSTALLATION ==
6
-
7
- 1. Copy the folder `yet-another-related-posts-plugin` into the directory `wp-content/plugins/` and the sample templates inside `yarpp-templates` folder into your active theme.
8
-
9
- 2. Activate the plugin.
10
-
11
- 3. Find the Related Posts (YARPP) settings page in your `wp-admin`. If you see a message telling you to build your cache, please build your cache. Otherwise, you will see no related posts anywhere.
12
-
13
- 4. (optional) If you run a relatively low-traffic site (=most blogs), it is recommended that you enable the "compute related posts on the fly" option at the bottom of the Related Posts (YARPP) settings page.
14
-
15
- == SUPPORT ==
16
-
17
- Read the FAQ:
18
- http://mitcho.com/code/yarpp
19
-
20
- If it's not in the FAQ, find it or ask it in the forum:
21
- http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
intl.php CHANGED
File without changes
keywords.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
- function yarpp_extract_keywords($source,$max = 20) {
4
- global $overusedwords;
5
 
6
  if (function_exists('mb_split')) {
7
  mb_regex_encoding(get_option('blog_charset'));
@@ -10,57 +10,39 @@ function yarpp_extract_keywords($source,$max = 20) {
10
  $wordlist = preg_split('%\s*\W+\s*%', strtolower($source));
11
 
12
  // Build an array of the unique words and number of times they occur.
13
- $tokens = array_count_values($wordlist);
14
 
15
  // Remove the stop words from the list.
16
  foreach ($overusedwords as $word) {
17
- unset($tokens[$word]);
18
  }
19
- // Remove words which are only a letter
20
- foreach (array_keys($tokens) as $word) {
21
- if (function_exists('mb_strlen'))
22
- if (mb_strlen($word) < 2) unset($tokens[$word]);
23
- else
24
- if (strlen($word) < 2) unset($tokens[$word]);
25
- }
26
-
27
- arsort($tokens, SORT_NUMERIC);
28
 
29
- $types = array_keys($tokens);
 
30
 
31
- if (count($types) > $max)
32
- $types = array_slice($types, 0, $max);
33
- return implode(' ', $types);
34
- }
35
-
36
- function post_title_keywords($ID,$max = 20) {
37
- global $wpdb;
38
- return yarpp_extract_keywords(html_entity_strip($wpdb->get_var("select post_title from $wpdb->posts where ID = $ID")),$max);
39
  }
40
 
41
- function html_entity_strip($html) {
42
- $html = preg_replace('/&#x[0-9a-f]+;/','',$html);
43
- $html = preg_replace('/&#[0-9]+;/','',$html);
44
- $html = preg_replace('/&[a-zA-Z]+;/','',$html);
45
- return $html;
46
  }
47
 
48
- function post_body_keywords($ID,$max = 20) {
49
- global $wpdb;
50
- $content = strip_tags(apply_filters_if_white('the_content',$wpdb->get_var("select post_content from $wpdb->posts where ID = $ID")));
51
- //echo "<!--".get_option('blog_charset')."-->";
52
- /*if (get_option('blog_charset') == 'UTF-8')
53
- $content = html_entity_decode_utf8($content);
54
- else
55
- $content = html_entity_decode($content,ENT_QUOTES,get_option('blog_charset'));*/
56
- $content = html_entity_strip($content);
57
  return yarpp_extract_keywords($content,$max);
58
  }
59
 
60
- function yarpp_cache_keywords($ID) {
61
- global $wpdb, $yarpp_debug;
62
- $body_terms = post_body_keywords($ID);
63
- $title_terms = post_title_keywords($ID);
 
 
 
64
  /*
65
  CREATE TABLE `wp_yarpp_keyword_cache` (
66
  `ID` BIGINT( 20 ) UNSIGNED NOT NULL ,
@@ -70,58 +52,15 @@ function yarpp_cache_keywords($ID) {
70
  PRIMARY KEY ( `ID` )
71
  ) ENGINE = MYISAM COMMENT = 'YARPP\'s keyword cache table'
72
  */
 
 
 
 
73
 
74
- $wpdb->query('set names utf8');
75
-
76
- $wpdb->query("insert into {$wpdb->prefix}yarpp_keyword_cache (ID,body,title) values ($ID,'$body_terms ','$title_terms ') on duplicate key update date = now(), body = '$body_terms ', title = '$title_terms '");
77
 
78
- //echo "<!--"."insert into {$wpdb->prefix}yarpp_keyword_cache (ID,body,title) values ($ID,'$body_terms','$title_terms') on duplicate key update date = now(), body = '$body_terms', title = '$title_terms'"."-->";
79
-
80
- }
81
-
82
- function yarpp_get_cached_keywords($ID,$type='body') {
83
- global $wpdb;
84
- $out = $wpdb->get_var("select $type from {$wpdb->prefix}yarpp_keyword_cache where ID = $ID");
85
- if ($out === false or $out == '')
86
- yarpp_cache_keywords($ID);
87
- $out = $wpdb->get_var("select $type from {$wpdb->prefix}yarpp_keyword_cache where ID = $ID");
88
- if ($out === false or $out == '')
89
- echo "<!--YARPP ERROR: couldn't select/create yarpp $type keywords for $ID-->";
90
- else
91
- return $out;
92
- return false;
93
- }
94
-
95
- // replacement html_entity_decode code from php.net
96
- // author: laurynas dot butkus at gmail dot com
97
-
98
- function html_entity_decode_utf8($string) {
99
- static $trans_tbl;
100
-
101
- // replace numeric entities
102
- $string = preg_replace('~&#x([0-9a-f]+);~ei', 'code2utf(hexdec("\\1"))', $string);
103
- $string = preg_replace('~&#([0-9]+);~e', 'code2utf(\\1)', $string);
104
-
105
- // replace literal entities
106
- if (!isset($trans_tbl))
107
- {
108
- $trans_tbl = array();
109
-
110
- foreach (get_html_translation_table(HTML_ENTITIES) as $val=>$key)
111
- $trans_tbl[$key] = utf8_encode($val);
112
- }
113
-
114
- return strtr($string, $trans_tbl);
115
- }
116
-
117
- // Returns the utf string corresponding to the unicode value (from php.net, courtesy - romans@void.lv)
118
- function code2utf($num)
119
- {
120
- if ($num < 128) return chr($num);
121
- if ($num < 2048) return chr(($num >> 6) + 192) . chr(($num & 63) + 128);
122
- if ($num < 65536) return chr(($num >> 12) + 224) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);
123
- if ($num < 2097152) return chr(($num >> 18) + 240) . chr((($num >> 12) & 63) + 128) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);
124
- return '';
125
  }
126
 
127
  ?>
1
  <?php
2
 
3
+ function yarpp_extract_keywords($source,$num_to_ret = 20) {
4
+ global $post, $overusedwords;
5
 
6
  if (function_exists('mb_split')) {
7
  mb_regex_encoding(get_option('blog_charset'));
10
  $wordlist = preg_split('%\s*\W+\s*%', strtolower($source));
11
 
12
  // Build an array of the unique words and number of times they occur.
13
+ $a = array_count_values($wordlist);
14
 
15
  // Remove the stop words from the list.
16
  foreach ($overusedwords as $word) {
17
+ unset($a[$word]);
18
  }
19
+ arsort($a, SORT_NUMERIC);
 
 
 
 
 
 
 
 
20
 
21
+ $num_words = count($a);
22
+ $num_to_ret = $num_words > $num_to_ret ? $num_to_ret : $num_words;
23
 
24
+ $outwords = array_slice($a, 0, $num_to_ret);
25
+ return implode(' ', array_keys($outwords));
 
 
 
 
 
 
26
  }
27
 
28
+ function post_title_keywords($max = 20) {
29
+ global $post;
30
+ return yarpp_extract_keywords($post->post_title,$max);
 
 
31
  }
32
 
33
+ function post_body_keywords($max = 20) {
34
+ global $post;
35
+ $content = strip_tags(apply_filters_if_white('the_content',$post->post_content));
 
 
 
 
 
 
36
  return yarpp_extract_keywords($content,$max);
37
  }
38
 
39
+ /* yarpp_cache_keywords is EXPERIMENTAL and not used.
40
+ * Don't worry about it. ^^
41
+ */
42
+ function yarpp_cache_keywords() {
43
+ global $wpdb, $post, $yarpp_debug;
44
+ $body_terms = post_body_keywords();
45
+ $title_terms = post_title_keywords();
46
  /*
47
  CREATE TABLE `wp_yarpp_keyword_cache` (
48
  `ID` BIGINT( 20 ) UNSIGNED NOT NULL ,
52
  PRIMARY KEY ( `ID` )
53
  ) ENGINE = MYISAM COMMENT = 'YARPP\'s keyword cache table'
54
  */
55
+ $timeout = 400;
56
+
57
+ if (!$wpdb->get_var("select count(*) as count from wp_yarpp_keyword_cache where ID = $post->ID and date > date_sub(now(),interval $timeout minute)")) {
58
+ $wpdb->query('set names utf8');
59
 
60
+ $wpdb->query("insert into wp_yarpp_keyword_cache (ID,body,title) values ($post->ID,'$body_terms','$title_terms') on duplicate key update body = '$body_terms', title = '$title_terms'");
 
 
61
 
62
+ if ($yarpp_debug) echo "<!--"."insert into wp_yarpp_keyword_cache (ID,body,title) values ($post->ID,'$body_terms','$title_terms') on duplicate key update body = '$body_terms', title = '$title_terms'"."-->";
63
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  }
65
 
66
  ?>
lang/words-de_DE.php CHANGED
File without changes
lang/words-en_US.php CHANGED
File without changes
lang/yarpp-de_DE.mo CHANGED
File without changes
lang/yarpp-de_DE.po CHANGED
File without changes
lang/yarpp-fr_FR.mo DELETED
Binary file
lang/yarpp-fr_FR.po DELETED
@@ -1,537 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Yet Another Related Posts Plugin fr_FR v2.1.6\n"
4
- "PO-Revision-Date: 2008-12-07 23:48+0100\n"
5
- "Last-Translator: Lionel Chollet <lionel.chollet@gmail.com>\n"
6
- "Language-Team: Lionel Chollet <lionel.chollet@gmail.com>\n"
7
- "MIME-Version: 1.0\n"
8
- "Content-Type: text/plain; charset=UTF-8\n"
9
- "Content-Transfer-Encoding: 8bit\n"
10
- "Plural-Forms: nplurals=2; plural=n>1;\n"
11
- "X-Poedit-Language: French\n"
12
- "X-Poedit-Country: FRANCE\n"
13
- "X-Poedit-SourceCharset: utf-8\n"
14
- "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;__ngettext_noop:1,2;_c\n"
15
- "X-Poedit-Basepath: ../\n"
16
- "X-Poedit-SearchPath-0: .: "
17
-
18
- #: includes.php:94
19
- msgid "MySQL error on adding yarpp_title"
20
- msgstr "Erreur MySQL lors de l’ajout du titre “yarpp_title”"
21
-
22
- #: includes.php:99
23
- msgid "MySQL error on adding yarpp_content"
24
- msgstr "Erreur MySQL lors de l’ajout du contenu “yarpp_content”"
25
-
26
- #: includes.php:185
27
- msgid "<h3>An important message from YARPP:</h3><p>Thank you for upgrading to YARPP 2. YARPP 2.0 adds the much requested ability to limit related entry results by certain tags or categories. 2.0 also brings more fine tuned control of the magic algorithm, letting you specify how the algorithm should consider or not consider entry content, titles, tags, and categories. Make sure to adjust the new settings to your liking and perhaps readjust your threshold.</p><p>For more information, check out the <a href=\"http://mitcho.com/code/yarpp/\">YARPP documentation</a>. (This message will not be displayed again.)</p>"
28
- msgstr "<h3>Message important de YARPP</h3><p>Merci d’avoir fait la mise à jour vers YARPP 2. Cette version inclut une fonctionnalité très demandée&nbsp;: la possibilité de construire la liste d’entrées complémentaires en fonction de certains tags ou certaines catégories. YARPP 2 apporte également un meilleur contrôle de l’algorithme de complémentarité, ce qui vous permet de définir si le calcul doit prendre en compte les contenus d’entrée, les titres, les tags ou les catégories. Réglez les nouveaux paramètres selon votre convenance (vous devrez peut-être adapter le seuil de prise en compte pour un résultat optimum).</p><p>Pour plus d’information, consultez la <a href=\"http://mitcho.com/code/yarpp/\">documentation YARPP</a>. (Ce message n’apparaîtra plus.)</p>"
29
-
30
- #: includes.php:197
31
- #: includes.php:197
32
- msgid "Related Posts (YARPP)"
33
- msgstr "Related Posts (YARPP)"
34
-
35
- #: includes.php:224
36
- #: yarpp.php:29
37
- #: yarpp.php:29
38
- msgid "Related Posts"
39
- msgstr "Entrées complémentaires"
40
-
41
- #: includes.php:229
42
- msgid "YARPP"
43
- msgstr "YARPP"
44
-
45
- #: template-builtin.php:35
46
- #, php-format
47
- msgid "%f is the YARPP match score between the current entry and this related entry. You are seeing this value because you are logged in to WordPress as an administrator. It is not shown to regular visitors."
48
- msgstr "%f représente le degré de complémentarité entre l’entrée considérée et cette entrée complémentaire. Cette valeur n’est affichée que pour les administrateurs connectés au site&nbsp;; elle n’apparaît pas pour les simples visiteurs."
49
-
50
- #: magic.php:304
51
- #: options.php:458
52
- #: options.php:521
53
- msgid "Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>."
54
- msgstr "La liste des entrées complémentaires est établie par le module d’extension <a href='http://mitcho.com/code/yarpp/'>YARPP</a>."
55
-
56
- #: options.php:26
57
- msgid "The MyISAM check has been overridden. You may now use the \"consider titles\" and \"consider bodies\" relatedness criteria."
58
- msgstr "Le calcul MyISAM n’est plus utilisé. Vous pouvez maintenant activer les options “Prendre en compte le titre” et “Prendre en compte le contenu” pour définir le calcul de complémentarité."
59
-
60
- #: options.php:35
61
- #, php-format
62
- msgid "YARPP's \"consider titles\" and \"consider bodies\" relatedness criteria require your <code>%s</code> table to use the <a href='http://dev.mysql.com/doc/refman/5.0/en/storage-engines.html'>MyISAM storage engine</a>, but the table seems to be using the <code>%s</code> engine. These two options have been disabled."
63
- msgstr "Les options YARPP “Prendre en compte le titre” et “Prendre en compte le contenu” pour le calcul de complémentarité requièrent que votre table <code>%s</code> utilise le <a href='http://dev.mysql.com/doc/refman/5.0/en/storage-engines.html'>moteur de classement MyISAM</a>, mais votre table utilise apparemment le moteur <code>%s</code>. Ces deux options ont été désactivées."
64
-
65
- #: options.php:37
66
- #, php-format
67
- msgid "To restore these features, please update your <code>%s</code> table by executing the following SQL directive: <code>ALTER TABLE `%s` ENGINE = MyISAM;</code> . No data will be erased by altering the table's engine, although there are performance implications."
68
- msgstr "Pour rétablir ces fonctionnalités, mettez à jour votre table <code>%s</code> en exécutant la commande SQL suivante&nbsp;: <code>ALTER TABLE `%s` ENGINE = MyISAM;</code><br />Le changement de moteur de classement n’entraînera pas de perte de données, mais pourra influer sur les performances."
69
-
70
- #: options.php:39
71
- #, php-format
72
- msgid "If, despite this check, you are sure that <code>%s</code> is using the MyISAM engine, press this magic button:"
73
- msgstr "Si, malgré cette vérification, vous êtes certain que <code>%s</code> utilise le moteur MyISAM, cliquez ce bouton magique&nbsp;:"
74
-
75
- #: options.php:42
76
- msgid "Trust me. Let me use MyISAM features."
77
- msgstr "Faites-moi confiance. Laissez-moi utiliser le moteur MyISAM."
78
-
79
- #: options.php:65
80
- msgid "The YARPP database had an error but has been fixed."
81
- msgstr "La base de données YARPP a rencontré une erreur mais elle a pu être corrigée."
82
-
83
- #: options.php:67
84
- msgid "The YARPP database has an error which could not be fixed."
85
- msgstr "La base de données YARPP a rencontré une erreur qui n’a pas pu être corrigée."
86
-
87
- #: options.php:153
88
- #: options.php:170
89
- #: options.php:182
90
- msgid "do not consider"
91
- msgstr "ne pas prendre en compte"
92
-
93
- #: options.php:154
94
- #: options.php:171
95
- #: options.php:184
96
- msgid "consider"
97
- msgstr "prendre en compte"
98
-
99
- #: options.php:172
100
- msgid "consider with extra weight"
101
- msgstr "prendre en compte avec plus d’importance"
102
-
103
- #: options.php:200
104
- msgid "Yet Another Related Posts Plugin version history (RSS 2.0)"
105
- msgstr "Historique des versions de l’extension YARPP (RSS 2.0)"
106
-
107
- #: options.php:271
108
- #: options.php:271
109
- msgid "Donate to mitcho (Michael Yoshitaka Erlewine) for this plugin via PayPal"
110
- msgstr "Faire un don à mitcho (Michael Yoshitaka Erlewine), via PayPal, pour cette extension"
111
-
112
- #: options.php:254
113
- msgid "Yet Another Related Posts Plugin Options"
114
- msgstr "Réglages YARPP"
115
-
116
- #: options.php:278
117
- msgid "\"The Pool\""
118
- msgstr "Le <em>corpus</em>"
119
-
120
- #: options.php:279
121
- msgid "\"The Pool\" refers to the pool of posts and pages that are candidates for display as related to the current entry."
122
- msgstr "Le <em>corpus</em> représente l’ensemble des articles et pages pouvant apparaître dans la liste des entrées complémentaires établie par l’extension YARPP."
123
-
124
- #: options.php:284
125
- msgid "Disallow by category:"
126
- msgstr "Catégorie(s) à&nbsp;exclure&nbsp;:"
127
-
128
- #: options.php:286
129
- msgid "Disallow by tag:"
130
- msgstr "Tag(s)<br />à exclure&nbsp;:"
131
-
132
- #: options.php:288
133
- msgid "Show password protected posts?"
134
- msgstr "Inclure les entrées protégées par mot de passe&nbsp;?"
135
-
136
- #: options.php:289
137
- msgid "Show only previous posts?"
138
- msgstr "Afficher seulement les entrées publiées antérieurement&nbsp;?"
139
-
140
- #: options.php:306
141
- msgid "\"Relatedness\" options"
142
- msgstr "Options de complémentarité"
143
-
144
- #: options.php:308
145
- #, php-format
146
- msgid "YARPP is different than the <a href=\"http://wasabi.pbwiki.com/Related%20Entries\">previous plugins it is based on</a> as it limits the related posts list by (1) a maximum number and (2) a <em>match threshold</em>."
147
- msgstr "YARPP fonctionne différemment <a href=\"http://wasabi.pbwiki.com/Related%20Entries\">des extensions antérieures</a>, en ceci que la liste des articles complémentaires est établie en fonction&nbsp;:<br />(1) d’une valeur maximale et (2) d’un <em>seuil</em> de complémentarité."
148
-
149
- #: options.php:308
150
- #: options.php:322
151
- #: options.php:405
152
- #: options.php:410
153
- #: options.php:457
154
- #: options.php:469
155
- #: options.php:470
156
- #: options.php:474
157
- #: options.php:520
158
- #: options.php:531
159
- msgid "more&gt;"
160
- msgstr "aide&nbsp;&gt;"
161
-
162
- #: options.php:313
163
- msgid "Match threshold:"
164
- msgstr "Seuil de complémentarité&nbsp;:"
165
-
166
- #: options.php:314
167
- msgid "Titles: "
168
- msgstr "Titres&nbsp;:"
169
-
170
- #: options.php:316
171
- msgid "Bodies: "
172
- msgstr "Contenus&nbsp;:"
173
-
174
- #: options.php:318
175
- msgid "Tags: "
176
- msgstr "Tags&nbsp;:"
177
-
178
- #: options.php:320
179
- msgid "Categories: "
180
- msgstr "Catégories&nbsp;:"
181
-
182
- #: options.php:322
183
- msgid "Cross-relate posts and pages?"
184
- msgstr "Complémentarité croisée entre articles et pages&nbsp;?"
185
-
186
- #: options.php:322
187
- msgid "When the \"Cross-relate posts and pages\" option is selected, the <code>related_posts()</code>, <code>related_pages()</code>, and <code>related_entries()</code> all will give the same output, returning both related pages and posts."
188
- msgstr "Quand l’option “Complémentarité croisée entre articles et pages” est activée, les fonctions <code>related_posts()</code>, <code>related_pages()</code> et <code>related_entries()</code> produiront le même résultat, et la liste présentera aussi bien les articles que les pages complémentaires."
189
-
190
- #: options.php:401
191
- msgid "Display options <small>for your website</small>"
192
- msgstr "Réglages de présentation <small>pour votre site</small>"
193
-
194
- #: options.php:405
195
- msgid "Automatically display related posts?"
196
- msgstr "Afficher la liste des entrées complémentaires automatiquement&nbsp;?"
197
-
198
- #: options.php:405
199
- msgid "This option automatically displays related posts right after the content on single entry pages. If this option is off, you will need to manually insert <code>related_posts()</code> or variants (<code>related_pages()</code> and <code>related_entries()</code>) into your theme files."
200
- msgstr "Quand cette option est activée, la liste d’entrées complémentaires sera affichée automatiquement après le contenu de l’entrée. Si cette option n’est pas activée, vous devrez insérer vous-même le code <code>related_posts()</code> ou ses variantes (<code>related_pages()</code> et <code>related_entries()</code>) dans vos fichiers-modèles."
201
-
202
- #: options.php:406
203
- msgid "Website display code example"
204
- msgstr "Exemple du code produit pour l’affichage des entrées complémentaires sur votre site"
205
-
206
- #: options.php:406
207
- #: options.php:471
208
- msgid "(Update options to reload.)"
209
- msgstr "(Enregistrez les réglages pour actualiser.)"
210
-
211
- #: options.php:409
212
- #: options.php:473
213
- msgid "Maximum number of related posts:"
214
- msgstr "Nombre maximal d’articles complémentaires&nbsp;:"
215
-
216
- #: options.php:422
217
- msgid "Before / after related entries:"
218
- msgstr "Avant / Après<br />la liste&nbsp;:"
219
-
220
- #: options.php:423
221
- #: options.php:428
222
- #: options.php:437
223
- #: options.php:487
224
- #: options.php:492
225
- #: options.php:501
226
- msgid "For example:"
227
- msgstr "Par exemple&nbsp;:"
228
-
229
- #: options.php:427
230
- #: options.php:491
231
- msgid "Before / after each related entry:"
232
- msgstr "Avant / Après<br />chaque entrée&nbsp;:"
233
-
234
- #: options.php:431
235
- #: options.php:495
236
- msgid "Show excerpt?"
237
- msgstr "Afficher l’extrait&nbsp;?"
238
-
239
- #: options.php:432
240
- #: options.php:496
241
- msgid "Excerpt length (No. of words):"
242
- msgstr "Taille de l’extrait (nombre de mots)&nbsp;/"
243
-
244
- #: options.php:436
245
- msgid "Before / after (Excerpt):"
246
- msgstr "Avant / Après<br />l’extrait"
247
-
248
- #: options.php:442
249
- #: options.php:506
250
- msgid "Order results:"
251
- msgstr "Classement des résultats&nbsp;"
252
-
253
- #: options.php:444
254
- #: options.php:508
255
- msgid "score (high relevance to low)"
256
- msgstr "par complémentarité (de la plus forte à la plus faible)"
257
-
258
- #: options.php:445
259
- #: options.php:509
260
- msgid "score (low relevance to high)"
261
- msgstr "par complémentarité (de la plus faible à la plus forte)"
262
-
263
- #: options.php:446
264
- #: options.php:510
265
- msgid "date (new to old)"
266
- msgstr "par date (de la plus récente à la plus ancienne)"
267
-
268
- #: options.php:447
269
- #: options.php:511
270
- msgid "date (old to new)"
271
- msgstr "par date (de la plus ancienne à la plus récente)"
272
-
273
- #: options.php:448
274
- #: options.php:512
275
- msgid "title (alphabetical)"
276
- msgstr "par titre (en ordre alphabétique)"
277
-
278
- #: options.php:449
279
- #: options.php:513
280
- msgid "title (reverse alphabetical)"
281
- msgstr "par titre (en ordre contre-alphabétique)"
282
-
283
- #: options.php:454
284
- #: options.php:518
285
- msgid "Default display if no results:"
286
- msgstr "Afficher s’il n’y a pas d’entrée complémentaire&nbsp;:"
287
-
288
- #: options.php:456
289
- #: options.php:520
290
- msgid "Help promote Yet Another Related Posts Plugin?"
291
- msgstr "Aider à la promotion de l’extension YARPP&nbsp;?"
292
-
293
- #: options.php:458
294
- #: options.php:521
295
- #, php-format
296
- msgid "This option will add the code %s. Try turning it on, updating your options, and see the code in the code example to the right. These links and donations are greatly appreciated."
297
- msgstr "Cette option affiche la mention&nbsp;: %s. Activez-la, enregistrez les réglages, et vous verrez la mention apparaître sous l’exemple du code produit pour l’affichage des entrées complémentaires, dans le cadre à droite."
298
-
299
- #: options.php:464
300
- msgid "Display options <small>for RSS</small>"
301
- msgstr "Réglages de présentation <small>pour les flux RSS</small>"
302
-
303
- #: options.php:469
304
- msgid "Display related posts in feeds?"
305
- msgstr "Afficher les entrées complémentaires dans les flux RSS&nbsp;?"
306
-
307
- #: options.php:470
308
- msgid "Display related posts in the descriptions?"
309
- msgstr "Afficher les entrées complémentaires dans les descriptions&nbsp;?"
310
-
311
- #: options.php:470
312
- msgid "This option displays the related posts in the RSS description fields, not just the content. If your feeds are set up to only display excerpts, however, only the description field is used, so this option is required for any display at all."
313
- msgstr "Cette option affiche les entrées complémentaires après l’extrait d’article dans vos flux RSS. Si vos flux RSS sont configurés pour n’afficher que les extraits, vous devez activer cette option si vous souhaitez faire apparaître la liste des entrées complémentaires."
314
-
315
- #: options.php:471
316
- msgid "RSS display code example"
317
- msgstr "Exemple du code produit pour l’affichage des entrées complémentaires dans vos flux RSS"
318
-
319
- #: options.php:486
320
- msgid "Before / after related entries display:"
321
- msgstr "Avant / Après<br />la liste&nbsp;:"
322
-
323
- #: options.php:500
324
- msgid "Before / after (excerpt):"
325
- msgstr "Avant / Après<br />l’extrait&nbsp;:"
326
-
327
- #: options.php:147
328
- msgid "word"
329
- msgstr "mot"
330
-
331
- #: options.php:148
332
- msgid "tag"
333
- msgstr "tag"
334
-
335
- #: options.php:149
336
- msgid "category"
337
- msgstr "catégorie"
338
-
339
- #: options.php:156
340
- #: options.php:186
341
- #, php-format
342
- msgid "require at least one %s in common"
343
- msgstr "nécessite d’avoir au moins 1 %s en commun"
344
-
345
- #: options.php:158
346
- #: options.php:188
347
- #, php-format
348
- msgid "require more than one %s in common"
349
- msgstr "nécessite d’avoir plusieurs %ss en commun"
350
-
351
- #: options.php:125
352
- msgid "Options saved!"
353
- msgstr "Réglages enregistrés."
354
-
355
- #: options.php:308
356
- msgid "The higher the match threshold, the more restrictive, and you get less related posts overall. The default match threshold is 5. If you want to find an appropriate match threshhold, take a look at some post's related posts display and their scores. You can see what kinds of related posts are being picked up and with what kind of match scores, and determine an appropriate threshold for your site."
357
- msgstr "Plus le seuil de complémentarité sera élevé, plus la sélection sera restrictive, et les listes d’entrées complémentaires présenteront, dans l’ensemble, moins d’éléments. La valeur du seuil de complémentarité, par défaut, est fixée à 5. Faites des essais avec différentes valeurs, afin de déterminer le seuil de complémentarité le mieux adapté à votre site et à vos entrées."
358
-
359
- #: options.php:605
360
- msgid "Update options"
361
- msgstr "Enregistrer les réglages"
362
-
363
- #: options.php:606
364
- msgid "Do you really want to reset your configuration?"
365
- msgstr "Voulez-vous vraiment revenir aux réglages par défaut&nbsp;?"
366
-
367
- #: options.php:606
368
- msgid "Reset options"
369
- msgstr "Revenir aux réglages par défaut"
370
-
371
- #: includes.php:110
372
- msgid "MySQL error on creating yarpp_keyword_cache table"
373
- msgstr "Erreur MySQL lors de la création de la table yarpp_keyword_cache"
374
-
375
- #: includes.php:121
376
- msgid "MySQL error on creating yarpp_related_cache table"
377
- msgstr "Erreur MySQL lors de la création de la table yarpp_related_cache table"
378
-
379
- #: magic.php:56
380
- msgid "Example post "
381
- msgstr "Exemple d’entrée "
382
-
383
- #: options.php:81
384
- #: options.php:84
385
- #: options.php:126
386
- #: options.php:530
387
- msgid "Related posts cache status"
388
- msgstr "Statut du cache des entrées complémentaires"
389
-
390
- #: options.php:81
391
- msgid "Your related posts cache is incomplete. Please build your cache from the <A>related posts status pane</a>."
392
- msgstr "Le cache des entrées complémentaires n’est pas à jour. Actualisez le cache depuis le <A>panneau du statut des entrées complémentaires</a>."
393
-
394
- #: options.php:84
395
- msgid "Your related posts cache is empty. Please build your cache from the <A>related posts status pane</a>."
396
- msgstr "Le cache des entrées complémentaires est vide. Construisez le cache depuis le <A>panneau du statut des entrées complémentaires</a>."
397
-
398
- #: options.php:127
399
- msgid "If you updated the \"pool\" options or \"relatedness\" options displayed, please rebuild your cache now from the <A>related posts status pane</a>."
400
- msgstr "Si vous avez modifié les réglages pour le <i>corpus</i> ou pour les options de complémentarité, veuillez reconstruire le cache depuis le <A>panneau du statut des entrées complémentaires</a>."
401
-
402
- #: options.php:273
403
- msgid "by <a href=\"http://mitcho.com/code/\">mitcho (Michael 芳貴 Erlewine)</a>"
404
- msgstr "par <a href=\"http://mitcho.com/code/\">mitcho (Michael 芳貴 Erlewine)</a>"
405
-
406
- #: options.php:273
407
- msgid "Follow <a href=\"http://twitter.com/yarpp/\">Yet Another Related Posts Plugin on Twitter</a>"
408
- msgstr "Suivez <a href=\"http://twitter.com/yarpp/\">YARPP sur Twitter</a>"
409
-
410
- #: options.php:294
411
- msgid "day(s)"
412
- msgstr "jour(s)"
413
-
414
- #: options.php:295
415
- msgid "week(s)"
416
- msgstr "semaine(s)"
417
-
418
- #: options.php:296
419
- msgid "month(s)"
420
- msgstr "mois"
421
-
422
- #: options.php:298
423
- msgid "Show only posts from the past NUMBER UNITS"
424
- msgstr "N’afficher que des entrées publiées depuis moins de NUMBER UNITS"
425
-
426
- #: options.php:387
427
- msgid "There is a new beta (VERSION) of Yet Another Related Posts Plugin. You can <A>download it here</a> at your own risk."
428
- msgstr "Une nouvelle version beta (VERSION) du module d’extension YARPP est disponible. Si vous souhaitez l’essayer, vous pouvez <A>la télécharger ici</a>."
429
-
430
- #: options.php:389
431
- msgid "There is a new version (VERSION) of Yet Another Related Posts Plugin available! You can <A>download it here</a>."
432
- msgstr "Une nouvelle version (VERSION) du module d’extension YARPP est disponible. Vous pouvez <A>la télécharger ici</a>."
433
-
434
- #: options.php:410
435
- #: options.php:474
436
- msgid "Display using a custom template file"
437
- msgstr "Utiliser un modèle personnalisé"
438
-
439
- #: options.php:412
440
- #: options.php:476
441
- msgid "Template file:"
442
- msgstr "Fichier-modèle :"
443
-
444
- #: options.php:469
445
- msgid "This option displays related posts at the end of each item in your RSS and Atom feeds. No template changes are needed."
446
- msgstr "Cette option affiche les entrées complémentaires sous le texte de l’article dans vos flux RSS. Il n’est pas nécessaire de définir un fichier-modèle."
447
-
448
- #: options.php:527
449
- msgid "Advanced"
450
- msgstr "Options spéciales"
451
-
452
- #: options.php:530
453
- msgid "Show cache status"
454
- msgstr "Afficher le statut du cache"
455
-
456
- #: options.php:531
457
- msgid "When the cache is incomplete, compute related posts on the fly?"
458
- msgstr "Quand le cache n’est pas à jour, établir la liste depuis la base de données ?"
459
-
460
- #: options.php:532
461
- msgid "If a displayed post's related posts are not cached and this option is on, YARPP will compute them on the fly. Do not turn this option on if you have a high-traffic site.<br />If this option is off and a post's related posts have not been cached, it will display as if it has no related posts."
462
- msgstr "Quand cette option est activée, si les entrées complémentaires ne sont pas encore en cache, YARPP en établira la liste à partir de la base de données. N’activez pas cette option si votre site a une très fort trafic.<br />Quand cette option est désactivée, si les entrées complémentaires ne sont pas en cache, elles ne seront pas affichées."
463
-
464
- #: options.php:562
465
- msgid "'MIN minute(s) and SEC second(s) remaining'"
466
- msgstr "'MIN minute(s) et SEC seconde(s) restantes'"
467
-
468
- #: options.php:564
469
- msgid "'SEC second(s) remaining'"
470
- msgstr "'SEC seconde(s) restantes'"
471
-
472
- #: options.php:568
473
- msgid "Your related posts cache is now complete."
474
- msgstr "Le cache des entrées complémentaires est à jour."
475
-
476
- #: options.php:568
477
- msgid "The SQL queries took SEC seconds."
478
- msgstr "Les requêtes SQL ont pris SEC secondes."
479
-
480
- #: options.php:578
481
- #: options.php:582
482
- msgid "There was an error while constructing the related posts for TITLE"
483
- msgstr "Une erreur s’est produite lors de l’établissement de la liste des entrées complémentaires pour TITLE"
484
-
485
- #: options.php:579
486
- #: options.php:584
487
- msgid "try to continue"
488
- msgstr "Essayez de poursuivre l’opération"
489
-
490
- #: options.php:592
491
- msgid "Your related posts cache is PERCENT% complete."
492
- msgstr "Le cache des entrées complémentaires est à jour à PERCENT%."
493
-
494
- #: options.php:598
495
- msgid "starting..."
496
- msgstr "Démarrage…"
497
-
498
- #: services.php:59
499
- msgid "You cannot rebuild the YARPP cache."
500
- msgstr "Vous n’êtes pas autorisé à reconstruire le cache YARPP."
501
-
502
- #: services.php:90
503
- #, php-format
504
- msgid "You do not have the permission to write the file '%s'."
505
- msgstr "Vous n‘avez pas la permission en écriture pour le fichier '%s'."
506
-
507
- #: template-metabox.php:12
508
- msgid "These are the related entries for this entry. Updating this post may change these related posts."
509
- msgstr "Voici les entrées complémentaires pour cette entrée. Les futures modifications de cette entrée pourront entraîner une modification de la liste de ses entrées complémentaires."
510
-
511
- #: template-metabox.php:25
512
- msgid "Whether all of these related entries are actually displayed and how they are displayed depends on your YARPP display options."
513
- msgstr "La teneur finale de la liste d’entrées complémentaires ainsi que sa présentation sur votre site dépendent des options d’affichage YARPP que vous aurez choisies."
514
-
515
- #: template-metabox.php:27
516
- msgid "No related posts."
517
- msgstr "Il n’y a pas d’entrées complémentaires."
518
-
519
- #: options.php:10
520
- msgid "Please move the YARPP template files into your theme to complete installation. Simply move the sample template files (currently in <code>wp-content/plugins/yet-another-related-posts-plugin/yarpp-templates/</code>) to the <code>TEMPLATEPATH</code> directory."
521
- msgstr "Pour finaliser l’installation, mettez maintenant les fichiers-modèles YARPP dans votre thème WordPress. Déplacez simplement les fichiers-modèles de base (actuellement situés dans le dossier <code>wp-content/plugins/yet-another-related-posts-plugin/yarpp-templates/</code>) vers le dossier <code>TEMPLATEPATH</code>."
522
-
523
- #: options.php:15
524
- msgid "No YARPP template files were found in your theme (<code>TEMPLATEPATH</code>) so the templating feature has been turned off."
525
- msgstr "Aucun fichier-modèle YARPP ne se trouve dans votre thème WordPress (<code>TEMPLATEPATH</code>) ; la fonction de présentation d’après fichier-modèle n’a donc pas été activée."
526
-
527
- #: options.php:410
528
- #: options.php:474
529
- #: options.php:527
530
- msgid "NEW!"
531
- msgstr "NOUVEAU !"
532
-
533
- #: options.php:410
534
- #: options.php:474
535
- msgid "This advanced option gives you full power to customize how your related posts are displayed. Templates (stored in your theme folder) are written in PHP."
536
- msgstr "Cette option avancée vous permet de personnaliser la présentation de vos listes d’entrées complémentaires. Les fichiers-modèles (à placer dans le dossier de votre thème WordPress) sont écrits en PHP."
537
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lang/yarpp-ja.mo CHANGED
Binary file
lang/{yarpp-ja_JP.po → yarpp-ja.po} RENAMED
@@ -14,523 +14,367 @@ msgstr ""
14
  "X-Poedit-Basepath: \n"
15
  "X-Poedit-SearchPath-0: ."
16
 
17
- #: includes.php:94
18
  msgid "MySQL error on adding yarpp_title"
19
  msgstr "yarpp_title インデックス作成時にエラー発生。"
20
 
21
- #: includes.php:99
22
  msgid "MySQL error on adding yarpp_content"
23
  msgstr "yarpp_content インデックス作成時にエラー発生。"
24
 
25
- #: includes.php:185
26
  msgid "<h3>An important message from YARPP:</h3><p>Thank you for upgrading to YARPP 2. YARPP 2.0 adds the much requested ability to limit related entry results by certain tags or categories. 2.0 also brings more fine tuned control of the magic algorithm, letting you specify how the algorithm should consider or not consider entry content, titles, tags, and categories. Make sure to adjust the new settings to your liking and perhaps readjust your threshold.</p><p>For more information, check out the <a href=\"http://mitcho.com/code/yarpp/\">YARPP documentation</a>. (This message will not be displayed again.)</p>"
27
  msgstr ""
28
 
29
- #: yarpp.php:29
30
- #: yarpp.php:29
31
- #: includes.php:224
32
  msgid "Related Posts"
33
  msgstr "関連記事"
34
 
35
- #: includes.php:229
36
  msgid "YARPP"
37
  msgstr ""
38
 
39
- #: options.php:35
40
  #, php-format
41
  msgid "YARPP's \"consider titles\" and \"consider bodies\" relatedness criteria require your <code>%s</code> table to use the <a href='http://dev.mysql.com/doc/refman/5.0/en/storage-engines.html'>MyISAM storage engine</a>, but the table seems to be using the <code>%s</code> engine. These two options have been disabled."
42
  msgstr "YARPPの関連スコア計算の「タイトルを検討する」、「内容を検討する」オプションはデータベースの<code>%s</code>テーブルが <a href='http://dev.mysql.com/doc/refman/4.1/ja/myisam.html'>MyISAM</a> でなければ使用できません。 <code>%s</code>テーブルは現在<code>%s</code>ストーレージエンジンを使用しているので、このふたつのオプションは使えません。"
43
 
44
- #: options.php:37
45
  #, php-format
46
  msgid "To restore these features, please update your <code>%s</code> table by executing the following SQL directive: <code>ALTER TABLE `%s` ENGINE = MyISAM;</code> . No data will be erased by altering the table's engine, although there are performance implications."
47
  msgstr "このオプションを使用したければ、<code>%s</code>テーブルに対してこのようなクエリを実行してください:<code>ALTER TABLE `%s` ENGINE = MyISAM;</code>。このクエリはデータは一切消しません。"
48
 
49
- #: options.php:39
50
  #, php-format
51
  msgid "If, despite this check, you are sure that <code>%s</code> is using the MyISAM engine, press this magic button:"
52
  msgstr "<code>%s</code>テーブルが絶対MyISAMを使用していると思う方はこちらの魔法のボタンをどうぞ:"
53
 
54
- #: options.php:42
55
  msgid "Trust me. Let me use MyISAM features."
56
  msgstr "MyISAM を使ってます。嘘じゃないから。"
57
 
58
- #: options.php:65
59
  msgid "The YARPP database had an error but has been fixed."
60
  msgstr "YARPPのデータベースは修正されました。"
61
 
62
- #: options.php:67
63
  msgid "The YARPP database has an error which could not be fixed."
64
  msgstr "YARPPのデータベースに修正できないエラーが発生しました。"
65
 
66
- #: options.php:147
67
  msgid "word"
68
  msgstr ""
69
 
70
- #: options.php:148
71
  msgid "tag"
72
  msgstr "タグ"
73
 
74
- #: options.php:149
75
  msgid "category"
76
  msgstr "カテゴリー"
77
 
78
- #: options.php:153
79
- #: options.php:170
80
- #: options.php:182
81
  msgid "do not consider"
82
  msgstr "検討しない"
83
 
84
- #: options.php:154
85
- #: options.php:171
86
- #: options.php:184
87
  msgid "consider"
88
  msgstr "検討する"
89
 
90
- #: options.php:156
91
- #: options.php:186
92
  #, php-format
93
  msgid "require at least one %s in common"
94
  msgstr "共有の%sをひとつ以上必要とする"
95
 
96
- #: options.php:158
97
- #: options.php:188
98
  #, php-format
99
  msgid "require more than one %s in common"
100
  msgstr "共有の%sをふたつ以上必要とする"
101
 
102
- #: options.php:172
103
  msgid "consider with extra weight"
104
  msgstr "検討する(重要視)"
105
 
106
- #: options.php:200
107
  msgid "Yet Another Related Posts Plugin version history (RSS 2.0)"
108
  msgstr "関連記事プラグイン (YARPP) 更新履歴 (RSS 2.0)"
109
 
110
- #: options.php:271
111
- #: options.php:271
112
  msgid "Donate to mitcho (Michael Yoshitaka Erlewine) for this plugin via PayPal"
113
  msgstr "YARPPの作成者(ミッチョ)にPayPalで寄付をする"
114
 
115
- #: options.php:254
116
  msgid "Yet Another Related Posts Plugin Options"
117
  msgstr "関連記事 (YARPP) 設定"
118
 
119
- #: options.php:278
 
 
 
 
 
120
  msgid "\"The Pool\""
121
  msgstr "フィルター設定"
122
 
123
- #: options.php:279
124
  msgid "\"The Pool\" refers to the pool of posts and pages that are candidates for display as related to the current entry."
125
  msgstr "関連記事として表示したい記事を制限します。"
126
 
127
- #: options.php:284
128
  msgid "Disallow by category:"
129
  msgstr "このカテゴリーの記事を表示しない"
130
 
131
- #: options.php:286
132
  msgid "Disallow by tag:"
133
  msgstr "このタグの記事を表示しない"
134
 
135
- #: options.php:288
136
  msgid "Show password protected posts?"
137
  msgstr "パスワードで保護されている記事も表示"
138
 
139
- #: options.php:289
140
  msgid "Show only previous posts?"
141
  msgstr "過去の記事だけを表示"
142
 
143
- #: options.php:306
144
  msgid "\"Relatedness\" options"
145
  msgstr "関連スコア設定"
146
 
147
- #: options.php:308
148
  #, php-format
149
  msgid "YARPP is different than the <a href=\"http://wasabi.pbwiki.com/Related%20Entries\">previous plugins it is based on</a> as it limits the related posts list by (1) a maximum number and (2) a <em>match threshold</em>."
150
  msgstr "この関連記事プラグイン(YARPP)は各対象記事の関連スコアを計算し、ある関連スコア以上の記事だけを表示します。"
151
 
152
- #: options.php:313
153
  msgid "Match threshold:"
154
  msgstr "表示する最低関連スコア"
155
 
156
- #: options.php:314
157
  msgid "Titles: "
158
  msgstr "タイトル:"
159
 
160
- #: options.php:316
161
  msgid "Bodies: "
162
  msgstr "内容:"
163
 
164
- #: options.php:318
165
  msgid "Tags: "
166
  msgstr "タグ:"
167
 
168
- #: options.php:320
169
  msgid "Categories: "
170
  msgstr "カテゴリー:"
171
 
172
- #: options.php:322
173
  msgid "Cross-relate posts and pages?"
174
  msgstr "記事とページを関連づける"
175
 
176
- #: options.php:322
177
  msgid "When the \"Cross-relate posts and pages\" option is selected, the <code>related_posts()</code>, <code>related_pages()</code>, and <code>related_entries()</code> all will give the same output, returning both related pages and posts."
178
  msgstr "「記事とページを関連づける」が有効の場合は <code>related_posts()</code>、 <code>related_pages()</code> と <code>related_entries()</code> は全て記事とページを両方「関連記事/ページ」として表示します。"
179
 
180
- #: options.php:401
181
  msgid "Display options <small>for your website</small>"
182
  msgstr "表示設定 <small>ウェブサイト用</small>"
183
 
184
- #: magic.php:304
185
- #: options.php:458
186
- #: options.php:521
 
 
 
 
 
 
 
 
187
  msgid "Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>."
188
  msgstr "関連記事は<a href='http://mitcho.com/code/yarpp/'>YARPP関連記事プラグイン</a>によって表示されています。"
189
 
190
- #: options.php:405
191
  msgid "Automatically display related posts?"
192
  msgstr "自動的に関連記事を表示する"
193
 
194
- #: options.php:405
195
  msgid "This option automatically displays related posts right after the content on single entry pages. If this option is off, you will need to manually insert <code>related_posts()</code> or variants (<code>related_pages()</code> and <code>related_entries()</code>) into your theme files."
196
  msgstr "単体記事表示時に自動的に関連記事を表示します。この自動表示を無効にすると、テーマファイルに<code>related_posts()</code>を入れる必要があります。"
197
 
198
- #: options.php:406
199
  msgid "Website display code example"
200
  msgstr "ウェブサイト表示のソース例"
201
 
202
- #: options.php:406
203
- #: options.php:471
204
  msgid "(Update options to reload.)"
205
  msgstr "(設定保存時に更新されます)"
206
 
207
- #: options.php:409
208
- #: options.php:473
209
  msgid "Maximum number of related posts:"
210
  msgstr "一度に表示する関連記事数"
211
 
212
- #: options.php:422
213
  msgid "Before / after related entries:"
214
  msgstr "関連記事表示を囲むタグ:"
215
 
216
- #: options.php:423
217
- #: options.php:428
218
- #: options.php:437
219
- #: options.php:487
220
- #: options.php:492
221
- #: options.php:501
222
  msgid "For example:"
223
  msgstr "例:"
224
 
225
- #: options.php:427
226
- #: options.php:491
227
  msgid "Before / after each related entry:"
228
  msgstr "各関連記事を囲むタグ:"
229
 
230
- #: options.php:431
231
- #: options.php:495
232
  msgid "Show excerpt?"
233
  msgstr "抜粋を表示?"
234
 
235
- #: options.php:432
236
- #: options.php:496
237
  msgid "Excerpt length (No. of words):"
238
  msgstr "抜粋の長さ(単語数):"
239
 
240
- #: options.php:436
241
  msgid "Before / after (Excerpt):"
242
  msgstr "抜粋を囲むタグ:"
243
 
244
- #: options.php:442
245
- #: options.php:506
246
  msgid "Order results:"
247
  msgstr "表示順番:"
248
 
249
- #: options.php:444
250
- #: options.php:508
251
  msgid "score (high relevance to low)"
252
  msgstr "関連スコアの高い順"
253
 
254
- #: options.php:445
255
- #: options.php:509
256
  msgid "score (low relevance to high)"
257
  msgstr "関連スコアの低い順"
258
 
259
- #: options.php:446
260
- #: options.php:510
261
  msgid "date (new to old)"
262
  msgstr "新しい日付順(降順)"
263
 
264
- #: options.php:447
265
- #: options.php:511
266
  msgid "date (old to new)"
267
  msgstr "古い日付順(昇順)"
268
 
269
- #: options.php:448
270
- #: options.php:512
271
  msgid "title (alphabetical)"
272
  msgstr "タイトル順(昇順)"
273
 
274
- #: options.php:449
275
- #: options.php:513
276
  msgid "title (reverse alphabetical)"
277
  msgstr "タイトル順(降順)"
278
 
279
- #: options.php:454
280
- #: options.php:518
281
  msgid "Default display if no results:"
282
  msgstr "関連記事がない時のメッセージ"
283
 
284
- #: options.php:456
285
- #: options.php:520
286
  msgid "Help promote Yet Another Related Posts Plugin?"
287
  msgstr "この関連記事プラグイン(YARPP)を宣伝しますか?"
288
 
289
- #: options.php:458
290
- #: options.php:521
291
  #, php-format
292
  msgid "This option will add the code %s. Try turning it on, updating your options, and see the code in the code example to the right. These links and donations are greatly appreciated."
293
  msgstr "関連記事表示の下に「%s」というコードを挿入します。"
294
 
295
- #: options.php:464
296
  msgid "Display options <small>for RSS</small>"
297
  msgstr "表示設定 <small>RSS/Atom フィード用</small>"
298
 
299
- #: options.php:469
300
  msgid "Display related posts in feeds?"
301
  msgstr "自動的にフィードで関連記事を表示する"
302
 
303
- #: options.php:470
304
  msgid "Display related posts in the descriptions?"
305
  msgstr "フィード内の抜粋にも自動的に関連記事を表示する"
306
 
307
- #: options.php:470
308
  msgid "This option displays the related posts in the RSS description fields, not just the content. If your feeds are set up to only display excerpts, however, only the description field is used, so this option is required for any display at all."
309
  msgstr "フィード内の全文表示に関連記事を表示するだけでなく、フィード内の抜粋でも関連記事が表示されます。WordPressの設定によりフィードに抜粋のみを表示している場合は、このオプションが無効の場合関連記事がフィード内で表示されません。"
310
 
311
- #: options.php:471
312
  msgid "RSS display code example"
313
  msgstr "RSS表示のソース例"
314
 
315
- #: options.php:486
316
  msgid "Before / after related entries display:"
317
  msgstr "関連記事表示を囲むタグ:"
318
 
319
- #: options.php:500
320
  msgid "Before / after (excerpt):"
321
  msgstr "抜粋を囲むタグ:"
322
 
323
- #: template-builtin.php:35
324
  #, php-format
325
  msgid "%f is the YARPP match score between the current entry and this related entry. You are seeing this value because you are logged in to WordPress as an administrator. It is not shown to regular visitors."
326
  msgstr "%fは現在表示の記事とこの関連記事の関連スコアです。この関連スコアはログイン済みのサイト管理者のみに表示されます。"
327
 
328
- #: includes.php:197
329
- #: includes.php:197
330
  msgid "Related Posts (YARPP)"
331
  msgstr "関連記事 (YARPP)"
332
 
333
- #: options.php:26
334
  msgid "The MyISAM check has been overridden. You may now use the \"consider titles\" and \"consider bodies\" relatedness criteria."
335
  msgstr "MyISAM専用機能を強制的に有効にしました。「タイトルを検討」と「内容を検討」機能が使えるようになりました。"
336
 
337
- #: options.php:308
338
- #: options.php:322
339
- #: options.php:405
340
- #: options.php:410
341
- #: options.php:457
342
- #: options.php:469
343
- #: options.php:470
344
- #: options.php:474
345
- #: options.php:520
346
- #: options.php:531
347
  msgid "more&gt;"
348
  msgstr "(説明)"
349
 
350
- #: options.php:125
351
  msgid "Options saved!"
352
  msgstr "設定の変更は保存されました。"
353
 
354
- #: options.php:606
355
  msgid "Do you really want to reset your configuration?"
356
  msgstr "本当に初期設定に戻りますか?"
357
 
358
- #: options.php:605
359
  msgid "Update options"
360
  msgstr "変更を保存"
361
 
362
- #: options.php:308
363
  msgid "The higher the match threshold, the more restrictive, and you get less related posts overall. The default match threshold is 5. If you want to find an appropriate match threshhold, take a look at some post's related posts display and their scores. You can see what kinds of related posts are being picked up and with what kind of match scores, and determine an appropriate threshold for your site."
364
  msgstr "より関連性の高い記事だけを表示したい場合は、最低関連スコアを上げてください。初期設定は5です。"
365
 
366
- #: options.php:606
367
  msgid "Reset options"
368
  msgstr "初期設定に戻る"
369
 
370
- #: magic.php:56
371
- msgid "Example post "
372
- msgstr "例:"
373
-
374
- #: template-metabox.php:12
375
- msgid "These are the related entries for this entry. Updating this post may change these related posts."
376
- msgstr "この投稿の関連記事。投稿を更新すると関連記事も変わる可能性があります。"
377
-
378
- #: template-metabox.php:25
379
- msgid "Whether all of these related entries are actually displayed and how they are displayed depends on your YARPP display options."
380
- msgstr "関連記事候補が全て表示されるかどうかは YARPP (関連記事) オプションの表示設定によって異なります。"
381
-
382
- #: template-metabox.php:27
383
- msgid "No related posts."
384
- msgstr "関連記事はありません。"
385
-
386
- #: options.php:81
387
- #: options.php:84
388
- #: options.php:126
389
- #: options.php:530
390
- msgid "Related posts cache status"
391
- msgstr "関連記事のキャッシュ状況"
392
-
393
- #: options.php:81
394
- msgid "Your related posts cache is incomplete. Please build your cache from the <A>related posts status pane</a>."
395
- msgstr "関連記事のキャッシュは現在未完全です。<A>キャッシュ状況パネル</a>でキャッシュを作成してください。"
396
-
397
- #: options.php:84
398
- msgid "Your related posts cache is empty. Please build your cache from the <A>related posts status pane</a>."
399
- msgstr "関連記事はまだキャッシュされていません。すぐに<A>キャッシュ状況パネル</a>でキャッシュを作成してください。"
400
-
401
- #: options.php:127
402
- msgid "If you updated the \"pool\" options or \"relatedness\" options displayed, please rebuild your cache now from the <A>related posts status pane</a>."
403
- msgstr "フィルター設定や関連スコア設定を調節した場合、<A>キャッシュ状況パネル</a>でキャッシュを更新してください。"
404
-
405
- #: options.php:273
406
- msgid "by <a href=\"http://mitcho.com/code/\">mitcho (Michael 芳貴 Erlewine)</a>"
407
- msgstr ""
408
-
409
- #: options.php:273
410
- msgid "Follow <a href=\"http://twitter.com/yarpp/\">Yet Another Related Posts Plugin on Twitter</a>"
411
- msgstr "Twitter で <a href=\"http://twitter.com/yarpp/\">YARPP をフォロー</a>。"
412
-
413
- #: options.php:294
414
- msgid "day(s)"
415
- msgstr "日間"
416
-
417
- #: options.php:295
418
- msgid "week(s)"
419
- msgstr "週間"
420
-
421
- #: options.php:296
422
- msgid "month(s)"
423
- msgstr "ヶ月間"
424
-
425
- #: options.php:298
426
- msgid "Show only posts from the past NUMBER UNITS"
427
- msgstr "過去 NUMBER UNITS の記事だけを表示"
428
-
429
- #: options.php:387
430
- msgid "There is a new beta (VERSION) of Yet Another Related Posts Plugin. You can <A>download it here</a> at your own risk."
431
- msgstr "関連記事プラグイン(YARPP)の新しいベータ(VERSION)があります。是非<A>ダウンロード</a>してみてください。"
432
-
433
- #: options.php:389
434
- msgid "There is a new version (VERSION) of Yet Another Related Posts Plugin available! You can <A>download it here</a>."
435
- msgstr "関連記事プラグイン(YARPP)の新しいバージョン(VERSION)があります。是非<A>ダウンロード</a>してみてください。"
436
-
437
- #: options.php:410
438
- #: options.php:474
439
- msgid "Display using a custom template file"
440
- msgstr "テンプレートを使って表示"
441
-
442
- #: options.php:412
443
- #: options.php:476
444
- msgid "Template file:"
445
- msgstr "テンプレートファイル:"
446
-
447
- #: options.php:469
448
- msgid "This option displays related posts at the end of each item in your RSS and Atom feeds. No template changes are needed."
449
- msgstr "RSSとAtomフィード内に関連記事を表示。テーマの変更は必要ありません。"
450
-
451
- #: options.php:527
452
- msgid "Advanced"
453
- msgstr "詳細"
454
-
455
- #: options.php:530
456
- msgid "Show cache status"
457
- msgstr "キャッシュ状況を表示"
458
-
459
- #: options.php:531
460
- msgid "When the cache is incomplete, compute related posts on the fly?"
461
- msgstr "キャッシュされていない場合、関連記事を寸時に計算。"
462
-
463
- #: options.php:532
464
- msgid "If a displayed post's related posts are not cached and this option is on, YARPP will compute them on the fly. Do not turn this option on if you have a high-traffic site.<br />If this option is off and a post's related posts have not been cached, it will display as if it has no related posts."
465
- msgstr "関連記事がキャッシュが未完全の場合、このオプションが有効であれば自動的に関連記事のクエリを実行します。"
466
-
467
- #: options.php:562
468
- msgid "'MIN minute(s) and SEC second(s) remaining'"
469
- msgstr "'残りMIN分SEC秒'"
470
-
471
- #: options.php:564
472
- msgid "'SEC second(s) remaining'"
473
- msgstr "'残りSEC秒'"
474
-
475
- #: options.php:568
476
- msgid "Your related posts cache is now complete."
477
- msgstr "関連記事キャッシュの作成は完了しました。"
478
-
479
- #: options.php:568
480
- msgid "The SQL queries took SEC seconds."
481
- msgstr "SQLクエリは計SEC秒かかりました。"
482
-
483
- #: options.php:578
484
- #: options.php:582
485
- msgid "There was an error while constructing the related posts for TITLE"
486
- msgstr "「TITLE」の関連記事を作成する途中にエラーが置きました。"
487
-
488
- #: options.php:579
489
- #: options.php:584
490
- msgid "try to continue"
491
- msgstr "続ける"
492
-
493
- #: options.php:592
494
- msgid "Your related posts cache is PERCENT% complete."
495
- msgstr "関連記事キャッシュは PERCENT% 完了です。"
496
-
497
- #: options.php:598
498
- msgid "starting..."
499
- msgstr "キャッシュ作成開始..."
500
-
501
- #: includes.php:110
502
- msgid "MySQL error on creating yarpp_keyword_cache table"
503
- msgstr "yarpp_keywords_cache テーブル作成時に MySQL エラー発生!"
504
-
505
- #: includes.php:121
506
- msgid "MySQL error on creating yarpp_related_cache table"
507
- msgstr "yarpp_related_cache テーブル作成時に MySQL エラー発生!"
508
-
509
- #: services.php:59
510
- msgid "You cannot rebuild the YARPP cache."
511
- msgstr "YARPP は関連記事キャッシュを作成出来ませんでした。"
512
-
513
- #: services.php:90
514
- #, php-format
515
- msgid "You do not have the permission to write the file '%s'."
516
- msgstr ""
517
-
518
- #: options.php:10
519
- msgid "Please move the YARPP template files into your theme to complete installation. Simply move the sample template files (currently in <code>wp-content/plugins/yet-another-related-posts-plugin/yarpp-templates/</code>) to the <code>TEMPLATEPATH</code> directory."
520
- msgstr "インストールの最終項目として、 YARPP のテンプレートファイルを現在使用のテーマのフォルダに移しましょう。<code>wp-content/plugins/yet-another-related-posts-plugin/yarpp-templates/</code>内の模範テンプレートを<code>TEMPLATEPATH</code>にコピーしてください。"
521
-
522
- #: options.php:15
523
- msgid "No YARPP template files were found in your theme (<code>TEMPLATEPATH</code>) so the templating feature has been turned off."
524
- msgstr "現在使用のテーマのフォルダ (<code>TEMPLATEPATH</code>) に YARPP テンプレートファイルが見つからなかったためテンプレート機能は使えません。"
525
-
526
- #: options.php:410
527
- #: options.php:474
528
- #: options.php:527
529
- msgid "NEW!"
530
- msgstr ""
531
-
532
- #: options.php:410
533
- #: options.php:474
534
- msgid "This advanced option gives you full power to customize how your related posts are displayed. Templates (stored in your theme folder) are written in PHP."
535
- msgstr "この新機能で関連記事の表示を完全にカスタマイズする事が出来ます。テンプレートファイルは PHP でかき、使用テーマのフォルダにいれます。"
536
-
14
  "X-Poedit-Basepath: \n"
15
  "X-Poedit-SearchPath-0: ."
16
 
17
+ #: includes.php:74
18
  msgid "MySQL error on adding yarpp_title"
19
  msgstr "yarpp_title インデックス作成時にエラー発生。"
20
 
21
+ #: includes.php:79
22
  msgid "MySQL error on adding yarpp_content"
23
  msgstr "yarpp_content インデックス作成時にエラー発生。"
24
 
25
+ #: includes.php:133
26
  msgid "<h3>An important message from YARPP:</h3><p>Thank you for upgrading to YARPP 2. YARPP 2.0 adds the much requested ability to limit related entry results by certain tags or categories. 2.0 also brings more fine tuned control of the magic algorithm, letting you specify how the algorithm should consider or not consider entry content, titles, tags, and categories. Make sure to adjust the new settings to your liking and perhaps readjust your threshold.</p><p>For more information, check out the <a href=\"http://mitcho.com/code/yarpp/\">YARPP documentation</a>. (This message will not be displayed again.)</p>"
27
  msgstr ""
28
 
29
+ #: includes.php:173
 
 
30
  msgid "Related Posts"
31
  msgstr "関連記事"
32
 
33
+ #: includes.php:178
34
  msgid "YARPP"
35
  msgstr ""
36
 
37
+ #: options.php:17
38
  #, php-format
39
  msgid "YARPP's \"consider titles\" and \"consider bodies\" relatedness criteria require your <code>%s</code> table to use the <a href='http://dev.mysql.com/doc/refman/5.0/en/storage-engines.html'>MyISAM storage engine</a>, but the table seems to be using the <code>%s</code> engine. These two options have been disabled."
40
  msgstr "YARPPの関連スコア計算の「タイトルを検討する」、「内容を検討する」オプションはデータベースの<code>%s</code>テーブルが <a href='http://dev.mysql.com/doc/refman/4.1/ja/myisam.html'>MyISAM</a> でなければ使用できません。 <code>%s</code>テーブルは現在<code>%s</code>ストーレージエンジンを使用しているので、このふたつのオプションは使えません。"
41
 
42
+ #: options.php:19
43
  #, php-format
44
  msgid "To restore these features, please update your <code>%s</code> table by executing the following SQL directive: <code>ALTER TABLE `%s` ENGINE = MyISAM;</code> . No data will be erased by altering the table's engine, although there are performance implications."
45
  msgstr "このオプションを使用したければ、<code>%s</code>テーブルに対してこのようなクエリを実行してください:<code>ALTER TABLE `%s` ENGINE = MyISAM;</code>。このクエリはデータは一切消しません。"
46
 
47
+ #: options.php:21
48
  #, php-format
49
  msgid "If, despite this check, you are sure that <code>%s</code> is using the MyISAM engine, press this magic button:"
50
  msgstr "<code>%s</code>テーブルが絶対MyISAMを使用していると思う方はこちらの魔法のボタンをどうぞ:"
51
 
52
+ #: options.php:24
53
  msgid "Trust me. Let me use MyISAM features."
54
  msgstr "MyISAM を使ってます。嘘じゃないから。"
55
 
56
+ #: options.php:47
57
  msgid "The YARPP database had an error but has been fixed."
58
  msgstr "YARPPのデータベースは修正されました。"
59
 
60
+ #: options.php:49
61
  msgid "The YARPP database has an error which could not be fixed."
62
  msgstr "YARPPのデータベースに修正できないエラーが発生しました。"
63
 
64
+ #: options.php:115
65
  msgid "word"
66
  msgstr ""
67
 
68
+ #: options.php:116
69
  msgid "tag"
70
  msgstr "タグ"
71
 
72
+ #: options.php:117
73
  msgid "category"
74
  msgstr "カテゴリー"
75
 
76
+ #: options.php:121
77
+ #: options.php:138
78
+ #: options.php:150
79
  msgid "do not consider"
80
  msgstr "検討しない"
81
 
82
+ #: options.php:122
83
+ #: options.php:139
84
+ #: options.php:152
85
  msgid "consider"
86
  msgstr "検討する"
87
 
88
+ #: options.php:124
89
+ #: options.php:154
90
  #, php-format
91
  msgid "require at least one %s in common"
92
  msgstr "共有の%sをひとつ以上必要とする"
93
 
94
+ #: options.php:126
95
+ #: options.php:156
96
  #, php-format
97
  msgid "require more than one %s in common"
98
  msgstr "共有の%sをふたつ以上必要とする"
99
 
100
+ #: options.php:140
101
  msgid "consider with extra weight"
102
  msgstr "検討する(重要視)"
103
 
104
+ #: options.php:168
105
  msgid "Yet Another Related Posts Plugin version history (RSS 2.0)"
106
  msgstr "関連記事プラグイン (YARPP) 更新履歴 (RSS 2.0)"
107
 
108
+ #: options.php:183
109
+ #: options.php:183
110
  msgid "Donate to mitcho (Michael Yoshitaka Erlewine) for this plugin via PayPal"
111
  msgstr "YARPPの作成者(ミッチョ)にPayPalで寄付をする"
112
 
113
+ #: options.php:186
114
  msgid "Yet Another Related Posts Plugin Options"
115
  msgstr "関連記事 (YARPP) 設定"
116
 
117
+ #: options.php:202
118
+ #, php-format
119
+ msgid "by <a href=\"http://mitcho.com/code/\">mitcho (Michael 芳貴 Erlewine)</a> and based on the fabulous work of <a href=\"http://peter.mapledesign.co.uk/weblog/archives/wordpress-related-posts-plugin\">Peter Bower</a>, <a href=\"http://wasabi.pbwiki.com/Related%20Entries\">Alexander Malov &amp; Mike Lu</a>."
120
+ msgstr "作成者: <a href=\"http://mitcho.com/\">ミッチョ (アーリーワイン・マイケル芳貴)</a>"
121
+
122
+ #: options.php:206
123
  msgid "\"The Pool\""
124
  msgstr "フィルター設定"
125
 
126
+ #: options.php:207
127
  msgid "\"The Pool\" refers to the pool of posts and pages that are candidates for display as related to the current entry."
128
  msgstr "関連記事として表示したい記事を制限します。"
129
 
130
+ #: options.php:212
131
  msgid "Disallow by category:"
132
  msgstr "このカテゴリーの記事を表示しない"
133
 
134
+ #: options.php:221
135
  msgid "Disallow by tag:"
136
  msgstr "このタグの記事を表示しない"
137
 
138
+ #: options.php:230
139
  msgid "Show password protected posts?"
140
  msgstr "パスワードで保護されている記事も表示"
141
 
142
+ #: options.php:231
143
  msgid "Show only previous posts?"
144
  msgstr "過去の記事だけを表示"
145
 
146
+ #: options.php:236
147
  msgid "\"Relatedness\" options"
148
  msgstr "関連スコア設定"
149
 
150
+ #: options.php:237
151
  #, php-format
152
  msgid "YARPP is different than the <a href=\"http://wasabi.pbwiki.com/Related%20Entries\">previous plugins it is based on</a> as it limits the related posts list by (1) a maximum number and (2) a <em>match threshold</em>."
153
  msgstr "この関連記事プラグイン(YARPP)は各対象記事の関連スコアを計算し、ある関連スコア以上の記事だけを表示します。"
154
 
155
+ #: options.php:242
156
  msgid "Match threshold:"
157
  msgstr "表示する最低関連スコア"
158
 
159
+ #: options.php:243
160
  msgid "Titles: "
161
  msgstr "タイトル:"
162
 
163
+ #: options.php:245
164
  msgid "Bodies: "
165
  msgstr "内容:"
166
 
167
+ #: options.php:247
168
  msgid "Tags: "
169
  msgstr "タグ:"
170
 
171
+ #: options.php:249
172
  msgid "Categories: "
173
  msgstr "カテゴリー:"
174
 
175
+ #: options.php:251
176
  msgid "Cross-relate posts and pages?"
177
  msgstr "記事とページを関連づける"
178
 
179
+ #: options.php:251
180
  msgid "When the \"Cross-relate posts and pages\" option is selected, the <code>related_posts()</code>, <code>related_pages()</code>, and <code>related_entries()</code> all will give the same output, returning both related pages and posts."
181
  msgstr "「記事とページを関連づける」が有効の場合は <code>related_posts()</code>、 <code>related_pages()</code> と <code>related_entries()</code> は全て記事とページを両方「関連記事/ページ」として表示します。"
182
 
183
+ #: options.php:293
184
  msgid "Display options <small>for your website</small>"
185
  msgstr "表示設定 <small>ウェブサイト用</small>"
186
 
187
+ #: options.php:302
188
+ #: options.php:363
189
+ #: options.php:363
190
+ msgid "RELATED TITLE"
191
+ msgstr "関連記事タイトル"
192
+
193
+ #: options.php:307
194
+ #: options.php:349
195
+ #: options.php:368
196
+ #: options.php:412
197
+ #: magic.php:219
198
  msgid "Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>."
199
  msgstr "関連記事は<a href='http://mitcho.com/code/yarpp/'>YARPP関連記事プラグイン</a>によって表示されています。"
200
 
201
+ #: options.php:309
202
  msgid "Automatically display related posts?"
203
  msgstr "自動的に関連記事を表示する"
204
 
205
+ #: options.php:309
206
  msgid "This option automatically displays related posts right after the content on single entry pages. If this option is off, you will need to manually insert <code>related_posts()</code> or variants (<code>related_pages()</code> and <code>related_entries()</code>) into your theme files."
207
  msgstr "単体記事表示時に自動的に関連記事を表示します。この自動表示を無効にすると、テーマファイルに<code>related_posts()</code>を入れる必要があります。"
208
 
209
+ #: options.php:310
210
  msgid "Website display code example"
211
  msgstr "ウェブサイト表示のソース例"
212
 
213
+ #: options.php:310
214
+ #: options.php:372
215
  msgid "(Update options to reload.)"
216
  msgstr "(設定保存時に更新されます)"
217
 
218
+ #: options.php:312
219
+ #: options.php:374
220
  msgid "Maximum number of related posts:"
221
  msgstr "一度に表示する関連記事数"
222
 
223
+ #: options.php:314
224
  msgid "Before / after related entries:"
225
  msgstr "関連記事表示を囲むタグ:"
226
 
227
+ #: options.php:315
228
+ #: options.php:320
229
+ #: options.php:329
230
+ #: options.php:378
231
+ #: options.php:383
232
+ #: options.php:392
233
  msgid "For example:"
234
  msgstr "例:"
235
 
236
+ #: options.php:319
237
+ #: options.php:382
238
  msgid "Before / after each related entry:"
239
  msgstr "各関連記事を囲むタグ:"
240
 
241
+ #: options.php:323
242
+ #: options.php:386
243
  msgid "Show excerpt?"
244
  msgstr "抜粋を表示?"
245
 
246
+ #: options.php:324
247
+ #: options.php:387
248
  msgid "Excerpt length (No. of words):"
249
  msgstr "抜粋の長さ(単語数):"
250
 
251
+ #: options.php:328
252
  msgid "Before / after (Excerpt):"
253
  msgstr "抜粋を囲むタグ:"
254
 
255
+ #: options.php:334
256
+ #: options.php:397
257
  msgid "Order results:"
258
  msgstr "表示順番:"
259
 
260
+ #: options.php:336
261
+ #: options.php:399
262
  msgid "score (high relevance to low)"
263
  msgstr "関連スコアの高い順"
264
 
265
+ #: options.php:337
266
+ #: options.php:400
267
  msgid "score (low relevance to high)"
268
  msgstr "関連スコアの低い順"
269
 
270
+ #: options.php:338
271
+ #: options.php:401
272
  msgid "date (new to old)"
273
  msgstr "新しい日付順(降順)"
274
 
275
+ #: options.php:339
276
+ #: options.php:402
277
  msgid "date (old to new)"
278
  msgstr "古い日付順(昇順)"
279
 
280
+ #: options.php:340
281
+ #: options.php:403
282
  msgid "title (alphabetical)"
283
  msgstr "タイトル順(昇順)"
284
 
285
+ #: options.php:341
286
+ #: options.php:404
287
  msgid "title (reverse alphabetical)"
288
  msgstr "タイトル順(降順)"
289
 
290
+ #: options.php:346
291
+ #: options.php:409
292
  msgid "Default display if no results:"
293
  msgstr "関連記事がない時のメッセージ"
294
 
295
+ #: options.php:347
296
+ #: options.php:411
297
  msgid "Help promote Yet Another Related Posts Plugin?"
298
  msgstr "この関連記事プラグイン(YARPP)を宣伝しますか?"
299
 
300
+ #: options.php:349
301
+ #: options.php:412
302
  #, php-format
303
  msgid "This option will add the code %s. Try turning it on, updating your options, and see the code in the code example to the right. These links and donations are greatly appreciated."
304
  msgstr "関連記事表示の下に「%s」というコードを挿入します。"
305
 
306
+ #: options.php:354
307
  msgid "Display options <small>for RSS</small>"
308
  msgstr "表示設定 <small>RSS/Atom フィード用</small>"
309
 
310
+ #: options.php:370
311
  msgid "Display related posts in feeds?"
312
  msgstr "自動的にフィードで関連記事を表示する"
313
 
314
+ #: options.php:371
315
  msgid "Display related posts in the descriptions?"
316
  msgstr "フィード内の抜粋にも自動的に関連記事を表示する"
317
 
318
+ #: options.php:371
319
  msgid "This option displays the related posts in the RSS description fields, not just the content. If your feeds are set up to only display excerpts, however, only the description field is used, so this option is required for any display at all."
320
  msgstr "フィード内の全文表示に関連記事を表示するだけでなく、フィード内の抜粋でも関連記事が表示されます。WordPressの設定によりフィードに抜粋のみを表示している場合は、このオプションが無効の場合関連記事がフィード内で表示されません。"
321
 
322
+ #: options.php:372
323
  msgid "RSS display code example"
324
  msgstr "RSS表示のソース例"
325
 
326
+ #: options.php:377
327
  msgid "Before / after related entries display:"
328
  msgstr "関連記事表示を囲むタグ:"
329
 
330
+ #: options.php:391
331
  msgid "Before / after (excerpt):"
332
  msgstr "抜粋を囲むタグ:"
333
 
334
+ #: magic.php:210
335
  #, php-format
336
  msgid "%f is the YARPP match score between the current entry and this related entry. You are seeing this value because you are logged in to WordPress as an administrator. It is not shown to regular visitors."
337
  msgstr "%fは現在表示の記事とこの関連記事の関連スコアです。この関連スコアはログイン済みのサイト管理者のみに表示されます。"
338
 
339
+ #: includes.php:154
340
+ #: includes.php:154
341
  msgid "Related Posts (YARPP)"
342
  msgstr "関連記事 (YARPP)"
343
 
344
+ #: options.php:8
345
  msgid "The MyISAM check has been overridden. You may now use the \"consider titles\" and \"consider bodies\" relatedness criteria."
346
  msgstr "MyISAM専用機能を強制的に有効にしました。「タイトルを検討」と「内容を検討」機能が使えるようになりました。"
347
 
348
+ #: options.php:302
349
+ msgid "PERMALINK"
350
+ msgstr "パーマリンク"
351
+
352
+ #: options.php:237
353
+ #: options.php:251
354
+ #: options.php:309
355
+ #: options.php:348
356
+ #: options.php:371
357
+ #: options.php:411
358
  msgid "more&gt;"
359
  msgstr "(説明)"
360
 
361
+ #: options.php:95
362
  msgid "Options saved!"
363
  msgstr "設定の変更は保存されました。"
364
 
365
+ #: options.php:420
366
  msgid "Do you really want to reset your configuration?"
367
  msgstr "本当に初期設定に戻りますか?"
368
 
369
+ #: options.php:419
370
  msgid "Update options"
371
  msgstr "変更を保存"
372
 
373
+ #: options.php:237
374
  msgid "The higher the match threshold, the more restrictive, and you get less related posts overall. The default match threshold is 5. If you want to find an appropriate match threshhold, take a look at some post's related posts display and their scores. You can see what kinds of related posts are being picked up and with what kind of match scores, and determine an appropriate threshold for your site."
375
  msgstr "より関連性の高い記事だけを表示したい場合は、最低関連スコアを上げてください。初期設定は5です。"
376
 
377
+ #: options.php:420
378
  msgid "Reset options"
379
  msgstr "初期設定に戻る"
380
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lang/yarpp-zh_CN.mo CHANGED
Binary file
lang/yarpp-zh_CN.po CHANGED
@@ -14,525 +14,367 @@ msgstr ""
14
  "X-Poedit-Basepath: \n"
15
  "X-Poedit-SearchPath-0: ."
16
 
17
- #: includes.php:94
18
  msgid "MySQL error on adding yarpp_title"
19
- msgstr "添加 yarpp_title 时错误"
20
 
21
- #: includes.php:99
22
  msgid "MySQL error on adding yarpp_content"
23
- msgstr "添加 yarpp_content 时错误"
24
 
25
- #: includes.php:185
26
  msgid "<h3>An important message from YARPP:</h3><p>Thank you for upgrading to YARPP 2. YARPP 2.0 adds the much requested ability to limit related entry results by certain tags or categories. 2.0 also brings more fine tuned control of the magic algorithm, letting you specify how the algorithm should consider or not consider entry content, titles, tags, and categories. Make sure to adjust the new settings to your liking and perhaps readjust your threshold.</p><p>For more information, check out the <a href=\"http://mitcho.com/code/yarpp/\">YARPP documentation</a>. (This message will not be displayed again.)</p>"
27
  msgstr "<h3>关于 YARPP 的重要信息:</h3><p>感谢您升级到 YARPP 2. YARPP 2.0 adds the much requested ability to limit related entry results by certain tags or categories. 2.0 also brings more fine tuned control of the magic algorithm, letting you specify how the algorithm should consider or not consider entry content, titles, tags, and categories. Make sure to adjust the new settings to your liking and perhaps readjust your threshold.</p><p>更多信息,请查阅 <a href=\"http://mitcho.com/code/yarpp/\">YARPP 官方手册</a>. (本条信息不会再次出现。)</p>"
28
 
29
- #: includes.php:197
30
- #: includes.php:197
31
  msgid "Related Posts (YARPP)"
32
  msgstr "关联文章 (YARPP)"
33
 
34
- #: includes.php:224
35
- #: yarpp.php:29
36
- #: yarpp.php:29
37
  msgid "Related Posts"
38
  msgstr "Related Posts"
39
 
40
- #: includes.php:229
41
  msgid "YARPP"
42
  msgstr "YARPP"
43
 
44
- #: template-builtin.php:35
45
  #, php-format
46
  msgid "%f is the YARPP match score between the current entry and this related entry. You are seeing this value because you are logged in to WordPress as an administrator. It is not shown to regular visitors."
47
  msgstr "YARPP 中的 %f 是指当前文章和关联文章之间的匹配程度。当您以管理员的身份登录时才能查阅,游客等其他权限是不能查阅的。"
48
 
49
- #: magic.php:304
50
- #: options.php:469
51
- #: options.php:533
 
 
52
  msgid "Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>."
53
- msgstr "以上关联文章由 <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a> 提供支持。"
54
 
55
- #: options.php:26
56
  msgid "The MyISAM check has been overridden. You may now use the \"consider titles\" and \"consider bodies\" relatedness criteria."
57
  msgstr "The MyISAM check has been overridden. You may now use the \"consider titles\" and \"consider bodies\" relatedness criteria."
58
 
59
- #: options.php:35
60
  #, php-format
61
  msgid "YARPP's \"consider titles\" and \"consider bodies\" relatedness criteria require your <code>%s</code> table to use the <a href='http://dev.mysql.com/doc/refman/5.0/en/storage-engines.html'>MyISAM storage engine</a>, but the table seems to be using the <code>%s</code> engine. These two options have been disabled."
62
  msgstr "YARPP's \"consider titles\" and \"consider bodies\" relatedness criteria require your <code>%s</code> table to use the <a href='http://dev.mysql.com/doc/refman/5.0/en/storage-engines.html'>MyISAM storage engine</a>, but the table seems to be using the <code>%s</code> engine. These two options have been disabled."
63
 
64
- #: options.php:37
65
  #, php-format
66
  msgid "To restore these features, please update your <code>%s</code> table by executing the following SQL directive: <code>ALTER TABLE `%s` ENGINE = MyISAM;</code> . No data will be erased by altering the table's engine, although there are performance implications."
67
  msgstr "如果要恢复这些功能,请在您的 <code>%s</code> 表执行下列SQL指令: <code>ALTER TABLE `%s` ENGINE = MyISAM;</code> 。该操作将修改数据库,但不会损坏您的其它设置。"
68
 
69
- #: options.php:39
70
  #, php-format
71
  msgid "If, despite this check, you are sure that <code>%s</code> is using the MyISAM engine, press this magic button:"
72
  msgstr "同意后 <code>%s</code> 将使用 MyISAM 引擎:"
73
 
74
- #: options.php:42
75
  msgid "Trust me. Let me use MyISAM features."
76
  msgstr "Trust me. Let me use MyISAM features."
77
 
78
- #: options.php:65
79
  msgid "The YARPP database had an error but has been fixed."
80
  msgstr "YARPP 数据库中的错误已被修复。"
81
 
82
- #: options.php:67
83
  msgid "The YARPP database has an error which could not be fixed."
84
  msgstr "YARPP 数据库中出现一个错误,无法修复。"
85
 
86
- #: options.php:153
87
- #: options.php:170
88
- #: options.php:182
89
  msgid "do not consider"
90
  msgstr "不参考"
91
 
92
- #: options.php:154
93
- #: options.php:171
94
- #: options.php:184
95
  msgid "consider"
96
  msgstr "参考"
97
 
98
- #: options.php:172
99
  msgid "consider with extra weight"
100
  msgstr "作为主要参考指标"
101
 
102
- #: options.php:211
103
  msgid "Yet Another Related Posts Plugin version history (RSS 2.0)"
104
  msgstr "Yet Another Related Posts Plugin 版本历史 (RSS 2.0)"
105
 
106
- #: options.php:282
107
- #: options.php:282
108
  msgid "Donate to mitcho (Michael Yoshitaka Erlewine) for this plugin via PayPal"
109
  msgstr "通过 PayPal 给插件作者 mitcho (Michael Yoshitaka Erlewine) 捐赠"
110
 
111
- #: options.php:265
112
  msgid "Yet Another Related Posts Plugin Options"
113
- msgstr "关联文章(YARPP)插件设置"
 
 
 
 
 
114
 
115
- #: options.php:289
116
  msgid "\"The Pool\""
117
  msgstr "全局设置"
118
 
119
- #: options.php:290
120
  msgid "\"The Pool\" refers to the pool of posts and pages that are candidates for display as related to the current entry."
121
- msgstr "您可以在“全局设置”里排除关联某些分类或标签,使其 YARPP 不再关联显示它们。"
122
 
123
- #: options.php:295
124
  msgid "Disallow by category:"
125
  msgstr "禁止关联以下分类:"
126
 
127
- #: options.php:297
128
  msgid "Disallow by tag:"
129
  msgstr "禁止关联以下标签:"
130
 
131
- #: options.php:299
132
  msgid "Show password protected posts?"
133
- msgstr "关联显示加密日志?"
134
 
135
- #: options.php:300
136
  msgid "Show only previous posts?"
137
  msgstr "只显示以前的日志?"
138
 
139
- #: options.php:317
140
  msgid "\"Relatedness\" options"
141
  msgstr "关联设置"
142
 
143
- #: options.php:319
144
  #, php-format
145
  msgid "YARPP is different than the <a href=\"http://wasabi.pbwiki.com/Related%20Entries\">previous plugins it is based on</a> as it limits the related posts list by (1) a maximum number and (2) a <em>match threshold</em>."
146
- msgstr "关联文章(YARPP)不同于<a href=\"http://wasabi.pbwiki.com/Related%20Entries\">以往的关联文章插件</a>,它有着更为先进的关联算法。您可以通过设置最大显示条目和匹配值使关联更精准。"
147
 
148
- #: options.php:324
149
  msgid "Match threshold:"
150
  msgstr "匹配值:"
151
 
152
- #: options.php:325
153
  msgid "Titles: "
154
  msgstr "标题:"
155
 
156
- #: options.php:327
157
  msgid "Bodies: "
158
  msgstr "正文:"
159
 
160
- #: options.php:329
161
  msgid "Tags: "
162
  msgstr "标签:"
163
 
164
- #: options.php:331
165
  msgid "Categories: "
166
  msgstr "分类:"
167
 
168
- #: options.php:333
169
  msgid "Cross-relate posts and pages?"
170
  msgstr "固定页面参与关联?"
171
 
172
- #: options.php:333
173
  msgid "When the \"Cross-relate posts and pages\" option is selected, the <code>related_posts()</code>, <code>related_pages()</code>, and <code>related_entries()</code> all will give the same output, returning both related pages and posts."
174
  msgstr "选中该项后,<code>related_posts()</code>, <code>related_pages()</code>, 和 <code>related_entries()</code> 这些代码的输出结果相同。"
175
 
176
- #: options.php:412
177
  msgid "Display options <small>for your website</small>"
178
  msgstr "显示设置"
179
 
180
- #: options.php:416
 
 
 
 
 
 
 
 
 
 
181
  msgid "Automatically display related posts?"
182
  msgstr "自动插入关联文章?"
183
 
184
- #: options.php:416
185
  msgid "This option automatically displays related posts right after the content on single entry pages. If this option is off, you will need to manually insert <code>related_posts()</code> or variants (<code>related_pages()</code> and <code>related_entries()</code>) into your theme files."
186
  msgstr "根据右侧的代码示例,自动插入关联文章到您的页面中,当您取消该选项时,需要通过手工加入代码 <code>related_posts()</code> 或者根据需求插入 (<code>related_pages()</code> and <code>related_entries()</code>) 到您的模板文件中。"
187
 
188
- #: options.php:417
189
  msgid "Website display code example"
190
  msgstr "网站显示的代码示例"
191
 
192
- #: options.php:417
193
- #: options.php:483
194
  msgid "(Update options to reload.)"
195
- msgstr "(保存设置后生效。)"
196
 
197
- #: options.php:420
198
- #: options.php:485
199
  msgid "Maximum number of related posts:"
200
  msgstr "最多关联篇数"
201
 
202
- #: options.php:433
203
  msgid "Before / after related entries:"
204
  msgstr "主体起止标签"
205
 
206
- #: options.php:434
207
- #: options.php:439
208
- #: options.php:448
209
- #: options.php:499
210
- #: options.php:504
211
- #: options.php:513
212
  msgid "For example:"
213
  msgstr "例如:"
214
 
215
- #: options.php:438
216
- #: options.php:503
217
  msgid "Before / after each related entry:"
218
  msgstr "条目起止标签"
219
 
220
- #: options.php:442
221
- #: options.php:507
222
  msgid "Show excerpt?"
223
  msgstr "显示摘要?"
224
 
225
- #: options.php:443
226
- #: options.php:508
227
  msgid "Excerpt length (No. of words):"
228
  msgstr "摘要字符数"
229
 
230
- #: options.php:447
231
  msgid "Before / after (Excerpt):"
232
  msgstr "摘要起止标签:"
233
 
234
- #: options.php:453
235
- #: options.php:518
236
  msgid "Order results:"
237
  msgstr "排序方式:"
238
 
239
- #: options.php:455
240
- #: options.php:520
241
  msgid "score (high relevance to low)"
242
  msgstr "匹配值(有高到低)"
243
 
244
- #: options.php:456
245
- #: options.php:521
246
  msgid "score (low relevance to high)"
247
  msgstr "匹配值(由低到高)"
248
 
249
- #: options.php:457
250
- #: options.php:522
251
  msgid "date (new to old)"
252
  msgstr "日期(由新到旧)"
253
 
254
- #: options.php:458
255
- #: options.php:523
256
  msgid "date (old to new)"
257
  msgstr "日期(由旧到新)"
258
 
259
- #: options.php:459
260
- #: options.php:524
261
  msgid "title (alphabetical)"
262
  msgstr "标题(按字母顺序排列)"
263
 
264
- #: options.php:460
265
- #: options.php:525
266
  msgid "title (reverse alphabetical)"
267
  msgstr "标题(按逆向字母排列)"
268
 
269
- #: options.php:465
270
- #: options.php:530
271
  msgid "Default display if no results:"
272
  msgstr "无匹配时:"
273
 
274
- #: options.php:467
275
- #: options.php:532
276
  msgid "Help promote Yet Another Related Posts Plugin?"
277
  msgstr "帮助推广关联文章(YARPP)插件?"
278
 
279
- #: options.php:469
280
- #: options.php:533
281
  #, php-format
282
  msgid "This option will add the code %s. Try turning it on, updating your options, and see the code in the code example to the right. These links and donations are greatly appreciated."
283
  msgstr "选中该项后会在模板中加入以下代码:%s. 设置更新后可以在右侧的代码示例看到。真诚地感谢您的推广或捐赠。"
284
 
285
- #: options.php:476
286
  msgid "Display options <small>for RSS</small>"
287
  msgstr "RSS 相关设置"
288
 
289
- #: options.php:481
290
  msgid "Display related posts in feeds?"
291
  msgstr "在文章底部显示?"
292
 
293
- #: options.php:482
294
  msgid "Display related posts in the descriptions?"
295
  msgstr "在摘要中显示?(当RSS只输出摘要时)"
296
 
297
- #: options.php:482
298
  msgid "This option displays the related posts in the RSS description fields, not just the content. If your feeds are set up to only display excerpts, however, only the description field is used, so this option is required for any display at all."
299
  msgstr "该选项将会在 RSS 的摘要区中插入关联文章,而不是在正文区中。如果您的 RSS 只输出摘要,请选择该项。"
300
 
301
- #: options.php:483
302
  msgid "RSS display code example"
303
  msgstr "RSS 显示的代码示例"
304
 
305
- #: options.php:498
306
  msgid "Before / after related entries display:"
307
  msgstr "主体起止标签:"
308
 
309
- #: options.php:512
310
  msgid "Before / after (excerpt):"
311
  msgstr "摘要起止标签:"
312
 
313
- #: options.php:319
314
- #: options.php:333
315
- #: options.php:416
316
- #: options.php:421
317
- #: options.php:468
318
- #: options.php:481
319
- #: options.php:482
320
- #: options.php:486
321
- #: options.php:532
322
- #: options.php:544
323
  msgid "more&gt;"
324
  msgstr "更多&gt;"
325
 
326
- #: options.php:147
327
  msgid "word"
328
  msgstr "字符"
329
 
330
- #: options.php:148
331
  msgid "tag"
332
  msgstr "标签"
333
 
334
- #: options.php:149
335
  msgid "category"
336
  msgstr "分类"
337
 
338
- #: options.php:156
339
- #: options.php:186
340
  #, php-format
341
  msgid "require at least one %s in common"
342
  msgstr "至少从一个%s中考虑关联"
343
 
344
- #: options.php:158
345
- #: options.php:188
346
  #, php-format
347
  msgid "require more than one %s in common"
348
  msgstr "至少从一个以上%s中考虑关联"
349
 
350
- #: options.php:125
351
  msgid "Options saved!"
352
  msgstr "保存成功!"
353
 
354
- #: options.php:319
355
  msgid "The higher the match threshold, the more restrictive, and you get less related posts overall. The default match threshold is 5. If you want to find an appropriate match threshhold, take a look at some post's related posts display and their scores. You can see what kinds of related posts are being picked up and with what kind of match scores, and determine an appropriate threshold for your site."
356
- msgstr ""
357
 
358
- #: options.php:618
359
  msgid "Update options"
360
  msgstr "保存设置"
361
 
362
- #: options.php:619
363
  msgid "Do you really want to reset your configuration?"
364
  msgstr "请注意!您确定重置所有的设置吗?"
365
 
366
- #: options.php:619
367
  msgid "Reset options"
368
  msgstr "重置设置"
369
 
370
- #: includes.php:110
371
- msgid "MySQL error on creating yarpp_keyword_cache table"
372
- msgstr "创建 yarpp_keyword_cache table 表时错误"
373
-
374
- #: includes.php:121
375
- msgid "MySQL error on creating yarpp_related_cache table"
376
- msgstr "创建 yarpp_related_cache 表时错误"
377
-
378
- #: magic.php:56
379
- msgid "Example post "
380
- msgstr ""
381
-
382
- #: options.php:81
383
- #: options.php:84
384
- #: options.php:126
385
- #: options.php:543
386
- msgid "Related posts cache status"
387
- msgstr "关联文章缓存"
388
-
389
- #: options.php:81
390
- msgid "Your related posts cache is incomplete. Please build your cache from the <A>related posts status pane</a>."
391
- msgstr "您的缓存不完整,<A>立即重建</a>。"
392
-
393
- #: options.php:84
394
- msgid "Your related posts cache is empty. Please build your cache from the <A>related posts status pane</a>."
395
- msgstr "您还尚未建立关联文章缓存, <A>立即重建</a>。"
396
-
397
- #: options.php:127
398
- msgid "If you updated the \"pool\" options or \"relatedness\" options displayed, please rebuild your cache now from the <A>related posts status pane</a>."
399
- msgstr "如果您刚刚修改了“全局设置”或者“关联设置”等选项后,建议您<A>重建下关联文章缓存</a>。"
400
-
401
- #: options.php:198
402
- msgid "Edit Catalog Entry"
403
- msgstr ""
404
-
405
- #: options.php:199
406
- msgid "close"
407
- msgstr "关闭"
408
-
409
- #: options.php:284
410
- msgid "by <a href=\"http://mitcho.com/code/\">mitcho (Michael 芳貴 Erlewine)</a>"
411
- msgstr "插件作者:<a href=\"http://mitcho.com/code/\">mitcho (Michael 芳貴 Erlewine)</a> | 中文译者:<a href=\"http://jorwang.com/\">JorWang</a>"
412
-
413
- #: options.php:284
414
- msgid "Follow <a href=\"http://twitter.com/yarpp/\">Yet Another Related Posts Plugin on Twitter</a>"
415
- msgstr ""
416
-
417
- #: options.php:305
418
- msgid "day(s)"
419
- msgstr "天"
420
-
421
- #: options.php:306
422
- msgid "week(s)"
423
- msgstr "周"
424
-
425
- #: options.php:307
426
- msgid "month(s)"
427
- msgstr "月"
428
-
429
- #: options.php:309
430
- msgid "Show only posts from the past NUMBER UNITS"
431
- msgstr "仅关联显示 NUMBER UNITS 内的文章。"
432
-
433
- #: options.php:398
434
- msgid "There is a new beta (VERSION) of Yet Another Related Posts Plugin. You can <A>download it here</a> at your own risk."
435
- msgstr "新的测试版本发布了!<A>点击下载</a> Yet Another Related Posts Plugin (VERSION) 。(测试版使用有风险,请注意备份。)"
436
-
437
- #: options.php:400
438
- msgid "There is a new version (VERSION) of Yet Another Related Posts Plugin available! You can <A>download it here</a>."
439
- msgstr "新的正式版本发布了!<A>点击下载</a> Yet Another Related Posts Plugin (VERSION) 。"
440
-
441
- #: options.php:421
442
- #: options.php:486
443
- msgid "Display using a custom template file"
444
- msgstr "使用自定义模板"
445
-
446
- #: options.php:421
447
- #: options.php:486
448
- msgid "This advanced option gives you full power to customize how your related posts are displayed. Templates (in the <code>wp-content/yarpp-templates</code> directory) are written in PHP."
449
- msgstr ""
450
-
451
- #: options.php:423
452
- #: options.php:488
453
- msgid "Template file:"
454
- msgstr "模板文件:"
455
-
456
- #: options.php:481
457
- msgid "This option displays related posts at the end of each item in your RSS and Atom feeds. No template changes are needed."
458
- msgstr ""
459
-
460
- #: options.php:540
461
- msgid "Advanced"
462
- msgstr "高级设置"
463
-
464
- #: options.php:543
465
- msgid "Show cache status"
466
- msgstr "查看缓存状态"
467
-
468
- #: options.php:544
469
- msgid "When the cache is incomplete, compute related posts on the fly?"
470
- msgstr "当缓存不完整时,由插件自行匹配关联文章?"
471
-
472
- #: options.php:545
473
- msgid "If a displayed post's related posts are not cached and this option is on, YARPP will compute them on the fly. Do not turn this option on if you have a high-traffic site.<br />If this option is off and a post's related posts have not been cached, it will display as if it has no related posts."
474
- msgstr ""
475
-
476
- #: options.php:575
477
- msgid "'MIN minute(s) and SEC second(s) remaining'"
478
- msgstr ""
479
-
480
- #: options.php:577
481
- msgid "'SEC second(s) remaining'"
482
- msgstr ""
483
-
484
- #: options.php:581
485
- msgid "Your related posts cache is now complete."
486
- msgstr "恭喜!您的关联文章缓存已成功完成。"
487
-
488
- #: options.php:581
489
- msgid "The SQL queries took SEC seconds."
490
- msgstr ""
491
-
492
- #: options.php:591
493
- #: options.php:595
494
- msgid "There was an error while constructing the related posts for TITLE"
495
- msgstr ""
496
-
497
- #: options.php:592
498
- #: options.php:597
499
- msgid "try to continue"
500
- msgstr "重试"
501
-
502
- #: options.php:605
503
- msgid "Your related posts cache is PERCENT% complete."
504
- msgstr "您的关联文章(YARPP)缓存完整率为:PERCENT% "
505
-
506
- #: options.php:611
507
- msgid "starting..."
508
- msgstr "开始建立……"
509
-
510
- #: services.php:59
511
- msgid "You cannot rebuild the YARPP cache."
512
- msgstr "您不能建立关联文章缓存。"
513
-
514
- #: services.php:90
515
- #, php-format
516
- msgid "You do not have the permission to write the file '%s'."
517
- msgstr ""
518
-
519
- #: template-metabox.php:12
520
- msgid "These are the related entries for this entry. Updating this post may change these related posts."
521
- msgstr ""
522
-
523
- #: template-metabox.php:25
524
- msgid "Whether all of these related entries are actually displayed and how they are displayed depends on your YARPP display options."
525
- msgstr ""
526
-
527
- #: template-metabox.php:27
528
- msgid "No related posts."
529
- msgstr "无关联文章"
530
-
531
- #: options.php:10
532
- msgid "Please move the YARPP template files into your theme to complete installation. Simply move the sample template files (currently in <code>wp-content/plugins/yet-another-related-posts-plugin/yarpp-templates/</code>) to the <code>TEMPLATEPATH</code> directory."
533
- msgstr "如果您需要使用关联文章(YARPP)插件的自定义模板,请手动将文件夹(<code>wp-content/plugins/yet-another-related-posts-plugin/yarpp-templates/</code>)的文件移动到您的主题文件夹(<code>TEMPLATEPATH</code>)内。"
534
-
535
- #: options.php:15
536
- msgid "No YARPP template files were found in your theme (<code>TEMPLATEPATH</code>) so the templating feature has been turned off."
537
- msgstr "未在您的主题文件夹 (<code>TEMPLATEPATH</code>) 内找到关联文章(YARPP)的自定义模板文件。"
538
-
14
  "X-Poedit-Basepath: \n"
15
  "X-Poedit-SearchPath-0: ."
16
 
17
+ #: includes.php:74
18
  msgid "MySQL error on adding yarpp_title"
19
+ msgstr "在添加 yarpp_title 时 MySQL 发生错误"
20
 
21
+ #: includes.php:79
22
  msgid "MySQL error on adding yarpp_content"
23
+ msgstr "在添加 yarpp_content 时 MySQL 发生错误"
24
 
25
+ #: includes.php:133
26
  msgid "<h3>An important message from YARPP:</h3><p>Thank you for upgrading to YARPP 2. YARPP 2.0 adds the much requested ability to limit related entry results by certain tags or categories. 2.0 also brings more fine tuned control of the magic algorithm, letting you specify how the algorithm should consider or not consider entry content, titles, tags, and categories. Make sure to adjust the new settings to your liking and perhaps readjust your threshold.</p><p>For more information, check out the <a href=\"http://mitcho.com/code/yarpp/\">YARPP documentation</a>. (This message will not be displayed again.)</p>"
27
  msgstr "<h3>关于 YARPP 的重要信息:</h3><p>感谢您升级到 YARPP 2. YARPP 2.0 adds the much requested ability to limit related entry results by certain tags or categories. 2.0 also brings more fine tuned control of the magic algorithm, letting you specify how the algorithm should consider or not consider entry content, titles, tags, and categories. Make sure to adjust the new settings to your liking and perhaps readjust your threshold.</p><p>更多信息,请查阅 <a href=\"http://mitcho.com/code/yarpp/\">YARPP 官方手册</a>. (本条信息不会再次出现。)</p>"
28
 
29
+ #: includes.php:154
30
+ #: includes.php:154
31
  msgid "Related Posts (YARPP)"
32
  msgstr "关联文章 (YARPP)"
33
 
34
+ #: includes.php:173
 
 
35
  msgid "Related Posts"
36
  msgstr "Related Posts"
37
 
38
+ #: includes.php:178
39
  msgid "YARPP"
40
  msgstr "YARPP"
41
 
42
+ #: magic.php:210
43
  #, php-format
44
  msgid "%f is the YARPP match score between the current entry and this related entry. You are seeing this value because you are logged in to WordPress as an administrator. It is not shown to regular visitors."
45
  msgstr "YARPP 中的 %f 是指当前文章和关联文章之间的匹配程度。当您以管理员的身份登录时才能查阅,游客等其他权限是不能查阅的。"
46
 
47
+ #: options.php:307
48
+ #: options.php:349
49
+ #: options.php:368
50
+ #: options.php:412
51
+ #: magic.php:219
52
  msgid "Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>."
53
+ msgstr "Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>."
54
 
55
+ #: options.php:8
56
  msgid "The MyISAM check has been overridden. You may now use the \"consider titles\" and \"consider bodies\" relatedness criteria."
57
  msgstr "The MyISAM check has been overridden. You may now use the \"consider titles\" and \"consider bodies\" relatedness criteria."
58
 
59
+ #: options.php:17
60
  #, php-format
61
  msgid "YARPP's \"consider titles\" and \"consider bodies\" relatedness criteria require your <code>%s</code> table to use the <a href='http://dev.mysql.com/doc/refman/5.0/en/storage-engines.html'>MyISAM storage engine</a>, but the table seems to be using the <code>%s</code> engine. These two options have been disabled."
62
  msgstr "YARPP's \"consider titles\" and \"consider bodies\" relatedness criteria require your <code>%s</code> table to use the <a href='http://dev.mysql.com/doc/refman/5.0/en/storage-engines.html'>MyISAM storage engine</a>, but the table seems to be using the <code>%s</code> engine. These two options have been disabled."
63
 
64
+ #: options.php:19
65
  #, php-format
66
  msgid "To restore these features, please update your <code>%s</code> table by executing the following SQL directive: <code>ALTER TABLE `%s` ENGINE = MyISAM;</code> . No data will be erased by altering the table's engine, although there are performance implications."
67
  msgstr "如果要恢复这些功能,请在您的 <code>%s</code> 表执行下列SQL指令: <code>ALTER TABLE `%s` ENGINE = MyISAM;</code> 。该操作将修改数据库,但不会损坏您的其它设置。"
68
 
69
+ #: options.php:21
70
  #, php-format
71
  msgid "If, despite this check, you are sure that <code>%s</code> is using the MyISAM engine, press this magic button:"
72
  msgstr "同意后 <code>%s</code> 将使用 MyISAM 引擎:"
73
 
74
+ #: options.php:24
75
  msgid "Trust me. Let me use MyISAM features."
76
  msgstr "Trust me. Let me use MyISAM features."
77
 
78
+ #: options.php:47
79
  msgid "The YARPP database had an error but has been fixed."
80
  msgstr "YARPP 数据库中的错误已被修复。"
81
 
82
+ #: options.php:49
83
  msgid "The YARPP database has an error which could not be fixed."
84
  msgstr "YARPP 数据库中出现一个错误,无法修复。"
85
 
86
+ #: options.php:121
87
+ #: options.php:138
88
+ #: options.php:150
89
  msgid "do not consider"
90
  msgstr "不参考"
91
 
92
+ #: options.php:122
93
+ #: options.php:139
94
+ #: options.php:152
95
  msgid "consider"
96
  msgstr "参考"
97
 
98
+ #: options.php:140
99
  msgid "consider with extra weight"
100
  msgstr "作为主要参考指标"
101
 
102
+ #: options.php:168
103
  msgid "Yet Another Related Posts Plugin version history (RSS 2.0)"
104
  msgstr "Yet Another Related Posts Plugin 版本历史 (RSS 2.0)"
105
 
106
+ #: options.php:183
107
+ #: options.php:183
108
  msgid "Donate to mitcho (Michael Yoshitaka Erlewine) for this plugin via PayPal"
109
  msgstr "通过 PayPal 给插件作者 mitcho (Michael Yoshitaka Erlewine) 捐赠"
110
 
111
+ #: options.php:186
112
  msgid "Yet Another Related Posts Plugin Options"
113
+ msgstr "Yet Another Related Posts Plugin 设置"
114
+
115
+ #: options.php:202
116
+ #, php-format
117
+ msgid "by <a href=\"http://mitcho.com/code/\">mitcho (Michael 芳貴 Erlewine)</a> and based on the fabulous work of <a href=\"http://peter.mapledesign.co.uk/weblog/archives/wordpress-related-posts-plugin\">Peter Bower</a>, <a href=\"http://wasabi.pbwiki.com/Related%20Entries\">Alexander Malov &amp; Mike Lu</a>."
118
+ msgstr "by <a href=\"http://mitcho.com/code/\">mitcho (Michael 芳貴 Erlewine)</a> and based on the fabulous work of <a href=\"http://peter.mapledesign.co.uk/weblog/archives/wordpress-related-posts-plugin\">Peter Bower</a>, <a href=\"http://wasabi.pbwiki.com/Related%20Entries\">Alexander Malov &amp; Mike Lu</a>. 简体中文翻译:<a href=\"http://jorwang.com/\">Jor Wang</a>."
119
 
120
+ #: options.php:206
121
  msgid "\"The Pool\""
122
  msgstr "全局设置"
123
 
124
+ #: options.php:207
125
  msgid "\"The Pool\" refers to the pool of posts and pages that are candidates for display as related to the current entry."
126
+ msgstr "您可以在“全局设置”里排除某特定分类或标签,今后 YARPP 在筛选关联文章时将不列出已排除项目中的文章。"
127
 
128
+ #: options.php:212
129
  msgid "Disallow by category:"
130
  msgstr "禁止关联以下分类:"
131
 
132
+ #: options.php:221
133
  msgid "Disallow by tag:"
134
  msgstr "禁止关联以下标签:"
135
 
136
+ #: options.php:230
137
  msgid "Show password protected posts?"
138
+ msgstr "显示加密日志?"
139
 
140
+ #: options.php:231
141
  msgid "Show only previous posts?"
142
  msgstr "只显示以前的日志?"
143
 
144
+ #: options.php:236
145
  msgid "\"Relatedness\" options"
146
  msgstr "关联设置"
147
 
148
+ #: options.php:237
149
  #, php-format
150
  msgid "YARPP is different than the <a href=\"http://wasabi.pbwiki.com/Related%20Entries\">previous plugins it is based on</a> as it limits the related posts list by (1) a maximum number and (2) a <em>match threshold</em>."
151
+ msgstr "关联文章(YARPP)不同于<a href=\"http://wasabi.pbwiki.com/Related%20Entries\">以往的关联文章插件</a>,它有更先进的关联算法。您可以通过设置最大显示条目和匹配值使文章之间的匹配度更为精准。"
152
 
153
+ #: options.php:242
154
  msgid "Match threshold:"
155
  msgstr "匹配值:"
156
 
157
+ #: options.php:243
158
  msgid "Titles: "
159
  msgstr "标题:"
160
 
161
+ #: options.php:245
162
  msgid "Bodies: "
163
  msgstr "正文:"
164
 
165
+ #: options.php:247
166
  msgid "Tags: "
167
  msgstr "标签:"
168
 
169
+ #: options.php:249
170
  msgid "Categories: "
171
  msgstr "分类:"
172
 
173
+ #: options.php:251
174
  msgid "Cross-relate posts and pages?"
175
  msgstr "固定页面参与关联?"
176
 
177
+ #: options.php:251
178
  msgid "When the \"Cross-relate posts and pages\" option is selected, the <code>related_posts()</code>, <code>related_pages()</code>, and <code>related_entries()</code> all will give the same output, returning both related pages and posts."
179
  msgstr "选中该项后,<code>related_posts()</code>, <code>related_pages()</code>, 和 <code>related_entries()</code> 这些代码的输出结果相同。"
180
 
181
+ #: options.php:293
182
  msgid "Display options <small>for your website</small>"
183
  msgstr "显示设置"
184
 
185
+ #: options.php:302
186
+ msgid "PERMALINK"
187
+ msgstr "PERMALINK"
188
+
189
+ #: options.php:302
190
+ #: options.php:363
191
+ #: options.php:363
192
+ msgid "RELATED TITLE"
193
+ msgstr "RELATED TITLE"
194
+
195
+ #: options.php:309
196
  msgid "Automatically display related posts?"
197
  msgstr "自动插入关联文章?"
198
 
199
+ #: options.php:309
200
  msgid "This option automatically displays related posts right after the content on single entry pages. If this option is off, you will need to manually insert <code>related_posts()</code> or variants (<code>related_pages()</code> and <code>related_entries()</code>) into your theme files."
201
  msgstr "根据右侧的代码示例,自动插入关联文章到您的页面中,当您取消该选项时,需要通过手工加入代码 <code>related_posts()</code> 或者根据需求插入 (<code>related_pages()</code> and <code>related_entries()</code>) 到您的模板文件中。"
202
 
203
+ #: options.php:310
204
  msgid "Website display code example"
205
  msgstr "网站显示的代码示例"
206
 
207
+ #: options.php:310
208
+ #: options.php:372
209
  msgid "(Update options to reload.)"
210
+ msgstr "(更新设置后生效。)"
211
 
212
+ #: options.php:312
213
+ #: options.php:374
214
  msgid "Maximum number of related posts:"
215
  msgstr "最多关联篇数"
216
 
217
+ #: options.php:314
218
  msgid "Before / after related entries:"
219
  msgstr "主体起止标签"
220
 
221
+ #: options.php:315
222
+ #: options.php:320
223
+ #: options.php:329
224
+ #: options.php:378
225
+ #: options.php:383
226
+ #: options.php:392
227
  msgid "For example:"
228
  msgstr "例如:"
229
 
230
+ #: options.php:319
231
+ #: options.php:382
232
  msgid "Before / after each related entry:"
233
  msgstr "条目起止标签"
234
 
235
+ #: options.php:323
236
+ #: options.php:386
237
  msgid "Show excerpt?"
238
  msgstr "显示摘要?"
239
 
240
+ #: options.php:324
241
+ #: options.php:387
242
  msgid "Excerpt length (No. of words):"
243
  msgstr "摘要字符数"
244
 
245
+ #: options.php:328
246
  msgid "Before / after (Excerpt):"
247
  msgstr "摘要起止标签:"
248
 
249
+ #: options.php:334
250
+ #: options.php:397
251
  msgid "Order results:"
252
  msgstr "排序方式:"
253
 
254
+ #: options.php:336
255
+ #: options.php:399
256
  msgid "score (high relevance to low)"
257
  msgstr "匹配值(有高到低)"
258
 
259
+ #: options.php:337
260
+ #: options.php:400
261
  msgid "score (low relevance to high)"
262
  msgstr "匹配值(由低到高)"
263
 
264
+ #: options.php:338
265
+ #: options.php:401
266
  msgid "date (new to old)"
267
  msgstr "日期(由新到旧)"
268
 
269
+ #: options.php:339
270
+ #: options.php:402
271
  msgid "date (old to new)"
272
  msgstr "日期(由旧到新)"
273
 
274
+ #: options.php:340
275
+ #: options.php:403
276
  msgid "title (alphabetical)"
277
  msgstr "标题(按字母顺序排列)"
278
 
279
+ #: options.php:341
280
+ #: options.php:404
281
  msgid "title (reverse alphabetical)"
282
  msgstr "标题(按逆向字母排列)"
283
 
284
+ #: options.php:346
285
+ #: options.php:409
286
  msgid "Default display if no results:"
287
  msgstr "无匹配时:"
288
 
289
+ #: options.php:347
290
+ #: options.php:411
291
  msgid "Help promote Yet Another Related Posts Plugin?"
292
  msgstr "帮助推广关联文章(YARPP)插件?"
293
 
294
+ #: options.php:349
295
+ #: options.php:412
296
  #, php-format
297
  msgid "This option will add the code %s. Try turning it on, updating your options, and see the code in the code example to the right. These links and donations are greatly appreciated."
298
  msgstr "选中该项后会在模板中加入以下代码:%s. 设置更新后可以在右侧的代码示例看到。真诚地感谢您的推广或捐赠。"
299
 
300
+ #: options.php:354
301
  msgid "Display options <small>for RSS</small>"
302
  msgstr "RSS 相关设置"
303
 
304
+ #: options.php:370
305
  msgid "Display related posts in feeds?"
306
  msgstr "在文章底部显示?"
307
 
308
+ #: options.php:371
309
  msgid "Display related posts in the descriptions?"
310
  msgstr "在摘要中显示?(当RSS只输出摘要时)"
311
 
312
+ #: options.php:371
313
  msgid "This option displays the related posts in the RSS description fields, not just the content. If your feeds are set up to only display excerpts, however, only the description field is used, so this option is required for any display at all."
314
  msgstr "该选项将会在 RSS 的摘要区中插入关联文章,而不是在正文区中。如果您的 RSS 只输出摘要,请选择该项。"
315
 
316
+ #: options.php:372
317
  msgid "RSS display code example"
318
  msgstr "RSS 显示的代码示例"
319
 
320
+ #: options.php:377
321
  msgid "Before / after related entries display:"
322
  msgstr "主体起止标签:"
323
 
324
+ #: options.php:391
325
  msgid "Before / after (excerpt):"
326
  msgstr "摘要起止标签:"
327
 
328
+ #: options.php:237
329
+ #: options.php:251
330
+ #: options.php:309
331
+ #: options.php:348
332
+ #: options.php:371
333
+ #: options.php:411
 
 
 
 
334
  msgid "more&gt;"
335
  msgstr "更多&gt;"
336
 
337
+ #: options.php:115
338
  msgid "word"
339
  msgstr "字符"
340
 
341
+ #: options.php:116
342
  msgid "tag"
343
  msgstr "标签"
344
 
345
+ #: options.php:117
346
  msgid "category"
347
  msgstr "分类"
348
 
349
+ #: options.php:124
350
+ #: options.php:154
351
  #, php-format
352
  msgid "require at least one %s in common"
353
  msgstr "至少从一个%s中考虑关联"
354
 
355
+ #: options.php:126
356
+ #: options.php:156
357
  #, php-format
358
  msgid "require more than one %s in common"
359
  msgstr "至少从一个以上%s中考虑关联"
360
 
361
+ #: options.php:95
362
  msgid "Options saved!"
363
  msgstr "保存成功!"
364
 
365
+ #: options.php:237
366
  msgid "The higher the match threshold, the more restrictive, and you get less related posts overall. The default match threshold is 5. If you want to find an appropriate match threshhold, take a look at some post's related posts display and their scores. You can see what kinds of related posts are being picked up and with what kind of match scores, and determine an appropriate threshold for your site."
367
+ msgstr "只简单的几步设置,就能精准得到您想要的关联文章。这里默认的匹配值为5 。如果你想找到合适您网站的的匹配值,我建议你打开 ”对管理员(权限>8的用户)显示匹配值” 这个设置,这样可以更容易找到适合您网站的匹配值。"
368
 
369
+ #: options.php:419
370
  msgid "Update options"
371
  msgstr "保存设置"
372
 
373
+ #: options.php:420
374
  msgid "Do you really want to reset your configuration?"
375
  msgstr "请注意!您确定重置所有的设置吗?"
376
 
377
+ #: options.php:420
378
  msgid "Reset options"
379
  msgstr "重置设置"
380
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
magic.php CHANGED
@@ -1,89 +1,8 @@
1
  <?php
2
 
3
- //=TEMPLATING/DISPLAY===========
4
-
5
- function yarpp_set_score_override_flag($q) {
6
- global $yarpp_time, $yarpp_score_override, $yarpp_online_limit;
7
- if ($yarpp_time) {
8
- if ($q->query_vars['orderby'] == 'score')
9
- $yarpp_score_override = true;
10
- else
11
- $yarpp_score_override = false;
12
-
13
- if ($q->query_vars['showposts'] != '') {
14
- $yarpp_online_limit = $q->query_vars['showposts'];
15
- } else {
16
- $yarpp_online_limit = false;
17
- }
18
-
19
- }
20
- }
21
-
22
- function yarpp_join_filter($arg) {
23
- global $wpdb, $yarpp_time;
24
- if ($yarpp_time) {
25
- $arg .= " join {$wpdb->prefix}yarpp_related_cache as yarpp using (ID)";
26
- }
27
- return $arg;
28
- }
29
-
30
- function yarpp_where_filter($arg) {
31
- global $wpdb, $yarpp_time;
32
- $threshold = yarpp_get_option('threshold');
33
- if ($yarpp_time) {
34
- $arg = str_replace("$wpdb->posts.ID = ","yarpp.score > $threshold and yarpp.reference_ID = ",$arg);
35
- if (yarpp_get_option("recent_only"))
36
- $arg .= " and post_date > date_sub(now(), interval ".yarpp_get_option("recent_number")." ".yarpp_get_option("recent_units").") ";
37
- //echo "<!--YARPP TEST: $arg-->";
38
- }
39
- return $arg;
40
- }
41
-
42
- function yarpp_orderby_filter($arg) {
43
- global $wpdb, $yarpp_time, $yarpp_score_override;
44
- if ($yarpp_time and $yarpp_score_override) {
45
- $arg = str_replace("$wpdb->posts.post_date","yarpp.score",$arg);
46
- }
47
- return $arg;
48
- }
49
-
50
- function yarpp_limit_filter($arg) {
51
- global $wpdb, $yarpp_time, $yarpp_online_limit;
52
- if ($yarpp_time and $yarpp_online_limit) {
53
- return " limit $yarpp_online_limit ";
54
- }
55
- return $arg;
56
- }
57
-
58
- function yarpp_fields_filter($arg) {
59
- global $wpdb, $yarpp_time;
60
- if ($yarpp_time) {
61
- $arg .= ", yarpp.score";
62
- }
63
- return $arg;
64
- }
65
-
66
- function yarpp_demo_request_filter($arg) {
67
- global $wpdb, $yarpp_demo_time, $yarpp_limit;
68
- if ($yarpp_demo_time) {
69
- $wpdb->query("set @count = 0;");
70
- $arg = "SELECT SQL_CALC_FOUND_ROWS ID + $yarpp_limit as ID, post_author, post_date, post_date_gmt, 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.' as post_content,
71
- concat('".__('Example post ','yarpp')."',@count:=@count+1) as post_title, 0 as post_category, '' as post_excerpt, 'publish' as post_status, 'open' as comment_status, 'open' as ping_status, '' as post_password, concat('example-post-',@count) as post_name, '' as to_ping, '' as pinged, post_modified, post_modified_gmt, '' as post_content_filtered, 0 as post_parent, concat('PERMALINK',@count) as guid, 0 as menu_order, 'post' as post_type, '' as post_mime_type, 0 as comment_count, 'SCORE' as score
72
- FROM wp_posts
73
- ORDER BY ID DESC LIMIT 0, $yarpp_limit";
74
- }
75
- return $arg;
76
- }
77
-
78
- //=CACHING===========
79
-
80
- function yarpp_sql($type,$args,$giveresults = true,$reference_ID=false,$domain='website') {
81
  global $wpdb, $post, $yarpp_debug;
82
 
83
- if (is_object($post) and !$reference_ID) {
84
- $reference_ID = $post->ID;
85
- }
86
-
87
  // set $yarpp_debug
88
  if (isset($_REQUEST['yarpp_debug']))
89
  $yarpp_debug = true;
@@ -95,7 +14,10 @@ function yarpp_sql($type,$args,$giveresults = true,$reference_ID=false,$domain='
95
  $domainprefix = '';
96
 
97
  $options = array('limit'=>"${domainprefix}limit",
 
98
  'threshold'=>'threshold',
 
 
99
  'show_pass_post'=>'show_pass_post',
100
  'past_only'=>'past_only',
101
  'cross_relate'=>'cross_relate',
@@ -104,10 +26,7 @@ function yarpp_sql($type,$args,$giveresults = true,$reference_ID=false,$domain='
104
  'tags'=>'tags',
105
  'categories'=>'categories',
106
  'distags'=>'distags',
107
- 'discats'=>'discats',
108
- 'recent_only'=>'recent_only',
109
- 'recent_number'=>'recent_number',
110
- 'recent_units'=>'recent_units');
111
  $optvals = array();
112
  foreach (array_keys($options) as $option) {
113
  if (isset($args[$option])) {
@@ -122,12 +41,18 @@ function yarpp_sql($type,$args,$giveresults = true,$reference_ID=false,$domain='
122
  // if cross_relate is set, override the type argument and make sure both matches are accepted in the sql query
123
  if ($cross_relate) $type = array('post','page');
124
 
 
 
125
  // Fetch keywords
126
- $body_terms = yarpp_get_cached_keywords($reference_ID,'body');
127
- $title_terms = yarpp_get_cached_keywords($reference_ID,'title');
128
 
129
  if ($yarpp_debug) echo "<!--TITLE TERMS: $title_terms-->"; // debug
130
  if ($yarpp_debug) echo "<!--BODY TERMS: $body_terms-->"; // debug
 
 
 
 
131
 
132
  // get weights
133
 
@@ -143,6 +68,8 @@ function yarpp_sql($type,$args,$giveresults = true,$reference_ID=false,$domain='
143
 
144
  $totalweight = $bodyweight + $titleweight + $tagweight + $catweight;
145
 
 
 
146
  // get disallowed categories and tags
147
 
148
  $disterms = implode(',', array_filter(array_merge(explode(',',$discats),explode(',',$distags)),'is_numeric'));
@@ -151,25 +78,28 @@ function yarpp_sql($type,$args,$giveresults = true,$reference_ID=false,$domain='
151
 
152
  $criteria = array();
153
  if ($bodyweight)
154
- $criteria['body'] = "(MATCH (post_content) AGAINST ('".$wpdb->escape($body_terms)."'))";
155
  if ($titleweight)
156
- $criteria['title'] = "(MATCH (post_title) AGAINST ('".$wpdb->escape($title_terms)."'))";
157
  if ($tagweight)
158
  $criteria['tag'] = "COUNT( DISTINCT tagtax.term_taxonomy_id )";
159
  if ($catweight)
160
  $criteria['cat'] = "COUNT( DISTINCT cattax.term_taxonomy_id )";
161
 
162
- $newsql = "SELECT $reference_ID, ID, "; //post_title, post_date, post_content, post_excerpt,
163
 
164
- //foreach ($criteria as $key => $value) {
165
- // $newsql .= "$value as ${key}score, ";
166
- //}
167
 
168
  $newsql .= '(0';
169
  foreach ($criteria as $key => $value) {
170
  $newsql .= "+ $value * ".$weights[$key];
171
  }
172
  $newsql .= ') as score';
 
 
 
173
 
174
  $newsql .= "\n from $wpdb->posts \n";
175
 
@@ -179,14 +109,14 @@ function yarpp_sql($type,$args,$giveresults = true,$reference_ID=false,$domain='
179
  left join $wpdb->terms as blockterm on (blocktax.term_id = blockterm.term_id and blockterm.term_id in ($disterms))\n";
180
 
181
  if ($tagweight)
182
- $newsql .= " left JOIN $wpdb->term_relationships AS thistag ON (thistag.object_id = $reference_ID )
183
  left JOIN $wpdb->term_relationships AS tagrel on (tagrel.term_taxonomy_id = thistag.term_taxonomy_id
184
  AND tagrel.object_id = $wpdb->posts.ID)
185
  left JOIN $wpdb->term_taxonomy AS tagtax ON ( tagrel.term_taxonomy_id = tagtax.term_taxonomy_id
186
  AND tagtax.taxonomy = 'post_tag')\n";
187
 
188
  if ($catweight)
189
- $newsql .= " left JOIN $wpdb->term_relationships AS thiscat ON (thiscat.object_id = $reference_ID )
190
  left JOIN $wpdb->term_relationships AS catrel on (catrel.term_taxonomy_id = thiscat.term_taxonomy_id
191
  AND catrel.object_id = $wpdb->posts.ID)
192
  left JOIN $wpdb->term_taxonomy AS cattax ON ( catrel.term_taxonomy_id = cattax.term_taxonomy_id
@@ -194,30 +124,27 @@ function yarpp_sql($type,$args,$giveresults = true,$reference_ID=false,$domain='
194
 
195
  // WHERE
196
 
197
- $newsql .= " where (post_status IN ( 'publish', 'static' ) and ID != '$reference_ID')";
198
 
199
  if ($past_only)
200
- $newsql .= " and post_date <= NOW() ";
201
  if (!$show_pass_post)
202
  $newsql .= " and post_password ='' ";
203
- if ($recent_only)
204
- $newsql .= " and post_date > date_sub(now(), interval $recent_number $recent_units) ";
205
 
206
  $newsql .= " and post_type IN ('".implode("', '",$type)."')";
207
 
208
  // GROUP BY
209
  $newsql .= "\n group by id \n";
210
  // HAVING
211
- $safethreshold = max($threshold/2,0.1); // this is so the new calibration system works.
212
- $newsql .= " having score >= $safethreshold";
213
  if ($usedisterms)
214
- $newsql .= " and count(blockterm.term_id) = 0";
215
 
216
- $newsql .= (($categories == 3)?' and '.$criteria['cat'].' >= 1':'');
217
- $newsql .= (($categories == 4)?' and '.$criteria['cat'].' >= 2':'');
218
- $newsql .= (($tags == 3)?' and '.$criteria['tag'].' >= 1':'');
219
- $newsql .= (($tags == 4)?' and '.$criteria['tag'].' >= 2':'');
220
- $newsql .= " order by score desc limit ".$limit;
221
 
222
  if (!$giveresults) {
223
  $newsql = "select count(t.ID) from ($newsql) as t";
@@ -229,24 +156,12 @@ function yarpp_sql($type,$args,$giveresults = true,$reference_ID=false,$domain='
229
 
230
  /* new in 2.1! the domain argument refers to {website,widget,rss}, though widget is not used yet. */
231
 
232
- function yarpp_related($type,$args,$echo = true,$reference_ID=false,$domain = 'website') {
233
- global $wpdb, $post, $userdata, $yarpp_time, $yarpp_demo_time, $wp_query, $id, $page, $pages, $authordata;
234
-
235
- if ($domain != 'demo_web' and $domain != 'demo_rss') {
236
- if ($yarpp_time) // if we're already in a YARPP loop, stop now.
237
- return false;
238
-
239
- if (is_object($post) and !$reference_ID)
240
- $reference_ID = $post->ID;
241
- } else {
242
- if ($yarpp_demo_time) // if we're already in a YARPP loop, stop now.
243
- return false;
244
- }
245
-
246
  get_currentuserinfo();
247
 
248
  // set the "domain prefix", used for all the preferences.
249
- if ($domain == 'rss' or $domain == 'demo_rss')
250
  $domainprefix = 'rss_';
251
  else
252
  $domainprefix = '';
@@ -254,10 +169,15 @@ function yarpp_related($type,$args,$echo = true,$reference_ID=false,$domain = 'w
254
  // get options
255
  // note the 2.1 change... the options array changed from what you might call a "list" to a "hash"... this changes the structure of the $args to something which is, in the long term, much more useful
256
  $options = array(
257
- 'limit'=>"${domainprefix}limit",
258
- 'use_template'=>"${domainprefix}use_template",
259
- 'order'=>"${domainprefix}order",
260
- 'template_file'=>"${domainprefix}template_file",
 
 
 
 
 
261
  'promote_yarpp'=>"${domainprefix}promote_yarpp");
262
  $optvals = array();
263
  foreach (array_keys($options) as $option) {
@@ -269,70 +189,44 @@ function yarpp_related($type,$args,$echo = true,$reference_ID=false,$domain = 'w
269
  }
270
  extract($optvals);
271
 
272
- if (yarpp_get_option('ad_hoc_caching') == 1)
273
- yarpp_cache_enforce($type,$reference_ID);
274
-
275
  $output = '';
276
-
277
- if ($domain != 'demo_web' and $domain != 'demo_rss')
278
- $yarpp_time = true; // get ready for YARPP TIME!
279
- else
280
- $yarpp_demo_time = true;
281
- // just so we can return to normal later
282
- $current_query = $wp_query;
283
- $current_post = $post;
284
- $current_id = $id;
285
- $current_page = $page;
286
- $current_pages = $pages;
287
- $current_authordata = $authordata;
288
-
289
- $related_query = new WP_Query();
290
- $orders = split(' ',$order);
291
- if ($domain != 'demo_web' and $domain != 'demo_rss')
292
- $related_query->query("p=$reference_ID&orderby=".$orders[0]."&order=".$orders[1]."&showposts=$limit");
293
- else
294
- $related_query->query('');
295
 
296
- if ($domain == 'metabox') {
297
- include('template-metabox.php');
298
- } elseif ($use_template and file_exists(TEMPLATEPATH . '/' . $template_file)) {
299
- ob_start();
300
- include(TEMPLATEPATH . '/' . $template_file);
301
- $output = ob_get_contents();
302
- ob_end_clean();
 
 
 
 
 
 
303
  } else {
304
- include('template-builtin.php');
305
- }
306
-
307
- unset($related_query);
308
- if ($domain != 'demo_web' and $domain != 'demo_rss')
309
- $yarpp_time = false; // YARPP time is over... :(
310
- else
311
- $yarpp_demo_time = false;
312
-
313
- // restore the older wp_query.
314
- $wp_query = null; $wp_query = $current_query; unset($current_query);
315
- $post = null; $post = $current_post; unset($current_post);
316
- $authordata = null; $authordata = $current_authordata; unset($current_authordata);
317
- $pages = null; $pages = $current_pages; unset($current_pages);
318
- $id = $current_id; unset($current_id);
319
- $page = $current_page; unset($current_page);
320
-
321
- if ($promote_yarpp and $domain != 'metabox')
322
- $output .= "\n<p>".__("Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.",'yarpp')."</p>";
323
-
324
  if ($echo) echo $output; else return ((!empty($output))?"\n\n":'').$output;
325
  }
326
 
327
- function yarpp_related_exist($type,$args,$reference_ID=false) {
328
- global $wpdb, $post, $yarpp_time;
329
 
330
- if (is_object($post) and !$reference_ID)
331
- $reference_ID = $post->ID;
332
-
333
- if ($yarpp_time) // if we're already in a YARPP loop, stop now.
334
- return false;
335
-
336
  $options = array('threshold'=>'threshold','show_pass_post'=>'show_pass_post','past_only'=>'past_only');
337
  $optvals = array();
338
  foreach (array_keys($options) as $option) {
@@ -344,83 +238,34 @@ function yarpp_related_exist($type,$args,$reference_ID=false) {
344
  }
345
  extract($optvals);
346
 
347
- $result = $wpdb->get_var(yarpp_sql($type,$args,false,$reference_ID));
348
  return $result > 0 ? true: false;
349
  }
350
 
351
- // these are the post ID's which have been updated in this caching cycle
352
- $yarpp_updated_posts = array();
353
- // here's a queue of posts whose related posts should be enforced
354
- $yarpp_caching_queue = array();
355
-
356
- function yarpp_save_cache($post_ID,$force=true) {
357
- global $wpdb, $yarpp_caching_queue, $yarpp_updated_posts;
358
- $parent_ID = $wpdb->get_var("select post_parent from $wpdb->posts where ID='$post_ID'");
359
- if ($parent_ID != $post_ID and $parent_ID)
360
- $post_ID = $parent_ID;
361
- if (yarpp_get_option('cross_relate'))
362
- $type = array('post','page');
363
- else
364
- $type = array('post');
365
-
366
- // add it to the queue
367
- array_push($yarpp_caching_queue,$post_ID);
368
-
369
- // go through the queue
370
- while ($ID = array_pop($yarpp_caching_queue)) {
371
- if (array_search($ID,$yarpp_updated_posts) === false) {
372
- //echo "YARPP updating $ID<br/>";
373
- //echo "YARPP QUEUE: ".print_r($yarpp_caching_queue,true)."<br/>";
374
- //echo "YARPP UPDATED: ".print_r($yarpp_updated_posts,true)."<br/>";
375
- yarpp_cache_enforce($type,$ID,$force);
376
- array_push($yarpp_updated_posts,$ID);
377
- }
378
- }
379
- }
380
-
381
- function yarpp_cache_enforce($type=array('post'),$reference_ID,$force=false) {
382
- global $wpdb, $yarpp_debug, $yarpp_caching_queue;
383
 
384
- $timeout = 600;
385
 
386
- if (!$force) {
387
- if ($wpdb->get_var("select count(*) as count from {$wpdb->prefix}yarpp_related_cache where reference_ID = $reference_ID and date > date_sub(now(),interval $timeout minute)")) {
388
- if ($yarpp_debug) echo "<!--YARPP is using the cache right now.-->";
389
- return false;
390
- }
391
  }
392
-
393
- yarpp_cache_keywords($reference_ID);
394
-
395
- // let's first record the current related posts for this reference ID
396
- $old_relations = $wpdb->get_col("select ID from {$wpdb->prefix}yarpp_related_cache where reference_ID = $reference_ID and ID != 0");
397
- array_push($old_relations,0);
398
-
399
- // now clear out the cruft
400
- $wpdb->query("delete from {$wpdb->prefix}yarpp_related_cache where reference_ID = $reference_ID");
401
-
402
- // let's update the related posts
403
- $wpdb->query("insert into {$wpdb->prefix}yarpp_related_cache (reference_ID,ID,score) ".yarpp_sql($type,array(),true,$reference_ID)." on duplicate key update date = now()");
404
-
405
- if ($wpdb->rows_affected and $yarpp_debug) echo "<!--YARPP just set the cache for post $reference_ID-->";
406
-
407
- // if changes were made, let's find out which ones are new. We'll want to then add add these to the queue so their related posts can also be updated.
408
- if ($wpdb->rows_affected) {
409
- $new_relations = $wpdb->get_col("select ID from {$wpdb->prefix}yarpp_related_cache where reference_ID = $reference_ID and ID not in (".implode(',',$old_relations).")");
410
- //echo "YARPP added (select ID from {$wpdb->prefix}yarpp_related_cache where reference_ID = $reference_ID and ID not in (".implode(',',$old_relations).")): ".print_r($new_relations,true)."<br/>";
411
- $yarpp_caching_queue = array_merge($yarpp_caching_queue,$new_relations);
412
- }
413
-
414
- if (!$wpdb->rows_affected) {
415
- $wpdb->query("insert into {$wpdb->prefix}yarpp_related_cache (reference_ID,ID,score) values ($reference_ID,0,0)");
416
- if (!$wpdb->rows_affected)
417
- return false;
418
- }
419
- //$wpdb->query("delete from {$wpdb->prefix}yarpp_related_cache where date <= date_sub(now(),interval $timeout minute)");
420
- //if ($wpdb->rows_affected)
421
- // if ($yarpp_debug) echo "<!--$wpdb->rows_affected rows were cleared as they had expired.-->";
422
-
423
- return true;
424
-
425
  }
426
 
 
 
1
  <?php
2
 
3
+ function yarpp_sql($type,$args,$giveresults = true,$domain='website') {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  global $wpdb, $post, $yarpp_debug;
5
 
 
 
 
 
6
  // set $yarpp_debug
7
  if (isset($_REQUEST['yarpp_debug']))
8
  $yarpp_debug = true;
14
  $domainprefix = '';
15
 
16
  $options = array('limit'=>"${domainprefix}limit",
17
+ 'order'=>"${domainprefix}order",
18
  'threshold'=>'threshold',
19
+ 'show_excerpt'=>"${domainprefix}show_excerpt",
20
+ 'excerpt_length'=>"${domainprefix}excerpt_length",
21
  'show_pass_post'=>'show_pass_post',
22
  'past_only'=>'past_only',
23
  'cross_relate'=>'cross_relate',
26
  'tags'=>'tags',
27
  'categories'=>'categories',
28
  'distags'=>'distags',
29
+ 'discats'=>'discats');
 
 
 
30
  $optvals = array();
31
  foreach (array_keys($options) as $option) {
32
  if (isset($args[$option])) {
41
  // if cross_relate is set, override the type argument and make sure both matches are accepted in the sql query
42
  if ($cross_relate) $type = array('post','page');
43
 
44
+ //yarpp_cache_keywords(); /* TEST */
45
+
46
  // Fetch keywords
47
+ $body_terms = post_body_keywords();
48
+ $title_terms = post_title_keywords();
49
 
50
  if ($yarpp_debug) echo "<!--TITLE TERMS: $title_terms-->"; // debug
51
  if ($yarpp_debug) echo "<!--BODY TERMS: $body_terms-->"; // debug
52
+
53
+ // Make sure the post is not from the future
54
+ $time_difference = get_settings('gmt_offset');
55
+ $now = gmdate("Y-m-d H:i:s",(time()+($time_difference*3600)));
56
 
57
  // get weights
58
 
68
 
69
  $totalweight = $bodyweight + $titleweight + $tagweight + $catweight;
70
 
71
+ $weightedthresh = $threshold/($totalweight + 0.1);
72
+
73
  // get disallowed categories and tags
74
 
75
  $disterms = implode(',', array_filter(array_merge(explode(',',$discats),explode(',',$distags)),'is_numeric'));
78
 
79
  $criteria = array();
80
  if ($bodyweight)
81
+ $criteria['body'] = "(MATCH (post_content) AGAINST ('$body_terms'))";
82
  if ($titleweight)
83
+ $criteria['title'] = "(MATCH (post_title) AGAINST ('$title_terms'))";
84
  if ($tagweight)
85
  $criteria['tag'] = "COUNT( DISTINCT tagtax.term_taxonomy_id )";
86
  if ($catweight)
87
  $criteria['cat'] = "COUNT( DISTINCT cattax.term_taxonomy_id )";
88
 
89
+ $newsql = "SELECT ID, post_title, post_date, post_content, post_excerpt, ";
90
 
91
+ foreach ($criteria as $key => $value) {
92
+ $newsql .= "$value as ${key}score, ";
93
+ }
94
 
95
  $newsql .= '(0';
96
  foreach ($criteria as $key => $value) {
97
  $newsql .= "+ $value * ".$weights[$key];
98
  }
99
  $newsql .= ') as score';
100
+
101
+ if ($usedisterms)
102
+ $newsql .= ", count(blockterm.term_id) as block";
103
 
104
  $newsql .= "\n from $wpdb->posts \n";
105
 
109
  left join $wpdb->terms as blockterm on (blocktax.term_id = blockterm.term_id and blockterm.term_id in ($disterms))\n";
110
 
111
  if ($tagweight)
112
+ $newsql .= " left JOIN $wpdb->term_relationships AS thistag ON (thistag.object_id = $post->ID )
113
  left JOIN $wpdb->term_relationships AS tagrel on (tagrel.term_taxonomy_id = thistag.term_taxonomy_id
114
  AND tagrel.object_id = $wpdb->posts.ID)
115
  left JOIN $wpdb->term_taxonomy AS tagtax ON ( tagrel.term_taxonomy_id = tagtax.term_taxonomy_id
116
  AND tagtax.taxonomy = 'post_tag')\n";
117
 
118
  if ($catweight)
119
+ $newsql .= " left JOIN $wpdb->term_relationships AS thiscat ON (thiscat.object_id = $post->ID )
120
  left JOIN $wpdb->term_relationships AS catrel on (catrel.term_taxonomy_id = thiscat.term_taxonomy_id
121
  AND catrel.object_id = $wpdb->posts.ID)
122
  left JOIN $wpdb->term_taxonomy AS cattax ON ( catrel.term_taxonomy_id = cattax.term_taxonomy_id
124
 
125
  // WHERE
126
 
127
+ $newsql .= " where (post_status IN ( 'publish', 'static' ) and ID != '$post->ID')";
128
 
129
  if ($past_only)
130
+ $newsql .= " and post_date <= '$now' ";
131
  if (!$show_pass_post)
132
  $newsql .= " and post_password ='' ";
 
 
133
 
134
  $newsql .= " and post_type IN ('".implode("', '",$type)."')";
135
 
136
  // GROUP BY
137
  $newsql .= "\n group by id \n";
138
  // HAVING
139
+ $newsql .= " having score >= $threshold";
 
140
  if ($usedisterms)
141
+ $newsql .= " and block = 0";
142
 
143
+ $newsql .= (($categories == 3)?' and catscore >= 1':'');
144
+ $newsql .= (($categories == 4)?' and catscore >= 2':'');
145
+ $newsql .= (($tags == 3)?' and tagscore >= 1':'');
146
+ $newsql .= (($tags == 4)?' and tagscore >= 2':'');
147
+ $newsql .= " order by ".(($order?$order:"score desc"))." limit ".$limit;
148
 
149
  if (!$giveresults) {
150
  $newsql = "select count(t.ID) from ($newsql) as t";
156
 
157
  /* new in 2.1! the domain argument refers to {website,widget,rss}, though widget is not used yet. */
158
 
159
+ function yarpp_related($type,$args,$echo = true,$domain = 'website') {
160
+ global $wpdb, $post, $userdata;
 
 
 
 
 
 
 
 
 
 
 
 
161
  get_currentuserinfo();
162
 
163
  // set the "domain prefix", used for all the preferences.
164
+ if ($domain == 'rss')
165
  $domainprefix = 'rss_';
166
  else
167
  $domainprefix = '';
169
  // get options
170
  // note the 2.1 change... the options array changed from what you might call a "list" to a "hash"... this changes the structure of the $args to something which is, in the long term, much more useful
171
  $options = array(
172
+ 'before_related'=>"${domainprefix}before_related",
173
+ 'after_related'=>"${domainprefix}after_related",
174
+ 'before_title'=>"${domainprefix}before_title",
175
+ 'after_title'=>"${domainprefix}after_title",
176
+ 'show_excerpt'=>"${domainprefix}show_excerpt",
177
+ 'excerpt_length'=>"${domainprefix}excerpt_length",
178
+ 'before_post'=>"${domainprefix}before_post",
179
+ 'after_post'=>"${domainprefix}after_post",
180
+ 'no_results'=>"${domainprefix}no_results",
181
  'promote_yarpp'=>"${domainprefix}promote_yarpp");
182
  $optvals = array();
183
  foreach (array_keys($options) as $option) {
189
  }
190
  extract($optvals);
191
 
192
+ $sql = yarpp_sql($type,$args,true,$domain);
193
+ $results = $wpdb->get_results($sql);
194
+
195
  $output = '';
196
+ if ($results) {
197
+ foreach ($results as $result) {
198
+ $title = stripslashes(apply_filters('the_title', $result->post_title));
199
+ $permalink = get_permalink($result->ID);
200
+
201
+ $post_content = strip_tags(apply_filters_if_white('the_content',$result->post_content));
202
+ //$post_content = stripslashes($post_content);
203
+
204
+ $post_excerpt = strip_tags($result->post_excerpt);
205
+ if ($post_excerpt == '')
206
+ $post_excerpt = $post_content; //this is okay because it will be clipped later anyway.
 
 
 
 
 
 
 
 
207
 
208
+ $output .= "$before_title<a href='$permalink' rel='bookmark' title='Permanent Link: $title'>$title";
209
+ if ($userdata->user_level >= 8 and $domain != 'rss')
210
+ $output .= ' <abbr title="'.sprintf(__('%f is the YARPP match score between the current entry and this related entry. You are seeing this value because you are logged in to WordPress as an administrator. It is not shown to regular visitors.','yarpp'),round($result->score,3)).'">('.round($result->score,3).')</abbr>';
211
+ $output .= '</a>';
212
+ if ($show_excerpt) {
213
+ $output .= $before_post . yarpp_excerpt($post_excerpt,$excerpt_length) . $after_post;
214
+ }
215
+ $output .= $after_title;
216
+ }
217
+ $output = stripslashes(stripslashes($before_related)).$output.stripslashes(stripslashes($after_related));
218
+ if ($promote_yarpp)
219
+ $output .= "\n<p>".__("Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.",'yarpp')."</p>";
220
+
221
  } else {
222
+ $output = $no_results;
223
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224
  if ($echo) echo $output; else return ((!empty($output))?"\n\n":'').$output;
225
  }
226
 
227
+ function yarpp_related_exist($type,$args) {
228
+ global $wpdb, $post;
229
 
 
 
 
 
 
 
230
  $options = array('threshold'=>'threshold','show_pass_post'=>'show_pass_post','past_only'=>'past_only');
231
  $optvals = array();
232
  foreach (array_keys($options) as $option) {
238
  }
239
  extract($optvals);
240
 
241
+ $result = $wpdb->get_var(yarpp_sql($type,$args,false,$domain));
242
  return $result > 0 ? true: false;
243
  }
244
 
245
+ /* yarpp_cache_* are EXPERIMENTAL and not used.
246
+ * Don't worry about it. ^^
247
+ */
248
+ function yarpp_cache_exists($post_id) {
249
+ global $wpdb;
250
+ /*
251
+ CREATE TABLE `wp_yarpp_keyword_cache` (
252
+ `ID` BIGINT( 20 ) UNSIGNED NOT NULL ,
253
+ `body` TEXT NOT NULL ,
254
+ `title` TEXT NOT NULL ,
255
+ `date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
256
+ PRIMARY KEY ( `ID` )
257
+ ) ENGINE = MYISAM COMMENT = 'YARPP\'s keyword cache table'
258
+ */
259
+ $timeout = 400;
260
+
261
+ if (!$wpdb->get_var("select count(*) as count from wp_yarpp_keyword_cache where ID = $post->ID and date > date_sub(now(),interval $timeout minute)")) {
262
+ $wpdb->query('set names utf8');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
263
 
264
+ $wpdb->query("insert into wp_yarpp_keyword_cache (ID,body,title) values ($post->ID,'$body_terms','$title_terms') on duplicate key update body = '$body_terms', title = '$title_terms'");
265
 
266
+ if ($yarpp_debug) echo "<!--"."insert into wp_yarpp_keyword_cache (ID,body,title) values ($post->ID,'$body_terms','$title_terms') on duplicate key update body = '$body_terms', title = '$title_terms'"."-->";
 
 
 
 
267
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
268
  }
269
 
270
+
271
+ ?>
options.css CHANGED
File without changes
options.php CHANGED
@@ -2,28 +2,10 @@
2
 
3
  global $wpdb, $yarpp_value_options, $yarpp_binary_options, $wp_version;
4
 
5
- // check to see that templates are in the right place
6
-
7
- if (!count(glob(TEMPLATEPATH . '/yarpp-template-*.php'))) {
8
- if (count(glob(WP_CONTENT_DIR.'/plugins/yet-another-related-posts-plugin/yarpp-templates/yarpp-template-*.php')))
9
- echo "<div class='updated'>"
10
- .str_replace("TEMPLATEPATH",TEMPLATEPATH,__("Please move the YARPP template files into your theme to complete installation. Simply move the sample template files (currently in <code>wp-content/plugins/yet-another-related-posts-plugin/yarpp-templates/</code>) to the <code>TEMPLATEPATH</code> directory.",'yarpp'))
11
- ."</div>";
12
-
13
- else
14
- echo "<div class='updated'>"
15
- .str_replace('TEMPLATEPATH',TEMPLATEPATH,__("No YARPP template files were found in your theme (<code>TEMPLATEPATH</code>) so the templating feature has been turned off.",'yarpp'))
16
- ."</div>";
17
-
18
- yarpp_set_option('use_template',false);
19
- yarpp_set_option('rss_use_template',false);
20
-
21
- }
22
-
23
  if ($_POST['myisam_override']) {
24
  yarpp_set_option('myisam_override',1);
25
  echo "<div class='updated'>"
26
- .__("The MyISAM check has been overridden. You may now use the \"consider titles\" and \"consider bodies\" relatedness criteria.",'yarpp')
27
  ."</div>";
28
  }
29
 
@@ -38,7 +20,7 @@ if (!yarpp_get_option('myisam_override')) {
38
  ."<br />"
39
  .sprintf(__("If, despite this check, you are sure that <code>%s</code> is using the MyISAM engine, press this magic button:",'yarpp'),$wpdb->posts)
40
  ."<br />"
41
- ."<form method='post'><input type='submit' class='button' name='myisam_override' value='"
42
  .__("Trust me. Let me use MyISAM features.",'yarpp')
43
  ."'></input></form>"
44
  ."</div>";
@@ -60,29 +42,17 @@ if (substr($wp_version,0,3) < 2.5) {
60
 
61
  if ($yarpp_myisam) {
62
  if (!yarpp_enabled()) {
63
- echo '<div class="updated"><p>';
64
  if (yarpp_activate())
65
  _e('The YARPP database had an error but has been fixed.','yarpp');
66
  else
67
  _e('The YARPP database has an error which could not be fixed.','yarpp');
68
- echo '</div></p>';
69
  }
70
  }
71
 
72
  yarpp_reinforce(); // just in case, set default options, etc.
73
 
74
- // check if the cache is complete or not.
75
- $cache_complete = $wpdb->get_var("select (count(p.ID)-sum(c.ID IS NULL))/count(p.ID)
76
- FROM $wpdb->posts as p
77
- LEFT JOIN {$wpdb->prefix}yarpp_related_cache as c ON ( p.ID = c.reference_ID )
78
- WHERE p.post_status = 'publish' ");
79
-
80
- if ($cache_complete > 0 and $cache_complete < 1)
81
- echo '<div class="updated fade" style="background-color: rgb(207, 235, 247);"><p>'.str_replace('<A>','<a class="thickbox" title="'.__('Related posts cache status','yarpp').'" href="#TB_inline?height=100&width=300&inlineId=yarpp-cache-status">',__('Your related posts cache is incomplete. Please build your cache from the <A>related posts status pane</a>.','yarpp')).'</p></div>';
82
-
83
- if ($cache_complete == 0)
84
- echo '<div class="updated fade" style="background-color: rgb(207, 235, 247);"><p>'.str_replace('<A>','<a class="thickbox" title="'.__('Related posts cache status','yarpp').'" href="#TB_inline?height=100&width=300&inlineId=yarpp-cache-status">',__('Your related posts cache is empty. Please build your cache from the <A>related posts status pane</a>.','yarpp')).'</p></div>';
85
-
86
  //compute $tagmap
87
  $tagmap = array();
88
  foreach ($wpdb->get_results("select $wpdb->terms.term_id, name from $wpdb->terms natural join $wpdb->term_taxonomy where $wpdb->term_taxonomy.taxonomy = 'category'") as $tag) {
@@ -122,14 +92,12 @@ if (isset($_POST['update_yarpp'])) {
122
  foreach (array_keys($yarpp_binary_options) as $option) {
123
  (isset($_POST[$option])) ? yarpp_set_option($option,true) : yarpp_set_option($option,false);
124
  }
125
- echo '<div class="updated fade" style="background-color: rgb(207, 235, 247);"><p>'.__('Options saved!','yarpp')
126
- .' '.str_replace('<A>','<a class="thickbox" title="'.__('Related posts cache status','yarpp').'" href="#TB_inline?height=100&width=300&inlineId=yarpp-cache-status">',
127
- __('If you updated the "pool" options or "relatedness" options displayed, please rebuild your cache now from the <A>related posts status pane</a>.','yarpp')).'</p></div>';
128
  }
129
 
130
  function checkbox($option,$desc,$tr="<tr valign='top'>
131
  <th class='th-full' colspan='2' scope='row'>",$inputplus = '',$thplus='') {
132
- echo " $tr<input $inputplus type='checkbox' name='$option' value='true'". ((yarpp_get_option($option) == 1) ? ' checked="checked"': '' )." /> $desc</th>$thplus
133
  </tr>";
134
  }
135
  function textbox($option,$desc,$size=2,$tr="<tr valign='top'>
@@ -206,51 +174,15 @@ css.setAttribute("rel", "stylesheet");
206
  css.setAttribute("type", "text/css");
207
  css.setAttribute("href", "../wp-content/plugins/yet-another-related-posts-plugin/options.css");
208
  document.getElementsByTagName("head")[0].appendChild(css);
209
-
210
- function load_display_demo_web() {
211
- jQuery.ajax({type:'POST',
212
- url:'admin-ajax.php',
213
- data:'action=yarpp_display_demo_web',
214
- beforeSend:function(){jQuery('#display_demo_web').eq(0).html('<img src="../wp-content/plugins/yet-another-related-posts-plugin/i/spin.gif" alt="loading..."/>')},
215
- success:function(html){jQuery('#display_demo_web').eq(0).html('<pre>'+html+'</pre>')},
216
- dataType:'html'}
217
- )
218
- }
219
-
220
- function load_display_demo_rss() {
221
- jQuery.ajax({type:'POST',
222
- url:'admin-ajax.php',
223
- data:'action=yarpp_display_demo_rss',
224
- beforeSend:function(){jQuery('#display_demo_rss').eq(0).html('<img src="../wp-content/plugins/yet-another-related-posts-plugin/i/spin.gif" alt="loading..."/>')},
225
- success:function(html){jQuery('#display_demo_rss').eq(0).html('<pre>'+html+'</pre>')},
226
- dataType:'html'}
227
- )
228
- }
229
-
230
- function load_display_distags() {
231
- jQuery.ajax({type:'POST',
232
- url:'admin-ajax.php',
233
- data:'action=yarpp_display_distags',
234
- beforeSend:function(){jQuery('#display_distags').eq(0).html('<img src="../wp-content/plugins/yet-another-related-posts-plugin/i/spin.gif" alt="loading..."/>')},
235
- success:function(html){jQuery('#display_distags').eq(0).html(html)},
236
- dataType:'html'}
237
- )
238
- }
239
-
240
- function load_display_discats() {
241
- jQuery.ajax({type:'POST',
242
- url:'admin-ajax.php',
243
- data:'action=yarpp_display_discats',
244
- beforeSend:function(){jQuery('#display_discats').eq(0).html('<img src="../wp-content/plugins/yet-another-related-posts-plugin/i/spin.gif" alt="loading..."/>')},
245
- success:function(html){jQuery('#display_discats').eq(0).html(html)},
246
- dataType:'html'}
247
- )
248
- }
249
  //-->
250
  </script>
251
 
252
  <div class="wrap">
253
  <h2>
 
 
 
254
  <?php _e('Yet Another Related Posts Plugin Options','yarpp');?> <small><?php
255
 
256
  $display_version = yarpp_get_option('version');
@@ -264,47 +196,44 @@ function load_display_discats() {
264
  ?></small>
265
  </h2>
266
 
267
- <?php echo "<div id='yarpp-version' style='display:none;'>".yarpp_get_option('version')."</div>"; ?>
268
-
269
  <form method="post">
270
 
271
- <a href='https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=66G4DATK4999L&item_name=mitcho%2ecom%2fcode%3a%20donate%20to%20Michael%20Yoshitaka%20Erlewine&no_shipping=1&no_note=1&tax=0&currency_code=USD&lc=US&charset=UTF%2d8' target='_new'><img src="https://www.paypal.com/<?php echo paypal_directory(); ?>i/btn/btn_donate_SM.gif" name="submit" alt="<?php _e('Donate to mitcho (Michael Yoshitaka Erlewine) for this plugin via PayPal');?>" title="<?php _e('Donate to mitcho (Michael Yoshitaka Erlewine) for this plugin via PayPal','yarpp');?>" style="float:right" /></a>
272
 
273
- <p><small><?php _e('by <a href="http://mitcho.com/code/">mitcho (Michael 芳貴 Erlewine)</a>','yarpp');?>. <?php _e('Follow <a href="http://twitter.com/yarpp/">Yet Another Related Posts Plugin on Twitter</a>','yarpp');?>.</small></p>
274
 
275
 
276
  <!--The Pool-->
277
- <div style='border:1px solid #ddd;padding:8px;'>
278
  <h3><?php _e('"The Pool"','yarpp');?></h3>
279
  <p><?php _e('"The Pool" refers to the pool of posts and pages that are candidates for display as related to the current entry.','yarpp');?></p>
280
 
281
  <table class="form-table" style="margin-top: 0">
282
  <tbody>
283
  <tr valign='top'>
284
- <th scope='row'><?php _e('Disallow by category:','yarpp');?></th><td><div id='display_discats' style="overflow:auto;max-height:100px;"></div></td></tr>
 
 
 
 
 
 
 
285
  <tr valign='top'>
286
  <th scope='row'><?php _e('Disallow by tag:','yarpp');?></th>
287
- <td><div id='display_distags' style="overflow:auto;max-height:100px;"></div></td></tr>
288
- <?php checkbox('show_pass_post',__("Show password protected posts?",'yarpp')); ?>
289
- <?php /*checkbox('past_only',__("Show only previous posts?",'yarpp')); */ ?>
290
- <?php
291
-
292
- $recent_number = "<input name=\"recent_number\" type=\"text\" id=\"recent_number\" value=\"".stripslashes(yarpp_get_option('recent_number',true))."\" size=\"2\" />";
293
- $recent_units = "<select name=\"recent_units\" id=\"recent_units\">
294
- <option value='day'". (('day'==yarpp_get_option('recent_units'))?" selected='selected'":'').">".__('day(s)','yarpp')."</option>
295
- <option value='week'". (('week'==yarpp_get_option('recent_units'))?" selected='selected'":'').">".__('week(s)','yarpp')."</option>
296
- <option value='month'". (('month'==yarpp_get_option('recent_units'))?" selected='selected'":'').">".__('month(s)','yarpp')."</option>
297
- </select>";
298
- checkbox('recent_only',str_replace('NUMBER',$recent_number,str_replace('UNITS',$recent_units,__("Show only posts from the past NUMBER UNITS",'yarpp')))); ?>
299
-
300
  </tbody>
301
  </table>
302
- </div>
303
 
304
  <!-- Relatedness -->
305
- <div style='border:1px solid #ddd;padding:8px;'>
306
  <h3><?php _e('"Relatedness" options','yarpp');?></h3>
307
-
308
  <p><?php _e('YARPP is different than the <a href="http://wasabi.pbwiki.com/Related%20Entries">previous plugins it is based on</a> as it limits the related posts list by (1) a maximum number and (2) a <em>match threshold</em>.','yarpp');?> <a href="#" class='info'><?php _e('more&gt;','yarpp');?><span><?php _e('The higher the match threshold, the more restrictive, and you get less related posts overall. The default match threshold is 5. If you want to find an appropriate match threshhold, take a look at some post\'s related posts display and their scores. You can see what kinds of related posts are being picked up and with what kind of match scores, and determine an appropriate threshold for your site.','yarpp');?></span></a></p>
309
 
310
  <table class="form-table" style="margin-top: 0">
@@ -322,123 +251,86 @@ function load_display_discats() {
322
  <?php checkbox('cross_relate',__("Cross-relate posts and pages?",'yarpp')." <a href='#' class='info'>".__('more&gt;','yarpp')."<span>".__("When the \"Cross-relate posts and pages\" option is selected, the <code>related_posts()</code>, <code>related_pages()</code>, and <code>related_entries()</code> all will give the same output, returning both related pages and posts.",'yarpp')."</span></a>"); ?>
323
  </tbody>
324
  </table>
325
- </div>
326
 
327
  <script language="javascript">
328
  //<!--
329
- function template() {
330
- if (jQuery('.template').eq(0).attr('checked')) {
331
- jQuery('.templated').show();
332
- jQuery('.not_templated').hide();
333
- } else {
334
- jQuery('.templated').hide();
335
- jQuery('.not_templated').show();
336
- }
337
- excerpt();
338
- }
339
  function excerpt() {
340
- if (!jQuery('.template').eq(0).attr('checked') && jQuery('.show_excerpt').eq(0).attr('checked'))
341
- jQuery('.excerpted').show();
342
- else
343
- jQuery('.excerpted').hide();
344
- }
345
-
346
- function rss_display() {
347
- if (jQuery('.rss_display').eq(0).attr('checked'))
348
- jQuery('.rss_displayed').show();
349
- else
350
- jQuery('.rss_displayed').hide();
351
- rss_excerpt();
352
- }
353
- function rss_template() {
354
- if (jQuery('.rss_template').eq(0).attr('checked')) {
355
- jQuery('.rss_templated').show();
356
- jQuery('.rss_not_templated').hide();
357
- } else {
358
- jQuery('.rss_templated').hide();
359
- jQuery('.rss_not_templated').show();
360
  }
361
- rss_excerpt();
 
362
  }
363
  function rss_excerpt() {
364
- if (jQuery('.rss_display').eq(0).attr('checked') && jQuery('.rss_show_excerpt').eq(0).attr('checked'))
365
- jQuery('.rss_excerpted').show();
366
- else
367
- jQuery('.rss_excerpted').hide();
 
 
368
  }
369
-
370
- function yarpp_js_init() {
371
- template();
372
- rss_template();
373
- load_display_discats();
374
- load_display_distags();
375
- load_display_demo_web();
376
- load_display_demo_rss();
377
- jQuery('#build-cache-button').click(function() {
378
- jQuery('#yarpp-cache-message').hide();
379
- jQuery('#build-cache-button').hide();
380
- jQuery('#build-display').css('display','block');
381
- yarppBuildRequest();
382
- });
383
-
384
- version = jQuery('#yarpp-version').html();
385
- jQuery.post('http://mitcho.com/code/yarpp/checkversion.php',{version:version},function(json){
386
- if (json.result == 'newbeta')
387
- jQuery('#yarpp-version').addClass('updated').html(<?php echo "'<p>".str_replace('VERSION',"'+json.beta.version+'",str_replace('<A>',"<a href=\"'+json.beta.url+'\">",__("There is a new beta (VERSION) of Yet Another Related Posts Plugin. You can <A>download it here</a> at your own risk.","yarpp")))."</p>'"?>).show();
388
- if (json.result == 'new')
389
- jQuery('#yarpp-version').addClass('updated').html(<?php echo "'<p>".str_replace('VERSION',"'+json.current.version+'",str_replace('<A>',"<a href=\"'+json.current.url+'\">",__("There is a new version (VERSION) of Yet Another Related Posts Plugin available! You can <A>download it here</a>.","yarpp")))."</p>'"?>).show();
390
- },'json');
391
  }
392
-
393
- jQuery(document).ready(yarpp_js_init);
394
-
395
  //-->
396
  </script>
397
 
398
 
399
  <!-- Display options -->
400
- <div style='border:1px solid #ddd;padding:8px;'>
401
  <h3><?php _e("Display options <small>for your website</small>",'yarpp');?></h3>
402
 
403
- <table class="form-table" style="margin-top: 0;width:100%">
404
  <?php
405
- checkbox('auto_display',__("Automatically display related posts?",'yarpp')." <a href='#' class='info'>".__('more&gt;','yarpp')."<span>".__("This option automatically displays related posts right after the content on single entry pages. If this option is off, you will need to manually insert <code>related_posts()</code> or variants (<code>related_pages()</code> and <code>related_entries()</code>) into your theme files.",'yarpp')."</span></a>","<tr valign='top'>
406
- <th class='th-full' colspan='2' scope='row'>",'','<td rowspan="11" style="border-left:8px transparent solid;"><b>'.__("Website display code example",'yarpp').'</b><br /><small>'.__("(Update options to reload.)",'yarpp').'</small><br/>'
407
- ."<div id='display_demo_web' style='overflow:auto;width:350px;max-height:500px;'></div></td>");?>
 
 
 
 
 
 
 
 
408
 
 
 
 
409
  <?php textbox('limit',__('Maximum number of related posts:','yarpp'))?>
410
- <?php checkbox('use_template',__("Display using a custom template file",'yarpp')." <span style='color:red;'>".__('NEW!','yarpp')."</span> <a href='#' class='info'>".__('more&gt;','yarpp')."<span>".__("This advanced option gives you full power to customize how your related posts are displayed. Templates (stored in your theme folder) are written in PHP.",'yarpp')."</span></a>","<tr valign='top'><th colspan='2'>",' class="template" onclick="javascript:template()"'); ?>
411
- <tr valign='top' class='templated'>
412
- <th><?php _e("Template file:",'yarpp');?></th>
413
- <td>
414
- <select name="template_file" id="template_file">
415
- <?php foreach (glob(TEMPLATEPATH . '/yarpp-template-*.php') as $template): ?>
416
- <option value='<?php echo htmlspecialchars(basename($template))?>'<?php echo (basename($template)==yarpp_get_option('template_file'))?" selected='selected'":'';?>><?php echo htmlspecialchars(basename($template))?></option>
417
- <?php endforeach; ?>
418
- </select>
419
- </td>
420
- </tr>
421
- <tr valign='top' class='not_templated'>
422
  <th><?php _e("Before / after related entries:",'yarpp');?></th>
423
  <td><input name="before_related" type="text" id="before_related" value="<?php echo stripslashes(yarpp_get_option('before_related',true)); ?>" size="10" /> / <input name="after_related" type="text" id="after_related" value="<?php echo stripslashes(yarpp_get_option('after_related',true)); ?>" size="10" /><em><small> <?php _e("For example:",'yarpp');?> &lt;ol&gt;&lt;/ol&gt; or &lt;div&gt;&lt;/div&gt;</small></em>
424
  </td>
425
  </tr>
426
- <tr valign='top' class='not_templated'>
427
  <th><?php _e("Before / after each related entry:",'yarpp');?></th>
428
  <td><input name="before_title" type="text" id="before_title" value="<?php echo stripslashes(yarpp_get_option('before_title',true)); ?>" size="10" /> / <input name="after_title" type="text" id="after_title" value="<?php echo stripslashes(yarpp_get_option('after_title',true)); ?>" size="10" /><em><small> <?php _e("For example:",'yarpp');?> &lt;li&gt;&lt;/li&gt; or &lt;dl&gt;&lt;/dl&gt;</small></em>
429
  </td>
430
  </tr>
431
- <?php checkbox('show_excerpt',__("Show excerpt?",'yarpp'),"<tr class='not_templated' valign='top'><th colspan='2'>",' class="show_excerpt" onclick="javascript:excerpt()"'); ?>
432
- <?php textbox('excerpt_length',__('Excerpt length (No. of words):','yarpp'),null,"<tr class='excerpted' valign='top'>
433
  <th>")?>
434
 
435
- <tr class="excerpted" valign='top'>
436
  <th><?php _e("Before / after (Excerpt):",'yarpp');?></th>
437
  <td><input name="before_post" type="text" id="before_post" value="<?php echo stripslashes(yarpp_get_option('before_post',true)); ?>" size="10" /> / <input name="after_post" type="text" id="after_post" value="<?php echo stripslashes(yarpp_get_option('after_post')); ?>" size="10" /><em><small> <?php _e("For example:",'yarpp');?> &lt;li&gt;&lt;/li&gt; or &lt;dl&gt;&lt;/dl&gt;</small></em>
438
  </td>
439
  </tr>
440
 
441
- <tr valign='top'>
442
  <th><?php _e("Order results:",'yarpp');?></th>
443
  <td><select name="order" id="order">
444
  <option value="score DESC" <?php echo (yarpp_get_option('order')=='score DESC'?' selected="selected"':'')?>><?php _e("score (high relevance to low)",'yarpp');?></option>
@@ -451,58 +343,57 @@ checkbox('auto_display',__("Automatically display related posts?",'yarpp')." <a
451
  </td>
452
  </tr>
453
 
454
- <?php textbox('no_results',__('Default display if no results:','yarpp'),'40',"<tr class='not_templated' valign='top'>
455
- <th>")?>
456
  <?php checkbox('promote_yarpp',__("Help promote Yet Another Related Posts Plugin?",'yarpp')
457
  ." <a href='#' class='info'>".__('more&gt;','yarpp')."<span>"
458
- .sprintf(__("This option will add the code %s. Try turning it on, updating your options, and see the code in the code example to the right. These links and donations are greatly appreciated.", 'yarpp'),"<code>".htmlspecialchars(__("Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.",'yarpp'))."</code>") ."</span></a>"); ?>
 
459
  </table>
460
- </div>
461
 
462
  <!-- Display options for RSS -->
463
- <div style='border:1px solid #ddd;padding:8px;'>
464
- <h3><?php _e("Display options <small>for RSS</small>",'yarpp');?></h3>
465
 
466
- <table class="form-table" style="margin-top: 0;width:100%">
467
  <?php
 
468
 
469
- checkbox('rss_display',__("Display related posts in feeds?",'yarpp')." <a href='#' class='info'>".__('more&gt;','yarpp')."<span>".__("This option displays related posts at the end of each item in your RSS and Atom feeds. No template changes are needed.",'yarpp')."</span></a>","<tr valign='top'><th colspan='3'>",' class="rss_display" onclick="javascript:rss_display();"');
470
- checkbox('rss_excerpt_display',__("Display related posts in the descriptions?",'yarpp')." <a href='#' class='info'>".__('more&gt;','yarpp')."<span>".__("This option displays the related posts in the RSS description fields, not just the content. If your feeds are set up to only display excerpts, however, only the description field is used, so this option is required for any display at all.",'yarpp')."</span></a>","<tr class='rss_displayed' valign='top'>
471
- <th class='th-full' colspan='2' scope='row'>",'','<td rowspan="9" style="border-left:8px transparent solid;"><b>'.__("RSS display code example",'yarpp').'</b><br /><small>'.__("(Update options to reload.)",'yarpp').'</small><br/>'
472
- ."<div id='display_demo_rss' style='overflow:auto;width:350px;max-height:500px;'></div></td>"); ?>
473
- <?php textbox('rss_limit',__('Maximum number of related posts:','yarpp'),2)?>
474
- <?php checkbox('rss_use_template',__("Display using a custom template file",'yarpp')." <span style='color:red;'>".__('NEW!','yarpp')."</span> <a href='#' class='info'>".__('more&gt;','yarpp')."<span>".__("This advanced option gives you full power to customize how your related posts are displayed. Templates (stored in your theme folder) are written in PHP.",'yarpp')."</span></a>","<tr valign='top'><th colspan='2'>",' class="rss_template" onclick="javascript:rss_template()"'); ?>
475
- <tr valign='top' class='rss_templated'>
476
- <th><?php _e("Template file:",'yarpp');?></th>
477
- <td>
478
- <select name="rss_template_file" id="rss_template_file">
479
- <?php foreach (glob(TEMPLATEPATH . '/yarpp-template-*.php') as $template): ?>
480
- <option value='<?php echo htmlspecialchars(basename($template))?>'<?php echo (basename($template)==yarpp_get_option('rss_template_file'))?" selected='selected'":'';?>><?php echo htmlspecialchars(basename($template))?></option>
481
- <?php endforeach; ?>
482
- </select>
483
- </td>
484
- </tr>
485
- <tr class='rss_not_templated' valign='top'>
486
  <th><?php _e("Before / after related entries display:",'yarpp');?></th>
487
  <td><input name="rss_before_related" type="text" id="rss_before_related" value="<?php echo stripslashes(yarpp_get_option('rss_before_related',true)); ?>" size="10" /> / <input name="rss_after_related" type="text" id="rss_after_related" value="<?php echo stripslashes(yarpp_get_option('rss_after_related',true)); ?>" size="10" /><em><small> <?php _e("For example:",'yarpp');?> &lt;ol&gt;&lt;/ol&gt; or &lt;div&gt;&lt;/div&gt;</small></em>
488
  </td>
489
  </tr>
490
- <tr class='rss_not_templated' valign='top'>
491
  <th><?php _e("Before / after each related entry:",'yarpp');?></th>
492
  <td><input name="rss_before_title" type="text" id="rss_before_title" value="<?php echo stripslashes(yarpp_get_option('rss_before_title',true)); ?>" size="10" /> / <input name="rss_after_title" type="text" id="rss_after_title" value="<?php echo stripslashes(yarpp_get_option('rss_after_title',true)); ?>" size="10" /><em><small> <?php _e("For example:",'yarpp');?> &lt;li&gt;&lt;/li&gt; or &lt;dl&gt;&lt;/dl&gt;</small></em>
493
  </td>
494
  </tr>
495
- <?php checkbox('rss_show_excerpt',__("Show excerpt?",'yarpp'),"<tr class='rss_not_templated' valign='top'><th colspan='2'>",' class="rss_show_excerpt" onclick="javascript:rss_excerpt()"'); ?>
496
- <?php textbox('rss_excerpt_length',__('Excerpt length (No. of words):','yarpp'),null,"<tr class='rss_excerpted' valign='top'>
497
  <th>")?>
498
 
499
- <tr class="rss_excerpted" valign='top'>
500
  <th><?php _e("Before / after (excerpt):",'yarpp');?></th>
501
  <td><input name="rss_before_post" type="text" id="rss_before_post" value="<?php echo stripslashes(yarpp_get_option('rss_before_post',true)); ?>" size="10" /> / <input name="rss_after_post" type="text" id="rss_after_post" value="<?php echo stripslashes(yarpp_get_option('rss_after_post')); ?>" size="10" /><em><small> <?php _e("For example:",'yarpp');?> &lt;li&gt;&lt;/li&gt; or &lt;dl&gt;&lt;/dl&gt;</small></em>
502
  </td>
503
  </tr>
504
 
505
- <tr class='rss_displayed' valign='top'>
506
  <th><?php _e("Order results:",'yarpp');?></th>
507
  <td><select name="rss_order" id="rss_order">
508
  <option value="score DESC" <?php echo (yarpp_get_option('rss_order')=='score DESC'?' selected="selected"':'')?>><?php _e("score (high relevance to low)",'yarpp');?></option>
@@ -515,91 +406,14 @@ checkbox('rss_excerpt_display',__("Display related posts in the descriptions?",'
515
  </td>
516
  </tr>
517
 
518
- <?php textbox('rss_no_results',__('Default display if no results:','yarpp'),'40',"<tr valign='top' class='rss_not_templated'>
519
  <th scope='row'>")?>
520
  <?php checkbox('rss_promote_yarpp',__("Help promote Yet Another Related Posts Plugin?",'yarpp')." <a href='#' class='info'>".__('more&gt;','yarpp')."<span>"
521
- .sprintf(__("This option will add the code %s. Try turning it on, updating your options, and see the code in the code example to the right. These links and donations are greatly appreciated.", 'yarpp'),"<code>".htmlspecialchars(__("Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.",'yarpp'))."</code>") ."</span></a>","<tr valign='top' class='rss_displayed'>
 
522
  <th class='th-full' colspan='2' scope='row'>"); ?>
523
  </table>
524
- </div>
525
 
526
- <div style='border:1px solid #ddd;padding:8px;'>
527
- <h3><?php _e('Advanced','yarpp');?> <span style='color:red;'><?php _e('NEW!','yarpp')?></span></h3>
528
-
529
- <table class="form-table" style="margin-top: 0">
530
- <tr valign='top' colspan='2'><td><input class="thickbox button" type="button" value="<?php _e("Show cache status",'yarpp');?>" title="<?php _e('Related posts cache status','yarpp');?>" alt="#TB_inline?height=100&width=300&inlineId=yarpp-cache-status"/>
531
- <?php checkbox('ad_hoc_caching',__("When the cache is incomplete, compute related posts on the fly?",'yarpp')." <a href='#' class='info'>".__('more&gt;','yarpp')."<span>"
532
- .__("If a displayed post's related posts are not cached and this option is on, YARPP will compute them on the fly. Do not turn this option on if you have a high-traffic site.<br />If this option is off and a post's related posts have not been cached, it will display as if it has no related posts.",'yarpp')
533
- ."</span></a>"); ?>
534
- </table>
535
- </div>
536
-
537
- <script type='text/javascript'>
538
- //<!--
539
- time=0;i=0;m=0;id=0;
540
- timeout = 10000;
541
- function yarppBuildRequest() {
542
- jQuery.ajax({
543
- url:'admin-ajax.php',
544
- type: 'post',
545
- data: {action:'yarpp_build_cache_action',i:i,m:m,id:id},
546
- dataType: 'json',
547
- timeout: timeout,
548
- success: function (json) {
549
- if (json.result == 'success') {
550
- i = json.i;
551
- m = json.m;
552
- id = json.id;
553
- time = time + parseFloat(json.time);
554
- var remaining = Math.floor((m-i)*(time/i));
555
- var min = Math.floor(remaining/60);
556
- var sec = Math.floor(remaining - 60*min);
557
- if (i < m) {
558
- jQuery('#yarpp-bar').css('width',json.percent+'%');
559
- jQuery('#yarpp-percentage').html(json.percent+'%');
560
- jQuery('#yarpp-latest').html(json.title);
561
- if (min > 0) {
562
- jQuery('#yarpp-time').html(<?php echo str_replace('SEC',"'+sec+'",str_replace('MIN',"'+min+'",__("'MIN minute(s) and SEC second(s) remaining'",'yarpp')));?>);
563
- } else {
564
- jQuery('#yarpp-time').html(<?php echo str_replace('SEC',"'+sec+'",__("'SEC second(s) remaining'",'yarpp'));?>);
565
- }
566
- yarppBuildRequest();
567
- } else {
568
- jQuery('#build-display').html('<p><?php _e("Your related posts cache is now complete.",'yarpp');?><br/><small><?php echo str_replace('SEC',"'+(Math.floor(time*10)/10)+'",__('The SQL queries took SEC seconds.','yarpp'));?></small></p>');
569
- }
570
- return;
571
- }
572
- if (json.result == 'error') {
573
- i = json.i;
574
- m = json.m;
575
- id = json.id;
576
- }
577
- timeout += 5000;
578
- jQuery('#yarpp-latest').html('<?php echo str_replace('TITLE',"'+json.title+'",__('There was an error while constructing the related posts for TITLE','yarpp'))?>');
579
- jQuery('#build-cache-button').show().val('<?php _e("try to continue");?>');
580
- },
581
- error: function(json) {
582
- jQuery('#yarpp-latest').html('<?php echo str_replace('TITLE',"'+json.title+'",__('There was an error while constructing the related posts for TITLE','yarpp'))?>');
583
- timeout += 5000;
584
- jQuery('#build-cache-button').show().val('<?php _e("try to continue");?>');
585
- }
586
- });
587
- return false;
588
- }
589
- //-->
590
- </script>
591
-
592
- <div id='yarpp-cache-status' style='display:none;'><p id='yarpp-cache-message'><?php echo str_replace('PERCENT',floor($cache_complete * 1000)/10,__("Your related posts cache is PERCENT% complete.",'yarpp'));?></p>
593
- <center><input type='button' class='button' id='build-cache-button' value='build the cache now'/></center>
594
- <div id='build-display' style='display:none;margin-top:15px;'>
595
- <div class="progress-container" style='border: 1px solid #ccc; width: 200px; margin: 2px 5px 2px 0; padding: 1px; float: left; background: white;'>
596
- <div id='yarpp-bar' style="width: 0%; height: 12px; background-color: #21759B;">&nbsp;</div>
597
- </div><div id='yarpp-percentage'>0%</div>
598
- <p style='font-size: .8em' id='yarpp-latest'><?php _e('starting...','yarpp');?></p>
599
- <p style='font-size: .8em' id='yarpp-time'></p>
600
- </div>
601
- </div>
602
-
603
  <div>
604
  <p class="submit">
605
  <input type="submit" name="update_yarpp" value="<?php _e("Update options",'yarpp')?>" />
2
 
3
  global $wpdb, $yarpp_value_options, $yarpp_binary_options, $wp_version;
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  if ($_POST['myisam_override']) {
6
  yarpp_set_option('myisam_override',1);
7
  echo "<div class='updated'>"
8
+ .__("The MyISAM check has been overridden. You may now use the \"consider titles\" and \"consider bodies\" relatedness criteria.")
9
  ."</div>";
10
  }
11
 
20
  ."<br />"
21
  .sprintf(__("If, despite this check, you are sure that <code>%s</code> is using the MyISAM engine, press this magic button:",'yarpp'),$wpdb->posts)
22
  ."<br />"
23
+ ."<form method='post'><input type='submit' name='myisam_override' value='"
24
  .__("Trust me. Let me use MyISAM features.",'yarpp')
25
  ."'></input></form>"
26
  ."</div>";
42
 
43
  if ($yarpp_myisam) {
44
  if (!yarpp_enabled()) {
45
+ echo '<div class="updated">';
46
  if (yarpp_activate())
47
  _e('The YARPP database had an error but has been fixed.','yarpp');
48
  else
49
  _e('The YARPP database has an error which could not be fixed.','yarpp');
50
+ echo '</div>';
51
  }
52
  }
53
 
54
  yarpp_reinforce(); // just in case, set default options, etc.
55
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  //compute $tagmap
57
  $tagmap = array();
58
  foreach ($wpdb->get_results("select $wpdb->terms.term_id, name from $wpdb->terms natural join $wpdb->term_taxonomy where $wpdb->term_taxonomy.taxonomy = 'category'") as $tag) {
92
  foreach (array_keys($yarpp_binary_options) as $option) {
93
  (isset($_POST[$option])) ? yarpp_set_option($option,true) : yarpp_set_option($option,false);
94
  }
95
+ echo '<div id="message" class="updated fade" style="background-color: rgb(207, 235, 247);"><p>'.__('Options saved!','yarpp').'</p></div>';
 
 
96
  }
97
 
98
  function checkbox($option,$desc,$tr="<tr valign='top'>
99
  <th class='th-full' colspan='2' scope='row'>",$inputplus = '',$thplus='') {
100
+ echo " $tr<input $inputplus type='checkbox' name='$option' value='true'". ((yarpp_get_option($option)) ? ' checked="checked"': '' )." /> $desc</th>$thplus
101
  </tr>";
102
  }
103
  function textbox($option,$desc,$size=2,$tr="<tr valign='top'>
174
  css.setAttribute("type", "text/css");
175
  css.setAttribute("href", "../wp-content/plugins/yet-another-related-posts-plugin/options.css");
176
  document.getElementsByTagName("head")[0].appendChild(css);
177
+ document.getElementsByTagName("body")[0].setAttribute('onload',"excerpt();rss_excerpt();do_rss_display();");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  //-->
179
  </script>
180
 
181
  <div class="wrap">
182
  <h2>
183
+ <a href='https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=66G4DATK4999L&item_name=mitcho%2ecom%2fcode%3a%20donate%20to%20Michael%20Yoshitaka%20Erlewine&no_shipping=1&no_note=1&tax=0&currency_code=USD&lc=US&charset=UTF%2d8' target='_new'><img src="https://www.paypal.com/<?php echo paypal_directory(); ?>i/btn/btn_donate_SM.gif" name="submit" alt="<?php _e('Donate to mitcho (Michael Yoshitaka Erlewine) for this plugin via PayPal');?>" title="<?php _e('Donate to mitcho (Michael Yoshitaka Erlewine) for this plugin via PayPal','yarpp');?>" style="float:right" /></a>
184
+
185
+
186
  <?php _e('Yet Another Related Posts Plugin Options','yarpp');?> <small><?php
187
 
188
  $display_version = yarpp_get_option('version');
196
  ?></small>
197
  </h2>
198
 
 
 
199
  <form method="post">
200
 
 
201
 
202
+ <p><small><?php _e('by <a href="http://mitcho.com/code/">mitcho (Michael 芳貴 Erlewine)</a> and based on the fabulous work of <a href="http://peter.mapledesign.co.uk/weblog/archives/wordpress-related-posts-plugin">Peter Bower</a>, <a href="http://wasabi.pbwiki.com/Related%20Entries">Alexander Malov &amp; Mike Lu</a>.','yarpp');?></small></p>
203
 
204
 
205
  <!--The Pool-->
 
206
  <h3><?php _e('"The Pool"','yarpp');?></h3>
207
  <p><?php _e('"The Pool" refers to the pool of posts and pages that are candidates for display as related to the current entry.','yarpp');?></p>
208
 
209
  <table class="form-table" style="margin-top: 0">
210
  <tbody>
211
  <tr valign='top'>
212
+ <th scope='row'><?php _e('Disallow by category:','yarpp');?></th><td><div style="overflow:auto;max-height:100px;">
213
+ <?php
214
+ $discats = explode(',',yarpp_get_option('discats'));
215
+ array_unshift($discats,' ');
216
+ foreach ($wpdb->get_results("select $wpdb->terms.term_id, name from $wpdb->terms natural join $wpdb->term_taxonomy where $wpdb->term_taxonomy.taxonomy = 'category' order by name") as $cat) {
217
+ echo "<input type='checkbox' name='discats[$cat->term_id]' value='true'". (array_search($cat->term_id,$discats) ? ' checked="checked"': '' )." /> <label>$cat->name</label> ";//for='discats[$cat->term_id]' it's not HTML. :(
218
+ }?>
219
+ </div></td></tr>
220
  <tr valign='top'>
221
  <th scope='row'><?php _e('Disallow by tag:','yarpp');?></th>
222
+ <td><div style="overflow:auto;max-height:100px;">
223
+ <?php
224
+ $distags = explode(',',yarpp_get_option('distags'));
225
+ array_unshift($distags,' ');
226
+ foreach ($wpdb->get_results("select $wpdb->terms.term_id, name from $wpdb->terms natural join $wpdb->term_taxonomy where $wpdb->term_taxonomy.taxonomy = 'post_tag' order by name") as $tag) {
227
+ echo "<input type='checkbox' name='distags[$tag->term_id]' value='true'". (array_search($tag->term_id,$distags) ? ' checked="checked"': '' )." /> <label>$tag->name</label> ";// for='distags[$tag->term_id]'
228
+ }?>
229
+ </div></td></tr>
230
+ <?php checkbox('show_past_post',__("Show password protected posts?",'yarpp')); ?>
231
+ <?php checkbox('past_only',__("Show only previous posts?",'yarpp')); ?>
 
 
 
232
  </tbody>
233
  </table>
 
234
 
235
  <!-- Relatedness -->
 
236
  <h3><?php _e('"Relatedness" options','yarpp');?></h3>
 
237
  <p><?php _e('YARPP is different than the <a href="http://wasabi.pbwiki.com/Related%20Entries">previous plugins it is based on</a> as it limits the related posts list by (1) a maximum number and (2) a <em>match threshold</em>.','yarpp');?> <a href="#" class='info'><?php _e('more&gt;','yarpp');?><span><?php _e('The higher the match threshold, the more restrictive, and you get less related posts overall. The default match threshold is 5. If you want to find an appropriate match threshhold, take a look at some post\'s related posts display and their scores. You can see what kinds of related posts are being picked up and with what kind of match scores, and determine an appropriate threshold for your site.','yarpp');?></span></a></p>
238
 
239
  <table class="form-table" style="margin-top: 0">
251
  <?php checkbox('cross_relate',__("Cross-relate posts and pages?",'yarpp')." <a href='#' class='info'>".__('more&gt;','yarpp')."<span>".__("When the \"Cross-relate posts and pages\" option is selected, the <code>related_posts()</code>, <code>related_pages()</code>, and <code>related_entries()</code> all will give the same output, returning both related pages and posts.",'yarpp')."</span></a>"); ?>
252
  </tbody>
253
  </table>
 
254
 
255
  <script language="javascript">
256
  //<!--
 
 
 
 
 
 
 
 
 
 
257
  function excerpt() {
258
+ display = 'none';
259
+ if (document.getElementsByName('show_excerpt')[0].checked) {
260
+ display = 'table-row';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
261
  }
262
+ document.getElementsByName('excerpted')[0].style.display = display;
263
+ document.getElementsByName('excerpted')[1].style.display = display;
264
  }
265
  function rss_excerpt() {
266
+ display = 'none';
267
+ if (document.getElementsByName('rss_display')[0].checked && document.getElementsByName('rss_show_excerpt')[0].checked) {
268
+ display = 'table-row';
269
+ }
270
+ document.getElementsByName('rss_excerpted')[0].style.display = display;
271
+ document.getElementsByName('rss_excerpted')[1].style.display = display;
272
  }
273
+ function do_rss_display() {
274
+ display = 'none';
275
+ if (document.getElementsByName('rss_display')[0].checked) {
276
+ rss_excerpt();
277
+ display = 'table-row';
278
+ }
279
+ document.getElementsByName('rss_displayed')[0].style.display = display;
280
+ document.getElementsByName('rss_displayed')[1].style.display = display;
281
+ document.getElementsByName('rss_displayed')[2].style.display = display;
282
+ document.getElementsByName('rss_displayed')[3].style.display = display;
283
+ document.getElementsByName('rss_displayed')[4].style.display = display;
284
+ document.getElementsByName('rss_displayed')[5].style.display = display;
285
+ document.getElementsByName('rss_displayed')[6].style.display = display;
286
+ document.getElementsByName('rss_displayed')[7].style.display = display;
 
 
 
 
 
 
 
 
287
  }
 
 
 
288
  //-->
289
  </script>
290
 
291
 
292
  <!-- Display options -->
 
293
  <h3><?php _e("Display options <small>for your website</small>",'yarpp');?></h3>
294
 
295
+ <table class="form-table" style="margin-top: 0">
296
  <?php
297
+ // construct the demo code based on current preferences
298
+
299
+ $democode = stripslashes(yarpp_get_option('before_related',true))."
300
+ ";
301
+ for ($i=1;$i<=yarpp_get_option('limit');$i++) {
302
+ $democode .= stripslashes(yarpp_get_option('before_title',true)).stripslashes(htmlspecialchars("<a href='".__("PERMALINK",'yarpp')."$i'>".__("RELATED TITLE",'yarpp')." $i</a>")).(yarpp_get_option('show_excerpt')?"\r\t".stripslashes(yarpp_get_option('before_post',true)).yarpp_excerpt(LOREMIPSUM,yarpp_get_option('excerpt_length')).stripslashes(yarpp_get_option('before_post',true)):'').stripslashes(yarpp_get_option('after_title',true))."
303
+ ";
304
+ }
305
+ $democode .= stripslashes(yarpp_get_option('after_related',true));
306
+ if (yarpp_get_option('promote_yarpp'))
307
+ $democode .= htmlspecialchars("\n<p>".__("Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.",'yarpp')."</p>");
308
 
309
+ checkbox('auto_display',__("Automatically display related posts?",'yarpp')." <a href='#' class='info'>".__('more&gt;','yarpp')."<span>".__("This option automatically displays related posts right after the content on single entry pages. If this option is off, you will need to manually insert <code>related_posts()</code> or variants (<code>related_pages()</code> and <code>related_entries()</code>) into your theme files.",'yarpp')."</span></a>","<tr valign='top'>
310
+ <th class='th-full' colspan='2' scope='row'>",'','<td rowspan="10" style="border-left:8px white solid;"><b>'.__("Website display code example",'yarpp').'</b><br /><small>'.__("(Update options to reload.)",'yarpp').'</small><br/>'
311
+ ."<code><pre style='overflow:auto;width:350px;'>".($democode)."</pre></code></td>"); ?>
312
  <?php textbox('limit',__('Maximum number of related posts:','yarpp'))?>
313
+ <tr valign='top'>
 
 
 
 
 
 
 
 
 
 
 
314
  <th><?php _e("Before / after related entries:",'yarpp');?></th>
315
  <td><input name="before_related" type="text" id="before_related" value="<?php echo stripslashes(yarpp_get_option('before_related',true)); ?>" size="10" /> / <input name="after_related" type="text" id="after_related" value="<?php echo stripslashes(yarpp_get_option('after_related',true)); ?>" size="10" /><em><small> <?php _e("For example:",'yarpp');?> &lt;ol&gt;&lt;/ol&gt; or &lt;div&gt;&lt;/div&gt;</small></em>
316
  </td>
317
  </tr>
318
+ <tr valign='top'>
319
  <th><?php _e("Before / after each related entry:",'yarpp');?></th>
320
  <td><input name="before_title" type="text" id="before_title" value="<?php echo stripslashes(yarpp_get_option('before_title',true)); ?>" size="10" /> / <input name="after_title" type="text" id="after_title" value="<?php echo stripslashes(yarpp_get_option('after_title',true)); ?>" size="10" /><em><small> <?php _e("For example:",'yarpp');?> &lt;li&gt;&lt;/li&gt; or &lt;dl&gt;&lt;/dl&gt;</small></em>
321
  </td>
322
  </tr>
323
+ <?php checkbox('show_excerpt',__("Show excerpt?",'yarpp'),"<tr valign='top'><th colspan='2'>",' onclick="javascript:excerpt()"'); ?>
324
+ <?php textbox('excerpt_length',__('Excerpt length (No. of words):','yarpp'),null,"<tr name='excerpted' valign='top' ".(yarpp_get_option('show_excerpt')?'':"style='display:none'").">
325
  <th>")?>
326
 
327
+ <tr name="excerpted" valign='top' <?php echo (yarpp_get_option('show_excerpt')?'':"style='display:none'")?>>
328
  <th><?php _e("Before / after (Excerpt):",'yarpp');?></th>
329
  <td><input name="before_post" type="text" id="before_post" value="<?php echo stripslashes(yarpp_get_option('before_post',true)); ?>" size="10" /> / <input name="after_post" type="text" id="after_post" value="<?php echo stripslashes(yarpp_get_option('after_post')); ?>" size="10" /><em><small> <?php _e("For example:",'yarpp');?> &lt;li&gt;&lt;/li&gt; or &lt;dl&gt;&lt;/dl&gt;</small></em>
330
  </td>
331
  </tr>
332
 
333
+ <tr name="excerpted" valign='top'>
334
  <th><?php _e("Order results:",'yarpp');?></th>
335
  <td><select name="order" id="order">
336
  <option value="score DESC" <?php echo (yarpp_get_option('order')=='score DESC'?' selected="selected"':'')?>><?php _e("score (high relevance to low)",'yarpp');?></option>
343
  </td>
344
  </tr>
345
 
346
+ <?php textbox('no_results',__('Default display if no results:','yarpp'),'40')?>
 
347
  <?php checkbox('promote_yarpp',__("Help promote Yet Another Related Posts Plugin?",'yarpp')
348
  ." <a href='#' class='info'>".__('more&gt;','yarpp')."<span>"
349
+ .sprintf(__("This option will add the code %s. Try turning it on, updating your options, and see the code in the code example to the right. These links and donations are greatly appreciated.",'yarpp'),"<code>".htmlspecialchars(__("Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.",'yarpp'))."</code>")
350
+ ."</span></a>"); ?>
351
  </table>
 
352
 
353
  <!-- Display options for RSS -->
354
+ <h3><?php _e("Display options <small>for RSS</small>",'yarpp');?> <span style='color:red;'>NEW!</span></h3>
 
355
 
356
+ <table class="form-table" style="margin-top: 0">
357
  <?php
358
+ // construct the demo code based on current preferences for RSS
359
 
360
+ $democode = stripslashes(yarpp_get_option('rss_before_related',true))."
361
+ ";
362
+ for ($i=1;$i<=yarpp_get_option('rss_limit');$i++) {
363
+ $democode .= stripslashes(yarpp_get_option('rss_before_title',true)).stripslashes(htmlspecialchars("<a href='".__("RELATED TITLE",'yarpp')."$i'>".__("RELATED TITLE",'yarpp')." $i</a>")).(yarpp_get_option('rss_show_excerpt')?"\r\t".stripslashes(yarpp_get_option('rss_before_post',true)).yarpp_excerpt(LOREMIPSUM,yarpp_get_option('rss_excerpt_length')).stripslashes(yarpp_get_option('rss_before_post',true)):'').stripslashes(yarpp_get_option('rss_after_title',true))."
364
+ ";
365
+ }
366
+ $democode .= stripslashes(yarpp_get_option('rss_after_related',true));
367
+ if (yarpp_get_option('rss_promote_yarpp'))
368
+ $democode .= htmlspecialchars("\n<p>".__("Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.",'yarpp')."</p>");
369
+
370
+ checkbox('rss_display',__("Display related posts in feeds?",'yarpp'),"<tr valign='top'><th colspan='3'>",' onclick="javascript:do_rss_display();"');
371
+ checkbox('rss_excerpt_display',__("Display related posts in the descriptions?",'yarpp')." <a href='#' class='info'>".__('more&gt;','yarpp')."<span>".__("This option displays the related posts in the RSS description fields, not just the content. If your feeds are set up to only display excerpts, however, only the description field is used, so this option is required for any display at all.",'yarpp')."</span></a>","<tr name='rss_displayed' valign='top'>
372
+ <th class='th-full' colspan='2' scope='row'>",'','<td rowspan="10" style="border-left:8px white solid;"><b>'.__("RSS display code example",'yarpp').'</b><br /><small>'.__("(Update options to reload.)",'yarpp').'</small><br/>'
373
+ ."<code><pre style='overflow:auto;width:350px;'>".($democode)."</pre></code></td>"); ?>
374
+ <?php textbox('rss_limit',__('Maximum number of related posts:','yarpp'),2,"<tr valign='top' name='rss_displayed'>
375
+ <th scope='row'>")?>
376
+ <tr name='rss_displayed' valign='top'>
377
  <th><?php _e("Before / after related entries display:",'yarpp');?></th>
378
  <td><input name="rss_before_related" type="text" id="rss_before_related" value="<?php echo stripslashes(yarpp_get_option('rss_before_related',true)); ?>" size="10" /> / <input name="rss_after_related" type="text" id="rss_after_related" value="<?php echo stripslashes(yarpp_get_option('rss_after_related',true)); ?>" size="10" /><em><small> <?php _e("For example:",'yarpp');?> &lt;ol&gt;&lt;/ol&gt; or &lt;div&gt;&lt;/div&gt;</small></em>
379
  </td>
380
  </tr>
381
+ <tr name='rss_displayed' valign='top'>
382
  <th><?php _e("Before / after each related entry:",'yarpp');?></th>
383
  <td><input name="rss_before_title" type="text" id="rss_before_title" value="<?php echo stripslashes(yarpp_get_option('rss_before_title',true)); ?>" size="10" /> / <input name="rss_after_title" type="text" id="rss_after_title" value="<?php echo stripslashes(yarpp_get_option('rss_after_title',true)); ?>" size="10" /><em><small> <?php _e("For example:",'yarpp');?> &lt;li&gt;&lt;/li&gt; or &lt;dl&gt;&lt;/dl&gt;</small></em>
384
  </td>
385
  </tr>
386
+ <?php checkbox('rss_show_excerpt',__("Show excerpt?",'yarpp'),"<tr name='rss_displayed' valign='top'><th colspan='2'>",' onclick="javascript:rss_excerpt()"'); ?>
387
+ <?php textbox('rss_excerpt_length',__('Excerpt length (No. of words):','yarpp'),null,"<tr name='rss_excerpted' valign='top' ".(yarpp_get_option('rss_show_excerpt')?'':"style='display:none'").">
388
  <th>")?>
389
 
390
+ <tr name="rss_excerpted" valign='top' <?php echo (yarpp_get_option('rss_show_excerpt')?'':"style='display:none'")?>>
391
  <th><?php _e("Before / after (excerpt):",'yarpp');?></th>
392
  <td><input name="rss_before_post" type="text" id="rss_before_post" value="<?php echo stripslashes(yarpp_get_option('rss_before_post',true)); ?>" size="10" /> / <input name="rss_after_post" type="text" id="rss_after_post" value="<?php echo stripslashes(yarpp_get_option('rss_after_post')); ?>" size="10" /><em><small> <?php _e("For example:",'yarpp');?> &lt;li&gt;&lt;/li&gt; or &lt;dl&gt;&lt;/dl&gt;</small></em>
393
  </td>
394
  </tr>
395
 
396
+ <tr name='rss_displayed' valign='top'>
397
  <th><?php _e("Order results:",'yarpp');?></th>
398
  <td><select name="rss_order" id="rss_order">
399
  <option value="score DESC" <?php echo (yarpp_get_option('rss_order')=='score DESC'?' selected="selected"':'')?>><?php _e("score (high relevance to low)",'yarpp');?></option>
406
  </td>
407
  </tr>
408
 
409
+ <?php textbox('rss_no_results',__('Default display if no results:','yarpp'),'40',"<tr valign='top' name='rss_displayed'>
410
  <th scope='row'>")?>
411
  <?php checkbox('rss_promote_yarpp',__("Help promote Yet Another Related Posts Plugin?",'yarpp')." <a href='#' class='info'>".__('more&gt;','yarpp')."<span>"
412
+ .sprintf(__("This option will add the code %s. Try turning it on, updating your options, and see the code in the code example to the right. These links and donations are greatly appreciated."),"<code>".htmlspecialchars(__("Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.",'yarpp'))."</code>")
413
+ ."</span></a>","<tr valign='top' name='rss_displayed'>
414
  <th class='th-full' colspan='2' scope='row'>"); ?>
415
  </table>
 
416
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
417
  <div>
418
  <p class="submit">
419
  <input type="submit" name="update_yarpp" value="<?php _e("Update options",'yarpp')?>" />
readme.txt CHANGED
@@ -15,12 +15,13 @@ Returns a list of the related entries based on a unique algorithm using titles,
15
 
16
  Yet Another Related Posts Plugin (YARPP) gives you a list of posts and/or pages related to the current entry, introducing the reader to other relevant content on your site. Key features include:
17
 
18
- 1. *An advanced and versatile algorithm*: Using a customizable algorithm considering post titles, content, tags, and categories, YARPP calculates a "match score" for each pair of posts on your blog. You choose the threshold limit for relevance and you get more related posts if there are more related posts and less if there are less.
19
- 2. *Templating*: **New in 3.0!** A new [templating system](http://mitcho.com/blog/projects/yarpp-3-templatesyarpp-3-templates/) puts you in charge of how your posts are displayed.
20
- 3. *Caching*: **New in 3.0!** YARPP now caches the related posts for all the posts and thus has significantly improved performance over versions 2.x.
21
- 4. *Related posts in RSS feeds*: **New in 2.1!** Display related posts in your RSS and Atom feeds with custom display options.
22
- 5. *Disallowing certain tags or categories*: **New in 2.0!** You can choose certain tags or categories as disallowed, meaning any page or post with such tags or categories will not be served up by the plugin.
23
- 6. *Related posts and pages*: **New in 1.1!** Puts you in control of pulling up related posts, pages, or both.
 
24
 
25
  == Installation ==
26
 
@@ -232,5 +233,6 @@ If you are a bilingual speaker of English and another language and an avid user
232
 
233
  The following feature requests have been made and may be incorporated into a future release. If you have a bug fix, please start a new thread on [the Wordpress.org forums](http://wordpress.org/tags/yet-another-related-posts-plugin).
234
 
 
235
  * More localizations
236
- * Sentece-aware excerpts, [by request](http://wordpress.org/support/topic/162465)
15
 
16
  Yet Another Related Posts Plugin (YARPP) gives you a list of posts and/or pages related to the current entry, introducing the reader to other relevant content on your site. Key features include:
17
 
18
+ 1. *Limiting by a threshold*: Peter Bowyer did the great work of making the algorithm use MySQL's [fulltext search](http://dev.mysql.com/doc/en/Fulltext_Search.html) score to identify related posts. But it just displayed, for example, the top 5 most "relevant" entries, even if some of them weren't at all relevant. Now you can set a threshold limit for relevance, and you get more related posts if there are more related posts and less if there are less. Ha!
19
+ 2. *Using tags and categories*: **New in 2.0!** The new 2.0 algorithm uses tags and categories. The new options screen puts you in control of how these factors should be used.
20
+ 3. *Related posts in RSS feeds*: **New in 2.1!** Display related posts in your RSS and Atom feeds with custom display options.
21
+ 4. *Disallowing certain tags or categories*: **New in 2.0!** You can choose certain tags or categories as disallowed, meaning any page or post with such tags or categories will not be served up by the plugin.
22
+ 5. *Related posts and pages*: **New in 1.1!** Puts you in control of pulling up related posts, pages, or both.
23
+ 6. *Simple installation*: **New in 1.5!** Automatically displays related posts after content on single entry pages without any theme tinkering.
24
+ 7. *Miscellany*: a nicer options screen (including a sample display of the code that is produced **New in 2.0**), displaying the fulltext match score on output for admins, an option to allow related posts from the future, a couple bug fixes, etc.
25
 
26
  == Installation ==
27
 
233
 
234
  The following feature requests have been made and may be incorporated into a future release. If you have a bug fix, please start a new thread on [the Wordpress.org forums](http://wordpress.org/tags/yet-another-related-posts-plugin).
235
 
236
+ * More customizeable displays so that you can, for example, add the date and comment count in the excerpt ([by request](http://wordpress.org/support/topic/156231))
237
  * More localizations
238
+ * Sentece-aware excerpts, [by request](http://wordpress.org/support/topic/162465)
related-functions.php CHANGED
@@ -4,28 +4,28 @@
4
 
5
  // Since YARPP 2.1, these functions receive (optionally) one array argument. See the documentation for instructions on how to customize their output.
6
 
7
- function related_posts($a = array(),$echo=true,$reference_ID=false) {
8
- return yarpp_related(array('post'),$a,$echo,$reference_ID);
9
  }
10
 
11
- function related_pages($a = array(),$echo=true,$reference_ID=false) {
12
- return yarpp_related(array('page'),$a,$echo,$reference_ID);
13
  }
14
 
15
- function related_entries($a = array(),$echo=true,$reference_ID=false) {
16
- return yarpp_related(array('page','post'),$a,$echo,$reference_ID);
17
  }
18
 
19
- function related_posts_exist($a = array(),$reference_ID=false) {
20
- return yarpp_related_exist(array('post'),$a,$reference_ID);
21
  }
22
 
23
- function related_pages_exist($a = array(),$reference_ID=false) {
24
- return yarpp_related_exist(array('page'),$a,$reference_ID);
25
  }
26
 
27
- function related_entries_exist($a = array(),$reference_ID=false) {
28
- return yarpp_related_exist(array('page','post'),$a,$reference_ID);
29
  }
30
 
31
  ?>
4
 
5
  // Since YARPP 2.1, these functions receive (optionally) one array argument. See the documentation for instructions on how to customize their output.
6
 
7
+ function related_posts($a = array(),$echo=true) {
8
+ return yarpp_related(array('post'),$a,$echo);
9
  }
10
 
11
+ function related_pages($a = array(),$echo=true) {
12
+ return yarpp_related(array('page'),$a,$echo);
13
  }
14
 
15
+ function related_entries($a = array(),$echo=true) {
16
+ return yarpp_related(array('page','post'),$a,$echo);
17
  }
18
 
19
+ function related_posts_exist($a = array()) {
20
+ return yarpp_related_exist(array('post'),$a);
21
  }
22
 
23
+ function related_pages_exist($a = array()) {
24
+ return yarpp_related_exist(array('page'),$a);
25
  }
26
 
27
+ function related_entries_exist($a = array()) {
28
+ return yarpp_related_exist(array('page','post'),$a);
29
  }
30
 
31
  ?>
services.php DELETED
@@ -1,93 +0,0 @@
1
- <?php
2
-
3
- // setup the ajax action hooks
4
- if (function_exists('add_action')) {
5
- add_action('wp_ajax_yarpp_display_discats', 'yarpp_ajax_display_discats');
6
- add_action('wp_ajax_yarpp_display_distags', 'yarpp_ajax_display_distags');
7
- add_action('wp_ajax_yarpp_display_demo_web', 'yarpp_ajax_display_demo_web');
8
- add_action('wp_ajax_yarpp_display_demo_rss', 'yarpp_ajax_display_demo_rss');
9
- add_action('wp_ajax_yarpp_build_cache_action', 'yarpp_build_cache');
10
- }
11
-
12
- function yarpp_ajax_display_discats() {
13
- global $wpdb;
14
- $discats = explode(',',yarpp_get_option('discats'));
15
- array_unshift($discats,' ');
16
- foreach ($wpdb->get_results("select $wpdb->terms.term_id, name from $wpdb->terms natural join $wpdb->term_taxonomy where $wpdb->term_taxonomy.taxonomy = 'category' order by name") as $cat) {
17
- echo "<input type='checkbox' name='discats[$cat->term_id]' value='true'". (array_search($cat->term_id,$discats) ? ' checked="checked"': '' )." /> <label>$cat->name</label> ";//for='discats[$cat->term_id]' it's not HTML. :(
18
- }
19
- exit;
20
- }
21
-
22
- function yarpp_ajax_display_distags() {
23
- global $wpdb;
24
- $distags = explode(',',yarpp_get_option('distags'));
25
- array_unshift($distags,' ');
26
- foreach ($wpdb->get_results("select $wpdb->terms.term_id, name from $wpdb->terms natural join $wpdb->term_taxonomy where $wpdb->term_taxonomy.taxonomy = 'post_tag' order by name") as $tag) {
27
- echo "<input type='checkbox' name='distags[$tag->term_id]' value='true'". (array_search($tag->term_id,$distags) ? ' checked="checked"': '' )." /> <label>$tag->name</label> ";// for='distags[$tag->term_id]'
28
- }
29
- exit;
30
- }
31
-
32
- function yarpp_ajax_display_demo_web() {
33
- global $wpdb, $post, $userdata, $yarpp_demo_time, $wp_query, $id, $page, $pages, $yarpp_limit;
34
-
35
- header("Content-Type: text/html; charset=UTF-8");
36
-
37
- $yarpp_limit = yarpp_get_option('limit');
38
- $return = yarpp_related(array('post'),array(),false,false,'demo_web');
39
- unset($yarpp_limit);
40
- echo ereg_replace("[\n\r]",'',nl2br(htmlspecialchars($return)));
41
- exit;
42
- }
43
-
44
- function yarpp_ajax_display_demo_rss() {
45
- global $wpdb, $post, $userdata, $yarpp_demo_time, $wp_query, $id, $page, $pages, $yarpp_limit;
46
-
47
- header("Content-Type: text/html; charset=utf-8");
48
-
49
- $yarpp_limit = yarpp_get_option('rss_limit');
50
- $return = yarpp_related(array('post'),array(),false,false,'demo_rss');
51
- unset($yarpp_limit);
52
- echo ereg_replace("[\n\r]",'',nl2br(htmlspecialchars($return)));
53
- exit;
54
- }
55
-
56
- function yarpp_build_cache() {
57
- global $wpdb;
58
- if (!is_user_logged_in() || !current_user_can('level_10')) {
59
- wp_die(__('You cannot rebuild the YARPP cache.', 'yarpp'));
60
- }
61
-
62
- if (!$_POST['i']) {
63
- $id = $wpdb->get_var("select min(ID), count(ID) from $wpdb->posts where post_status = 'publish'",0);
64
- $i = 1;
65
- $m = $wpdb->get_var(null,1);
66
- } else {
67
- $id = $_POST['id'];
68
- $i = $_POST['i'];
69
- $m = $_POST['m'];
70
- }
71
-
72
- $timeout = 2; // seconds
73
- $start = yarpp_microtime_float();
74
- while ((yarpp_microtime_float() - $start) < $timeout and $i <= $m) {
75
- $result = yarpp_cache_enforce(array('post'),$id,true);
76
-
77
- if (!$result) {
78
- header('Content-Type: application/json');
79
- echo "{result:'error',id: '$id', title: '".addslashes($title)."', i: $i, m: $m, percent: '".(floor(1000 * $i/$m)/10)."'}";
80
- exit();
81
- }
82
-
83
- $id = $wpdb->get_var("select ID, post_title from $wpdb->posts where ID > $id and post_status = 'publish' order by ID asc limit 1",0);
84
- $title = $wpdb->get_var(null,1);
85
- $i++;
86
- }
87
-
88
- header('Content-Type: application/json');
89
- echo "{result:'success',time:'".(yarpp_microtime_float() - $start)."', id: '$id', title: '".addslashes($title)."', i: $i, m: $m, percent: '".(floor(1000 * $i/$m)/10)."'}";
90
- exit();
91
- }
92
-
93
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
template-builtin.php DELETED
@@ -1,46 +0,0 @@
1
- <?php /*
2
- YARPP's built-in "template"
3
-
4
- This "template" is used when you choose not to use a template.
5
-
6
- If you want to create a new template, look at templates/template-example.php as an example.
7
- */
8
-
9
- $options = array(
10
- 'before_title'=>"${domainprefix}before_title",
11
- 'after_title'=>"${domainprefix}after_title",
12
- 'show_excerpt'=>"${domainprefix}show_excerpt",
13
- 'excerpt_length'=>"${domainprefix}excerpt_length",
14
- 'before_post'=>"${domainprefix}before_post",
15
- 'after_post'=>"${domainprefix}after_post",
16
- 'before_related'=>"${domainprefix}before_related",
17
- 'after_related'=>"${domainprefix}after_related",
18
- 'no_results'=>"${domainprefix}no_results");
19
- $optvals = array();
20
- foreach (array_keys($options) as $option) {
21
- if (isset($args[$option])) {
22
- $optvals[$option] = stripslashes($args[$option]);
23
- } else {
24
- $optvals[$option] = stripslashes(stripslashes(yarpp_get_option($options[$option])));
25
- }
26
- }
27
- extract($optvals);
28
-
29
- if ($related_query->have_posts()) {
30
- while ($related_query->have_posts()) {
31
- $related_query->the_post();
32
-
33
- $output .= "$before_title<a href='".get_permalink()."' rel='bookmark' title='Permanent Link: ".get_the_title()."'>".get_the_title()."";
34
- if ($userdata->user_level >= 8 and $domain != 'rss')
35
- $output .= ' <abbr title="'.sprintf(__('%f is the YARPP match score between the current entry and this related entry. You are seeing this value because you are logged in to WordPress as an administrator. It is not shown to regular visitors.','yarpp'),round(get_the_score(),3)).'">('.round(get_the_score(),3).')</abbr>';
36
- $output .= '</a>';
37
- if ($show_excerpt) {
38
- $output .= $before_post . yarpp_excerpt(get_the_excerpt(),$excerpt_length) . $after_post;
39
- }
40
- $output .= $after_title;
41
-
42
- }
43
- $output = stripslashes(stripslashes($before_related)).$output.stripslashes(stripslashes($after_related));
44
- } else {
45
- $output = $no_results;
46
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
template-functions.php DELETED
@@ -1,13 +0,0 @@
1
- <?php
2
-
3
- // two YARPP-specific Template Tags, to be used in the YARPP-template Loop.
4
-
5
- function the_score() {
6
- echo get_the_score();
7
- }
8
-
9
- function get_the_score() { // returns the score
10
- global $post;
11
- $score = $post->score;
12
- return apply_filters('get_the_score', $score, $d, $gmt);
13
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
template-metabox.php DELETED
@@ -1,28 +0,0 @@
1
- <?php
2
-
3
- yarpp_save_cache($reference_ID,false); // enforce the cache, but don't force it
4
-
5
- $body_terms = yarpp_get_cached_keywords($reference_ID,'body');
6
- $title_terms = yarpp_get_cached_keywords($reference_ID,'title');
7
-
8
- if ($yarpp_debug) $output .= "<p>last updated keywords: ".$wpdb->get_var("select date from {$wpdb->prefix}yarpp_keyword_cache where ID = '$reference_ID'")."</p>";
9
- if ($yarpp_debug) $output .= "<p>body keywords: $body_terms</p>";
10
- if ($yarpp_debug) $output .= "<p>title keywords: $title_terms</p>";
11
-
12
- $output .= '<p>'.__( 'These are the related entries for this entry. Updating this post may change these related posts.' , 'yarpp').'</p>';
13
-
14
- if ($yarpp_debug) $output .= "<p>last updated: ".$wpdb->get_var("select max(date) as updated from {$wpdb->prefix}yarpp_related_cache where reference_ID = '$reference_ID'")."</p>";
15
-
16
- if ($related_query->have_posts()) {
17
- $output .= '<ol>';
18
- while ($related_query->have_posts()) {
19
- $related_query->the_post();
20
- $output .= "<li><a href='post.php?action=edit&post=$id'>".get_the_title()."</a>"; // FIXME: what if it's a page?
21
- $output .= ' ('.round(get_the_score(),3).')';
22
- $output .= '</li>';
23
- }
24
- $output .= '</ol>';
25
- $output .= '<p>'.__( 'Whether all of these related entries are actually displayed and how they are displayed depends on your YARPP display options.' , 'yarpp').'</p>';
26
- } else {
27
- $output .= '<p><em>'.__('No related posts.').'</em></p>';
28
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
yarpp-templates/yarpp-template-example.php DELETED
@@ -1,14 +0,0 @@
1
- <?php /*
2
- Example template
3
- Author: mitcho (Michael Yoshitaka Erlewine)
4
- */
5
- ?><h3>Related Posts</h3>
6
- <?php if ($related_query->have_posts()):?>
7
- <ol>
8
- <?php while ($related_query->have_posts()) : $related_query->the_post(); ?>
9
- <li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a><!-- (<?php the_score(); ?>)--></li>
10
- <?php endwhile; ?>
11
- </ol>
12
- <?php else: ?>
13
- <p>No related posts.</p>
14
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
yarpp-templates/yarpp-template-list.php DELETED
@@ -1,19 +0,0 @@
1
- <?php /*
2
- List template
3
- This template returns the related posts as a comma-separated list.
4
- Author: mitcho (Michael Yoshitaka Erlewine)
5
- */
6
- ?><h3>Related Posts</h3>
7
-
8
- <?php if ($related_query->have_posts()):
9
- $postsArray = array();
10
- while ($related_query->have_posts()) : $related_query->the_post();
11
- $postsArray[] = '<a href="'.get_permalink().'" rel="bookmark">'.get_the_title().'</a><!-- ('.get_the_score().')-->';
12
- endwhile;
13
-
14
- echo implode(', '."\n",$postsArray); // print out a list of the related items, separated by commas
15
-
16
- else:?>
17
-
18
- <p>No related posts.</p>
19
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
yarpp-templates/yarpp-template-photoblog.php DELETED
@@ -1,17 +0,0 @@
1
- <?php /*
2
- Example photoblog template for use with Yet Another Photoblog
3
- Author: mitcho (Michael Yoshitaka Erlewine)
4
- */ ?>
5
- <h3>Related Photos</h3>
6
- <?php if ($related_query->have_posts()):?>
7
- <ol>
8
- <?php while ($related_query->have_posts()) : $related_query->the_post(); ?>
9
- <?php if (function_exists('yapb_is_photoblog_post')): if (yapb_is_photoblog_post()):?>
10
- <li><a href="<?php the_permalink() ?>" rel="bookmark"><?php yapb_get_thumbnail(); ?></a></li>
11
- <?php endif; endif; ?>
12
- <?php endwhile; ?>
13
- </ol>
14
-
15
- <?php else: ?>
16
- <p>No related photos.</p>
17
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
yarpp-templates/yarpp-template-random.php DELETED
@@ -1,18 +0,0 @@
1
- <?php /*
2
- Example template: random
3
- This template gives you some random other post in case there are no related posts
4
- Author: mitcho (Michael Yoshitaka Erlewine)
5
- */ ?>
6
- <h3>Related Posts</h3>
7
- <?php if ($related_query->have_posts()):?>
8
- <ol>
9
- <?php while ($related_query->have_posts()) : $related_query->the_post(); ?>
10
- <li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a><!-- (<?php the_score(); ?>)--></li>
11
- <?php endwhile; ?>
12
- </ol>
13
-
14
- <?php else:
15
- $related_query->query("orderby=rand&order=asc&limit=1");
16
- $related_query->the_post();?>
17
- <p>No related posts were found, so here's a consolation prize: <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a>.</p>
18
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
yarpp.php CHANGED
@@ -3,14 +3,13 @@
3
  Plugin Name: Yet Another Related Posts Plugin
4
  Plugin URI: http://mitcho.com/code/yarpp/
5
  Description: Returns a list of the related entries based on a unique algorithm using titles, post bodies, tags, and categories. Now with RSS feed support!
6
- Version: 3.0b7
7
  Author: mitcho (Michael Yoshitaka Erlewine)
8
  Author URI: http://mitcho.com/
9
  */
10
 
11
  require_once('includes.php');
12
  require_once('related-functions.php');
13
- require_once('template-functions.php');
14
 
15
  add_action('admin_menu','yarpp_admin_menu');
16
  add_action('admin_print_scripts','yarpp_upgrade_check');
@@ -23,27 +22,5 @@ load_plugin_textdomain('yarpp', PLUGINDIR.'/'.dirname(plugin_basename(__FILE__))
23
 
24
  // new in 2.0: add as a widget
25
  add_action('plugins_loaded', 'widget_yarpp_init');
26
- // new in 3.0: add meta box
27
- add_action( 'admin_menu', 'yarpp_add_metabox');
28
- function yarpp_add_metabox() {
29
- add_meta_box( __( 'Related Posts' , 'yarpp'), __( 'Related Posts' , 'yarpp'), 'yarpp_metabox', 'post', 'normal' );
30
- }
31
- function yarpp_metabox() {
32
- global $post;
33
- echo '<div id="yarpp-related-posts">';
34
- if ($post->ID)
35
- yarpp_related(array('post'),array('limit'=>1000),true,false,'metabox');
36
- else
37
- echo "<p>Related entries may be displayed once you save your entry.</p>";
38
- echo '</div>';
39
- }
40
 
41
- add_action('save_post','yarpp_save_cache');
42
-
43
- add_filter('posts_join','yarpp_join_filter');
44
- add_filter('posts_where','yarpp_where_filter');
45
- add_filter('posts_orderby','yarpp_orderby_filter');
46
- add_filter('posts_fields','yarpp_fields_filter');
47
- add_filter('posts_request','yarpp_demo_request_filter');
48
- add_filter('post_limits','yarpp_limit_filter');
49
- add_action('parse_query','yarpp_set_score_override_flag'); // sets the score override flag.
3
  Plugin Name: Yet Another Related Posts Plugin
4
  Plugin URI: http://mitcho.com/code/yarpp/
5
  Description: Returns a list of the related entries based on a unique algorithm using titles, post bodies, tags, and categories. Now with RSS feed support!
6
+ Version: 2.1.6
7
  Author: mitcho (Michael Yoshitaka Erlewine)
8
  Author URI: http://mitcho.com/
9
  */
10
 
11
  require_once('includes.php');
12
  require_once('related-functions.php');
 
13
 
14
  add_action('admin_menu','yarpp_admin_menu');
15
  add_action('admin_print_scripts','yarpp_upgrade_check');
22
 
23
  // new in 2.0: add as a widget
24
  add_action('plugins_loaded', 'widget_yarpp_init');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
 
26
+ ?>