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

collection_log()

Description

Add a new row to the collection log (e.g. after an action on that collection)

Parameters

ColumnTypeDefaultDescription
$collection integer
$type string Action type
$resource integer
$notes string ""

Return

void

Location

include/collections_functions.php lines 3572 to 3589

Definition

 
function collection_log($collection,$type,$resource,$notes "")
    {
    global 
$userref;

    if (!
is_numeric($collection)) {return false;}

    
$modifiedcollogtype=hook("modifycollogtype","",array($type,$resource));
    if (
$modifiedcollogtype) {$type=$modifiedcollogtype;}
    
    
$modifiedcollognotes=hook("modifycollognotes","",array($type,$resource,$notes));
    if (
$modifiedcollognotes) {$notes=$modifiedcollognotes;}

    
$user = ($userref ?: null);
    
$resource = ($resource ?: null);
    
$notes mb_strcut($notes0255);

    
ps_query("INSERT INTO collection_log (date, user, collection, type, resource, notes) VALUES (now(), ?, ?, ?, ?, ?)",array("i",$user,"i",$collection,"s",$type,"i",$resource,"s",$notes));
    }

This article was last updated 19th April 2024 10:35 Europe/London time based on the source file dated 15th April 2024 12:15 Europe/London time.