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.

YagaDiscussionHeaderBadges 0.1.2 : plugin not found

Vanilla 2.2
Theme Bootstrap
Serveur de Test : http://88.181.151.128:8080/

Hi all,

I just put in my plugin folder your new version.

Since it no longer appears in the list of plugins

I emptied the cache and it's always the same

Thank for your answers

Tof

Comments

  • I think there are some problems , replace all in the class.YagaDiscussionHeaderBadges.php

    with this and make sure the folder has the same name. Report if that worked..

    <?php if (!defined('APPLICATION')) exit();
    
    // Define the plugin:
    $PluginInfo['YagaDiscussionHeaderBadges'] = array(
       'Name'=> 'YagaDiscussionHeaderBadges',
       'Description' => 'This plugin shows badges in the AuthorInfo of a discussion header.',
       'Version' => '0.1.3',
       'Author' => "Martin Wahnschaffe",
       'AuthorEmail' => 'martin@imagineearth.info',
       'AuthorUrl' => 'http://www.imagineearth.info'
       'License'     => 'GPLv3',
    );
    
    
    class YagaDiscussionHeaderBadges_Plugin extends Gdn_Plugin {
    
      /**
        * Base_Render_Before Event Hook
        *
        * This is a common hook that fires for all controllers (Base), on the Render method (Render), just 
        * before execution of that method (Before). It is a good place to put UI stuff like CSS and Javascript 
        * inclusions. Note that all the Controller logic has already been run at this point.
        *
        * @param $Sender Sending controller instance
        */
      public function Base_Render_Before($Sender) {
        $Sender->AddCssFile($this->GetResource('design/badges.css', FALSE, FALSE));
      }
    
      public function DiscussionController_AuthorInfo_Handler($Sender, $Args) {
            // Get the user object from the controller, I am just guessing with this line
        $UserID = $Sender->EventArguments['Author']->UserID;
    
        $BadgeAwardModel = Yaga::BadgeAwardModel();
            $Badges = $BadgeAwardModel->GetByUser($UserID);
    
        foreach($Badges as $Badge) {
            echo Anchor(
                Img($Badge['Photo']),
                'badges/detail/' . $Badge['BadgeID'] . '/' . Gdn_Format::Url($Badge['Name']),
                array('title' => $Badge['Name']),
                array('class' => 'DiscussionHeaderBadge')
            );
         }
      }
    }
    
  • Hello my friend,

    I just tested with your code. It still does not work.

    I just put the 0.1.1 release. This version works very well with VANILLA 2.2

  • jackmaessenjackmaessen ✭✭✭
    edited March 2016

    version 0.1.2 should work also fine but there are some typos in the "define"

    version 0.1.1

    <?php if (!defined('APPLICATION')) exit();
    
    // Define the plugin:
    $PluginInfo['YagaDiscussionHeaderBadges'] = array(
       'Description' => 'This plugin shows badges in the AuthorInfo of a discussion header.',
       'Version' => '0.1.1',
       'Author' => "Martin Wahnschaffe",
       'AuthorEmail' => 'martin@imagineearth.info',
       'AuthorUrl' => 'http://www.imagineearth.info'
    );
    

    version 0.1.2

        ya<?php if (!defined('APPLICATION')) exit();
    
        // Define the plugin:
        $PluginInfo['YagaDiscussionHeaderBadges'] = array(
           'Description' => 'This plugin shows badges in the AuthorInfo of a discussion header.',
           'Version' => '0.1.2',
           'Author' => "Martin Wahnschaffe",
           'AuthorEmail' => 'martin@imagineearth.info',
           'AuthorUrl' => 'http://www.imagineearth.info'
           'License'     => 'GPLv3',
        );
    

    See the ya on line 1 and missing comma after 'AuthorUrl' => 'http://www.imagineearth.info'

Sign In or Register to comment.