ZenphotoCMS Forum
if album exists print command? - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: if album exists print command? (/thread-3387.html)



if album exists print command? - bpetruzzo - 2008-07-29

There's a good chance that my title didn't make sense and that's partially why I'm posting in the first place, cause I'm not exactly sure how to search for the solution to my problem and subsequently unsure of how to ask about a solution.

Basically, I have a series of albums. Some have very lengthy descriptions. I have a div block that contains my description, which I'd like only to appear if a description exists. As it is, the div block shows up on all album pages, most with empty descriptions.

So I guess my question is, how would I go about telling the album.php page to only print the div if the album description exists?




if album exists print command? - acrylian - 2008-07-29

Useif(!empty(getAlbumDesc()) { printAlbumDesc() } where your description should appear




if album exists print command? - bpetruzzo - 2008-07-29

I wasn't able to get that code to work. It kept giving me this error:

Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE or '$'

Basically, I want this set of code:

`Album Explanation

`

to execute only if a description exists. Would the code you gave me pull that off?




if album exists print command? - sbillard - 2008-07-29

`

Album Explanation

`




if album exists print command? - bpetruzzo - 2008-07-30

That worked perfect! Thank you so much!