WordPress Related Posts - Version 0.9

Version Description

Download this release

Release Info

Developer denishua
Plugin Icon wp plugin WordPress Related Posts
Version 0.9
Comparing to
See all releases

Code changes from version 0.7 to 0.9

Thumbs.db DELETED
Binary file
WPRP/lang/default.mo DELETED
Binary file
WPRP/lang/default.po DELETED
@@ -1,102 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: wp_related_post\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2008-03-20 21:45+0800\n"
6
- "PO-Revision-Date: \n"
7
- "Last-Translator: Denis <honghua.deng@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
- "X-Poedit-KeywordsList: __;_e\n"
13
- "X-Poedit-Basepath: .\n"
14
- "X-Poedit-SearchPath-0: .\n"
15
-
16
- #: wp_related_posts.php:129
17
- msgid "No Related Post"
18
- msgstr ""
19
-
20
- #: wp_related_posts.php:133
21
- #: wp_related_posts.php:326
22
- msgid "Random Posts"
23
- msgstr ""
24
-
25
- #: wp_related_posts.php:136
26
- #: wp_related_posts.php:327
27
- msgid "Most Commented Posts"
28
- msgstr ""
29
-
30
- #: wp_related_posts.php:139
31
- #: wp_related_posts.php:329
32
- msgid "Most Popular Posts"
33
- msgstr ""
34
-
35
- #: wp_related_posts.php:142
36
- msgid "Something wrong"
37
- msgstr ""
38
-
39
- #: wp_related_posts.php:277
40
- msgid "WordPress Related Posts"
41
- msgstr ""
42
-
43
- #: wp_related_posts.php:309
44
- msgid "Related Posts Options&hellip;"
45
- msgstr ""
46
-
47
- #: wp_related_posts.php:310
48
- msgid "WordPress Related Posts Plugin will generate a related posts via WordPress tags, and add the related posts to feed."
49
- msgstr ""
50
-
51
- #: wp_related_posts.php:312
52
- msgid "Related Posts Preference"
53
- msgstr ""
54
-
55
- #: wp_related_posts.php:315
56
- msgid "Related Posts Title:"
57
- msgstr ""
58
-
59
- #: wp_related_posts.php:321
60
- msgid "When No Related Posts, Dispaly:"
61
- msgstr ""
62
-
63
- #: wp_related_posts.php:325
64
- msgid "Text: 'No Related Posts'"
65
- msgstr ""
66
-
67
- #: wp_related_posts.php:335
68
- msgid "No Related Post's Title or Text:"
69
- msgstr ""
70
-
71
- #: wp_related_posts.php:341
72
- msgid "Limit:"
73
- msgstr ""
74
-
75
- #: wp_related_posts.php:347
76
- msgid "Exclude(category IDs):"
77
- msgstr ""
78
-
79
- #: wp_related_posts.php:353
80
- msgid "Other Setting:"
81
- msgstr ""
82
-
83
- #: wp_related_posts.php:363
84
- msgid "Auto Insert Related Posts"
85
- msgstr ""
86
-
87
- #: wp_related_posts.php:374
88
- msgid "Related Posts for RSS"
89
- msgstr ""
90
-
91
- #: wp_related_posts.php:385
92
- msgid "Display Comments Count"
93
- msgstr ""
94
-
95
- #: wp_related_posts.php:396
96
- msgid "Display Post Date"
97
- msgstr ""
98
-
99
- #: wp_related_posts.php:403
100
- msgid "Update Preferences &raquo;"
101
- msgstr ""
102
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
WPRP/lang/wp_related_posts-zh_CN.mo DELETED
Binary file
WPRP/lang/wp_related_posts-zh_CN.po DELETED
@@ -1,105 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: WordPress 2.3 Related Posts Plugin v0.2\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2008-03-20 21:43+0800\n"
6
- "PO-Revision-Date: 2008-03-20 21:44+0800\n"
7
- "Last-Translator: Denis <honghua.deng@gmail.com>\n"
8
- "Language-Team: WordPress 中文团队 <team@wp-cn.com>\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "X-Poedit-KeywordsList: _e;__\n"
13
- "X-Poedit-Basepath: .\n"
14
- "X-Poedit-SearchPath-0: .\n"
15
-
16
- #: wp_related_posts.php:129
17
- msgid "No Related Post"
18
- msgstr "暂无相关日志"
19
-
20
- #: wp_related_posts.php:133
21
- #: wp_related_posts.php:326
22
- msgid "Random Posts"
23
- msgstr "随机日志"
24
-
25
- #: wp_related_posts.php:136
26
- #: wp_related_posts.php:327
27
- msgid "Most Commented Posts"
28
- msgstr "最多留言日志"
29
-
30
- #: wp_related_posts.php:139
31
- #: wp_related_posts.php:329
32
- msgid "Most Popular Posts"
33
- msgstr "最流行日志"
34
-
35
- #: wp_related_posts.php:142
36
- msgid "Something wrong"
37
- msgstr "发生错误了"
38
-
39
- #: wp_related_posts.php:277
40
- msgid "WordPress Related Posts"
41
- msgstr "WordPress 相关日志"
42
-
43
- #: wp_related_posts.php:309
44
- msgid "Related Posts Options&hellip;"
45
- msgstr "相关日志选项 &hellip;"
46
-
47
- #: wp_related_posts.php:310
48
- msgid "WordPress Related Posts Plugin will generate a related posts via WordPress tags, and add the related posts to feed."
49
- msgstr "WordPress 相关日志插件可以通过 WordPress 的标签系统产生一个相关日志列表,并可以添加相关日志至 RSS 中。"
50
-
51
- #: wp_related_posts.php:312
52
- msgid "Related Posts Preference"
53
- msgstr "相关日志设置"
54
-
55
- #: wp_related_posts.php:315
56
- msgid "Related Posts Title:"
57
- msgstr "相关日志列表的标题:"
58
-
59
- #: wp_related_posts.php:321
60
- msgid "When No Related Posts, Dispaly:"
61
- msgstr "当没有相关日志时,显示:"
62
-
63
- #: wp_related_posts.php:325
64
- msgid "Text: 'No Related Posts'"
65
- msgstr "文本:“无相关日志”"
66
-
67
- #: wp_related_posts.php:335
68
- msgid "No Related Post's Title or Text:"
69
- msgstr "无相关日志时的标题或文本:"
70
-
71
- #: wp_related_posts.php:341
72
- msgid "Limit:"
73
- msgstr "显示的项数:"
74
-
75
- #: wp_related_posts.php:347
76
- msgid "Exclude(category IDs):"
77
- msgstr "不包括(分类ID):"
78
-
79
- #: wp_related_posts.php:353
80
- msgid "Other Setting:"
81
- msgstr "其他设置"
82
-
83
- #: wp_related_posts.php:363
84
- msgid "Auto Insert Related Posts"
85
- msgstr "自动插入相关日志"
86
-
87
- #: wp_related_posts.php:374
88
- msgid "Related Posts for RSS"
89
- msgstr "在RSS中添加相关日志"
90
-
91
- #: wp_related_posts.php:385
92
- msgid "Display Comments Count"
93
- msgstr "显示留言数"
94
-
95
- #: wp_related_posts.php:396
96
- msgid "Display Post Date"
97
- msgstr "显示日期"
98
-
99
- #: wp_related_posts.php:403
100
- msgid "Update Preferences &raquo;"
101
- msgstr "更新选项 &raquo;"
102
-
103
- #~ msgid "Related Post"
104
- #~ msgstr "相关日志"
105
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: Related,Posts
4
  Donate link: http://fairyfish.net/donate/
5
  Requires at least: 2.3
6
  Tested up to: 2.5
7
- Stable tag: 0.7
8
 
9
  WordPress Related Posts Plugin will generate a related posts via WordPress tags, and add the related posts to feed.
10
 
@@ -12,6 +12,7 @@ WordPress Related Posts Plugin will generate a related posts via WordPress tags,
12
 
13
  WordPress Related Posts Plugin will generate a related posts via WordPress tags, and add the related posts to feed.
14
 
 
15
 
16
  == Installation ==
17
 
4
  Donate link: http://fairyfish.net/donate/
5
  Requires at least: 2.3
6
  Tested up to: 2.5
7
+ Stable tag: 0.9
8
 
9
  WordPress Related Posts Plugin will generate a related posts via WordPress tags, and add the related posts to feed.
10
 
12
 
13
  WordPress Related Posts Plugin will generate a related posts via WordPress tags, and add the related posts to feed.
14
 
15
+ Please search and submit your transaltion here: <a href="http://fairyfish.net/2008/06/06/wordpress-related-posts-plugin-translation/">http://fairyfish.net/2008/06/06/wordpress-related-posts-plugin-translation/</a>
16
 
17
  == Installation ==
18
 
WPRP/wp_related_posts.php → wp_related_posts.php RENAMED
@@ -1,10 +1,10 @@
1
  <?php
2
  /*
3
  Plugin Name: WordPress Related Posts
4
- Version: 0.7
5
  Plugin URI: http://fairyfish.net/2007/09/12/wordpress-23-related-posts-plugin/
6
- Description: Generate a related posts list via tags of WorPdress
7
- Author: Denis,PaoPao
8
  Author URI: http://fairyfish.net/
9
 
10
  Copyright (c) 2007
@@ -30,7 +30,10 @@ http://www.gnu.org/licenses/gpl.txt
30
  Just install the plugin in your blog and activate
31
  */
32
 
33
- load_plugin_textdomain('wp_related_posts',PLUGINDIR . '/' . dirname(plugin_basename (__FILE__)) . '/lang');
 
 
 
34
 
35
  function wp_get_related_posts() {
36
  global $wpdb, $post,$table_prefix;
@@ -134,8 +137,32 @@ function wp_get_related_posts() {
134
 
135
  function wp_related_posts(){
136
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  $output = wp_get_related_posts() ;
138
- echo $output;
 
 
 
 
 
 
 
 
 
 
139
  }
140
 
141
  function wp23_related_posts() {
@@ -271,99 +298,114 @@ function wp_related_posts_options_subpanel() {
271
  <div class="wrap">
272
  <h2 id="write-post"><?php _e("Related Posts Options&hellip;",'wp_related_posts');?></h2>
273
  <p><?php _e("WordPress Related Posts Plugin will generate a related posts via WordPress tags, and add the related posts to feed.",'wp_related_posts');?></p>
274
- <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=<?php echo basename(__FILE__); ?>">
275
- <h3><?php _e("Related Posts Preference",'wp_related_posts');?></h3>
276
- <table class="form-table">
277
- <tr>
278
- <th><?php _e("Related Posts Title:",'wp_related_posts'); ?></th>
279
- <td>
280
- <input type="text" name="wp_rp_title_option" value="<?php echo $wp_rp["wp_rp_title"]; ?>" />
281
- </td>
282
- </tr>
283
- <tr>
284
- <th><?php _e("When No Related Posts, Dispaly:",'wp_related_posts'); ?></th>
285
- <td>
286
- <?php $wp_no_rp = $wp_rp["wp_no_rp"]; ?>
287
- <select name="wp_no_rp_option" >
288
- <option value="text" <?php if($wp_no_rp == 'text') echo 'selected' ?> ><?php _e("Text: 'No Related Posts'",'wp_related_posts'); ?></option>
289
- <option value="random" <?php if($wp_no_rp == 'random') echo 'selected' ?>><?php _e("Random Posts",'wp_related_posts'); ?></option>
290
- <option value="commented" <?php if($wp_no_rp == 'commented') echo 'selected' ?>><?php _e("Most Commented Posts",'wp_related_posts'); ?></option>
291
- <?php if (function_exists('akpc_most_popular')){ ?>
292
- <option value="popularity" <?php if($wp_no_rp == 'popularity') echo 'selected' ?>><?php _e("Most Popular Posts",'wp_related_posts'); ?></option>
293
- <?php } ?>
294
- </select>
295
- </td>
296
- </tr>
297
- <tr>
298
- <th><?php _e("No Related Post's Title or Text:",'wp_related_posts'); ?></th>
299
- <td>
300
- <input type="text" name="wp_no_rp_text_option" value="<?php echo $wp_rp["wp_no_rp_text"]; ?>" />
301
- </td>
302
- </tr>
303
- <tr>
304
- <th><?php _e("Limit:",'wp_related_posts');?></th>
305
- <td>
306
- <input type="text" name="wp_rp_limit_option" value="<?php echo $wp_rp["wp_rp_limit"]; ?>" />
307
- </td>
308
- </tr>
309
- <tr>
310
- <th><?php _e("Exclude(category IDs):",'wp_related_posts');?></th>
311
- <td>
312
- <input type="text" name="wp_rp_exclude_option" value="<?php echo $wp_rp["wp_rp_exclude"]; ?>" />
313
- </td>
314
- </tr>
315
- <tr>
316
- <th><?php _e("Other Setting:",'wp_related_posts');?></th>
317
- <td>
318
- <label>
319
- <?php
320
- if ( $wp_rp["wp_rp_auto"] == 'yes' ) {
321
- echo '<input name="wp_rp_auto_option" type="checkbox" value="yes" checked>';
322
- } else {
323
- echo '<input name="wp_rp_auto_option" type="checkbox" value="yes">';
324
- }
325
- ?>
326
- <?php _e("Auto Insert Related Posts",'wp_related_posts');?>
327
- </label>
328
- <br />
329
- <label>
330
- <?php
331
- if ( $wp_rp["wp_rp_rss"] == 'yes' ) {
332
- echo '<input name="wp_rp_rss_option" type="checkbox" value="yes" checked>';
333
- } else {
334
- echo '<input name="wp_rp_rss_option" type="checkbox" value="yes">';
335
- }
336
- ?>
337
- <?php _e("Related Posts for RSS",'wp_related_posts');?>
338
- </label>
339
- <br />
340
- <label>
341
- <?php
342
- if ( $wp_rp["wp_rp_comments"] == 'yes' ) {
343
- echo '<input name="wp_rp_comments_option" type="checkbox" value="yes" checked>';
344
- } else {
345
- echo '<input name="wp_rp_comments_option" type="checkbox" value="yes">';
346
- }
347
- ?>
348
- <?php _e("Display Comments Count",'wp_related_posts');?>
349
- </label>
350
- <br />
351
- <label>
352
- <?php
353
- if ( $wp_rp["wp_rp_date"] == 'yes' ) {
354
- echo '<input name="wp_rp_date_option" type="checkbox" value="yes" checked>';
355
- } else {
356
- echo '<input name="wp_rp_date_option" type="checkbox" value="yes">';
357
- }
358
- ?>
359
- <?php _e("Display Post Date",'wp_related_posts');?>
360
- </label>
361
- <br />
362
- </td>
363
- </tr>
364
- </table>
365
-
366
- <p class="submit"><input type="submit" value="<?php _e("Update Preferences &raquo;",'wp_related_posts');?>" name="wp_rp_Submit" /></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
367
  </form>
368
- </div>
369
  <?php }?>
1
  <?php
2
  /*
3
  Plugin Name: WordPress Related Posts
4
+ Version: 0.9
5
  Plugin URI: http://fairyfish.net/2007/09/12/wordpress-23-related-posts-plugin/
6
+ Description: Generate a related posts list via tags of WordPress
7
+ Author: Denis
8
  Author URI: http://fairyfish.net/
9
 
10
  Copyright (c) 2007
30
  Just install the plugin in your blog and activate
31
  */
32
 
33
+ add_action('init', 'init_textdomain');
34
+ function init_textdomain(){
35
+ load_plugin_textdomain('wp_related_posts',PLUGINDIR . '/' . dirname(plugin_basename (__FILE__)) . '/lang');
36
+ }
37
 
38
  function wp_get_related_posts() {
39
  global $wpdb, $post,$table_prefix;
137
 
138
  function wp_related_posts(){
139
 
140
+ global $id;
141
+
142
+ $preview = $_GET['preview'];
143
+
144
+ $output_old = get_post_meta($id, "related_posts", $single = true);
145
+
146
+ if($output_old){
147
+ $time = time();
148
+ if(($time - $output_old["time"])<600){
149
+ echo $output_old["related_posts"];
150
+ return;
151
+ }
152
+ }
153
+
154
  $output = wp_get_related_posts() ;
155
+
156
+ $output_new = array("time"=>time(),"related_posts"=>$output);
157
+ if($output_old){
158
+ update_post_meta($id, 'related_posts', $output_new);
159
+ }else{
160
+ if(!add_post_meta($id, 'related_posts', $output_new, true)){
161
+ update_post_meta($id, 'related_posts', $output_new);
162
+ }
163
+ }
164
+
165
+ echo $output;
166
  }
167
 
168
  function wp23_related_posts() {
298
  <div class="wrap">
299
  <h2 id="write-post"><?php _e("Related Posts Options&hellip;",'wp_related_posts');?></h2>
300
  <p><?php _e("WordPress Related Posts Plugin will generate a related posts via WordPress tags, and add the related posts to feed.",'wp_related_posts');?></p>
301
+ <div style="float:right;">
302
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
303
+ <input type="hidden" name="cmd" value="_donations">
304
+ <input type="hidden" name="business" value="honghua.deng@gmail.com">
305
+ <input type="hidden" name="item_name" value="Donate to fairyfish.net">
306
+ <input type="hidden" name="no_shipping" value="0">
307
+ <input type="hidden" name="no_note" value="1">
308
+ <input type="hidden" name="currency_code" value="USD">
309
+ <input type="hidden" name="tax" value="0">
310
+ <input type="hidden" name="lc" value="US">
311
+ <input type="hidden" name="bn" value="PP-DonationsBF">
312
+ <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
313
+ <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
314
+ </form>
315
+ </div>
316
+ <h3><?php _e("Related Posts Preference",'wp_related_posts');?></h3>
317
+ <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=<?php echo basename(__FILE__); ?>">
318
+
319
+ <table class="form-table">
320
+ <tr>
321
+ <th><?php _e("Related Posts Title:",'wp_related_posts'); ?></th>
322
+ <td>
323
+ <input type="text" name="wp_rp_title_option" value="<?php echo $wp_rp["wp_rp_title"]; ?>" />
324
+ </td>
325
+ </tr>
326
+ <tr>
327
+ <th><?php _e("When No Related Posts, Dispaly:",'wp_related_posts'); ?></th>
328
+ <td>
329
+ <?php $wp_no_rp = $wp_rp["wp_no_rp"]; ?>
330
+ <select name="wp_no_rp_option" >
331
+ <option value="text" <?php if($wp_no_rp == 'text') echo 'selected' ?> ><?php _e("Text: 'No Related Posts'",'wp_related_posts'); ?></option>
332
+ <option value="random" <?php if($wp_no_rp == 'random') echo 'selected' ?>><?php _e("Random Posts",'wp_related_posts'); ?></option>
333
+ <option value="commented" <?php if($wp_no_rp == 'commented') echo 'selected' ?>><?php _e("Most Commented Posts",'wp_related_posts'); ?></option>
334
+ <?php if (function_exists('akpc_most_popular')){ ?>
335
+ <option value="popularity" <?php if($wp_no_rp == 'popularity') echo 'selected' ?>><?php _e("Most Popular Posts",'wp_related_posts'); ?></option>
336
+ <?php } ?>
337
+ </select>
338
+ </td>
339
+ </tr>
340
+ <tr>
341
+ <th><?php _e("No Related Post's Title or Text:",'wp_related_posts'); ?></th>
342
+ <td>
343
+ <input type="text" name="wp_no_rp_text_option" value="<?php echo $wp_rp["wp_no_rp_text"]; ?>" />
344
+ </td>
345
+ </tr>
346
+ <tr>
347
+ <th><?php _e("Limit:",'wp_related_posts');?></th>
348
+ <td>
349
+ <input type="text" name="wp_rp_limit_option" value="<?php echo $wp_rp["wp_rp_limit"]; ?>" />
350
+ </td>
351
+ </tr>
352
+ <tr>
353
+ <th><?php _e("Exclude(category IDs):",'wp_related_posts');?></th>
354
+ <td>
355
+ <input type="text" name="wp_rp_exclude_option" value="<?php echo $wp_rp["wp_rp_exclude"]; ?>" />
356
+ </td>
357
+ </tr>
358
+ <tr>
359
+ <th><?php _e("Other Setting:",'wp_related_posts');?></th>
360
+ <td>
361
+ <label>
362
+ <?php
363
+ if ( $wp_rp["wp_rp_auto"] == 'yes' ) {
364
+ echo '<input name="wp_rp_auto_option" type="checkbox" value="yes" checked>';
365
+ } else {
366
+ echo '<input name="wp_rp_auto_option" type="checkbox" value="yes">';
367
+ }
368
+ ?>
369
+ <?php _e("Auto Insert Related Posts",'wp_related_posts');?>
370
+ </label>
371
+ <br />
372
+ <label>
373
+ <?php
374
+ if ( $wp_rp["wp_rp_rss"] == 'yes' ) {
375
+ echo '<input name="wp_rp_rss_option" type="checkbox" value="yes" checked>';
376
+ } else {
377
+ echo '<input name="wp_rp_rss_option" type="checkbox" value="yes">';
378
+ }
379
+ ?>
380
+ <?php _e("Related Posts for RSS",'wp_related_posts');?>
381
+ </label>
382
+ <br />
383
+ <label>
384
+ <?php
385
+ if ( $wp_rp["wp_rp_comments"] == 'yes' ) {
386
+ echo '<input name="wp_rp_comments_option" type="checkbox" value="yes" checked>';
387
+ } else {
388
+ echo '<input name="wp_rp_comments_option" type="checkbox" value="yes">';
389
+ }
390
+ ?>
391
+ <?php _e("Display Comments Count",'wp_related_posts');?>
392
+ </label>
393
+ <br />
394
+ <label>
395
+ <?php
396
+ if ( $wp_rp["wp_rp_date"] == 'yes' ) {
397
+ echo '<input name="wp_rp_date_option" type="checkbox" value="yes" checked>';
398
+ } else {
399
+ echo '<input name="wp_rp_date_option" type="checkbox" value="yes">';
400
+ }
401
+ ?>
402
+ <?php _e("Display Post Date",'wp_related_posts');?>
403
+ </label>
404
+ <br />
405
+ </td>
406
+ </tr>
407
+ </table>
408
+ <p class="submit"><input type="submit" value="<?php _e("Update Preferences &raquo;",'wp_related_posts');?>" name="wp_rp_Submit" /></p>
409
  </form>
410
+ </div>
411
  <?php }?>