Guten Abend,
Ich hab ein Problem und zwar habe ich ein Star Rating System was eigentlich auch super funktioniert nur das Problem ist, dass man zur Zeit noch so oft bewerten kann wie man möchte da es keine IP Sperre gibt. Jetzt wollte ich fragen ob mir einer eventuell erklären kann wie ich eine IP Sperre hin bekomme.
Hier ist der Code:
PHP
		
					
				<head>
    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <script>
    // This is the first thing we add ------------------------------------------
    $(document).ready(function() {
        $('.rate_widget').each(function(i) {
            var widget = this;
            var out_data = {
                widget_id : $(widget).attr('id'),
                fetch: 1
            };
            $.post(
                'bewertung.php',
                out_data,
                function(INFO) {
                    $(widget).data( 'fsr', INFO );
                    set_votes(widget);
                },
                'json'
            );
        });
        $('.ratings_stars').hover(
            // Handles the mouseover
            function() {
                $(this).prevAll().andSelf().addClass('ratings_over');
                $(this).nextAll().removeClass('ratings_vote'); 
            },
            // Handles the mouseout
            function() {
                $(this).prevAll().andSelf().removeClass('ratings_over');
                // can't use 'this' because it wont contain the updated data
                set_votes($(this).parent());
            }
        );
        // This actually records the vote
        $('.ratings_stars').bind('click', function() {
            var star = this;
            var widget = $(this).parent();
            var clicked_data = {
                clicked_on : $(star).attr('class'),
                widget_id : $(star).parent().attr('id')
            };
            $.post(
                'bewertung.php',
                clicked_data,
                function(INFO) {
                    widget.data( 'fsr', INFO );
                    set_votes(widget);
                },
                'json'
            ); 
        });
    });
    function set_votes(widget) {
        var avg = $(widget).data('fsr').whole_avg;
        var votes = $(widget).data('fsr').number_votes;
        var exact = $(widget).data('fsr').dec_avg;
        window.console && console.log('and now in set_votes, it thinks the fsr is ' + $(widget).data('fsr').number_votes);
        $(widget).find('.star_' + avg).prevAll().andSelf().addClass('ratings_vote');
        $(widget).find('.star_' + avg).nextAll().removeClass('ratings_vote'); 
        $(widget).find('.total_votes').text( votes + ' Bewertungen (' + exact + ' rating)' );
    }
    // END FIRST THING
</script>Währe schön wenn mir einer helfen könnte.
Mfg Spassvogel
 
		