Code Duplication    Length = 11-11 lines in 2 locations

viewpost.php 1 location

@@ 428-438 (lines=11) @@
425
$xoopsTpl->assign('unread_link', $unread_link);
426
427
$viewmode_options = [];
428
if ('DESC' === $order) {
429
    $viewmode_options[] = [
430
        'link'  => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewpost.php?viewmode=flat&order=ASC&forum=' . $forum_id,
431
        'title' => _OLDESTFIRST
432
    ];
433
} else {
434
    $viewmode_options[] = [
435
        'link'  => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewpost.php?viewmode=flat&order=DESC&forum=' . $forum_id,
436
        'title' => _NEWESTFIRST
437
    ];
438
}
439
440
//$xoopsTpl->assign('viewmode_compact', ($viewmode=="compact")?1:0);
441
$xoopsTpl->assign_by_ref('viewmode_options', $viewmode_options);

viewtopic.php 1 location

@@ 702-712 (lines=11) @@
699
                  ]);
700
701
$viewmode_options = [];
702
if ('DESC' === $order) {
703
    $viewmode_options[] = [
704
        'link'  => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?order=ASC&status=$status&topic_id=' . $topic_id,
705
        'title' => _OLDESTFIRST
706
    ];
707
} else {
708
    $viewmode_options[] = [
709
        'link'  => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?order=DESC&status=$status&topic_id=' . $topic_id,
710
        'title' => _NEWESTFIRST
711
    ];
712
}
713
714
switch ($status) {
715
    case 'active':