Code Duplication    Length = 15-15 lines in 3 locations

index.php 3 locations

@@ 196-210 (lines=15) @@
193
                                   . " AND datesub > 0 AND submit = '1' AND offline = '1' AND request = '0' ORDER BY term");
194
    $totalSwords = $xoopsDB->getRowsNum($resultS);
195
196
    if ($totalSwords > 0) { // If there are definitions
197
        while (list($entryID, $term) = $xoopsDB->fetchRow($resultS)) {
198
            $subentries             = [];
199
            $xoopsModule            = XoopsModule::getByDirname('lexikon');
200
            $linktext               = mb_ucfirst($myts->htmlSpecialChars($term));
201
            $subentries['linktext'] = $linktext;
202
            $subentries['id']       = $entryID;
203
204
            $blockS['substuff'][] = $subentries;
205
        }
206
        $xoopsTpl->assign('blockS', $blockS);
207
        $xoopsTpl->assign('wehavesubs', 1);
208
    } else {
209
        $xoopsTpl->assign('wehavesubs', 0);
210
    }
211
212
    $blockR      = [];
213
    $resultR     = $xoopsDB->query('SELECT entryID, term FROM '
@@ 220-234 (lines=15) @@
217
                                    . " AND datesub > 0 AND request = '1' ORDER BY term");
218
    $totalRwords = $xoopsDB->getRowsNum($resultR);
219
220
    if ($totalRwords > 0) { // If there are definitions
221
        while (list($entryID, $term) = $xoopsDB->fetchRow($resultR)) {
222
            $reqentries             = [];
223
            $xoopsModule            = XoopsModule::getByDirname('lexikon');
224
            $linktext               = mb_ucfirst($myts->htmlSpecialChars($term));
225
            $reqentries['linktext'] = $linktext;
226
            $reqentries['id']       = $entryID;
227
228
            $blockR['reqstuff'][] = $reqentries;
229
        }
230
        $xoopsTpl->assign('blockR', $blockR);
231
        $xoopsTpl->assign('wehavereqs', 1);
232
    } else {
233
        $xoopsTpl->assign('wehavereqs', 0);
234
    }
235
} else {
236
    $xoopsTpl->assign('userisadmin', 0);
237
    $blockR      = [];
@@ 247-261 (lines=15) @@
244
                                    . ' ORDER BY term');
245
    $totalRwords = $xoopsDB->getRowsNum($resultR);
246
247
    if ($totalRwords > 0) { // If there are definitions
248
        while (list($entryID, $term) = $xoopsDB->fetchRow($resultR)) {
249
            $reqentries             = [];
250
            $xoopsModule            = XoopsModule::getByDirname('lexikon');
251
            $linktext               = mb_ucfirst($myts->htmlSpecialChars($term));
252
            $reqentries['linktext'] = $linktext;
253
            $reqentries['id']       = $entryID;
254
255
            $blockR['reqstuff'][] = $reqentries;
256
        }
257
        $xoopsTpl->assign('blockR', $blockR);
258
        $xoopsTpl->assign('wehavereqs', 1);
259
    } else {
260
        $xoopsTpl->assign('wehavereqs', 0);
261
    }
262
}
263
// Various strings
264
$xoopsTpl->assign('lang_modulename', $xoopsModule->name());