WP-Print - Version 2.10

Version Description

Download this release

Release Info

Developer GamerZ
Plugin Icon WP-Print
Version 2.10
Comparing to
See all releases

Code changes from version 1.00 to 2.10

print/print-options.php ADDED
@@ -0,0 +1,183 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ +----------------------------------------------------------------+
4
+ | |
5
+ | WordPress 2.1 Plugin: WP-Print 2.10 |
6
+ | Copyright (c) 2007 Lester "GaMerZ" Chan |
7
+ | |
8
+ | File Written By: |
9
+ | - Lester "GaMerZ" Chan |
10
+ | - http://www.lesterchan.net |
11
+ | |
12
+ | File Information: |
13
+ | - Print Options Page |
14
+ | - wp-content/plugins/print/print-options.php |
15
+ | |
16
+ +----------------------------------------------------------------+
17
+ */
18
+
19
+
20
+ ### Variables Variables Variables
21
+ $base_name = plugin_basename('print/print-options.php');
22
+ $base_page = 'admin.php?page='.$base_name;
23
+ $id = intval($_GET['id']);
24
+
25
+ ### If Form Is Submitted
26
+ if($_POST['Submit']) {
27
+ $print_options = array();
28
+ $print_options['post_text'] = addslashes(trim($_POST['print_post_text']));
29
+ $print_options['page_text'] = addslashes(trim($_POST['print_page_text']));
30
+ $print_options['print_icon'] = trim($_POST['print_icon']);
31
+ $print_options['print_style'] = intval($_POST['print_style']);
32
+ $print_options['print_html'] = trim($_POST['print_html']);
33
+ $print_options['comments'] = intval($_POST['print_comments']);
34
+ $print_options['links'] = intval($_POST['print_links']);
35
+ $print_options['images'] = intval($_POST['print_images']);
36
+ $update_print_queries = array();
37
+ $update_print_text = array();
38
+ $update_print_queries[] = update_option('print_options', $print_options);
39
+ $update_print_text[] = __('Print Options', 'wp-print');
40
+ $i=0;
41
+ $text = '';
42
+ foreach($update_print_queries as $update_print_query) {
43
+ if($update_print_query) {
44
+ $text .= '<font color="green">'.$update_print_text[$i].' '.__('Updated', 'wp-print').'</font><br />';
45
+ }
46
+ $i++;
47
+ }
48
+ if(empty($text)) {
49
+ $text = '<font color="red">'.__('No Print Option Updated', 'wp-print').'</font>';
50
+ }
51
+ }
52
+
53
+ ### Get Print Options
54
+ $print_options = get_option('print_options');
55
+ ?>
56
+ <script type="text/javascript">
57
+ /* <![CDATA[*/
58
+ function check_print_style() {
59
+ print_style_options = document.getElementById("print_style").value;
60
+ if (print_style_options == 4) {
61
+ document.getElementById("print_style_custom").style.display = 'block';
62
+ } else {
63
+ if(document.getElementById("print_style_custom").style.display == 'block') {
64
+ document.getElementById("print_style_custom").style.display = 'none';
65
+ }
66
+ }
67
+ }
68
+ function print_default_templates(template) {
69
+ var default_template;
70
+ switch(template) {
71
+ case 'html':
72
+ default_template = '<a href="%PRINT_URL%" rel="nofollow" title="%PRINT_TEXT%">%PRINT_TEXT%</a>';
73
+ break;
74
+ }
75
+ document.getElementById("print_template_" + template).value = default_template;
76
+ }
77
+ /* ]]> */
78
+ </script>
79
+ <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
80
+ <div class="wrap">
81
+ <h2><?php _e('Print Options', 'wp-print'); ?></h2>
82
+ <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
83
+ <fieldset class="options">
84
+ <legend><?php _e('Print Styles', 'wp-print'); ?></legend>
85
+ <table width="100%" border="0" cellspacing="3" cellpadding="3">
86
+ <tr valign="top">
87
+ <th align="left" width="30%"><?php _e('Print Text Link For Post', 'wp-print'); ?></th>
88
+ <td align="left">
89
+ <input type="text" name="print_post_text" value="<?php echo stripslashes($print_options['post_text']); ?>" size="30" />
90
+ </td>
91
+ </tr>
92
+ <tr valign="top">
93
+ <th align="left" width="30%"><?php _e('Print Text Link For Page', 'wp-print'); ?></th>
94
+ <td align="left">
95
+ <input type="text" name="print_page_text" value="<?php echo stripslashes($print_options['page_text']); ?>" size="30" />
96
+ </td>
97
+ </tr>
98
+ <tr valign="top">
99
+ <th align="left" width="30%"><?php _e('Print Icon', 'wp-print'); ?></th>
100
+ <td align="left">
101
+ <?php
102
+ $print_icon = $print_options['print_icon'];
103
+ $print_icon_url = get_option('siteurl').'/wp-content/plugins/print/images';
104
+ $print_icon_path = ABSPATH.'/wp-content/plugins/print/images';
105
+ if($handle = @opendir($print_icon_path)) {
106
+ while (false !== ($filename = readdir($handle))) {
107
+ if ($filename != '.' && $filename != '..') {
108
+ if(is_file($print_icon_path.'/'.$filename)) {
109
+ if($print_icon == $filename) {
110
+ echo '<input type="radio" name="print_icon" value="'.$filename.'" checked="checked" />'."\n";
111
+ } else {
112
+ echo '<input type="radio" name="print_icon" value="'.$filename.'" />'."\n";
113
+ }
114
+ echo '&nbsp;&nbsp;&nbsp;';
115
+ echo '<img src="'.$print_icon_url.'/'.$filename.'" alt="'.$filename.'" />'."\n";
116
+ echo '&nbsp;&nbsp;&nbsp;('.$filename.')';
117
+ echo '<br /><br />'."\n";
118
+ }
119
+ }
120
+ }
121
+ closedir($handle);
122
+ }
123
+ ?>
124
+ </td>
125
+ </tr>
126
+ <tr valign="top">
127
+ <th align="left" width="30%"><?php _e('Print Text Link Style', 'wp-print'); ?></th>
128
+ <td align="left">
129
+ <select name="print_style" id="print_style" size="1" onchange="check_print_style();">
130
+ <option value="1"<?php selected('1', $print_options['print_style']); ?>><?php _e('Print Icon With Text Link', 'wp-print'); ?></option>
131
+ <option value="2"<?php selected('2', $print_options['print_style']); ?>><?php _e('Print Icon Only', 'wp-print'); ?></option>
132
+ <option value="3"<?php selected('3', $print_options['print_style']); ?>><?php _e('Print Text Link Only', 'wp-print'); ?></option>
133
+ <option value="4"<?php selected('4', $print_options['print_style']); ?>><?php _e('Custom', 'wp-print'); ?></option>
134
+ </select>
135
+ <div id="print_style_custom" style="display: <?php if(intval($print_options['print_style']) == 4) { echo 'block'; } else { echo 'none'; } ?>; margin-top: 20px;">
136
+ <textarea rows="2" cols="80" name="print_html" id="print_template_html"><?php echo htmlspecialchars(stripslashes($print_options['print_html'])); ?></textarea><br />
137
+ <?php _e('HTML is allowed.', 'wp-print'); ?><br />
138
+ %PRINT_URL% - <?php _e('URL to the printable post/page.', 'wp-print'); ?><br />
139
+ %PRINT_TEXT% - <?php _e('Print text link of the post/page that you have typed in above.', 'wp-print'); ?><br />
140
+ %PRINT_ICON_URL% - <?php _e('URL to the print icon you have chosen above.', 'wp-print'); ?><br />
141
+ <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-print'); ?>" onclick="javascript: print_default_templates('html');" class="button" />
142
+ </div>
143
+ </td>
144
+ </tr>
145
+ </table>
146
+ </fieldset>
147
+ <fieldset class="options">
148
+ <legend><?php _e('Print Options', 'wp-print'); ?></legend>
149
+ <table width="100%" border="0" cellspacing="3" cellpadding="3">
150
+ <tr valign="top">
151
+ <th align="left" width="30%"><?php _e('Print Comments?', 'wp-print'); ?></th>
152
+ <td align="left">
153
+ <select name="print_comments" size="1">
154
+ <option value="1"<?php selected('1', $print_options['comments']); ?>><?php _e('Yes', 'wp-print'); ?></option>
155
+ <option value="0"<?php selected('0', $print_options['comments']); ?>><?php _e('No', 'wp-print'); ?></option>
156
+ </select>
157
+ </td>
158
+ </tr>
159
+ <tr valign="top">
160
+ <th align="left" width="30%"><?php _e('Print Links?', 'wp-print'); ?></th>
161
+ <td align="left">
162
+ <select name="print_links" size="1">
163
+ <option value="1"<?php selected('1', $print_options['links']); ?>><?php _e('Yes', 'wp-print'); ?></option>
164
+ <option value="0"<?php selected('0', $print_options['links']); ?>><?php _e('No', 'wp-print'); ?></option>
165
+ </select>
166
+ </td>
167
+ </tr>
168
+ <tr valign="top">
169
+ <th align="left" width="30%"><?php _e('Print Images?', 'wp-print'); ?></th>
170
+ <td align="left">
171
+ <select name="print_images" size="1">
172
+ <option value="1"<?php selected('1', $print_options['images']); ?>><?php _e('Yes', 'wp-print'); ?></option>
173
+ <option value="0"<?php selected('0', $print_options['images']); ?>><?php _e('No', 'wp-print'); ?></option>
174
+ </select>
175
+ </td>
176
+ </tr>
177
+ </table>
178
+ </fieldset>
179
+ <div align="center">
180
+ <input type="submit" name="Submit" class="button" value="<?php _e('Update Options', 'wp-print'); ?>" />&nbsp;&nbsp;<input type="button" name="cancel" value="<?php _e('Cancel', 'wp-print'); ?>" class="button" onclick="javascript:history.go(-1)" />
181
+ </div>
182
+ </form>
183
+ </div>
print/print.php ADDED
@@ -0,0 +1,331 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: WP-Print
4
+ Plugin URI: http://www.lesterchan.net/portfolio/programming.php
5
+ Description: Displays a printable version of your WordPress blog's post/page.
6
+ Version: 2.10
7
+ Author: GaMerZ
8
+ Author URI: http://www.lesterchan.net
9
+ */
10
+
11
+
12
+ /*
13
+ Copyright 2007 Lester Chan (email : gamerz84@hotmail.com)
14
+
15
+ This program is free software; you can redistribute it and/or modify
16
+ it under the terms of the GNU General Public License as published by
17
+ the Free Software Foundation; either version 2 of the License, or
18
+ (at your option) any later version.
19
+
20
+ This program is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ GNU General Public License for more details.
24
+
25
+ You should have received a copy of the GNU General Public License
26
+ along with this program; if not, write to the Free Software
27
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28
+ */
29
+
30
+
31
+ ### Create Text Domain For Translations
32
+ load_plugin_textdomain('wp-print', 'wp-content/plugins/print');
33
+
34
+
35
+ ### Function: Print Option Menu
36
+ add_action('admin_menu', 'print_menu');
37
+ function print_menu() {
38
+ if (function_exists('add_options_page')) {
39
+ add_options_page(__('Print', 'wp-print'), __('Print', 'wp-print'), 'manage_options', 'print/print-options.php') ;
40
+ }
41
+ }
42
+
43
+
44
+ ### Function: Print htaccess ReWrite Rules
45
+ add_filter('generate_rewrite_rules', 'print_rewrite');
46
+ function print_rewrite($wp_rewrite) {
47
+ $r_rule = '';
48
+ $r_link = '';
49
+ $rewrite_rules2 = $wp_rewrite->generate_rewrite_rule($wp_rewrite->permalink_structure.'print');
50
+ array_splice($rewrite_rules2, 1);
51
+ $r_rule = array_keys($rewrite_rules2);
52
+ $r_rule = array_shift($r_rule);
53
+ $r_rule = str_replace('/trackback', '',$r_rule);
54
+ $r_link = array_values($rewrite_rules2);
55
+ $r_link = array_shift($r_link);
56
+ $r_link = str_replace('tb=1', 'print=1', $r_link);
57
+ $print_rules = array($r_rule => $r_link, '(.+)/printpage/?$' => 'index.php?pagename='.$wp_rewrite->preg_index(1).'&print=1');
58
+ $wp_rewrite->rules = $print_rules + $wp_rewrite->rules;
59
+ }
60
+
61
+
62
+ ### Function: Print Public Variables
63
+ add_filter('query_vars', 'print_variables');
64
+ function print_variables($public_query_vars) {
65
+ $public_query_vars[] = 'print';
66
+ return $public_query_vars;
67
+ }
68
+
69
+
70
+ ### Function: Display Print Link
71
+ function print_link($deprecated = '', $deprecated2 ='') {
72
+ global $id;
73
+ $using_permalink = get_option('permalink_structure');
74
+ $print_options = get_option('print_options');
75
+ $print_style = intval($print_options['print_style']);
76
+ $print_text = stripslashes($print_options['post_text']);
77
+ $print_icon = get_option('siteurl').'/wp-content/plugins/print/images/'.$print_options['print_icon'];
78
+ $print_link = get_permalink();
79
+ $print_html = stripslashes($print_options['print_html']);
80
+ if(!empty($using_permalink)) {
81
+ if(is_page()) {
82
+ $print_text = stripslashes($print_options['page_text']);
83
+ $print_link = $print_link.'printpage/';
84
+ } else {
85
+ $print_link = $print_link.'print/';
86
+ }
87
+ } else {
88
+ if(is_page()) {
89
+ $print_text = stripslashes($print_options['page_text']);
90
+ }
91
+ $print_link = $print_link.'&amp;print=1';
92
+ }
93
+ unset($print_options);
94
+ switch($print_style) {
95
+ // Icon + Text Link
96
+ case 1:
97
+ echo '<img src="'.$print_icon.'" alt="'.$print_text.'" title="'.$print_text.'" border="0" />&nbsp;<a href="'.$print_link.'" title="'.$print_text.'" rel="nofollow">'.$print_text.'</a>'."\n";
98
+ break;
99
+ // Icon Only
100
+ case 2:
101
+ echo '<a href="'.$print_link.'" title="'.$print_text.'" rel="nofollow"><img src="'.$print_icon.'" alt="'.$print_text.'" title="'.$print_text.'" border="0" /></a>'."\n";
102
+ break;
103
+ // Text Link Only
104
+ case 3:
105
+ echo '<a href="'.$print_link.'" title="'.$print_text.'" rel="nofollow">'.$print_text.'</a>'."\n";
106
+ break;
107
+ case 4:
108
+ $print_html = str_replace("%PRINT_URL%", $print_link, $print_html);
109
+ $print_html = str_replace("%PRINT_TEXT%", $print_text, $print_html);
110
+ $print_html = str_replace("%PRINT_ICON_URL%", $print_icon, $print_html);
111
+ echo $print_html;
112
+ break;
113
+ }
114
+ }
115
+
116
+
117
+ ### Function: Display Print Image Link (Deprecated)
118
+ function print_link_image() {
119
+ print_link();
120
+ }
121
+
122
+
123
+ ### Function: Print Content
124
+ function print_content($display = true) {
125
+ global $links_text, $link_number, $pages, $multipage, $numpages, $post;
126
+ $max_url_char = 80;
127
+ if(!empty($post->post_password) && stripslashes($_COOKIE['wp-postpass_'.COOKIEHASH]) != $post->post_password) {
128
+ $content = get_the_password_form();
129
+ } else {
130
+ if($multipage) {
131
+ for($page = 0; $page < $numpages; $page++) {
132
+ $content .= $pages[$page];
133
+ }
134
+ } else {
135
+ $content = $pages[0];
136
+ }
137
+ $content = apply_filters('the_content', $content);
138
+ $content = str_replace(']]>', ']]&gt;', $content);
139
+ if(!print_can('images')) {
140
+ $content = remove_image($content);
141
+ }
142
+ if(print_can('links')) {
143
+ preg_match_all('/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches);
144
+ for ($i=0; $i < count($matches[0]); $i++) {
145
+ $link_match = $matches[0][$i];
146
+ $link_number++;
147
+ $link_url = $matches[2][$i];
148
+ if(stristr($link_url, 'https://')) {
149
+ $link_url =(strtolower(substr($link_url,0,8)) != 'https://') ?get_option('home') . $link_url : $link_url;
150
+ } else if( stristr($link_url, 'mailto:')) {
151
+ $link_url =(strtolower(substr($link_url,0,7)) != 'mailto:') ?get_option('home') . $link_url : $link_url;
152
+ } else if( $link_url[0] == '#' ) {
153
+ $link_url = $link_url;
154
+ } else {
155
+ $link_url =(strtolower(substr($link_url,0,7)) != 'http://') ?get_option('home') . $link_url : $link_url;
156
+ }
157
+ $link_text = $matches[4][$i];
158
+ $content = str_replace_one($link_match, '['.$link_number."] <a href=\"$link_url\" rel=\"external\">".$link_text.'</a>', $content);
159
+ if(strlen($link_url) > 100) {
160
+ $link_url = chunk_split($link_url, 100, "<br />\n");
161
+ }
162
+ if(preg_match('/<img(.+?)src=\"(.+?)\"(.*?)>/',$link_text)) {
163
+ $links_text .= '<br />['.$link_number.'] '.__('Image', 'wp-print').': <b>'.$link_url.'</b>';
164
+ } else {
165
+ $links_text .= '<br />['.$link_number.'] '.$link_text.': <b>'.$link_url.'</b>';
166
+ }
167
+ }
168
+ }
169
+ }
170
+ if($display) {
171
+ echo $content;
172
+ } else {
173
+ return $content;
174
+ }
175
+ }
176
+
177
+
178
+ ### Function: Print Categories
179
+ function print_categories($before = '', $after = '') {
180
+ $temp_cat = strip_tags(get_the_category_list(',' , $parents));
181
+ $temp_cat = explode(', ', $temp_cat);
182
+ $temp_cat = implode($after.', '.$before, $temp_cat);
183
+ echo $before.$temp_cat.$after;
184
+ }
185
+
186
+
187
+ ### Function: Print Comments Content
188
+ function print_comments_content($display = true) {
189
+ global $links_text, $link_number;
190
+ $content = get_comment_text();
191
+ $content = apply_filters('comment_text', $content);
192
+ if(!print_can('images')) {
193
+ $content = remove_image($content);
194
+ }
195
+ if(print_can('links')) {
196
+ preg_match_all('/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches);
197
+ for ($i=0; $i < count($matches[0]); $i++) {
198
+ $link_match = $matches[0][$i];
199
+ $link_number++;
200
+ $link_url = $matches[2][$i];
201
+ if(stristr($link_url, 'https://')) {
202
+ $link_url =(strtolower(substr($link_url,0,8)) != 'https://') ?get_option('home') . $link_url : $link_url;
203
+ } else if(stristr($link_url, 'mailto:')) {
204
+ $link_url =(strtolower(substr($link_url,0,7)) != 'mailto:') ?get_option('home') . $link_url : $link_url;
205
+ } else if($link_url[0] == '#') {
206
+ $link_url = $link_url;
207
+ } else {
208
+ $link_url =(strtolower(substr($link_url,0,7)) != 'http://') ?get_option('home') . $link_url : $link_url;
209
+ }
210
+ $link_text = $matches[4][$i];
211
+ $content = str_replace_one($link_match, '['.$link_number."] <a href=\"$link_url\" rel=\"external\">".$link_text.'</a>', $content);
212
+ if(strlen($link_url) > 100) {
213
+ $link_url = chunk_split($link_url, 100, "<br />\n");
214
+ }
215
+ if(preg_match('/<img(.+?)src=\"(.+?)\"(.*?)>/',$link_text)) {
216
+ $links_text .= '<br />['.$link_number.'] '.__('Image', 'wp-print').': <b>'.$link_url.'</b>';
217
+ } else {
218
+ $links_text .= '<br />['.$link_number.'] '.$link_text.': <b>'.$link_url.'</b>';
219
+ }
220
+ }
221
+ }
222
+ if($display) {
223
+ echo $content;
224
+ } else {
225
+ return $content;
226
+ }
227
+ }
228
+
229
+
230
+ ### Function: Print Comments
231
+ function print_comments_number() {
232
+ global $post;
233
+ $comment_text = '';
234
+ $comment_status = $post->comment_status;
235
+ if($comment_status == 'open') {
236
+ $num_comments = get_comments_number();
237
+ if($num_comments == 0) {
238
+ $comment_text = __('No Comments', 'wp-print');
239
+ } elseif($num_comments == 1) {
240
+ $comment_text = __('1 Comment', 'wp-print');
241
+ } else {
242
+ $comment_text = sprintf(__('%s Comments', 'wp-print'), $num_comments);
243
+ }
244
+ } else {
245
+ $comment_text = __('Comments Disabled', 'wp-print');
246
+ }
247
+ if(!empty($post->post_password) && stripslashes($_COOKIE['wp-postpass_'.COOKIEHASH]) != $post->post_password) {
248
+ _e('Comments Hidden', 'wp-print');
249
+ } else {
250
+ echo $comment_text;
251
+ }
252
+ }
253
+
254
+
255
+ ### Function: Print Links
256
+ function print_links($text_links = '') {
257
+ global $links_text;
258
+ if(empty($text_links)) {
259
+ $text_links = __('URLs in this post:', 'wp-print');
260
+ }
261
+ if(!empty($links_text)) {
262
+ echo $text_links.$links_text;
263
+ }
264
+ }
265
+
266
+
267
+ ### Function: Load WP-Print
268
+ add_action('template_redirect', 'wp_print');
269
+ function wp_print() {
270
+ if(intval(get_query_var('print')) == 1) {
271
+ include(ABSPATH.'wp-content/plugins/print/wp-print.php');
272
+ exit;
273
+ }
274
+ }
275
+
276
+
277
+ ### Function: Add Print Comments Template
278
+ function print_template_comments($file = '') {
279
+ $file = ABSPATH.'wp-content/plugins/print/wp-print-comments.php';
280
+ return $file;
281
+ }
282
+
283
+
284
+ ### Function: Print Page Title
285
+ function print_pagetitle($print_pagetitle) {
286
+ return '&raquo; Print'.$print_pagetitle;
287
+ }
288
+
289
+
290
+ ### Function: Can Print?
291
+ function print_can($type) {
292
+ $print_options = get_option('print_options');
293
+ return intval($print_options[$type]);
294
+ }
295
+
296
+
297
+ ### Function: Remove Image From Text
298
+ function remove_image($content) {
299
+ $content= preg_replace('/<img(.+?)src=\"(.+?)\"(.*?)>/', '',$content);
300
+ return $content;
301
+ }
302
+
303
+
304
+ ### Function: Replace One Time Only
305
+ function str_replace_one($search, $replace, $content){
306
+ if ($pos = strpos($content, $search)) {
307
+ return substr($content, 0, $pos).$replace.substr($content, $pos+strlen($search));
308
+ } else {
309
+ return $content;
310
+ }
311
+ }
312
+
313
+
314
+ ### Function: Print Options
315
+ add_action('activate_print/print.php', 'print_init');
316
+ function print_init() {
317
+ // Delete Options First
318
+ delete_option('print_options');
319
+ // Add Options
320
+ $print_options = array();
321
+ $print_options['post_text'] = __('Print This Post', 'wp-print');
322
+ $print_options['page_text'] = __('Print This Page', 'wp-print');
323
+ $print_options['print_icon'] = 'print.gif';
324
+ $print_options['print_style'] = 1;
325
+ $print_options['print_html'] = '<a href="%PRINT_URL%" rel="nofollow" title="%PRINT_TEXT%">%PRINT_TEXT%</a>';
326
+ $print_options['comments'] = 0;
327
+ $print_options['links'] = 1;
328
+ $print_options['images'] = 1;
329
+ add_option('print_options', $print_options, 'Print Options');
330
+ }
331
+ ?>
print/wp-print-comments.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ +----------------------------------------------------------------+
4
+ | |
5
+ | WordPress 2.1 Plugin: WP-Print 2.10 |
6
+ | Copyright (c) 2007 Lester "GaMerZ" Chan |
7
+ | |
8
+ | File Written By: |
9
+ | - Lester "GaMerZ" Chan |
10
+ | - http://www.lesterchan.net |
11
+ | |
12
+ | File Information: |
13
+ | - Printer Friendly Page For Comments |
14
+ | - wp-print-comments.php |
15
+ | |
16
+ +----------------------------------------------------------------+
17
+ */
18
+ ?>
19
+ <?php if($comments) : ?>
20
+ <?php $comment_count = 1; ?>
21
+ <p id="CommentTitle"><?php print_comments_number(); ?> <?php _e('To', 'wp-print'); ?> "<?php the_title(); ?>"</p>
22
+ <?php foreach ($comments as $comment) : ?>
23
+ <p class="CommentDate">
24
+ <strong>#<?php echo $comment_count; ?> <?php comment_type(); ?></strong> <?php _e('By', 'wp-print'); ?> <u><?php comment_author(); ?></u> <?php _e('On', 'wp-print'); ?> <?php comment_date(get_option("date_format").' @ '.get_option("time_format")); ?></p>
25
+ <div class="CommentContent">
26
+ <?php if ($comment->comment_approved == '0') : ?>
27
+ <p><em><?php _e('Your comment is awaiting moderation.', 'wp-print'); ?></em></p>
28
+ <?php endif; ?>
29
+ <?php print_comments_content(); ?>
30
+ </div>
31
+ <?php $comment_count++; ?>
32
+ <?php endforeach; ?>
33
+ <hr class="Divider" style="text-align: center;" />
34
+ <?php endif; ?>
print/wp-print.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ +----------------------------------------------------------------+
4
+ | |
5
+ | WordPress 2.1 Plugin: WP-Print 2.10 |
6
+ | Copyright (c) 2007 Lester "GaMerZ" Chan |
7
+ | |
8
+ | File Written By: |
9
+ | - Lester "GaMerZ" Chan |
10
+ | - http://www.lesterchan.net |
11
+ | |
12
+ | File Information: |
13
+ | - Printer Friendly Page |
14
+ | - wp-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
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
31
+ <html xmlns="http://www.w3.org/1999/xhtml">
32
+ <head>
33
+ <title><?php bloginfo('name'); ?> <?php wp_title(); ?></title>
34
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
35
+ <meta name="Robots" content="noindex, nofollow" />
36
+ <style type="text/css" media="screen, print">
37
+ Body {
38
+ font-family: Verdana, Arial, Tahoma;
39
+ font-size: 12px;
40
+ color: #000000;
41
+ }
42
+ #Outline {
43
+ text-align: left;
44
+ width: 90%;
45
+ margin-left: auto;
46
+ margin-right: auto;
47
+ padding: 10px;
48
+ border: 1px solid #000000;
49
+ }
50
+ #BlogTitle {
51
+ font-weight: bold;
52
+ font-size: 16px;
53
+ margin-bottom: 5px;
54
+ }
55
+ #BlogDate {
56
+ margin-top: 5px;
57
+ margin-bottom: 10px;
58
+ }
59
+ #BlogContent {
60
+ padding: 10px;
61
+ margin-top: 10px;
62
+ }
63
+ HR.Divider {
64
+ width: 80%;
65
+ height: 1px;
66
+ color: #000000;
67
+ }
68
+ #CommentTitle {
69
+ font-weight: bold;
70
+ font-size: 16px;
71
+ padding-bottom: 10px;
72
+ }
73
+ .CommentDate {
74
+ margin-top: 5px;
75
+ margin-bottom: 10px;
76
+ }
77
+ .CommentContent {
78
+ padding: 2px 10px 10px 10px;
79
+ }
80
+ @media print {
81
+ #print-link {
82
+ display: none;
83
+ }
84
+ }
85
+ </style>
86
+ </head>
87
+ <body>
88
+ <p style="text-align: center;"><strong>- <?php bloginfo('name'); ?> - <?php bloginfo('url')?> -</strong></p>
89
+ <center>
90
+ <div id="Outline">
91
+ <?php if (have_posts()): ?>
92
+ <?php while (have_posts()): the_post(); ?>
93
+ <p id="BlogTitle"><?php the_title(); ?></p>
94
+ <p id="BlogDate"><?php _e('Posted By', 'wp-print'); ?> <u><?php the_author(); ?></u> <?php _e('On', 'wp-print'); ?> <?php the_time(get_option("date_format").' @ '.get_option("time_format")); ?> <?php _e('In', 'wp-print'); ?> <?php print_categories('<u>', '</u>'); ?> | <u><?php print_comments_number(); ?></u></p>
95
+ <div id="BlogContent"><?php print_content(); ?></div>
96
+ <?php endwhile; ?>
97
+ <hr class="Divider" style="text-align: center;" />
98
+ <?php if(print_can('comments')): ?>
99
+ <?php comments_template(); ?>
100
+ <?php endif; ?>
101
+ <p style="text-align: left;"><?php _e('Article printed from', 'wp-print'); ?> <?php bloginfo('name'); ?>: <strong><?php bloginfo('url'); ?></strong></p>
102
+ <p style="text-align: left;"><?php _e('URL to article', 'wp-print'); ?>: <strong><?php the_permalink(); ?></strong></p>
103
+ <?php if(print_can('links')): ?>
104
+ <p style="text-align: left;"><?php print_links(); ?></p>
105
+ <?php endif; ?>
106
+ <p style="text-align: right;" id="print-link"><?php _e('Click', 'wp-print'); ?> <a href="#Print" onclick="window.print(); return false;" title="<?php _e('Click here to print.', 'wp-print'); ?>"><?php _e('here', 'wp-print'); ?></a> <?php _e('to print.', 'wp-print'); ?></p>
107
+ <?php else: ?>
108
+ <p style="text-align: left;"><?php _e('No posts matched your criteria.', 'wp-print'); ?></p>
109
+ <?php endif; ?>
110
+ </div>
111
+ </center>
112
+ </body>
113
+ </html>
print/wp-print.pot ADDED
@@ -0,0 +1,213 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: WP-Print 2.10\n"
4
+ "POT-Creation-Date: \n"
5
+ "PO-Revision-Date: 2007-01-29 12:59+0800\n"
6
+ "Last-Translator: Lester 'GaMerZ' Chan <gamerz84@hotmail.com>\n"
7
+ "Language-Team: Lester Chan <gamerz84@hotmail.com>\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=utf-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Poedit-Language: English\n"
12
+ "X-Poedit-Country: SINGAPORE\n"
13
+ "X-Poedit-KeywordsList: __;_e\n"
14
+ "X-Poedit-Basepath: .\n"
15
+ "X-Poedit-SearchPath-0: .\n"
16
+
17
+ #: print-options.php:39
18
+ #: print-options.php:81
19
+ #: print-options.php:148
20
+ msgid "Print Options"
21
+ msgstr ""
22
+
23
+ #: print-options.php:44
24
+ msgid "Updated"
25
+ msgstr ""
26
+
27
+ #: print-options.php:49
28
+ msgid "No Print Option Updated"
29
+ msgstr ""
30
+
31
+ #: print-options.php:84
32
+ msgid "Print Styles"
33
+ msgstr ""
34
+
35
+ #: print-options.php:87
36
+ msgid "Print Text Link For Post"
37
+ msgstr ""
38
+
39
+ #: print-options.php:93
40
+ msgid "Print Text Link For Page"
41
+ msgstr ""
42
+
43
+ #: print-options.php:99
44
+ msgid "Print Icon"
45
+ msgstr ""
46
+
47
+ #: print-options.php:127
48
+ msgid "Print Text Link Style"
49
+ msgstr ""
50
+
51
+ #: print-options.php:130
52
+ msgid "Print Icon With Text Link"
53
+ msgstr ""
54
+
55
+ #: print-options.php:131
56
+ msgid "Print Icon Only"
57
+ msgstr ""
58
+
59
+ #: print-options.php:132
60
+ msgid "Print Text Link Only"
61
+ msgstr ""
62
+
63
+ #: print-options.php:133
64
+ msgid "Custom"
65
+ msgstr ""
66
+
67
+ #: print-options.php:137
68
+ msgid "HTML is allowed."
69
+ msgstr ""
70
+
71
+ #: print-options.php:138
72
+ msgid "URL to the printable post/page."
73
+ msgstr ""
74
+
75
+ #: print-options.php:139
76
+ msgid "Print text link of the post/page that you have typed in above."
77
+ msgstr ""
78
+
79
+ #: print-options.php:140
80
+ msgid "URL to the print icon you have chosen above."
81
+ msgstr ""
82
+
83
+ #: print-options.php:141
84
+ msgid "Restore Default Template"
85
+ msgstr ""
86
+
87
+ #: print-options.php:151
88
+ msgid "Print Comments?"
89
+ msgstr ""
90
+
91
+ #: print-options.php:154
92
+ #: print-options.php:163
93
+ #: print-options.php:172
94
+ msgid "Yes"
95
+ msgstr ""
96
+
97
+ #: print-options.php:155
98
+ #: print-options.php:164
99
+ #: print-options.php:173
100
+ msgid "No"
101
+ msgstr ""
102
+
103
+ #: print-options.php:160
104
+ msgid "Print Links?"
105
+ msgstr ""
106
+
107
+ #: print-options.php:169
108
+ msgid "Print Images?"
109
+ msgstr ""
110
+
111
+ #: print-options.php:180
112
+ msgid "Update Options"
113
+ msgstr ""
114
+
115
+ #: print-options.php:180
116
+ msgid "Cancel"
117
+ msgstr ""
118
+
119
+ #: print.php:39
120
+ msgid "Print"
121
+ msgstr ""
122
+
123
+ #: print.php:163
124
+ #: print.php:216
125
+ msgid "Image"
126
+ msgstr ""
127
+
128
+ #: print.php:238
129
+ msgid "No Comments"
130
+ msgstr ""
131
+
132
+ #: print.php:240
133
+ msgid "1 Comment"
134
+ msgstr ""
135
+
136
+ #: print.php:242
137
+ #, php-format
138
+ msgid "%s Comments"
139
+ msgstr ""
140
+
141
+ #: print.php:245
142
+ msgid "Comments Disabled"
143
+ msgstr ""
144
+
145
+ #: print.php:248
146
+ msgid "Comments Hidden"
147
+ msgstr ""
148
+
149
+ #: print.php:259
150
+ msgid "URLs in this post:"
151
+ msgstr ""
152
+
153
+ #: print.php:321
154
+ msgid "Print This Post"
155
+ msgstr ""
156
+
157
+ #: print.php:322
158
+ msgid "Print This Page"
159
+ msgstr ""
160
+
161
+ #: wp-print-comments.php:21
162
+ msgid "To"
163
+ msgstr ""
164
+
165
+ #: wp-print-comments.php:24
166
+ msgid "By"
167
+ msgstr ""
168
+
169
+ #: wp-print-comments.php:24
170
+ #: wp-print.php:94
171
+ msgid "On"
172
+ msgstr ""
173
+
174
+ #: wp-print-comments.php:27
175
+ msgid "Your comment is awaiting moderation."
176
+ msgstr ""
177
+
178
+ #: wp-print.php:94
179
+ msgid "Posted By"
180
+ msgstr ""
181
+
182
+ #: wp-print.php:94
183
+ msgid "In"
184
+ msgstr ""
185
+
186
+ #: wp-print.php:101
187
+ msgid "Article printed from"
188
+ msgstr ""
189
+
190
+ #: wp-print.php:102
191
+ msgid "URL to article"
192
+ msgstr ""
193
+
194
+ #: wp-print.php:106
195
+ msgid "Click"
196
+ msgstr ""
197
+
198
+ #: wp-print.php:106
199
+ msgid "Click here to print."
200
+ msgstr ""
201
+
202
+ #: wp-print.php:106
203
+ msgid "here"
204
+ msgstr ""
205
+
206
+ #: wp-print.php:106
207
+ msgid "to print."
208
+ msgstr ""
209
+
210
+ #: wp-print.php:108
211
+ msgid "No posts matched your criteria."
212
+ msgstr ""
213
+
readme.html ADDED
@@ -0,0 +1,456 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
5
+ <title>WP-Print 2.10 Readme</title>
6
+ <style type="text/css" media="screen">
7
+ /* Default Style */
8
+ BODY {
9
+ font-family: Verdana, Arial;
10
+ font-size: 12px;
11
+ color: #000000;
12
+ background: #FFFFFF;
13
+ }
14
+ P {
15
+ padding-left: 10px;
16
+ }
17
+ BLOCKQUOTE {
18
+ margin: 10px 20px 0px 20px;
19
+ padding: 10px;
20
+ border: 1px solid #8d8d8d;
21
+ background-color: #f5f5f5;
22
+ }
23
+ LI {
24
+ margin-top: 20px;
25
+ }
26
+ UL LI UL LI {
27
+ margin-top: 10px;
28
+ }
29
+ A, A:active, A:link, A:visited {
30
+ color: #2d3a4c;
31
+ text-decoration: none;
32
+ }
33
+ A:hover {
34
+ color: #5577a5;
35
+ text-decoration: underline;
36
+ }
37
+ /* Place Holder Style */
38
+ #Container {
39
+ width: 780px;
40
+ margin-left: auto;
41
+ margin-right: auto;
42
+ }
43
+ #Content {
44
+ background-color: #fafafa;
45
+ border: 1px solid #a2b6cb;
46
+ padding: 10px;
47
+ margin-top: -13px;
48
+ }
49
+ /* Title Style */
50
+ #Title {
51
+ font-family: Verdana, Arial;
52
+ font-size: 22px;
53
+ font-weight: bold;
54
+ color: #389aff;
55
+ border-bottom: 1px solid #389aff;
56
+ margin-bottom: 10px;
57
+ }
58
+ .SubTitle {
59
+ font-family: Verdana, Arial;
60
+ font-size: 18px;
61
+ font-weight: bold;
62
+ color: #5b87b4;
63
+ }
64
+ .SubSubTitle {
65
+ font-family: Verdana, Arial;
66
+ font-size: 14px;
67
+ font-weight: bold;
68
+ color: #73a4d6;
69
+ }
70
+ /* Tabs */
71
+ UL#Tabs {
72
+ font-family: Verdana, Arial;
73
+ font-size: 12px;
74
+ font-weight: bold;
75
+ list-style-type: none;
76
+ padding-bottom: 28px;
77
+ border-bottom: 1px solid #a2b6cb;
78
+ margin-bottom: 12px;
79
+ z-index: 1;
80
+ }
81
+ #Tabs LI.Tab {
82
+ float: right;
83
+ height: 25px;
84
+ background-color: #deedfb;
85
+ margin: 2px 0px 0px 5px;
86
+ border: 1px solid #a2b6cb;
87
+ }
88
+ #Tabs LI.Tab A {
89
+ float: left;
90
+ display: block;
91
+ color: #666666;
92
+ text-decoration: none;
93
+ padding: 5px;
94
+ }
95
+ #Tabs LI.Tab A:hover {
96
+ background-color: #bfe0fe;
97
+ border-bottom: 1px solid #bfe0fe;
98
+ }
99
+ /* Selected Tab */
100
+ #Tabs LI.SelectedTab {
101
+ float: right;
102
+ height: 25px;
103
+ background-color: #fafafa;
104
+ margin: 2px 0px 0px 5px;
105
+ border-top: 1px solid #a2b6cb;
106
+ border-right: 1px solid #a2b6cb;
107
+ border-bottom: 1px solid #fafafa;
108
+ border-left: 1px solid #a2b6cb;
109
+ }
110
+ #Tabs LI.SelectedTab A {
111
+ float: left;
112
+ display: block;
113
+ color: #666666;
114
+ text-decoration: none;
115
+ padding: 5px;
116
+ cursor: default;
117
+ }
118
+ /* Copyright */
119
+ #Copyright {
120
+ text-align: center;
121
+ }
122
+ </style>
123
+ <script type="text/javascript">
124
+ /* <![CDATA[*/
125
+ // Index Page
126
+ function index() {
127
+ // Tab
128
+ document.getElementById('IndexTab').className = 'SelectedTab';
129
+ document.getElementById('ChangelogTab').className = 'Tab';
130
+ document.getElementById('InstallTab').className = 'Tab';
131
+ document.getElementById('UpgradeTab').className = 'Tab';
132
+ document.getElementById('UsageTab').className = 'Tab';
133
+ // Page
134
+ document.getElementById('Index').style.display= 'block';
135
+ document.getElementById('Changelog').style.display = 'none';
136
+ document.getElementById('Install').style.display = 'none';
137
+ document.getElementById('Upgrade').style.display = 'none';
138
+ document.getElementById('Usage').style.display = 'none';
139
+ }
140
+ // Changelog Page
141
+ function changelog() {
142
+ // Tab
143
+ document.getElementById('IndexTab').className = 'Tab';
144
+ document.getElementById('ChangelogTab').className = 'SelectedTab';
145
+ document.getElementById('InstallTab').className = 'Tab';
146
+ document.getElementById('UpgradeTab').className = 'Tab';
147
+ document.getElementById('UsageTab').className = 'Tab';
148
+ // Page
149
+ document.getElementById('Index').style.display = 'none';
150
+ document.getElementById('Changelog').style.display = 'block';
151
+ document.getElementById('Install').style.display = 'none';
152
+ document.getElementById('Upgrade').style.display = 'none';
153
+ document.getElementById('Usage').style.display = 'none';
154
+ }
155
+ // Installation Page
156
+ function install() {
157
+ // Tab
158
+ document.getElementById('IndexTab').className = 'Tab';
159
+ document.getElementById('ChangelogTab').className = 'Tab';
160
+ document.getElementById('InstallTab').className = 'SelectedTab';
161
+ document.getElementById('UpgradeTab').className = 'Tab';
162
+ document.getElementById('UsageTab').className = 'Tab';
163
+ // Page
164
+ document.getElementById('Index').style.display= 'none';
165
+ document.getElementById('Changelog').style.display = 'none';
166
+ document.getElementById('Install').style.display = 'block';
167
+ document.getElementById('Upgrade').style.display = 'none';
168
+ document.getElementById('Usage').style.display = 'none';
169
+ }
170
+ // Upgrade Page
171
+ function upgrade() {
172
+ // Tab
173
+ document.getElementById('IndexTab').className = 'Tab';
174
+ document.getElementById('ChangelogTab').className = 'Tab';
175
+ document.getElementById('InstallTab').className = 'Tab';
176
+ document.getElementById('UpgradeTab').className = 'SelectedTab';
177
+ document.getElementById('UsageTab').className = 'Tab';
178
+ // Page
179
+ document.getElementById('Index').style.display= 'none';
180
+ document.getElementById('Changelog').style.display = 'none';
181
+ document.getElementById('Install').style.display = 'none';
182
+ document.getElementById('Upgrade').style.display = 'block';
183
+ document.getElementById('Usage').style.display = 'none';
184
+ }
185
+ // Usage Page
186
+ function usage() {
187
+ // Tab
188
+ document.getElementById('IndexTab').className = 'Tab';
189
+ document.getElementById('ChangelogTab').className = 'Tab';
190
+ document.getElementById('InstallTab').className = 'Tab';
191
+ document.getElementById('UpgradeTab').className = 'Tab';
192
+ document.getElementById('UsageTab').className = 'SelectedTab';
193
+ // Page
194
+ document.getElementById('Index').style.display= 'none';
195
+ document.getElementById('Changelog').style.display = 'none';
196
+ document.getElementById('Install').style.display = 'none';
197
+ document.getElementById('Upgrade').style.display = 'none';
198
+ document.getElementById('Usage').style.display = 'block';
199
+ }
200
+ /* ]]> */
201
+ </script>
202
+ </head>
203
+ <body>
204
+ <div id="Container">
205
+ <!-- Title -->
206
+ <div id="Title">WP-Print 2.10&nbsp;&nbsp;&nbsp;<span style="color: #aaaaaa;">Readme</span></div>
207
+
208
+ <!-- Tabs -->
209
+ <ul id="Tabs">
210
+ <li id="UsageTab" class="Tab"><a href="#Usage" onclick="usage(); return false;" title="Usage Instructions">Usage</a></li>
211
+ <li id="UpgradeTab" class="Tab"><a href="#Upgrade" onclick="upgrade(); return false;" title="Upgrade Instructions">Upgrade</a></li>
212
+ <li id="InstallTab" class="Tab"><a href="#Installation" onclick="install(); return false;" title="Installation Instructions">Installation</a></li>
213
+ <li id="ChangelogTab" class="Tab"><a href="#Changelog" onclick="changelog(); return false;" title="Changelog">Changelog</a></li>
214
+ <li id="IndexTab" class="SelectedTab"><a href="#Index" onclick="index(); return false;" title="Index Instructions">Index</a></li>
215
+ </ul>
216
+
217
+ <!-- Content -->
218
+ <div id="Content">
219
+ <!-- Index -->
220
+ <div id="Index">
221
+ <div class="SubTitle">&raquo; Index</div>
222
+ <div class="SubSubTitle">Plugin Information</div>
223
+ <p>
224
+ <b>Author:</b><br />
225
+ <b>&raquo;</b> Lester 'GaMerZ' Chan
226
+ </p>
227
+ <p>
228
+ <b>EMail:</b><br />
229
+ <b>&raquo;</b>
230
+ <script type="text/javascript">
231
+ /* <![CDATA[*/
232
+ document.write(' <a href="mailto:gamerz84@hotmail.com?Subject=WP-Print%202.10%20Support" title="EMail To gamerz84@hotmail.com">gamerz84@hotmail.com</a>');
233
+ /* ]]> */
234
+ </script>
235
+ </p>
236
+ <p>
237
+ <b>Website:</b><br />
238
+ <b>&raquo;</b> <a href="http://www.lesterchan.net/" title="http://www.lesterchan.net/">http://www.lesterchan.net/</a>
239
+ </p>
240
+ <p>
241
+ <b>Features:</b><br />
242
+ <b>&raquo;</b> Displays a printable version of your WordPress blog's post/page.
243
+ </p>
244
+ <p>
245
+ <b>Download:</b><br />
246
+ <b>&raquo;</b> <a href="http://www.lesterchan.net/others/downloads.php?id=12" title="http://www.lesterchan.net/others/downloads.php?id=12">WP-Print 2.10 For WordPress 2.1.x</a><br />
247
+ <b>&raquo;</b> <a href="http://www.lesterchan.net/others/downloads/wp-print206.zip" title="http://www.lesterchan.net/others/downloads/wp-print206.zip">WP-Print 2.06 For WordPress 2.0.x</a><br />
248
+ <b>&raquo;</b> <a href="http://www.lesterchan.net/others/downloads/wp-print200a.zip" title="http://www.lesterchan.net/others/downloads/wp-print200a.zip">WP-Print 2.00a For WordPress 1.5.2</a>
249
+ </p>
250
+ <p>
251
+ <b>Demo:</b><br />
252
+ <b>&raquo;</b> <a href="http://www.lesterchan.net/wordpress/2006/07/05/donations/print/" title="http://www.lesterchan.net/wordpress/2006/07/05/donations/print/">http://www.lesterchan.net/wordpress/2006/07/05/donations/print/</a>
253
+ </p>
254
+ <p>
255
+ <b>Development:</b><br />
256
+ <b>&raquo;</b> <a href="http://dev.wp-plugins.org/browser/wp-print/" title="http://dev.wp-plugins.org/browser/wp-print/">http://dev.wp-plugins.org/browser/wp-print/</a>
257
+ </p>
258
+ <p>
259
+ <b>Translations:</b><br />
260
+ <b>&raquo;</b> <a href="http://dev.wp-plugins.org/browser/wp-print/i18n/" title="http://dev.wp-plugins.org/browser/wp-print/i18n/">http://dev.wp-plugins.org/browser/wp-print/i18n/</a>
261
+ </p>
262
+ <p>
263
+ <b>Support Forums:</b><br />
264
+ <b>&raquo;</b> <a href="http://forums.lesterchan.net/index.php?board=18.0" title="http://forums.lesterchan.net/index.php?board=18.0">http://forums.lesterchan.net/index.php?board=18.0</a>
265
+ </p>
266
+ <p>
267
+ <b>Updated:</b><br />
268
+ <b>&raquo;</b> 1st February 2007
269
+ </p>
270
+ <p>
271
+ <b>Note:</b><br />
272
+ <b>&raquo;</b> The <b>Changelog</b>, <b>Installation</b>, <b>Upgrade</b>, <b>Usage</b> Tab at the top of the page.<br />
273
+ <b>&raquo;</b> Please go to 'WP-Admin -> Options -> Print' to configure the print text link style.
274
+ </p>
275
+ <p>
276
+ <b>Donations:</b><br />
277
+ <b>&raquo;</b> I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks as my school allowance, I will really appericiate it. If not feel free to use it without any obligations. Thank You. My Paypal account is
278
+ <script type="text/javascript">
279
+ /* <![CDATA[*/
280
+ document.write(' <b>gamerz84@hotmail.com</b>.');
281
+ /* ]]> */
282
+ </script>
283
+ </p>
284
+ </div>
285
+
286
+ <!-- Changelog -->
287
+ <div id="Changelog" style="display: none;">
288
+ <div class="SubTitle">&raquo; Changelog</div>
289
+ <ul>
290
+ <li>
291
+ <b>Version 2.10 (01-02-2007)</b>
292
+ <ul>
293
+ <li>NEW: Added Fam Fam Fam's Printer Icon</li>
294
+ <li>NEW: Works For WordPress 2.1 Only</li>
295
+ <li>NEW: Localize WP-Print</li>
296
+ <li>NEW: Ability To Configure The Text For Print Links Via 'WP-Admin -> Options -> Print'</li>
297
+ <li>NEW: The Text For Print Links Can No Longer Be Pass To The Function print_link() or print_link_image()</li>
298
+ <li>FIXED: MUltiple URL Type Fixed By (Virgil - <a href="http://virgil.gr">http://virgil.gr</a>)</li>
299
+ <li>FIXED: 'Click Here To Print' Will Not Be Hidden When Printing By <a href="http://blog.fileville.net/">Joe (Ttech)</a></li>
300
+ </ul>
301
+ </li>
302
+ <li>
303
+ <b>Version 2.06 (01-10-2006)</b>
304
+ <ul>
305
+ <li>NEW: Used Default Date/Time Format Under WordPress Options</li>
306
+ <li>NEW: Added robots: noindex To Printer Friendly Pages</li>
307
+ <li>NEW: Added rel="nofollow" To All Links Generated By WP-Print</li>
308
+ <li>FIXED: &lt;abbr&gt; Tag Mixed Up With &lt;a&gt;</li>
309
+ <li>FIXED: PHP5 Compatibility Issue</li>
310
+ <li>FIXED: Long URL Will Not Break Into More Than 1 Line</li>
311
+ </ul>
312
+ </li>
313
+ <li>
314
+ <b>Version 2.05 (01-06-2006)</b>
315
+ <ul>
316
+ <li>NEW: Added Print Options In WP Administration Panel Under 'Options -> Print'</li>
317
+ <li>NEW: Print Administration Panel And The Code That WP-Print Generated Is XHTML 1.0 Transitional</li>
318
+ <li>FIXED: Comment's Content Formatting</li>
319
+ </ul>
320
+ </li>
321
+ <li>
322
+ <b>Version 2.04 (01-04-2006)</b>
323
+ <ul>
324
+ <li>NEW: Able To Print Comments Together With Post Using $can_print_comments In wp-print.php</li>
325
+ <li>NEW: Moved wp-print.php To Plugin Folder</li>
326
+ <li>FIXED: Removed Link From Post Comment Count And Post Category</li>
327
+ </ul>
328
+ </li>
329
+ <li>
330
+ <b>Version 2.03 (01-03-2006)</b>
331
+ <ul>
332
+ <li>NEW: Added Print Image With print_link_image()</li>
333
+ <li>NEW: Automatically Break To Next Line If Link Contains More Than 100 Chars</li>
334
+ <li>FIXED: Comment Numbers Showing In Password Protected Post</li>
335
+ </ul>
336
+ </li>
337
+ <li>
338
+ <b>Version 2.02 (01-02-2006)</b>
339
+ <ul>
340
+ <li>FIXED: Able To View Password Protected Blog</li>
341
+ </ul>
342
+ </li>
343
+ <li>
344
+ <b>Version 2.01 (01-01-2006)</b>
345
+ <ul>
346
+ <li>NEW: Compatible With WordPress 2.0</li>
347
+ <li>NEW: Automatically Detect Whether You Are Using Nice Permalink</li>
348
+ <li>NEW: Automated Permalink</li>
349
+ <li>NEW: Now You Only Need To Insert 1 Line Into Your index.php Of Your Theme</li>
350
+ <li>NEW: GPL License Added</li>
351
+ <li>FIXED: Links Not Displaying Properly When Printing More Than 1 Post On A Single Page</li>
352
+ </ul>
353
+ </li>
354
+ <li>
355
+ <b>Version 2.00a (17-11-2005)</b>
356
+ <ul>
357
+ <li>NEW: Permlink For The Page Feature</li>
358
+ </ul>
359
+ </li>
360
+ <li>
361
+ <b>Version 2.00 (10-11-2005)</b>
362
+ <ul>
363
+ <li>NEW: Print Out A Summary Of URLS In The Post At The Bottom Of The Page</li>
364
+ </ul>
365
+ </li>
366
+ </ul>
367
+ </div>
368
+
369
+ <!-- Installation Instructions -->
370
+ <div id="Install" style="display: none;">
371
+ <div class="SubTitle">&raquo; Installation Instructions</div>
372
+ <ol>
373
+ <li>
374
+ Open <b>wp-content/plugins</b> Folder
375
+ </li>
376
+ <li>
377
+ Put:
378
+ <blockquote>Folder: print</blockquote>
379
+ </li>
380
+ <li>
381
+ <b>Activate</b> WP-Print Plugin
382
+ </li>
383
+ <li>
384
+ You Need To Re-Generate The Permalink (<b>WP-Admin -> Options -> Permalinks Options -> Update Permalink Structure</b>)
385
+ </li>
386
+ <li>
387
+ Refer To <b>Usage</b> For Further Instructions
388
+ </li>
389
+ </ol>
390
+ </div>
391
+
392
+ <!-- Upgrade Instructions -->
393
+ <div id="Upgrade" style="display: none;">
394
+ <div class="SubTitle">&raquo; Upgrade Instructions</div>
395
+ <div class="SubSubTitle">From v1.0x To v2.10</div>
396
+ <ol>
397
+ <li>
398
+ <b>Deactivate</b> WP-Print Plugin
399
+ </li>
400
+ <li>
401
+ Open <b>wp-content/plugins</b> Folder
402
+ </li>
403
+ <li>
404
+ Put/Overwrite:
405
+ <blockquote>Folder: print</blockquote>
406
+ </li>
407
+ <li>
408
+ Delete these files if exists:
409
+ <blockquote>
410
+ File: wp-print.php<br />
411
+ File: wp-content/plugins/print.php
412
+ </blockquote>
413
+ </li>
414
+ <li>
415
+ <b>Activate</b> WP-Print Plugin
416
+ </li>
417
+ <li>
418
+ You Need To Re-Generate The Permalink (<b>WP-Admin -> Options -> Permalinks Options -> Update Permalink Structure</b>)
419
+ </li>
420
+ <li>
421
+ Refer To <b>Usage</b> For Further Instructions
422
+ </li>
423
+ </ol>
424
+ </div>
425
+
426
+ <!-- Usage Instructions -->
427
+ <div id="Usage" style="display: none;">
428
+ <div class="SubTitle">&raquo; Usage Instructions</div>
429
+ <div class="SubSubTitle">General Usage</div>
430
+ <ol>
431
+ <li>
432
+ Open <b>wp-content/themes/&lt;YOUR THEME NAME&gt;/index.php</b>
433
+ <p>You may place it in <b>single.php</b>, <b>post.php</b>, <b>page.php</b> or <b>theloop.php</b> also.</p>
434
+ </li>
435
+ <li>
436
+ Find:
437
+ <blockquote>
438
+ &lt;?php while (have_posts()) : the_post(); ?&gt;
439
+ </blockquote>
440
+ </li>
441
+ <li>
442
+ Add Anywhere Below It:
443
+ <blockquote>
444
+ &lt;?php if(function_exists('wp_print')) { print_link(); } ?&gt;
445
+ </blockquote>
446
+ </li>
447
+ <li>
448
+ Go to <b>'WP-Admin -> Options -> Print'</b> to configure the style of the print text link.
449
+ </li>
450
+ </ol>
451
+ </div>
452
+ </div>
453
+ </div>
454
+ <p id="Copyright">WP-Print 2.10<br />Copyright &copy; 2007 Lester 'GaMerZ' Chan. All Rights Reserved.</p>
455
+ </body>
456
+ </html>
readme.txt CHANGED
@@ -1,58 +1,29 @@
1
- -> Print Plugin For WordPress
2
- --------------------------------------------------
3
- Author -> Lester 'GaMerZ' Chan
4
- Email -> lesterch@singnet.com.sg
5
- Website -> http://www.lesterchan.net/
6
- Demo -> http://www.lesterchan.net/blogs/wp-print.php?p=647
7
- Updated -> 3rd September 2005
8
- --------------------------------------------------
9
-
10
-
11
- -> Installation Instructions
12
- --------------------------------------------------
13
- // Open root Wordpress folder
14
-
15
- Put
16
- ------------------------------------------------------------------
17
- wp-print.php
18
- ------------------------------------------------------------------
19
-
20
-
21
- // Go to Manage > Files > Common -> .htaccess (for rewrite rules)
22
- // Note: If you ARE using nice permalink url
23
- Find:
24
- ------------------------------------------------------------------
25
- RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/?([0-9]+)?/?$ <BLOG URL>/index.php?year=$1&monthnum=$2&day=$3&name=$4&page=$5 [QSA,L]
26
- ------------------------------------------------------------------
27
- Add Below It:
28
- ------------------------------------------------------------------
29
- RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/print/?$ <BLOG URL>/wp-print.php?year=$1&monthnum=$2&day=$3&name=$4 [QSA,L]
30
- ------------------------------------------------------------------
31
-
32
- // Open wp-content/themes/<YOUR THEME NAME>/index.php
33
-
34
- Find:
35
- ------------------------------------------------------------------
36
- <?php while (have_posts()) : the_post(); ?>
37
- ------------------------------------------------------------------
38
- Add Below It:
39
- ------------------------------------------------------------------
40
- <a href="<?php the_permalink(); ?>print/">Print This Article</a>
41
- ------------------------------------------------------------------
42
-
43
-
44
- // Note: If you ARE NOT using nice permalink url
45
- // Open wp-content/themes/<YOUR THEME NAME>/index.php
46
-
47
- Find:
48
- ------------------------------------------------------------------
49
- <?php while (have_posts()) : the_post(); ?>
50
- ------------------------------------------------------------------
51
- Add Below It:
52
- ------------------------------------------------------------------
53
- <?php if(is_page()) : ?>
54
- <a href="wp-print.php?page_id=<?=the_ID()?>">Print This Article</a>
55
- <?php else : ?>
56
- <a href="wp-print.php?p=<?=the_ID()?>">Print This Article</a>
57
- <?php endif; ?>
58
- ------------------------------------------------------------------
1
+ === WP-Print ===
2
+ Contributors: GamerZ
3
+ Donate link: http://www.lesterchan.net/wordpress
4
+ Tags: print, printer, wp-print
5
+ Requires at least: 2.1.0
6
+ Stable tag: 2.10
7
+
8
+ Displays a printable version of your WordPress blog's post/page.
9
+
10
+ == Description ==
11
+
12
+ All the information (general, changelog, installation, upgrade, usage) you need about this plugin can be found here: [WP-Print Readme](http://www.lesterchan.net/wordpress/readme/wp-print.html "WP-Print Readme").
13
+ It is the exact same readme.html is included in the zip package.
14
+
15
+ == Development Blog ==
16
+
17
+ [GaMerZ WordPress Plugins Development Blog](http://www.lesterchan.net/wordpress/ "GaMerZ WordPress Plugins Development Blog")
18
+
19
+ == Installation ==
20
+
21
+ [WP-Print Readme](http://www.lesterchan.net/wordpress/readme/wp-print.html "WP-Print Readme") (Installation Tab)
22
+
23
+ == Screenshots ==
24
+
25
+ [GaMerZ WordPress Plugins Screenshots](http://www.lesterchan.net/wordpress/screenshots/ "GaMerZ WordPress Plugins Screenshots")
26
+
27
+ == Frequently Asked Questions ==
28
+
29
+ You will need [GaMerZ WordPress Plugins Support Forums](http://forums.lesterchan.net/ "GaMerZ WordPress Plugins Support Forums")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
wp-print.php DELETED
@@ -1,77 +0,0 @@
1
- <?php
2
- /*
3
- * Print Plugin For WordPress
4
- * - wp-print.php
5
- *
6
- * Copyright � 2004-2005 Lester "GaMerZ" Chan
7
- */
8
-
9
-
10
- // Require WordPress Header
11
- require('wp-blog-header.php');
12
- ?>
13
-
14
- <!DOCTYPE HTML PUBLIC "-//W3C//Dp HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dp">
15
- <html>
16
- <head>
17
- <title><?php bloginfo('name')?> > Print > <?php echo single_post_title('')?></title>
18
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
19
- <style type="text/css" media="screen, print">
20
- Body {
21
- font-family: Verdana, Arial, Tahoma;
22
- font-size: 12px;
23
- color: #000000;
24
- }
25
- #Outline {
26
- text-align: left;
27
- width: 90%;
28
- margin-left: auto;
29
- margin-right: auto;
30
- padding: 10px;
31
- border: 1px solid #000000;
32
- }
33
- #BlogTitle {
34
- font-weight: bold;
35
- font-size: 16px;
36
- margin-bottom: 5px;
37
- }
38
- #BlogDate {
39
- margin-top: 5px;
40
- margin-bottom: 10px;
41
- }
42
- #BlogContent {
43
- padding: 10px;
44
- margin-top: 10px;
45
- }
46
- HR#Divider {
47
- width: 80%;
48
- height: 1px;
49
- color: #000000;
50
- }
51
- </style>
52
- </head>
53
- <body>
54
- <p align="center"><b>- <?php bloginfo('name'); ?> - <?php bloginfo('url')?> -</b></p>
55
- <center>
56
- <div id="Outline">
57
- <?php if (have_posts()) : ?>
58
- <?php while (have_posts()) : the_post(); ?>
59
- <p id="BlogTitle"><?php the_title(); ?></p>
60
- <p id="BlogDate">Posted By <?php the_author(); ?> On <?php the_time('jS F Y @ H:i'); ?> In <?php the_category(', '); ?> | <a href="<?php comments_link(); ?>"><?php comments_number(); ?></a></p>
61
- <div id="BlogContent">
62
- <?php for($page = 1; $page <= $numpages; $page++) { ?>
63
- <?php the_content(); ?>
64
- <?php } ?>
65
- </div>
66
- <?php endwhile; ?>
67
- <?php else : ?>
68
- <p>No Posts Matched Your Criteria</p>
69
- <?php endif; ?>
70
- <p><hr id="Divider" align="center"></p>
71
- <p align="left">Article printed from <?=get_bloginfo('name')?>: <b><?=get_bloginfo('url')?></b></p>
72
- <p align="left">URL to article: <b><?=get_permalink()?></b></p>
73
- <p align="right">Click <a href="javascript:window.print();">here</a> to print.</p>
74
- </div>
75
- </center>
76
- </body>
77
- </html>