I have had this problem, so here is a solution....
A guide how to set this up is all in the doc below, you only need to add the special tags to your phpWCMS template and you are away...with your own print solution.
hope this helps those who need to get round this problem.
TriP
Code: Select all
<html>
<head>
<title>Print version</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="own.css" rel="stylesheet" type="text/css">
</head>
<?php
/*PHPrint - This file is printTemplate.php
Make any Page Printer Friendly! Copyright by MikeNew.Net, Notice must stay intact
************
Legal: MikeNew.Net is not responsible for any damages caused
by use of this script. (Not that it will, probably. Never has.)
This script will make your pages printer friendly.
Optionally, it will strip images as well. (Instructions for that below)
/* Modification to the Script August 2002
1. Copyright by Mike in header
2. deleted extra http refer...
3. Changed filename to printTemplate.php
*/
// After installation, you can remove text from here down to the next: 8< ---->
// Back up/copy this file first.
/*
1. Save this script in the root of the site for simplicity.
2. Place <!-- startprint --> somewhere in your HTML page 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 phprint.php anywhere on the HTML page (preferably outside the printed content,
like this: <a href="/phprint.php">Print this page</a>
- or however you like, just as long as you link to this script. */
// If you've already tested, you can remove the text from here up to the other: 8< ---->
//Do you want to strip images from the printable output?
// If no, change to "no". Otherwise, images are stripped by default.
$stripImages = "no";
// That's it! No need to go below here. Upload it and test.
$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 );
// Start of the Print echo on html
echo" own design here ";
echo " own design here";
echo "own design here";
echo $PHPrint;
echo "own design here";
echo " own design here";
flush ();
?>