Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

show the comment box only on last page of discussion

fh111fh111 ✭✭
edited May 2012 in Vanilla 2.0 - 2.8

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

Answers

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

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

Sign In or Register to comment.