Topic: Wierd random link.

Hi guys,

I've got a problem..
On the mini portal index page, if I hover my mouse over the "Who's Online" box anywhere other than user links gives me a link to Mark all topics as read.

This same link is behind the menu links in the Admin Menu and the header where is says "You're logged in as blah blah".

Can anybody shed some light on this?

Re: Wierd random link.

I have a feeling it's got something to do with this code in header.php, please correct me if i'm wrong!

// START SUBST - <pun_status>
if ($pun_user['is_guest'])
    $tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".'<p>'.$lang_common['Not logged in'].'</p>'."\n\t\t".'</div>';
else
{
    $tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".'<ul class="conl">'."\n\t\t\t\t".'<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>';
    }

    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>

I have

if (in_array(basename($_SERVER['PHP_SELF']), array('forum.php', 'search.php')))

in header.php so that it shows the new posts and mark all topic links on the forum index, as i'm using the mini portal.

Re: Wierd random link.

It has to do with the similar code for the sidebar you see.
There's a couple places where the HTML isn't right tongue

http://fluxbb.org

Free PunBB Hosting - lots of mods, easy to customize

Re: Wierd random link.

But pages like, viewforum.php don't use the sidebar, infact they use a totally different template :S.. the site is http://www.simzi.co.uk could you just take a little peak big_smile?

Re: Wierd random link.

I already did tongue
The miniportal mod adds a new function to generate a sidebar, the issue is there.

http://fluxbb.org

Free PunBB Hosting - lots of mods, easy to customize

Re: Wierd random link.

I've just noticed that the issue is only affecting internet explorer browsers. This is wierd.

Re: Wierd random link.

I see no error in FF1.5 nor IE7.

But it's probably an <a> tag that isn't being closed wink

Re: Wierd random link.

Bekko is right (although I think there are 2 errors, not just 1). smile

http://fluxbb.org

Free PunBB Hosting - lots of mods, easy to customize

Re: Wierd random link.

Surely if the unclosed <a> tag was the issue it would be somewhere here:

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>';

i can't see any unclosed tags :S

Re: Wierd random link.

Nope, those look fine...

In the output it's messed up for some reason:

                <li id="navextra2"><a href="http://www.simzi.co.uk/misc.php?action=markread"?Mark all as read</a></li>

But that's a code you entered, so edit it there wink

Re: Wierd random link.

Hm.. thanks for all yuor help guys. Loads of people have been complaining to me on msn about the portal and they don't like it so i've removed it anyway. I liked it! But if it's gonna deterr members I'll take it off. thanks.