Topic: Trying to add another block below the welcome mesasge

I added a new <pun_status> block below the original one and just named it <pun_status2>. Here is my problem. If I enter the forums it displays as it should but in viewtopic I would like it to be completley invisible. I've tried for hours and hours and I don't know what I can add to remove it when in viewtopic mode. Can someone please tell me what I need to add: Here is the code:

Original code:

// START SUBST - <pun_status>
require PUN_ROOT.'lang/'.$pun_user['language'].'/welcome.php';
if ($pun_user['is_guest'])
    $tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".($pun_config['o_welcome_guest']? '<b>'.$lang_welcome['Welcome'].'!</b>'."\n\t\t" : '').'<p>'.$lang_common['Not logged in'].'</p>'."\n\t\t".'</div>';  //welcome mod
else
{
    $is_welcome = time()-$pun_user['cur_visit']<60*$pun_config['o_timeout_welcome'];    //display welcome text for N mins.
    $is_welcome = $pun_config['o_timeout_welcome']<0? 1 : $is_welcome;              //if negative, always show the text.
    $realname = $pun_config['o_welcome_full_name']? $pun_user['realname'] : substr($pun_user['realname'],0,strpos($pun_user['realname'],' '));
    $tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".'<ul class="conl">'."\n\t\t\t\t".($is_welcome? '<li><b>'.$lang_welcome['Welcome'].' '.pun_htmlspecialchars($realname).'!</b></li>' : '').'<li>'.$lang_common['Logged in as'].' <strong>'.pun_htmlspecialchars($pun_user['username']).'</strong></li>'."\n\t\t\t\t".'<li>'.$lang_common['Last visit'].': '.format_time($pun_user['last_visit']).'</li>';
    if ($pun_user['g_id'] < PUN_GUEST)
    {
        $result_header = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'reports WHERE zapped IS NULL') or error('Unable to fetch reports info', __FILE__, __LINE__, $db->error());

        if ($db->result($result_header))
            $tpl_temp .= "\n\t\t\t\t".'<li class="reportlink"><strong><a href="admin_reports.php">There are new reports</a></strong></li>';

        if ($pun_config['o_maintenance'] == '1')
            $tpl_temp .= "\n\t\t\t\t".'<li class="maintenancelink"><strong><a href="admin_options.php#maintenance">Maintenance mode is enabled!</a></strong></li>';
    }
    require(PUN_ROOT.'include/pms/header_new_messages.php');
        if (in_array(basename($_SERVER['PHP_SELF']), array('forum.php', 'search.php')))
        $tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<ul class="conr">'."\n\t\t\t\t".'<li><a href="search.php?action=show_new">'.$lang_common['Show new posts'].'</a></li>'."\n\t\t\t\t".'<li><a href="misc.php?action=markread">'.$lang_common['Mark all as read'].'</a></li>'."\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';
    else
        $tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';
}

$tpl_main = str_replace('<pun_status>', $tpl_temp, $tpl_main);
// END SUBST - <pun_status>

New code I added:

// START SUBST - <pun_status>
 
if ($pun_user['is_guest'])
    $tpl_temp = '<div id="brdwelcome2" class="inbox"> </div>';  //welcome mod
else
{
 
 
    $tpl_temp = '<div id="brdwelcome2" class="boxed">'."\n\t\t\t".'<ul class="conl">'."\n\t\t\t\t".($is_welcome? '<li><b>'.$lang_welcome['Welcome'].' '.pun_htmlspecialchars($realname).'!</b></li>' : '').'<li>'.$lang_common['Logged in as'].' <strong>'.pun_htmlspecialchars($pun_user['username']).'</strong></li>'."\n\t\t\t\t".'<li>'.$lang_common['Last visit'].': '.format_time($pun_user['last_visit']).'</li>';
    if ($pun_user['g_id'] < PUN_GUEST)
    {
 
        if ($pun_config['o_maintenance'] == '1')
            $tpl_temp .= "\n\t\t\t\t".'<li class="maintenancelink"><strong><a href="admin_options.php#maintenance">Maintenance mode is enabled!</a></strong></li>';
    }
 
        if (in_array(basename($_SERVER['PHP_SELF']), array('forum.php', 'search.php')))
        $tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<ul class="conr">'."\n\t\t\t\t".'<li><a href="search.php?action=show_new">'.$lang_common['Show new posts'].'</a></li>'."\n\t\t\t\t".'<li><a href="misc.php?action=markread">'.$lang_common['Mark all as read'].'</a></li>'."\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';
    else
        $tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';
}

$tpl_main = str_replace('<pun_status2>', $tpl_temp, $tpl_main);
// END SUBST - <pun_status2>

Thanks