| 1 |
<?php |
| 2 |
/* |
| 3 |
+----------------------------------------------------------------+ |
| 4 |
| | |
| 5 |
| WordPress 2.0 Plugin: WP-Print 2.01 | |
| 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 |
### If wp-print.php Loaded Directly, Load wp-blog-header.php |
| 21 |
if(intval($_GET['p']) > 0 || !function_exists('single_post_title')) { |
| 22 |
require(dirname(__FILE__).'/wp-blog-header.php'); |
| 23 |
} |
| 24 |
|
| 25 |
### Variables |
| 26 |
$links_text = ''; |
| 27 |
|
| 28 |
### Load Print Content Function |
| 29 |
add_action('init', 'print_content'); |
| 30 |
|
| 31 |
### Function: Print Page Title |
| 32 |
add_filter('wp_title', 'print_pagetitle'); |
| 33 |
function print_pagetitle($print_pagetitle) { |
| 34 |
return '» Print'.$print_pagetitle; |
| 35 |
} |
| 36 |
?> |
| 37 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 38 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
| 39 |
<head> |
| 40 |
<title><?php bloginfo('name'); ?> <?php wp_title(); ?></title> |
| 41 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| 42 |
<style type="text/css" media="screen, print"> |
| 43 |
Body { |
| 44 |
font-family: Verdana, Arial, Tahoma; |
| 45 |
font-size: 12px; |
| 46 |
color: #000000; |
| 47 |
} |
| 48 |
#Outline { |
| 49 |
text-align: left; |
| 50 |
width: 90%; |
| 51 |
margin-left: auto; |
| 52 |
margin-right: auto; |
| 53 |
padding: 10px; |
| 54 |
border: 1px solid #000000; |
| 55 |
} |
| 56 |
#BlogTitle { |
| 57 |
font-weight: bold; |
| 58 |
font-size: 16px; |
| 59 |
margin-bottom: 5px; |
| 60 |
} |
| 61 |
#BlogDate { |
| 62 |
margin-top: 5px; |
| 63 |
margin-bottom: 10px; |
| 64 |
} |
| 65 |
#BlogContent { |
| 66 |
padding: 10px; |
| 67 |
margin-top: 10px; |
| 68 |
} |
| 69 |
HR#Divider { |
| 70 |
width: 80%; |
| 71 |
height: 1px; |
| 72 |
color: #000000; |
| 73 |
} |
| 74 |
</style> |
| 75 |
</head> |
| 76 |
<body> |
| 77 |
<p align="center"><b>- <?php bloginfo('name'); ?> - <?php bloginfo('url')?> -</b></p> |
| 78 |
<center> |
| 79 |
<div id="Outline"> |
| 80 |
<?php if (have_posts()) : ?> |
| 81 |
<?php while (have_posts()) : the_post(); ?> |
| 82 |
<p id="BlogTitle"><?php the_title(); ?></p> |
| 83 |
<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> |
| 84 |
<div id="BlogContent"><?php print_content(); ?></div> |
| 85 |
<?php endwhile; ?> |
| 86 |
<hr id="Divider" align="center" /> |
| 87 |
<p align="left">Article printed from <?php bloginfo('name'); ?>: <b><?php bloginfo('url'); ?></b></p> |
| 88 |
<p align="left">URL to article: <b><?php the_permalink(); ?></b></p> |
| 89 |
<p align="left"><?php print_links(); ?></p> |
| 90 |
<p align="right">Click <a href="javascript:window.print();">here</a> to print.</p> |
| 91 |
<?php else : ?> |
| 92 |
<p align="center">No posts matched your criteria.</p> |
| 93 |
<?php endif; ?> |
| 94 |
</div> |
| 95 |
</center> |
| 96 |
</body> |
| 97 |
</html> |