I've developed/improved a hack to allow your own print solution (with the idea of trip).
Demo: http://www.7dana.com (sorry..very little print icon

NOTE:
You can't use this hack with rewrite functionality enabled in phpwcms ...sorry.
This script is an modification of PHPrint 2.1 (Copyright by MikeNew.Net)!
INSTALLATION:
-----------------
1: Save this code to print.php in the root of the site.
Code: Select all
<?php
/*PHPrint - This file is print.php
Make any Page Printer Friendly! Version 2.1 - With error handling
Copyright by MikeNew.Net, Notice must stay intact
Any improvements to this script are welcome: www.mikenew.net/contact.asp
************
Legal: MikeNew.Net is not responsible for any damages caused
by use of this script. (Highly unlikely. Hasn't yet.)
This script will make your pages printer friendly.
Optionally, it will strip images as well. (Instructions for that below)
***********************************************************
This script is an modification of PHPrint 2.1 (Copyright by MikeNew.Net)
by Goran Zajec from www.7dana.com , maded to use with PHPWCMS CMS.
***********************************************************
1. Save this script in the root of the site for simplicity.
2. Place <!-- startprint --> somewhere in your PHPWCMS template
where you consider it to be the start of printer friendly content,
and <!-- stopprint --> goes at the end of that same content.
3. You place a link to print.php anywhere on the PHPWCMS template
(preferably outside the printed content, like this:
<a href="print.php">Print this page</a> or however you like,
just as long as you link to this script. */
//The name of your site, without trailing slash?
$site_NAME="My Site";
//Path to print_logo image, without trailing slash?
$LOGO_image="img/print_logo.gif";
//Do you want to strip images from the printable output?
// If no, change to "no". Otherwise, images are stripped by default.
$stripImages = "no";
//What's the base domain name of your site, without trailing slash?
// Just the domain itself, so we can fix any relative image and link problems.
$baseURL="http://www.yoursite.com";
// That's it! No need to go below here. Upload it and test.
// --------------------------------------------------------
// --------------------------------------------------------
echo "<html><head>";
echo "<title>$site_NAME | Print version</title>";
echo "<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>";
echo "<style><!-- body { font-family: Verdana,Arial,Sans-serif; margin: 0px; font-size: 12px; } table { font-size: 12px; background-color: #FFFFFF; } hr { height: 1px; color: #D1D1D1; } .print_table { border: 1px solid #cccccc; padding: 8px; margin: 12px; } .print_bottom { text-align: center; padding: 15px; font-size: 11px; border-top: 1px solid #cccccc;} //--></style>";
echo "</head><body> ";
// Let's turn off direct access without referer page.
if (is_null($HTTP_REFERER)) {
print "<br><br><p align='center'><strong>Oooops...you can't access PRINT PAGE directly....without referer page!</strong><br><BR>[<a href='$baseURL'> Home Page</a>]</p> \n";
}
else {
$startingpoint = "<!-- startprint -->";
$endingpoint = "<!-- stopprint -->";
$read = fopen($HTTP_REFERER, "rb");
$value = "";
while(!feof($read)){
$value .= fread($read, 4096);
}
fclose($read);
$start= strpos($value, "$startingpoint");
$finish= strpos($value, "$endingpoint");
$length= $finish-$start;
$value=substr($value, $start, $length);
function i_denude($variable)
{
return(eregi_replace("<img src=[^>]*>", "", $variable));
}
function i_denudef($variable)
{
return(eregi_replace("<font[^>]*>", "", $variable));
}
$PHPrint = ("$value");
if ($stripImages == "yes") {
$PHPrint = i_denude("$PHPrint");
}
$PHPrint = i_denudef("$PHPrint");
$PHPrint = str_replace( "</font>", "", $PHPrint );
echo "<table class=print_table width=580 border=0 cellpadding=0 cellspacing=0><tr><td valign=top>";
echo "<img src=$LOGO_image alt='$site_NAME' hspace=0 vspace=0 border=0><hr>";
echo $PHPrint;
echo "<table class=print_bottom width=90% align=center border=0 cellpadding=0 cellspacing=0><tr><td valign=top>";
echo "This article comes from <strong>$site_NAME</strong> site ($baseURL).<br><br>";
echo "The URL for this article is:<br><a href='$HTTP_REFERER'> $HTTP_REFERER</a><br><br>";
echo "<form><input type='button' value='Print this page' onClick='window.print()'></form>";
echo "</td></tr></table>";
echo "</td></tr></table>";
echo "<br></body></html>";
flush ();
}
?>
Code: Select all
<!-- startprint -->
and
Code: Select all
<!-- stopprint -->
3. Place a link to print.php anywhere on the template (preferably outside the printed content, like this:
Code: Select all
<a href="print.php">Print this page</a>
4. Open print.php and set up additional parameter(site name, path to print_logo image, ...) .
Thats all, enjoy in the new Print Page look.
