Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter
Support for Vanilla Forums Cloud product

In this Discussion

Follow Us


remove VOTE from voting plugin

shozen1shozen1 New
edited February 2012 in Questions
This discussion is related to the Voting addon.

Maybe a strange question but can anyone tell me how to remove VOTE from the voting plugin. I only need it to display comments, follows, views

thanks for your help in advance

Tagged:

Answers

  • sahotataransahotataran Developer, Bay Area - CA ✭✭✭

    use CSS. get the element of the votes by using FIREBUG in FIREFOX and give that element display:none

    Theme Charcha for great desktop and mobile experience! - drop me a message :)

  • shozen1shozen1 New
    edited February 2012

    Thanks for your reply sahotataran

    The built in chrome 'inspect element' does the same thing but I was assuming this would be in a php file as I want to completely get rid of the code being used to display votes both in discussions and in comments by the users.

  • sahotataransahotataran Developer, Bay Area - CA ✭✭✭

    messing around with code is a difficult job. and also if in future you need to update the plugin to match the latest version in future then you will not have to go through the code again - you know what to do - just find that element and hide it - all done - otherwise you will have to mess with the latest code again :)

    Theme Charcha for great desktop and mobile experience! - drop me a message :)

  • yes, you DO have a point. I will take your advice, thanks.

  • sahotataransahotataran Developer, Bay Area - CA ✭✭✭

    you r welcome :)

    Theme Charcha for great desktop and mobile experience! - drop me a message :)

  • I have a same idie with shozen, if you hide the element, it cause alot of CPU usages, I mean the page load time

  • 422422 Developer MVP
    edited February 2012

    Its easily removed , personally i dislike hiding functional code with css its a bad idea IMHO.

    However hiding it with display:none should not affect server resources whatsoever, as its a clientside function

    422 Real Estate Australia , now open Check it out

  • For what it's worth, I forked it and you can get it here. It should include only the PHP and CSS needed to show counts of follows, views, comments. No voting-related code anywhere.

    JoZ3_69
  • What exactly am I hiding? I would love to have this function, but I can't seem to find which file I should be editing.

  • @kobutsu I tried your version, but I end up with your version and the vote plugin version displaying at the same time. Any suggestions?

  • @422 could you tell me is it the voting.css I am editing. I have been at this one all day and put display: none just about every place possible and I can't hide voting at all.

  • 422422 Developer MVP

    Sorry, missed this. What do u want to achieve exactly.

    Incidentally. I always, copy css changes from other css files to my custom.css.

    Regaring hiding certain vote components, this can be done by hacking the plugin itself.

    422 Real Estate Australia , now open Check it out

  • @422 Yea I am trying to make it to where the voting, or votes is not displayed. That way only views, comments, and follows are displayed.

    How do you hack the plugin to accomplish this?

  • Ok I figured it out...I think. Please let me know if this will cause me problems later on or if this was a bad way to go about it.

    I went into class.voting.plugin.php and completely deleted the section entitled //Voting. I know in the comments above everyone was saying edit the CSS not PHP, but this is the only way I figured it out. However, I am pretty terrible with editing any type of sheet lol.

  • 422422 Developer MVP

    Ive done that before, had no issues. Sounds right.

    422 Real Estate Australia , now open Check it out

  • @Ender,

    What exactly did you remove? I tried removing a few different sections of that file and managed to remove the 'Vote' box from the categories page, but in each post there was still the voting button and the 'sort by' sectors...

    Cheers.

  • @ender: my plugin and Voting are incompatible. My plugin only offers a subset of what Voting does, though, so if you need voting, use Voting and not BigCount!

    (I've put a very little documentation about that, and how to accurately track view counts for BigCount or Voting, into the Readme here: https://github.com/kobutsu/BigCount/blob/master/README.md )

  • edited March 2012

    @Kobutsu: I installed your plugin, but doesn't seem to be displaying properly. Maybe the issue is the 'Embed Friendly' theme?

    http://imageshack.us/photo/my-images/836/screenshot20120309at931.png/

    Also unable to 'Disable' the plugin.

  • For those not 100% on CSS edit the voting.css file and add

    .VotesBox, .FollowsBox, {display: none !important;}

    If you want to remove the comment count aswell then add display:none; under ul.DataList div.Meta strong {

  • @joepc, do i just add that code anywhere in the file?

    also, will that remove the voting and follows?

  • ah nvm, just manually added it to all the spans i didn't want. crash course in css, ha.

  • peregrineperegrine MVP
    edited August 2012

    if you don't want to have to hide it with css and never have it sent or shown``

    just comment it out in the plugin. you don't have to mess with css.

    all you have to do is go into class.voting.plugin.php look around line 120. and add the two lines shown that say "add this line"

    /*  add this line
        // Votes
        if ($Session->IsValid()) {
            echo Wrap(Anchor(
                Wrap(T('Votes')) . Gdn_Format::BigNumber($CountVotes),
                '/vanilla/discussion/votediscussion/'.$Discussion->DiscussionID.'/'.$Session->TransientKey().'?Target='.urlencode($Sender->SelfUrl),
                '',
                array('title' => T('Vote'))
            ), 'div', array('class' => 'StatBox VotesBox'));
        } else {
            echo Wrap(Wrap(T('Votes')) . $CountVotes, 'div', array('class' => 'StatBox VotesBox'));
        }
    */  // add this line
    

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. Peregrine

  • fh111fh111 Vanilla Padawan ✭✭

    We were using Voting plugin like this for a while but i did not like that the ajax posting funtionality was compromised (when posting a comment for example)

    we are now happily using peregrines plugin AuthorTimeView (thanks @peregrine:) in combination with vanilla's built in bookmark discussion function.

    the only difference is that users don't see how many other user bookmarked a discussion, which is fine. apart from that discussion view is much cleaner now

  • @peregrine your way disables voting but the voting per comment in discussion still displays. how can I also remove it?

  • peregrineperegrine MVP
    edited January 2013
    • around line 208 either
    • add a return in the line below the function,
    • or remove the entire function totally (if you understand how to do that).

     public function DiscussionController_BeforeCommentMeta_Handler($Sender) {
     // add the line below           
      return;
    
    

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. Peregrine

    vrijvlinderbingyang
  • These replies are great about removing the counts on the index. But on each thread there is still a vote count option that I would like to remove. I am only using this mod to add the comments and views to the thread index.

  • peregrineperegrine MVP
    edited March 2013

    @insanemustang said: These replies are great about removing the counts on the index. But on each thread there is still a vote count option that I would like to remove. I am only using this mod to add the comments and views to the thread index.

    change in class.voting.plugin.php

    public function DiscussionController_BeforeCommentMeta_Handler($Sender) {
        // add the line below       
    return;
    
    

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. Peregrine

  • @peregrine I'm looking at that code, do I remove stuff, or just add this in there? Mine looks like this

    public function DiscussionController_BeforeCommentMeta_Handler($Sender) {
    //      if (!C('Plugins.Voting.Enabled'))
    //          return;
  • peregrineperegrine MVP
    edited March 2013
    public function DiscussionController_BeforeCommentMeta_Handler($Sender) {
    return; 
    // if (!C('Plugins.Voting.Enabled')) 
    // return;
    

    you could either remove the whole function, or leave everything intact with the one line addition.

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. Peregrine

Sign In or Register to comment.