Skip Confirmation page...slightly optimised
Posted February 5th 2012, 2:44pm
am not adding any copyrights...
@phpbb3 @IE9/Chrome/Opera/Firfeox
[strike]Firefox gives error...care to explain why?[/strike]


[strike]Allow this script only in posts pages. I willnt explain these codes unless I got it working in firefox somehow :([/strike]

add this line to change add onclick attribute to send button

$(function(){
$('#quick_reply .button2[name="post"]').attr('onclick', 'this.form.target=\'cgiFrame\';');});


for is submitted to hidden iframe (not dynamically created)
then add this
function skipper() {
var replyurl = document.getElementById('cgiFrame').contentWindow.location.href;
if ((replyurl.indexOf('/post') != -1)) {
var z = $(parent.cgiFrame.document.body).find('h1.page-title').next().find('a').attr('href'); //unique url
var pathArray = window.location.pathname.split('#');
window.location.href = pathArray[0] + z ;
} else {
return false;
}
}


code initiates after iframe completely loads...multiclick error avoided

then add this in your widget or forum description

<iframe name="cgiFrame" id="cgiFrame" onload="skipper()" src="" style="display:none; width:0px; height:0px"></iframe>
φ
Posts: 163
Joined: August 5th 2011, 11:00pm
Location: Pakistan
Likes Given: 34
Likes Received: 3
Skip Confirmation page...slightly optimised
Posted February 5th 2012, 4:30pm
ok done its working.
The optimisations are:

1] Even after confirmation page is skipped user will be redirected to the original post url (unique in every case], thus even when you reply to the last post of page 1 you will be redirected to page 2

2] Cross-browser

3] Even user multiclicks send button post will be submitted once

4] @ http://www.diondesigns.org/t8430-skippi ... ost-p10193 not happening
φ
Posts: 163
Joined: August 5th 2011, 11:00pm
Location: Pakistan
Likes Given: 34
Likes Received: 3
Skip Confirmation page...slightly optimised
Posted February 6th 2012, 2:31pm
So, and I can say that I created something similar yesterday. Skipping 'Your message has been sent' page. But I used ajax for it. :)) Your script is fine, but I don't test it yet.
φ
Posts: 37
Joined: August 27th 2011, 11:00pm
Location: Србија/Serbia
Likes Given: 4
Likes Received: 2
Skip Confirmation page...slightly optimised
Posted February 6th 2012, 4:13pm
What about making a pop up "window" that says "Loading..." then "Your message has been successfully sent"? is that possible?

bwt, i tested the code but it didn't works (:
φ
Posts:
Avatar
Guest
Skip Confirmation page...slightly optimised
Posted March 17th 2012, 2:52pm
the first post dosen't appear :(
φ
Posts: 42
Joined: October 11th 2011, 11:00pm
Likes Given: 13
Likes Received: 1
Skip Confirmation page...slightly optimised
Posted March 17th 2012, 5:07pm
viewtopic.php?p=12063#p12063

I added back this post manually. If you notice other posts that aren't displaying, and you would like to see them displayed, please let me know. I'll restore those posts when I have the time to do so.
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
Skip Confirmation page...slightly optimised
Posted March 22nd 2012, 3:37pm
Sorry to say this but the tutorial isn't working ..
φ
Posts: 42
Joined: October 11th 2011, 11:00pm
Likes Given: 13
Likes Received: 1
Skip Confirmation page...slightly optimised
Posted March 22nd 2012, 8:34pm
razvan said:
Sorry to say this but the tutorial isn't working ..

Since this is the User Contributions forum, perhaps you should send a PM to the author...
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357

Who is online

Users browsing this forum: No registered users and 1 guest