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 1777 to 1806

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 16th June 2026 20:05 Europe/London time based on the source file dated 16th June 2026 15:20 Europe/London time.