ZenphotoCMS Forum
Help with if/else statement - 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: Help with if/else statement (/thread-9899.html)



Help with if/else statement - zyfb - 2012-04-26

This is what i want to do
if(.gif file is true)
echo" printfullimage";
else
echo"printdefaultimage";

What is the actual code for this?




Help with if/else statement - zyfb - 2012-04-27

This is what I have, but still not working. I need help with the if statement.

What I want is to show the full image when is a gif file and show the default size image when is other files.

`

"> [img]

`




Help with if/else statement - fretzl - 2012-04-27

You're looking for something like this:
if (getSuffix($imageobject->filename) == "gif" {




Help with if/else statement - zyfb - 2012-04-27

fretzl, thank you for your help.
Do you think you can help me with the rest of the code?
When I upload the code. only the second code the else statement prints.




Help with if/else statement - fretzl - 2012-04-27

I'm not sure where you are using this code.
Of course you have to setup the image object.
http://www.zenphoto.org/news/zenphotos-object-model-framework#creating-a-new-object

If it's part of the next_image() loop the image object is already setup so then you can try:

if (getSuffix($_zp_current_image->filename) == "gif" {etc...




Help with if/else statement - zyfb - 2012-04-27

It works perfectly thank you