• Page 1 of 1
  • 1
Forum moderator: bigblog  
uCoz Community » For Webmasters » Custom Solutions » Skipping forum redirection page after posting a reply?
Skipping forum redirection page after posting a reply?
Skan
Posts: 43
Reputation: 0

Message # 1 | 8:44 PM
Hello!

Is there any way that i could skip the page which follows right after i post something on a thread on ucoz forum?
I find it kinda useless to redirect to a page to go again to same page from where i left. It would be nice that after i post a message to just refresh the page.

Thanks!
Paradox
Old Guard
Posts: 3284
Reputation: 145

Message # 2 | 7:26 AM
Skan, the following script should help. wink You may need to adjust it slightly. This was developed by a friend of mine, however, the site has been since closed down so I am posting it here for the sake of liberty.

Code
<?if($PAGE_ID$='threadpage')?><script type="text/javascript">function haveFiles(){var f = false;$("input.uplFileFl").each(function(){if ($(this).val()) f=true;});return f}document.addform.onsubmit = function(){var namewnd = "w" + Math.floor(Math.random()*999); if (haveFiles()) {_uPostForm($("form[name='addform']"), {success: function(dt){ parseResult(dt, namewnd);}})} else {$.post("/forum", $("form[name='addform']").serialize(), function(dt) {parseResult(dt, namewnd)})};return false;};function parseResult(dt, namewnd){var err = $("#frM2", dt).text(), thmurl = $("a:first", dt).attr("href"); if (err) {_uWnd.content(namewnd, '<center>'+err+'</center>'); _uWnd.setTitle(namewnd, 'error'); $("#frF16").attr("disabled", false); setTimeout(function(){ _uWnd.close(namewnd) },2000);} else if ($(dt).text().indexOf("added") > -1) { $("textarea#message").val(""); $("form[name='addform'] input:file").val(""); _uWnd.content(namewnd, '<center>God bless you</center>'); _uWnd.setTitle(namewnd, 'success'); $("#frF16").attr("disabled", false); setTimeout(function(){ _uWnd.close(namewnd) },2000); setTimeout(function(){ <?if $PAGE_ID$='threadpage'?>$(".gDivRight:first").load(thmurl + "?" + Math.floor(Math.random()*9999) + " .gDivRight:first"); setPnt(thmurl);<?endif?><?if $PAGE_ID$='addthread' or $PAGE_ID$='addpoll'?>setPnt($("td.forumNamesBar:first a.forumBarA:last", dt).attr("href"), true);<?endif?>}, 50);} else { _uWnd.content(namewnd, 'While adding an error occurred'); _uWnd.setTitle(namewnd, 'failed'); $("#frF16").attr("disabled", false); setTimeout(function(){ _uWnd.close(namewnd) },2000); }};</script><?endif?>

Jack of all trades in development, design, strategy.
Working as a Support Engineer.
Been here for 13 years and counting.
Skan
Posts: 43
Reputation: 0

Message # 3 | 11:55 AM
Paradox, Hello, thanks for your reply/code but it seems that it's not working. the forum still has the redirect page after posting a reply.
Is there somewhere specific where i should add the code? I've added it on forum and appearance of entries page but it's not working.
Somewhere where i make a mistake?

Thanks
Paradox
Old Guard
Posts: 3284
Reputation: 145

Message # 4 | 11:58 AM
Skan, ah, yes, you need to post it after $BODY in the General forum appearance template. wink Apologies for not having mentioned earlier. smile
Jack of all trades in development, design, strategy.
Working as a Support Engineer.
Been here for 13 years and counting.
Skan
Posts: 43
Reputation: 0

Message # 5 | 2:10 PM
Paradox, wow dude, thanks a lot, that made thing very easy for me!

And... by any chance... is there any way of showing the loading icon in browser's tab icon after i press the Post Reply button?
Some friend told me that he wasn't sure that the website got it and pressed several times from which resulted many messages with same content.

Thanks!
uCoz Community » For Webmasters » Custom Solutions » Skipping forum redirection page after posting a reply?
  • Page 1 of 1
  • 1
Search: