Code Duplication    Length = 7-7 lines in 2 locations

ratevideo.php 2 locations

@@ 43-49 (lines=7) @@
40
    $result = $xoopsDB->query(
41
        'SELECT cid, submitter FROM ' . $xoopsDB->prefix('xoopstube_videos') . ' WHERE lid=' . intval($lid)
42
    );
43
    while (list($cid, $ratinguserDB) = $xoopsDB->fetchRow($result)) {
44
        if ($ratinguserDB == $ratinguser) {
45
            $ratemessage = _MD_XOOPSTUBE_CANTVOTEOWN;
46
            redirect_header('singlevideo.php?cid=' . intval($cid) . '&lid=' . intval($lid), 4, $ratemessage);
47
            exit();
48
        }
49
    }
50
    // Check if REG user is trying to vote twice.
51
    $result = $xoopsDB->query(
52
        'SELECT cid, ratinguser FROM ' . $xoopsDB->prefix('xoopstube_votedata') . ' WHERE lid=' . intval($lid)
@@ 54-60 (lines=7) @@
51
    $result = $xoopsDB->query(
52
        'SELECT cid, ratinguser FROM ' . $xoopsDB->prefix('xoopstube_votedata') . ' WHERE lid=' . intval($lid)
53
    );
54
    while (list($cid, $ratinguserDB) = $xoopsDB->fetchRow($result)) {
55
        if ($ratinguserDB == $ratinguser) {
56
            $ratemessage = _MD_XOOPSTUBE_VOTEONCE;
57
            redirect_header('singlevideo.php?cid=' . intval($cid) . '&lid=' . intval($lid), 4, $ratemessage);
58
            exit();
59
        }
60
    }
61
} else {
62
    // Check if ANONYMOUS user is trying to vote more than once per day.
63
    $yesterday = (time() - (86400 * $anonwaitdays));