1
brash
ERROR: Forum not selected! Bug With Xoops & IIS
  • 2004/4/1 1:13

  • brash

  • Friend of XOOPS

  • Posts: 2206

  • Since: 2003/4/10


Hi All,

This has been a bug hanging around for a very long time now between IIS and NewBB, and I believe was first reported in this thread by jctsup1 a few months ago (although the bug has existed as long as I have been using IIS and XOOPS which is over a year)

This bug is common only IIS and it is replicable, and I really think it would be great to give this bug the flick.

The "ERROR: Forum not selected!" text is located on line 95 of the main.php file in the language\english directory of the NewBB module, and is defined as _MD_ERRORFORUM .
This _MD_ERRORFORUM is then found in a total 8 files which are:

1) newbb\delete.php on line 42

2) newbb\edit.php on line 37

3) newbb\newtopic.php on line 38

4) newbb\post.php on line 38

5) newbb\reply.php on line 37

6) newbb\viewforum.php on line 36

7) newbb\viewtopic.php on line 36

8) newbb\language\english\main.php on line 95


I'm no coder but I would put my money on their being a bug between XOOPS and IIS somewhere in files listed above as 6 or 7. In particular I think the $HTTP_GET_VARS variable at the top of viewforum.php is not being set, or being set incorrectly for whatever reason.

This is about as far as my skills of being able to track back PHP goes, and from here will need a real PHP coder to find out why this is happening.

----------------------------------

This bug has been reported on Sourceforge [size=x-large]>> HERE <<[/size]

2
brash
Re: ERROR: Forum not selected! Bug With NewBB & IIS
  • 2004/5/13 0:04

  • brash

  • Friend of XOOPS

  • Posts: 2206

  • Since: 2003/4/10


Any progess on this bug? It is starting to be a bit of a thorn for those using an IIS platform

3
brash
Re: ERROR: Forum not selected! Bug With NewBB & IIS
  • 2004/5/19 11:26

  • brash

  • Friend of XOOPS

  • Posts: 2206

  • Since: 2003/4/10


Just tried the latest NewBB 2.0 Beta 2 and this bug is still apparent for IIS users. Predator, any chance at getting this bug fixed? You have a very willing beta tester here toget this bug fixed for IIS users

4
brash
Re: ERROR: Forum not selected! Bug With NewBB & IIS
  • 2004/5/22 0:24

  • brash

  • Friend of XOOPS

  • Posts: 2206

  • Since: 2003/4/10


^bump^

5
Dave_L
Re: ERROR: Forum not selected! Bug With NewBB & IIS
  • 2004/5/22 4:47

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


What exact sequence of actions causes the bug to occur?

6
brash
Re: ERROR: Forum not selected! Bug With NewBB & IIS
  • 2004/5/22 10:32

  • brash

  • Friend of XOOPS

  • Posts: 2206

  • Since: 2003/4/10


Hi Dave,

You can try www.it-hq.org or www.iis-resources.com to test this as I know for sure both of these use IIS. The following is the most likely sequence that'll be causing the problems. Basically if you are viewing a thread in NewBB and goto log on you are given the error.

(1) open up website (without logging on) and browse through a thread.

(2) Find thread you want to reply to, so you log on.

(3) Upon logon you are presented with an "ERROR:Forum not selected" message and are redirected elsewhere in the site. The redirection doesn't seem to be consistant either. On my site you seem to get redirected to the forum root, but over at www.iis-resources.com you seem to get redirected back to the homepage.

7
Mithrandir
Re: ERROR: Forum not selected! Bug With NewBB & IIS

Is it possible to post in the forum after login by navigating back to the forum?

8
Anonymous
Re: ERROR: Forum not selected! Bug With NewBB & IIS
  • 2004/5/22 13:06

  • Anonymous

  • Posts: 0

  • Since:


As i thought is the problem here:

if ( $can_post == ) {
    
$xoopsTpl->assign(array('viewer_can_post' => true'forum_post_or_register' => "<a href="newtopic.php?forum=".$forum.""><img src="".$bbImage['post']."" alt=""._MD_POSTNEW."" /></a>"));
} else {
    
$xoopsTpl->assign('viewer_can_post'false);
    if ( 
$show_reg == ) {
        
$xoopsTpl->assign('forum_post_or_register''<a href="'.XOOPS_URL.'/user.php?xoops_redirect='.htmlspecialchars($xoopsRequestUri).'">'._MD_REGTOPOST.'</a>');
    } else {
        
$xoopsTpl->assign('forum_post_or_register''');
    }
}



So there is the problem? It is $xoopsRequestUri) which in this chase redirect including the values to user.php, but instead of

http://www.iis-resources.com/user.php?xoops_redirect=/modules/newbb/viewtopic.php?topic_id=1223&forum=3&post_id=5607#forumpost5607

it shows

http://www.iis-resources.com/user.php?xoops_redirect=/modules/newbb/viewtopic.php

so everything including ? (topic_id=1223&forum=3&post_id=5607#forumpost5607) is gone.

Why is this?

in common.php line 229:

$xoopsRequestUri = @xoops_getenv('REQUEST_URI');
    if (!
$xoopsRequestUri) {
        
$xoopsRequestUri = (!$rq xoops_getenv('SCRIPT_NAME')) ? getenv('REQUEST_URI') : $rq;
    }


Running PHP 4.3 under IIS 5 on Windows XP, there is no $_SERVER['REQUEST_URI'] variable. This seems to fix it:

if(!isset($_SERVER['REQUEST_URI'])) {
$_SERVER['REQUEST_URI'] = substr($_SERVER['argv'][0], strpos($_SERVER['argv'][0], ';') + 1);
}

But here the Core devs have to look in it

In the newbb there are 2 files using this:

viewtopic.php and viewforum.php,

i will use in the new newbb now a different way to eliminate this problem.

9
Anonymous
Re: ERROR: Forum not selected! Bug With NewBB & IIS
  • 2004/5/22 14:25

  • Anonymous

  • Posts: 0

  • Since:


try this little hack please:

common.php line 229

$xoopsRequestUri = @xoops_getenv('REQUEST_URI');
if (!
$xoopsRequestUri) {
 
$xoopsRequestUri = (!$rq xoops_getenv('SCRIPT_NAME')) ?getenv('REQUEST_URI') : $rq;
}


replace with

$xoopsRequestUri = @xoops_getenv('REQUEST_URI');
    if (!
$xoopsRequestUri) {
         if(!
getenv('REQUEST_URI')) {
                 
$_SERVER['REQUEST_URI'] = substr($_SERVER['argv'][0], strpos($_SERVER['argv'][0], ';') + 1);
                 
$xoopsRequestUri = (!$rq xoops_getenv('SCRIPT_NAME')) ? $_SERVER['REQUEST_URI'] : $rq;
             }
             else
             {
                 
$xoopsRequestUri = (!$rq xoops_getenv('SCRIPT_NAME')) ? getenv('REQUEST_URI') : $rq;
             }
    }

10
jctsup1
Re: ERROR: Forum not selected! Bug With NewBB & IIS
  • 2004/5/22 15:02

  • jctsup1

  • Not too shy to talk

  • Posts: 146

  • Since: 2002/5/23


Mithrandir -

Yes it is possible to navigate back to the forum & post but thats not the issue. I just logged into this site when I was browsing this thread & once I logged in, I was redirected to this thread which is what is supposed to happen.


Login

Who's Online

145 user(s) are online (114 user(s) are browsing Support Forums)


Members: 0


Guests: 145


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits