Hi, I'm trying to use flickrish, but it is using some calls that are for php 5.2 only.
I'm going to try to update it to be php 5.1 tolerant, as well as try to add some options and make it more ZP 1.2.8 tolerant. However, PHP is not my native language, so I need a little assistance from the developers.
The function that is 5.2 only is date_format().
Question 1. Is there an equivalent in 5.1
Question 2. What variable hold the PHP version, or is there a way to ask php if a function exists?
Ideally I'ld like to setup a small function in the theme that checks if date_format is available, otherwise just gives you back an unformatted date.
Once I get passed that, I hope to add support for :
- google maps
- shutterfly
TIA,
-m
Comments
Also this is not the right place for general PHP learning questions. Try searching on http://php.net or one of the many PHP support forums.
Author is MIA and hasn't touched this in a year. I'm trying to develop for ZenPhoto, to make a theme more usable for all users, throw me a bone here. Themes like this will make ZP more popular IMHO.
I found what I was looking for : function_exists(). I made a wrapper function to check for date_create/date_format() so now the theme is 5.1 and 5.2 compatible. I also made a check for GetImageMetaData() vs GetImageEXIFData() to make the theme work w/ various versions of ZP out of the box.
Next problem : "Undefined variable: _zp_themeroot" ...
I'm guessing this some global that was deprecated between ZP versions?
-m
GetImageMetaData() vs GetImageEXIFData()
The latter is stil located in the deprecated functions plugin.
`$_zp_themeroot` is a standard global available for all themes and not deprecated. You see it easily in every standard theme. (We have a list of globals on the user guide).
Btw, if you haven't yet, you should now read the theming tutorial.
So there is some sort of scope issue w/ $_zp_themeroot where in one case it is not defined. This is for a page custom to this theme called textimage.php. It is called w/ this line from header.php :
<img src="<?php echo $_zp_themeroot ?>/textimage.php?txt=<?php echo getGalleryTitle();?>" />
That instance of $_zp_themeroot is defined, but when textimage.php is loaded by itself, I'm guessing it is outside of the normal zenphoto frame work and so that global isn't defined. textimage.php creates and returns an image/png.
Is there a certain include I need to add at the top of textimage.php to get the ZP globals perhaps?
Thanks for your time,
-m
`$font = $_zp_themeroot .'/fonts/arial.ttf';`
to
`$font = dirname(__FILE__).'/fonts/arial.ttf';`
and now it's not barfing out any more warnings to apache's error_log.
Next up : google maps.
I have to say I was blown away about how easy integrating the google map plugin was... one call on two pages each. I had that working in about 10 minutes. I'm now working on parameterizing some of the hard-coded stuff into theme options. I'll see about cleaning up the font files and then post my changes. Any other clean-up suggestions are welcome. Demo here : http://warped.org/photos/Places/thailand/thailand_knm-0003.jpg.php