Code Duplication    Length = 8-8 lines in 4 locations

htdocs/modules/system/blocks/system_blocks.php 4 locations

@@ 210-217 (lines=8) @@
207
    $block          = array();
208
209
    // waiting content for news
210
    if (xoops_isActiveModule('news') && $module_handler->getCount(new Criteria('dirname', 'news'))) {
211
        $result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('stories') . ' WHERE published=0');
212
        if ($result) {
213
            $block['modules'][0]['adminlink'] = XOOPS_URL . '/modules/news/admin/index.php?op=newarticle';
214
            list($block['modules'][0]['pendingnum']) = $xoopsDB->fetchRow($result);
215
            $block['modules'][0]['lang_linkname'] = _MB_SYSTEM_SUBMS;
216
        }
217
    }
218
219
    // waiting content for mylinks
220
    if (xoops_isActiveModule('mylinks') && $module_handler->getCount(new Criteria('dirname', 'mylinks'))) {
@@ 272-279 (lines=8) @@
269
    }
270
271
    // waiting content for TDMDownloads
272
    if (xoops_isActiveModule('TDMdownloads') && $module_handler->getCount(new Criteria('dirname', 'TDMDownloads'))) {
273
        $result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('tdmdownloads_downloads') . ' WHERE status=0');
274
        if ($result) {
275
            $block['modules'][8]['adminlink'] = XOOPS_URL . '/modules/TDMDownloads/admin/downloads.php?op=list&statut_display=0';
276
            list($block['modules'][8]['pendingnum']) = $xoopsDB->fetchRow($result);
277
            $block['modules'][8]['lang_linkname'] = _MB_SYSTEM_TDMDOWNLOADS;
278
        }
279
    }
280
281
    // waiting content for extgallery
282
    if (xoops_isActiveModule('extgallery') && $module_handler->getCount(new Criteria('dirname', 'extgallery'))) {
@@ 282-289 (lines=8) @@
279
    }
280
281
    // waiting content for extgallery
282
    if (xoops_isActiveModule('extgallery') && $module_handler->getCount(new Criteria('dirname', 'extgallery'))) {
283
        $result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('extgallery_publicphoto') . ' WHERE photo_approved=0');
284
        if ($result) {
285
            $block['modules'][9]['adminlink'] = XOOPS_URL . '/modules/extgallery/admin/photo.php#pending-photo';
286
            list($block['modules'][9]['pendingnum']) = $xoopsDB->fetchRow($result);
287
            $block['modules'][9]['lang_linkname'] = _MB_SYSTEM_EXTGALLERY;
288
        }
289
    }
290
291
    // waiting content for smartsection
292
    if (xoops_isActiveModule('smartsection') && $module_handler->getCount(new Criteria('dirname', 'smartsection'))) {
@@ 292-299 (lines=8) @@
289
    }
290
291
    // waiting content for smartsection
292
    if (xoops_isActiveModule('smartsection') && $module_handler->getCount(new Criteria('dirname', 'smartsection'))) {
293
        $result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('smartsection_items') . ' WHERE status=1');
294
        if ($result) {
295
            $block['modules'][10]['adminlink'] = XOOPS_URL . '/modules/smartsection/admin/item.php';
296
            list($block['modules'][10]['pendingnum']) = $xoopsDB->fetchRow($result);
297
            $block['modules'][10]['lang_linkname'] = _MB_SYSTEM_SMARTSECTION;
298
        }
299
    }
300
301
    return $block;
302
}