Code Duplication    Length = 5-5 lines in 2 locations

blocks/xoopsfaq_rand.php 1 location

@@ 67-71 (lines=5) @@
64
            unset($catsToUse[$key]);
65
        }
66
    }
67
    if (!empty($catsToUse)) {
68
        $criteria->add(new Criteria('contents_cid', '(' . implode(',', $catsToUse) . ')', 'IN'));
69
    } else {
70
        return $block;
71
    }
72
    $xpFaqObjArray = $xfFaqHandler->getAll($criteria);
73
    $faqCount      = (is_array($xpFaqObjArray) && !empty($xpFaqObjArray)) ? count($xpFaqObjArray) : 0;
74

blocks/xoopsfaq_recent.php 1 location

@@ 71-75 (lines=5) @@
68
            unset($catsToUse[$key]);
69
        }
70
    }
71
    if (!empty($catsToUse)) {
72
        $criteria->add(new Criteria('contents_cid', '(' . implode(',', $catsToUse) . ')', 'IN'));
73
    } else {
74
        return $block;
75
    }
76
77
    $fieldsArray = array('contents_cid', 'contents_title', 'contents_contents');
78
    $faqObjArray = $xfFaqHandler->getAll($criteria, $fieldsArray);