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

save_related_keywords()

Parameters

ColumnTypeDefaultDescription
$keyword
$related

Location

include/search_functions.php lines 2668 to 2685

Definition

 
function save_related_keywords($keyword,$related)
    {
    
debug_function_call("save_related_keywords"func_get_args());

    
$keyref resolve_keyword($keywordtruefalsefalse);
    
$s=trim_array(explode(",",$related));

    
ps_query("DELETE FROM keyword_related WHERE keyword = ?", array("i",$keyref));
    if (
trim($related)!="")
        {
        for (
$n=0;$n<count($s);$n++)
            {
            
ps_query("insert into keyword_related (keyword,related) values (?,?)",array("i",$keyref,"i",resolve_keyword($s[$n],true,false,false)));
            }
        }
    
clear_query_cache("keywords_related");
    return 
true;
    }

This article was last updated 9th September 2024 21:05 Europe/London time based on the source file dated 17th July 2024 15:30 Europe/London time.