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

log_keyword_usage()

Description

Log which keywords are used in a search

Parameters

ColumnTypeDefaultDescription
$keywords array refs of keywords used in a search
$search_result
$search_results array result of the search

Location

include/search_functions.php lines 3376 to 3395

Definition

 
function log_keyword_usage($keywords$search_result)
    {
    if(
is_array($keywords) && count($keywords) > 0)
        {
        if(
array_key_exists('total'$search_result))
            {
            
$count $search_result['total'];
            }
        elseif(
is_array($search_result))
            {
            
$count count($search_result);
            }
            
        
$log_code = (!isset($count) || $count 'Keyword usage' 'Keyword usage - no results found');
        foreach(
$keywords as $keyword)
            {
            
daily_stat($log_code$keyword);
            }
        }
    }

This article was last updated 21st May 2024 21:35 Europe/London time based on the source file dated 13th May 2024 14:40 Europe/London time.