Best of joomla gives you news, joomla templates, tutorials and websites about Joomla , FireBoard and FireMessage official page.
| No account yet?   |
Welcome, Guest
Please Login or Register.    Lost Password?
(SOLVED!)Loads forum page then reloads once again? (2 viewing) (2) Guests
Go to bottom Favoured: 7
TOPIC: (SOLVED!)Loads forum page then reloads once again?
#11276
Re:Loads forum page then reloads once again? 1 Year, 2 Months ago  
hmm yea why did joomla board didn't used joomla sessions at the beginning?
dragontje124 (User)
Gold Boarder
Posts: 175
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
Last Edit: 2007/06/11 13:52 By dragontje124.
 
The administrator has disabled public write access.  
#11362
Re:Loads forum page then reloads once again? 1 Year, 2 Months ago  
Thanks VERY much for this Prutkar. This stupid reloading started to annoy me from the 1st time i used joomlaboard, 4 years ago !!
As always, very good coding (my name is flocmoimeme on blastchat).


Just wondering which version of FB you are using ? FB 1.0.1 original file is like that lines 255 to 271 :
if ($inactivePeriod setQuery("UPDATE #__fb_sessions SET allowed='na', readtopics='' where userid=$my->id";
$database->query();
setcookie("fboard_settings[prevvisit]", $fbSession->lasttime, time() + 31536000, '/';

// do not reload the page if user is posting
if ($func != "post"
{
echo 'setTimeout("window.location.reload( true )",100);';
}
}

$database->setQuery("UPDATE #__fb_sessions SET lasttime=$systime where userid=$my->id";
$database->query();

}
So if i change only
Code:

setTimeout("window.location.reload( true )",100);
to
Code:

global $mosConfig_live_site;
$database->setQuery("UPDATE #__fb_sessions SET lasttime=$systime where userid=$my->id"«»);
$database->query();
mosRedirect($mosConfig_live_site.$_ENV["REQUEST_URI"]);

as you said previously, it works, but as the whole part of the file becomes :
Code:

if ($inactivePeriod setQuery("UPDATE #__fb_sessions SET allowed='na', readtopics='' where userid=$my->id"«»);
            $database->query();
            setcookie("fboard_settings[prevvisit]", $fbSession->lasttime, time() + 31536000, '/');

            // do not reload the page if user is posting
            if ($func != "post"«»)
            {
                echo 'global $mosConfig_live_site;
$database->setQuery("UPDATE #__fb_sessions SET lasttime=$systime where userid=$my->id"«»);
$database->query();
mosRedirect($mosConfig_live_site.$_ENV["REQUEST_URI"]);';
            }
        }

        $database->setQuery("UPDATE #__fb_sessions SET lasttime=$systime where userid=$my->id"«»);
        $database->query();
    }

I'm afraid the table #__fb_sessions is updated twice don't you think (i'm a php beginner) ? Wouldn't it be possible to remove the two $database->...; lines from your hack ?
florut (User)
FB Translation Team
Gold Boarder
Posts: 195
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
Last Edit: 2007/06/12 05:01 By florut.
 
The administrator has disabled public write access.  
#11438
Re:Loads forum page then reloads once again? 1 Year, 2 Months ago  
Explore what mosRedirect does in joomla documentation
Code:

mosRedirect($mosConfig_live_site.$_ENV["REQUEST_URI"]);
You will find out that in case code processing gets inside that if statement in which we replaced that settimeout...reload, then if will never get to 2nd UPDATE.

In fact, I think that settimeout...reload had value of 100ms in it just so that php processing will get to that 2nd UPDATE line and be executed and reload happens after that.

Because if UPDATE wont happen, your code gets into endles loop of reloading.

This was implemented:
Code:

IF (session does not exist or it expired) {
    reload after 100ms
}
UPDATE session table and set last users visit time


Now IF we would change it to:
Code:

IF (session does not exist or it expired) {
    reload right away (leave code) which mosRedirect() does this file execution will end here
}
UPDATE session table and set last users visit time

If we hit mosRedirect it will never get to UPDATE session table so same IF statement will fail on next execution = endless loop

that is why
Code:

IF (session does not exist or it expired) {
    UPDATE session table and set last users visit time (copy of line outside IF)
    mosRedirect(); //leave this code, and reload everything (but happens before anything is printed out to user, so there is no reload visible)
}
UPDATE session table and set last users visit time

Prutkar (User)
Fresh Boarder
Posts: 17
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
 
The administrator has disabled public write access.  
#11459
Re:Loads forum page then reloads once again? 1 Year, 2 Months ago  
Thanks VERY much for taking time to explain. All the time i take on Joomla project is for learning, learning, and learning...

Well it's right that it's much more about an algorithmic problem than a php problem as i said... I think i have understood everything.

I just wonder where did you get the joomla documentation you are talking about ? I did not see anything about this function in the developer wiki ??
florut (User)
FB Translation Team
Gold Boarder
Posts: 195
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
The administrator has disabled public write access.  
#11466
Re:Loads forum page then reloads once again? 1 Year, 2 Months ago  
I think I did not get it from documentation, I observed core joomla components code and saw the function mosRedirect, then I was looking for its definition to understand what it does. You can find its definition in includes/joomla.php file.
Prutkar (User)
Fresh Boarder
Posts: 17
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
 
The administrator has disabled public write access.  
#12421
Re:Loads forum page then reloads once again? 1 Year, 2 Months ago  
We have implemented the hack and have found users now need to click twice on the forum menu item. I'm assuming this isn't to be expected?
jasonrhl (User)
Senior Boarder
Posts: 51
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
The administrator has disabled public write access.  
#12422
Re:Loads forum page then reloads once again? 1 Year, 2 Months ago  
No, it was working just fine (I can not present it as I took FireBoard off from my site due to reported problems posting new messages, database was being filled up by id and other information with 0 which resulted in Duplicate index error messages)

Please, read about mosRedirect to understand what that function does, it redirects, and it is redirecting to same URL as that javascript.
Prutkar (User)
Fresh Boarder
Posts: 17
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
 
The administrator has disabled public write access.  
#12426
Re:Loads forum page then reloads once again? 1 Year, 2 Months ago  
Yea I have the same problem as jasonrhl any ideas why?
zammbi (User)
Junior Boarder
Posts: 28
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
http://www.speedingpc.com - Repair, speed up and pimp your computer!
 
The administrator has disabled public write access.  
#12429
Re:Loads forum page then reloads once again? 1 Year, 2 Months ago  
So what happens after first click guys? Where is a bug report, please provide more information.
Prutkar (User)
Fresh Boarder
Posts: 17
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
 
The administrator has disabled public write access.  
#12441
Re:Loads forum page then reloads once again? 1 Year, 2 Months ago  
Well it seems to load to my home page sometimes and then I have to click a 2nd time to get to the forum. My server is down atm, once its up again I'll try find some more info.
zammbi (User)
Junior Boarder
Posts: 28
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
http://www.speedingpc.com - Repair, speed up and pimp your computer!
 
The administrator has disabled public write access.  
Go to top
Powered by FireBoard - Creditsget the latest posts directly to your desktop