Bring Your Business to Life › Support › Image Store › PHP Function to check if a gallery is secure or not
- AuthorPosts
- September 20, 2012 at 6:27 pm #49995kyle7787Participant
I am trying to make it so users must request to get full access to a gallery. What I have so far is posted a limited number of photos to all the open galleries, and at the end it displays a form for them to request more. I have done so using the _inc/store.php file on line 1781. On the return statement I just made it return a form using formidable. But I only want the form to show up on galleries that aren’t secured.
Is there a function that I can use to check if a gallery is secured or not? I am just looking for a simple boolean function or something that returns an int, for example 1 if secured and 0 if not secure.
If the plugin doesn’t have a function like this, how can I implement it?
September 22, 2012 at 11:36 pm #50023Xpark MediaKeymasterfunction is_gallery_protected($post =false){ if(empty($post)) global $post; if(!empty($post->post_password)) return true return false; }
The post is the gallery object that you want to check or the current gallery (post)
- AuthorPosts
- You must be logged in to reply to this topic.