if-then function for unpublished images

I'm trying to make a signal for my image.php page so when i am in the page as admin, it alerts me that the image is unpublished.

I thought some kind of if-then like this would work:

<?php if(getImagePublish(true)) {

?>true <?php

}else{ ?> false <?php

}; ?>

i am getting an error that says: Call to undefined function getImagePublish()

what am I doing wrong?

Comments

  • Don't know where to start. I guess you have not read the themeing guide nor the information about the zenphoto object model.

    There is no such functon `getImagePublish()` There is a method of the gallery class by that name, but it must be invoked as a method of a object of class gallery. Even then, it will not give you the information you wish--it returns the default "publish" option for images.

    What you want is the `getShow()` method of the image object.
  • I have read both, but i don't have a good understanding of object orientation, so a lot of the information goes over my head.

    thanks for pointing me in the right direction. I was able to get the result i wanted by changing it to:

    <?php if ($_zp_current_image->getShow()) {

    ?>true <?php

    }else{ ?> false <?php

    }; ?>
  • acrylian Administrator, Developer
    The flag_thumbnail plugin has an option to add an icon or text note to mark unpublished images, too. It uses a filter so no need to change the theme.

    However, it does that only on the thumbnails, not on the image page itself.
Sign In or Register to comment.