Code Duplication    Length = 15-15 lines in 3 locations

index.php 3 locations

@@ 184-198 (lines=15) @@
181
                                   . " AND datesub > 0 AND submit = '1' AND offline = '1' AND request = '0' ORDER BY term");
182
    $totalSwords = $xoopsDB->getRowsNum($resultS);
183
184
    if ($totalSwords > 0) { // If there are definitions
185
        while (list($entryID, $term) = $xoopsDB->fetchRow($resultS)) {
186
            $subentries             = array();
187
            $xoopsModule            = XoopsModule::getByDirname('lexikon');
188
            $linktext               = mb_ucfirst($myts->htmlSpecialChars($term));
189
            $subentries['linktext'] = $linktext;
190
            $subentries['id']       = $entryID;
191
192
            $blockS['substuff'][] = $subentries;
193
        }
194
        $xoopsTpl->assign('blockS', $blockS);
195
        $xoopsTpl->assign('wehavesubs', 1);
196
    } else {
197
        $xoopsTpl->assign('wehavesubs', 0);
198
    }
199
200
    $blockR      = array();
201
    $resultR     = $xoopsDB->query('SELECT entryID, term FROM ' . $xoopsDB->prefix('lxentries') . ' WHERE datesub < ' . time() . " AND datesub > 0 AND request = '1' ORDER BY term");
@@ 204-218 (lines=15) @@
201
    $resultR     = $xoopsDB->query('SELECT entryID, term FROM ' . $xoopsDB->prefix('lxentries') . ' WHERE datesub < ' . time() . " AND datesub > 0 AND request = '1' ORDER BY term");
202
    $totalRwords = $xoopsDB->getRowsNum($resultR);
203
204
    if ($totalRwords > 0) { // If there are definitions
205
        while (list($entryID, $term) = $xoopsDB->fetchRow($resultR)) {
206
            $reqentries             = array();
207
            $xoopsModule            = XoopsModule::getByDirname('lexikon');
208
            $linktext               = mb_ucfirst($myts->htmlSpecialChars($term));
209
            $reqentries['linktext'] = $linktext;
210
            $reqentries['id']       = $entryID;
211
212
            $blockR['reqstuff'][] = $reqentries;
213
        }
214
        $xoopsTpl->assign('blockR', $blockR);
215
        $xoopsTpl->assign('wehavereqs', 1);
216
    } else {
217
        $xoopsTpl->assign('wehavereqs', 0);
218
    }
219
} else {
220
    $xoopsTpl->assign('userisadmin', 0);
221
    $blockR      = array();
@@ 225-239 (lines=15) @@
222
    $resultR     = $xoopsDB->query('SELECT entryID, term FROM ' . $xoopsDB->prefix('lxentries') . ' WHERE datesub < ' . time() . " AND datesub > 0 AND request = '1' " . $catperms . ' ORDER BY term');
223
    $totalRwords = $xoopsDB->getRowsNum($resultR);
224
225
    if ($totalRwords > 0) { // If there are definitions
226
        while (list($entryID, $term) = $xoopsDB->fetchRow($resultR)) {
227
            $reqentries             = array();
228
            $xoopsModule            = XoopsModule::getByDirname('lexikon');
229
            $linktext               = mb_ucfirst($myts->htmlSpecialChars($term));
230
            $reqentries['linktext'] = $linktext;
231
            $reqentries['id']       = $entryID;
232
233
            $blockR['reqstuff'][] = $reqentries;
234
        }
235
        $xoopsTpl->assign('blockR', $blockR);
236
        $xoopsTpl->assign('wehavereqs', 1);
237
    } else {
238
        $xoopsTpl->assign('wehavereqs', 0);
239
    }
240
}
241
// Various strings
242
$xoopsTpl->assign('lang_modulename', $xoopsModule->name());