PHP Function to check if a gallery is secure or not

HomeSupportImage StorePHP Function to check if a gallery is secure or not

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #49995
    kyle7787
    Participant

    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?

    #50023
    Xpark Media
    Keymaster
    function 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)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.