Version Description
Download this release
Release Info
Developer | GamerZ |
Plugin | WP-Print |
Version | 2.31 |
Comparing to | |
See all releases |
Code changes from version 2.30 to 2.31
- print-comments.php +4 -2
- print-css.css +4 -1
- print-options.php +4 -4
- print-posts.php +6 -28
- print.php +49 -0
- readme.html +27 -9
- readme.txt +1 -1
- wp-print.mo +0 -0
- wp-print.php +40 -5
- wp-print.pot +37 -37
print-comments.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
+----------------------------------------------------------------+
|
4 |
| |
|
5 |
-
| WordPress 2.5 Plugin: WP-Print 2.
|
6 |
| Copyright (c) 2008 Lester "GaMerZ" Chan |
|
7 |
| |
|
8 |
| File Written By: |
|
@@ -10,12 +10,14 @@
|
|
10 |
| - http://lesterchan.net |
|
11 |
| |
|
12 |
| File Information: |
|
13 |
-
| - Printer Friendly
|
14 |
| - wp-content/plugins/wp-print/print-comments.php |
|
15 |
| |
|
16 |
+----------------------------------------------------------------+
|
17 |
*/
|
18 |
?>
|
|
|
|
|
19 |
<?php if($comments) : ?>
|
20 |
<?php $comment_count = 1; ?>
|
21 |
<span style='float:right' id='comments_controls'><?php print_comments_number(); ?> (<a href="#" onclick="javascript:document.getElementById('comments_box').style.display = 'block'; return false;"><?php _e('Open', 'wp-print'); ?></a> | <a href="#" onclick="javascript:document.getElementById('comments_box').style.display = 'none'; return false;"><?php _e('Close', 'wp-print'); ?></a>)</span>
|
2 |
/*
|
3 |
+----------------------------------------------------------------+
|
4 |
| |
|
5 |
+
| WordPress 2.5 Plugin: WP-Print 2.31 |
|
6 |
| Copyright (c) 2008 Lester "GaMerZ" Chan |
|
7 |
| |
|
8 |
| File Written By: |
|
10 |
| - http://lesterchan.net |
|
11 |
| |
|
12 |
| File Information: |
|
13 |
+
| - Printer Friendly Comments Template |
|
14 |
| - wp-content/plugins/wp-print/print-comments.php |
|
15 |
| |
|
16 |
+----------------------------------------------------------------+
|
17 |
*/
|
18 |
?>
|
19 |
+
|
20 |
+
|
21 |
<?php if($comments) : ?>
|
22 |
<?php $comment_count = 1; ?>
|
23 |
<span style='float:right' id='comments_controls'><?php print_comments_number(); ?> (<a href="#" onclick="javascript:document.getElementById('comments_box').style.display = 'block'; return false;"><?php _e('Open', 'wp-print'); ?></a> | <a href="#" onclick="javascript:document.getElementById('comments_box').style.display = 'none'; return false;"><?php _e('Close', 'wp-print'); ?></a>)</span>
|
print-css.css
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
/*
|
2 |
+----------------------------------------------------------------+
|
3 |
| |
|
4 |
-
| WordPress 2.5 Plugin: WP-Print 2.
|
5 |
| Copyright (c) 2008 Lester "GaMerZ" Chan |
|
6 |
| |
|
7 |
| File Written By: |
|
@@ -21,6 +21,9 @@ Body {
|
|
21 |
font-size: 12px;
|
22 |
color: #000000;
|
23 |
}
|
|
|
|
|
|
|
24 |
#Outline {
|
25 |
width: 90%;
|
26 |
margin-left: auto;
|
1 |
/*
|
2 |
+----------------------------------------------------------------+
|
3 |
| |
|
4 |
+
| WordPress 2.5 Plugin: WP-Print 2.31 |
|
5 |
| Copyright (c) 2008 Lester "GaMerZ" Chan |
|
6 |
| |
|
7 |
| File Written By: |
|
21 |
font-size: 12px;
|
22 |
color: #000000;
|
23 |
}
|
24 |
+
.Center {
|
25 |
+
margin: 0px auto 0px auto;
|
26 |
+
}
|
27 |
#Outline {
|
28 |
width: 90%;
|
29 |
margin-left: auto;
|
print-options.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
+----------------------------------------------------------------+
|
4 |
| |
|
5 |
-
| WordPress 2.5 Plugin: WP-Print 2.
|
6 |
| Copyright (c) 2008 Lester "GaMerZ" Chan |
|
7 |
| |
|
8 |
| File Written By: |
|
@@ -119,7 +119,7 @@ switch($mode) {
|
|
119 |
default_template = '<a href="%PRINT_URL%" rel="nofollow" title="%PRINT_TEXT%">%PRINT_TEXT%</a>';
|
120 |
break;
|
121 |
case 'disclaimer':
|
122 |
-
default_template = '<?php
|
123 |
break;
|
124 |
}
|
125 |
document.getElementById("print_template_" + template).value = default_template;
|
@@ -149,8 +149,8 @@ switch($mode) {
|
|
149 |
<td>
|
150 |
<?php
|
151 |
$print_icon = $print_options['print_icon'];
|
152 |
-
$print_icon_url =
|
153 |
-
$print_icon_path =
|
154 |
if($handle = @opendir($print_icon_path)) {
|
155 |
while (false !== ($filename = readdir($handle))) {
|
156 |
if ($filename != '.' && $filename != '..') {
|
2 |
/*
|
3 |
+----------------------------------------------------------------+
|
4 |
| |
|
5 |
+
| WordPress 2.5 Plugin: WP-Print 2.31 |
|
6 |
| Copyright (c) 2008 Lester "GaMerZ" Chan |
|
7 |
| |
|
8 |
| File Written By: |
|
119 |
default_template = '<a href="%PRINT_URL%" rel="nofollow" title="%PRINT_TEXT%">%PRINT_TEXT%</a>';
|
120 |
break;
|
121 |
case 'disclaimer':
|
122 |
+
default_template = '<?php echo js_escape(sprintf(__('Copyright © %s %s. All rights reserved.', 'wp-print'), date('Y'), get_option('blogname'))); ?>';
|
123 |
break;
|
124 |
}
|
125 |
document.getElementById("print_template_" + template).value = default_template;
|
149 |
<td>
|
150 |
<?php
|
151 |
$print_icon = $print_options['print_icon'];
|
152 |
+
$print_icon_url =WP_PLUGIN_URL.'/wp-print/images';
|
153 |
+
$print_icon_path = WP_PLUGIN_DIR.'/wp-print/images';
|
154 |
if($handle = @opendir($print_icon_path)) {
|
155 |
while (false !== ($filename = readdir($handle))) {
|
156 |
if ($filename != '.' && $filename != '..') {
|
print-posts.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
+----------------------------------------------------------------+
|
4 |
| |
|
5 |
-
| WordPress 2.5 Plugin: WP-Print 2.
|
6 |
| Copyright (c) 2008 Lester "GaMerZ" Chan |
|
7 |
| |
|
8 |
| File Written By: |
|
@@ -10,36 +10,14 @@
|
|
10 |
| - http://lesterchan.net |
|
11 |
| |
|
12 |
| File Information: |
|
13 |
-
| - Printer Friendly Page
|
14 |
| - wp-content/plugins/wp-print/print-posts.php |
|
15 |
| |
|
16 |
+----------------------------------------------------------------+
|
17 |
*/
|
|
|
18 |
|
19 |
|
20 |
-
### Variables
|
21 |
-
$links_text = '';
|
22 |
-
|
23 |
-
### Actions
|
24 |
-
add_action('init', 'print_content');
|
25 |
-
|
26 |
-
### Filters
|
27 |
-
add_filter('wp_title', 'print_pagetitle');
|
28 |
-
add_filter('comments_template', 'print_template_comments');
|
29 |
-
|
30 |
-
### Print Options
|
31 |
-
$print_options = get_option('print_options');
|
32 |
-
|
33 |
-
### Determine Text Direction
|
34 |
-
$text_direction = 'ltr';
|
35 |
-
$text_align = 'left';
|
36 |
-
$text_align_opposite = 'right';
|
37 |
-
if($print_options['text_direction'] == 'rtl') {
|
38 |
-
$text_direction = 'rtl';
|
39 |
-
$text_align = 'right';
|
40 |
-
$text_align_opposite = 'left';
|
41 |
-
}
|
42 |
-
?>
|
43 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
44 |
<html xmlns="http://www.w3.org/1999/xhtml">
|
45 |
<head>
|
@@ -59,12 +37,12 @@ if($print_options['text_direction'] == 'rtl') {
|
|
59 |
<?php if(@file_exists(TEMPLATEPATH.'/print-css.css')): ?>
|
60 |
<link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri(); ?>/print-css.css" type="text/css" media="screen, print" />
|
61 |
<?php else: ?>
|
62 |
-
<link rel="stylesheet" href="<?php
|
63 |
<?php endif; ?>
|
64 |
</head>
|
65 |
<body>
|
66 |
<p style="text-align: center;"><strong>- <?php bloginfo('name'); ?> - <?php bloginfo('url')?> -</strong></p>
|
67 |
-
<
|
68 |
<div id="Outline">
|
69 |
<?php if (have_posts()): ?>
|
70 |
<?php while (have_posts()): the_post(); ?>
|
@@ -86,7 +64,7 @@ if($print_options['text_direction'] == 'rtl') {
|
|
86 |
<p style="text-align: <?php echo $text_direction; ?>;"><?php _e('No posts matched your criteria.', 'wp-print'); ?></p>
|
87 |
<?php endif; ?>
|
88 |
</div>
|
89 |
-
</
|
90 |
<p style="text-align: center;"><?php echo stripslashes($print_options['disclaimer']); ?></p>
|
91 |
</body>
|
92 |
</html>
|
2 |
/*
|
3 |
+----------------------------------------------------------------+
|
4 |
| |
|
5 |
+
| WordPress 2.5 Plugin: WP-Print 2.31 |
|
6 |
| Copyright (c) 2008 Lester "GaMerZ" Chan |
|
7 |
| |
|
8 |
| File Written By: |
|
10 |
| - http://lesterchan.net |
|
11 |
| |
|
12 |
| File Information: |
|
13 |
+
| - Printer Friendly Post/Page Template |
|
14 |
| - wp-content/plugins/wp-print/print-posts.php |
|
15 |
| |
|
16 |
+----------------------------------------------------------------+
|
17 |
*/
|
18 |
+
?>
|
19 |
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
22 |
<html xmlns="http://www.w3.org/1999/xhtml">
|
23 |
<head>
|
37 |
<?php if(@file_exists(TEMPLATEPATH.'/print-css.css')): ?>
|
38 |
<link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri(); ?>/print-css.css" type="text/css" media="screen, print" />
|
39 |
<?php else: ?>
|
40 |
+
<link rel="stylesheet" href="<?php echo WP_PLUGIN_URL; ?>/wp-print/print-css.css" type="text/css" media="screen, print" />
|
41 |
<?php endif; ?>
|
42 |
</head>
|
43 |
<body>
|
44 |
<p style="text-align: center;"><strong>- <?php bloginfo('name'); ?> - <?php bloginfo('url')?> -</strong></p>
|
45 |
+
<div class="Center">
|
46 |
<div id="Outline">
|
47 |
<?php if (have_posts()): ?>
|
48 |
<?php while (have_posts()): the_post(); ?>
|
64 |
<p style="text-align: <?php echo $text_direction; ?>;"><?php _e('No posts matched your criteria.', 'wp-print'); ?></p>
|
65 |
<?php endif; ?>
|
66 |
</div>
|
67 |
+
</div>
|
68 |
<p style="text-align: center;"><?php echo stripslashes($print_options['disclaimer']); ?></p>
|
69 |
</body>
|
70 |
</html>
|
print.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
+----------------------------------------------------------------+
|
4 |
+
| |
|
5 |
+
| WordPress 2.5 Plugin: WP-Print 2.31 |
|
6 |
+
| Copyright (c) 2008 Lester "GaMerZ" Chan |
|
7 |
+
| |
|
8 |
+
| File Written By: |
|
9 |
+
| - Lester "GaMerZ" Chan |
|
10 |
+
| - http://lesterchan.net |
|
11 |
+
| |
|
12 |
+
| File Information: |
|
13 |
+
| - Process Printing Page |
|
14 |
+
| - wp-content/plugins/wp-print/print.php |
|
15 |
+
| |
|
16 |
+
+----------------------------------------------------------------+
|
17 |
+
*/
|
18 |
+
|
19 |
+
|
20 |
+
### Variables
|
21 |
+
$links_text = '';
|
22 |
+
|
23 |
+
### Actions
|
24 |
+
add_action('init', 'print_content');
|
25 |
+
|
26 |
+
### Filters
|
27 |
+
add_filter('wp_title', 'print_pagetitle');
|
28 |
+
add_filter('comments_template', 'print_template_comments');
|
29 |
+
|
30 |
+
### Print Options
|
31 |
+
$print_options = get_option('print_options');
|
32 |
+
|
33 |
+
### Determine Text Direction
|
34 |
+
$text_direction = 'ltr';
|
35 |
+
$text_align = 'left';
|
36 |
+
$text_align_opposite = 'right';
|
37 |
+
if($print_options['text_direction'] == 'rtl') {
|
38 |
+
$text_direction = 'rtl';
|
39 |
+
$text_align = 'right';
|
40 |
+
$text_align_opposite = 'left';
|
41 |
+
}
|
42 |
+
|
43 |
+
### Load Print Post/Page Template
|
44 |
+
if(file_exists(TEMPLATEPATH.'/print-posts.php')) {
|
45 |
+
include(TEMPLATEPATH.'/print-posts.php');
|
46 |
+
} else {
|
47 |
+
include(WP_PLUGIN_DIR.'/wp-print/print-posts.php');
|
48 |
+
}
|
49 |
+
?>
|
readme.html
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<html>
|
3 |
<head>
|
4 |
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
5 |
-
<title>WP-Print 2.
|
6 |
<style type="text/css" media="screen">
|
7 |
/* Default Style */
|
8 |
BODY {
|
@@ -203,7 +203,7 @@
|
|
203 |
<body>
|
204 |
<div id="Container">
|
205 |
<!-- Title -->
|
206 |
-
<div id="Title">WP-Print 2.
|
207 |
|
208 |
<!-- Tabs -->
|
209 |
<ul id="Tabs">
|
@@ -234,7 +234,7 @@
|
|
234 |
</p>
|
235 |
<p>
|
236 |
<strong>Download:</strong><br />
|
237 |
-
<strong>»</strong> <a href="http://downloads.wordpress.org/plugin/wp-print.2.
|
238 |
<strong>»</strong> <a href="http://downloads.wordpress.org/plugin/wp-print.2.20.zip" title="http://downloads.wordpress.org/plugin/wp-print.2.20.zip">WP-Print 2.20 For WordPress 2.1.x, 2.2.x And 2.3.x</a><br />
|
239 |
<strong>»</strong> <a href="http://downloads.wordpress.org/plugin/wp-print.2.06.zip" title="http://downloads.wordpress.org/plugin/wp-print.2.06.zip">WP-Print 2.06 For WordPress 2.0.x</a><br />
|
240 |
<strong>»</strong> <a href="http://downloads.wordpress.org/plugin/wp-print.2.00.zip" title="http://downloads.wordpress.org/plugin/wp-print.2.00.zip">WP-Print 2.00 For WordPress 1.5.2</a>
|
@@ -261,7 +261,8 @@
|
|
261 |
</p>
|
262 |
<p>
|
263 |
<strong>Credits:</strong><br />
|
264 |
-
<strong>»</strong> Icons courtesy of <a href="http://www.famfamfam.com/">FamFamFam</a
|
|
|
265 |
</p>
|
266 |
<p>
|
267 |
<strong>Note:</strong><br />
|
@@ -282,6 +283,15 @@
|
|
282 |
<div id="Changelog" style="display: none;">
|
283 |
<div class="SubTitle">» Changelog</div>
|
284 |
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
285 |
<li>
|
286 |
<strong>Version 2.30 (01-06-2008)</strong>
|
287 |
<ul>
|
@@ -426,7 +436,7 @@
|
|
426 |
<!-- Upgrade Instructions -->
|
427 |
<div id="Upgrade" style="display: none;">
|
428 |
<div class="SubTitle">» Upgrade Instructions</div>
|
429 |
-
<div class="SubSubTitle">From v2.0x To v2.
|
430 |
<ol>
|
431 |
<li>
|
432 |
<strong>Deactivate</strong> WP-Print Plugin
|
@@ -489,16 +499,24 @@
|
|
489 |
<div class="SubSubTitle">Note</div>
|
490 |
<ul>
|
491 |
<li>
|
492 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
493 |
<ul>
|
494 |
-
<li>If it doesn't exists, it will just load the
|
495 |
-
<li>This will allow you to upgrade WP-Print without worrying about overwriting your printing styles that you have created.</li>
|
496 |
</ul>
|
497 |
</li>
|
498 |
</ul>
|
499 |
</div>
|
500 |
</div>
|
501 |
</div>
|
502 |
-
<p id="Copyright">WP-Print 2.
|
503 |
</body>
|
504 |
</html>
|
2 |
<html>
|
3 |
<head>
|
4 |
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
5 |
+
<title>WP-Print 2.31 Readme</title>
|
6 |
<style type="text/css" media="screen">
|
7 |
/* Default Style */
|
8 |
BODY {
|
203 |
<body>
|
204 |
<div id="Container">
|
205 |
<!-- Title -->
|
206 |
+
<div id="Title">WP-Print 2.31 <span style="color: #aaaaaa;">Readme</span></div>
|
207 |
|
208 |
<!-- Tabs -->
|
209 |
<ul id="Tabs">
|
234 |
</p>
|
235 |
<p>
|
236 |
<strong>Download:</strong><br />
|
237 |
+
<strong>»</strong> <a href="http://downloads.wordpress.org/plugin/wp-print.2.31.zip" title="http://downloads.wordpress.org/plugin/wp-print.2.31.zip">WP-Print 2.31 For WordPress 2.5.x And 2.6.x</a><br />
|
238 |
<strong>»</strong> <a href="http://downloads.wordpress.org/plugin/wp-print.2.20.zip" title="http://downloads.wordpress.org/plugin/wp-print.2.20.zip">WP-Print 2.20 For WordPress 2.1.x, 2.2.x And 2.3.x</a><br />
|
239 |
<strong>»</strong> <a href="http://downloads.wordpress.org/plugin/wp-print.2.06.zip" title="http://downloads.wordpress.org/plugin/wp-print.2.06.zip">WP-Print 2.06 For WordPress 2.0.x</a><br />
|
240 |
<strong>»</strong> <a href="http://downloads.wordpress.org/plugin/wp-print.2.00.zip" title="http://downloads.wordpress.org/plugin/wp-print.2.00.zip">WP-Print 2.00 For WordPress 1.5.2</a>
|
261 |
</p>
|
262 |
<p>
|
263 |
<strong>Credits:</strong><br />
|
264 |
+
<strong>»</strong> Icons courtesy of <a href="http://www.famfamfam.com/">FamFamFam</a>.<br />
|
265 |
+
<strong>»</strong> Do Not Print idea by <a href="http://www.nilpo.com/">Robert "Nilpo" Dunham</a>.
|
266 |
</p>
|
267 |
<p>
|
268 |
<strong>Note:</strong><br />
|
283 |
<div id="Changelog" style="display: none;">
|
284 |
<div class="SubTitle">» Changelog</div>
|
285 |
<ul>
|
286 |
+
<li>
|
287 |
+
<strong>Version 2.31 (16-07-2008)</strong>
|
288 |
+
<ul>
|
289 |
+
<li>NEW: Works For WordPress 2.6</li>
|
290 |
+
<li>NEW: Added donotprint ShortCode. See Usage Tab</li>
|
291 |
+
<li>NEW: WP-Print Will Load print-posts.php And print-comments.php Templates From Your Theme Directory First If The Exist</li>
|
292 |
+
<li>FIXED: Replace <center> With <div style="margin: 0px auto 0px auto;"></li>
|
293 |
+
</ul>
|
294 |
+
</li>
|
295 |
<li>
|
296 |
<strong>Version 2.30 (01-06-2008)</strong>
|
297 |
<ul>
|
436 |
<!-- Upgrade Instructions -->
|
437 |
<div id="Upgrade" style="display: none;">
|
438 |
<div class="SubTitle">» Upgrade Instructions</div>
|
439 |
+
<div class="SubSubTitle">From v2.0x To v2.31</div>
|
440 |
<ol>
|
441 |
<li>
|
442 |
<strong>Deactivate</strong> WP-Print Plugin
|
499 |
<div class="SubSubTitle">Note</div>
|
500 |
<ul>
|
501 |
<li>
|
502 |
+
If you do not want to print a portion of your post's content, do the following:
|
503 |
+
<blockquote>
|
504 |
+
[donotprint]Text within this tag will not be displayed when printing[/donotprint]
|
505 |
+
</blockquote>
|
506 |
+
<p>The text within [donotprint][/donotprint] will not be displayed when you are viewing a printer friendly version of a post or page.</p>
|
507 |
+
<p>However, it will still be displayed as normal on a normal post or page view.</p>
|
508 |
+
</li>
|
509 |
+
<li>
|
510 |
+
WP-Print will load '<strong>print-css.css</strong>', '<strong>print-posts.php</strong>' and '<strong>print-comments.php</strong>' from your theme's directory if it exists.
|
511 |
<ul>
|
512 |
+
<li>If it doesn't exists, it will just load the respective defalult file that comes with WP-Print.</li>
|
513 |
+
<li>This will allow you to upgrade WP-Print without worrying about overwriting your printing styles or templates that you have created.</li>
|
514 |
</ul>
|
515 |
</li>
|
516 |
</ul>
|
517 |
</div>
|
518 |
</div>
|
519 |
</div>
|
520 |
+
<p id="Copyright">WP-Print 2.31<br />Copyright © 2008 Lester 'GaMerZ' Chan. All Rights Reserved.</p>
|
521 |
</body>
|
522 |
</html>
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: GamerZ
|
|
3 |
Donate link: http://lesterchan.net/wordpress
|
4 |
Tags: print, printer, wp-print
|
5 |
Requires at least: 2.5.0
|
6 |
-
Stable tag: 2.
|
7 |
|
8 |
Displays a printable version of your WordPress blog's post/page.
|
9 |
|
3 |
Donate link: http://lesterchan.net/wordpress
|
4 |
Tags: print, printer, wp-print
|
5 |
Requires at least: 2.5.0
|
6 |
+
Stable tag: 2.31
|
7 |
|
8 |
Displays a printable version of your WordPress blog's post/page.
|
9 |
|
wp-print.mo
CHANGED
Binary file
|
wp-print.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: WP-Print
|
4 |
Plugin URI: http://lesterchan.net/portfolio/programming/php/
|
5 |
Description: Displays a printable version of your WordPress blog's post/page.
|
6 |
-
Version: 2.
|
7 |
Author: Lester 'GaMerZ' Chan
|
8 |
Author URI: http://lesterchan.net
|
9 |
*/
|
@@ -28,10 +28,29 @@ Author URI: http://lesterchan.net
|
|
28 |
*/
|
29 |
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
### Create Text Domain For Translations
|
32 |
add_action('init', 'print_textdomain');
|
33 |
function print_textdomain() {
|
34 |
-
|
|
|
|
|
|
|
|
|
35 |
}
|
36 |
|
37 |
|
@@ -112,7 +131,7 @@ function print_link($print_post_text = '', $print_page_text = '', $echo = true)
|
|
112 |
} else {
|
113 |
$print_text = $print_post_text;
|
114 |
}
|
115 |
-
$print_icon =
|
116 |
$print_link = get_permalink();
|
117 |
$print_html = stripslashes($print_options['print_html']);
|
118 |
// Fix For Static Page
|
@@ -185,6 +204,16 @@ function print_link_shortcode($atts) {
|
|
185 |
}
|
186 |
|
187 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
### Function: Print Content
|
189 |
function print_content($display = true) {
|
190 |
global $links_text, $link_number, $max_link_number, $matched_links, $pages, $multipage, $numpages, $post;
|
@@ -202,6 +231,8 @@ function print_content($display = true) {
|
|
202 |
} else {
|
203 |
$content = $pages[0];
|
204 |
}
|
|
|
|
|
205 |
$content = apply_filters('the_content', $content);
|
206 |
$content = str_replace(']]>', ']]>', $content);
|
207 |
if(!print_can('images')) {
|
@@ -364,7 +395,7 @@ function print_links($text_links = '') {
|
|
364 |
add_action('template_redirect', 'wp_print');
|
365 |
function wp_print() {
|
366 |
if(intval(get_query_var('print')) == 1 || intval(get_query_var('printpage')) == 1) {
|
367 |
-
include(
|
368 |
exit;
|
369 |
}
|
370 |
}
|
@@ -372,7 +403,11 @@ function wp_print() {
|
|
372 |
|
373 |
### Function: Add Print Comments Template
|
374 |
function print_template_comments($file = '') {
|
375 |
-
|
|
|
|
|
|
|
|
|
376 |
return $file;
|
377 |
}
|
378 |
|
3 |
Plugin Name: WP-Print
|
4 |
Plugin URI: http://lesterchan.net/portfolio/programming/php/
|
5 |
Description: Displays a printable version of your WordPress blog's post/page.
|
6 |
+
Version: 2.31
|
7 |
Author: Lester 'GaMerZ' Chan
|
8 |
Author URI: http://lesterchan.net
|
9 |
*/
|
28 |
*/
|
29 |
|
30 |
|
31 |
+
### Use WordPress 2.6 Constants
|
32 |
+
if (!defined('WP_CONTENT_DIR')) {
|
33 |
+
define( 'WP_CONTENT_DIR', ABSPATH.'wp-content');
|
34 |
+
}
|
35 |
+
if (!defined('WP_CONTENT_URL')) {
|
36 |
+
define('WP_CONTENT_URL', get_option('siteurl').'/wp-content');
|
37 |
+
}
|
38 |
+
if (!defined('WP_PLUGIN_DIR')) {
|
39 |
+
define('WP_PLUGIN_DIR', WP_CONTENT_DIR.'/plugins');
|
40 |
+
}
|
41 |
+
if (!defined('WP_PLUGIN_URL')) {
|
42 |
+
define('WP_PLUGIN_URL', WP_CONTENT_URL.'/plugins');
|
43 |
+
}
|
44 |
+
|
45 |
+
|
46 |
### Create Text Domain For Translations
|
47 |
add_action('init', 'print_textdomain');
|
48 |
function print_textdomain() {
|
49 |
+
if (!function_exists('wp_print_styles')) {
|
50 |
+
load_plugin_textdomain('wp-print', 'wp-content/plugins/wp-print');
|
51 |
+
} else {
|
52 |
+
load_plugin_textdomain('wp-print', false, 'wp-print');
|
53 |
+
}
|
54 |
}
|
55 |
|
56 |
|
131 |
} else {
|
132 |
$print_text = $print_post_text;
|
133 |
}
|
134 |
+
$print_icon = WP_PLUGIN_URL.'/wp-print/images/'.$print_options['print_icon'];
|
135 |
$print_link = get_permalink();
|
136 |
$print_html = stripslashes($print_options['print_html']);
|
137 |
// Fix For Static Page
|
204 |
}
|
205 |
|
206 |
|
207 |
+
### Function: Short Code For DO NOT PRINT Content
|
208 |
+
add_shortcode('donotprint', 'print_donotprint_shortcode');
|
209 |
+
function print_donotprint_shortcode($atts, $content = null) {
|
210 |
+
return $content;
|
211 |
+
}
|
212 |
+
function print_donotprint_shortcode2($atts, $content = null) {
|
213 |
+
return;
|
214 |
+
}
|
215 |
+
|
216 |
+
|
217 |
### Function: Print Content
|
218 |
function print_content($display = true) {
|
219 |
global $links_text, $link_number, $max_link_number, $matched_links, $pages, $multipage, $numpages, $post;
|
231 |
} else {
|
232 |
$content = $pages[0];
|
233 |
}
|
234 |
+
remove_shortcode('donotprint', 'print_donotprint_shortcode');
|
235 |
+
add_shortcode('donotprint', 'print_donotprint_shortcode2');
|
236 |
$content = apply_filters('the_content', $content);
|
237 |
$content = str_replace(']]>', ']]>', $content);
|
238 |
if(!print_can('images')) {
|
395 |
add_action('template_redirect', 'wp_print');
|
396 |
function wp_print() {
|
397 |
if(intval(get_query_var('print')) == 1 || intval(get_query_var('printpage')) == 1) {
|
398 |
+
include(WP_PLUGIN_DIR.'/wp-print/print.php');
|
399 |
exit;
|
400 |
}
|
401 |
}
|
403 |
|
404 |
### Function: Add Print Comments Template
|
405 |
function print_template_comments($file = '') {
|
406 |
+
if(file_exists(TEMPLATEPATH.'/print-comments.php')) {
|
407 |
+
$file = TEMPLATEPATH.'/print-comments.php';
|
408 |
+
} else {
|
409 |
+
$file = WP_PLUGIN_DIR.'/wp-print/print-comments.php';
|
410 |
+
}
|
411 |
return $file;
|
412 |
}
|
413 |
|
wp-print.pot
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
-
"Project-Id-Version: WP-Print 2.
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
-
"POT-Creation-Date: 2008-
|
6 |
-
"PO-Revision-Date: 2008-
|
7 |
"Last-Translator: Lester Chan <lesterchan@gmail.com>\n"
|
8 |
"Language-Team: Lester Chan <lesterchan@gmail.com>\n"
|
9 |
"MIME-Version: 1.0\n"
|
@@ -15,46 +15,46 @@ msgstr ""
|
|
15 |
"X-Poedit-Basepath: .\n"
|
16 |
"X-Poedit-SearchPath-0: .\n"
|
17 |
|
18 |
-
#: print-comments.php:
|
19 |
msgid "Open"
|
20 |
msgstr ""
|
21 |
|
22 |
-
#: print-comments.php:
|
23 |
msgid "Close"
|
24 |
msgstr ""
|
25 |
|
26 |
-
#: print-comments.php:
|
27 |
msgid "To"
|
28 |
msgstr ""
|
29 |
|
30 |
-
#: print-comments.php:
|
31 |
msgid "Comment"
|
32 |
msgstr ""
|
33 |
|
34 |
-
#: print-comments.php:
|
35 |
msgid "Trackback"
|
36 |
msgstr ""
|
37 |
|
38 |
-
#: print-comments.php:
|
39 |
msgid "Pingback"
|
40 |
msgstr ""
|
41 |
|
42 |
-
#: print-comments.php:
|
43 |
msgid "By"
|
44 |
msgstr ""
|
45 |
|
46 |
-
#: print-comments.php:
|
47 |
-
#: print-posts.php:
|
48 |
msgid "On"
|
49 |
msgstr ""
|
50 |
|
51 |
-
#: print-comments.php:
|
52 |
-
#: print-posts.php:
|
53 |
#, php-format
|
54 |
msgid "%s @ %s"
|
55 |
msgstr ""
|
56 |
|
57 |
-
#: print-comments.php:
|
58 |
msgid "Your comment is awaiting moderation."
|
59 |
msgstr ""
|
60 |
|
@@ -98,7 +98,7 @@ msgid "<a href=\"%s\">Click Here</a> To Finish The Uninstallation And WP-Print W
|
|
98 |
msgstr ""
|
99 |
|
100 |
#: print-options.php:122
|
101 |
-
#: wp-print.php:
|
102 |
#, php-format
|
103 |
msgid "Copyright © %s %s. All rights reserved."
|
104 |
msgstr ""
|
@@ -240,85 +240,85 @@ msgid ""
|
|
240 |
" Choose [Cancel] To Stop, [OK] To Uninstall."
|
241 |
msgstr ""
|
242 |
|
243 |
-
#: print-posts.php:
|
244 |
msgid "Posted By"
|
245 |
msgstr ""
|
246 |
|
247 |
-
#: print-posts.php:
|
248 |
msgid "In"
|
249 |
msgstr ""
|
250 |
|
251 |
-
#: print-posts.php:
|
252 |
msgid "Article printed from"
|
253 |
msgstr ""
|
254 |
|
255 |
-
#: print-posts.php:
|
256 |
msgid "URL to article"
|
257 |
msgstr ""
|
258 |
|
259 |
-
#: print-posts.php:
|
260 |
msgid "Click"
|
261 |
msgstr ""
|
262 |
|
263 |
-
#: print-posts.php:
|
264 |
msgid "Click here to print."
|
265 |
msgstr ""
|
266 |
|
267 |
-
#: print-posts.php:
|
268 |
msgid "here"
|
269 |
msgstr ""
|
270 |
|
271 |
-
#: print-posts.php:
|
272 |
msgid "to print."
|
273 |
msgstr ""
|
274 |
|
275 |
-
#: print-posts.php:
|
276 |
msgid "No posts matched your criteria."
|
277 |
msgstr ""
|
278 |
|
279 |
-
#: wp-print.php:
|
280 |
msgid "Print"
|
281 |
msgstr ""
|
282 |
|
283 |
-
#: wp-print.php:
|
284 |
msgid "Note: There is a print link embedded within this post, please visit this post to print it."
|
285 |
msgstr ""
|
286 |
|
287 |
-
#: wp-print.php:
|
288 |
-
#: wp-print.php:
|
289 |
msgid "Image"
|
290 |
msgstr ""
|
291 |
|
292 |
-
#: wp-print.php:
|
293 |
msgid "No Comments"
|
294 |
msgstr ""
|
295 |
|
296 |
-
#: wp-print.php:
|
297 |
msgid "1 Comment"
|
298 |
msgstr ""
|
299 |
|
300 |
-
#: wp-print.php:
|
301 |
#, php-format
|
302 |
msgid "%s Comments"
|
303 |
msgstr ""
|
304 |
|
305 |
-
#: wp-print.php:
|
306 |
msgid "Comments Disabled"
|
307 |
msgstr ""
|
308 |
|
309 |
-
#: wp-print.php:
|
310 |
msgid "Comments Hidden"
|
311 |
msgstr ""
|
312 |
|
313 |
-
#: wp-print.php:
|
314 |
msgid "URLs in this post:"
|
315 |
msgstr ""
|
316 |
|
317 |
-
#: wp-print.php:
|
318 |
msgid "Print This Post"
|
319 |
msgstr ""
|
320 |
|
321 |
-
#: wp-print.php:
|
322 |
msgid "Print This Page"
|
323 |
msgstr ""
|
324 |
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
+
"Project-Id-Version: WP-Print 2.31\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2008-07-15 15:44+0800\n"
|
6 |
+
"PO-Revision-Date: 2008-07-15 15:44+0800\n"
|
7 |
"Last-Translator: Lester Chan <lesterchan@gmail.com>\n"
|
8 |
"Language-Team: Lester Chan <lesterchan@gmail.com>\n"
|
9 |
"MIME-Version: 1.0\n"
|
15 |
"X-Poedit-Basepath: .\n"
|
16 |
"X-Poedit-SearchPath-0: .\n"
|
17 |
|
18 |
+
#: print-comments.php:23
|
19 |
msgid "Open"
|
20 |
msgstr ""
|
21 |
|
22 |
+
#: print-comments.php:23
|
23 |
msgid "Close"
|
24 |
msgstr ""
|
25 |
|
26 |
+
#: print-comments.php:25
|
27 |
msgid "To"
|
28 |
msgstr ""
|
29 |
|
30 |
+
#: print-comments.php:28
|
31 |
msgid "Comment"
|
32 |
msgstr ""
|
33 |
|
34 |
+
#: print-comments.php:28
|
35 |
msgid "Trackback"
|
36 |
msgstr ""
|
37 |
|
38 |
+
#: print-comments.php:28
|
39 |
msgid "Pingback"
|
40 |
msgstr ""
|
41 |
|
42 |
+
#: print-comments.php:28
|
43 |
msgid "By"
|
44 |
msgstr ""
|
45 |
|
46 |
+
#: print-comments.php:28
|
47 |
+
#: print-posts.php:50
|
48 |
msgid "On"
|
49 |
msgstr ""
|
50 |
|
51 |
+
#: print-comments.php:28
|
52 |
+
#: print-posts.php:50
|
53 |
#, php-format
|
54 |
msgid "%s @ %s"
|
55 |
msgstr ""
|
56 |
|
57 |
+
#: print-comments.php:32
|
58 |
msgid "Your comment is awaiting moderation."
|
59 |
msgstr ""
|
60 |
|
98 |
msgstr ""
|
99 |
|
100 |
#: print-options.php:122
|
101 |
+
#: wp-print.php:466
|
102 |
#, php-format
|
103 |
msgid "Copyright © %s %s. All rights reserved."
|
104 |
msgstr ""
|
240 |
" Choose [Cancel] To Stop, [OK] To Uninstall."
|
241 |
msgstr ""
|
242 |
|
243 |
+
#: print-posts.php:50
|
244 |
msgid "Posted By"
|
245 |
msgstr ""
|
246 |
|
247 |
+
#: print-posts.php:50
|
248 |
msgid "In"
|
249 |
msgstr ""
|
250 |
|
251 |
+
#: print-posts.php:57
|
252 |
msgid "Article printed from"
|
253 |
msgstr ""
|
254 |
|
255 |
+
#: print-posts.php:58
|
256 |
msgid "URL to article"
|
257 |
msgstr ""
|
258 |
|
259 |
+
#: print-posts.php:62
|
260 |
msgid "Click"
|
261 |
msgstr ""
|
262 |
|
263 |
+
#: print-posts.php:62
|
264 |
msgid "Click here to print."
|
265 |
msgstr ""
|
266 |
|
267 |
+
#: print-posts.php:62
|
268 |
msgid "here"
|
269 |
msgstr ""
|
270 |
|
271 |
+
#: print-posts.php:62
|
272 |
msgid "to print."
|
273 |
msgstr ""
|
274 |
|
275 |
+
#: print-posts.php:64
|
276 |
msgid "No posts matched your criteria."
|
277 |
msgstr ""
|
278 |
|
279 |
+
#: wp-print.php:61
|
280 |
msgid "Print"
|
281 |
msgstr ""
|
282 |
|
283 |
+
#: wp-print.php:202
|
284 |
msgid "Note: There is a print link embedded within this post, please visit this post to print it."
|
285 |
msgstr ""
|
286 |
|
287 |
+
#: wp-print.php:274
|
288 |
+
#: wp-print.php:342
|
289 |
msgid "Image"
|
290 |
msgstr ""
|
291 |
|
292 |
+
#: wp-print.php:365
|
293 |
msgid "No Comments"
|
294 |
msgstr ""
|
295 |
|
296 |
+
#: wp-print.php:367
|
297 |
msgid "1 Comment"
|
298 |
msgstr ""
|
299 |
|
300 |
+
#: wp-print.php:369
|
301 |
#, php-format
|
302 |
msgid "%s Comments"
|
303 |
msgstr ""
|
304 |
|
305 |
+
#: wp-print.php:372
|
306 |
msgid "Comments Disabled"
|
307 |
msgstr ""
|
308 |
|
309 |
+
#: wp-print.php:375
|
310 |
msgid "Comments Hidden"
|
311 |
msgstr ""
|
312 |
|
313 |
+
#: wp-print.php:386
|
314 |
msgid "URLs in this post:"
|
315 |
msgstr ""
|
316 |
|
317 |
+
#: wp-print.php:457
|
318 |
msgid "Print This Post"
|
319 |
msgstr ""
|
320 |
|
321 |
+
#: wp-print.php:458
|
322 |
msgid "Print This Page"
|
323 |
msgstr ""
|
324 |
|