ZenphotoCMS Forum
Hide/Show div depending on file type in image.php - 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: Hide/Show div depending on file type in image.php (/thread-12968.html)



Hide/Show div depending on file type in image.php - imai - 2017-08-15

Hi guys,

I want to show/hide a text div depending on the file type on image.php.

Can you tell me how to set it as a 'php if' on file type?
I wonder it'd be similar to the .

Thank you very much.




Hide/Show div depending on file type in image.php - acrylian - 2017-08-16

You can do it like this:
if(getISuffix($_zp_current_image->filename) == 'jpg") { … }




Hide/Show div depending on file type in image.php - imai - 2017-08-17

Thanks a lot for the response.

But it didn't work as a string.

I thought on replacing for 'jpg' instead of 'jpg".
Though it worked as a string but still got the error below:

"Fatal error: Call to undefined function getISuffix() in .../image.php on line 44"

Just in case is it easy to resolve?
Otherwise I can live with it for now.

Cheers




Hide/Show div depending on file type in image.php - acrylian - 2017-08-17

I just had a typo in the function name as it is called getSuffix. On such answer always remember that we sometimes answer inbetween quickly. There is a functions documentation on our user guide you can also refer to. Or you use a IDE like Eclipse, Netbeans or the like that provides access to functions.