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

truncate_join_field_value()

Description

Truncate the field for insertion into the main resource table field

Parameters

ColumnTypeDefaultDescription
$value string

Return

string

Location

include/resource_functions.php lines 6683 to 6708

Definition

 
function truncate_join_field_value($value)
    {
    global 
$resource_field_column_limit$server_charset;

    
$encoding 'UTF-8';

    if(isset(
$server_charset) && '' != $server_charset)
        {
        
$encoding $server_charset;
        }

    
$truncated_value mb_substr($value0$resource_field_column_limit$encoding);

    if(
$resource_field_column_limit >= strlen($truncated_value))
        {
        return 
$truncated_value;
        }

    
$more_limit $resource_field_column_limit;
    while(
$resource_field_column_limit strlen($truncated_value))
        {
        
$truncated_value mb_substr($value0, --$more_limit$encoding);
        }

    return 
$truncated_value;
    }

This article was last updated 19th March 2024 09:35 Europe/London time based on the source file dated 11th March 2024 14:25 Europe/London time.