Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

check_use_watermark()

Parameters

ColumnTypeDefaultDescription
$download_key ""
$resource ""

Location

include/resource_functions.php lines 4974 to 5015

Definition

 
function check_use_watermark($download_key ""$resource="")
    {
    
debug_function_call("check_use_watermark"func_get_args());
    
# This function checks whether or not to use watermarks
    # Note that access status must be available prior to calls to this function    

    
global $access,$k,$watermark,$watermark_open,$pagename,$watermark_open_search$terms_download;

    
# Cannot watermark without a watermark
    
if(!isset($watermark))
        {
        return 
false
        }

    
# Cannot watermark unless permission "w" is present       
    
if(!checkperm('w'))
        { 
        return 
false
        }

    
# Watermark is present and permission "w" is present

    # Watermark if access is restricted
    
if($access == 1)
        { 
        return 
true
        }

    
# Watermark if open override is present 
    
if(    $watermark_open  
        
&& (    ($pagename == "preview"
             || (
$pagename == "view"
             || (
$pagename == "search" && $watermark_open_search)
             || (
$pagename == "download" && $terms_download && !download_link_check_key($download_key$resource))
           ) )
        { 
        return 
true
        } 

    
# Watermark not necessary
    
return false;
}

This article was last updated 12th July 2020 04:05 Europe/London time based on the source file dated 10th July 2020 16:06 Europe/London time.