Member
Member
snagt   2006-12-13, 01:28
#1

Could anyone help me out how to rewrite this bit from template-functions?
I want the script to print echo getAlbumPlace(); as the printAlbumPlace(), but only if there actually IS anything written in the "Place" field. Otherwise, print nothing.

`function getAlbumPlace() {

global $_zp_current_album;

return $_zp_current_album->getPlace();

}

function printAlbumPlace() {

echo getAlbumPlace();

}`

It's because I want to use Zenphoto to show my travel photos, AND my portfolio - both pages which need a slightly different layout. So I want the echo getAlbumPlace(); only to show on the travel-photos pages. Reason why I include the h3 tag is because there's a background image involved, which otherwise would stay awkwardly empty, in the non-travelphoto pages!
Many thanks in advance

Developer
Developer
trisweb   2006-12-13, 01:44
#2

`

`

That should do it! Let us know if you need more help.

Member
Member
snagt   2006-12-13, 02:10
#3

Works wonderfully, thanks very much!

I've spent days looking for a simple image gallery script (after deciding I didn't want to use a Lightbox-like script) and in the end I tried out Catscan (http://cat-scan.net/) and Cligs (http://johnleach.co.uk/documents/cligs/index.html). But both these projects had so little documentation that I turned to Zenphoto (which I didn't want to do in the beginning because I'm kind of afraid of SQL and scripts that consist of more than one file). Well, now I'm very happy that I did Thanks again!

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.