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.

How to add plugin "Discussion Inserts 0.1" on all dicussions

I will like to add "Discussion Inserts 0.1" plugin on all discussions topics.
Please is it possible? How can I achieve that?

Tagged:

Comments

  • hgtonighthgtonight ∞ · New Moderator

    If you want the same message to appear on all discussions, I would suggest using a message or Pockets to place it.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Ok thank you for your reply

  • @hgtonight I won't be able to use neither message nor pockets to add the "discussion insert" information exactly before comment section just like "discussion insert" plugin. Is there a way you can modify "discussion insert" plugin to be added above all discussion comments

  • I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @peregrine thank you for your comment.
    I have installed "commentbodyinsert" plugin. It worked but did not solve my problem. "Discussion Inserts 0.1" plugin is the perfect plugin that I need but it works only on one discussion. I use it to add statement to encourage visitors to leave comments.
    I have attached two pictures to explain what I mean:

    1) Picture - Correct_Insert_by_discussion_insert_plugin
    2) Picture - Wrong_insert_by_commentbodyinsert_plugin


    I hope the pictures helps.
    My question now is how to modify "discussion insert" plugin to be able to add inserts on all the discussions on the forum.

    Thank you for your assistance.

  • peregrineperegrine MVP
    edited September 2014

    you need to style the Voice class in custom.css but this should work.

      <?php if (!defined('APPLICATION')) exit();
    
    
        // Define the plugin:
        $PluginInfo['AddVoice'] = array(
           'Name' => 'AddVoice',
           'Description' => 'Add Voice',
           'Version' => '1.0',
           'Author' => "Peregrine",
           'MobileFriendly' => TRUE,
        );
    
    
        class AddVoice extends Gdn_Plugin {
    
    
           public function DiscussionController_BeforeCommentForm_Handler($Sender) {
    
            echo '<p class="Voice"> This Discussion is Missing your voice" </p>';
    
        }
    
        }
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Where can I find the custom.css file? Please could you explain more in detail?
    Thank you for your time.

  • phreakphreak Vanilla*APP (White Label) & Vanilla*Skins Shop MVP

    @Prosper: The custom.css file is in your themes folder, if not simply create it and try if it works with something like

    body {background: red;}

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • peregrineperegrine MVP
    edited September 2014
    • create a folder under plugins called AddVoice

    like so /plugins/AddVoice

    • then cut and paste the above code in default.php

    so now you have /plugin/AddVoice/default.php

    • then in the theme you are using in the design folder.

    modify the custom.css

    add OR WHATEVER YOU WANT,

    .Voice {
    color: #d00
    border: 2px solid;
    border-radius: 25px;
    }
    

    have you considered searching on the forum "custom.css" or looked any theme tutorials.

    It been explained close to 5 billion times on the forum and the tutorials sections.

    If not, i would suggest you do so.

    but then again, here is your answer anyway.

    custom.css is in the design folder of all your themes. you change it on the themes

    I am available for paid consulting, if you don't like reading documentation or tutorials.

    http://vanillaforums.org/discussion/comment/210155/#Comment_210155

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • you could also use

    http://vanillaforums.org/addon/addtexttobox-plugin

    it would be closer to the post button.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @phreak and @peregrine , thank you for your comments. I created the folder design and add the file custom.css

    @peregrine - I have done as you directed but got this error message "There was an error getting the class methods." when I click on enable button for "AddVoice" plugin.
    Please how do I solve this?

  • extract the zip and copy it exactly.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Thanks now the plugin "AddVoice" is enabled and working fine.
    Thank you once more.

  • Sorry I just noticed that the "AddVoice" plugin shows up only when users are signed in on the forum.
    The idea is for the word (AddVoice) to show and encourage people to sign in or register to comment. So I will need the AddVoice to show up just above the "Sign In or Register to comment" line. Thanks.

  • peregrineperegrine MVP
    edited September 2014

    replace the code with

    from
    public function DiscussionController_BeforeCommentForm_Handler($Sender) {

    to

    public function DiscussionController_AfterComments_Handler($Sender) {

    my free consulting time has expired. you know how you can renew it :)

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @peregrine. Thank you for your great support.
    AddVoice plugin now works perfectly.

Sign In or Register to comment.