if ('thread' === $viewmode) {
    $viewmode_options[] = [
        'link'  => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?viewmode=flat&topic_id=' . $topic_id,
        'title' => _FLAT
    ];