Previous Thread
Next Thread
Print Thread
Rate Thread
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:
Code
$meta = "<meta http-equiv=\"Refresh\" content=\"{$delay};url=" . make_ubb_url("ubb={$redirect['redirect']}", "", false) . "\" />";

REPLACE WITH:
Code
$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.


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Sponsored Links
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


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
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
Originally Posted by Bill B
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.


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Sponsored Links
Joined: Jul 2001
Posts: 1,157
Likes: 82
coffee and code
coffee and code
Joined: Jul 2001
Posts: 1,157
Likes: 82
Originally Posted by Gremelin
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.


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
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 6: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:
Code
$time = "5";

REPLACE WITH:
Code
$time = "2";

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.


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com

Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)