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

dash_tile_featured_collection_get_top_resources()

Parameters

This function accepts no parameters.

Location

include/dash_functions.php lines 1907 to 1936

Definition

 
function dash_tile_featured_collection_get_top_resources() 
{
    global 
$view_title_field;

    
$resources ps_array("SELECT 
        DISTINCT r.ref `value`
            FROM collection_resource cr 
                JOIN resource r ON r.ref = cr.resource
                JOIN collection c ON c.ref = cr.collection
            WHERE c.type = ? 
            ORDER BY r.hit_count DESC
        "
, ['i'COLLECTION_TYPE_FEATURED], "schema");
    
$resource_data get_resource_data_batch($resources);
    
$count 0;
    
$return = [];
    foreach (
$resource_data as $resource)  {
        if (
resource_download_allowed($resource['ref'], 'thm'$resource['resource_type'])) {
            
$count++;
            
$return[] = [
                
'ref'                           => $resource['ref'],
                
'title'                         => get_data_by_field($resource['ref'], $view_title_field),
                
'resource_type'                 => $resource['resource_type']
            ];
        }
        if (
$count >=3) {
            break;
        } 
    }
    return 
$return;
}

This article was last updated 27th May 2026 15:35 Europe/London time based on the source file dated 27th May 2026 13:05 Europe/London time.