HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

I want to add leaderboard to another page

edited April 2020 in Vanilla 3.x Help

I make a empty page using vchat plugin.

Now I want to add leader board to it.

how to add smarty functions to it.

{module name="LeaderBoardModule" SlotType="w"}


  • Options


  • Options
    R_JR_J Ex-Fanboy Munich Admin

    That requires some changes in the plugins files. You can either transform the view to a Smarty template file or add the module with Vanilla code.

    I would try opening the default.php file and add those lines right below the line public function PluginController_VChat_Create($Sender) {

    $LeaderBoardModule = new LeaderBoardModule($Sender);
    $Sender->AddData('LeaderBoardModule', $leaderBoardModule);

    In the views/vchat.php you can add the following line:

    <?php echo $this->Data('LeaderBoardModule')->ToString(); ?>

    Not sure if this works, though...

  • Options
      public function PluginController_VChat_Create($Sender) {
          $Session = Gdn::Session();
               $LeaderBoardModule = new LeaderBoardModule($Sender);
               $Sender->AddData('LeaderBoardModule', $leaderBoardModule);
               $Sender->AddCssFile('videochat.css', 'plugins/VChat');
               $Sender->MasterView = 'default';

    Added this but not working..

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    I've misspelled something. It should be that line:

    $Sender->AddData('LeaderBoardModule', $LeaderBoardModule);

  • Options

    Still not working "We've run into a problem and are unable to handle this request right now.

    Please check back in a little while."

    190:         // Make sure that $ActualMethodName exists before continuing:
    191:         if (!method_exists($this, $actualMethodName)) {
    192:             // Make sure that a plugin is not handling the call
    193:             if (!Gdn::pluginManager()->hasNewMethod($className, $referenceMethodName)) {
    194:                 throw new \BadMethodCallException(
    195:                     "The \"$className\" object does not have a \"$actualMethodName\" method.",
    196:                     501
    197:                 );
    198:             }

  • Options

    @R_J do I have another way to do this?

Sign In or Register to comment.