1 (edited by ricketh? 2006-10-19 22:33)

Topic: Show new posts since last visit and mark all topics as read

Both of these links that usually show up towards the top right of the page are not showing on my forum.

I'm using the mini portal. The index.php relies on the index.tpl template file (The links show FINE on this page)
The index.php gets its template from the header file in which I added:

else if (defined('PUN_QUIET_VISIT'))
    $tpl_main = file_get_contents(PUN_ROOT.'include/template/index.tpl');

This tells the index.php to use the index.tpl template.

For all other pages I've left the code in header.php alone so it's still:

else 
        $tpl_main = file_get_contents(PUN_ROOT.'include/template/main.tpl');

BUT - the show new posts since last visit and mark all topics as read links don't show on ANY page other than the index.php. The main.tpl template I'm using is the standard template which is straight from the 1.2.14 download package.

Can anybody help me PLEASE, i've spent so long trying to figure out why it's not working.

My forum URL is: http://www.simzi.co.uk/

Thanks in advance guys.

EDIT: the links show in search.php

2

Re: Show new posts since last visit and mark all topics as read

replace your <pun_status> subst in header.php with this:

then view the results

// 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('index.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>

Re: Show new posts since last visit and mark all topics as read

Nope.. Doesn't work :S

Re: Show new posts since last visit and mark all topics as read

Let me guess, you renamed the default index.php to forum.php?

FIND

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

REPLACE WITH

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

5

Re: Show new posts since last visit and mark all topics as read

yup there is your answer ricketh smile stupid me couldnt point that out sad

Re: Show new posts since last visit and mark all topics as read

Oh dear, thanks Smartys that's a great help !

I owe you.