Ejemplo n.º 1
0
/*
    Param: orderBy

    Purpose:
    Sort the result set

    Options:
    Any valid MySQL style orderBy statement

    Default:
    createdon DESC
*/
//-------------------------------------------------------------------- */
$templates = $ditto->template->process($templates);
// parse the templates for TV's and store them for later use
$ditto->setDisplayFields($ditto->template->fields, $hiddenFields);
// parse hidden fields
$ditto->parseFields($placeholders, $seeThruUnpub, $dateSource, $randomize);
// parse the fields into the field array
$documentIDs = $ditto->determineIDs($IDs, $idType, $ditto->fields["backend"]["tv"], $orderBy, $depth, $showPublishedOnly, $seeThruUnpub, $hideFolders, $hidePrivate, $showInMenuOnly, $where, $keywords, $dateSource, $queryLimit, $display, $filter, $paginate, $randomize);
// retrieves a list of document IDs that meet the criteria and populates the $resources array with them
$count = count($documentIDs);
// count the number of documents to be retrieved
$count = $count - $offset;
// handle the offset
if ($count > 0) {
    // if documents are returned continue with execution
    $total = $total == "all" ? $count : min($total, $count);
    // set total equal to count if all documents are to be included
    $display = $display == "all" ? min($count, $total) : min($display, $total);
    // allow show to use all option