Installing a Print Image Button

Hi there

I'm just wondering how I can add a button or link to phpalbum so that when people click on it, it will print the original file

Thanks for your help!

I assume you will have to do

I assume you will have to do it with some javascript. To add some java script just edit the template files, imageview.tpl.php or album.tpl.php in the theme directory of your theme.

simple solution

this is a very simple sollution but you don't have print options or something like that.
the only thing you have to do is add the next code to the imageview.tpl.php file where you want to have the print option.
< a href="Javascript:self.print()" >print deze pagina< /a >
(haal de spaties na de < en voor de > weg)

Print Button

Hi All

I've been playing around for a few days, and saw that you wanted a "print" button .... Doing this, the picture is placed in it's own window, clear of any "junk", so that a 'file >> print' prints only the photo !

Add this to imageview.tpl in Theme Dir.

<INPUT type="button" value="Print Photo" onClick="'<? print $image;?>','mywindow','width=<? print $width;?>,height=<? print $height;?>,toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=no,copyhistory=yes,resizable=no')">

This MUST all be on one line ...

I've put mine just after

<? if($long_desc){?>

<? print $long_desc?>
<? } ?>

Here's where I used it :

Ralph Colyn

different print options


If you want to print ONLY the image you have to use the code from RColyn.
with the code I posted you will print the page like you see it.
this has as advantige that you print also the image details but as disadvantige that you print your album background (more inkt used).
You can create a hole page with a title and extra information but you have to create a new template or you have to add all the code befor and after the <? print $image;?>.
but in both cases you have to find out what the code is to get the image details you want.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.