|
Joined: Jul 2001
Posts: 1,157 Likes: 82
coffee and code
|
coffee and code
Joined: Jul 2001
Posts: 1,157 Likes: 82 |
About:This additional javascript enables modern browsers to forward directly to the next page without needing to load the "middle" acknowledgement page. It removes the "2 second" delay page between new posts, post edits, post deletions...etc. This also eliminates the server building and page downloading of your site's header-page-footer templates, saving a bit of server resources, and bandwidth for the user -- who might be on a data-limited mobile devices. Because it does not remove the "refresh" meta tag, it keeps the "view post" and "return to the forum" middle-page functionality for older browsers -- which cannot support the "window.location.href" script command. I'm looking at you, IE6! This is just a quick upgrade in which many users have asked for in the past -- without removing the current functionality for older browsers and browsers with javascript turned off. How-To:FIND IN libs/html.inc.php: $meta = "<meta http-equiv=\"Refresh\" content=\"{$delay};url=" . make_ubb_url("ubb={$redirect['redirect']}", "", false) . "\" />"; REPLACE WITH: $meta = "<meta http-equiv=\"Refresh\" content=\"{$delay};url=" . make_ubb_url("ubb={$redirect['redirect']}", "", false) . "\" /><script type=\"text/javascript\">window.location.href = \"" . make_ubb_url("ubb={$redirect['redirect']}", "", false) . "\"</script>"; done.
|
|
|
|
Joined: Dec 2001
Posts: 87
Power User
|
Power User
Joined: Dec 2001
Posts: 87 |
What a good "tweak". These are the kinds of things that I really hope get added to any future upgrade... It would be a shame to have to go back and manually add them... eg. Stop Forum Spam.
Bill Barker Issaquah, Wa
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
You should add the control panel one as well, it's a 2 second delay listed in the libs
|
|
|
|
Joined: Dec 2001
Posts: 87
Power User
|
Power User
Joined: Dec 2001
Posts: 87 |
For the life of me, I couldn't find which file it was in.
Bill Barker Issaquah, Wa
|
|
|
|
Joined: Jul 2001
Posts: 1,157 Likes: 82
coffee and code
|
coffee and code
Joined: Jul 2001
Posts: 1,157 Likes: 82 |
For the life of me, I couldn't find which file it was in. libs/html.inc.php @ about line 562 of UBBT 7.5.8-r2 And while you're in there, if you wanted to change the refresh delay for older browsers; about 3 lines up, change "$delay = 2;" from 2, to 5, or whatever. The number is the automatic page refresh delay in seconds. BTW, I just updated the OP to add a better description of what this mod does.
|
|
|
|
Joined: Jul 2001
Posts: 1,157 Likes: 82
coffee and code
|
coffee and code
Joined: Jul 2001
Posts: 1,157 Likes: 82 |
You should add the control panel one as well, it's a 2 second delay listed in the libs You might not want to add it to the control panel. I can see problems occurring when an admin user runs one of the "Content Rebuilder" options (Rebuild Posts, Rebuild Topics, Rebuild Forums...etc) This may kill your server/database -- or at the very least, to the admin running the command, make it look like the page isn't loading at all. In the same sentence, there is a "refresh delay" of 5 seconds at about line 1393 of html.inc.php regarding incorrect/bad password entry ("BAD_PASS") that should be left as-is, or extended to 10 seconds if you so choose.
|
|
|
|
Joined: Dec 2001
Posts: 87
Power User
|
Power User
Joined: Dec 2001
Posts: 87 |
Sorry. I meant that I couldn't find which file controlled the Control Panel delay that Gremlin (?) mentioned.
ADD: I see you posted while I was typing... Okay, understand about not pushing the CP too much. I'll skip that. Thanks.
Last edited by Bill B; 05/08/2014 5:23 AM. Reason: Added comment
Bill Barker Issaquah, Wa
|
|
|
|
Joined: Jul 2001
Posts: 1,157 Likes: 82
coffee and code
|
coffee and code
Joined: Jul 2001
Posts: 1,157 Likes: 82 |
@ Bill, libs/admin.inc.php @ about line 338 FIND: REPLACE WITH: Personally, I have mine set to "2" seconds, but the default is "5" seconds. You can modify it to whatever you want that delay to be. Be aware of the condition I mentioned above, regarding the Content Rebuilder requiring some sort of delay.
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 808
Joined: July 2001
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|