Пример #1
0
 $Commits = new CommitsByTreeLocation($db);
 $Commits->UserIDSet($User->id);
 if ($sqlSetAll) {
     if ($Debug) {
         echo 'invoking TreePathConditionSetAll() with ' . $sqlUserSpecifiedCondition;
     }
     $Commits->TreePathConditionSetAll($sqlUserSpecifiedCondition);
 } else {
     if ($Debug) {
         echo 'invoking TreePathConditionSet() with ' . $sqlUserSpecifiedCondition;
     }
     $Commits->TreePathConditionSet($sqlUserSpecifiedCondition);
 }
 $Commits->Debug = $Debug;
 if (substr($query, 0, 7) == '/ports/') {
     $NumberOfCommits = $Commits->GetCountPortCommits();
 } else {
     $NumberOfCommits = $Commits->GetCountCommits();
 }
 if ($Debug) {
     echo 'number of commits = ' . $NumberOfCommits . "<br>\n";
 }
 $NumFound = $NumberOfCommits;
 $params = array('mode' => 'Sliding', 'perPage' => $PageSize, 'delta' => 5, 'totalItems' => $NumFound, 'urlVar' => 'page', 'currentPage' => $PageNumber, 'spacesBeforeSeparator' => 1, 'spacesAfterSeparator' => 1);
 $Pager =& Pager::factory($params);
 $offset = $Pager->getOffsetByPageId();
 $NumOnThisPage = $offset[1] - $offset[0] + 1;
 if ($PageNumber > 1) {
     $Commits->SetOffset($offset[0] - 1);
 }
 $Commits->SetLimit($PageSize);