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.

Creating a pager in views/discussions/helper_functions.php

ShmizzleShmizzle New
edited November 2010 in Vanilla 2.0 - 2.8
I'm trying to display a pager on the discussions page next to all discussion titles for discussions that have multiple pages. The function I need to call is Pager->ToString(), but whenever I call this function (using $this-> or $Sender->) in my theme's views/discussions/helper_functions.php file, I get error messages from PHP.

When calling $this->Pager->ToString() I get:
Fatal error: Using $this when not in object context in /views/discussions/helper_functions.php on line 46
When calling $Sender->Pager->ToString(), I get:
Fatal error: Call to a member function ToString() on a non-object in /views/discussions/helper_functions.php on line 46
I'm able to call the function in views/discussion/index.php file, though.

Any ideas?


  • Options
    Bump. Anyone? My members find it to be a major pain to always have to enter a thread's first page first before being able to nav to a certain page (such as the last).
  • Options
    LincLinc Detroit Admin
    edited November 2010
    Pretty sure that a template file is not the correct place for making pagers. That should probably be done with a plugin up in the controller, then positioned within the theme.
Sign In or Register to comment.