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

remove_keyword_mappings()

Parameters

ColumnTypeDefaultDescription
$ref
$string
$resource_type_field
$partial_index false
$is_date false
$optional_column ''
$optional_value ''
$is_html false

Location

include/resource_functions.php lines 2039 to 2061

Definition

 
function remove_keyword_mappings($ref,$string,$resource_type_field,$partial_index=false,$is_date=false,$optional_column='',$optional_value='',$is_html=false)
    {
    
# Removes one instance of each keyword->resource mapping for each occurrence of that
    # keyword in $string.
    # This is used to remove keyword mappings when a field has changed.
    # We also decrease the hit count for each keyword.
    
if (trim($string)=="") {return false;}
    
$keywords=split_keywords($string,true,$partial_index,$is_date,$is_html);

    
add_verbatim_keywords($keywords$string$resource_type_field);        // add in any verbatim keywords (found using regex).

    
for ($n=0;$n<count($keywords);$n++)
        {
        unset (
$kwpos);
        if (
is_array($keywords[$n])){
            
$kwpos=$keywords[$n]['position'];
            
$keywords[$n]=$keywords[$n]['keyword'];
        }        
        
$kw=$keywords[$n]; 
        if (!isset(
$kwpos)){$kwpos=$n;}
        
remove_keyword_from_resource($ref,$keywords[$n],$resource_type_field,$optional_column='',$optional_value='',false$kwpos);
        }    
    }

This article was last updated 28th June 2022 15:05 Europe/London time based on the source file dated 27th June 2022 12:50 Europe/London time.