We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8883
    • 59 Posts
    Earlier it was enough to add the rel="nofollow" (in <a href- tag) to stop counting bot-votes . Since a few weeks this method becomes senseless. Dozens of votes in resulting of 3 stars on average...
      • 2912
      • 315 Posts
      I was thinking about that but if its not going to work no need to try it. Although I did find this one: http://modxcms.com/forums/index.php/topic,24771.msg153606.html#msg153606 and it works a treat. I don’t think it will have the same problem. smiley
        BBloke
        • 4215
        • 5 Posts
        This average 3 star bot rating is making the snippet useless. It should be fixed.

        I looked around the net for solutions to get rid of the bots.
        The solution that I think is right for our case is by using javascript to pass the voting parameters to the snippet. Most bots can’t interpret javascript (it will cost them enormous computing power to do that). With the combination that they don’t have screens, this becomes the safest bet at least for the next couple of years.

        The solutions that are discussed here won’t work.
        Google may not spider nofollow but other search engines will, spam pots also will spider nofollow links.
        AnythingRating snippet also isn’t fixing the issue. Look at the demos from his creator - they are all averaging around 3 stars. Yes it uses javascript but it also exposes the link with the parameters to the post freely. This can be easily fixed and it worked, I tried it. But I have some other reasons to not like that snippet.

        I tried fixing CSS Star Rating by using some simple AJAX to post the parameters and removing the post url from the resulting html. It works, but it’s not truly what it should be - an AJAX rating snippet. I have to refresh the page to get the new actual vote and to disallow new voting - far from an AJAX solution.
        I tried calling only the snippet from javascript via index-ajax.php but the snippet starts showing some errors and things get complicated.

        For now I can use my simple crippled AJAX solution but I would like to make it fully AJAX.
          • 5811
          • 1,717 Posts
          Hi all,

          This average 3 star bot rating is making the snippet useless. It should be fixed.
          I am ready to provide a new version of AnythingRating, if one of you give me the solution to avoid the bot rating. By lack of time, I haven’t follow all the discussion regarding this subject. So, I appreciate if one of you have a suggestion to solve this kind of issue. Thanks.
            • 36416
            • 589 Posts
            Quote from: coroico at Feb 09, 2009, 05:50 PM

            This average 3 star bot rating is making the snippet useless. It should be fixed.
            I am ready to provide a new version of AnythingRating, if one of you give me the solution to avoid the bot rating. By lack of time, I haven’t follow all the discussion regarding this subject. So, I appreciate if one of you have a suggestion to solve this kind of issue. Thanks.

            Just give every potential voting link rel="nofollow" attribute.
              • 5340
              • 1,624 Posts
              Hi guys,

              I just started using this snippet with Evo.

              I have a couple of questions:

              1. How would you implement a section called "Most Votes". Right now I;m using Ditto and I do not see a way to sort based on star_rating TV
              2. How would you restrict voting to registered users only

              Thank You

              PS: Were the problems mentioned above(Bot related) fixed in the latest version for Evo?
              • For item 1, I’ve attached a Ditto extender that I coded up for one of our clients ...

                Note: The extender assumes that your star rating TV is called ‘star_rating’ - if it’s different, then the reference will need to be updated in the extender file.

                To use the extender, please follow these steps:

                • Copy the attached extender file (remove the .txt extension first) into: assets/snippets/ditto/extenders/
                • In your snippet call for Ditto, add: &extenders=`star_rating`

                The extender does two things. Firstly, it does the sorting and secondly, it sets a star_rating_val placeholder to use in your Ditto template. For example, you could have this in your Ditto template:
                ([+star_rating_val+] out of 5 stars)


                For item 2, your best bet is to create a wrapper snippet that checks the logged-in user’s group and then, using $modx->runSnippet(), either renders the full voting output or the read-only output depending on if they’re allowed to vote or not.
                  Garry Nutting
                  Senior Developer
                  MODX, LLC

                  Email: [email protected]
                  Twitter: @garryn
                  Web: modx.com
                  • 5340
                  • 1,624 Posts
                  Thx garry

                  I’ll have a look at your extender.
                  I assume it can be easily extended to output the best 10 rated companies instead of most voted
                    • 22840
                    • 1,572 Posts
                    * Copy the attached extender file (remove the .txt extension first) into: assets/snippets/ditto/extenders/
                    * In your snippet call for Ditto, add: &extenders=`star_rating`

                    Just tried the extender and am getting the following error:

                    « MODx Parse Error »
                    MODx encountered the following error while attempting to parse the requested resource:
                    « PHP Parse Error »

                    PHP error debug
                    Error: Division by zero
                    Error type/ Nr.: Warning - 2
                    File: /home/campsite/public_html/assets/snippets/ditto/extenders/star_rating.extender.inc.php
                    Line: 26
                    Line 26 source: $rating = round($vals[0]/$vals[1], 2);

                    Parser timing
                    MySQL: 0.0048 s (9 Requests)
                    PHP: 0.0391 s
                    Total: 0.0439 s

                    Any ideas anyone ??
                      • 5340
                      • 1,624 Posts
                      It seems that $vals[1] is 0

                      Can you check that for the document you receive this error you do not have a 0 after :?

                      I think it’s either nothing or something like 3:1(more then 0)