Code Duplication    Length = 4-4 lines in 5 locations

blocks/faqs_recent.php 1 location

@@ 52-55 (lines=4) @@
49
    $allcategories = $categoryHandler->getObjects(null, true);
50
    if ($faqsObj) {
51
        $userids = [];
52
        foreach ($faqsObj as $key => $thisfaq) {
53
            $faqids[]                 = $thisfaq->getVar('faqid');
54
            $userids[$thisfaq->uid()] = 1;
55
        }
56
        /** @var \XoopsModules\Smartfaq\AnswerHandler $answerHandler */
57
        $answerHandler = \XoopsModules\Smartfaq\Helper::getInstance()->getHandler('Answer');
58
        $allanswers    = $answerHandler->getLastPublishedByFaq($faqids);

category.php 1 location

@@ 104-107 (lines=4) @@
101
102
if (count($faqsObj) > 0) {
103
    $userids = [];
104
    foreach ($faqsObj as $key => $thisfaq) {
105
        $faqids[]                 = $thisfaq->getVar('faqid');
106
        $userids[$thisfaq->uid()] = 1;
107
    }
108
    /** @var \XoopsModules\Smartfaq\AnswerHandler $answerHandler */
109
    $answerHandler = \XoopsModules\Smartfaq\Helper::getInstance()->getHandler('Answer');
110
    $allanswers    = $answerHandler->getLastPublishedByFaq($faqids);

index.php 1 location

@@ 123-126 (lines=4) @@
120
    $allcategories   = $categoryHandler->getObjects(null, true);
121
    if ($faqsObj) {
122
        $userids = [];
123
        foreach ($faqsObj as $key => $thisfaq) {
124
            $faqids[]                 = $thisfaq->getVar('faqid');
125
            $userids[$thisfaq->uid()] = 1;
126
        }
127
        /** @var \XoopsModules\Smartfaq\AnswerHandler $answerHandler */
128
        $answerHandler = \XoopsModules\Smartfaq\Helper::getInstance()->getHandler('Answer');
129
        $allanswers    = $answerHandler->getLastPublishedByFaq($faqids);

open_category.php 1 location

@@ 97-100 (lines=4) @@
94
$category['total'] = $catQnasWithSub + $totalQnas[$categoryid];
95
if ($faqsObj) {
96
    $userids = [];
97
    foreach ($faqsObj as $key => $thisfaq) {
98
        $faqids[]                 = $thisfaq->getVar('faqid');
99
        $userids[$thisfaq->uid()] = 1;
100
    }
101
102
    $memberHandler = xoops_getHandler('member');
103
    $users         = $memberHandler->getUsers(new \Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true);

open_index.php 1 location

@@ 102-105 (lines=4) @@
99
100
    if ($faqsObj) {
101
        $userids = [];
102
        foreach ($faqsObj as $key => $thisfaq) {
103
            $faqids[]                 = $thisfaq->getVar('faqid');
104
            $userids[$thisfaq->uid()] = 1;
105
        }
106
107
        $memberHandler = xoops_getHandler('member');
108
        $users         = $memberHandler->getUsers(new \Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true);