Code Duplication    Length = 6-7 lines in 2 locations

include/functions.php 2 locations

@@ 541-546 (lines=6) @@
538
539
    $arr    = array();
540
    $result = $xoopsDB->query($sql);
541
    while (list($lid, $cid, $published) = $xoopsDB->fetchRow($result)) {
542
        if (true == xtubeCheckGroups()) {
543
            ++$count;
544
            $published_date = ($published > $published_date) ? $published : $published_date;
545
        }
546
    }
547
548
    $child_count = 0;
549
    if ($get_child == 1) {
@@ 558-564 (lines=7) @@
555
                . ' OR b.cid=' . $arr[$i] . ')) GROUP BY a.lid, a.published, a.cid';
556
557
            $result2 = $xoopsDB->query($query2);
558
            while (list($lid, $published) = $xoopsDB->fetchRow($result2)) {
559
                if ($published == 0) {
560
                    continue;
561
                }
562
                $published_date = ($published > $published_date) ? $published : $published_date;
563
                ++$child_count;
564
            }
565
        }
566
    }
567
    $info['count']     = $count + $child_count;