Yet Another Related Posts Plugin (YARPP) - Version 3.4.2

Version Description

  • Bugfix: 3.4 and 3.4.1 assumed existence of wp_posts table.
  • Fix typo in yarpp-template-random.php example template file
  • Improve compatibility with DB Cache Reloaded plugin which doesn't properly implement set_charset method.
Download this release

Release Info

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

Code changes from version 3.4.4b3 to 3.4.2

cache-postmeta.php CHANGED
@@ -28,11 +28,11 @@ class YARPP_Cache_Postmeta extends YARPP_Cache {
28
}
29
30
public function upgrade( $last_version ) {
31
if ( $last_version && version_compare('3.4b1', $last_version) > 0 ) {
32
// 3.4 moved _yarpp_body_keywords and _yarpp_title_keywords into the single
33
// postmeta _yarpp_keywords, so clear out the old data now.
34
- delete_post_meta_by_key('_yarpp_title_keywords');
35
- delete_post_meta_by_key('_yarpp_body_keywords');
36
}
37
}
38
@@ -58,6 +58,7 @@ class YARPP_Cache_Postmeta extends YARPP_Cache {
58
*/
59
public function where_filter($arg) {
60
global $wpdb;
61
// modify the where clause to use the related ID list.
62
if (!count($this->related_IDs))
63
$this->related_IDs = array(0);
@@ -92,6 +93,7 @@ class YARPP_Cache_Postmeta extends YARPP_Cache {
92
}
93
94
public function limit_filter($arg) {
95
if ($this->online_limit)
96
return " limit {$this->online_limit} ";
97
return $arg;
@@ -105,7 +107,7 @@ class YARPP_Cache_Postmeta extends YARPP_Cache {
105
// get the related posts from postmeta, and also construct the relate_IDs array
106
$this->related_postdata = get_post_meta($reference_ID,YARPP_POSTMETA_RELATED_KEY,true);
107
if (is_array($this->related_postdata) && count($this->related_postdata))
108
- $this->related_IDs = wp_list_pluck( $this->related_postdata, 'ID' );
109
add_filter('posts_where',array(&$this,'where_filter'));
110
add_filter('posts_orderby',array(&$this,'orderby_filter'));
111
add_filter('posts_fields',array(&$this,'fields_filter'));
@@ -147,7 +149,6 @@ class YARPP_Cache_Postmeta extends YARPP_Cache {
147
// clear each cache
148
foreach($reference_ID as $id) {
149
delete_post_meta( $id, YARPP_POSTMETA_RELATED_KEY );
150
- delete_post_meta( $id, YARPP_POSTMETA_KEYWORDS_KEY );
151
}
152
}
153
@@ -161,7 +162,7 @@ class YARPP_Cache_Postmeta extends YARPP_Cache {
161
162
$original_related = $this->related($reference_ID);
163
$related = $wpdb->get_results($this->sql($reference_ID), ARRAY_A);
164
- $new_related = wp_list_pluck( $related, 'ID' );
165
166
if ( count($new_related) ) {
167
update_post_meta($reference_ID, YARPP_POSTMETA_RELATED_KEY, $related);
@@ -186,8 +187,8 @@ class YARPP_Cache_Postmeta extends YARPP_Cache {
186
}
187
188
public function flush() {
189
- delete_post_meta_by_key( YARPP_POSTMETA_RELATED_KEY );
190
- delete_post_meta_by_key( YARPP_POSTMETA_KEYWORDS_KEY );
191
}
192
193
public function related($reference_ID = null, $related_ID = null) {
@@ -212,7 +213,7 @@ class YARPP_Cache_Postmeta extends YARPP_Cache {
212
$results = get_post_meta($reference_ID,YARPP_POSTMETA_RELATED_KEY,true);
213
if (!$results || $results == YARPP_NO_RELATED)
214
return array();
215
- return wp_list_pluck( $results, 'ID' );
216
}
217
218
// return a list of entities which list this post as "related"
28
}
29
30
public function upgrade( $last_version ) {
31
+ global $wpdb;
32
if ( $last_version && version_compare('3.4b1', $last_version) > 0 ) {
33
// 3.4 moved _yarpp_body_keywords and _yarpp_title_keywords into the single
34
// postmeta _yarpp_keywords, so clear out the old data now.
35
+ $wpdb->query("delete from {$wpdb->postmeta} where (meta_key = '_yarpp_title_keywords' or meta_key = '_yarpp_body_keywords')");
36
}
37
}
38
58
*/
59
public function where_filter($arg) {
60
global $wpdb;
61
+ $threshold = yarpp_get_option('threshold');
62
// modify the where clause to use the related ID list.
63
if (!count($this->related_IDs))
64
$this->related_IDs = array(0);
93
}
94
95
public function limit_filter($arg) {
96
+ global $wpdb;
97
if ($this->online_limit)
98
return " limit {$this->online_limit} ";
99
return $arg;
107
// get the related posts from postmeta, and also construct the relate_IDs array
108
$this->related_postdata = get_post_meta($reference_ID,YARPP_POSTMETA_RELATED_KEY,true);
109
if (is_array($this->related_postdata) && count($this->related_postdata))
110
+ $this->related_IDs = array_map(create_function('$x','return $x["ID"];'), $this->related_postdata);
111
add_filter('posts_where',array(&$this,'where_filter'));
112
add_filter('posts_orderby',array(&$this,'orderby_filter'));
113
add_filter('posts_fields',array(&$this,'fields_filter'));
149
// clear each cache
150
foreach($reference_ID as $id) {
151
delete_post_meta( $id, YARPP_POSTMETA_RELATED_KEY );
152
}
153
}
154
162
163
$original_related = $this->related($reference_ID);
164
$related = $wpdb->get_results($this->sql($reference_ID), ARRAY_A);
165
+ $new_related = array_map(create_function('$x','return $x["ID"];'), $related);
166
167
if ( count($new_related) ) {
168
update_post_meta($reference_ID, YARPP_POSTMETA_RELATED_KEY, $related);
187
}
188
189
public function flush() {
190
+ global $wpdb;
191
+ return $wpdb->query("delete from `{$wpdb->postmeta}` where meta_key = '" . YARPP_POSTMETA_RELATED_KEY . "'");
192
}
193
194
public function related($reference_ID = null, $related_ID = null) {
213
$results = get_post_meta($reference_ID,YARPP_POSTMETA_RELATED_KEY,true);
214
if (!$results || $results == YARPP_NO_RELATED)
215
return array();
216
+ return array_map(create_function('$x','return $x["ID"];'), $results);
217
}
218
219
// return a list of entities which list this post as "related"
cache-tables.php CHANGED
@@ -19,8 +19,8 @@ class YARPP_Cache_Tables extends YARPP_Cache {
19
global $wpdb;
20
// now check for the cache tables
21
$tabledata = $wpdb->get_col("show tables");
22
- if (in_array($wpdb->prefix . YARPP_TABLES_RELATED_TABLE,$tabledata) !== false &&
23
- in_array($wpdb->prefix . YARPP_TABLES_KEYWORDS_TABLE,$tabledata) !== false)
24
return true;
25
else
26
return false;
@@ -173,13 +173,10 @@ class YARPP_Cache_Tables extends YARPP_Cache {
173
174
public function clear($reference_ID) {
175
global $wpdb;
176
- if (is_array($reference_ID) && count($reference_ID)) {
177
$wpdb->query("delete from {$wpdb->prefix}" . YARPP_TABLES_RELATED_TABLE . " where reference_ID in (".implode(',',$reference_ID).")");
178
- $wpdb->query("delete from {$wpdb->prefix}" . YARPP_TABLES_KEYWORDS_TABLE . " where ID in (".implode(',',$reference_ID).")");
179
- } else if (is_int($reference_ID)) {
180
$wpdb->query("delete from {$wpdb->prefix}" . YARPP_TABLES_RELATED_TABLE . " where reference_ID = {$reference_ID}");
181
- $wpdb->query("delete from {$wpdb->prefix}" . YARPP_TABLES_KEYWORDS_TABLE . " where ID = {$reference_ID}");
182
- }
183
}
184
185
// @return YARPP_RELATED | YARPP_NO_RELATED | YARPP_NOT_CACHED
@@ -190,12 +187,10 @@ class YARPP_Cache_Tables extends YARPP_Cache {
190
if ( !$reference_ID = absint($reference_ID) )
191
return YARPP_NOT_CACHED;
192
193
- $original_related = (array) @$this->related($reference_ID);
194
195
- if ( count($original_related) ) {
196
- // clear out the cruft
197
- $this->clear($reference_ID);
198
- }
199
200
$wpdb->query("insert into {$wpdb->prefix}" . YARPP_TABLES_RELATED_TABLE . " (reference_ID,ID,score) " . $this->sql($reference_ID) . " on duplicate key update date = now()");
201
@@ -206,7 +201,7 @@ class YARPP_Cache_Tables extends YARPP_Cache {
206
if ($this->core->debug) echo "<!--YARPP just set the cache for post $reference_ID-->";
207
208
// Clear the caches of any items which are no longer related or are newly related.
209
- if ( count($original_related) ) {
210
$this->clear(array_diff($original_related, $new_related));
211
$this->clear(array_diff($new_related, $original_related));
212
}
@@ -246,12 +241,12 @@ class YARPP_Cache_Tables extends YARPP_Cache {
246
}
247
248
// return a list of ID's of "related" entries
249
- if ( !is_null($reference_ID) ) {
250
return $wpdb->get_col("select distinct ID from {$wpdb->prefix}" . YARPP_TABLES_RELATED_TABLE . " where reference_ID = $reference_ID and ID != 0");
251
}
252
253
// return a list of entities which list this post as "related"
254
- if ( !is_null($related_ID) ) {
255
return $wpdb->get_col("select distinct reference_ID from {$wpdb->prefix}" . YARPP_TABLES_RELATED_TABLE . " where ID = $related_ID");
256
}
257
19
global $wpdb;
20
// now check for the cache tables
21
$tabledata = $wpdb->get_col("show tables");
22
+ if (array_search($wpdb->prefix . YARPP_TABLES_RELATED_TABLE,$tabledata) !== false &&
23
+ array_search($wpdb->prefix . YARPP_TABLES_KEYWORDS_TABLE,$tabledata) !== false)
24
return true;
25
else
26
return false;
173
174
public function clear($reference_ID) {
175
global $wpdb;
176
+ if (is_array($reference_ID) && count($reference_ID))
177
$wpdb->query("delete from {$wpdb->prefix}" . YARPP_TABLES_RELATED_TABLE . " where reference_ID in (".implode(',',$reference_ID).")");
178
+ else if (is_int($reference_ID))
179
$wpdb->query("delete from {$wpdb->prefix}" . YARPP_TABLES_RELATED_TABLE . " where reference_ID = {$reference_ID}");
180
}
181
182
// @return YARPP_RELATED | YARPP_NO_RELATED | YARPP_NOT_CACHED
187
if ( !$reference_ID = absint($reference_ID) )
188
return YARPP_NOT_CACHED;
189
190
+ $original_related = $this->related($reference_ID);
191
192
+ // clear out the cruft
193
+ $this->clear($reference_ID);
194
195
$wpdb->query("insert into {$wpdb->prefix}" . YARPP_TABLES_RELATED_TABLE . " (reference_ID,ID,score) " . $this->sql($reference_ID) . " on duplicate key update date = now()");
196
201
if ($this->core->debug) echo "<!--YARPP just set the cache for post $reference_ID-->";
202
203
// Clear the caches of any items which are no longer related or are newly related.
204
+ if (count($original_related)) {
205
$this->clear(array_diff($original_related, $new_related));
206
$this->clear(array_diff($new_related, $original_related));
207
}
241
}
242
243
// return a list of ID's of "related" entries
244
+ if (!is_null($reference_ID)) {
245
return $wpdb->get_col("select distinct ID from {$wpdb->prefix}" . YARPP_TABLES_RELATED_TABLE . " where reference_ID = $reference_ID and ID != 0");
246
}
247
248
// return a list of entities which list this post as "related"
249
+ if (!is_null($related_ID)) {
250
return $wpdb->get_col("select distinct reference_ID from {$wpdb->prefix}" . YARPP_TABLES_RELATED_TABLE . " where ID = $related_ID");
251
}
252
class-admin.php CHANGED
@@ -3,7 +3,7 @@
3
class YARPP_Admin {
4
public $core;
5
public $hook;
6
-
7
function __construct( &$core ) {
8
$this->core = &$core;
9
@@ -21,19 +21,6 @@ class YARPP_Admin {
21
add_filter( 'default_hidden_meta_boxes', array( $this, 'default_hidden_meta_boxes' ), 10, 2 );
22
}
23
24
- private $templates = null;
25
- public function get_templates() {
26
- if ( is_null($this->templates) ) {
27
- $this->templates = glob(STYLESHEETPATH . '/yarpp-template-*.php');
28
- // if glob hits an error, it returns false.
29
- if ( $this->templates === false )
30
- $this->templates = array();
31
- // get basenames only
32
- $this->templates = array_map('basename', $this->templates);
33
- }
34
- return (array) $this->templates;
35
- }
36
-
37
function ajax_register() {
38
// Register AJAX services
39
if ( defined('DOING_AJAX') && DOING_AJAX ) {
@@ -90,10 +77,8 @@ class YARPP_Admin {
90
$content .= '<p>' . str_replace('<a>', '<a href="' . esc_url(admin_url('options-general.php?page=yarpp')) .'">', __('Make sure to visit the <a>Related Posts settings page</a> to customize YARPP.', 'yarpp') ). '</p>';
91
?>
92
<script>
93
- jQuery(function () {
94
- var body = jQuery(document.body),
95
- menu = jQuery('#menu-settings'),
96
- collapse = jQuery('#collapse-menu'),
97
yarpp = menu.find("a[href='options-general.php?page=yarpp']"),
98
options = {
99
content: '<?php echo $content; ?>',
@@ -104,13 +89,13 @@ jQuery(function () {
104
},
105
close: function() {
106
menu.unbind('mouseenter mouseleave', yarpp_pointer);
107
- collapse.unbind('mouseenter mouseleave', yarpp_pointer);
108
}};
109
110
if ( !yarpp.length )
111
return;
112
113
- body.pointer(options).pointer('open');
114
115
if ( menu.is('.folded *') || !menu.is('.wp-menu-open') ) {
116
function yarpp_pointer(e) {
@@ -119,11 +104,11 @@ jQuery(function () {
119
options.position.of = yarpp;
120
else
121
options.position.of = menu;
122
- body.pointer( options );
123
}, 200);
124
}
125
menu.bind('mouseenter mouseleave', yarpp_pointer);
126
- collapse.bind('mouseenter mouseleave', yarpp_pointer);
127
}
128
});
129
</script>
@@ -188,13 +173,16 @@ jQuery(function () {
188
header("HTTP/1.1 200");
189
header("Content-Type: text/html; charset=UTF-8");
190
191
- $exclude_tt_ids = wp_parse_id_list(yarpp_get_option('exclude'));
192
- $exclude_term_ids = $this->get_term_ids_from_tt_ids( $taxonomy, $exclude_tt_ids );
193
- // if ( 'category' == $taxonomy )
194
- // $exclude .= ',' . get_option( 'default_category' );
195
196
$terms = get_terms($taxonomy, array(
197
- 'exclude' => $exclude_term_ids,
198
'hide_empty' => false,
199
'hierarchical' => false,
200
'number' => 100,
@@ -207,19 +195,11 @@ jQuery(function () {
207
}
208
209
foreach ($terms as $term) {
210
- echo "<span><input type='checkbox' name='exclude[{$term->term_taxonomy_id}]' id='exclude_{$term->term_taxonomy_id}' value='true' /> <label for='exclude_{$term->term_taxonomy_id}'>" . esc_html($term->name) . "</label></span> ";
211
}
212
exit;
213
}
214
215
- function get_term_ids_from_tt_ids( $taxonomy, $tt_ids ) {
216
- global $wpdb;
217
- $tt_ids = wp_parse_id_list($tt_ids);
218
- if ( empty($tt_ids) )
219
- return array();
220
- return $wpdb->get_col("select term_id from $wpdb->term_taxonomy where taxonomy = '{$taxonomy}' and term_taxonomy_id in (" . join(',', $tt_ids) . ")");
221
- }
222
-
223
function ajax_display() {
224
check_ajax_referer( 'yarpp_display' );
225
3
class YARPP_Admin {
4
public $core;
5
public $hook;
6
+
7
function __construct( &$core ) {
8
$this->core = &$core;
9
21
add_filter( 'default_hidden_meta_boxes', array( $this, 'default_hidden_meta_boxes' ), 10, 2 );
22
}
23
24
function ajax_register() {
25
// Register AJAX services
26
if ( defined('DOING_AJAX') && DOING_AJAX ) {
77
$content .= '<p>' . str_replace('<a>', '<a href="' . esc_url(admin_url('options-general.php?page=yarpp')) .'">', __('Make sure to visit the <a>Related Posts settings page</a> to customize YARPP.', 'yarpp') ). '</p>';
78
?>
79
<script>
80
+ jQuery(function ($) {
81
+ var menu = $('#menu-settings'),
82
yarpp = menu.find("a[href='options-general.php?page=yarpp']"),
83
options = {
84
content: '<?php echo $content; ?>',
89
},
90
close: function() {
91
menu.unbind('mouseenter mouseleave', yarpp_pointer);
92
+ $('#collapse-menu').('mouseenter mouseleave', yarpp_pointer);
93
}};
94
95
if ( !yarpp.length )
96
return;
97
98
+ yarpp.pointer(options).pointer('open');
99
100
if ( menu.is('.folded *') || !menu.is('.wp-menu-open') ) {
101
function yarpp_pointer(e) {
104
options.position.of = yarpp;
105
else
106
options.position.of = menu;
107
+ yarpp.pointer( options );
108
}, 200);
109
}
110
menu.bind('mouseenter mouseleave', yarpp_pointer);
111
+ $('#collapse-menu').bind('mouseenter mouseleave', yarpp_pointer);
112
}
113
});
114
</script>
173
header("HTTP/1.1 200");
174
header("Content-Type: text/html; charset=UTF-8");
175
176
+ $exclude = yarpp_get_option('exclude');
177
+ if ( isset($exclude[$taxonomy]) )
178
+ $exclude = $exclude[$taxonomy];
179
+ else
180
+ $exclude = array();
181
+ if ( 'category' == $taxonomy )
182
+ $exclude .= ',' . get_option( 'default_category' );
183
184
$terms = get_terms($taxonomy, array(
185
+ 'exclude' => $exclude,
186
'hide_empty' => false,
187
'hierarchical' => false,
188
'number' => 100,
195
}
196
197
foreach ($terms as $term) {
198
+ echo "<span><input type='checkbox' name='exclude[{$taxonomy}][{$term->term_id}]' id='exclude_{$taxonomy}_{$term->term_id}' value='true' /> <label for='exclude_{$taxonomy}_{$term->term_id}'>" . esc_html($term->name) . "</label></span> ";
199
}
200
exit;
201
}
202
203
function ajax_display() {
204
check_ajax_referer( 'yarpp_display' );
205
class-cache.php CHANGED
@@ -134,7 +134,7 @@ abstract class YARPP_Cache {
134
* SQL!
135
*/
136
137
- protected function sql( $reference_ID = false, $args = array() ) {
138
global $wpdb, $post;
139
140
if ( is_object($post) && !$reference_ID ) {
@@ -147,7 +147,7 @@ abstract class YARPP_Cache {
147
$reference_post = $post;
148
}
149
150
- $options = array( 'threshold', 'show_pass_post', 'past_only', 'weight', 'require_tax', 'exclude', 'recent_only', 'recent_number', 'recent_units', 'limit' );
151
extract( $this->core->parse_args($args, $options) );
152
// The maximum number of items we'll ever want to cache
153
$limit = max($limit, $this->core->get_option('rss_limit'));
@@ -160,23 +160,32 @@ abstract class YARPP_Cache {
160
161
$newsql .= 'ROUND(0';
162
163
- if ((int) @$weight['body'])
164
- $newsql .= " + (MATCH (post_content) AGAINST ('".$wpdb->escape($keywords['body'])."')) * ". absint($weight['body']);
165
- if ((int) @$weight['title'])
166
- $newsql .= " + (MATCH (post_title) AGAINST ('".$wpdb->escape($keywords['title'])."')) * ". absint($weight['title']);
167
168
// Build tax criteria query parts based on the weights
169
- foreach ( $weight['tax'] as $tax => $weight ) {
170
- $newsql .= " + " . $this->tax_criteria($reference_ID, $tax) . " * " . intval($weight);
171
}
172
173
$newsql .= ',1) as score';
174
175
$newsql .= "\n from $wpdb->posts \n";
176
177
- $exclude_tt_ids = wp_parse_id_list( $exclude );
178
- if ( count($exclude_tt_ids) || count($weight['tax']) || count($require_tax) ) {
179
- $newsql .= "left join $wpdb->term_relationships as terms on ( terms.object_id = $wpdb->posts.ID ) \n";
180
}
181
182
// WHERE
@@ -199,43 +208,29 @@ abstract class YARPP_Cache {
199
// number_format fix suggested by vkovalcik! :)
200
$safethreshold = number_format(max($threshold,0.1), 2, '.', '');
201
$newsql .= " having score >= $safethreshold";
202
- if ( count($exclude_tt_ids) ) {
203
- $newsql .= " and bit_or(terms.term_taxonomy_id in (" . join(',', $exclude_tt_ids) . ")) = 0";
204
}
205
206
- foreach ( $require_tax as $tax => $number ) {
207
- $newsql .= ' and ' . $this->tax_criteria($reference_ID, $tax) . ' >= ' . intval($number);
208
}
209
210
$newsql .= " order by score desc limit $limit";
211
212
- if ( isset($args['post_type']) && is_array($args['post_type']) )
213
- $post_types = $args['post_type'];
214
- else
215
- $post_types = $this->core->get_post_types( 'name' );
216
-
217
- $queries = array();
218
- foreach ( $post_types as $post_type ) {
219
- $queries[] = '(' . str_replace("post_type = 'post'", "post_type = '{$post_type}'", $newsql) . ')';
220
- }
221
- $sql = implode( ' union ', $queries );
222
223
- if ($this->core->debug) echo "<!--$sql-->";
224
225
- $this->last_sql = $sql;
226
-
227
- return $sql;
228
- }
229
-
230
- private function tax_criteria( $reference_ID, $taxonomy ) {
231
- // @todo maybe reinforce the object term cache?
232
- $terms = get_the_terms( $reference_ID, $taxonomy );
233
- // if there are no terms of that tax
234
- if ( false === $terms )
235
- return '(1 = 0)';
236
237
- $tt_ids = wp_list_pluck($terms, 'term_taxonomy_id');
238
- return "count(distinct if( terms.term_taxonomy_id in (" . join(',',$tt_ids) . "), terms.term_taxonomy_id, null ))";
239
}
240
241
/**
@@ -346,8 +341,9 @@ abstract class YARPP_Cache {
346
}
347
}
348
// Remove words which are only a letter
349
foreach (array_keys($tokens) as $word) {
350
- if ( function_exists('mb_strlen') )
351
if (mb_strlen($word) < 2) unset($tokens[$word]);
352
else
353
if (strlen($word) < 2) unset($tokens[$word]);
@@ -478,14 +474,15 @@ class YARPP_Cache_Bypass extends YARPP_Cache {
478
*/
479
public function where_filter($arg) {
480
global $wpdb;
481
// modify the where clause to use the related ID list.
482
if (!count($this->related_IDs))
483
$this->related_IDs = array(0);
484
$arg = preg_replace("!{$wpdb->posts}.ID = \d+!","{$wpdb->posts}.ID in (".join(',',$this->related_IDs).")",$arg);
485
486
// if we have "recent only" set, add an additional condition
487
- if ($this->args["recent_only"])
488
- $arg .= " and post_date > date_sub(now(), interval {$this->args['recent_number']} {$this->args['recent_units']}) ";
489
return $arg;
490
}
491
@@ -537,11 +534,9 @@ class YARPP_Cache_Bypass extends YARPP_Cache {
537
global $wpdb;
538
539
$this->yarpp_time = true;
540
- $options = array( 'threshold', 'show_pass_post', 'past_only', 'weight', 'require_tax', 'exclude', 'recent_only', 'recent_number', 'recent_units', 'limit' );
541
- $this->args = $this->core->parse_args($args, $options);
542
543
$this->related_postdata = $wpdb->get_results($this->sql($reference_ID, $args), ARRAY_A);
544
- $this->related_IDs = wp_list_pluck( $this->related_postdata, 'ID' );
545
546
add_filter('posts_where',array(&$this,'where_filter'));
547
add_filter('posts_orderby',array(&$this,'orderby_filter'));
@@ -603,12 +598,16 @@ class YARPP_Cache_Bypass extends YARPP_Cache {
603
$results = $wpdb->get_results($this->sql($reference_ID), ARRAY_A);
604
if ( !$results || !count($results) )
605
return false;
606
-
607
- $results_ids = wp_list_pluck( $results, 'ID' );
608
if ( is_null($related_ID) ) {
609
- return $results_ids;
610
} else {
611
- return in_array( $related_ID, $results_ids );
612
}
613
}
614
}
134
* SQL!
135
*/
136
137
+ function sql( $reference_ID = false, $args = array() ) {
138
global $wpdb, $post;
139
140
if ( is_object($post) && !$reference_ID ) {
147
$reference_post = $post;
148
}
149
150
+ $options = array( 'threshold', 'show_pass_post', 'past_only', 'weight', 'exclude', 'recent_only', 'recent_number', 'recent_units', 'limit' );
151
extract( $this->core->parse_args($args, $options) );
152
// The maximum number of items we'll ever want to cache
153
$limit = max($limit, $this->core->get_option('rss_limit'));
160
161
$newsql .= 'ROUND(0';
162
163
+ if ($weight['body'] != 1)
164
+ $newsql .= " + (MATCH (post_content) AGAINST ('".$wpdb->escape($keywords['body'])."')) * ". ($weight['body'] == 3 ? 3 : 1);
165
+ if ($weight['title'] != 1)
166
+ $newsql .= " + (MATCH (post_title) AGAINST ('".$wpdb->escape($keywords['title'])."')) * ". ($weight['title'] == 3 ? 3 : 1);
167
168
// Build tax criteria query parts based on the weights
169
+ $tax_criteria = array();
170
+ foreach ( $weight['tax'] as $tax => $value ) {
171
+ // 1 means don't consider:
172
+ if ($value == 1)
173
+ continue;
174
+ $tax_criteria[$tax] = "count(distinct if( termtax.taxonomy = '$tax', refterms.term_taxonomy_id, null ))";
175
+ $newsql .= " + " . $tax_criteria[$tax];
176
}
177
178
$newsql .= ',1) as score';
179
180
$newsql .= "\n from $wpdb->posts \n";
181
182
+ // Get disallowed categories and tags
183
+ $disterms = wp_parse_id_list(join(',',$exclude));
184
+ $usedisterms = count($disterms);
185
+ if ( $usedisterms || count($tax_criteria) ) {
186
+ $newsql .= "left join $wpdb->term_relationships as terms on ( terms.object_id = $wpdb->posts.ID ) \n"
187
+ . "left join $wpdb->term_taxonomy as termtax on ( terms.term_taxonomy_id = termtax.term_taxonomy_id ) \n"
188
+ . "left join $wpdb->term_relationships as refterms on ( terms.term_taxonomy_id = refterms.term_taxonomy_id and refterms.object_id = $reference_ID ) \n";
189
}
190
191
// WHERE
208
// number_format fix suggested by vkovalcik! :)
209
$safethreshold = number_format(max($threshold,0.1), 2, '.', '');
210
$newsql .= " having score >= $safethreshold";
211
+ if ( $usedisterms ) {
212
+ $disterms = implode(',', $disterms);
213
+ $newsql .= " and bit_or(termtax.term_id in ($disterms)) = 0";
214
}
215
216
+ foreach ( $weight['tax'] as $tax => $value ) {
217
+ if ( $value == 3 )
218
+ $newsql .= ' and '.$tax_criteria[$tax].' >= 1';
219
+ if ( $value == 4 )
220
+ $newsql .= ' and '.$tax_criteria[$tax].' >= 2';
221
}
222
223
$newsql .= " order by score desc limit $limit";
224
225
+ // in caching, we cross-relate regardless of whether we're going to actually
226
+ // use it or not.
227
+ $newsql = "($newsql) union (".str_replace("post_type = 'post'","post_type = 'page'",$newsql).")";
228
229
+ if ($this->core->debug) echo "<!--$newsql-->";
230
231
+ $this->last_sql = $newsql;
232
233
+ return $newsql;
234
}
235
236
/**
341
}
342
}
343
// Remove words which are only a letter
344
+ $mb_strlen_exists = function_exists('mb_strlen');
345
foreach (array_keys($tokens) as $word) {
346
+ if ($mb_strlen_exists)
347
if (mb_strlen($word) < 2) unset($tokens[$word]);
348
else
349
if (strlen($word) < 2) unset($tokens[$word]);
474
*/
475
public function where_filter($arg) {
476
global $wpdb;
477
+ $threshold = yarpp_get_option('threshold');
478
// modify the where clause to use the related ID list.
479
if (!count($this->related_IDs))
480
$this->related_IDs = array(0);
481
$arg = preg_replace("!{$wpdb->posts}.ID = \d+!","{$wpdb->posts}.ID in (".join(',',$this->related_IDs).")",$arg);
482
483
// if we have "recent only" set, add an additional condition
484
+ if (yarpp_get_option("recent_only"))
485
+ $arg .= " and post_date > date_sub(now(), interval ".yarpp_get_option("recent_number")." ".yarpp_get_option("recent_units").") ";
486
return $arg;
487
}
488
534
global $wpdb;
535
536
$this->yarpp_time = true;
537
538
$this->related_postdata = $wpdb->get_results($this->sql($reference_ID, $args), ARRAY_A);
539
+ $this->related_IDs = array_map(create_function('$x','return $x["ID"];'), $this->related_postdata);
540
541
add_filter('posts_where',array(&$this,'where_filter'));
542
add_filter('posts_orderby',array(&$this,'orderby_filter'));
598
$results = $wpdb->get_results($this->sql($reference_ID), ARRAY_A);
599
if ( !$results || !count($results) )
600
return false;
601
+
602
if ( is_null($related_ID) ) {
603
+ return array_map(create_function('$x','return $x["ID"];'), $results);
604
} else {
605
+ foreach($results as $result) {
606
+ if ($result['ID'] == $related_ID)
607
+ return true;
608
+ }
609
}
610
+
611
+ return false;
612
}
613
}
class-core.php CHANGED
@@ -14,8 +14,12 @@ class YARPP {
14
15
public $myisam = true;
16
17
// 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.
18
public $default_options = array();
19
20
function __construct() {
21
$this->load_default_options();
@@ -62,6 +66,7 @@ class YARPP {
62
$this->default_options = array(
63
'threshold' => 5,
64
'limit' => 5,
65
'excerpt_length' => 10,
66
'recent_number' => 12,
67
'recent_units' => 'month',
@@ -74,6 +79,7 @@ class YARPP {
74
'no_results' => '<p>'.__('No related posts.','yarpp').'</p>',
75
'order' => 'score DESC',
76
'rss_limit' => 3,
77
'rss_excerpt_length' => 10,
78
'rss_before_title' => '<li>',
79
'rss_after_title' => '</li>',
@@ -85,14 +91,10 @@ class YARPP {
85
'rss_order' => 'score DESC',
86
'past_only' => true,
87
'show_excerpt' => false,
88
- 'rss_show_excerpt' => false,
89
'recent_only' => false, // new in 3.0
90
- //'use_template' => false, // new in 2.2
91
- //'rss_use_template' => false, // new in 2.2
92
- //'template_file' => '', // new in 2.2
93
- //'rss_template_file' => '', // new in 2.2
94
- 'template' => false, // new in 3.4.4
95
- 'rss_template' => false, // new in 3.4.4
96
'show_pass_post' => false,
97
'cross_relate' => false,
98
'auto_display' => true,
@@ -101,16 +103,15 @@ class YARPP {
101
'promote_yarpp' => false,
102
'rss_promote_yarpp' => false,
103
'myisam_override' => false,
104
- 'exclude' => '', // conslidated YARPP 3.4 and further in 3.4.4
105
- 'weight' => array( // consolidated in YARPP 3.4, format changed in 3.4.4
106
- 'title' => 1,
107
- 'body' => 1,
108
'tax' => array(
109
- 'category' => 1, // changed default in 3.4
110
- 'post_tag' => 1
111
)
112
- ),
113
- 'require_tax' => array() // new in 3.4.4
114
);
115
}
116
@@ -118,24 +119,17 @@ class YARPP {
118
$current_options = $this->get_option();
119
120
// we can call yarpp_set_option(key,value) if we like:
121
- if ( !is_array($options) ) {
122
- if ( isset($value) )
123
- $options = array( $options => $value );
124
- else
125
- return false;
126
- }
127
128
$new_options = array_merge( $current_options, $options );
129
130
// new in 3.1: clear cache when updating certain settings.
131
- $clear_cache_options = array( 'show_pass_post', 'recent_only', 'threshold' );
132
- $new_options_which_require_flush = array_intersect( array_keys( array_diff_assoc($options, $current_options) ), $clear_cache_options );
133
if ( count($new_options_which_require_flush) ||
134
- ( $new_options['limit'] > $current_options['limit'] ) ||
135
- ( $new_options['weight'] != $current_options['weight'] ) ||
136
- ( $new_options['exclude'] != $current_options['exclude'] ) ||
137
- ( $new_options['require_tax'] != $current_options['require_tax'] ) )
138
- $this->cache->flush();
139
140
update_option( 'yarpp', $new_options );
141
}
@@ -145,7 +139,18 @@ class YARPP {
145
$options = (array) get_option( 'yarpp', array() );
146
// ensure defaults if not set:
147
$options = array_merge( $this->default_options, $options );
148
-
149
if ( is_null( $option ) )
150
return $options;
151
@@ -239,10 +244,6 @@ class YARPP {
239
$this->upgrade_3_4b5();
240
if ( $last_version && version_compare('3.4b8', $last_version) > 0 )
241
$this->upgrade_3_4b8();
242
- if ( $last_version && version_compare('3.4.4b2', $last_version) > 0 )
243
- $this->upgrade_3_4_4b2();
244
- if ( $last_version && version_compare('3.4.4b3', $last_version) > 0 )
245
- $this->upgrade_3_4_4b3();
246
247
$this->cache->upgrade($last_version);
248
// flush cache in 3.4.1b5 as 3.4 messed up calculations.
@@ -355,11 +356,11 @@ class YARPP {
355
function upgrade_3_4b8() {
356
$options = $this->get_option();
357
$options['weight'] = array(
358
- 'title' => (int) @$options['title'],
359
- 'body' => (int) @$options['body'],
360
'tax' => array(
361
- 'post_tag' => (int) @$options['tags'],
362
- 'category' => (int) @$options['categories'],
363
)
364
);
365
@@ -377,96 +378,24 @@ class YARPP {
377
update_option( 'yarpp', $options );
378
}
379
380
- function upgrade_3_4_4b2() {
381
- $options = $this->get_option();
382
-
383
- // update weight values; split out tax weights into weight[tax] and require_tax
384
- $weight_map = array( 2 => 1, 3 => YARPP_EXTRA_WEIGHT );
385
- if ((int) $options['weight']['title'] == 1)
386
- unset( $options['weight']['title'] );
387
- else
388
- $options['weight']['title'] = $weight_map[(int) $options['weight']['title']];
389
-
390
- if ((int) $options['weight']['body'] == 1)
391
- unset( $options['weight']['body'] );
392
- else
393
- $options['weight']['body'] = $weight_map[(int) $options['weight']['body']];
394
-
395
- $options['require_tax'] = array();
396
- foreach ( $options['weight']['tax'] as $tax => $value ) {
397
- if ( $value == 3 )
398
- $options['require_tax'][$tax] = 1;
399
- if ( $value == 4 )
400
- $options['require_tax'][$tax] = 2;
401
-
402
- if ( $value > 1 )
403
- $options['weight']['tax'][$tax] = 1;
404
- else
405
- unset( $options['weight']['tax'][$tax] );
406
- }
407
-
408
- // consolidate excludes, using tt_ids.
409
- $exclude_tt_ids = array();
410
- foreach ($options['exclude'] as $tax => $term_ids) {
411
- if ( !empty($term_ids) )
412
- $exclude_tt_ids = array_merge( wp_list_pluck(get_terms( $tax, array('include' => $term_ids) ), 'term_taxonomy_id'), $exclude_tt_ids );
413
- }
414
- $options['exclude'] = join(',', $exclude_tt_ids);
415
-
416
- update_option( 'yarpp', $options );
417
}
418
419
- function upgrade_3_4_4b3() {
420
- $options = $this->get_option();
421
- $options['template'] = $options['use_template'] ? $options['template_file'] : false;
422
- $options['rss_template'] = $options['rss_use_template'] ? $options['rss_template_file'] : false;
423
- unset( $options['use_template'] );
424
- unset( $options['template_file'] );
425
- unset( $options['rss_use_template'] );
426
- unset( $options['rss_template_file'] );
427
- update_option( 'yarpp', $options );
428
- }
429
-
430
- private $post_types = null;
431
- function get_post_types( $field = false ) {
432
- if ( is_null($this->post_types) ) {
433
- $this->post_types = get_post_types(array(), 'objects');
434
- $this->post_types = array_filter( $this->post_types, array($this, 'post_type_filter') );
435
- }
436
-
437
- if ( $field )
438
- return wp_list_pluck( $this->post_types, $field );
439
- return $this->post_types;
440
- }
441
-
442
- private function post_type_filter( $post_type ) {
443
- if ( $post_type->_builtin && $post_type->show_ui )
444
- return true;
445
- if ( isset($post_type->yarpp_support) )
446
- return $post_type->yarpp_support;
447
- return false;
448
- }
449
-
450
- private $taxonomies = null;
451
- function get_taxonomies( $field = false ) {
452
- if ( is_null($this->post_types) ) {
453
- $this->taxonomies = get_taxonomies(array(), 'objects');
454
- $this->taxonomies = array_filter( $this->taxonomies, array($this, 'taxonomy_filter') );
455
- }
456
-
457
- if ( $field )
458
- return wp_list_pluck( $this->taxonomies, $field );
459
- return $this->taxonomies;
460
}
461
462
private function taxonomy_filter( $taxonomy ) {
463
- if ( !count(array_intersect( $taxonomy->object_type, $this->get_post_types( 'name' ) )) )
464
return false;
465
-
466
- // if yarpp_support is set, follow that; otherwise include if show_ui is true
467
- if ( isset($taxonomy->yarpp_support) )
468
- return $taxonomy->yarpp_support;
469
- return $taxonomy->show_ui;
470
}
471
472
/*
@@ -494,7 +423,7 @@ class YARPP {
494
495
$this->setup_active_cache( $args );
496
497
- $options = array( 'domain', 'limit', 'template', 'order', 'promote_yarpp' );
498
extract( $this->parse_args( $args, $options ) );
499
500
$cache_status = $this->active_cache->enforce($reference_ID);
@@ -524,21 +453,21 @@ class YARPP {
524
'orderby' => $orders[0],
525
'order' => $orders[1],
526
'showposts' => $limit,
527
- 'post_type' => ( isset($args['post_type']) ? $args['post_type'] : $this->get_post_types( 'name' ) )
528
));
529
}
530
$this->prep_query( $current_query->is_feed );
531
$related_query = $wp_query; // backwards compatibility
532
533
- if ( 'metabox' == $domain ) {
534
include(YARPP_DIR.'/template-metabox.php');
535
- } elseif ( !!$template && file_exists(STYLESHEETPATH . '/' . $template) ) {
536
global $post;
537
ob_start();
538
- include(STYLESHEETPATH . '/' . $template);
539
$output = ob_get_contents();
540
ob_end_clean();
541
- } elseif ( 'widget' == $domain ) {
542
include(YARPP_DIR.'/template-widget.php');
543
} else {
544
include(YARPP_DIR.'/template-builtin.php');
@@ -596,7 +525,7 @@ class YARPP {
596
'orderby' => $orders[0],
597
'order' => $orders[1],
598
'showposts' => $limit,
599
- 'post_type' => ( isset($args['post_type']) ? $args['post_type'] : $this->get_post_types( 'name' ) )
600
));
601
$this->active_cache->end_yarpp_time(); // YARPP time is over... :(
602
@@ -629,7 +558,7 @@ class YARPP {
629
$related_query->query(array(
630
'p' => $reference_ID,
631
'showposts' => 1,
632
- 'post_type' => ( isset($args['post_type']) ? $args['post_type'] : $this->get_post_types( 'name' ) )
633
));
634
$return = $related_query->have_posts();
635
unset($related_query);
@@ -648,7 +577,7 @@ class YARPP {
648
if ( $this->cache_bypass->demo_time ) // if we're already in a demo YARPP loop, stop now.
649
return false;
650
651
- $options = array( 'domain', 'limit', 'template', 'order', 'promote_yarpp' );
652
extract( $this->parse_args( $args, $options ) );
653
654
$this->cache_bypass->begin_demo_time( $limit );
@@ -660,10 +589,10 @@ class YARPP {
660
$this->prep_query( $domain == 'rss' );
661
$related_query = $wp_query; // backwards compatibility
662
663
- if ( !!$template && file_exists(STYLESHEETPATH . '/' . $template) ) {
664
global $post;
665
ob_start();
666
- include(STYLESHEETPATH . '/' . $template);
667
$output = ob_get_contents();
668
ob_end_clean();
669
} else {
@@ -681,7 +610,7 @@ class YARPP {
681
}
682
683
public function parse_args( $args, $options ) {
684
- $options_with_rss_variants = array( 'limit', 'template', 'excerpt_length', 'before_title', 'after_title', 'before_post', 'after_post', 'before_related', 'after_related', 'no_results', 'order' );
685
686
$r = array();
687
foreach ( $options as $option ) {
@@ -702,7 +631,7 @@ class YARPP {
702
703
private function setup_active_cache( $args ) {
704
// the options which the main sql query cares about:
705
- $magic_options = array( 'limit', 'threshold', 'show_pass_post', 'past_only', 'weight', 'exclude', 'require_tax', 'recent_only', 'recent_number', 'recent_units' );
706
707
$defaults = $this->get_option();
708
foreach ( $magic_options as $option ) {
14
15
public $myisam = true;
16
17
+ public $templates = array();
18
+
19
// 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.
20
public $default_options = array();
21
+ // These are options which, when updated, will trigger a clearing of the cache
22
+ public $clear_cache_options = array( 'show_pass_post', 'recent_only', 'threshold', 'weight');
23
24
function __construct() {
25
$this->load_default_options();
66
$this->default_options = array(
67
'threshold' => 5,
68
'limit' => 5,
69
+ 'template_file' => '', // new in 2.2
70
'excerpt_length' => 10,
71
'recent_number' => 12,
72
'recent_units' => 'month',
79
'no_results' => '<p>'.__('No related posts.','yarpp').'</p>',
80
'order' => 'score DESC',
81
'rss_limit' => 3,
82
+ 'rss_template_file' => '', // new in 2.2
83
'rss_excerpt_length' => 10,
84
'rss_before_title' => '<li>',
85
'rss_after_title' => '</li>',
91
'rss_order' => 'score DESC',
92
'past_only' => true,
93
'show_excerpt' => false,
94
'recent_only' => false, // new in 3.0
95
+ 'use_template' => false, // new in 2.2
96
+ 'rss_show_excerpt' => false,
97
+ 'rss_use_template' => false, // new in 2.2
98
'show_pass_post' => false,
99
'cross_relate' => false,
100
'auto_display' => true,
103
'promote_yarpp' => false,
104
'rss_promote_yarpp' => false,
105
'myisam_override' => false,
106
+ 'exclude' => array(), // conslidated YARPP 3.4
107
+ 'weight' => array( // consolidated in YARPP 3.4
108
+ 'title' => 2,
109
+ 'body' => 2,
110
'tax' => array(
111
+ 'category' => 2, // changed default in 3.4
112
+ 'post_tag' => 2
113
)
114
+ )
115
);
116
}
117
119
$current_options = $this->get_option();
120
121
// we can call yarpp_set_option(key,value) if we like:
122
+ if ( !is_array($options) && isset($value) )
123
+ $options = array( $options => $value );
124
125
$new_options = array_merge( $current_options, $options );
126
127
// new in 3.1: clear cache when updating certain settings.
128
+ $new_options_which_require_flush = array_intersect( array_keys( array_diff_assoc($options, $current_options) ), $this->clear_cache_options );
129
if ( count($new_options_which_require_flush) ||
130
+ ( isset($options['exclude']) && $options['exclude'] != $current_options['exclude'] ) ||
131
+ ( isset($options['weight']) && $options['weight'] != $current_options['weight'] ) )
132
+ $this->cache->flush();
133
134
update_option( 'yarpp', $new_options );
135
}
139
$options = (array) get_option( 'yarpp', array() );
140
// ensure defaults if not set:
141
$options = array_merge( $this->default_options, $options );
142
+ // some extra work is required for arrays:
143
+ foreach ( $this->default_options as $key => $default ) {
144
+ if ( !is_array($default) )
145
+ continue;
146
+ if ( isset($options[$key]) && is_array($options[$key]) )
147
+ $options[$key] = array_merge( $this->default_options[$key], (array) $options[$key] );
148
+ else
149
+ $options[$key] = $this->default_options[$key];
150
+ }
151
+ if ( !isset($options['weight']['tax']) )
152
+ $options['weight']['tax'] = $this->default_options['weight']['tax'];
153
+
154
if ( is_null( $option ) )
155
return $options;
156
244
$this->upgrade_3_4b5();
245
if ( $last_version && version_compare('3.4b8', $last_version) > 0 )
246
$this->upgrade_3_4b8();
247
248
$this->cache->upgrade($last_version);
249
// flush cache in 3.4.1b5 as 3.4 messed up calculations.
356
function upgrade_3_4b8() {
357
$options = $this->get_option();
358
$options['weight'] = array(
359
+ 'title' => (int) $options['title'],
360
+ 'body' => (int) $options['body'],
361
'tax' => array(
362
+ 'post_tag' => (int) $options['tags'],
363
+ 'category' => (int) $options['categories'],
364
)
365
);
366
378
update_option( 'yarpp', $options );
379
}
380
381
+ // @todo: custom post type support
382
+ function get_post_types() {
383
+ return array('post', 'page');
384
}
385
386
+ function get_taxonomies() {
387
+ $taxonomies = get_taxonomies(array(), 'objects');
388
+ return array_filter( $taxonomies, array($this, 'taxonomy_filter') );
389
}
390
391
private function taxonomy_filter( $taxonomy ) {
392
+ // if yarpp_support is set and false, or if show_ui is false, skip it
393
+ if ( (isset($taxonomy->yarpp_support) && !$taxonomy->yarpp_support) ||
394
+ !$taxonomy->show_ui )
395
return false;
396
+ if ( !count(array_intersect( $taxonomy->object_type, $this->get_post_types() )) )
397
+ return false;
398
+ return true;
399
}
400
401
/*
423
424
$this->setup_active_cache( $args );
425
426
+ $options = array( 'domain', 'limit', 'use_template', 'order', 'template_file', 'promote_yarpp' );
427
extract( $this->parse_args( $args, $options ) );
428
429
$cache_status = $this->active_cache->enforce($reference_ID);
453
'orderby' => $orders[0],
454
'order' => $orders[1],
455
'showposts' => $limit,
456
+ 'post_type' => ( isset($args['post_type']) ? $args['post_type'] : $this->get_post_types() )
457
));
458
}
459
$this->prep_query( $current_query->is_feed );
460
$related_query = $wp_query; // backwards compatibility
461
462
+ if ($domain == 'metabox') {
463
include(YARPP_DIR.'/template-metabox.php');
464
+ } elseif ($use_template && file_exists(STYLESHEETPATH . '/' . $template_file) && $template_file != '') {
465
global $post;
466
ob_start();
467
+ include(STYLESHEETPATH . '/' . $template_file);
468
$output = ob_get_contents();
469
ob_end_clean();
470
+ } elseif ($domain == 'widget') {
471
include(YARPP_DIR.'/template-widget.php');
472
} else {
473
include(YARPP_DIR.'/template-builtin.php');
525
'orderby' => $orders[0],
526
'order' => $orders[1],
527
'showposts' => $limit,
528
+ 'post_type' => ( isset($args['post_type']) ? $args['post_type'] : $this->get_post_types() )
529
));
530
$this->active_cache->end_yarpp_time(); // YARPP time is over... :(
531
558
$related_query->query(array(
559
'p' => $reference_ID,
560
'showposts' => 1,
561
+ 'post_type' => ( isset($args['post_type']) ? $args['post_type'] : $this->get_post_types() )
562
));
563
$return = $related_query->have_posts();
564
unset($related_query);
577
if ( $this->cache_bypass->demo_time ) // if we're already in a demo YARPP loop, stop now.
578
return false;
579
580
+ $options = array( 'domain', 'limit', 'use_template', 'order', 'template_file', 'promote_yarpp' );
581
extract( $this->parse_args( $args, $options ) );
582
583
$this->cache_bypass->begin_demo_time( $limit );
589
$this->prep_query( $domain == 'rss' );
590
$related_query = $wp_query; // backwards compatibility
591
592
+ if ($use_template && file_exists(STYLESHEETPATH . '/' . $template_file) && $template_file != '') {
593
global $post;
594
ob_start();
595
+ include(STYLESHEETPATH . '/' . $template_file);
596
$output = ob_get_contents();
597
ob_end_clean();
598
} else {
610
}
611
612
public function parse_args( $args, $options ) {
613
+ $options_with_rss_variants = array( 'limit', 'template_file', 'excerpt_length', 'before_title', 'after_title', 'before_post', 'after_post', 'before_related', 'after_related', 'no_results', 'order' );
614
615
$r = array();
616
foreach ( $options as $option ) {
631
632
private function setup_active_cache( $args ) {
633
// the options which the main sql query cares about:
634
+ $magic_options = array( 'limit', 'threshold', 'show_pass_post', 'past_only', 'weight', 'exclude', 'recent_only', 'recent_number', 'recent_units' );
635
636
$defaults = $this->get_option();
637
foreach ( $magic_options as $option ) {
class-widget.php CHANGED
@@ -14,19 +14,18 @@ class YARPP_Widget extends WP_Widget {
14
15
extract($args);
16
17
- // compatibility with pre-3.4.4 settings:
18
- if ( isset($instance['use_template']) )
19
- $instance['template'] = $instance['use_template'] ? $instance['template_file'] : false;
20
-
21
$instance['post_type'] = ($post->post_type == 'page' ? array('page') : array('post'));
22
if ( yarpp_get_option('cross_relate') )
23
$instance['post_type'] = array('post','page');
24
25
$title = apply_filters('widget_title', $instance['title']);
26
echo $before_widget;
27
- if ( !$instance['template'] ) {
28
echo $before_title;
29
- echo $title;
30
echo $after_title;
31
}
32
@@ -36,63 +35,60 @@ class YARPP_Widget extends WP_Widget {
36
}
37
38
function update($new_instance, $old_instance) {
39
- $instance = array(
40
- 'promote_yarpp' => isset($new_instance['promote_yarpp']),
41
- 'template' => isset($new_instance['use_template']) ? $new_instance['template_file'] : false
42
- );
43
-
44
- if ( !!$instance['template'] ) // don't save the title change.
45
$instance['title'] = $old_instance['title'];
46
- else // save the title change:
47
$instance['title'] = $new_instance['title'];
48
-
49
return $instance;
50
}
51
52
function form($instance) {
53
- global $yarpp;
54
-
55
- $instance = wp_parse_args( $instance, array(
56
- 'title' => __('Related Posts (YARPP)','yarpp'),
57
- 'template' => false,
58
- 'promote_yarpp' => false
59
- ) );
60
-
61
- // compatibility with pre-3.4.4 settings:
62
- if ( isset($instance['use_template']) )
63
- $instance['template'] = $instance['template_file'];
64
-
65
?>
66
- <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($instance['title']); ?>" /></label></p>
67
68
- <?php // if there are YARPP templates installed...
69
- $templates = $yarpp->admin->get_templates();
70
- if ( count($templates) ): ?>
71
72
- <p><input class="checkbox" id="<?php echo $this->get_field_id('use_template'); ?>" name="<?php echo $this->get_field_name('use_template'); ?>" type="checkbox" <?php checked(!!$instance['template']) ?> /> <label for="<?php echo $this->get_field_id('use_template'); ?>"><?php _e("Display using a custom template file",'yarpp');?></label></p>
73
- <p id="<?php echo $this->get_field_id('template_file_p'); ?>"><label for="<?php echo $this->get_field_id('template_file'); ?>"><?php _e("Template file:",'yarpp');?></label> <select name="<?php echo $this->get_field_name('template_file'); ?>" id="<?php echo $this->get_field_id('template_file'); ?>">
74
- <?php foreach ($templates as $template): ?>
75
- <option value='<?php echo esc_attr($template); ?>'<?php selected($template, $instance['template']);?>><?php echo esc_html($template); ?></option>
76
- <?php endforeach; ?>
77
- </select><p>
78
- <script type="text/javascript">
79
- jQuery(function($) {
80
- function ensureTemplateChoice() {
81
- if ($('#<?php echo $this->get_field_id('use_template'); ?>').attr('checked')) {
82
- $('#<?php echo $this->get_field_id('title'); ?>').attr('disabled',true);
83
- $('#<?php echo $this->get_field_id('template_file_p'); ?>').show();
84
- } else {
85
- $('#<?php echo $this->get_field_id('title'); ?>').attr('disabled',false);
86
- $('#<?php echo $this->get_field_id('template_file_p'); ?>').hide();
87
}
88
- }
89
- $('#<?php echo $this->get_field_id('use_template'); ?>').change(ensureTemplateChoice);
90
- ensureTemplateChoice();
91
- });
92
- </script>
93
- <?php endif; ?>
94
95
- <p><input class="checkbox" id="<?php echo $this->get_field_id('promote_yarpp'); ?>" name="<?php echo $this->get_field_name('promote_yarpp'); ?>" type="checkbox" <?php checked($instance['promote_yarpp']) ?> /> <label for="<?php echo $this->get_field_id('promote_yarpp'); ?>"><?php _e("Help promote Yet Another Related Posts Plugin?",'yarpp'); ?></label></p>
96
<?php
97
}
98
}
14
15
extract($args);
16
17
$instance['post_type'] = ($post->post_type == 'page' ? array('page') : array('post'));
18
if ( yarpp_get_option('cross_relate') )
19
$instance['post_type'] = array('post','page');
20
21
$title = apply_filters('widget_title', $instance['title']);
22
echo $before_widget;
23
+ if ( !$instance['use_template'] ) {
24
echo $before_title;
25
+ if ($title)
26
+ echo $title;
27
+ else
28
+ _e('Related Posts (YARPP)','yarpp');
29
echo $after_title;
30
}
31
35
}
36
37
function update($new_instance, $old_instance) {
38
+ // this starts with default values.
39
+ $instance = array( 'promote_yarpp' => 0, 'use_template' => 0 );
40
+ foreach ( $instance as $field => $val ) {
41
+ if ( isset($new_instance[$field]) )
42
+ $instance[$field] = 1;
43
+ }
44
+ if ($instance['use_template']) {
45
+ $instance['template_file'] = $new_instance['template_file'];
46
$instance['title'] = $old_instance['title'];
47
+ } else {
48
+ $instance['template_file'] = $old_instance['template_file'];
49
$instance['title'] = $new_instance['title'];
50
+ }
51
return $instance;
52
}
53
54
function form($instance) {
55
+ $title = esc_attr($instance['title']);
56
+ $template_file = $instance['template_file'];
57
?>
58
+ <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></label></p>
59
+
60
+ <?php // if there are YARPP templates installed...
61
+
62
+ $templates = glob(STYLESHEETPATH . '/yarpp-template-*.php');
63
+ if ( is_array($templates) && count($templates) ): ?>
64
+
65
+ <p><input class="checkbox" id="<?php echo $this->get_field_id('use_template'); ?>" name="<?php echo $this->get_field_name('use_template'); ?>" type="checkbox" <?php checked($instance['use_template'], true) ?> /> <label for="<?php echo $this->get_field_id('use_template'); ?>"><?php _e("Display using a custom template file",'yarpp');?></label></p>
66
+ <p id="<?php echo $this->get_field_id('template_file_p'); ?>"><label for="<?php echo $this->get_field_id('template_file'); ?>"><?php _e("Template file:",'yarpp');?></label> <select name="<?php echo $this->get_field_name('template_file'); ?>" id="<?php echo $this->get_field_id('template_file'); ?>">
67
+ <?php foreach ($templates as $template): ?>
68
+ <option value='<?php echo htmlspecialchars(basename($template))?>'<?php echo (basename($template)==$template_file)?" selected='selected'":'';?>><?php echo htmlspecialchars(basename($template))?></option>
69
+ <?php endforeach; ?>
70
+ </select><p>
71
+
72
+ <?php endif; ?>
73
74
+ <p><input class="checkbox" id="<?php echo $this->get_field_id('promote_yarpp'); ?>" name="<?php echo $this->get_field_name('promote_yarpp'); ?>" type="checkbox" <?php checked($instance['images'], true) ?> /> <label for="<?php echo $this->get_field_id('promote_yarpp'); ?>"><?php _e("Help promote Yet Another Related Posts Plugin?",'yarpp'); ?></label></p>
75
76
+ <script type="text/javascript">
77
+ jQuery(function($) {
78
+ function ensureTemplateChoice() {
79
+ if ($('#<?php echo $this->get_field_id('use_template'); ?>').attr('checked')) {
80
+ $('#<?php echo $this->get_field_id('title'); ?>').attr('disabled',true);
81
+ $('#<?php echo $this->get_field_id('template_file_p'); ?>').show();
82
+ } else {
83
+ $('#<?php echo $this->get_field_id('title'); ?>').attr('disabled',false);
84
+ $('#<?php echo $this->get_field_id('template_file_p'); ?>').hide();
85
+ }
86
}
87
+ $('#<?php echo $this->get_field_id('use_template'); ?>').change(ensureTemplateChoice);
88
+ ensureTemplateChoice();
89
+ });
90
+ </script>
91
92
<?php
93
}
94
}
lang/yarpp-sk_SK.mo DELETED
Binary file
lang/yarpp-sk_SK.po DELETED
@@ -1,543 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Yet Another Related Posts Plugin v3.4.3\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: \n"
6
- "PO-Revision-Date: 2011-12-30 10:47+0000\n"
7
- "Last-Translator: brozman <v.brozman@gmail.com>\n"
8
- "Language-Team: \n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
- "X-Poedit-Language: Slovak\n"
14
- "X-Poedit-Country: SLOVAKIA\n"
15
- "X-Poedit-SourceCharset: utf-8\n"
16
- "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
17
- "X-Poedit-Basepath: ../\n"
18
- "X-Poedit-Bookmarks: \n"
19
- "X-Poedit-SearchPath-0: .\n"
20
- "X-Textdomain-Support: yes"
21
-
22
- #: class-admin.php:42
23
- #: class-widget.php:7
24
- #: class-widget.php:28
25
- #@ yarpp
26
- msgid "Related Posts (YARPP)"
27
- msgstr "Súvisiace články (YARPP)"
28
-
29
- #: class-admin.php:50
30
- #@ yarpp
31
- msgid "Related Posts"
32
- msgstr "Súvisiace články"
33
-
34
- #: class-admin.php:50
35
- #@ default
36
- msgid "Configure"
37
- msgstr "Konfigurovať"
38
-
39
- #: class-admin.php:76
40
- #@ yarpp
41
- msgid "Thank you for installing <span>Yet Another Related Posts Plugin</span>!"
42
- msgstr "Ďakujeme Vám za inštaláciu <span>Yet Another Related Posts Plugin</span>!"
43
-
44
- #: class-admin.php:77
45
- #@ yarpp
46
- msgid "Make sure to visit the <a>Related Posts settings page</a> to customize YARPP."
47
- msgstr "Navštívte <a>stránku s nastaveniami</a> pre úpravu pluginu YARPP."
48
-
49
- #: class-admin.php:123
50
- #@ default
51
- msgid "Settings"
52
- msgstr "Nastavenia"
53
-
54
- #: class-admin.php:149
55
- #@ yarpp
56
- msgid "Related entries may be displayed once you save your entry"
57
- msgstr "Súvisiace články budú zobrazené po tom, ako uložíte vykonané zmeny"
58
-
59
- #: class-cache.php:525
60
- #@ yarpp
61
- msgid "Example post "
62
- msgstr "Vzorový článok"
63
-
64
- #: class-core.php:77
65
- #: class-core.php:88
66
- #: class-core.php:272
67
- #: class-core.php:283
68
- #@ yarpp
69
- msgid "Related posts:"
70
- msgstr "Súvisiace články:"
71
-
72
- #: class-core.php:79
73
- #: class-core.php:90
74
- #: class-core.php:274
75
- #: class-core.php:285
76
- #: template-metabox.php:30
77
- #: template-widget.php:13
78
- #@ yarpp
79
- msgid "No related posts."
80
- msgstr "Žiadne súvisiace články."
81
-
82
- #: class-core.php:510
83
- #: class-core.php:627
84
- #: options-meta-boxes.php:205
85
- #: options-meta-boxes.php:257
86
- #, php-format
87
- #@ yarpp
88
- msgid "Related posts brought to you by <a href='%s'>Yet Another Related Posts Plugin</a>."
89
- msgstr "Tento plugin Vám prináša <a href='%s'>Yet Another Related Posts Plugin</a>."
90
-
91
- #: class-widget.php:58
92
- #@ default
93
- msgid "Title:"
94
- msgstr "Nadpis:"
95
-
96
- #: class-widget.php:65
97
- #: options-meta-boxes.php:170
98
- #: options-meta-boxes.php:228
99
- #@ yarpp
100
- msgid "Display using a custom template file"
101
- msgstr "Zobraziť pomocou vlastnej šablóny"
102
-
103
- #: class-widget.php:66
104
- #: options-meta-boxes.php:174
105
- #: options-meta-boxes.php:233
106
- #@ yarpp
107
- msgid "Template file:"
108
- msgstr "Súbor šablóny:"
109
-
110
- #: class-widget.php:74
111
- #: options-meta-boxes.php:203
112
- #: options-meta-boxes.php:256
113
- #@ yarpp
114
- msgid "Help promote Yet Another Related Posts Plugin?"
115
- msgstr "Chcete pomôcť s propagáciou Yet Another Related Posts Pluginu?"
116
-
117
- #: options-meta-boxes.php:36
118
- #: options-meta-boxes.php:50
119
- #@ yarpp
120
- msgid "do not consider"
121
- msgstr "nebrať do úvahy"
122
-
123
- #: options-meta-boxes.php:37
124
- #: options-meta-boxes.php:51
125
- #@ yarpp
126
- msgid "consider"
127
- msgstr "brať do úvahy"
128
-
129
- #: options-meta-boxes.php:38
130
- #, php-format
131
- #@ yarpp
132
- msgid "require at least one %s in common"
133
- msgstr "požaduje sa najmenej jedna spoločná %s"
134
-
135
- #: options-meta-boxes.php:39
136
- #, php-format
137
- #@ yarpp
138
- msgid "require more than one %s in common"
139
- msgstr "požaduje sa viac ako jedna spoločná %s"
140
-
141
- #: options-meta-boxes.php:52
142
- #@ yarpp
143
- msgid "consider with extra weight"
144
- msgstr "priradiť extra význam"
145
-
146
- #: options-meta-boxes.php:61
147
- #@ yarpp
148
- msgid "Order results:"
149
- msgstr "Zoradiť výsledky:"
150
-
151
- #: options-meta-boxes.php:64
152
- #@ yarpp
153
- msgid "score (high relevance to low)"
154
- msgstr "podľa zhody (od najväčšej po najmenšiu)"
155
-
156
- #: options-meta-boxes.php:65
157
- #@ yarpp
158
- msgid "score (low relevance to high)"
159
- msgstr "podľa zhody (od najmenšej po najväčšiu)"
160
-
161
- #: options-meta-boxes.php:66
162
- #@ yarpp
163
- msgid "date (new to old)"
164
- msgstr "podľa dátumu (od najnovšších po najstaršie)"
165
-
166
- #: options-meta-boxes.php:67
167
- #@ yarpp
168
- msgid "date (old to new)"
169
- msgstr "podľa dátumu (od najstaršších po najnovšie)"
170
-
171
- #: options-meta-boxes.php:68
172
- #@ yarpp
173
- msgid "title (alphabetical)"
174
- msgstr "podľa nadpisu (abecedne A-Z)"
175
-
176
- #: options-meta-boxes.php:69
177
- #@ yarpp
178
- msgid "title (reverse alphabetical)"
179
- msgstr "podľa nadpisu (obrátene abecedne Z-A)"
180
-
181
- #: options-meta-boxes.php:100
182
- #@ yarpp
183
- msgid "\"The Pool\" refers to the pool of posts and pages that are candidates for display as related to the current entry."
184
- msgstr "V \"pokročilých nastaveniach\" môžete nastaviť, ktoré príspevky sa budú zobrazovať ako súvisiace k aktuálnemu záznamu."
185
-
186
- #: options-meta-boxes.php:106
187
- #, php-format
188
- #@ yarpp
189
- msgid "Disallow by %s:"
190
- msgstr "Zakázať"
191
-
192
- #: options-meta-boxes.php:108
193
- #@ yarpp
194
- msgid "Show password protected posts?"
195
- msgstr "Zobraziť články chránené heslom?"
196
-
197
- #: options-meta-boxes.php:113
198
- #@ yarpp
199
- msgid "day(s)"
200
- msgstr "dni"
201
-
202
- #: options-meta-boxes.php:114
203
- #@ yarpp
204
- msgid "week(s)"
205
- msgstr "týždne"
206
-
207
- #: options-meta-boxes.php:115
208
- #@ yarpp
209
- msgid "month(s)"
210
- msgstr "mesiac(e)"
211
-
212
- #: options-meta-boxes.php:117
213
- #@ yarpp
214
- msgid "Show only posts from the past NUMBER UNITS"
215
- msgstr "Zobraziť len články za posledných NUMBER UNITS"
216
-
217
- #: options-meta-boxes.php:126
218
- #@ yarpp
219
- msgid "\"The Pool\""
220
- msgstr "\"Pokročilé nastavenia\""
221
-
222
- #: options-meta-boxes.php:132
223
- #@ yarpp
224
- msgid "YARPP limits the related posts list by (1) a maximum number and (2) a <em>match threshold</em>."
225
- msgstr "YARPP zoraďuje súvisiace články podľa (1) čísla zobrazovaných článkov (2) <em>podľa zhody</em>."
226
-
227
- #: options-meta-boxes.php:132
228
- #: options-meta-boxes.php:148
229
- #: options-meta-boxes.php:166
230
- #: options-meta-boxes.php:170
231
- #: options-meta-boxes.php:204
232
- #: options-meta-boxes.php:221
233
- #: options-meta-boxes.php:223
234
- #: options-meta-boxes.php:228
235
- #: options-meta-boxes.php:256
236
- #@ yarpp
237
- msgid "more&gt;"
238
- msgstr "viac&gt;"
239
-
240
- #: options-meta-boxes.php:132
241
- #@ yarpp
242
- 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."
243
- msgstr "Čím vyššie je nastavená presnosť zhody, tým menej súvisiacich príspevkov dostanete. Štandardne je zhoda nastavená na číslo 5. Pri hľadaní toho správneho nastavenia zhody Vám odporúčame pozrieť aké čísla sa zobrazujú pri navrhnutých súvisiacich článkoch a vyladiť si nastavenie podľa seba."
244
-
245
- #: options-meta-boxes.php:138
246
- #@ yarpp
247
- msgid "Match threshold:"
248
- msgstr "Presnosť zhody:"
249
-
250
- #: options-meta-boxes.php:139
251
- #@ yarpp
252
- msgid "Titles: "
253
- msgstr "Nadpisy:"
254
-
255
- #: options-meta-boxes.php:141
256
- #@ yarpp
257
- msgid "Bodies: "
258
- msgstr "Telo:"
259
-
260
- #: options-meta-boxes.php:148
261
- #@ yarpp
262
- msgid "Cross-relate posts and pages?"
263
- msgstr "Nerozlišovať medzi stránkami a článkami?"
264
-
265
- #: options-meta-boxes.php:148
266
- #@ yarpp
267
- 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."
268
- msgstr "Ak je možnosť \"Nerozlišovať medzi stránkami a článkami?\" zapnutá, <code>related_posts()</code>, <code>related_pages()</code>, and <code>related_entries()</code> všetky tieto kódy vrátia rovnaké výsledky a zobrazia súvisiace články aj stránky."
269
-
270
- #: options-meta-boxes.php:149
271
- #@ yarpp
272
- msgid "Show only previous posts?"
273
- msgstr "Zobraziť len miunulé príspevky?"
274
-
275
- #: options-meta-boxes.php:157
276
- #@ yarpp
277
- msgid "\"Relatedness\" options"
278
- msgstr "nastavenie \"Podobnosti\""
279
-
280
- #: options-meta-boxes.php:166
281
- #@ yarpp
282
- msgid "Automatically display related posts?"
283
- msgstr "Zobraziť súvisiace články automaticky?"
284
-
285
- #: options-meta-boxes.php:166
286
- #@ yarpp
287
- 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."
288
- msgstr "Táto možnosť automaticky zobrazí súvisiace články hneď pod obsahom danej stránky. Ak je táto funkcia vypnutá, budete musieť ručne vložiť <code>related_posts()</code> alebo (<code>related_pages()</code> a <code>related_entries()</code>) do súborov Vašej témy."
289
-
290
- #: options-meta-boxes.php:167
291
- #@ yarpp
292
- msgid "Website display code example"
293
- msgstr "Takto bude vyzerať kód na stránke"
294
-
295
- #: options-meta-boxes.php:167
296
- #: options-meta-boxes.php:221
297
- #@ yarpp
298
- msgid "(Update options to reload.)"
299
- msgstr "(Aktualizujte možnosti pre obnovenie.)"
300
-
301
- #: options-meta-boxes.php:169
302
- #: options-meta-boxes.php:226
303
- #@ yarpp
304
- msgid "Maximum number of related posts:"
305
- msgstr "Maximálny počet súvisiacich článkov:"
306
-
307
- #: options-meta-boxes.php:170
308
- #: options-meta-boxes.php:228
309
- #@ yarpp
310
- 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."
311
- msgstr "Toto pokročilé nastavenie Vám dáva plnú moc pri upravovaní toho, ako budú súvisiace články zobrazené. Šablóny (nachádzajúce sa v priečinku Vašej témy) sú písané v PHP."
312
-
313
- #: options-meta-boxes.php:184
314
- #: options-meta-boxes.php:244
315
- #@ yarpp
316
- msgid "Before / after related entries:"
317
- msgstr "Pred / za súvisiacimi článkami:"
318
-
319
- #: options-meta-boxes.php:184
320
- #: options-meta-boxes.php:185
321
- #: options-meta-boxes.php:193
322
- #: options-meta-boxes.php:244
323
- #: options-meta-boxes.php:245
324
- #: options-meta-boxes.php:250
325
- #@ yarpp
326
- msgid "For example:"
327
- msgstr "Napríklad:"
328
-
329
- #: options-meta-boxes.php:184
330
- #: options-meta-boxes.php:185
331
- #: options-meta-boxes.php:193
332
- #: options-meta-boxes.php:244
333
- #: options-meta-boxes.php:245
334
- #: options-meta-boxes.php:250
335
- #@ yarpp
336
- msgid " or "
337
- msgstr "alebo"
338
-
339
- #: options-meta-boxes.php:185
340
- #: options-meta-boxes.php:245
341
- #@ yarpp
342
- msgid "Before / after each related entry:"
343
- msgstr "Pred / za každým súvisiacim článkom:"
344
-
345
- #: options-meta-boxes.php:187
346
- #: options-meta-boxes.php:247
347
- #@ yarpp
348
- msgid "Show excerpt?"
349
- msgstr "Zobraziť výňatok?"
350
-
351
- #: options-meta-boxes.php:188
352
- #: options-meta-boxes.php:248
353
- #@ yarpp
354
- msgid "Excerpt length (No. of words):"
355
- msgstr "Dĺžka výňatku (počet slov)"
356
-
357
- #: options-meta-boxes.php:192
358
- #@ yarpp
359
- msgid "Before / after (Excerpt):"
360
- msgstr "Pred / za (výňatkom)"
361
-
362
- #: options-meta-boxes.php:200
363
- #: options-meta-boxes.php:254
364
- #@ yarpp
365
- msgid "Default display if no results:"
366
- msgstr "Ak sa nenájdu žiadne výsledky, zobrazí sa:"
367
-
368
- #: options-meta-boxes.php:205
369
- #: options-meta-boxes.php:257
370
- #, php-format
371
- #@ yarpp
372
- 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."
373
- msgstr "Zapnutie tejto možnosti pridá kód %s. Skúste to zapnút, uložiť nastavenia, a výsledok uvidíte vpravo hore. Zapnutie tohto nastavenia a finančné dary si veľmi vážime."
374
-
375
- #: options-meta-boxes.php:212
376
- #@ yarpp
377
- msgid "Display options <small>for your website</small>"
378
- msgstr "Zobraziť možnosti <small>pre Vašu stránku</small>"
379
-
380
- #: options-meta-boxes.php:221
381
- #@ yarpp
382
- msgid "Display related posts in feeds?"
383
- msgstr "Zobraziť súvisiace články v kanáloch?"
384
-
385
- #: options-meta-boxes.php:221
386
- #@ yarpp
387
- msgid "This option displays related posts at the end of each item in your RSS and Atom feeds. No template changes are needed."
388
- msgstr "Táto možnosť zobrazí súvisiace články na konci každého príspevku v RSS a Atom kanáloch. Žiadne zmeny v šablóne nie sú nutné."
389
-
390
- #: options-meta-boxes.php:221
391
- #@ yarpp
392
- msgid "RSS display code example"
393
- msgstr "Príklad zobrazenia RSS kódu"
394
-
395
- #: options-meta-boxes.php:223
396
- #@ yarpp
397
- msgid "Display related posts in the descriptions?"
398
- msgstr "Zobraziť súvisiace články v popisoch?"
399
-
400
- #: options-meta-boxes.php:223
401
- #@ yarpp
402
- 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."
403
- msgstr "Táto možnosť zobrazí súvisiace články v popise RSS. Ak je zapnutá, zobrazí len výňatky z článkov. Ak je necháte vypnutú, zobrazia sa Vám celé RSS kanály."
404
-
405
- #: options-meta-boxes.php:228
406
- #@ yarpp
407
- msgid "NEW!"
408
- msgstr "NOVÉ!"
409
-
410
- #: options-meta-boxes.php:250
411
- #@ yarpp
412
- msgid "Before / after (excerpt):"
413
- msgstr "Pred / za (výňatkom)"
414
-
415
- #: options-meta-boxes.php:264
416
- #@ yarpp
417
- msgid "Display options <small>for RSS</small>"
418
- msgstr "Nastavenie zobrazenie <small>pre RSS</small>"
419
-
420
- #: options-meta-boxes.php:271
421
- #@ yarpp
422
- msgid "YARPP Forum"
423
- msgstr "YARPP Fórum"
424
-
425
- #: options-meta-boxes.php:272
426
- #@ yarpp
427
- msgid "YARPP on Twitter"
428
- msgstr "YARPP na Twittri"
429
-
430
- #: options-meta-boxes.php:273
431
- #@ yarpp
432
- msgid "YARPP on the Web"
433
- msgstr "YARPP na Webe"
434
-
435
- #: options-meta-boxes.php:274
436
- #@ yarpp
437
- msgid "Rate YARPP on WordPress.org"
438
- msgstr "Ohodnoťte plugin YARPP na stránke WordPress.org"
439
-
440
- #: options-meta-boxes.php:275
441
- #@ default
442
- #@ yarpp
443
- msgid "Donate to mitcho (Michael Yoshitaka Erlewine) for this plugin via PayPal"
444
- msgstr "Poslať finančný prispevok autorovi pluginu - mitchovi (Michael Yoshitaka Erlewine) cez PayPal."
445
-
446
- #: options-meta-boxes.php:310
447
- #@ yarpp
448
- msgid "Contact YARPP"
449
- msgstr "Kontaktovať YARPP"
450
-
451
- #: options.php:36
452
- #, php-format
453
- #@ default
454
- msgid "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox\" title=\"%3$s\">View version %4$s details</a> or <a href=\"%5$s\">update automatically</a>."
455
- msgstr "Bola vydaná nová verzia %1$s. <a href=\"%2$s\" class=\"thickbox\" title=\"%3$s\">Pozrieť %4$s detaily verzie</a> alebo <a href=\"%5$s\">aktualizovať automaticky</a>."
456
-
457
- #: options.php:40
458
- #, php-format
459
- #@ yarpp
460
- msgid "There is a new beta (%s) of Yet Another Related Posts Plugin. You can <a href=\"%s\">download it here</a> at your own risk."
461
- msgstr "Bola vydaná nová beta verzia (%s) Yet Another Related Posts Pluginu. Môžete si ju <a href=\"%s\">stiahnuť</a> na vlastné riziko."
462
-
463
- #: options.php:48
464
- #@ yarpp
465
- msgid "The MyISAM check has been overridden. You may now use the \"consider titles\" and \"consider bodies\" relatedness criteria."
466
- msgstr "MyISAM kontrola bola prepísaná. Teraz môžte použiť \"consider titles\" and \"consider bodies\" kritériá podobnosti."
467
-
468
- #: options.php:56
469
- #, php-format
470
- #@ yarpp
471
- 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."
472
- msgstr "YARPP \"consider titles\" and \"consider bodies\" kritériá podobnosti vyžadujú Vašu <code>%s</code> tabuľku <a href='http://dev.mysql.com/doc/refman/5.0/en/storage-engines.html'>MyISAM storage engine</a>, no zdá sa, že tabuľka používa <code>%s</code>. Tieto dve možnosti boli vypnuté."
473
-
474
- #: options.php:58
475
- #, php-format
476
- #@ yarpp
477
- 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."
478
- msgstr "Pre obnovenie týchto funkcií, prosím aktualizujte svoju <code>%s</code> tabuľku, spustením nasledovného SQL príkazu: <code>ALTER TABLE `%s` ENGINE = MyISAM;</code> . Žiadne dáta nebudú vymazané po vykonaní toho príkazu."
479
-
480
- #: options.php:60
481
- #, php-format
482
- #@ yarpp
483
- msgid "If, despite this check, you are sure that <code>%s</code> is using the MyISAM engine, press this magic button:"
484
- msgstr "Ak ste si aj napriek tejto kontrole istý, že <code>%s</code> používa MyISAM, stlačte toto čarovné tlačidlo:"
485
-
486
- #: options.php:63
487
- #@ yarpp
488
- msgid "Trust me. Let me use MyISAM features."
489
- msgstr "Verte mi, je lepšie, keď používate funkcie MyISAM."
490
-
491
- #: options.php:75
492
- #@ yarpp
493
- msgid "The YARPP database had an error but has been fixed."
494
- msgstr "YARPP databáza obsahovala chybu, ktorú sme už stihli opraviť."
495
-
496
- #: options.php:77
497
- #@ yarpp
498
- msgid "The YARPP database has an error which could not be fixed."
499
- msgstr "V databáze YARPP je závažná chyba, ktorá sa nedá opraviť."
500
-
501
- #: options.php:78
502
- #, php-format
503
- #@ yarpp
504
- msgid "Please try <a href=\"%s\" target=\"_blank\">manual SQL setup</a>."
505
- msgstr "Vyskúšajte prosím <a href=\"%s\" target=\"_blank\">manuálne nastaveniť databázu</a>."
506
-
507
- #: options.php:109
508
- #@ yarpp
509
- msgid "Options saved!"
510
- msgstr "Nastavenia uložené!"
511
-
512
- #: options.php:115
513
- #@ yarpp
514
- msgid "Yet Another Related Posts Plugin Options"
515
- msgstr "Možnost Yet Another Related Posts Pluginu"
516
-
517
- #: options.php:123
518
- #, php-format
519
- #@ yarpp
520
- msgid "by <a href=\"%s\" target=\"_blank\">mitcho (Michael 芳貴 Erlewine)</a>"
521
- msgstr "plugin od <a href=\"%s\" target=\"_blank\">mitcho (Michael 芳貴 Erlewine)</a>"
522
-
523
- #: options.php:152
524
- #@ default
525
- msgid "Save Changes"
526
- msgstr "Uložiť zmeny"
527
-
528
- #: template-builtin.php:20
529
- #, php-format
530
- #@ yarpp
531
- 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."
532
- msgstr "%f je zhoda medzi aktuálnym príspevkom a súvisiacim článkom. Túto možnosť môžete vidieť len ako administrátor. Návštevníci túto hodnotu neuvidia."
533
-
534
- #: template-metabox.php:12
535
- #@ yarpp
536
- msgid "These are the related entries for this entry. Updating this post may change these related posts."
537
- msgstr "Toto sú súvisiace články pre tento príspevok. Aktualizácia tohoto príspevku môže súvisiace články zmeniť."
538
-
539
- #: template-metabox.php:28
540
- #@ yarpp
541
- msgid "Whether all of these related entries are actually displayed and how they are displayed depends on your YARPP display options."
542
- msgstr "To, či sú všetky aktuálne príspevky zobrazené a ako sú zobrazené, závisí na nastavení Vášho YARPP."
543
-
lang/yarpp-tr_TR.mo CHANGED
Binary file
lang/yarpp-tr_TR.po CHANGED
@@ -3,9 +3,9 @@ msgstr ""
3
"Project-Id-Version: Yet Another Related Posts Plugin v3.0.13\n"
4
"Report-Msgid-Bugs-To: \n"
5
"POT-Creation-Date: \n"
6
- "PO-Revision-Date: 2011-12-16 13:05+0200\n"
7
- "Last-Translator: Baris Unver <baris.unver@beyn.org>\n"
8
- "Language-Team: Baris Unver <baris.unver@beyn.org>\n"
9
"MIME-Version: 1.0\n"
10
"Content-Type: text/plain; charset=UTF-8\n"
11
"Content-Transfer-Encoding: 8bit\n"
@@ -13,209 +13,209 @@ msgstr ""
13
"X-Poedit-Language: Turkish\n"
14
"X-Poedit-Country: TURKEY\n"
15
"X-Poedit-SourceCharset: utf-8\n"
16
- "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
17
"X-Poedit-Basepath: ../\n"
18
- "X-Textdomain-Support: yes\n"
19
"X-Poedit-SearchPath-0: .\n"
20
21
- #@ yarpp
22
#: includes.php:26
23
#: includes.php:37
24
msgid "Related posts:"
25
msgstr "Benzer yazılar:"
26
27
- #@ yarpp
28
#: includes.php:28
29
#: includes.php:39
30
#: template-metabox.php:27
31
#: template-widget.php:13
32
msgid "No related posts."
33
msgstr "Benzer yazı yok."
34
35
- #@ yarpp
36
#: includes.php:149
37
#: includes.php:194
38
#: includes.php:215
39
msgid "Related Posts (YARPP)"
40
- msgstr "Benzer Yazılar (YARPP)"
41
42
- #@ yarpp
43
#: includes.php:169
44
msgid "Settings"
45
msgstr "Ayarlar"
46
47
- #@ yarpp
48
#: includes.php:376
49
msgid "Related Posts"
50
msgstr "Benzer Yazılar"
51
52
- #@ yarpp
53
#: cache-postmeta.php:105
54
#: cache-tables.php:131
55
msgid "Example post "
56
msgstr "Örnek yazı"
57
58
- #@ yarpp
59
#: magic.php:297
60
#: options-meta-boxes.php:205
61
#: options-meta-boxes.php:269
62
#, php-format
63
msgid "Related posts brought to you by <a href='%s'>Yet Another Related Posts Plugin</a>."
64
- msgstr "Benzer yazılar <a href='%s'>Yet Another Related Posts Eklentisini</a> ile listelendi."
65
66
- #@ yarpp
67
#: options.php:54
68
msgid "The MyISAM check has been overridden. You may now use the \"consider titles\" and \"consider bodies\" relatedness criteria."
69
- msgstr "MyISAM kontrolü artık geçersiz. Artık \"başlıkları göz önünde bulundur\" ve \"içerikleri göz önünde bulundur\" kriterlerini kullanabilirsiniz."
70
71
- #@ yarpp
72
#: options.php:63
73
#, php-format
74
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."
75
- msgstr "YARPP'ın \"başlıkları göz önünde bulundur\" ve \"içerikleri göz önünde bulundur\" kriterleri, veritabanındaki <code>%s</code> tablosunun <a href='http://dev.mysql.com/doc/refman/5.0/en/storage-engines.html'>MyISAM motoruyla</a> çalışmasını gerektirir. Ama tablolar <code>%s</code> motorunu kullanıyor gibi gözüküyor. Bu iki özellik devre dışı bırakıldı."
76
77
- #@ yarpp
78
#: options.php:65
79
#, php-format
80
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."
81
- msgstr "Bu özellikleri geri getirmek için, <code>%s</code> tablosunu <code>ALTER TABLE `%s` ENGINE = MyISAM;</code> kodunu kullanarak güncelleştirin. Hiçbir veri silinmeyecektir ancak sitenin performansı etkilenebilir."
82
83
- #@ yarpp
84
#: options.php:67
85
#, php-format
86
msgid "If, despite this check, you are sure that <code>%s</code> is using the MyISAM engine, press this magic button:"
87
- msgstr "Eğer <code>%s</code>'in MyISAM motorunu kullandığından eminseniz lütfen bu düğmeyi tıklayın:"
88
89
- #@ yarpp
90
#: options.php:70
91
msgid "Trust me. Let me use MyISAM features."
92
msgstr "Bana güvenebilirsin :). MYISAM özelliklerini kullanmama izin ver."
93
94
- #@ yarpp
95
#: options.php:83
96
msgid "The YARPP database had an error but has been fixed."
97
- msgstr "YARPP veritabanında bir hata oluştu ama hata giderildi."
98
99
- #@ yarpp
100
#: options.php:85
101
msgid "The YARPP database has an error which could not be fixed."
102
- msgstr "YARPP veritabanında bir hata oluştu ve hata giderilemedi."
103
104
- #@ yarpp
105
#: options.php:114
106
msgid "Options saved!"
107
msgstr "Ayarlar kaydedildi!"
108
109
- #@ yarpp
110
#: options-meta-boxes.php:38
111
msgid "word"
112
msgstr "kelime"
113
114
- #@ yarpp
115
#: options-meta-boxes.php:39
116
msgid "tag"
117
msgstr "etiket"
118
119
- #@ yarpp
120
#: options-meta-boxes.php:40
121
msgid "category"
122
msgstr "kategori"
123
124
- #@ yarpp
125
#: options-meta-boxes.php:45
126
#: options-meta-boxes.php:63
127
#: options-meta-boxes.php:76
128
msgid "do not consider"
129
- msgstr "göz önünde bulundurma"
130
131
- #@ yarpp
132
#: options-meta-boxes.php:46
133
#: options-meta-boxes.php:64
134
#: options-meta-boxes.php:78
135
msgid "consider"
136
msgstr "göz önünde bulundur"
137
138
- #@ yarpp
139
#: options-meta-boxes.php:48
140
#: options-meta-boxes.php:80
141
#, php-format
142
msgid "require at least one %s in common"
143
- msgstr "en az bir tane ortak %s gerektirir"
144
145
- #@ yarpp
146
#: options-meta-boxes.php:50
147
#: options-meta-boxes.php:82
148
#, php-format
149
msgid "require more than one %s in common"
150
- msgstr "birden fazla ortak %s gerektirir"
151
152
- #@ yarpp
153
#: options-meta-boxes.php:65
154
msgid "consider with extra weight"
155
- msgstr "daha çok göz önünde bulundur"
156
157
- #@ yarpp
158
#: options.php:178
159
msgid "Yet Another Related Posts Plugin Options"
160
- msgstr "Yet Another Related Posts Ayarları"
161
162
#@ default
163
#@ yarpp
164
- #: options-meta-boxes.php:286
165
msgid "Donate to mitcho (Michael Yoshitaka Erlewine) for this plugin via PayPal"
166
- msgstr "Bu eklentinin yazarına (Michael Yoshitaka Erlewine) PayPal ile bağış yap"
167
168
- #@ yarpp
169
#: options-meta-boxes.php:118
170
msgid "\"The Pool\""
171
- msgstr "\"Havuz\""
172
173
- #@ yarpp
174
#: options-meta-boxes.php:91
175
msgid "\"The Pool\" refers to the pool of posts and pages that are candidates for display as related to the current entry."
176
- msgstr "\"Havuz\", mevcut gönderilerle alakalı olabilecek yazı ve sayfaların oluşturduğu havuzun adıdır."
177
178
- #@ yarpp
179
#: options-meta-boxes.php:96
180
msgid "Disallow by category:"
181
- msgstr "Kategoriye göre reddet:"
182
183
- #@ yarpp
184
#: options-meta-boxes.php:98
185
msgid "Disallow by tag:"
186
- msgstr "Etikete göre reddet:"
187
188
- #@ yarpp
189
#: options-meta-boxes.php:101
190
msgid "Show password protected posts?"
191
- msgstr "Şifreli yazıları göster?"
192
193
- #@ yarpp
194
#: options-meta-boxes.php:105
195
msgid "day(s)"
196
msgstr "gün"
197
198
- #@ yarpp
199
#: options-meta-boxes.php:106
200
msgid "week(s)"
201
msgstr "hafta"
202
203
- #@ yarpp
204
#: options-meta-boxes.php:107
205
msgid "month(s)"
206
msgstr "ay"
207
208
- #@ yarpp
209
#: options-meta-boxes.php:109
210
msgid "Show only posts from the past NUMBER UNITS"
211
- msgstr "Sadece geçmiş SAYI ÜNİTELERİNDEN yazıları göster"
212
213
- #@ yarpp
214
#: options-meta-boxes.php:148
215
msgid "\"Relatedness\" options"
216
- msgstr "\"Benzerlik\" seçenekleri"
217
218
- #@ yarpp
219
#: options-meta-boxes.php:124
220
#: options-meta-boxes.php:139
221
#: options-meta-boxes.php:157
@@ -225,344 +225,345 @@ msgstr "\"Benzerlik\" seçenekleri"
225
#: options-meta-boxes.php:223
226
#: options-meta-boxes.php:228
227
#: options-meta-boxes.php:268
228
msgid "more&gt;"
229
- msgstr "bilgi &gt;"
230
231
- #@ yarpp
232
#: options-meta-boxes.php:124
233
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."
234
- msgstr "Eşleşme eşiği yükseldikçe seçilecek olan benzer yazılar daha yüksek kriterlere göre değerlendirilir ve benzer yazı sayınız azalabilir. Varsayılan eşleşme eşiği 5'tir. Uygun bir eşleşme eşiği sayısı bulmak için, yazılarınızın bazılarına bakın ve benzer yazılarının eşleşme eşik değerlerini inceleyin. Gördüğünüz sayılara göre ortalama bir değer bulabilirsiniz."
235
236
- #@ yarpp
237
#: options-meta-boxes.php:130
238
msgid "Match threshold:"
239
- msgstr "Eşleşme eşiği:"
240
241
- #@ yarpp
242
#: options-meta-boxes.php:131
243
msgid "Titles: "
244
msgstr "Başlıklar:"
245
246
- #@ yarpp
247
#: options-meta-boxes.php:133
248
msgid "Bodies: "
249
- msgstr "İçerikler: "
250
251
- #@ yarpp
252
#: options-meta-boxes.php:135
253
msgid "Tags: "
254
- msgstr "Etiketler: "
255
256
- #@ yarpp
257
#: options-meta-boxes.php:137
258
msgid "Categories: "
259
- msgstr "Kategoriler: "
260
261
- #@ yarpp
262
#: options-meta-boxes.php:139
263
msgid "Cross-relate posts and pages?"
264
- msgstr "Sayfa ve yazıları birbirleriyle ilişkilendir?"
265
266
- #@ yarpp
267
#: options-meta-boxes.php:139
268
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."
269
- msgstr "\"Sayfa ve yazıları birbiriyle ilişkilendir\" seçeneği seçiliyse, <code>related_posts()</code>, <code>related_pages()</code> ve <code>related_entries()</code> kodları birbirinin aynı sonuçları döndürür; hepsi de benzer yazı ve sayfaları beraber gösterir."
270
271
- #@ yarpp
272
#: options.php:46
273
#, php-format
274
msgid "There is a new beta (%s) of Yet Another Related Posts Plugin. You can <a href=\"%s\">download it here</a> at your own risk."
275
- msgstr "Bu eklentinin BETA (%s) sürümü mevcut. <a href=\"%s\">Buradan indirebilirsiniz.</a>"
276
277
- #@ yarpp
278
#: options-meta-boxes.php:212
279
msgid "Display options <small>for your website</small>"
280
- msgstr "Gösterim seçenekleri <small>(sizin siteniz için)</small>"
281
282
- #@ yarpp
283
#: options-meta-boxes.php:157
284
msgid "Automatically display related posts?"
285
msgstr "Otomatik olarak benzer yazıları göster"
286
287
- #@ yarpp
288
#: options-meta-boxes.php:157
289
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."
290
- msgstr "Bu özellik, benzer yazıların otomatik olarak sayfa ve yazıların hemen ardına eklenmesini sağlar. Eğer bu özelliği kapatırsanız, <code>related_posts()</code> yada (<code>related_pages()</code> and <code>related_entries()</code>) kodlarından birini temanıza eklemeniz gerekecektir."
291
292
- #@ yarpp
293
#: options-meta-boxes.php:158
294
msgid "Website display code example"
295
- msgstr "Gösterilecek kod örneği"
296
297
- #@ yarpp
298
#: options-meta-boxes.php:158
299
#: options-meta-boxes.php:221
300
msgid "(Update options to reload.)"
301
- msgstr "(Yaptığınız değişiklikleri görmek için seçenekleri kaydedin.)"
302
303
- #@ yarpp
304
#: options-meta-boxes.php:160
305
#: options-meta-boxes.php:226
306
msgid "Maximum number of related posts:"
307
- msgstr "Benzer yazı sayısı:"
308
309
- #@ yarpp
310
#: includes.php:248
311
#: options-meta-boxes.php:161
312
#: options-meta-boxes.php:228
313
msgid "Display using a custom template file"
314
- msgstr "Özel bir şablon dosyası kullanarak görüntüle"
315
316
- #@ yarpp
317
#: options-meta-boxes.php:228
318
msgid "NEW!"
319
msgstr "YENİ!"
320
321
- #@ yarpp
322
#: options-meta-boxes.php:161
323
#: options-meta-boxes.php:228
324
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."
325
- msgstr "Bu gelişmiş özellik, benzer yazılarınızı nasıl göstereceğiniz konusunda size her türlü olanağı sağlar. Şablonlar PHP ile yazılır ve tema dizininizde bulunmalıdır."
326
327
- #@ yarpp
328
#: includes.php:249
329
#: options-meta-boxes.php:165
330
#: options-meta-boxes.php:233
331
msgid "Template file:"
332
- msgstr "Şablon dosyası:"
333
334
- #@ yarpp
335
#: options-meta-boxes.php:175
336
#: options-meta-boxes.php:244
337
msgid "Before / after related entries:"
338
- msgstr "Benzer gönderilerden önce & sonra:"
339
340
- #@ yarpp
341
#: options-meta-boxes.php:175
342
#: options-meta-boxes.php:176
343
#: options-meta-boxes.php:184
344
#: options-meta-boxes.php:244
345
#: options-meta-boxes.php:245
346
#: options-meta-boxes.php:250
347
msgid "For example:"
348
msgstr "Örneğin:"
349
350
- #@ yarpp
351
#: options-meta-boxes.php:175
352
#: options-meta-boxes.php:176
353
#: options-meta-boxes.php:184
354
#: options-meta-boxes.php:244
355
#: options-meta-boxes.php:245
356
#: options-meta-boxes.php:250
357
msgid " or "
358
- msgstr " veya "
359
360
- #@ yarpp
361
#: options-meta-boxes.php:176
362
#: options-meta-boxes.php:245
363
msgid "Before / after each related entry:"
364
- msgstr "Her benzer gönderiden önce & sonra:"
365
366
- #@ yarpp
367
#: options-meta-boxes.php:178
368
#: options-meta-boxes.php:247
369
msgid "Show excerpt?"
370
- msgstr "Yazı özetini göster?"
371
372
- #@ yarpp
373
#: options-meta-boxes.php:179
374
#: options-meta-boxes.php:248
375
msgid "Excerpt length (No. of words):"
376
- msgstr "Özet uzunluğu (kelime sayısı):"
377
378
- #@ yarpp
379
#: options-meta-boxes.php:183
380
msgid "Before / after (Excerpt):"
381
- msgstr "Özetten önce & sonra:"
382
383
- #@ yarpp
384
#: options-meta-boxes.php:189
385
#: options-meta-boxes.php:254
386
msgid "Order results:"
387
- msgstr "Sonuçların sıralanışı:"
388
389
- #@ yarpp
390
#: options-meta-boxes.php:191
391
#: options-meta-boxes.php:256
392
msgid "score (high relevance to low)"
393
- msgstr "Skor (yüksekten düşüğe)"
394
395
- #@ yarpp
396
#: options-meta-boxes.php:192
397
#: options-meta-boxes.php:257
398
msgid "score (low relevance to high)"
399
- msgstr "skor (düşükten yükseğe)"
400
401
- #@ yarpp
402
#: options-meta-boxes.php:193
403
#: options-meta-boxes.php:258
404
msgid "date (new to old)"
405
msgstr "tarih (yeniden eskiye)"
406
407
- #@ yarpp
408
#: options-meta-boxes.php:194
409
#: options-meta-boxes.php:259
410
msgid "date (old to new)"
411
msgstr "tarih (eskiden yeniye)"
412
413
- #@ yarpp
414
#: options-meta-boxes.php:195
415
#: options-meta-boxes.php:260
416
msgid "title (alphabetical)"
417
- msgstr "başlık (A'dan Z'ye)"
418
419
- #@ yarpp
420
#: options-meta-boxes.php:196
421
#: options-meta-boxes.php:261
422
msgid "title (reverse alphabetical)"
423
- msgstr "başlık (Z'den A'ya)"
424
425
- #@ yarpp
426
#: options-meta-boxes.php:201
427
#: options-meta-boxes.php:266
428
msgid "Default display if no results:"
429
msgstr "Sonuç yoksa, şunu göster:"
430
431
- #@ yarpp
432
#: includes.php:257
433
#: options-meta-boxes.php:203
434
#: options-meta-boxes.php:268
435
msgid "Help promote Yet Another Related Posts Plugin?"
436
- msgstr "Yet Another Related Posts eklentisini yay!"
437
438
- #@ yarpp
439
#: options-meta-boxes.php:205
440
#: options-meta-boxes.php:269
441
#, php-format
442
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."
443
- msgstr "Bu özellik %s kodunu ekleyecek. Bunu işaretleyip seçenekleri güncelleyin ve kodunuzda olacak değişikliği sağ tarafta görün. Bu bağlantılar ve bağışlar bizim için çok önemli."
444
445
- #@ yarpp
446
#: options-meta-boxes.php:276
447
msgid "Display options <small>for RSS</small>"
448
- msgstr "Görüntüleme seçenekleri (<small>RSS için</small>)"
449
450
- #@ yarpp
451
#: options-meta-boxes.php:221
452
msgid "Display related posts in feeds?"
453
- msgstr "Benzer yazıları beslemelerde (feed) göster?"
454
455
- #@ yarpp
456
#: options-meta-boxes.php:221
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 "Bu özelllik RSS ve Atom beslemelerinde, her bir gönderinin sonuna \"Benzer Yazılar\" bölümü ekler. Kodlarda bir değişiklik yapmanıza gerek yoktur."
459
460
- #@ yarpp
461
#: options-meta-boxes.php:223
462
msgid "Display related posts in the descriptions?"
463
msgstr "Benzer yazıları açıklama (descriptions) kısmında göster?"
464
465
- #@ yarpp
466
#: options-meta-boxes.php:223
467
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."
468
- msgstr "RSS'nin açıklama kısmında benzer yazıları gösterir, sadece içeriği değil. Eğer beslemeniz (RSS) sadece alıntıları göstermeye ayarlamışsa, sadece açıklama (description) alanı kullanılıyorsa, bu özellik gereklidir."
469
470
- #@ yarpp
471
#: options-meta-boxes.php:221
472
msgid "RSS display code example"
473
- msgstr "RSS'e eklenecek kod örneği"
474
475
- #@ yarpp
476
#: options-meta-boxes.php:250
477
msgid "Before / after (excerpt):"
478
- msgstr "Öncesi & sonrası (özet):"
479
480
- #@ yarpp
481
#: options.php:279
482
msgid "Update options"
483
- msgstr "Seçenekleri güncelle"
484
485
- #@ yarpp
486
#: options.php:280
487
msgid "Do you really want to reset your configuration?"
488
msgstr "Ayarlarınızı sıfırlamak istediğinizden emin misiniz?"
489
490
- #@ yarpp
491
#: options.php:280
492
msgid "Reset options"
493
msgstr "Ayarları sıfırla"
494
495
- #@ yarpp
496
#: template-builtin.php:35
497
#, php-format
498
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."
499
- msgstr "%f, YARPP eklentisinin belirlediği ve mevcut yazıyla bu benzer yazı arasındaki benzerlik skorudur. Bu değeri, blogunuzda yönetici olarak giriş yaptığınız için görüyorsunuz. Ziyaretçileriniz bu değerleri göremez."
500
501
- #@ yarpp
502
#: template-metabox.php:12
503
msgid "These are the related entries for this entry. Updating this post may change these related posts."
504
- msgstr "Bunlar, bu yazı için benzer gönderilerdir. Yazıyı güncellediğinizde bu gönderiler değişebilir."
505
506
- #@ yarpp
507
#: template-metabox.php:25
508
msgid "Whether all of these related entries are actually displayed and how they are displayed depends on your YARPP display options."
509
- msgstr "Bu benzer gönderilerin kaçının gösterileceği ve nasıl gösterileceği, düzenlediğiniz YARPP seçeneklerine bağlıdır."
510
511
- #@ default
512
#: includes.php:243
513
msgid "Title:"
514
- msgstr "Başlık:"
515
516
- #@ yarpp
517
#: includes.php:385
518
msgid "Related entries may be displayed once you save your entry"
519
- msgstr "Benzer gönderiler, gönderinizi kaydettikten sonra görüntülenebilecektir."
520
521
- #@ yarpp
522
#: options-meta-boxes.php:124
523
msgid "YARPP limits the related posts list by (1) a maximum number and (2) a <em>match threshold</em>."
524
- msgstr "YARPP, benzer yazı listesini (1) bir sayı sınırıyla, (2) bir <em>eşleşme eşiğiyle</em> belirler."
525
526
- #@ yarpp
527
#: options-meta-boxes.php:140
528
msgid "Show only previous posts?"
529
- msgstr "Yalnızca önceki yazıları göster?"
530
531
- #@ yarpp
532
#: options-meta-boxes.php:283
533
msgid "YARPP Forum"
534
- msgstr "YARPP Forumu"
535
536
- #@ yarpp
537
#: options-meta-boxes.php:284
538
msgid "YARPP on Twitter"
539
- msgstr "Twitter'da YARPP"
540
541
- #@ yarpp
542
#: options-meta-boxes.php:285
543
msgid "YARPP on the Web"
544
- msgstr "Web'de YARPP"
545
546
- #@ yarpp
547
#: options-meta-boxes.php:292
548
msgid "Contact YARPP"
549
- msgstr "YARPP'a ulaşın"
550
551
- #@ default
552
#: options.php:42
553
#, php-format
554
msgid "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox\" title=\"%3$s\">View version %4$s details</a> or <a href=\"%5$s\">update automatically</a>."
555
- msgstr "%1$s için yeni bir sürüm mevcut. <a href=\"%2$s\" class=\"thickbox\" title=\"%3$s\">%4$s numaralı sürüm değişikliklerini okuyun</a> veya <a href=\"%5$s\">otomatik olarak güncelleyin</a>."
556
557
- #@ yarpp
558
#: options.php:86
559
#, php-format
560
msgid "Please try <a href=\"%s\" target=\"_blank\">manual SQL setup</a>."
561
- msgstr "Lütfen <a href=\"%s\" target=\"_blank\">elle SQL kurulumunu</a> deneyin."
562
563
- #@ yarpp
564
#: options.php:188
565
#, php-format
566
msgid "by <a href=\"%s\" target=\"_blank\">mitcho (Michael 芳貴 Erlewine)</a>"
567
- msgstr "<a href=\"%s\" target=\"_blank\">mitcho (Michael 芳貴 Erlewine)</a>"
568
3
"Project-Id-Version: Yet Another Related Posts Plugin v3.0.13\n"
4
"Report-Msgid-Bugs-To: \n"
5
"POT-Creation-Date: \n"
6
+ "PO-Revision-Date: 2009-09-17 15:10+0300\n"
7
+ "Last-Translator: Nurullah DEMIR <ndemir@live.com>\n"
8
+ "Language-Team: \n"
9
"MIME-Version: 1.0\n"
10
"Content-Type: text/plain; charset=UTF-8\n"
11
"Content-Transfer-Encoding: 8bit\n"
13
"X-Poedit-Language: Turkish\n"
14
"X-Poedit-Country: TURKEY\n"
15
"X-Poedit-SourceCharset: utf-8\n"
16
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
17
"X-Poedit-Basepath: ../\n"
18
+ "X-Poedit-Bookmarks: \n"
19
"X-Poedit-SearchPath-0: .\n"
20
+ "X-Textdomain-Support: yes"
21
22
#: includes.php:26
23
#: includes.php:37
24
+ #@ yarpp
25
msgid "Related posts:"
26
msgstr "Benzer yazılar:"
27
28
#: includes.php:28
29
#: includes.php:39
30
#: template-metabox.php:27
31
#: template-widget.php:13
32
+ #@ yarpp
33
msgid "No related posts."
34
msgstr "Benzer yazı yok."
35
36
#: includes.php:149
37
#: includes.php:194
38
#: includes.php:215
39
+ #@ yarpp
40
msgid "Related Posts (YARPP)"
41
+ msgstr "Benzer Yazılar(YARPP)"
42
43
#: includes.php:169
44
+ #@ yarpp
45
msgid "Settings"
46
msgstr "Ayarlar"
47
48
#: includes.php:376
49
+ #@ yarpp
50
msgid "Related Posts"
51
msgstr "Benzer Yazılar"
52
53
#: cache-postmeta.php:105
54
#: cache-tables.php:131
55
+ #@ yarpp
56
msgid "Example post "
57
msgstr "Örnek yazı"
58