Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

remove_keyword_from_resource()

Parameters

ColumnTypeDefaultDescription
$ref
$keyword
$resource_type_field
$optional_column ''
$optional_value ''
$normalized false
$position ''

Location

include/resource_functions.php lines 1949 to 1973

Definition

 
function remove_keyword_from_resource($ref,$keyword,$resource_type_field,$optional_column='',$optional_value='',$normalized=false$position='')
    {
    if(!
$normalized)
        {
        global 
$unnormalized_index;
        
$kworig=$keyword;
        
$keyword=normalize_keyword($keyword);
        if(
$keyword!=$kworig && $unnormalized_index)
            {
            
// $keyword has been changed by normalizing, also remove the original value
            
remove_keyword_from_resource($ref,$kworig,$resource_type_field,$optional_column='',$optional_value='',true);
            }
        }        
    
        
$keyref=resolve_keyword($keyword,truefalse);
    if (
$optional_column<>'' && $optional_value<>'')    # Check if any optional column value passed and include this condition
        
{
        
sql_query("delete from resource_keyword where resource='$ref' and keyword='$keyref' and resource_type_field='$resource_type_field'" . (($position!="")?" and position='" $position ."'":"") . " and $optional_column$optional_value");
        }
    else{
        
sql_query("delete from resource_keyword where resource='$ref' and keyword='$keyref' and resource_type_field='$resource_type_field'" . (($position!="")?" and position='" $position ."'":""));
        }
    
sql_query("update keyword set hit_count=hit_count-1 where ref='$keyref' limit 1");
            
    }

This article was last updated 15th July 2020 02:05 Europe/London time based on the source file dated 13th July 2020 14:40 Europe/London time.