WordPress Related Posts - Version 1.2

Version Description

  • Compatible with WordPress 3.0
Download this release

Release Info

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

Code changes from version 1.1.1 to 1.2

Files changed (2) hide show
  1. readme.txt +5 -2
  2. wp_related_posts.php +5 -5
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
- === Plugin Name ===
2
  Contributors: denishua
3
  Tags: Related,Posts
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8490579
5
  Requires at least: 2.3
6
  Tested up to: 2.8.4
7
- Stable tag: 1.1.1
8
 
9
  WordPress Related Posts Plugin will generate a related posts via WordPress tags, and add the related posts to feed.
10
 
@@ -27,6 +27,9 @@ Please search and submit your transaltion here: <a href="http://fairyfish.net/20
27
 
28
  == Changelog ==
29
 
 
 
 
30
  = 1.1 =
31
  * fix don't display in Feed problem
32
 
1
+ === Plugin Name ===
2
  Contributors: denishua
3
  Tags: Related,Posts
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8490579
5
  Requires at least: 2.3
6
  Tested up to: 2.8.4
7
+ Stable tag: 1.2
8
 
9
  WordPress Related Posts Plugin will generate a related posts via WordPress tags, and add the related posts to feed.
10
 
27
 
28
  == Changelog ==
29
 
30
+ = 1.2 =
31
+ * Compatible with WordPress 3.0
32
+
33
  = 1.1 =
34
  * fix don't display in Feed problem
35
 
wp_related_posts.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: WordPress Related Posts
4
- Version: 1.1.1
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
@@ -14,14 +14,14 @@ function init_textdomain(){
14
  }
15
 
16
  function wp_get_related_posts($before_title="",$after_title="") {
17
- global $wpdb, $post,$table_prefix;
18
  $wp_rp = get_option("wp_rp");
19
 
20
  $wp_rp_title = $wp_rp["wp_rp_title"];
21
 
22
  $exclude = explode(",",$wp_rp["wp_rp_exclude"]);
23
  if ( $exclude != '' ) {
24
- $q = 'SELECT tt.term_id FROM '. $table_prefix .'term_taxonomy tt, ' . $table_prefix . 'term_relationships tr WHERE tt.taxonomy = \'category\' AND tt.term_taxonomy_id = tr.term_taxonomy_id AND tr.object_id = '.$post->ID;
25
 
26
  $cats = $wpdb->get_results($q);
27
 
@@ -152,9 +152,9 @@ function wp_related_posts_auto($content){
152
  add_filter('the_content', 'wp_related_posts_auto',99);
153
 
154
  function wp_get_random_posts ($limitclause="") {
155
- global $wpdb, $tableposts, $post;
156
 
157
- $q = "SELECT ID, post_title, post_content,post_excerpt, post_date, comment_count FROM $tableposts WHERE post_status = 'publish' AND post_type = 'post' AND ID != $post->ID ORDER BY RAND() $limitclause";
158
  return $wpdb->get_results($q);
159
  }
160
 
1
  <?php
2
  /*
3
  Plugin Name: WordPress Related Posts
4
+ Version: 1.2
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
14
  }
15
 
16
  function wp_get_related_posts($before_title="",$after_title="") {
17
+ global $wpdb, $post;
18
  $wp_rp = get_option("wp_rp");
19
 
20
  $wp_rp_title = $wp_rp["wp_rp_title"];
21
 
22
  $exclude = explode(",",$wp_rp["wp_rp_exclude"]);
23
  if ( $exclude != '' ) {
24
+ $q = 'SELECT tt.term_id FROM '. $wpdb->term_taxonomy.' tt, ' . $wpdb->term_relationships.' tr WHERE tt.taxonomy = \'category\' AND tt.term_taxonomy_id = tr.term_taxonomy_id AND tr.object_id = '.$post->ID;
25
 
26
  $cats = $wpdb->get_results($q);
27
 
152
  add_filter('the_content', 'wp_related_posts_auto',99);
153
 
154
  function wp_get_random_posts ($limitclause="") {
155
+ global $wpdb, $post;
156
 
157
+ $q = "SELECT ID, post_title, post_content,post_excerpt, post_date, comment_count FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' AND ID != $post->ID ORDER BY RAND() $limitclause";
158
  return $wpdb->get_results($q);
159
  }
160