WP-Print - Version 2.11

Version Description

Download this release

Release Info

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

Code changes from version 2.00 to 2.11

print/images/print.gif ADDED
Binary file
print/images/printer_famfamfam.gif ADDED
Binary file
print/print-options.php ADDED
@@ -0,0 +1,183 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ +----------------------------------------------------------------+
4
+ | |
5
+ | WordPress 2.1 Plugin: WP-Print 2.11 |
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,362 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.11
7
+ Author: Lester 'GaMerZ' Chan
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 ='', $echo = true) {
72
+ global $id;
73
+ if (function_exists('polyglot_get_lang')){
74
+ global $polyglot_settings;
75
+ $polyglot_append = $polyglot_settings['uri_helpers']['lang_view'].'/'.polyglot_get_lang().'/';
76
+ }
77
+ $output = '';
78
+ $using_permalink = get_option('permalink_structure');
79
+ $print_options = get_option('print_options');
80
+ $print_style = intval($print_options['print_style']);
81
+ $print_text = stripslashes($print_options['post_text']);
82
+ $print_icon = get_option('siteurl').'/wp-content/plugins/print/images/'.$print_options['print_icon'];
83
+ $print_link = get_permalink();
84
+ $print_html = stripslashes($print_options['print_html']);
85
+ // Fix For Static Page
86
+ if(get_option('show_on_front') == 'page' && is_page()) {
87
+ if(intval(get_option('page_on_front')) > 0) {
88
+ $print_link = _get_page_link();
89
+ }
90
+ }
91
+ if(!empty($using_permalink)) {
92
+ if(is_page()) {
93
+ if(substr($print_link, -1, 1) != '/') {
94
+ $print_link = $print_link.'/';
95
+ }
96
+ $print_text = stripslashes($print_options['page_text']);
97
+ $print_link = $print_link.'printpage/'.$polyglot_append;
98
+ } else {
99
+ $print_link = $print_link.'print/'.$polyglot_append;
100
+ }
101
+ } else {
102
+ if(is_page()) {
103
+ $print_text = stripslashes($print_options['page_text']);
104
+ }
105
+ $print_link = $print_link.'&amp;print=1';
106
+ }
107
+ unset($print_options);
108
+ switch($print_style) {
109
+ // Icon + Text Link
110
+ case 1:
111
+ $output = '<img class="WP-PrintIcon" src="'.$print_icon.'" alt="'.$print_text.'" title="'.$print_text.'" style="border: 0px;" />&nbsp;<a href="'.$print_link.'" title="'.$print_text.'" rel="nofollow">'.$print_text.'</a>';
112
+ break;
113
+ // Icon Only
114
+ case 2:
115
+ $output = '<a href="'.$print_link.'" title="'.$print_text.'" rel="nofollow"><img class="WP-PrintIcon" src="'.$print_icon.'" alt="'.$print_text.'" title="'.$print_text.'" style="border: 0px;" /></a>';
116
+ break;
117
+ // Text Link Only
118
+ case 3:
119
+ $output = '<a href="'.$print_link.'" title="'.$print_text.'" rel="nofollow">'.$print_text.'</a>';
120
+ break;
121
+ case 4:
122
+ $print_html = str_replace("%PRINT_URL%", $print_link, $print_html);
123
+ $print_html = str_replace("%PRINT_TEXT%", $print_text, $print_html);
124
+ $print_html = str_replace("%PRINT_ICON_URL%", $print_icon, $print_html);
125
+ $output = $print_html;
126
+ break;
127
+ }
128
+ if($echo) {
129
+ echo $output."\n";
130
+ } else {
131
+ return $output;
132
+ }
133
+ }
134
+
135
+
136
+ ### Function: Display Print Image Link (Deprecated)
137
+ function print_link_image() {
138
+ print_link();
139
+ }
140
+
141
+
142
+ ### Function: Place Print Link
143
+ add_filter('the_content', 'place_printlink', 7);
144
+ function place_printlink($content){
145
+ if(!is_feed()) {
146
+ $content = str_replace("[print_link]", print_link('', '', false), $content);
147
+ } else {
148
+ $content = str_replace("[print_link]", __('Note: You can print this post by visiting the site.', 'wp-print'), $content);
149
+ }
150
+ return $content;
151
+ }
152
+
153
+
154
+ ### Function: Print Content
155
+ function print_content($display = true) {
156
+ global $links_text, $link_number, $pages, $multipage, $numpages, $post;
157
+ $max_url_char = 80;
158
+ if(!empty($post->post_password) && stripslashes($_COOKIE['wp-postpass_'.COOKIEHASH]) != $post->post_password) {
159
+ $content = get_the_password_form();
160
+ } else {
161
+ if($multipage) {
162
+ for($page = 0; $page < $numpages; $page++) {
163
+ $content .= $pages[$page];
164
+ }
165
+ } else {
166
+ $content = $pages[0];
167
+ }
168
+ $content = apply_filters('the_content', $content);
169
+ $content = str_replace(']]>', ']]&gt;', $content);
170
+ if(!print_can('images')) {
171
+ $content = remove_image($content);
172
+ }
173
+ if(print_can('links')) {
174
+ preg_match_all('/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches);
175
+ for ($i=0; $i < count($matches[0]); $i++) {
176
+ $link_match = $matches[0][$i];
177
+ $link_number++;
178
+ $link_url = $matches[2][$i];
179
+ if(stristr($link_url, 'https://')) {
180
+ $link_url =(strtolower(substr($link_url,0,8)) != 'https://') ?get_option('home') . $link_url : $link_url;
181
+ } else if( stristr($link_url, 'mailto:')) {
182
+ $link_url =(strtolower(substr($link_url,0,7)) != 'mailto:') ?get_option('home') . $link_url : $link_url;
183
+ } else if( $link_url[0] == '#' ) {
184
+ $link_url = $link_url;
185
+ } else {
186
+ $link_url =(strtolower(substr($link_url,0,7)) != 'http://') ?get_option('home') . $link_url : $link_url;
187
+ }
188
+ $link_text = $matches[4][$i];
189
+ $content = str_replace_one($link_match, '['.$link_number."] <a href=\"$link_url\" rel=\"external\">".$link_text.'</a>', $content);
190
+ if(strlen($link_url) > 100) {
191
+ $link_url = chunk_split($link_url, 100, "<br />\n");
192
+ }
193
+ if(preg_match('/<img(.+?)src=\"(.+?)\"(.*?)>/',$link_text)) {
194
+ $links_text .= '<br />['.$link_number.'] '.__('Image', 'wp-print').': <b>'.$link_url.'</b>';
195
+ } else {
196
+ $links_text .= '<br />['.$link_number.'] '.$link_text.': <b>'.$link_url.'</b>';
197
+ }
198
+ }
199
+ }
200
+ }
201
+ if($display) {
202
+ echo $content;
203
+ } else {
204
+ return $content;
205
+ }
206
+ }
207
+
208
+
209
+ ### Function: Print Categories
210
+ function print_categories($before = '', $after = '') {
211
+ $temp_cat = strip_tags(get_the_category_list(',' , $parents));
212
+ $temp_cat = explode(', ', $temp_cat);
213
+ $temp_cat = implode($after.', '.$before, $temp_cat);
214
+ echo $before.$temp_cat.$after;
215
+ }
216
+
217
+
218
+ ### Function: Print Comments Content
219
+ function print_comments_content($display = true) {
220
+ global $links_text, $link_number;
221
+ $content = get_comment_text();
222
+ $content = apply_filters('comment_text', $content);
223
+ if(!print_can('images')) {
224
+ $content = remove_image($content);
225
+ }
226
+ if(print_can('links')) {
227
+ preg_match_all('/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches);
228
+ for ($i=0; $i < count($matches[0]); $i++) {
229
+ $link_match = $matches[0][$i];
230
+ $link_number++;
231
+ $link_url = $matches[2][$i];
232
+ if(stristr($link_url, 'https://')) {
233
+ $link_url =(strtolower(substr($link_url,0,8)) != 'https://') ?get_option('home') . $link_url : $link_url;
234
+ } else if(stristr($link_url, 'mailto:')) {
235
+ $link_url =(strtolower(substr($link_url,0,7)) != 'mailto:') ?get_option('home') . $link_url : $link_url;
236
+ } else if($link_url[0] == '#') {
237
+ $link_url = $link_url;
238
+ } else {
239
+ $link_url =(strtolower(substr($link_url,0,7)) != 'http://') ?get_option('home') . $link_url : $link_url;
240
+ }
241
+ $link_text = $matches[4][$i];
242
+ $content = str_replace_one($link_match, '['.$link_number."] <a href=\"$link_url\" rel=\"external\">".$link_text.'</a>', $content);
243
+ if(strlen($link_url) > 100) {
244
+ $link_url = chunk_split($link_url, 100, "<br />\n");
245
+ }
246
+ if(preg_match('/<img(.+?)src=\"(.+?)\"(.*?)>/',$link_text)) {
247
+ $links_text .= '<br />['.$link_number.'] '.__('Image', 'wp-print').': <b>'.$link_url.'</b>';
248
+ } else {
249
+ $links_text .= '<br />['.$link_number.'] '.$link_text.': <b>'.$link_url.'</b>';
250
+ }
251
+ }
252
+ }
253
+ if($display) {
254
+ echo $content;
255
+ } else {
256
+ return $content;
257
+ }
258
+ }
259
+
260
+
261
+ ### Function: Print Comments
262
+ function print_comments_number() {
263
+ global $post;
264
+ $comment_text = '';
265
+ $comment_status = $post->comment_status;
266
+ if($comment_status == 'open') {
267
+ $num_comments = get_comments_number();
268
+ if($num_comments == 0) {
269
+ $comment_text = __('No Comments', 'wp-print');
270
+ } elseif($num_comments == 1) {
271
+ $comment_text = __('1 Comment', 'wp-print');
272
+ } else {
273
+ $comment_text = sprintf(__('%s Comments', 'wp-print'), $num_comments);
274
+ }
275
+ } else {
276
+ $comment_text = __('Comments Disabled', 'wp-print');
277
+ }
278
+ if(!empty($post->post_password) && stripslashes($_COOKIE['wp-postpass_'.COOKIEHASH]) != $post->post_password) {
279
+ _e('Comments Hidden', 'wp-print');
280
+ } else {
281
+ echo $comment_text;
282
+ }
283
+ }
284
+
285
+
286
+ ### Function: Print Links
287
+ function print_links($text_links = '') {
288
+ global $links_text;
289
+ if(empty($text_links)) {
290
+ $text_links = __('URLs in this post:', 'wp-print');
291
+ }
292
+ if(!empty($links_text)) {
293
+ echo $text_links.$links_text;
294
+ }
295
+ }
296
+
297
+
298
+ ### Function: Load WP-Print
299
+ add_action('template_redirect', 'wp_print');
300
+ function wp_print() {
301
+ if(intval(get_query_var('print')) == 1) {
302
+ include(ABSPATH.'wp-content/plugins/print/wp-print.php');
303
+ exit;
304
+ }
305
+ }
306
+
307
+
308
+ ### Function: Add Print Comments Template
309
+ function print_template_comments($file = '') {
310
+ $file = ABSPATH.'wp-content/plugins/print/wp-print-comments.php';
311
+ return $file;
312
+ }
313
+
314
+
315
+ ### Function: Print Page Title
316
+ function print_pagetitle($print_pagetitle) {
317
+ return '&raquo; Print'.$print_pagetitle;
318
+ }
319
+
320
+
321
+ ### Function: Can Print?
322
+ function print_can($type) {
323
+ $print_options = get_option('print_options');
324
+ return intval($print_options[$type]);
325
+ }
326
+
327
+
328
+ ### Function: Remove Image From Text
329
+ function remove_image($content) {
330
+ $content= preg_replace('/<img(.+?)src=\"(.+?)\"(.*?)>/', '',$content);
331
+ return $content;
332
+ }
333
+
334
+
335
+ ### Function: Replace One Time Only
336
+ function str_replace_one($search, $replace, $content){
337
+ if ($pos = strpos($content, $search)) {
338
+ return substr($content, 0, $pos).$replace.substr($content, $pos+strlen($search));
339
+ } else {
340
+ return $content;
341
+ }
342
+ }
343
+
344
+
345
+ ### Function: Print Options
346
+ add_action('activate_print/print.php', 'print_init');
347
+ function print_init() {
348
+ // Delete Options First
349
+ delete_option('print_options');
350
+ // Add Options
351
+ $print_options = array();
352
+ $print_options['post_text'] = __('Print This Post', 'wp-print');
353
+ $print_options['page_text'] = __('Print This Page', 'wp-print');
354
+ $print_options['print_icon'] = 'print.gif';
355
+ $print_options['print_style'] = 1;
356
+ $print_options['print_html'] = '<a href="%PRINT_URL%" rel="nofollow" title="%PRINT_TEXT%">%PRINT_TEXT%</a>';
357
+ $print_options['comments'] = 0;
358
+ $print_options['links'] = 1;
359
+ $print_options['images'] = 1;
360
+ add_option('print_options', $print_options, 'Print Options');
361
+ }
362
+ ?>
print/wp-print-comments.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ +----------------------------------------------------------------+
4
+ | |
5
+ | WordPress 2.1 Plugin: WP-Print 2.11 |
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-css.css ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ .WPPrintImage {
2
+ vertical-align: top;
3
+ }
print/wp-print.mo ADDED
Binary file
print/wp-print.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ +----------------------------------------------------------------+
4
+ | |
5
+ | WordPress 2.1 Plugin: WP-Print 2.11 |
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,217 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: WP-Print 2.11\n"
4
+ "POT-Creation-Date: \n"
5
+ "PO-Revision-Date: 2007-06-16 01:30+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:148
124
+ msgid "Note: You can print this post by visiting the site."
125
+ msgstr ""
126
+
127
+ #: print.php:194
128
+ #: print.php:247
129
+ msgid "Image"
130
+ msgstr ""
131
+
132
+ #: print.php:269
133
+ msgid "No Comments"
134
+ msgstr ""
135
+
136
+ #: print.php:271
137
+ msgid "1 Comment"
138
+ msgstr ""
139
+
140
+ #: print.php:273
141
+ #, php-format
142
+ msgid "%s Comments"
143
+ msgstr ""
144
+
145
+ #: print.php:276
146
+ msgid "Comments Disabled"
147
+ msgstr ""
148
+
149
+ #: print.php:279
150
+ msgid "Comments Hidden"
151
+ msgstr ""
152
+
153
+ #: print.php:290
154
+ msgid "URLs in this post:"
155
+ msgstr ""
156
+
157
+ #: print.php:352
158
+ msgid "Print This Post"
159
+ msgstr ""
160
+
161
+ #: print.php:353
162
+ msgid "Print This Page"
163
+ msgstr ""
164
+
165
+ #: wp-print-comments.php:21
166
+ msgid "To"
167
+ msgstr ""
168
+
169
+ #: wp-print-comments.php:24
170
+ msgid "By"
171
+ msgstr ""
172
+
173
+ #: wp-print-comments.php:24
174
+ #: wp-print.php:94
175
+ msgid "On"
176
+ msgstr ""
177
+
178
+ #: wp-print-comments.php:27
179
+ msgid "Your comment is awaiting moderation."
180
+ msgstr ""
181
+
182
+ #: wp-print.php:94
183
+ msgid "Posted By"
184
+ msgstr ""
185
+
186
+ #: wp-print.php:94
187
+ msgid "In"
188
+ msgstr ""
189
+
190
+ #: wp-print.php:101
191
+ msgid "Article printed from"
192
+ msgstr ""
193
+
194
+ #: wp-print.php:102
195
+ msgid "URL to article"
196
+ msgstr ""
197
+
198
+ #: wp-print.php:106
199
+ msgid "Click"
200
+ msgstr ""
201
+
202
+ #: wp-print.php:106
203
+ msgid "Click here to print."
204
+ msgstr ""
205
+
206
+ #: wp-print.php:106
207
+ msgid "here"
208
+ msgstr ""
209
+
210
+ #: wp-print.php:106
211
+ msgid "to print."
212
+ msgstr ""
213
+
214
+ #: wp-print.php:108
215
+ msgid "No posts matched your criteria."
216
+ msgstr ""
217
+
readme-install.txt DELETED
@@ -1,54 +0,0 @@
1
- -> Installation Instructions
2
- --------------------------------------------------
3
- // Open root Wordpress folder
4
-
5
- Put
6
- ------------------------------------------------------------------
7
- wp-print.php
8
- ------------------------------------------------------------------
9
-
10
-
11
- // Go to Manage > Files > Common -> .htaccess (for rewrite rules)
12
- // Note: If you ARE using nice permalink url
13
- Find:
14
- ------------------------------------------------------------------
15
- # END WordPress
16
- ------------------------------------------------------------------
17
- Add Below It:
18
- ------------------------------------------------------------------
19
- 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]
20
- RewriteRule ^(.+)/printpage/?$ <BLOG URL>/wp-print.php?pagename=$1 [QSA,L]
21
- ------------------------------------------------------------------
22
-
23
-
24
- // Open wp-content/themes/<YOUR THEME NAME>/index.php
25
-
26
- Find:
27
- ------------------------------------------------------------------
28
- <?php while (have_posts()) : the_post(); ?>
29
- ------------------------------------------------------------------
30
- Add Below It:
31
- ------------------------------------------------------------------
32
- <?php if(is_page()) : ?>
33
- <a href="<?php the_permalink(); ?>printpage/">Print This Article</a>
34
- <?php else : ?>
35
- <a href="<?php the_permalink(); ?>print/">Print This Article</a>
36
- <?php endif; ?>
37
- ------------------------------------------------------------------
38
-
39
-
40
- // Note: If you ARE NOT using nice permalink url
41
- // Open wp-content/themes/<YOUR THEME NAME>/index.php
42
-
43
- Find:
44
- ------------------------------------------------------------------
45
- <?php while (have_posts()) : the_post(); ?>
46
- ------------------------------------------------------------------
47
- Add Below It:
48
- ------------------------------------------------------------------
49
- <?php if(is_page()) : ?>
50
- <a href="wp-print.php?page_id=<?=the_ID()?>">Print This Article</a>
51
- <?php else : ?>
52
- <a href="wp-print.php?p=<?=the_ID()?>">Print This Article</a>
53
- <?php endif; ?>
54
- ------------------------------------------------------------------
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.html ADDED
@@ -0,0 +1,465 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.11 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.11&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
+ <strong>Author:</strong><br />
225
+ <strong>&raquo;</strong> Lester 'GaMerZ' Chan
226
+ </p>
227
+ <p>
228
+ <strong>EMail:</strong><br />
229
+ <strong>&raquo;</strong>
230
+ <script type="text/javascript">
231
+ /* <![CDATA[*/
232
+ document.write(' <a href="mailto:gamerz84@hotmail.com?Subject=WP-Print%202.11%20Support" title="EMail To gamerz84@hotmail.com">gamerz84@hotmail.com</a>');
233
+ /* ]]> */
234
+ </script>
235
+ </p>
236
+ <p>
237
+ <strong>Website:</strong><br />
238
+ <strong>&raquo;</strong> <a href="http://www.lesterchan.net/" title="http://www.lesterchan.net/">http://www.lesterchan.net/</a>
239
+ </p>
240
+ <p>
241
+ <strong>Features:</strong><br />
242
+ <strong>&raquo;</strong> Displays a printable version of your WordPress blog's post/page.
243
+ </p>
244
+ <p>
245
+ <strong>Download:</strong><br />
246
+ <strong>&raquo;</strong> <a href="http://www.lesterchan.net/others/downloads.php?id=12" title="http://www.lesterchan.net/others/downloads.php?id=12">WP-Print 2.11 For WordPress 2.1.x And Above</a><br />
247
+ <strong>&raquo;</strong> <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
+ <strong>&raquo;</strong> <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
+ <strong>Demo:</strong><br />
252
+ <strong>&raquo;</strong> <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
+ <strong>Development:</strong><br />
256
+ <strong>&raquo;</strong> <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
+ <strong>Translations:</strong><br />
260
+ <strong>&raquo;</strong> <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
+ <strong>Support Forums:</strong><br />
264
+ <strong>&raquo;</strong> <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
+ <strong>Updated:</strong><br />
268
+ <strong>&raquo;</strong> 1st June 2007
269
+ </p>
270
+ <p>
271
+ <strong>Note:</strong><br />
272
+ <strong>&raquo;</strong> The <strong>Changelog</strong>, <strong>Installation</strong>, <strong>Upgrade</strong>, <strong>Usage</strong> Tab at the top of the page.<br />
273
+ <strong>&raquo;</strong> Please go to '<strong>WP-Admin -> Options -> Print</strong>' to configure the print text link style.
274
+ </p>
275
+ <p>
276
+ <strong>Donations:</strong><br />
277
+ <strong>&raquo;</strong> 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(' <strong>gamerz84@hotmail.com</strong>.');
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
+ <strong>Version 2.11 (01-06-2007)</strong>
292
+ <ul>
293
+ <li>NEW: Putting [print_link] In Your Post/Page Content Will Display A Link To The Printable Post/Page</li>
294
+ <li>FIXED: Worked With Polyglot Plugin, Fixed By <a href="http://www.getoto.net/">zeridon</a></li>
295
+ <li>FIXED: Wrong URL If Front Page Is A Static Page</li>
296
+ </ul>
297
+ </li>
298
+ <li>
299
+ <strong>Version 2.10 (01-02-2007)</strong>
300
+ <ul>
301
+ <li>NEW: Added Fam Fam Fam's Printer Icon</li>
302
+ <li>NEW: Works For WordPress 2.1 Only</li>
303
+ <li>NEW: Localize WP-Print</li>
304
+ <li>NEW: Ability To Configure The Text For Print Links Via 'WP-Admin -> Options -> Print'</li>
305
+ <li>NEW: The Text For Print Links Can No Longer Be Pass To The Function print_link() or print_link_image()</li>
306
+ <li>FIXED: MUltiple URL Type Fixed By (Virgil - <a href="http://virgil.gr">http://virgil.gr</a>)</li>
307
+ <li>FIXED: 'Click Here To Print' Will Be Hidden When Printing By <a href="http://blog.fileville.net/">Joe (Ttech)</a></li>
308
+ </ul>
309
+ </li>
310
+ <li>
311
+ <strong>Version 2.06 (01-10-2006)</strong>
312
+ <ul>
313
+ <li>NEW: Used Default Date/Time Format Under WordPress Options</li>
314
+ <li>NEW: Added robots: noindex To Printer Friendly Pages</li>
315
+ <li>NEW: Added rel="nofollow" To All Links Generated By WP-Print</li>
316
+ <li>FIXED: &lt;abbr&gt; Tag Mixed Up With &lt;a&gt;</li>
317
+ <li>FIXED: PHP5 Compatibility Issue</li>
318
+ <li>FIXED: Long URL Will Not Break Into More Than 1 Line</li>
319
+ </ul>
320
+ </li>
321
+ <li>
322
+ <strong>Version 2.05 (01-06-2006)</strong>
323
+ <ul>
324
+ <li>NEW: Added Print Options In WP Administration Panel Under 'Options -> Print'</li>
325
+ <li>NEW: Print Administration Panel And The Code That WP-Print Generated Is XHTML 1.0 Transitional</li>
326
+ <li>FIXED: Comment's Content Formatting</li>
327
+ </ul>
328
+ </li>
329
+ <li>
330
+ <strong>Version 2.04 (01-04-2006)</strong>
331
+ <ul>
332
+ <li>NEW: Able To Print Comments Together With Post Using $can_print_comments In wp-print.php</li>
333
+ <li>NEW: Moved wp-print.php To Plugin Folder</li>
334
+ <li>FIXED: Removed Link From Post Comment Count And Post Category</li>
335
+ </ul>
336
+ </li>
337
+ <li>
338
+ <strong>Version 2.03 (01-03-2006)</strong>
339
+ <ul>
340
+ <li>NEW: Added Print Image With print_link_image()</li>
341
+ <li>NEW: Automatically Break To Next Line If Link Contains More Than 100 Chars</li>
342
+ <li>FIXED: Comment Numbers Showing In Password Protected Post</li>
343
+ </ul>
344
+ </li>
345
+ <li>
346
+ <strong>Version 2.02 (01-02-2006)</strong>
347
+ <ul>
348
+ <li>FIXED: Able To View Password Protected Blog</li>
349
+ </ul>
350
+ </li>
351
+ <li>
352
+ <strong>Version 2.01 (01-01-2006)</strong>
353
+ <ul>
354
+ <li>NEW: Compatible With WordPress 2.0</li>
355
+ <li>NEW: Automatically Detect Whether You Are Using Nice Permalink</li>
356
+ <li>NEW: Automated Permalink</li>
357
+ <li>NEW: Now You Only Need To Insert 1 Line Into Your index.php Of Your Theme</li>
358
+ <li>NEW: GPL License Added</li>
359
+ <li>FIXED: Links Not Displaying Properly When Printing More Than 1 Post On A Single Page</li>
360
+ </ul>
361
+ </li>
362
+ <li>
363
+ <strong>Version 2.00a (17-11-2005)</strong>
364
+ <ul>
365
+ <li>NEW: Permlink For The Page Feature</li>
366
+ </ul>
367
+ </li>
368
+ <li>
369
+ <strong>Version 2.00 (10-11-2005)</strong>
370
+ <ul>
371
+ <li>NEW: Print Out A Summary Of URLS In The Post At The Bottom Of The Page</li>
372
+ </ul>
373
+ </li>
374
+ </ul>
375
+ </div>
376
+
377
+ <!-- Installation Instructions -->
378
+ <div id="Install" style="display: none;">
379
+ <div class="SubTitle">&raquo; Installation Instructions</div>
380
+ <ol>
381
+ <li>
382
+ Open <strong>wp-content/plugins</strong> Folder
383
+ </li>
384
+ <li>
385
+ Put:
386
+ <blockquote>Folder: print</blockquote>
387
+ </li>
388
+ <li>
389
+ <strong>Activate</strong> WP-Print Plugin
390
+ </li>
391
+ <li>
392
+ You Need To Re-Generate The Permalink (<strong>WP-Admin -> Options -> Permalinks -> Update Permalink Structure</strong>)
393
+ </li>
394
+ <li>
395
+ Refer To <strong>Usage</strong> For Further Instructions
396
+ </li>
397
+ </ol>
398
+ </div>
399
+
400
+ <!-- Upgrade Instructions -->
401
+ <div id="Upgrade" style="display: none;">
402
+ <div class="SubTitle">&raquo; Upgrade Instructions</div>
403
+ <div class="SubSubTitle">From v1.0x To v2.11</div>
404
+ <ol>
405
+ <li>
406
+ <strong>Deactivate</strong> WP-Print Plugin
407
+ </li>
408
+ <li>
409
+ Open <strong>wp-content/plugins</strong> Folder
410
+ </li>
411
+ <li>
412
+ Put/Overwrite:
413
+ <blockquote>Folder: print</blockquote>
414
+ </li>
415
+ <li>
416
+ Delete these files if exists:
417
+ <blockquote>
418
+ File: wp-print.php<br />
419
+ File: wp-content/plugins/print.php
420
+ </blockquote>
421
+ </li>
422
+ <li>
423
+ <strong>Activate</strong> WP-Print Plugin
424
+ </li>
425
+ <li>
426
+ You Need To Re-Generate The Permalink (<strong>WP-Admin -> Options -> Permalinks -> Update Permalink Structure</strong>)
427
+ </li>
428
+ <li>
429
+ Refer To <strong>Usage</strong> For Further Instructions
430
+ </li>
431
+ </ol>
432
+ </div>
433
+
434
+ <!-- Usage Instructions -->
435
+ <div id="Usage" style="display: none;">
436
+ <div class="SubTitle">&raquo; Usage Instructions</div>
437
+ <div class="SubSubTitle">General Usage</div>
438
+ <ol>
439
+ <li>
440
+ Open <strong>wp-content/themes/&lt;YOUR THEME NAME&gt;/index.php</strong>
441
+ <p>You may place it in <strong>single.php</strong>, <strong>post.php</strong>, <strong>page.php</strong> or <strong>theloop.php</strong> also.</p>
442
+ </li>
443
+ <li>
444
+ Find:
445
+ <blockquote>
446
+ &lt;?php while (have_posts()) : the_post(); ?&gt;
447
+ </blockquote>
448
+ </li>
449
+ <li>
450
+ Add Anywhere Below It:
451
+ <blockquote>
452
+ &lt;?php if(function_exists('wp_print')) { print_link(); } ?&gt;
453
+ </blockquote>
454
+ <p>If you DO NOT want the print link to appear in every post/page, DO NOT use the code above. Just type in <strong>[print_link]</strong> into the selected post/page content and it will embed the print link into that post/page only.</p>
455
+ </li>
456
+ <li>
457
+ Go to <strong>'WP-Admin -> Options -> Print'</strong> to configure the style of the print text link.
458
+ </li>
459
+ </ol>
460
+ </div>
461
+ </div>
462
+ </div>
463
+ <p id="Copyright">WP-Print 2.11<br />Copyright &copy; 2007 Lester 'GaMerZ' Chan. All Rights Reserved.</p>
464
+ </body>
465
+ </html>
readme.txt CHANGED
@@ -1,15 +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 -> htp://www.lesterchan.net/blogs/wp-print.php?p=647
7
- Updated -> 17th November 2005
8
- --------------------------------------------------
9
 
 
10
 
11
- // Version 2.00a (17-11-2005)
12
- - ADDED: Permlink For The Page Feature
13
 
14
- // Version 2.00 (10-11-2005)
15
- - ADDED: Print Out A Summary Of URLS In The Post At The Bottom Of The Page
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.11
 
 
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,123 +0,0 @@
1
- <?php
2
- /*
3
- +----------------------------------------------------------------+
4
- | |
5
- | WordPress 1.5 Plugin: WP-Print 2.00 |
6
- | Copyright (c) 2005 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
- ### Require WordPress Header
21
- require('wp-blog-header.php');
22
-
23
- ### Variables
24
- $links_text = '';
25
- $page_title = single_post_title('', false);
26
-
27
- ### Print The Content With URLs Footer
28
- function print_content() {
29
- global $links_text;
30
- // Default WordPress Way Of Getting Content
31
- $content = get_the_content($more_link_text, $stripteaser, $more_file);
32
- $content = apply_filters('the_content', $content);
33
- $content = str_replace(']]>', ']]&gt;', $content);
34
- // Match Links
35
- preg_match_all('/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches);
36
- // Count The Number Of Matched Links
37
- for ($i=0; $i < count($matches[0]); $i++) {
38
- $link_match = $matches[0][$i];
39
- $link_number = '['.($i+1).']';
40
- $link_url = $matches[2][$i];
41
- $link_url = (strtolower(substr($link_url,0,7)) != 'http://') ? get_settings('home') . $link_url : $link_url;
42
- $link_text = $matches[4][$i];
43
- $content = str_replace($link_match, $link_number." <a href=\"$link_url\" target=\"_blank\">".$link_text.'</a>', $content);
44
- if(preg_match('/<img(.+?)src=\"(.+?)\"(.*?)>/',$link_text)) {
45
- $links_text .= '<br />'.$link_number.' Image: <b>'.$link_url.'</b>';
46
- } else {
47
- $links_text .= '<br />'.$link_number.' '.$link_text.': <b>'.$link_url.'</b>';
48
- }
49
- }
50
- // Print Out The Content
51
- echo $content;
52
- }
53
-
54
- ### If Page Title Is Empty, Display Error As Page Title
55
- if(empty($page_title)) {
56
- $page_title = 'Error';
57
- }
58
- ?>
59
- <!DOCTYPE HTML PUBLIC "-//W3C//Dp HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dp">
60
- <html>
61
- <head>
62
- <title><?php bloginfo('name')?> > Print > <?php echo $page_title; ?></title>
63
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
64
- <style type="text/css" media="screen, print">
65
- Body {
66
- font-family: Verdana, Arial, Tahoma;
67
- font-size: 12px;
68
- color: #000000;
69
- }
70
- #Outline {
71
- text-align: left;
72
- width: 90%;
73
- margin-left: auto;
74
- margin-right: auto;
75
- padding: 10px;
76
- border: 1px solid #000000;
77
- }
78
- #BlogTitle {
79
- font-weight: bold;
80
- font-size: 16px;
81
- margin-bottom: 5px;
82
- }
83
- #BlogDate {
84
- margin-top: 5px;
85
- margin-bottom: 10px;
86
- }
87
- #BlogContent {
88
- padding: 10px;
89
- margin-top: 10px;
90
- }
91
- HR#Divider {
92
- width: 80%;
93
- height: 1px;
94
- color: #000000;
95
- }
96
- </style>
97
- </head>
98
- <body>
99
- <p align="center"><b>- <?php bloginfo('name'); ?> - <?php bloginfo('url')?> -</b></p>
100
- <center>
101
- <div id="Outline">
102
- <?php if (have_posts()) : ?>
103
- <?php while (have_posts()) : the_post(); ?>
104
- <p id="BlogTitle"><?php the_title(); ?></p>
105
- <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>
106
- <div id="BlogContent">
107
- <?php for($page = 1; $page <= $numpages; $page++) { ?>
108
- <?php print_content(); ?>
109
- <?php } ?>
110
- </div>
111
- <?php endwhile; ?>
112
- <p><hr id="Divider" align="center"></p>
113
- <p align="left">Article printed from <?=get_bloginfo('name')?>: <b><?=get_bloginfo('url')?></b></p>
114
- <p align="left">URL to article: <b><?=get_permalink()?></b></p>
115
- <p align="left"><?php if(!empty($links_text)) { echo 'URLs in this post:'.$links_text; } ?></p>
116
- <p align="right">Click <a href="javascript:window.print();">here</a> to print.</p>
117
- <?php else : ?>
118
- <p align="center">No posts matched your criteria.</p>
119
- <?php endif; ?>
120
- </div>
121
- </center>
122
- </body>
123
- </html>