Howdy, Stranger!

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

Try Vanilla Forums Cloud product

In this Discussion

Ready to contribute?

Amazing! Sign our contributors' agreement and then join us on GitHub.

Vanilla is proud to present version 2.2.
Please upgrade to 2.1.x here. The 2.0 branch is no longer being updated.

show the comment box only on last page of discussion

fh111fh111 Vanilla Padawan ✭✭
edited May 2012 in Vanilla 2.0 Help

how would it work?

i am in /views/discussion/index.php and i guess i could put a && condition in there checking if on last page. i just don't get it enough yet to know what to put

} else if ($Session->IsValid() && $Session->CheckPermission('Vanilla.Comments.Add', TRUE, 'Category', $this->Discussion->PermissionCategoryID)) {
   echo $this->FetchView('comment', 'post');

any help appreciated, thanks


  • peregrineperegrine MVP
    edited May 2012

    look in vanilla/applications/dashboard/modules/classpagermodule.php for guidance
    if you

    if ($PagerOptions["RecordCount"] >  $PagerOptions["CurrentRecords"])
      // probably means you are on the lastpage.

    there is also a function if you can figure out how to access it.

        * Whether or not this is the last page of the pager.
        * @return bool True if this is the last page.
       public function LastPage() {
          return $this->Offset + $this->Limit >= $this->TotalRecords;

    someone with more knowledge could probably tell you more ..

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • fh111fh111 Vanilla Padawan ✭✭

    interesting, thanks! i'll take a look at this when i have a minute

Sign In or Register to comment.