Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

CalculateNumberOfPages() way too complicated

edited January 2009 in Vanilla 1.0 Help
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

  • 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.