Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Vanilla Voting 0.2beta

2

Comments

  • Check in your conf/extensions.php, sometimes add-ons must be called in a particular order. Try to call jQuery before Voting.
  • Thanks but it is above Voting when enabled:

    include($Configuration['EXTENSIONS_PATH']."JQuery/default.php");
    include($Configuration['EXTENSIONS_PATH']."VanillaVoting/default.php");
  • i have the similar problem as well, but with this error from firebug:

    $.post is not a function
    AddCommentVote("extensions/VanillaVoting/library/AddVote.php", 5, 1, 0, "970d3c484e2c1ca925ce169748619d58")AddVote.js.php (line 29)
    onclick(click clientX=0, clientY=0)comments.php (line 1)
    [Break on this error] function(data) {


    i followed the steps that cre8d listed and JQuery is loaded before vanillavoting in conf/extensions.php.

    so i just wondering what is $.post does?, i have looked the AddVote.js.php, it seems take the following arguments:

    $.post(AjaxURL, {'CommentID': CommentID, 'Vote': Vote, 'CurrentTotalVotes': CurrentTotalVotes, 'PostBackKey': PostBackKey },
  • Has anyone gotten this working on 1.1.4?
  • strangely when i disable jquery plugin, the voting seems to work( i checked the source of this plugin, it does contain jquery source code, so i guess there is no point to install jquery before this plugin).

    by the way, my version of vanilla is 1.1.4.
  • Notice: Undefined index: Vote in /home/content/.../Framework.Class.SqlBuilder.php Notice: Undefined index: UserDiscussionVote in /home/content/.../library/ Framework/Framework.Functions.php A fatal, non-recoverable error has occurred Technical information (for support personel): Error Message An error occurred while retrieving discussions. Affected Elements DiscussionManager.GetDiscussionList(); The error occurred on or near: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as TotalDiscussionVotes, UserDiscussionVote. as Vote from LUM_Discussion t left' at line 1

    could somebody help me with this error? i had it installed at one time it worked perfectly but after moving databases; exporting and importing the data ..i get this error. very creative extension!
  • i really hate that i can't get this to work anymore.
  • i simply have no idea why it is no longer working. it is so frustrating! ..i'm whining aren't i?
  • i think i may have figured out the problem. i have installed vanilla version: 1.1.4! does this addon require vanilla version: 1.1.1 or vanilla version: 1.1.4 with default theme for version: 1.1.1? it is very default troubleshooting software i know nothing about. is vanilla version: 1.1.1 still avalable someplace?
  • any news on this?
  • I got voting to work with 1.1.4 with a bit of hacking around jquery and it runs pretty smoothly now. Thank you very much for this. However, it would be very useful to have an option to enable hiding of comments for all users (just like comments on Digg.com). We are getting a lot of garbage in our comments (sometimes spam, but mostly off-topic messages which degrade discussions). We would really value an option to hide a comment if has been voted negative by more than 2-3 people (which might be a configurable value). The plugin does an wonderful job hiding comments for users that voted against them, but those who left the comment are not seeing it as hidden and as a result they continue their off-topic discussion.
  • airloacker, can you share how you solved the problems and your modified files if possible?
  • it simply doesn't work for me.
  • i have made this extension to work, finally! but the thing is it doesn't consolidate the total number of votes. for example, if in the discussion page, where all the posts are listed, you clicked a vote, a number will be added. then when you clicked on the title of the post and you are in the post itself, the vote number is still zero in the post, and this happens vice versa. Anyone here knows any solution for this? hope that this could be resolved because this is really a great extension! thanks in advance to anyone who could help me!
  • Hello there,
    I'm looking for a tool that allows star ratings (say 1-5) to comments. Is this something that I could build from this plug-in, or would I be better to start over?

    Any help or advice much appreciated.

    Jimmy.
  • Greetings everybody...
    Is there a way to sort discussions based on the number of votes it receives, so the most popular would on the top?
    Thanks a lot.

    Alex
  • you should look into the discussion manager, which function the discussion grid calls in order to retrieve the discussions to show on the front page

    then look when it builds the sql sentence for retrieving the DB data and sure there is a delegate (I haven't checked actually, but I'll bet on it) where you can attach a function that modifies the SQLBuilder instance adding the amount of votes as the "OrderBy" field

    edit:

    for the star rating system, ther is another addon to do that, I don't remember the real name, but it was something similar to Vanilla Vote, anyway run a search on the addon site ;)
  • Thanks for the input....
    Although if you could be more specific about where to find "discussion manager" would be really awesome!
    Thanks a bunch...
  • OK, I've finally had a little time to look into why this isn't working with my JQuery extension. The reason is that for some reason that's beyond me (I can't code JS) The JQuery JS code in Vanilla Voting does NOT like the var $j = jQuery.noConflict(); setting that I enable on the JQuery library. If you remove this line from my extension, then Vanilla Voting works.

    BUT

    This means that JQuery (and any dependant extensions) will now conflict with scriptaculous and moo tools based extensions (the Vanilla core is based on scriptaculous...).
  • FIXED IT!

    MSB, you may not like this solution, but it is a solution and it DOES work now, so people can now use Vanilla Voting with the JQuery extension and all of the other extensions that rely upon it!

    All I did was replace $ with jQuery (count of 24) and that seemed to do the trick. Sorry if you don't like this solution MSB, but it works until a more elegant one can be found ;)

    Copy and paste the following into AddVote.js.php overwriting EVERYTHING already in the file.<?php header("Content-Type: text/javascript"); include("../../../appg/settings.php"); include("../../../appg/init_vanilla.php"); global $Context; ?> function AddDiscussionVote (AjaxURL, DiscussionID, Vote, CurrentTotalVotes, PostBackKey) { jQuery.post(AjaxURL, {'DiscussionID': DiscussionID, 'Vote': Vote, 'CurrentTotalVotes': CurrentTotalVotes, 'PostBackKey': PostBackKey }, function(data) { if (data == 'Complete') { jQuery("li#Discussion_"+DiscussionID+" li.DiscussionVoteCount span:first-child").fadeTo('slow','0.1'); jQuery("li#Discussion_"+DiscussionID+" li.DiscussionVoteCount span:first-child").text(CurrentTotalVotes + Vote); if(Vote > 0) { jQuery("li#Discussion_"+DiscussionID+" li.DiscussionAddVote").html('<span class="VotedPositive"><input class="VotePositive" type="button" disabled="disabled"/><input class="VoteNegative" type="button" disabled="disabled"/></span>'); jQuery("li#Discussion_"+DiscussionID).addClass("VotedPositive"); } else if (Vote < 0) { jQuery("li#Discussion_"+DiscussionID+" li.DiscussionAddVote").html('<span class="VotedNegative"><input class="VotePositive" type="button" disabled="disabled"/><input class="VoteNegative" type="button" disabled="disabled"/></span>'); jQuery("li#Discussion_"+DiscussionID).addClass("VotedNegative"); } } else { alert('Adding vote to discussion did not work'); } jQuery("li#Discussion_"+DiscussionID+" li.DiscussionVoteCount span:first-child").fadeTo('slow','1'); } ); return false; }; function AddCommentVote (AjaxURL, CommentID, Vote, CurrentTotalVotes, PostBackKey) { jQuery.post(AjaxURL, {'CommentID': CommentID, 'Vote': Vote, 'CurrentTotalVotes': CurrentTotalVotes, 'PostBackKey': PostBackKey }, function(data) { if (data == 'Complete') { jQuery("li#Comment_"+CommentID+" span.CommentVoteCount").fadeTo('slow','0.1'); jQuery("li#Comment_"+CommentID+" span.CommentVoteCount").text(CurrentTotalVotes + Vote); if(Vote > 0) { jQuery("li#Comment_"+CommentID+" span.AddCommentVote").html('<span class="VotedPositive"><input class="VotePositive" type="button" disabled="disabled"/><input class="VoteNegative" type="button" disabled="disabled"/></span>'); } else if (Vote < 0) { jQuery("li#Comment_"+CommentID+" .CommentBody").slideUp('slow'); jQuery("li#Comment_"+CommentID+" span.AddCommentVote").html('<span class="VotedNegative"><input class="VotePositive" type="button" disabled="disabled"/><input class="VoteNegative" type="button" disabled="disabled"/></span>'); jQuery("li#Comment_"+CommentID+" span.CommentVoteCount").addClass('VotedNegative'); jQuery("li#Comment_"+CommentID).addClass('VotedNegative'); } } else { alert('Adding vote to comment did not work'); } jQuery("li#Comment_"+CommentID+" span.CommentVoteCount").fadeTo('slow','1'); } ); return false; }; function ShowComment (CommentID) { jQuery("li#Comment_"+CommentID+" .CommentBody").slideToggle('slow'); } jQuery(document).ready(function() { jQuery("li ul.VotedNegative").each(function() { jQuery(this).parent().addClass('VotedNegative'); }); jQuery("li span.VotedNegative").each(function() { jQuery(this).parent().parent().parent().addClass('VotedNegative'); jQuery("li.VotedNegative .CommentBody").hide(); }); });P.S. I've confirmed this working simultaneously with JQuery v15-1.2.6, JQThickBox v12-3.1, Mootools 1.8, User Info 2.1, Collapsible Panel 2.4 and a whole bunch of others that I have installed on my local test server.
Sign In or Register to comment.