Print, PDF, Email by PrintFriendly - Version 3.2.6

Version Description

  • Fixed Button behavior when displayed on Homepage for NON-JS version.
  • Fixed CSS issue with Button when placed above content.
  • Fixed box-shadow issue with button.
  • Custom print and pdf options now available for Non-JS version. Custom options include header, css, image alignment, etc..
  • Fixed bug for custom tagline.
Download this release

Release Info

Developer printfriendly
Plugin Icon 128x128 Print, PDF, Email by PrintFriendly
Version 3.2.6
Comparing to
See all releases

Code changes from version 3.2.5 to 3.2.6

Files changed (3) hide show
  1. admin.js +1 -3
  2. pf.php +37 -17
  3. readme.txt +10 -4
admin.js CHANGED
@@ -183,13 +183,11 @@ jQuery(document).ready(function() {
183
  function pf_on_javascript() {
184
  jQuery('.javascript').show();
185
  jQuery('.no-javascript').hide();
186
- jQuery('#print-options').show('slow');
187
  }
188
 
189
  function pf_on_no_javascript() {
190
  jQuery('.javascript').hide();
191
  jQuery('.no-javascript').show();
192
- jQuery('#print-options').hide('slow');
193
  }
194
 
195
  function pf_reset_style() {
@@ -251,4 +249,4 @@ jQuery(document).ready(function() {
251
 
252
  // page checkboxes TODO...
253
 
254
- });
183
  function pf_on_javascript() {
184
  jQuery('.javascript').show();
185
  jQuery('.no-javascript').hide();
 
186
  }
187
 
188
  function pf_on_no_javascript() {
189
  jQuery('.javascript').hide();
190
  jQuery('.no-javascript').show();
 
191
  }
192
 
193
  function pf_reset_style() {
249
 
250
  // page checkboxes TODO...
251
 
252
+ });
pf.php CHANGED
@@ -5,11 +5,12 @@ Plugin Name: Print Friendly and PDF
5
  Plugin URI: http://www.printfriendly.com
6
  Description: PrintFriendly & PDF button for your website. Optimizes your pages and brand for print, pdf, and email.
7
  Name and URL are included to ensure repeat visitors and new visitors when printed versions are shared.
8
- Version: 3.2.5
9
  Author: Print Friendly
10
  Author URI: http://www.PrintFriendly.com
11
 
12
  Changelog :
 
13
  3.2.5 - Added hide images and image style options. Improved input validation. Improved output escaping. Removed printfriendly post_class. Small i8n fix. Few small HTML fixes.
14
  3.2.4 - Add printfriendly post_class. Fixed minor JS bug. Added redundancy to uninstall script.
15
  3.2.3 - Rolling back to version 3.2.1
@@ -270,11 +271,14 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
270
 
271
  $onclick = 'onclick="window.print(); return false;"';
272
  $href = 'http://www.printfriendly.com/print?url='.get_permalink();
273
-
274
- if ( isset( $this->options['javascript'] ) && $this->options['javascript'] == 'no' )
 
275
  $onclick = 'target="_blank"';
 
 
276
 
277
- if ( !is_singular() && '' != $onclick ) {
278
  $onclick = '';
279
  $href = get_permalink().'?pfstyle=wp';
280
  }
@@ -283,7 +287,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
283
  if ( 'none' != $this->options['content_position'] )
284
  $align = ' pf-align'.$this->options['content_position'];
285
 
286
- $button = apply_filters( 'printfriendly_button', '<div class="printfriendly'.$align.'"><a href="'.$href.'" rel="nofollow" '.$onclick.'>'.$this->button().'</a></div>' );
287
 
288
 
289
  if ( $is_manual )
@@ -317,6 +321,13 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
317
 
318
  }
319
 
 
 
 
 
 
 
 
320
 
321
  /**
322
  * Filter posts by category.
@@ -374,7 +385,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
374
  /* else {
375
 
376
  }*/
377
-
378
  // Custom button selected, but no url nor text given, reset button type to default
379
  if( 'custom-image' === $valid_input['button_type'] && ( '' === $valid_input['custom_image'] && '' === $input['custom_text'] ) ) {
380
  $valid_input['button_type'] = 'pf-button.gif';
@@ -397,7 +408,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
397
  $valid_input['text_color'] = $this->options['text_color'];
398
  add_settings_error( $this->option_name, 'invalid_color', __( 'The color you entered is not valid, it must be a valid hexadecimal RGB font color.', $this->hook ) );
399
  }
400
-
401
 
402
 
403
  /* Section 2 options */
@@ -490,7 +501,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
490
  }
491
  unset( $opt );
492
 
493
-
494
  // @todo custom css url validation
495
  if ( !isset( $input['custom_css_url'] ) || empty( $input['custom_css_url'] ) )
496
  $valid_input['custom_css_url'] = '';
@@ -744,8 +755,8 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
744
  */
745
  unset($this->options['category_ids']);
746
  }
747
-
748
-
749
  if($this->options['db_version'] < 7) {
750
 
751
  $additional_options = array(
@@ -787,7 +798,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
787
  function button( $name = false ){
788
  if( !$name )
789
  $name = $this->options['button_type'];
790
-
791
  $text = $this->options['custom_text'];
792
  $img_path = 'http://cdn.printfriendly.com/';
793
  if($this->options['website_protocol'] == 'https')
@@ -809,22 +820,31 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
809
  break;
810
 
811
  case "pf-icon-both.gif":
812
- return '<span class="printfriendly-text2 printandpdf"><img style="border:none;margin-right:6px;" src="'.$img_path.'pf-print-icon.gif" width="16" height="15" alt="Print Friendly Version of this page" />Print <img style="border:none;margin:0 6px" src="'.$img_path.'pf-pdf-icon.gif" width="12" height="12" alt="Get a PDF version of this webpage" />PDF</span>';
813
  break;
814
 
815
  case "pf-icon-small.gif":
816
- return '<img style="border:none;margin-right:4px;" src="'.$img_path.'pf-icon-small.gif" alt="PrintFriendly and PDF" width="18" height="18"><span class="printfriendly-text2">'.$text.'</span>';
817
  break;
818
  case "pf-icon.gif":
819
- return '<img style="border:none;margin-right:6px;" src="'.$img_path.'pf-icon.gif" width="23" height="25" alt="PrintFriendly and PDF"><span class="printfriendly-text2">'.$text.'</span>';
820
  break;
821
 
822
  default:
823
- return '<img src="'.$img_path.$name.'" alt="Print Friendly" />';
824
  break;
825
  }
826
  }
827
 
 
 
 
 
 
 
 
 
 
828
 
829
  /**
830
  * Convenience function to output a value custom button preview elements
@@ -1216,10 +1236,10 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
1216
  <option value="no" <?php $this->selected( 'javascript', 'no' ); ?>> <?php _e( "No", $this->hook ); ?></option>
1217
  </select>
1218
  <span class="description javascript">
1219
- <?php _e( "Display print preview on-page using a JavaScript Lightbox (user never leaves the site/page).", $this->hook ); ?>
1220
  </span>
1221
  <span class="description no-javascript">
1222
- <?php _e( "Display print preview on PrintFriendly.com (No JavaScript)", $this->hook ); ?>
1223
  </span>
1224
  </label>
1225
 
5
  Plugin URI: http://www.printfriendly.com
6
  Description: PrintFriendly & PDF button for your website. Optimizes your pages and brand for print, pdf, and email.
7
  Name and URL are included to ensure repeat visitors and new visitors when printed versions are shared.
8
+ Version: 3.2.6
9
  Author: Print Friendly
10
  Author URI: http://www.PrintFriendly.com
11
 
12
  Changelog :
13
+ 3.2.6 - Fixed Button behavior when displayed on Homepage for NON-JS version. Fixed CSS issue with Button when placed above content. Fixed box-shadow issue with button. Custom print and pdf options now available for Non-JS version (custom header, custom css, image alignment, etc.). Fixed custom header bug.
14
  3.2.5 - Added hide images and image style options. Improved input validation. Improved output escaping. Removed printfriendly post_class. Small i8n fix. Few small HTML fixes.
15
  3.2.4 - Add printfriendly post_class. Fixed minor JS bug. Added redundancy to uninstall script.
16
  3.2.3 - Rolling back to version 3.2.1
271
 
272
  $onclick = 'onclick="window.print(); return false;"';
273
  $href = 'http://www.printfriendly.com/print?url='.get_permalink();
274
+ $js_enabled = $this->js_enabled();
275
+ if (!$js_enabled)
276
+ {
277
  $onclick = 'target="_blank"';
278
+ $href = "http://www.printfriendly.com/print?headerImageUrl={$this->options['image_url']}&headerTagline={$this->options['tagline']}&pfCustomCSS={$this->options['custom_css_url']}&imageDisplayStyle={$this->options['image-style']}&disableClickToDel={$this->options['click_to_delete']}&disablePDF={$this->options['pdf']}&disablePrint={$this->options['print']}&disableEmail={$this->options['email']}&hideImages={$this->options['hide-images']}&url=".get_permalink();
279
+ }
280
 
281
+ if ( !is_singular() && '' != $onclick && $js_enabled) {
282
  $onclick = '';
283
  $href = get_permalink().'?pfstyle=wp';
284
  }
287
  if ( 'none' != $this->options['content_position'] )
288
  $align = ' pf-align'.$this->options['content_position'];
289
 
290
+ $button = apply_filters( 'printfriendly_button', '<div class="printfriendly'.$align.'"><a href="'.$href.'" rel="nofollow" '.$onclick.'>'.$this->button().'</a></div><br clear="all" />' );
291
 
292
 
293
  if ( $is_manual )
321
 
322
  }
323
 
324
+ /**
325
+ * @since 3.2.6
326
+ * @return boolean true if JS is enabled for the plugin
327
+ **/
328
+ function js_enabled() {
329
+ return isset( $this->options['javascript'] ) && $this->options['javascript'] == 'yes';
330
+ }
331
 
332
  /**
333
  * Filter posts by category.
385
  /* else {
386
 
387
  }*/
388
+
389
  // Custom button selected, but no url nor text given, reset button type to default
390
  if( 'custom-image' === $valid_input['button_type'] && ( '' === $valid_input['custom_image'] && '' === $input['custom_text'] ) ) {
391
  $valid_input['button_type'] = 'pf-button.gif';
408
  $valid_input['text_color'] = $this->options['text_color'];
409
  add_settings_error( $this->option_name, 'invalid_color', __( 'The color you entered is not valid, it must be a valid hexadecimal RGB font color.', $this->hook ) );
410
  }
411
+
412
 
413
 
414
  /* Section 2 options */
501
  }
502
  unset( $opt );
503
 
504
+
505
  // @todo custom css url validation
506
  if ( !isset( $input['custom_css_url'] ) || empty( $input['custom_css_url'] ) )
507
  $valid_input['custom_css_url'] = '';
755
  */
756
  unset($this->options['category_ids']);
757
  }
758
+
759
+
760
  if($this->options['db_version'] < 7) {
761
 
762
  $additional_options = array(
798
  function button( $name = false ){
799
  if( !$name )
800
  $name = $this->options['button_type'];
801
+ $button_css = $this->generic_button_css();
802
  $text = $this->options['custom_text'];
803
  $img_path = 'http://cdn.printfriendly.com/';
804
  if($this->options['website_protocol'] == 'https')
820
  break;
821
 
822
  case "pf-icon-both.gif":
823
+ return '<span class="printfriendly-text2 printandpdf"><img style="border:none;margin-right:6px;" src="'.$img_path.'pf-print-icon.gif" width="16" height="15" alt="Print Friendly Version of this page" />Print <img style="'.$button_css.'margin:0 6px" src="'.$img_path.'pf-pdf-icon.gif" width="12" height="12" alt="Get a PDF version of this webpage" />PDF</span>';
824
  break;
825
 
826
  case "pf-icon-small.gif":
827
+ return '<img style="'.$button_css.'margin-right:4px;" src="'.$img_path.'pf-icon-small.gif" alt="PrintFriendly and PDF" width="18" height="18"><span class="printfriendly-text2">'.$text.'</span>';
828
  break;
829
  case "pf-icon.gif":
830
+ return '<img style="'.$button_css.'margin-right:6px;" src="'.$img_path.'pf-icon.gif" width="23" height="25" alt="PrintFriendly and PDF"><span class="printfriendly-text2">'.$text.'</span>';
831
  break;
832
 
833
  default:
834
+ return '<img style="'.$button_css.'" src="'.$img_path.$name.'" alt="Print Friendly" />';
835
  break;
836
  }
837
  }
838
 
839
+ /**
840
+ *
841
+ *
842
+ **/
843
+
844
+ function generic_button_css() {
845
+ return "border:none;-webkit-box-shadow:none; box-shadow:none;";
846
+ }
847
+
848
 
849
  /**
850
  * Convenience function to output a value custom button preview elements
1236
  <option value="no" <?php $this->selected( 'javascript', 'no' ); ?>> <?php _e( "No", $this->hook ); ?></option>
1237
  </select>
1238
  <span class="description javascript">
1239
+ <?php _e( "Preview appears on the page in a Lightbox.", $this->hook ); ?>
1240
  </span>
1241
  <span class="description no-javascript">
1242
+ <?php _e( "Preview opens a new browser tab.", $this->hook ); ?>
1243
  </span>
1244
  </label>
1245
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: printfriendly,joostdevalk, jrf
3
  Tags: print, pdf, printer, printing, printable, widget, plugin
4
  Requires at least: 2.8
5
  Tested up to: 3.5.1
6
- Stable tag: 3.2.5
7
 
8
  The #1 Print and PDF button for your WordPress site. Printer Friendly pages without coding, css, or print.css. Fast, easy, and professional.
9
 
@@ -60,7 +60,7 @@ Supported languages:
60
  * Chinese Simplified
61
  * Chinese Traditional
62
 
63
- [Learn more...](blog.printfriendly.com/2012/06/print-friendly-speaks-your-language.html)
64
 
65
  PrintFriendly and PDF is the #1 print optimization technology, **as featured in [Lifehacker](http://lifehacker.com/5272212/print-friendly-optimizes-web-pages-for-printing "PrintFriendly & PDF in Lifehacker"), [Mashable](http://mashable.com/2009/05/18/print-friendly/ "PrintFriendly & PDF in Mashable") & [makeuseof](http://www.makeuseof.com/dir/printfriendly-save-on-paper-and-ink/#comment-95052)**.
66
 
@@ -98,9 +98,15 @@ If you have any other issues with the plugin or the PrintFriendly widget, please
98
 
99
  == Changelog ==
100
 
 
 
 
 
 
 
 
101
  = 3.2.5 =
102
- * New! Image alignment option for Print and PDF pages.
103
- * New! Select to not show images by default in the Print and PDF.
104
  * Improved input validation.
105
  * Improved output escaping.
106
  * Removed printfriendly post_class.
3
  Tags: print, pdf, printer, printing, printable, widget, plugin
4
  Requires at least: 2.8
5
  Tested up to: 3.5.1
6
+ Stable tag: 3.2.6
7
 
8
  The #1 Print and PDF button for your WordPress site. Printer Friendly pages without coding, css, or print.css. Fast, easy, and professional.
9
 
60
  * Chinese Simplified
61
  * Chinese Traditional
62
 
63
+ [Learn more...](http://blog.printfriendly.com/2012/06/print-friendly-speaks-your-language.html)
64
 
65
  PrintFriendly and PDF is the #1 print optimization technology, **as featured in [Lifehacker](http://lifehacker.com/5272212/print-friendly-optimizes-web-pages-for-printing "PrintFriendly & PDF in Lifehacker"), [Mashable](http://mashable.com/2009/05/18/print-friendly/ "PrintFriendly & PDF in Mashable") & [makeuseof](http://www.makeuseof.com/dir/printfriendly-save-on-paper-and-ink/#comment-95052)**.
66
 
98
 
99
  == Changelog ==
100
 
101
+ = 3.2.6 =
102
+ * Fixed Button behavior when displayed on Homepage for NON-JS version.
103
+ * Fixed CSS issue with Button when placed above content.
104
+ * Fixed box-shadow issue with button.
105
+ * Custom print and pdf options now available for Non-JS version. Custom options include header, css, image alignment, etc..
106
+ * Fixed bug for custom tagline.
107
+
108
  = 3.2.5 =
109
+ * Added hide images and image style options.
 
110
  * Improved input validation.
111
  * Improved output escaping.
112
  * Removed printfriendly post_class.