Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video 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 2670 to 2691

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 != "" "'" escape_check($userref) . "'" "NULL");
    
$collection escape_check($collection);
    
$type escape_check($type);
    
$resource $resource != "" "'" escape_check($resource) . "'" "NULL";
    
$notes escape_check(mb_strcut($notes0255));

    
sql_query("
        INSERT INTO collection_log (date, user, collection, type, resource, notes)
             VALUES (now(), 
{$user}, '{$collection}', '{$type}', {$resource}, '{$notes}')");
    }

This article was last updated 30th November 2020 13:05 Europe/London time based on the source file dated 25th November 2020 10:35 Europe/London time.