Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

get_related_keywords()

Parameters

ColumnTypeDefaultDescription
$keyref

Location

include/search_functions.php lines 2252 to 2273

Definition

 
function get_related_keywords($keyref)
    {
    
debug_function_call("get_related_keywords"func_get_args());

    
# For a given keyword reference returns the related keywords
    # Also reverses the process, returning keywords for matching related words
    # and for matching related words, also returns other words related to the same keyword.
    
global $keyword_relationships_one_way;
    global 
$related_keywords_cache;
    if (isset(
$related_keywords_cache[$keyref])){
        return 
$related_keywords_cache[$keyref];
    } else {
        if (
$keyword_relationships_one_way){
            
$related_keywords_cache[$keyref]=sql_array("select related value from keyword_related where keyword='$keyref'");
            return 
$related_keywords_cache[$keyref];
            }
        else {
            
$related_keywords_cache[$keyref]=sql_array("select keyword value from keyword_related where related='$keyref' union select related value from keyword_related where (keyword='$keyref' or keyword in (select keyword value from keyword_related where related='$keyref')) and related<>'$keyref'");
            return 
$related_keywords_cache[$keyref];
            }
        }
    }

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