protected function getLastDownloads($limit=20)
    {
        $newDate = '02.02.1971';
        $oldDate = '01.01.1970';
        $viewDate = false;
        $arrLastDownloads = array();
        $objLastDownloads = \Database::getInstance()->prepare("SELECT `tstamp`, `filename`, `downloads`, `id`
                                                               FROM `tl_dlstats`
                                                               ORDER BY `tstamp` DESC, `filename`")
                                                    ->limit($limit)
                                                    ->execute();
        $intRows = $objLastDownloads->numRows;
        if ($intRows>0)
        {
            while ($objLastDownloads->next())
            {
                $viewDate = false;
                if ($oldDate != \Date::parse($GLOBALS['TL_CONFIG']['dateFormat'], $objLastDownloads->tstamp))
                {
                    $newDate  = \Date::parse($GLOBALS['TL_CONFIG']['dateFormat'], $objLastDownloads->tstamp);
                    $viewDate = $newDate;
                }
                $c4d = $this->check4details($objLastDownloads->id);
                $arrLastDownloads[] = array( \Date::parse($GLOBALS['TL_CONFIG']['datimFormat'], $objLastDownloads->tstamp)
                                           , $objLastDownloads->filename
                                           , $this->getFormattedNumber($objLastDownloads->downloads,0)
                                           , $viewDate
                                           , $objLastDownloads->id
                                           , $c4d
                                           , $objLastDownloads->downloads // for sorting
                                           , $objLastDownloads->tstamp // for sorting
                                           );
                $oldDate = $newDate;
            }
        }

        return $arrLastDownloads;
    }
protected function getLastDownloads($limit=20)
    {
        $newDate = '02.02.1971';
        $oldDate = '01.01.1970';
        $viewDate = false;
        $arrLastDownloads = array();
        $objLastDownloads = \Database::getInstance()->prepare("SELECT `tstamp`, `filename`, `downloads`, `id`
                                                               FROM `tl_dlstats`
                                                               ORDER BY `tstamp` DESC, `filename`")
                                                    ->limit($limit)
                                                    ->execute();
        $intRows = $objLastDownloads->numRows;
        if ($intRows>0)
        {
            while ($objLastDownloads->next())
            {
                $viewDate = false;
                if ($oldDate != \Date::parse($GLOBALS['TL_CONFIG']['dateFormat'], $objLastDownloads->tstamp))
                {
                    $newDate  = \Date::parse($GLOBALS['TL_CONFIG']['dateFormat'], $objLastDownloads->tstamp);
                    $viewDate = $newDate;
                }
                $c4d = $this->check4details($objLastDownloads->id);
                $arrLastDownloads[] = array( \Date::parse($GLOBALS['TL_CONFIG']['datimFormat'], $objLastDownloads->tstamp)
                                           , $objLastDownloads->filename
                                           , $this->getFormattedNumber($objLastDownloads->downloads,0)
                                           , $viewDate
                                           , $objLastDownloads->id
                                           , $c4d
                                           , $objLastDownloads->downloads // for sorting
                                           , $objLastDownloads->tstamp // for sorting
                                           );
                $oldDate = $newDate;
            }
        }

        return $arrLastDownloads;
    }
protected function getLastDownloads ( $ limit = 20 ) { $ newDate = '02.02.1971' ; $ oldDate = '01.01.1970' ; $ viewDate = false ; $ arrLastDownloads = array ( ) ; $ objLastDownloads = \ Database :: getInstance ( ) -> prepare ( "SELECT `tstamp`, `filename`, `downloads`, `id`
                                                               FROM `tl_dlstats`
                                                               ORDER BY `tstamp` DESC, `filename`" ) -> limit ( $ limit ) -> execute ( ) ; $ intRows = $ objLastDownloads -> numRows ; if ( $ intRows > 0 ) { while ( $ objLastDownloads -> next ( ) ) { $ viewDate = false ; if ( $ oldDate != \ Date :: parse ( $ GLOBALS [ 'TL_CONFIG' ] [ 'dateFormat' ] , $ objLastDownloads -> tstamp ) ) { $ newDate = \ Date :: parse ( $ GLOBALS [ 'TL_CONFIG' ] [ 'dateFormat' ] , $ objLastDownloads -> tstamp ) ; $ viewDate = $ newDate ; } $ c4d = $ this -> check4details ( $ objLastDownloads -> id ) ; $ arrLastDownloads [ ] = array ( \ Date :: parse ( $ GLOBALS [ 'TL_CONFIG' ] [ 'datimFormat' ] , $ objLastDownloads -> tstamp ) , $ objLastDownloads -> filename , $ this -> getFormattedNumber ( $ objLastDownloads -> downloads , 0 ) , $ viewDate , $ objLastDownloads -> id , $ c4d , $ objLastDownloads -> downloads // for sorting , $ objLastDownloads -> tstamp // for sorting ) ; $ oldDate = $ newDate ; } } return $ arrLastDownloads ; }
Get Last Downloadslist
@param numbner $limit    optional
@return array    $arrLastDownloads
Get Last Downloadslist