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.
Options

[Solved] how do i move it to DiscussionController_AuthorInfo_Handler ?

jeongweejeongwee Vanilla version 2.6 ✭✭
edited August 2013 in Vanilla 2.0 - 2.8

i tryed to remove the lines

public function DiscussionController_AfterReactions_Handler($Sender, $Args) {

        Gdn::Controller()->FireEvent('BeforePeregrineReactions');
        $CountValues = array();

        $CountValues = $Sender->MyReactionCountData;
        $React[1] = T("");
        $TitleReact[1] = "Click me if the post is funny";
        $React[2] = T("");
        $TitleReact[2] = "Click me if the post made you say wow";
        $React[3] = T("");
        $TitleReact[3] = T("Click me if the post was informative");
        $React[4] = T("");
        $TitleReact[4] = T("Click me if the post was artistic or had great imagery");

        $RecordType = $Args['RecordType'];
        $RecordID = $Args['RecordID'];

        echo '';


        for ($x = 1; $x <= 4; $x++) {
            if (!isset($CountValues[$x]))
                $CountValues[$x] = 0;
            echo '<span class="ReactionCount';
            if ($CountValues[0] == $x) {
                echo " MyReactClick";
            }
            echo '">' . $CountValues[$x];

            echo '';

            $Image = Img("plugins/PeregrineReactions/design/images/ClickReaction-" . $x . ".png", array('alt' => 'reaction image', 'class' => "ProfilePhotoSmall"));

            echo '' . $Image . " " . $React[$x] . ' ';
        }
        echo ' ';
    }

and change the lines

 public function DiscussionController_AuthorInfo_Handler($Sender) {
    $AuthorInfo = $Sender->EventArguments['Author'];
    $totalreactionpoints = $AuthorInfo->PeregrineReactOne + $AuthorInfo->PeregrineReactTwo + $AuthorInfo->PeregrineReactThree + $AuthorInfo->PeregrineReactFour;
    echo sprintf(T('Total Reaction Points: %1s'), $totalreactionpoints);
    }

to

 public function DiscussionController_AuthorInfo_Handler($Sender, $Args) {

        Gdn::Controller()->FireEvent('BeforePeregrineReactions');
        $CountValues = array();

        $CountValues = $Sender->MyReactionCountData;
        $React[1] = T("");
        $TitleReact[1] = "Click me if the post is funny";
        $React[2] = T("");
        $TitleReact[2] = "Click me if the post made you say wow";
        $React[3] = T("");
        $TitleReact[3] = T("Click me if the post was informative");
        $React[4] = T("");
        $TitleReact[4] = T("Click me if the post was artistic or had great imagery");

        $RecordType = $Args['RecordType'];
        $RecordID = $Args['RecordID'];

        echo '';


        for ($x = 1; $x <= 4; $x++) {
            if (!isset($CountValues[$x]))
                $CountValues[$x] = 0;
            echo '<span class="ReactionCount';
            if ($CountValues[0] == $x) {
                echo " MyReactClick";
            }
            echo '">' . $CountValues[$x];

            echo '';

            $Image = Img("plugins/PeregrineReactions/design/images/ClickReaction-" . $x . ".png", array('alt' => 'reaction image', 'class' => "ProfilePhotoSmall"));

            echo '' . $Image . " " . $React[$x] . ' ';
        }
        echo ' ';
    }

after i done this , i refreshed my webpage.then Peregrine Reactions show at there.but it just moved not actualy working.when i clicking on it ,i got a alert "Too Few Args - Invalid."

image

my plugins\PeregrineReactions\default.php file is below here,just change the txt to php.can anyone tell me how do i fix it ,thx

Comments

  • Options
    TamaTama United Kingdom ✭✭✭

    what exactly are you trying to do with the plugin?

    There was an error rendering this rich post.

  • Options
    jeongweejeongwee Vanilla version 2.6 ✭✭

    @Tama
    move it to here , see the picture.

    move.png 378.9K
  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    You can't do it easily because that is there, .Reactions div for a purpose, you would need to edit something in the core files . I also think it is there for a reason. In the end of each comment or discussion so you do not have to scroll to the top to react.

    You can try using css to move it there .

  • Options
    jeongweejeongwee Vanilla version 2.6 ✭✭

    thx .. i use css absolute and relative did it.

Sign In or Register to comment.