Member
Member
imai   2017-08-15, 23:52
#1
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 <?php if (hasPrevImage()) { ?>.

Thank you very much.
Administrator
Administrator
acrylian   2017-08-16, 09:14
#2
You can do it like this:
`if(getISuffix($_zp_current_image->filename) == 'jpg") { … }`
Member
Member
imai   2017-08-17, 01:39
#3
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
Administrator
Administrator
acrylian   2017-08-17, 11:42
#4
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.
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.