Code Duplication    Length = 6-6 lines in 2 locations

blocks/xoopsfaq_rand.php 1 location

@@ 55-60 (lines=6) @@
52
    // Filter out cats based on group permissions
53
    $options[1] = isset($options[1]) ? $options[1] : array(0);
54
    $cTu = $catsToUse = (false === strpos($options[1], ',')) ? (array)$options[1] : explode(',', $options[1]);
55
    if (in_array(0, $catsToUse) || empty($catsToUse)) {
56
        // Get a list of all cats
57
        $xfCatHandler     = $xfHelper->getHandler('category');
58
        $catListArray     = $xfCatHandler->getList();
59
        $cTu = $catsToUse = array_keys($catListArray);
60
    }
61
    // Remove any cats this user doesn't have rights to view
62
    foreach ($cTu as $key => $thisCat) {
63
        if (false === $permHelper->checkPermission('viewcat', $thisCat)) {

blocks/xoopsfaq_recent.php 1 location

@@ 59-64 (lines=6) @@
56
57
    $options[3] = isset($options[3]) ? $options[3] : array(0);
58
    $cTu = $catsToUse = (false === strpos($options[3], ',')) ? (array)$options[3] : explode(',', $options[3]);
59
    if (in_array(0, $catsToUse) || empty($catsToUse)) {
60
        // Get a list of all cats
61
        $xfCatHandler     = $xfHelper->getHandler('category');
62
        $catListArray     = $xfCatHandler->getList();
63
        $cTu = $catsToUse = array_keys($catListArray);
64
    }
65
    // Remove any cats this user doesn't have rights to view
66
    foreach ($cTu as $key => $thisCat) {
67
        if (false === $permHelper->checkPermission('viewcat', $thisCat)) {