Member
Member
bpetruzzo   2008-07-29, 19:30
#1

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?

Administrator
Administrator
acrylian   2008-07-29, 19:45
#2

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

Member
Member
bpetruzzo   2008-07-29, 21:44
#3

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?

Member
Member
sbillard   2008-07-29, 22:46
#4

`

Album Explanation

`

Member
Member
bpetruzzo   2008-07-30, 20:39
#5

That worked perfect! Thank you so much!

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