Version Description
Download this release
Release Info
Developer | printfriendly |
Plugin | Print, PDF, Email by PrintFriendly |
Version | 1.1 |
Comparing to | |
See all releases |
Code changes from version 1.0 to 1.1
- pf.php +42 -37
- readme.txt +1 -1
pf.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: PrintFriendly
|
4 |
Plugin URI: http://www.printfriendly.com/button
|
5 |
Description: Creates PrintFriendly.com button for easy printing. [<a href="options-general.php?page=printfriendly/pf.php">Settings</a>].
|
6 |
-
Version: 1.
|
7 |
Author: Vamsee Kanakala
|
8 |
Author URI: http://kanakala.net
|
9 |
*/
|
@@ -11,42 +11,47 @@
|
|
11 |
function pf_show_link($content)
|
12 |
{
|
13 |
$button_type = get_option('pf_button_type');
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
50 |
}
|
51 |
|
52 |
remove_action('the_content', 'pf_show_link');
|
3 |
Plugin Name: PrintFriendly
|
4 |
Plugin URI: http://www.printfriendly.com/button
|
5 |
Description: Creates PrintFriendly.com button for easy printing. [<a href="options-general.php?page=printfriendly/pf.php">Settings</a>].
|
6 |
+
Version: 1.1
|
7 |
Author: Vamsee Kanakala
|
8 |
Author URI: http://kanakala.net
|
9 |
*/
|
11 |
function pf_show_link($content)
|
12 |
{
|
13 |
$button_type = get_option('pf_button_type');
|
14 |
+
$plink_url = get_permalink();
|
15 |
+
$separator = "?pfstyle=wp";
|
16 |
+
if (strpos($plink_url,"?")!=false)
|
17 |
+
$separator = "&pfstyle=wp";
|
18 |
+
|
19 |
+
switch ($button_type) {
|
20 |
+
case "text-only":
|
21 |
+
if (is_single() || is_page()) {
|
22 |
+
return $content.'<div id="pfButton"><script src="http://cdn.printfriendly.com/printfriendly.js" type="text/javascript"></script><a href="http://www.printfriendly.com" id="pfLink" onclick="window.print(); return false;" title="Print an optimized version of this web page" style="text-decoration: none;"><span style="color: rgb(85, 117, 12);">Print Friendly</span></a></div>';
|
23 |
+
} else {
|
24 |
+
return $content.'<div id="pfButton"><a href="'.$plink_url.$separator.'" title="Print an optimized version of this web page" style="text-decoration: none;"><span style="color: rgb(85, 117, 12);">Print Friendly</span></a></div>';
|
25 |
+
}
|
26 |
+
break;
|
27 |
+
case "pf-button-big.gif":
|
28 |
+
if (is_single() || is_page()) {
|
29 |
+
return $content.'<div id="pfButton"><script src="http://cdn.printfriendly.com/printfriendly.js" type="text/javascript"></script><a href="http://www.printfriendly.com" id="pfLink" onclick="window.print(); return false;" title="Print an optimized version of this web page"><img id="printfriendly" style="border:none; padding:0;" src="http://cdn.printfriendly.com/pf-button-big.gif" alt="Print"/></a></div>';
|
30 |
+
} else {
|
31 |
+
return $content.'<div id="pfButton"><a href="'.$plink_url.$separator.'" title="Print an optimized version of this web page"><img id="printfriendly" style="border:none; padding:0;" src="http://cdn.printfriendly.com/pf-button-big.gif" alt="Print"/></a></div>';
|
32 |
+
}
|
33 |
+
break;
|
34 |
+
case "pf-icon-small.gif":
|
35 |
+
if (is_single() || is_page()) {
|
36 |
+
return $content.'<div id="pfButton"><script src="http://cdn.printfriendly.com/printfriendly.js" type="text/javascript"></script><a href="http://www.printfriendly.com" id="pfLink" onclick="window.print(); return false;" title="Print an optimized version of this web page" style="text-decoration: none;"><img id="printfriendly" style="border:none; padding:0;" src="http://cdn.printfriendly.com/pf-icon-small.gif" alt="Print"/><span style="font-size: 12px; color: rgb(85, 117, 12);">Print Friendly</span></a></div>';
|
37 |
+
} else {
|
38 |
+
return $content.'<div id="pfButton"><a href="'.$plink_url.$separator.'" title="Print an optimized version of this web page" style="text-decoration: none;"><img id="printfriendly" style="border:none; padding:0;" src="http://cdn.printfriendly.com/pf-icon-small.gif" alt="Print"/><span style="font-size: 12px; color: rgb(85, 117, 12);">Print Friendly</span></a></div>';
|
39 |
+
}
|
40 |
+
break;
|
41 |
+
case "pf-icon.gif":
|
42 |
+
if (is_single() || is_page()) {
|
43 |
+
return $content.'<div id="pfButton"><script src="http://cdn.printfriendly.com/printfriendly.js" type="text/javascript"></script><a href="http://www.printfriendly.com" id="pfLink" onclick="window.print(); return false;" title="Print an optimized version of this web page" style="text-decoration: none;"><img id="printfriendly" style="border:none; padding:0;" src="http://cdn.printfriendly.com/pf-icon.gif" alt="Print"/><span style="font-size: 15px; color: rgb(85, 117, 12);">Print Friendly</span></a></div>';
|
44 |
+
} else {
|
45 |
+
return $content.'<div id="pfButton"><a href="'.$plink_url.$separator.'" title="Print an optimized version of this web page" style="text-decoration: none;"><img id="printfriendly" style="border:none; padding:0;" src="http://cdn.printfriendly.com/pf-icon.gif" alt="Print"/><span style="font-size: 15px; color: rgb(85, 117, 12);">Print Friendly</span></a></div>';
|
46 |
+
}
|
47 |
+
break;
|
48 |
+
default:
|
49 |
+
if (is_single() || is_page()) {
|
50 |
+
return $content.'<div id="pfButton"><script src="http://cdn.printfriendly.com/printfriendly.js" type="text/javascript"></script><a href="http://www.printfriendly.com" id="pfLink" onclick="window.print(); return false;" title="Print an optimized version of this web page"><img id="printfriendly" style="border:none; padding:0;" src="http://cdn.printfriendly.com/pf-button.gif" alt="Print"/></a></div>';
|
51 |
+
} else {
|
52 |
+
return $content.'<div id="pfButton"><a href="'.$plink_url.$separator.'" title="Print an optimized version of this web page"><img id="printfriendly" style="border:none; padding:0;" src="http://cdn.printfriendly.com/pf-button.gif" alt="Print"/></a></div>';
|
53 |
+
}
|
54 |
+
}
|
55 |
}
|
56 |
|
57 |
remove_action('the_content', 'pf_show_link');
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: printfriendly, vamsee
|
|
3 |
Tags: print, friendly, save, paper, ink
|
4 |
Requires at least: 1.5
|
5 |
Tested up to: 2.7.1
|
6 |
-
Stable tag: 1.
|
7 |
|
8 |
Adds the PrintFriendly button to your posts and pages. On clicking, it opens a lightbox-like modal window with cleaned up, print friendly content of your blog post or page. It will help your readers save ink, paper and thereby helps the environment too!
|
9 |
|
3 |
Tags: print, friendly, save, paper, ink
|
4 |
Requires at least: 1.5
|
5 |
Tested up to: 2.7.1
|
6 |
+
Stable tag: 1.1
|
7 |
|
8 |
Adds the PrintFriendly button to your posts and pages. On clicking, it opens a lightbox-like modal window with cleaned up, print friendly content of your blog post or page. It will help your readers save ink, paper and thereby helps the environment too!
|
9 |
|