Collections functions
General functions
Render functions
Theme permission 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 3443 to 3460

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 3rd October 2022 11:35 Europe/London time based on the source file dated 22nd September 2022 11:00 Europe/London time.