Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions

external_upload_notify()

Description

Notify the creator of an external upload share that resources have been uploaded

Parameters

ColumnTypeDefaultDescription
$collection int Ref of external shared collection
$k string External upload access key
$tempcollection int Ref of temporay upload collection

Return

void

Location

include/collections_functions.php lines 6663 to 6695

Definition

 
function external_upload_notify($collection$k$tempcollection)
    {
    global 
$applicationname,$baseurl,$lang;

    
$upload_share get_external_shares(array("share_collection"=>$collection,"share_type"=>1"access_key"=>$k));
    if(!isset(
$upload_share[0]["user"]))
        {
        
debug("external_upload_notify() - unable to find external share details: " func_get_args());
        }
    
$user               $upload_share[0]["user"];
    
$templatevars       = array();
    
$url                $baseurl "/?c=" . (int)$collection;
    
$templatevars['url']= $url
            
    
$message=$lang["notify_upload_share_new"] . "\n\n"$lang["clicklinkviewcollection"] . "\n\n" $url;
    
$notificationmessage=$lang["notify_upload_share_new"];
        
    
// Does the user want an email or notification?
    
get_config_option($user,'email_user_notifications'$send_email);    
    if(
$send_email)
        {
        
$notify_email=ps_value("select email value from user where ref=?",array("i",$user),"");
        if(
$notify_email!='')
            {
            
send_mail($notify_email,$applicationname ": " $lang["notify_upload_share_new_subject"],$message,"","","emailnotifyuploadsharenew",$templatevars);
            }
        }        
    else
        {
        global 
$userref;
        
message_add($user,$notificationmessage,$url,0);
        }
    }

This article was last updated 19th March 2024 09:05 Europe/London time based on the source file dated 15th March 2024 17:00 Europe/London time.