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 3350 to 3369

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 27th April 2024 12:05 Europe/London time based on the source file dated 25th April 2024 17:25 Europe/London time.