Topic: Missing some stuff

I just noticed that I'm missing some stuff (and I'm also missing it on my 'clean' installs ...)

Show new posts since last visit
Mark all topics as read

is missing on all my 1.2* installs here at home, when checking the pagesource, I have for 1.2 (and similar for the other)

        <div id="brdwelcome" class="inbox">
            <p class="conl">Logged in as <strong>Administrator</strong><br />Last visit: 2005-01-09 16:46:35</p>
            <div class="clearer"></div>
        </div>

The whole conr thing is missing on my boards ... (and 1.2 was a clean install from zip, and so was 1.2.4 (but 1.2.5 was an upgrade))

But here, I can see it ... so I suppose its' something wrong with my install... so any clue what file might be the cause (looked around, and didn't find that stuff, and at 4am one isn't really good on searchign for stuff wink)

I suppose I might have missed something ... but everything else works just fine (although I'm sick of CSS wink) smile

2 (edited by Frank H 2005-04-12 01:53)

Re: Missing some stuff

ok, header.php line 174 ... by some odd reason this ifstatement doesn't work on PHP 4.1.2 (considering the basename doesn't(?) give an array, I'd say it should work, but it doesn't)

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

string basename ( string path [, string suffix] )

Some debugging, and I noticed that basename gave: "index"  ... not "index.php" ... odd... must be some bug in PHP 4.1.2 ... as it clearly shouldn't strip out the .php unless it's specified as a suffix (and it was added in PHP 4.1.0 ... perhaps just a bit buggy ... gonna try to rewrite it now so it works for me...

3

Re: Missing some stuff

It starts at line 174 of header.php

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

I can only think that for some reason you a failing the "if" condition.

EDIT: I must learn to anwser your posts faster.

Re: Missing some stuff

lol ... and I've found the reason, read my edit big_smile

Re: Missing some stuff

ok, I figured it out ... sigh ... it's a bug in php, right?

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

fixes it for my server ...

perhaps

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

will work for all post 4.1.0? (but I suppose it'll break on all pre 4.1.0 tongue) ... aint it a wounderful world we're living in? big_smile

6

Re: Missing some stuff

Don't we just need an "OR" in there to satisfy both.

Re: Missing some stuff

perhaps, but lots of checks in that case, probably best to make a new variable before the ifstatement if that case, so it hopefully save some calls to basename?

Well ... otoh ... if ppl are missing it, it's an easy mod to fix it, and after lookign at the php manual I've got a feeling it's a php bug, might be only 4.1.2 that's affected(?), if so, I'd say it's quite a bit of extra overhead just for a buggy php version... (althoug it's the 'default' version in debian 'woody')


either way ... now I'm done with php stuff for today ... sigh... been at it since 1-2pm ... and now it's 4am wink

Now one of my forums is updated though, next one to update is the much much larger 300-400MB attachment modded board ... gonna make 10 backups before I start on that one big_smile

8

Re: Missing some stuff

I know you are just gonno love all the markup and css changes for 1.3.

Re: Missing some stuff

I'm not so sure, in my eyes w3c and their standards is a big mess, when such specific things that can be done in CSS is taken different in different browsers, there's something really wrong (and wasn't the CSS 2.1 or something contradicting iself aswell, so it was impossible to do a 100% compatible version even from the start?)