Code Duplication    Length = 6-6 lines in 3 locations

include/ajax_rating.php 1 location

@@ 83-88 (lines=6) @@
80
$voted          = false;
81
$ip             = getenv('REMOTE_ADDR');
82
83
foreach ($ratingObjs as $ratingObj) {
84
    $current_rating += $ratingObj->getVar('rate');
85
    if ($ratingObj->getVar('ip') == $ip || ($uid > 0 && $uid == $ratingObj->getVar('uid'))) {
86
        $voted = true;
87
    }
88
}
89
90
//if ($voted) {
91
//    $output = "unit_long$itemid|" . _MD_PUBLISHER_VOTE_ALREADY . "\n";

rate.php 1 location

@@ 52-57 (lines=6) @@
49
$voted          = false;
50
$ip             = getenv('REMOTE_ADDR');
51
52
foreach ($ratingObjs as $ratingObj) {
53
    $current_rating += $ratingObj->getVar('rate');
54
    if ($ratingObj->getVar('ip') == $ip || ($uid > 0 && $uid == $ratingObj->getVar('uid'))) {
55
        $voted = true;
56
    }
57
}
58
//unset($ratingObj);
59
60
if ($voted) {

include/functions.php 1 location

@@ 914-919 (lines=6) @@
911
    $ip            = getenv('REMOTE_ADDR');
912
    $rating1       = $rating2 = $ratingWidth = 0;
913
914
    foreach ($ratingObjs as $ratingObj) {
915
        $currentRating += $ratingObj->getVar('rate');
916
        if ($ratingObj->getVar('ip') == $ip || ($uid > 0 && $uid == $ratingObj->getVar('uid'))) {
917
            $voted = true;
918
        }
919
    }
920
921
    $tense = $count == 1 ? _MD_PUBLISHER_VOTE_VOTE : _MD_PUBLISHER_VOTE_VOTES; //plural form votes/vote
922