Yet Another Related Posts Plugin (YARPP) - Version 3.6b3

Version Description

Download this release

Release Info

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

Code changes from version 3.6b2 to 3.6b3

class-widget.php CHANGED
@@ -43,6 +43,7 @@ class YARPP_Widget extends WP_Widget {
43
'promote_yarpp' => isset($new_instance['promote_yarpp']),
44
'template' => isset($new_instance['use_template']) ? $new_instance['template_file'] : false
45
);
46
47
if ( !!$instance['template'] ) // don't save the title change.
48
$instance['title'] = $old_instance['title'];
43
'promote_yarpp' => isset($new_instance['promote_yarpp']),
44
'template' => isset($new_instance['use_template']) ? $new_instance['template_file'] : false
45
);
46
+ // @todo add thumbnails support
47
48
if ( !!$instance['template'] ) // don't save the title change.
49
$instance['title'] = $old_instance['title'];
js/options.js CHANGED
@@ -3,7 +3,8 @@ jQuery(function($) {
3
postboxes.add_postbox_toggles(pagenow);
4
5
function template() {
6
- if ($('.template').attr('checked')) {
7
$('.templated').show();
8
$('.not_templated').hide();
9
} else {
@@ -12,7 +13,7 @@ jQuery(function($) {
12
}
13
excerpt();
14
}
15
- $('.template').click(template);
16
template();
17
18
function excerpt() {
@@ -74,7 +75,8 @@ jQuery(function($) {
74
rss_display();
75
76
function rss_template() {
77
- if ($('.rss_template').attr('checked')) {
78
$('.rss_templated').show();
79
$('.rss_not_templated').hide();
80
} else {
@@ -83,7 +85,7 @@ jQuery(function($) {
83
}
84
rss_excerpt();
85
}
86
- $('.rss_template').click(rss_template);
87
88
function rss_excerpt() {
89
if ($('#yarpp-rss_display').attr('checked') && $('#yarpp-rss_show_excerpt').attr('checked'))
@@ -179,6 +181,32 @@ jQuery(function($) {
179
});
180
});
181
182
$('.yarpp_copy_templates_button').live('click', function() {
183
window.location = window.location + (window.location.search.length ? '&' : '?') + 'action=copy_templates&_ajax_nonce=' + $('#yarpp_copy_templates-nonce').val();
184
});
3
postboxes.add_postbox_toggles(pagenow);
4
5
function template() {
6
+ var value = $('#yarpp-use_template').val();
7
+ if ( value == 'custom' ) {
8
$('.templated').show();
9
$('.not_templated').hide();
10
} else {
13
}
14
excerpt();
15
}
16
+ $('.template').change(template);
17
template();
18
19
function excerpt() {
75
rss_display();
76
77
function rss_template() {
78
+ var value = $('#yarpp-rss_use_template').val();
79
+ if ( value == 'custom' ) {
80
$('.rss_templated').show();
81
$('.rss_not_templated').hide();
82
} else {
85
}
86
rss_excerpt();
87
}
88
+ $('.rss_template').change(rss_template);
89
90
function rss_excerpt() {
91
if ($('#yarpp-rss_display').attr('checked') && $('#yarpp-rss_show_excerpt').attr('checked'))
181
});
182
});
183
184
+ $('.yarpp_template_button[data-help]').hover(function() {
185
+ var that = $(this),
186
+ help = '<p>' + that.attr('data-help') + '</p>',
187
+ options = {
188
+ content: help,
189
+ position: {
190
+ edge: 'left',
191
+ align: 'center',
192
+ of: that
193
+ },
194
+ document: {body: that}
195
+ };
196
+
197
+ var pointer = that.pointer(options).pointer('open');
198
+ that.mouseleave(function () {
199
+ pointer.pointer('close');
200
+ });
201
+ });
202
+ $('.yarpp_template_button:not(.disabled)').click(function() {
203
+ $(this).siblings('input')
204
+ .val($(this).attr('data-value'))
205
+ .change();
206
+ $(this).siblings().removeClass('active');
207
+ $(this).addClass('active');
208
+ });
209
+
210
$('.yarpp_copy_templates_button').live('click', function() {
211
window.location = window.location + (window.location.search.length ? '&' : '?') + 'action=copy_templates&_ajax_nonce=' + $('#yarpp_copy_templates-nonce').val();
212
});
options-meta-boxes.php CHANGED
@@ -1,6 +1,12 @@
1
<?php
2
3
class YARPP_Meta_Box {
4
function checkbox($option, $desc, $class = '') {
5
echo "<div class='yarpp_form_row yarpp_form_checkbox $class'><div scope='row'>";
6
echo "<input type='checkbox' name='$option' id='yarpp-$option' value='true'";
@@ -15,17 +21,44 @@ class YARPP_Meta_Box {
15
16
function template_checkbox( $rss = false, $class = '' ) {
17
global $yarpp;
18
$pre = $rss ? 'rss_' : '';
19
$chosen_template = yarpp_get_option( "{$pre}template" );
20
- echo "<div class='yarpp_form_row $class'><div><input type='checkbox' name='{$pre}use_template' id='yarpp-{$pre}use_template' class='{$pre}template' value='true'";
21
- disabled( !count($yarpp->admin->get_templates()), true );
22
- checked( !!$chosen_template );
23
- echo ' /> ';
24
25
- // todo: i18n
26
- $copy = "</p><p style='border-top: 1px solid #333; padding-top: 10px;'>This option is disabled because no YARPP templates were found in your theme. Would you like to copy some sample templates bundled with YARPP into your theme? <input type='button' class='button button-small yarpp_copy_templates_button' value='Copy Templates'/>";
27
28
- echo "<label for='yarpp-{$pre}use_template'>" . __("Display using a custom template file",'yarpp')." <span class='yarpp_help' data-help='" . esc_attr(__("This advanced option gives you full power to customize how your related posts are displayed. Templates (stored in your theme folder) are written in PHP.",'yarpp') . ( $this->offer_copy_templates() ? $copy : '')) . "'>&nbsp;</span>" . "</label></div></div>";
29
}
30
function template_file( $rss = false, $class = '' ) {
31
global $yarpp;
@@ -193,7 +226,7 @@ class YARPP_Meta_Box_Display_Web extends YARPP_Meta_Box {
193
function display() {
194
global $yarpp;
195
196
- echo "<div style='overflow:hidden'>";
197
echo '<div class="yarpp_code_display"><strong>' . __("Website display code example",'yarpp') . '</strong><br /><small>' . __("(Update options to reload.)", 'yarpp') . "</small><br/><div id='display_demo_web'></div></div>";
198
$this->checkbox('auto_display',__("Automatically display related posts?",'yarpp')." <span class='yarpp_help' data-help='" . esc_attr(__("This option automatically displays related posts right after the content on single entry pages. If this option is off, you will need to manually insert <code>related_posts()</code> or variants (<code>related_pages()</code> and <code>related_entries()</code>) into your theme files.",'yarpp')) . "'>&nbsp;</span>");
199
@@ -202,23 +235,24 @@ class YARPP_Meta_Box_Display_Web extends YARPP_Meta_Box {
202
echo "</div>";
203
204
echo "<div class='postbox yarpp_subbox templated'>";
205
- $this->template_file( false, 'templated' );
206
echo "</div>";
207
208
echo "<div class='postbox yarpp_subbox not_templated'>";
209
- $this->beforeafter(array('before_related', 'after_related'),__("Before / after related entries:",'yarpp'), 15, 'not_templated', __("For example:",'yarpp') . ' &lt;ol&gt;&lt;/ol&gt;' . __(' or ','yarpp') . '&lt;div&gt;&lt;/div&gt;');
210
- $this->beforeafter(array('before_title', 'after_title'),__("Before / after each related entry:",'yarpp'),15, 'not_templated', __("For example:",'yarpp') . ' &lt;li&gt;&lt;/li&gt;' . __(' or ','yarpp') . '&lt;dl&gt;&lt;/dl&gt;');
211
212
- $this->checkbox('show_excerpt', __("Show excerpt?",'yarpp'), 'not_templated');
213
$this->textbox('excerpt_length', __('Excerpt length (No. of words):','yarpp'), 10, 'excerpted');
214
215
$this->beforeafter(array('before_post', 'after_post'), __("Before / after (excerpt):",'yarpp'), 10, 'excerpted', __("For example:",'yarpp') . ' &lt;li&gt;&lt;/li&gt;' . __(' or ','yarpp') . '&lt;dl&gt;&lt;/dl&gt;');
216
217
- $this->displayorder('order');
218
-
219
- $this->textbox('no_results', __('Default display if no results:','yarpp'), 40, 'not_templated');
220
echo "</div>";
221
222
$this->checkbox('promote_yarpp',__("Help promote Yet Another Related Posts Plugin?",'yarpp')
223
." <span class='yarpp_help' data-help='" . esc_attr(sprintf(__("This option will add the code %s. Try turning it on, updating your options, and see the code in the code example to the right. These links and donations are greatly appreciated.", 'yarpp'),"<code>".htmlspecialchars(sprintf(__("Related posts brought to you by <a href='%s'>Yet Another Related Posts Plugin</a>.",'yarpp'), 'http://yarpp.org'))."</code>")) ."'>&nbsp;</span>");
224
}
@@ -230,7 +264,7 @@ class YARPP_Meta_Box_Display_Feed extends YARPP_Meta_Box {
230
function display() {
231
global $yarpp;
232
233
- echo "<div style='overflow:hidden'>";
234
echo '<div class="rss_displayed yarpp_code_display"><b>' . __("RSS display code example",'yarpp') . '</b><br /><small>' . __("(Update options to reload.)",'yarpp') . "</small><br/><div id='display_demo_rss'></div></div>";
235
236
$this->checkbox('rss_display',__("Display related posts in feeds?",'yarpp')." <span class='yarpp_help' data-help='" . esc_attr(__("This option displays related posts at the end of each item in your RSS and Atom feeds. No template changes are needed.",'yarpp')) . "'>&nbsp;</span>",'');
@@ -241,22 +275,23 @@ class YARPP_Meta_Box_Display_Feed extends YARPP_Meta_Box {
241
echo "</div>";
242
243
echo "<div class='postbox yarpp_subbox rss_templated rss_displayed'>";
244
- $this->template_file( true, 'rss_templated' );
245
echo "</div>";
246
247
echo "<div class='postbox yarpp_subbox rss_not_templated rss_displayed'>";
248
- $this->beforeafter(array('rss_before_related', 'rss_after_related'),__("Before / after related entries:",'yarpp'), 15, 'rss_not_templated rss_displayed', __("For example:",'yarpp') . ' &lt;ol&gt;&lt;/ol&gt;' . __(' or ','yarpp') . '&lt;div&gt;&lt;/div&gt;');
249
- $this->beforeafter(array('rss_before_title', 'rss_after_title'),__("Before / after each related entry:",'yarpp'), 15, 'rss_not_templated rss_displayed', __("For example:",'yarpp') . ' &lt;li&gt;&lt;/li&gt;' . __(' or ','yarpp') . '&lt;dl&gt;&lt;/dl&gt;');
250
251
- $this->checkbox('rss_show_excerpt', __("Show excerpt?",'yarpp'), 'rss_not_templated rss_displayed');
252
$this->textbox('rss_excerpt_length', __('Excerpt length (No. of words):','yarpp'), 10, 'rss_excerpted');
253
254
$this->beforeafter(array('rss_before_post', 'rss_after_post'),__("Before / after (excerpt):",'yarpp'), 10, 'rss_excerpted', __("For example:",'yarpp') . ' &lt;li&gt;&lt;/li&gt;' . __(' or ','yarpp') . '&lt;dl&gt;&lt;/dl&gt;');
255
256
- $this->displayorder('rss_order', 'rss_displayed');
257
-
258
- $this->textbox('rss_no_results', __('Default display if no results:','yarpp'), 40, 'rss_not_templated rss_displayed');
259
echo "</div>";
260
261
$this->checkbox('rss_promote_yarpp', __("Help promote Yet Another Related Posts Plugin?",'yarpp') . " <span class='yarpp_help' data-help='" . esc_attr(sprintf(__("This option will add the code %s. Try turning it on, updating your options, and see the code in the code example to the right. These links and donations are greatly appreciated.", 'yarpp'),"<code>" . htmlspecialchars(sprintf(__("Related posts brought to you by <a href='%s'>Yet Another Related Posts Plugin</a>.",'yarpp'), 'http://yarpp.org'))."</code>")) . "'>&nbsp;</span>", 'rss_displayed');
262
}
1
<?php
2
3
class YARPP_Meta_Box {
4
+ protected $template_text = '';
5
+
6
+ function __construct() {
7
+ $this->template_text = __("This advanced option gives you full power to customize how your related posts are displayed. Templates (stored in your theme folder) are written in PHP.",'yarpp');
8
+ }
9
+
10
function checkbox($option, $desc, $class = '') {
11
echo "<div class='yarpp_form_row yarpp_form_checkbox $class'><div scope='row'>";
12
echo "<input type='checkbox' name='$option' id='yarpp-$option' value='true'";
21
22
function template_checkbox( $rss = false, $class = '' ) {
23
global $yarpp;
24
+
25
$pre = $rss ? 'rss_' : '';
26
$chosen_template = yarpp_get_option( "{$pre}template" );
27
+ $choice = false === $chosen_template ? 'builtin' :
28
+ ( $chosen_template == 'thumbnails' ? 'thumbnails' : 'custom' );
29
30
+ echo "<div class='yarpp_form_row $class'>";
31
32
+ echo "<div data-value='builtin' class='yarpp_template_button";
33
+ if ( 'builtin' == $choice )
34
+ echo ' active';
35
+ echo "'><div class='image'></div><div class='label'>" . __('Basic list', 'yarpp') . "</div></div>";
36
+
37
+ echo "<div data-value='thumbnails' class='yarpp_template_button disabled";
38
+ if ( 'thumbnails' == $choice )
39
+ echo ' active';
40
+ echo "'";
41
+ echo " data-help='not implemented yet -- mitcho'";
42
+ echo "><div class='image'></div><div class='label'>" . __('Thumbnails', 'yarpp') . "</div></div>";
43
+
44
+ echo "<div data-value='custom' class='yarpp_template_button";
45
+ if ( 'custom' == $choice )
46
+ echo ' active';
47
+ if ( !count($yarpp->admin->get_templates()) )
48
+ echo ' disabled';
49
+ echo "'";
50
+ if ( !count($yarpp->admin->get_templates()) ) {
51
+ $help = __('This option is disabled because no YARPP templates were found in your theme.', 'yarpp');
52
+ if ( $this->offer_copy_templates() )
53
+ $help .= ' ' . __("Would you like to copy some sample templates bundled with YARPP into your theme?", 'yarpp') . "<input type='button' class='button button-small yarpp_copy_templates_button' value='" . esc_attr(__('Copy Templates', 'yarpp')) . "'/>";
54
+ echo " data-help='" . esc_attr( $help ) . "'";
55
+ }
56
+ echo "><div class='image'></div><div class='label'>" . __('Custom', 'yarpp') . "</div></div>";
57
+
58
+ echo "<input type='hidden' name='{$pre}use_template' id='yarpp-{$pre}use_template' class='{$pre}template' value='{$choice}' />";
59
+
60
+ echo "</div>";
61
+
62
}
63
function template_file( $rss = false, $class = '' ) {
64
global $yarpp;
226
function display() {
227
global $yarpp;
228
229
+ echo "<div style='overflow:visible'>";
230
echo '<div class="yarpp_code_display"><strong>' . __("Website display code example",'yarpp') . '</strong><br /><small>' . __("(Update options to reload.)", 'yarpp') . "</small><br/><div id='display_demo_web'></div></div>";
231
$this->checkbox('auto_display',__("Automatically display related posts?",'yarpp')." <span class='yarpp_help' data-help='" . esc_attr(__("This option automatically displays related posts right after the content on single entry pages. If this option is off, you will need to manually insert <code>related_posts()</code> or variants (<code>related_pages()</code> and <code>related_entries()</code>) into your theme files.",'yarpp')) . "'>&nbsp;</span>");
232
235
echo "</div>";
236
237
echo "<div class='postbox yarpp_subbox templated'>";
238
+ echo '<div class="yarpp_form_row"><div>' . $this->template_text . '</div></div>';
239
+ $this->template_file( false );
240
echo "</div>";
241
242
echo "<div class='postbox yarpp_subbox not_templated'>";
243
+ $this->beforeafter(array('before_related', 'after_related'),__("Before / after related entries:",'yarpp'), 15, '', __("For example:",'yarpp') . ' &lt;ol&gt;&lt;/ol&gt;' . __(' or ','yarpp') . '&lt;div&gt;&lt;/div&gt;');
244
+ $this->beforeafter(array('before_title', 'after_title'),__("Before / after each related entry:",'yarpp'),15, '', __("For example:",'yarpp') . ' &lt;li&gt;&lt;/li&gt;' . __(' or ','yarpp') . '&lt;dl&gt;&lt;/dl&gt;');
245
246
+ $this->checkbox('show_excerpt', __("Show excerpt?",'yarpp'), '');
247
$this->textbox('excerpt_length', __('Excerpt length (No. of words):','yarpp'), 10, 'excerpted');
248
249
$this->beforeafter(array('before_post', 'after_post'), __("Before / after (excerpt):",'yarpp'), 10, 'excerpted', __("For example:",'yarpp') . ' &lt;li&gt;&lt;/li&gt;' . __(' or ','yarpp') . '&lt;dl&gt;&lt;/dl&gt;');
250
251
+ $this->textbox('no_results', __('Default display if no results:','yarpp'), 40, '');
252
echo "</div>";
253
254
+ $this->displayorder('order');
255
+
256
$this->checkbox('promote_yarpp',__("Help promote Yet Another Related Posts Plugin?",'yarpp')
257
." <span class='yarpp_help' data-help='" . esc_attr(sprintf(__("This option will add the code %s. Try turning it on, updating your options, and see the code in the code example to the right. These links and donations are greatly appreciated.", 'yarpp'),"<code>".htmlspecialchars(sprintf(__("Related posts brought to you by <a href='%s'>Yet Another Related Posts Plugin</a>.",'yarpp'), 'http://yarpp.org'))."</code>")) ."'>&nbsp;</span>");
258
}
264
function display() {
265
global $yarpp;
266
267
+ echo "<div style='overflow:visible'>";
268
echo '<div class="rss_displayed yarpp_code_display"><b>' . __("RSS display code example",'yarpp') . '</b><br /><small>' . __("(Update options to reload.)",'yarpp') . "</small><br/><div id='display_demo_rss'></div></div>";
269
270
$this->checkbox('rss_display',__("Display related posts in feeds?",'yarpp')." <span class='yarpp_help' data-help='" . esc_attr(__("This option displays related posts at the end of each item in your RSS and Atom feeds. No template changes are needed.",'yarpp')) . "'>&nbsp;</span>",'');
275
echo "</div>";
276
277
echo "<div class='postbox yarpp_subbox rss_templated rss_displayed'>";
278
+ echo '<div class="yarpp_form_row"><div>' . $this->template_text . '</div></div>';
279
+ $this->template_file( true );
280
echo "</div>";
281
282
echo "<div class='postbox yarpp_subbox rss_not_templated rss_displayed'>";
283
+ $this->beforeafter(array('rss_before_related', 'rss_after_related'),__("Before / after related entries:",'yarpp'), 15, '', __("For example:",'yarpp') . ' &lt;ol&gt;&lt;/ol&gt;' . __(' or ','yarpp') . '&lt;div&gt;&lt;/div&gt;');
284
+ $this->beforeafter(array('rss_before_title', 'rss_after_title'),__("Before / after each related entry:",'yarpp'), 15, '', __("For example:",'yarpp') . ' &lt;li&gt;&lt;/li&gt;' . __(' or ','yarpp') . '&lt;dl&gt;&lt;/dl&gt;');
285
286
+ $this->checkbox('rss_show_excerpt', __("Show excerpt?",'yarpp'));
287
$this->textbox('rss_excerpt_length', __('Excerpt length (No. of words):','yarpp'), 10, 'rss_excerpted');
288
289
$this->beforeafter(array('rss_before_post', 'rss_after_post'),__("Before / after (excerpt):",'yarpp'), 10, 'rss_excerpted', __("For example:",'yarpp') . ' &lt;li&gt;&lt;/li&gt;' . __(' or ','yarpp') . '&lt;dl&gt;&lt;/dl&gt;');
290
291
+ $this->textbox('rss_no_results', __('Default display if no results:','yarpp'), 40);
292
echo "</div>";
293
+
294
+ $this->displayorder('rss_order', 'rss_displayed');
295
296
$this->checkbox('rss_promote_yarpp', __("Help promote Yet Another Related Posts Plugin?",'yarpp') . " <span class='yarpp_help' data-help='" . esc_attr(sprintf(__("This option will add the code %s. Try turning it on, updating your options, and see the code in the code example to the right. These links and donations are greatly appreciated.", 'yarpp'),"<code>" . htmlspecialchars(sprintf(__("Related posts brought to you by <a href='%s'>Yet Another Related Posts Plugin</a>.",'yarpp'), 'http://yarpp.org'))."</code>")) . "'>&nbsp;</span>", 'rss_displayed');
297
}
options.css CHANGED
@@ -115,7 +115,7 @@ a.yarpp_help:hover {
115
background: #fdfdfd;
116
}
117
.yarpp_form_row {
118
- overflow: auto;
119
}
120
.yarpp_form_row > div {
121
padding: 8px;
@@ -131,7 +131,7 @@ a.yarpp_help:hover {
131
padding-bottom: 5px;
132
}
133
.yarpp_form_label {
134
- width: 150px;
135
}
136
.yarpp_form_textbox > .yarpp_form_label {
137
padding-top: 13px;
@@ -175,3 +175,86 @@ a.yarpp_help:hover {
175
.template_file_wrap {
176
font-family: monospace;
177
}
115
background: #fdfdfd;
116
}
117
.yarpp_form_row {
118
+ overflow: visible;
119
}
120
.yarpp_form_row > div {
121
padding: 8px;
131
padding-bottom: 5px;
132
}
133
.yarpp_form_label {
134
+ width: 190px;
135
}
136
.yarpp_form_textbox > .yarpp_form_label {
137
padding-top: 13px;
175
.template_file_wrap {
176
font-family: monospace;
177
}
178
+
179
+ .not_templated input[type=text], .rss_not_templated input[type=text] {
180
+ font-family: monospace;
181
+ }
182
+
183
+ .yarpp_template_button {
184
+ position: relative;
185
+ height: 60px;
186
+ width: 70px;
187
+ -webkit-border-radius: 3px;
188
+ border-radius: 7px;
189
+ border: 1px solid #aaa;
190
+ margin: 10px;
191
+ margin-right: 5px;
192
+ margin-bottom: 20px;
193
+ cursor: pointer;
194
+ background: #f3f3f3;
195
+ background-image: -webkit-linear-gradient(top, #FEFEFE, #F4F4F4);
196
+ background-image: -moz-linear-gradient(top, #FEFEFE, #F4F4F4);
197
+ background-image: -o-linear-gradient(top, #FEFEFE, #F4F4F4);
198
+ background-image: linear-gradient(top, #FEFEFE, #F4F4F4);
199
+ color: #333;
200
+ text-shadow: 0 1px 0 white;
201
+ -webkit-box-shadow: 1px 1px 7px 1px #bbb;
202
+ box-shadow: 1px 1px 7px 1px #bbb;
203
+ }
204
+ .yarpp_template_button.disabled, .yarpp_template_button.disabled:hover, .yarpp_template_button.disabled:active {
205
+ -webkit-box-shadow: none;
206
+ box-shadow: none;
207
+ border-color: #ddd;
208
+ background: #f3f3f3;
209
+ background-image: -webkit-linear-gradient(top, #FEFEFE, #F4F4F4) !important;
210
+ background-image: -moz-linear-gradient(top, #FEFEFE, #F4F4F4) !important;
211
+ background-image: -o-linear-gradient(top, #FEFEFE, #F4F4F4) !important;
212
+ background-image: linear-gradient(top, #FEFEFE, #F4F4F4) !important;
213
+ }
214
+ .yarpp_template_button.disabled > div.label {
215
+ color: #bbb !important;
216
+ }
217
+ .yarpp_template_button:hover {
218
+ border-color: #999;
219
+ color: #222;
220
+ }
221
+ .yarpp_template_button:active, .yarpp_template_button.active {
222
+ background: #eee;
223
+ background-image: -webkit-linear-gradient(top, #eee, #f4f4f4);
224
+ background-image: -moz-linear-gradient(top, #eee, #f4f4f4);
225
+ background-image: -o-linear-gradient(top, #eee, #f4f4f4);
226
+ background-image: linear-gradient(top, #eee, #f4f4f4);
227
+ border-color: #999;
228
+ text-shadow: 0 -1px 0 white;
229
+ -webkit-box-shadow: inset 0 2px 8px -2px rgba( 0, 0, 0, 0.5 );
230
+ box-shadow: inset 0 2px 8px -2px rgba( 0, 0, 0, 0.5 );
231
+ }
232
+ .yarpp_template_button > div.label {
233
+ width: 70px;
234
+ bottom: 8px;
235
+ text-align: center;
236
+ position: absolute;
237
+ }
238
+
239
+ .yarpp_template_button > div.image {
240
+ width: 70px;
241
+ height: 40px;
242
+ background-image: url('template-buttons-2x.png');
243
+ background-size: 210px 40px;
244
+ opacity: 0.8;
245
+ }
246
+ .yarpp_template_button.disabled > div.image {
247
+ opacity: 0.2 !important;
248
+ }
249
+ .yarpp_template_button:active > div.image {
250
+ opacity: 1;
251
+ }
252
+ .yarpp_template_button[data-value=builtin] > div.image {
253
+ background-position: 0px 0px;
254
+ }
255
+ .yarpp_template_button[data-value=thumbnails] > div.image {
256
+ background-position: -70px 0px;
257
+ }
258
+ .yarpp_template_button[data-value=custom] > div.image {
259
+ background-position: -140px 0px;
260
+ }
options.php CHANGED
@@ -123,8 +123,10 @@ if (isset($_POST['update_yarpp'])) {
123
else
124
$new_options['exclude'] = '';
125
126
- $new_options['template'] = isset($_POST['use_template']) ? $_POST['template_file'] : false;
127
- $new_options['rss_template'] = isset($_POST['rss_use_template']) ? $_POST['rss_template_file'] : false;
128
129
$new_options = apply_filters( 'yarpp_settings_save', $new_options );
130
yarpp_set_option($new_options);
123
else
124
$new_options['exclude'] = '';
125
126
+ $new_options['template'] = $_POST['use_template'] == 'custom' ? $_POST['template_file'] :
127
+ ( $_POST['use_template'] == 'thumbnails' ? 'thumbnails' : false );
128
+ $new_options['rss_template'] = $_POST['rss_use_template'] == 'custom' ? $_POST['rss_template_file'] :
129
+ ( $_POST['rss_use_template'] == 'thumbnails' ? 'thumbnails' : false );
130
131
$new_options = apply_filters( 'yarpp_settings_save', $new_options );
132
yarpp_set_option($new_options);
template-buttons-2x.png ADDED
Binary file
yarpp.php CHANGED
@@ -3,13 +3,13 @@
3
Plugin Name: Yet Another Related Posts Plugin
4
Plugin URI: http://yarpp.org/
5
Description: Returns a list of related entries based on a unique algorithm for display on your blog and RSS feeds. Now with custom post type support!
6
- Version: 3.6b2
7
Author: mitcho (Michael Yoshitaka Erlewine)
8
Author URI: http://mitcho.com/
9
Donate link: http://tinyurl.com/donatetomitcho
10
*/
11
12
- define('YARPP_VERSION', '3.6b2');
13
define('YARPP_DIR', dirname(__FILE__));
14
define('YARPP_NO_RELATED', ':(');
15
define('YARPP_RELATED', ':)');
3
Plugin Name: Yet Another Related Posts Plugin
4
Plugin URI: http://yarpp.org/
5
Description: Returns a list of related entries based on a unique algorithm for display on your blog and RSS feeds. Now with custom post type support!
6
+ Version: 3.6b3
7
Author: mitcho (Michael Yoshitaka Erlewine)
8
Author URI: http://mitcho.com/
9
Donate link: http://tinyurl.com/donatetomitcho
10
*/
11
12
+ define('YARPP_VERSION', '3.6b3');
13
define('YARPP_DIR', dirname(__FILE__));
14
define('YARPP_NO_RELATED', ':(');
15
define('YARPP_RELATED', ':)');