Collections functions
General functions
Node functions
Render functions
Theme permission functions
User 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 2064 to 2088

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 ."'":""));
        }
    
ps_query("update keyword set hit_count=hit_count-1 where ref=? limit 1",array("i",$keyref));
            
    }

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.