• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Lack of interest Random resources (order clause)

cclaerhout

Well-known member
#1
Could you please add a random option to set the resources order inside the "getResources" function from the resources model (like you did for feature resources)? It will be useful for widgets.

Example:

Search:
PHP:
$orderClause = $this->prepareResourceOrderOptions($fetchOptions, 'resource.last_update DESC');
Replace with
PHP:
    if (!empty($fetchOptions['order']) && $fetchOptions['order'] == 'random')
     {
       $orderClause = 'ORDER BY RAND()';
     }
     else
     {
       $orderClause = $this->prepareResourceOrderOptions($fetchOptions, 'resource.last_update DESC');
     }