File size would be simple--there is a PHP function, `filesize($filename)` for that. There are no Zenphoto functions for run-time. Maybe it is a function of file-size or maybe there is metadata in the file that tells you. But I do not know.
There is metadata for the video run time if supported by the getID3 class we use. You should get that via the general metadata function if it was able to extract that.
And how do i get that info to display? I"ve tried different coding for php but I don't know what to put to get it to display the file size and file name. It needs to go where the 5's are:
Thanks for all the helpful info. I'm trying to tell you I don't know how to get the filesize($filename) to display on the page. There has to be some kind of formatting and I can't figure it out.
Echo it. Really php basics. You will need to pass the unprotected full image url to get the actual value. See the standard themes for that or the documentation.
The function I mentioned above are of course very different as they return an array.
Well, `<?php echo filesize($filename());?>` will of course not work unless you define the variable. But you need the path to the full image. There is an very obvious function called `getFullImageURL`. The full image needs to be set to unprotected.
I appreciate your help with this. I have been editing php in Wordpress for many years without as much difficulty as I am finding here. ZenPhoto is absolutely perfect for the application I am using it for (somewhat of a "Tube" site).
As for your last reply, the filename now shows, but the file size does not. Am I making a mistake?
Comments
<?php if ($thumbcrop) { printCustomSizedImage(getBareImageTitle(),null,$imagesize,$imagesize,$imagesize,$imagesize,null,null,'remove-attributes',null,true); } else { printCustomSizedImage(getBareImageTitle(),$imagesize,null,null,null,null,null,null,'remove-attributes',null,true); } ?>
55555555555555555555555555555
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functiongetImageMetaData
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functionprintImageMetadata
For instance, in html, I can't show an image by typing:
img src="http://www.google.com/1.jpg"
I have to type:
<img src="http://www.google.com/1.jpg">
So how do I get filesize($filename) to display on the page?
The function I mentioned above are of course very different as they return an array.
I try:
<?php echo filesize($filename());?>
but it breaks the page and does not display file size information.
Any help would be appreciated.
If you want something in exhange, I would be happy to write about your site, product or service on iGotStiffed.com or SillyReviews.com
Thanks.
Where you see "5555555" is where I'd like to be able to display the file size in MB and the file name.
What could I put in place of "55555555" to achieve these results?
Screenshot: http://imgur.com/kloFO
album.php code: http://codeviewer.org/view/code:2a8f
2. `echo $_zp_current_image->filename;`
I suggest you take some time to learn php basics, for example on http://www.w3schools.com/php/default.asp.
We have really no resource to teach that here. Sorry.
As for your last reply, the filename now shows, but the file size does not. Am I making a mistake?
`
<?php if ($thumbcrop) { printCustomSizedImage(getBareImageTitle(),null,$imagesize,$imagesize,$imagesize,$imagesize,null,null,'remove-attributes',null,true); } else { printCustomSizedImage(getBareImageTitle(),$imagesize,null,null,null,null,null,null,'remove-attributes',null,true); } ?><?php echo $_zp_current_image->filename;?>
<?php echo filesize(getFullImageURL());?>
`