1. 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)

Discussion in 'Resource Manager Closed Suggestions' started by cclaerhout, Nov 1, 2013.

  1. cclaerhout

    cclaerhout Well-Known Member

    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');
         }
     

Share This Page