Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions

get_related_keywords()

Parameters

ColumnTypeDefaultDescription
$keyref

Location

include/search_functions.php lines 2616 to 2636

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$related_keywords_cache;

    if (isset(
$related_keywords_cache[$keyref])) {
        return 
$related_keywords_cache[$keyref];
    } else {
        if (
$keyword_relationships_one_way) {
            
$related_keywords_cache[$keyref] = ps_array("SELECT related value FROM keyword_related WHERE keyword = ?", array("i"$keyref),"keywords_related");
            return 
$related_keywords_cache[$keyref];
        } else {
            
$related_keywords_cache[$keyref] = ps_array("SELECT keyword value FROM keyword_related WHERE related = ? UNION SELECT related value FROM keyword_related WHERE (keyword = ? OR keyword IN (SELECT keyword value FROM keyword_related WHERE related = ?)) AND related <> ?", array("i"$keyref"i"$keyref"i"$keyref"i"$keyref),"keywords_related");
            return 
$related_keywords_cache[$keyref];
        }
    }
}

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