Contextual Related Posts - Version 1.7.2

Version Description

  • Fixed: Title attribute was missing for the thumbnails
  • Modified: Reverted the output code to v1.6.5 style with img wrapped in its own a tag

=

Download this release

Release Info

Developer Ajay
Plugin Icon 128x128 Contextual Related Posts
Version 1.7.2
Comparing to
See all releases

Code changes from version 1.7.1 to 1.7.2

Files changed (3) hide show
  1. admin.inc.php +5 -5
  2. contextual-related-posts.php +8 -7
  3. readme.txt +7 -9
admin.inc.php CHANGED
@@ -217,19 +217,19 @@ function crp_options() {
217
  <td>
218
  <label>
219
  <input type="radio" name="post_thumb_op" value="inline" id="post_thumb_op_0" <?php if ($crp_settings['post_thumb_op']=='inline') echo 'checked="checked"' ?> />
220
- <?php _e('Display thumbnails inline with posts, before title',crp_LOCAL_NAME); ?></label>
221
  <br />
222
  <label>
223
  <input type="radio" name="post_thumb_op" value="after" id="post_thumb_op_1" <?php if ($crp_settings['post_thumb_op']=='after') echo 'checked="checked"' ?> />
224
- <?php _e('Display thumbnails inline with posts, after title',crp_LOCAL_NAME); ?></label>
225
  <br />
226
  <label>
227
  <input type="radio" name="post_thumb_op" value="thumbs_only" id="post_thumb_op_2" <?php if ($crp_settings['post_thumb_op']=='thumbs_only') echo 'checked="checked"' ?> />
228
- <?php _e('Display only thumbnails, no text',crp_LOCAL_NAME); ?></label>
229
  <br />
230
  <label>
231
  <input type="radio" name="post_thumb_op" value="text_only" id="post_thumb_op_3" <?php if ($crp_settings['post_thumb_op']=='text_only') echo 'checked="checked"' ?> />
232
- <?php _e('Do not display thumbnails, only text.',crp_LOCAL_NAME); ?></label>
233
  <br />
234
  </td>
235
  </tr>
@@ -246,7 +246,7 @@ function crp_options() {
246
  <td><input type="checkbox" name="scan_images" id="scan_images" <?php if ($crp_settings[scan_images]) echo 'checked="checked"' ?> /> <br /><?php _e('This can slow down the loading of your page if the first image in the related posts is large in file-size',CRP_LOCAL_NAME); ?></td>
247
  </tr>
248
  <tr style="vertical-align: top;"><th scope="row"><label for="thumb_default_show"><?php _e('Use default thumbnail? ',CRP_LOCAL_NAME); ?></label></th>
249
- <td><input type="checkbox" name="thumb_default_show" id="thumb_default_show" <?php if ($crp_settings[thumb_default_show]) echo 'checked="checked"' ?> /> <br /><?php _e('If checked, when no thumbnail is found, show a default one from the URL below. If not checked and no thumbnail is found, no image will be shown.',crp_LOCAL_NAME); ?></td>
250
  </tr>
251
  <tr style="vertical-align: top;"><th scope="row"><label for="thumb_default"><?php _e('Default thumbnail: ',CRP_LOCAL_NAME); ?></label></th>
252
  <td><input type="textbox" name="thumb_default" id="thumb_default" value="<?php echo attribute_escape(stripslashes($crp_settings[thumb_default])); ?>" style="width:500px"> <br /><?php _e('The plugin will first check if the post contains a thumbnail. If it doesn\'t then it will check the meta field. If this is not available, then it will show the default image as specified above',CRP_LOCAL_NAME); ?></td>
217
  <td>
218
  <label>
219
  <input type="radio" name="post_thumb_op" value="inline" id="post_thumb_op_0" <?php if ($crp_settings['post_thumb_op']=='inline') echo 'checked="checked"' ?> />
220
+ <?php _e('Display thumbnails inline with posts, before title',CRP_LOCAL_NAME); ?></label>
221
  <br />
222
  <label>
223
  <input type="radio" name="post_thumb_op" value="after" id="post_thumb_op_1" <?php if ($crp_settings['post_thumb_op']=='after') echo 'checked="checked"' ?> />
224
+ <?php _e('Display thumbnails inline with posts, after title',CRP_LOCAL_NAME); ?></label>
225
  <br />
226
  <label>
227
  <input type="radio" name="post_thumb_op" value="thumbs_only" id="post_thumb_op_2" <?php if ($crp_settings['post_thumb_op']=='thumbs_only') echo 'checked="checked"' ?> />
228
+ <?php _e('Display only thumbnails, no text',CRP_LOCAL_NAME); ?></label>
229
  <br />
230
  <label>
231
  <input type="radio" name="post_thumb_op" value="text_only" id="post_thumb_op_3" <?php if ($crp_settings['post_thumb_op']=='text_only') echo 'checked="checked"' ?> />
232
+ <?php _e('Do not display thumbnails, only text.',CRP_LOCAL_NAME); ?></label>
233
  <br />
234
  </td>
235
  </tr>
246
  <td><input type="checkbox" name="scan_images" id="scan_images" <?php if ($crp_settings[scan_images]) echo 'checked="checked"' ?> /> <br /><?php _e('This can slow down the loading of your page if the first image in the related posts is large in file-size',CRP_LOCAL_NAME); ?></td>
247
  </tr>
248
  <tr style="vertical-align: top;"><th scope="row"><label for="thumb_default_show"><?php _e('Use default thumbnail? ',CRP_LOCAL_NAME); ?></label></th>
249
+ <td><input type="checkbox" name="thumb_default_show" id="thumb_default_show" <?php if ($crp_settings[thumb_default_show]) echo 'checked="checked"' ?> /> <br /><?php _e('If checked, when no thumbnail is found, show a default one from the URL below. If not checked and no thumbnail is found, no image will be shown.',CRP_LOCAL_NAME); ?></td>
250
  </tr>
251
  <tr style="vertical-align: top;"><th scope="row"><label for="thumb_default"><?php _e('Default thumbnail: ',CRP_LOCAL_NAME); ?></label></th>
252
  <td><input type="textbox" name="thumb_default" id="thumb_default" value="<?php echo attribute_escape(stripslashes($crp_settings[thumb_default])); ?>" style="width:500px"> <br /><?php _e('The plugin will first check if the post contains a thumbnail. If it doesn\'t then it will check the meta field. If this is not available, then it will show the default image as specified above',CRP_LOCAL_NAME); ?></td>
contextual-related-posts.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Contextual Related Posts
4
- Version: 1.7.1
5
  Plugin URI: http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/
6
  Description: Displaying a set of related posts on your website or in your feed. Increase reader retention and reduce bounce rates
7
  Author: Ajay D'Souza
@@ -93,17 +93,17 @@ function ald_crp() {
93
  if (!$p_in_c) {
94
  $output .= $crp_settings['before_list_item'];
95
 
96
- $output .= '<a href="'.get_permalink($search->ID).'" rel="bookmark" class="crp_link">'; // Add beginning of link
97
  if ($crp_settings['post_thumb_op']=='after') {
98
- $output .= '<span class="crp_title"> '.$title.'</span>'; // Add title if post thumbnail is to be displayed after
99
  }
100
  if ($crp_settings['post_thumb_op']=='inline' || $crp_settings['post_thumb_op']=='after' || $crp_settings['post_thumb_op']=='thumbs_only') {
101
- $output .= crp_get_the_post_thumbnail($search->ID);
102
  }
103
  if ($crp_settings['post_thumb_op']=='inline' || $crp_settings['post_thumb_op']=='text_only') {
104
- $output .= '<span class="crp_title"> '.$title.'</span>'; // Add title when required by settings
105
  }
106
- $output .= '</a>'; // Close the link
107
  if ($crp_settings['show_excerpt']) {
108
  $output .= '<span class="crp_excerpt"> '.crp_excerpt($search->ID,$crp_settings['excerpt_length']).'</span>';
109
  }
@@ -242,7 +242,8 @@ function crp_get_the_post_thumbnail($postid) {
242
  $result = get_post($postid);
243
  $crp_settings = crp_read_options();
244
  $output = '';
245
-
 
246
  if (function_exists('has_post_thumbnail') && has_post_thumbnail($result->ID)) {
247
  $output .= get_the_post_thumbnail($result->ID, array($crp_settings[thumb_width],$crp_settings[thumb_height]), array('title' => $title,'alt' => $title, 'class' => 'crp_thumb', 'border' => '0'));
248
  } else {
1
  <?php
2
  /*
3
  Plugin Name: Contextual Related Posts
4
+ Version: 1.7.2
5
  Plugin URI: http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/
6
  Description: Displaying a set of related posts on your website or in your feed. Increase reader retention and reduce bounce rates
7
  Author: Ajay D'Souza
93
  if (!$p_in_c) {
94
  $output .= $crp_settings['before_list_item'];
95
 
96
+ //$output .= '<a href="'.get_permalink($search->ID).'" rel="bookmark" class="crp_link">'; // Add beginning of link
97
  if ($crp_settings['post_thumb_op']=='after') {
98
+ $output .= '<a href="'.get_permalink($search->ID).'" rel="bookmark" class="crp_title">'.$title.'</a>'; // Add title if post thumbnail is to be displayed after
99
  }
100
  if ($crp_settings['post_thumb_op']=='inline' || $crp_settings['post_thumb_op']=='after' || $crp_settings['post_thumb_op']=='thumbs_only') {
101
+ $output .= '<a href="'.get_permalink($search->ID).'" rel="bookmark">'.crp_get_the_post_thumbnail($search->ID).'</a>';
102
  }
103
  if ($crp_settings['post_thumb_op']=='inline' || $crp_settings['post_thumb_op']=='text_only') {
104
+ $output .= '<a href="'.get_permalink($search->ID).'" rel="bookmark" class="crp_title">'.$title.'</a>'; // Add title when required by settings
105
  }
106
+ //$output .= '</a>'; // Close the link
107
  if ($crp_settings['show_excerpt']) {
108
  $output .= '<span class="crp_excerpt"> '.crp_excerpt($search->ID,$crp_settings['excerpt_length']).'</span>';
109
  }
242
  $result = get_post($postid);
243
  $crp_settings = crp_read_options();
244
  $output = '';
245
+ $title = get_the_title($postid);
246
+
247
  if (function_exists('has_post_thumbnail') && has_post_thumbnail($result->ID)) {
248
  $output .= get_the_post_thumbnail($result->ID, array($crp_settings[thumb_width],$crp_settings[thumb_height]), array('title' => $title,'alt' => $title, 'class' => 'crp_thumb', 'border' => '0'));
249
  } else {
readme.txt CHANGED
@@ -32,17 +32,17 @@ The list is based on the content of the title and/or content of the posts which
32
 
33
  == Upgrade Notice ==
34
 
35
- = 1.7.1 =
36
- * Fixed: Minor bug fix for location of thumbnail
37
-
38
- = 1.7 =
39
- * Added: Better thumbnail support
40
- * Added: Limited support for InnoDB
41
- * Modified: Cleaner Settings page interface
42
 
43
 
44
  == Changelog ==
45
 
 
 
 
 
46
  = 1.7.1 =
47
  * Fixed: Minor bug fix for location of thumbnail
48
 
@@ -162,8 +162,6 @@ The following CSS styles are available:
162
 
163
  * **crp_related**: ID of the main wrapper `div`
164
 
165
- * **crp_link**: Class of the `a` tag for each list item
166
-
167
  * **crp_title**: Class of the `span` tag for title of the post
168
 
169
  * **crp_excerpt**: Class of the `span` tag for excerpt (if included)
32
 
33
  == Upgrade Notice ==
34
 
35
+ = 1.7.2 =
36
+ * Fixed: Title attribute was missing for the thumbnails
37
+ * Modified: Reverted the output code to v1.6.5 style with `img` wrapped in its own `a` tag
 
 
 
 
38
 
39
 
40
  == Changelog ==
41
 
42
+ = 1.7.2 =
43
+ * Fixed: Title attribute was missing for the thumbnails
44
+ * Modified: Reverted the output code to v1.6.5 style with `img` wrapped in its own `a` tag
45
+
46
  = 1.7.1 =
47
  * Fixed: Minor bug fix for location of thumbnail
48
 
162
 
163
  * **crp_related**: ID of the main wrapper `div`
164
 
 
 
165
  * **crp_title**: Class of the `span` tag for title of the post
166
 
167
  * **crp_excerpt**: Class of the `span` tag for excerpt (if included)