Previous Thread
Next Thread
Print Thread
Rate Thread
[7.x] Remove the middle acknowledgement page delay #319261
05/08/2014 1:26 AM
05/08/2014 1:26 AM
Joined: Jul 2001
Posts: 1,170
California
isaac Online happy OP
$coffee=code(true);
isaac  Online Happy OP
$coffee=code(true);
Joined: Jul 2001
Posts: 1,170
California
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.

Sponsored Links
Re: [7.x] Remove the middle acknowledgement page delay [Re: isaac] #319262
05/08/2014 4:18 AM
05/08/2014 4:18 AM
Joined: Dec 2001
Posts: 84
Issaquah, WA
Bill B Offline
Power User
Bill B  Offline
Power User
Joined: Dec 2001
Posts: 84
Issaquah, WA
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
Re: [7.x] Remove the middle acknowledgement page delay [Re: isaac] #319263
05/08/2014 4:43 AM
05/08/2014 4:43 AM
Joined: Jan 2000
Posts: 5,938
Portland, OR, USA
Gizmo Offline

UBB.Dev / UBB.Wiki Owner
Time Lord
Gizmo  Offline

UBB.Dev / UBB.Wiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,938
Portland, OR, USA
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, UBB.Sitemaps
Re: [7.x] Remove the middle acknowledgement page delay [Re: isaac] #319264
05/08/2014 5:46 AM
05/08/2014 5:46 AM
Joined: Dec 2001
Posts: 84
Issaquah, WA
Bill B Offline
Power User
Bill B  Offline
Power User
Joined: Dec 2001
Posts: 84
Issaquah, WA
For the life of me, I couldn't find which file it was in.


Bill Barker
Issaquah, Wa
Re: [7.x] Remove the middle acknowledgement page delay [Re: Bill B] #319265
05/08/2014 6:02 AM
05/08/2014 6:02 AM
Joined: Jul 2001
Posts: 1,170
California
isaac Online happy OP
$coffee=code(true);
isaac  Online Happy OP
$coffee=code(true);
Joined: Jul 2001
Posts: 1,170
California
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.

Sponsored Links
Re: [7.x] Remove the middle acknowledgement page delay [Re: Gizmo] #319266
05/08/2014 6:18 AM
05/08/2014 6:18 AM
Joined: Jul 2001
Posts: 1,170
California
isaac Online happy OP
$coffee=code(true);
isaac  Online Happy OP
$coffee=code(true);
Joined: Jul 2001
Posts: 1,170
California
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.

Re: [7.x] Remove the middle acknowledgement page delay [Re: isaac] #319267
05/08/2014 6:20 AM
05/08/2014 6:20 AM
Joined: Dec 2001
Posts: 84
Issaquah, WA
Bill B Offline
Power User
Bill B  Offline
Power User
Joined: Dec 2001
Posts: 84
Issaquah, WA
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
Re: [7.x] Remove the middle acknowledgement page delay [Re: Bill B] #319268
05/08/2014 6:28 AM
05/08/2014 6:28 AM
Joined: Jul 2001
Posts: 1,170
California
isaac Online happy OP
$coffee=code(true);
isaac  Online Happy OP
$coffee=code(true);
Joined: Jul 2001
Posts: 1,170
California
@ 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.


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
· Blue Host
· Interserver.net
Visit Us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,938
Joined: January 2000
Show All Member Profiles 
Forum Statistics
Forums64
Topics37,448
Posts293,484
Members13,793
Most Online1,498
Mar 17th, 2017
Top Posters(All Time)
AllenAyres 25,587
JoshPet 11,330
Rick 8,373
LK 7,396
Lord Dexter 6,503
Gizmo 5,938
Greg Hard 5,533
Top Posters(30 Days)
isaac 4
Today's Statistics
Currently Online 731
Topics Created 0
Posts Made 0
Users Online 0
Birthdays 20
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2018 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 7.6.2
(Preview build 20180611.dev)
Page Time: 0.038s Queries: 15 (0.012s) Memory: 3.2815 MB (Peak: 3.4537 MB) Zlib enabled. Server Time: 2018-06-20 14:49:56 UTC