Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

message_remove_related()

Description

Remove all messages related to a certain activity (e.g. resource request or resource submission)
matching the given ref(s)

Parameters

ColumnTypeDefaultDescription
$remote_activity int 0 ID of related activity type - see SYSTEM NOTIFICATION TYPES section in definitions.php
$remote_refs mixed array Related activity ID or array of IDs

Return

void

Location

include/message_functions.php lines 803 to 817

Definition

 
function message_remove_related($remote_activity=0,$remote_refs=array())
    {
    if(
$remote_activity==|| $remote_refs==|| (is_array($remote_refs) && count($remote_refs)==0) ){return false;}
    if(!
is_array($remote_refs)){$remote_refs=array($remote_refs);}
    
$parameters = array("i"$remote_activity);
    
$parameters array_merge($parametersps_param_fill($remote_refs,"i"));

    
$relatedmessages ps_array("select ref value from message where related_activity = ? and related_ref in (" ps_param_insert(count($remote_refs)) . ");"$parameters"");
    if(
count($relatedmessages)>0)
        {
        
$parameters ps_param_fill($relatedmessages,"i");
        
ps_query("DELETE FROM message WHERE ref in (" ps_param_insert(count($relatedmessages)) . ");"$parameters);
        
ps_query("DELETE FROM user_message WHERE message in (" ps_param_insert(count($relatedmessages)) . ");"$parameters);
        }
    }

This article was last updated 8th December 2024 20:35 Europe/London time based on the source file dated 27th November 2024 15:30 Europe/London time.