Some experimental fixes:
In Languages/English/Main.lng add just above the 1; at the bottom
$maintxt{'printpage'} = 'Print this page';
In Sources/Display.pm find:
$template_print =
qq~$menusep<a href="$scripturl?action=print;num=$viewnum" target="_blank">$img{'print'}</a>~;
replace with
$template_print =
qq~$menusep<a href="javascript:void(window.open('$scripturl?action=print;num=$viewnum','printw
indow'))">$img{'print'}</a>~;
Find:
$template_print_post =
qq~$menusep<a href="$scripturl?action=print;num=$viewnum;post=$postnum" target="_blank">$img{'printp'}</a>~;
Replace with:
$template_print_post =
qq~$menusep<a stnum','printwindow'))">$img{'printp'}</a>~;
In Sources/InstantMessage.pm find:
$showIM_link .= qq~
$menusep<a href="$scripturl?action=imprint;caller=$INFO{'caller'};id=$messageid" target="_blank">$img{'print_im'}</a>
~;
Replace with:
$showIM_link .= qq~
$menusep<a href="javascript:void(window.open('$scripturl?action=imprint;caller=$INFO{'calle
r'};id=$messageid','printwindow'))">$img{'print_im'}</a>
~;
In Sources/Printpage.pm find
function printPage() {
if (window.print) {
agree = confirm('$maintxt{773}');
if (agree) window.print();
}
}
Remove it. (twice)
Find
<body onload="printPage()">
Replace with
<body>
(twice)
Find:
</table>
<br />~;
$output .= qq~
Replace with:
</table>
<form><p style="text-align:center"><input type="button" value=" $maintxt{'printpage'} " onclick="window.print();" /></p></form>
~;
$output .= qq~
Find:
<br />~;
}
$output .= qq~
Replace with:
<br />
~;
}
$output .= qq~
<form><p style="text-align:center"><input type="button" value=" $maintxt{'printpage'} " onclick="window.print();" /></p></form>
These changes use javascript to create the 'printable window' and also uses a button to call the actual print function. (One of the things I'm pretty sure was happening was the server was waiting for a browser response on a function that was automatically loaded but a bot couldn't respond to - and so long as it was waiting, CPU resources were being eaten up.)
I would like to have the printable window autoclose after printing but the 'window.close' function doesn't work properly in Chrome/Safari.