Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test 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 6932 to 6957

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 4th December 2024 08:35 Europe/London time based on the source file dated 28th November 2024 12:10 Europe/London time.