Nice formatted Print Page

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
Goran
Posts: 81
Joined: Thu 27. Nov 2003, 11:43
Location: Zagreb, Croatia
Contact:

Post by Goran »

Oliver Georgi wrote:why that complex? use some lines of code and CSS style print.css and everything works the same. And check file printwindow.php in code snippets folder of phpwcms - or check this:

Code: Select all

[PHP]
if($GLOBALS['aktion'][2] !=0) {
	echo '<script language="JavaScript" type="text/javascript">';
	echo "\n<!--\n";
	echo 'window.print();';
	echo "\n//-->\n";
	echo '</script>';
}
[/PHP]
You can place any part of code/html there if neccessary.

Oliver
It's not so big, if you remove instructions around 3kb(CSS included).
I like features like different logo for print page, displaying URL of printed article and Print button.
osinski
Posts: 20
Joined: Tue 15. Feb 2005, 03:54

Post by osinski »

Do you have rewrite functionality enabled in phpwcms?
Sorry not really sure what this is and where you can enable it.
I have installed exactly the same version on my desktop where it works fine,
only the real server doesn't work.

Thanks a lot in advance for your replay
phalancs
Posts: 793
Joined: Thu 19. Feb 2004, 05:09
Location: Germany

problem

Post by phalancs »

sorry, i love this script.

It runs perfectly on my localhost. but online.... same as osikski.

Had the "oops" error, then replaced the http referer variable, now i have a blank site. Better than an error?

Any help? No rewrite enabled as far as i know (what should that be good for).

What should I do now?
2008
rosemckay
Posts: 54
Joined: Thu 13. Oct 2005, 00:59

Re: Very nice work but small problems!!!

Post by rosemckay »

osinski wrote:Then I replaced $HTTP_REFERER with $_SERVER['HTTP_REFERER'] and it finally worked except the referer page :(
Where is this change made?
User avatar
juergen
Moderator
Posts: 4556
Joined: Mon 10. Jan 2005, 18:10
Location: Weinheim
Contact:

Post by juergen »

Hello,

you prob. mix up two different methodes ...

The one you meant comes frome here:

http://www.phpwcms.de/forum/viewtopic.p ... print+page

Thats no java, a complete php based print page. I love this ... very helpfull to get your site on paper...

Jürgen
phalancs
Posts: 793
Joined: Thu 19. Feb 2004, 05:09
Location: Germany

Post by phalancs »

Hey DF6IH,

whats your point, why do you link to this post from within this post??
Why are you talking about java? Any solutions to the problems mentioned earlier?

Hmm :O
2008
User avatar
juergen
Moderator
Posts: 4556
Joined: Mon 10. Jan 2005, 18:10
Location: Weinheim
Contact:

Post by juergen »

Hi phalancs ... :)

I saw this threat with at least 2 methods of printing. The first, is the one you prefer. Within this site the next .. with a (php driven) J A V A script. I'm shure you confirm :wink:

So, there are three methods to get page-> paper. As I think a very usefull thing for page visitors.

Why not refering method nr 3? As you have an actual "how can I printout" thread. So, its depending on apache versions,php versions, you have to replace in the only PHP based methods
$HTTP_REFERER with $_SERVER['HTTP_REFERER']
you can check this in your phpinfo file.

So far my answer was to rosemckay.

phalancs, you are "crack statused" for me, thats why I didn't post: 'I have it running with mod_rewrite together' :wink: :lol:

Now closing 4 forum windows and going on with work.

Jürgen
peri
Posts: 61
Joined: Sat 11. Mar 2006, 14:33

problem with ie and safari

Post by peri »

i have installed the script and it works fine in NS and Firefox.
On IE and Safari i became a white site when i set


<!-- startprint -->
<!-- stopprint -->

into my template.

Whats this? Can someone help me to fix the problem?

Thx
peri
Ich werd jetzt erst einmal eine Tasse Tee trinken ... mhh lecker

Image
Goran
Posts: 81
Joined: Thu 27. Nov 2003, 11:43
Location: Zagreb, Croatia
Contact:

Post by Goran »

I have tested using Opera, IE, Firefox and Konqueror(Safari) without any problem.
Also, I use Print hack with mod_rewrite enabled and it works fine.

Take a look:
http://www.fragaria.hr
http://www.mojpas.com
R0yk3
Posts: 1
Joined: Thu 16. Mar 2006, 13:59

Post by R0yk3 »

Hello,

I installed this mod but when i use the print page i get a blank window?
I replaced $HTTP_REFERER with $_SERVER['HTTP_REFERER']
But i stil have a blank page.
mod_rewrite is off.

I have read it more arround here but no answers :cry:

i use apache on an windows XP machine. Sorry i can't show it it is on our Intranet.

Somebody pls..
peri
Posts: 61
Joined: Sat 11. Mar 2006, 14:33

Post by peri »

i think that if allow_url_fopen is set to off ( server settings) this script wont work.
I am right?
Ich werd jetzt erst einmal eine Tasse Tee trinken ... mhh lecker

Image
User avatar
sustia
Posts: 651
Joined: Fri 2. Apr 2004, 22:29
Location: Lecce (Italy)
Contact:

Post by sustia »

Another question.
Can I have different <!-- startprint --> and <!-- stopprint -->?
For example

<!-- startprint -->
{CONTENT}
<!-- stopprint -->

*a part I don't want to print*


<!-- startprint -->
{FOOTER}
<!-- stopprint -->
Campeones del mundo!
Vegetables!
Nordlicht
Posts: 160
Joined: Wed 12. Apr 2006, 08:16
Location: Germany, near Hamburg
Contact:

Post by Nordlicht »

Can't get it to work.

When I click on my Print button I get a new window with this message:
Warning: fopen(http://www.bau-facts.de/phpwcms/index.php?firmenprofil): failed to open stream: HTTP request failed! HTTP/1.1 401 Authorization Required in /www/htdocs/v079687/phpwcms/print.php on line 65

Warning: feof(): supplied argument is not a valid stream resource in /www/htdocs/v079687/phpwcms/print.php on line 67

Warning: fread(): supplied argument is not a valid stream resource in /www/htdocs/v079687/phpwcms/print.php on line 68

Warning: feof(): supplied argument is not a valid stream resource in /www/htdocs/v079687/phpwcms/print.php on line 67

Warning: fread(): supplied argument is not a valid stream resource in /www/htdocs/v079687/phpwcms/print.php on line 68
....
and so on, stuck in the loop

Any hints?
allow_url_fopen is set to on on the server.
Nordlicht
Posts: 160
Joined: Wed 12. Apr 2006, 08:16
Location: Germany, near Hamburg
Contact:

Post by Nordlicht »

Anybody else with this problem?
Site is hosted at all-inkl.de
cyrano
Posts: 1598
Joined: Sat 31. Jan 2004, 18:33
Location: Stuttgart
Contact:

Post by cyrano »

can't acces to page, but set print.php to CHMOD 777 get it working?
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
Post Reply