Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter

Categories

In this Discussion

Who's Online 16

6apxatCurtisOdenHotBlacklortabac +12 guests

CalculateNumberOfPages() way too complicated

library/Framework/Framework.Functions.php @ line 118
function CalculateNumberOfPages($ItemCount, $ItemsPerPage) {
$PageCount = ceil($ItemCount/$ItemsPerPage);
return ForceInt($PageCount, 1);
}
I know it's only executed once per request, but inefficiency is my pet peeve. Even if it's just replacing 13 lines with 2. :)

Comments

  • Posts: 5,574
    how is this done at the moment? doesnt it have to take whispers etc into account or is that done to find itemcount?
  • The parameters this function is fed are determined by the respective controller, check out the source: Framework.Functions.php. Functions are generally in alphabetical order.
Sign In or Register to comment.