1 (edited by myran-san 2005-01-08 16:32)

Topic: Error in the admin section.

Well i have updated from 1.2Beta and i followed the "guide" When i go to the administartion section i get the following error.

Notice: Undefined index: QUERY_STRING in /home/m/myransancom/forummyran/forum.myran-san.com/header.php on line 172

if (basename($_SERVER['PHP_SELF']) == 'index.php')
        $tpl_temp .= '</p>'."\n\t\t\t".'<p class="conr"><a href="search.php?action=show_new">'.$lang_common['Show new posts'].'</a><br /><a href="misc.php?action=markread">'.$lang_common['Mark all as read'].'</a></p>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';
    else if ($_SERVER['QUERY_STRING'] == 'action=show_new')
        $tpl_temp .= '</p>'."\n\t\t\t".'<p class="conr"><a href="misc.php?action=markread">'.$lang_common['Mark all as read'].'</a></p>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';
    else
        $tpl_temp .= '</p>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';
}

Does anyone know what to do?


Edit: Its not just in the admin part its in userlist to.... It also make the text larger in that section then the rest of the forum...

The world is made of murderers dreams

Re: Error in the admin section.

What web server is this running on? Very strange that QUERY_STRING isn't defined.

The second error can be fixed by adding a row o_regs_report with a value of 0 to the config table and then deleting the config cache PHP script in cache/. I had forgotten about this. I've updated the beta to final instructions to include this.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Error in the admin section.

Rickard wrote:

What web server is this running on? Very strange that QUERY_STRING isn't defined.

The second error can be fixed by adding a row o_regs_report with a value of 0 to the config table and then deleting the config cache PHP script in cache/. I had forgotten about this. I've updated the beta to final instructions to include this.

Apache/1.3.33 Server and  MySQL 4.0.23_Debian-1

I fixed the second part...

The world is made of murderers dreams

Re: Error in the admin section.

Very strange. I will investigate later. I have to go now.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

5 (edited by myran-san 2005-01-08 16:34)

Re: Error in the admin section.

I also found this  strange entry in the database:

http://www.myran-san.com/images/databas.gif

Edit: Here is the code from 1.2Beta

if (basename($_SERVER['PHP_SELF']) == 'index.php')
        $tpl_temp .= '</p>'."\n\t\t\t".'<p class="conr"><a href="search.php?action=show_new">'.$lang_common['Show new posts'].'</a><br /><a href="misc.php?action=markread">'.$lang_common['Mark all as read'].'</a></p>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>'."\n\t".'</div>';
    else
        $tpl_temp .= '</p>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>'."\n\t".'</div>';
}

Edit2: It only a problem for users. Guest dont have this problem at all. (user list)

The world is made of murderers dreams

Re: Error in the admin section.

Very strange. Oh well, you can solve the problem by replacing

    else if ($_SERVER['QUERY_STRING'] == 'action=show_new')

with

    else if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] == 'action=show_new')

I have no idea where that row from your config table comes from. I can't think of any option or setting for which a value of 52 would make sense smile

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Error in the admin section.

Just to echo your comments, i also added that line. It fixed the QUERY_STRING error and the font size error in one go.

  else if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] == 'action=show_new')


Paul_w

Re: Error in the admin section.

myran-san wrote:

Well i have updated from 1.2Beta and i followed the "guide" When i go to the administartion section i get the following error.

Notice: Undefined index: QUERY_STRING in /home/m/myransancom/forummyran/forum.myran-san.com/header.php on line 172
...

It's NOT error! It's a NOTICE smile Have a look at your php.ini (section "Error handling and logging") and you have some options to turn on/off this bug big_smile

@Rickard: Do you turn on this option on your server ? smile I have this always enable when I hack punBB smile

[no signature]

Re: Error in the admin section.

Problem is, PunBB should work perfectly with E_ALL wink

Re: Error in the admin section.

Yes, like Smarty said, PunBB 1.2 is supposed to work with E_ALL. That way, you're always sure no variable is being accessed without first being initialized. It has inherent security benefits.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Error in the admin section.

Thanks alot for the help. That new line solved the problem. Another reason to use PunBB. Fast and good support.

The world is made of murderers dreams