Code Duplication    Length = 7-7 lines in 3 locations

admin/index.php 3 locations

@@ 1394-1400 (lines=7) @@
1391
    $mostreadednews = $stats['mostreadednews'];
1392
    echo "<div style='text-align: center;'><b>" . _AM_NEWS_STATS3 . '</b><br /><br />' . _AM_NEWS_STATS4 . "<br />\n";
1393
    echo "<table border='0' width='100%'><tr class='bg3'><th align='center'>" . _AM_TOPIC . "</th><th align='center'>" . _AM_TITLE . '</th><th>' . _AM_POSTER . '</th><th>' . _NW_VIEWS . "</th></tr>\n";
1394
    foreach ($mostreadednews as $storyid => $data) {
1395
        $url1  = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/index.php?storytopic=' . $data['topicid'];
1396
        $url2  = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/article.php?storyid=' . $storyid;
1397
        $url3  = XOOPS_URL . '/userinfo.php?uid=' . $data['uid'];
1398
        $class = ($class === 'even') ? 'odd' : 'even';
1399
        printf("<tr class='" . $class . "'><td align='left'><a href='%s' target ='_blank'>%s</a></td><td align='left'><a href='%s' target='_blank'>%s</a></td><td><a href='%s' target='_blank'>%s</a></td><td align='right'>%u</td></tr>\n", $url1, $myts->displayTarea($data['topic_title']), $url2, $myts->displayTarea($data['title']), $url3, $myts->htmlSpecialChars($news->uname($data['uid'])), $data['counter']);
1400
    }
1401
    echo '</table>';
1402
1403
    // b) Less readed articles
@@ 1407-1413 (lines=7) @@
1404
    $lessreadednews = $stats['lessreadednews'];
1405
    echo '<br /><br />' . _AM_NEWS_STATS5;
1406
    echo "<table border='0' width='100%'><tr class='bg3'><th align='center'>" . _AM_TOPIC . "</th><th align='center'>" . _AM_TITLE . '</th><th>' . _AM_POSTER . '</th><th>' . _NW_VIEWS . "</th></tr>\n";
1407
    foreach ($lessreadednews as $storyid => $data) {
1408
        $url1  = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/index.php?storytopic=' . $data['topicid'];
1409
        $url2  = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/article.php?storyid=' . $storyid;
1410
        $url3  = XOOPS_URL . '/userinfo.php?uid=' . $data['uid'];
1411
        $class = ($class === 'even') ? 'odd' : 'even';
1412
        printf("<tr class='" . $class . "'><td align='left'><a href='%s' target ='_blank'>%s</a></td><td align='left'><a href='%s' target='_blank'>%s</a></td><td><a href='%s' target='_blank'>%s</a></td><td align='right'>%u</td></tr>\n", $url1, $myts->displayTarea($data['topic_title']), $url2, $myts->displayTarea($data['title']), $url3, $myts->htmlSpecialChars($news->uname($data['uid'])), $data['counter']);
1413
    }
1414
    echo '</table>';
1415
1416
    // c) Best rated articles (this is an average)
@@ 1420-1426 (lines=7) @@
1417
    $besratednews = $stats['besratednews'];
1418
    echo '<br /><br />' . _AM_NEWS_STATS6;
1419
    echo "<table border='0' width='100%'><tr class='bg3'><th align='center'>" . _AM_TOPIC . "</th><th align='center'>" . _AM_TITLE . '</th><th>' . _AM_POSTER . '</th><th>' . _NW_RATING . "</th></tr>\n";
1420
    foreach ($besratednews as $storyid => $data) {
1421
        $url1  = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/index.php?storytopic=' . $data['topicid'];
1422
        $url2  = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/article.php?storyid=' . $storyid;
1423
        $url3  = XOOPS_URL . '/userinfo.php?uid=' . $data['uid'];
1424
        $class = ($class === 'even') ? 'odd' : 'even';
1425
        printf("<tr class='" . $class . "'><td align='left'><a href='%s' target ='_blank'>%s</a></td><td align='left'><a href='%s' target='_blank'>%s</a></td><td><a href='%s' target='_blank'>%s</a></td><td align='right'>%s</td></tr>\n", $url1, $myts->displayTarea($data['topic_title']), $url2, $myts->displayTarea($data['title']), $url3, $myts->htmlSpecialChars($news->uname($data['uid'])), number_format($data['rating'], 2));
1426
    }
1427
    echo '</table></div><br /><br /><br />';
1428
1429
    // Last part of the stats, everything about authors