1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Up Down Voting 1.0

Discussion in 'Plugins' started by Nick, Mar 2, 2010.

  1. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

    valMETNG and Sv9t like this.
  2. suamisoleh

    suamisoleh New Member

    Cannot download

    Hi Alan Shubuya

    I can't download updown_voting-1-0.zip. The link redirect me to login page each time.

    Can you help?


    Tq
     
  3. valMETNG

    valMETNG Administrator Staff Member Admin

    Updown voting flag it not working

    Fiddlesticks. I just noticed that, when you press on Flag It, the javascript doesn't show the flagging reasons and doesn't allow you to flag. (Curses javascript under his breath.) Is anyone who's on 1.5.2 have this working? As always with javascript, I'm at a loss as to where the problem is.
     
  4. valMETNG

    valMETNG Administrator Staff Member Admin

    updown_voting.js alert fixed

    I found the answer in the vote plugin, which uses this code:
    Code:
    	$(".alert_link").click(function () {	    
    		var target = $(this).parents('div').nextAll('div.show_post_extras').children('div.alert_choices');
                    target.fadeToggle();
                    return false;
            });
    ...instead of what is currently in updown_voting:
    Code:
    	// Show/Hide box 
    	$(".alert_link").click(function () {
    		var target = $(this).parents('div').next('div').children('div.alert_choices');
                    target.fadeToggle();
                    return false;
            });
    Perhaps there are some new div classes? Don't ask me to explain why it works, but it does. :)
     
  5. koft

    koft New Member

    Thanks

    Thanks this really helped me

    One more then, if more users mark a link as spam, the spam word gets concanated in the string

    For example
    IF 2 users have marked as spam, when i hover over the red flag it shows

    This post has been flagged by 2 users as Spam, Spam

    Has anyone experienced this error

    Also can we stop down voting once the count reached 0, what happens i the post rating goes in negative
     
  6. valMETNG

    valMETNG Administrator Staff Member Admin

    Today, Google sent me a visitor to a post (thank you Google), but the URL it sent the visitor to ended in /alert/2. I assume that means Google is spidering links from the function show_post_extras in this plugin. We might want to change the code in this function to:
    Code:
      echo "<li><a rel='nofollow' href='" . $h->url(array('page'=>$h->post->id, 'alert'=>1)) . "'>" . $h->lang["vote_alert_reason_1"]  . "</a></li>\n";
      echo "<li><a rel='nofollow' href='" . $h->url(array('page'=>$h->post->id, 'alert'=>2)) . "'>" . $h->lang["vote_alert_reason_2"]  . "</a></li>\n";
      echo "<li><a rel='nofollow' href='" . $h->url(array('page'=>$h->post->id, 'alert'=>3)) . "'>" . $h->lang["vote_alert_reason_3"]  . "</a></li>\n";
      echo "<li><a rel='nofollow' href='" . $h->url(array('page'=>$h->post->id, 'alert'=>4)) . "'>" . $h->lang["vote_alert_reason_4"]  . "</a></li>\n";
      echo "<li><a rel='nofollow' href='" . $h->url(array('page'=>$h->post->id, 'alert'=>5)) . "'>" . $h->lang["vote_alert_reason_5"]  . "</a></li>\n";
      echo "<li><a rel='nofollow' href='" . $h->url(array('page'=>$h->post->id, 'alert'=>6)) . "'>" . $h->lang["vote_alert_reason_6"]  . "</a></li>\n";
    
     
    shibuya246 likes this.
  7. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

    Thanks, I will add that in here and on Vote plugin
    Do you think we should remove the alert flags to be a separate plugin. They seem to be quite different to the voting system itself?
     
  8. valMETNG

    valMETNG Administrator Staff Member Admin

    You're asking the wrong guy :) My preference is always to have less plugins - not more. There are standard features that all CMSs should have, and if a user is logged in, I think flagging is one of them. So, to me, it should be part of core :)

    The only time flagging wouldn't be appropriate is if you don't allow users to login. But, as long as this is core functionality and the admin is the only one who logs in, it wouldn't make a difference as they aren't going to flag anything.
     
    shibuya246 likes this.
  9. UncleDanger

    UncleDanger New Member

    I tried to mod this plugin using Gunaxin's files, which seems to work, except that they cause an error instead of changing the vote tally.

    upload_2016-6-9_15-6-14.png

    Any thoughts?
     
  10. valMETNG

    valMETNG Administrator Staff Member Admin

    There are a few reasons why you might get an "err" with this plugin but probably the most common is simply upvoting twice. The plugin checks to see if a vote was already recorded and, if so, responds with "err." If you refresh the page and the upvote shows, it was just a double-clicking problem. If it doesn't, let me know and we can troubleshoot the Javascript error together.
     
  11. UncleDanger

    UncleDanger New Member

    Actually, I've had a change of heart. A little bit of fiddling with the original files, and I have something I think I prefer to the arrows.

    Thanks anyway though!
     
  12. valMETNG

    valMETNG Administrator Staff Member Admin

    Please see updates here for bug related to posts widget.
     
  13. robin007

    robin007 Well-Known Member

    When i down vote, post not move to latest page.
     

    Attached Files:

  14. valMETNG

    valMETNG Administrator Staff Member Admin

    Just to confirm I understand what you're saying: you have a post that had enough votes to be considered "top" (post_status in hotaru_posts = 'top') and appears only on your Popular/Top Posts page. Then you downvoted below the top threshold (which, according to your settings = 2 so the vote count now = 1) and the post doesn't show on the Latest page - it remains on the Popular page?

    The code that does this is lines 133-136 in /content/plugins/updown_voting/libs/UpdownVotingFunctions.php. Please look at the post_status on the post in the hotaru_posts table while the post in on the Popular page. Confirm that the post_status = 'top' and the post_votes_up >= 2.

    Then downvote the post and look again at the post_status - did it change to 'new' from 'top'? Also look at the post_votes_up column - did it change to the correct number?
     
  15. robin007

    robin007 Well-Known Member

    I set post 2 vote to popular.
    post get 2 votes, then it shows in front page.
    now post_status top
    then i remove vote, and put a down vote also. now post vote is 0 still not hide from popular page.
    still post_status top.
     
  16. valMETNG

    valMETNG Administrator Staff Member Admin

    Can you please replace line 98 of /content/plugins/updown_voting/updown_voting.php with the following and try again?
    Code:
    $updown_voting_settings = $h->getSerializedSettings('updown_voting');
     
  17. robin007

    robin007 Well-Known Member

    Still not hide from popular page
     

    Attached Files:

  18. valMETNG

    valMETNG Administrator Staff Member Admin

    Alright, let's try something else...

    Please replace line 69 in \content\plugins\updown_voting\javascript\updown_voting.js with the following:
    Code:
    $target_votes.html('err');alert(XMLHttpRequest.responseText);alert(XMLHttpRequest.errorThrown);
    Then add the following code to line 82 of \content\plugins\updown_voting\libs\UpdownVotingFunctions.php:
    Code:
    $content= "settings updown_voting_settings['use_demote'] = ".$updown_voting_settings['use_demote']. " and count_and_status->post_votes_up = ".$count_and_status->post_votes_up." and updown_voting_settings['votes_to_promote'] = ".$updown_voting_settings['votes_to_promote'];echo $content;
    Finally, replace line 135 of UpdownVotingFunctions.php with:
    Code:
    $h->db->query($h->db->prepare($sql, 'new', $post_id));echo "sql = ".$h->db->prepare($sql, 'new', $post_id);
    Now downvote a post that >= 2 and paste the Javascript alert messages that are displayed.
     
  19. robin007

    robin007 Well-Known Member

    now showing this message
    Untitled.png
     
  20. valMETNG

    valMETNG Administrator Staff Member Admin

    That's what I suspected - your settings aren't being either retrieved or brought over. Please put line 98 of \content\plugins\updown_voting\updown_voting.php back to the way it was. Next add the following code to line 99 of \content\plugins\updown_voting\updown_voting.php:
    Code:
    $msg = "settings before: ".print_r($updown_voting_settings, true)." -- settings after: ";$updown_voting_settings = $h->getSerializedSettings('updown_voting');$msg.=print_r($updown_voting_settings, true);echo $msg;exit;
    Then downvote a post and paste the Javascript alert messages that are displayed.
     

Share This Page