• Page 1 of 2
  • 1
  • 2
  • »
uCause Community » Trash & Archives » Forum » Post a Message without Popups V2
Post a Message without Popups V2
AnimorphDate: Tuesday, 2011-07-05, 7:45 PM | Message # 1
uCause forum Admin
Group: Developer
Messages: 2835
Awards: 73
Status: :-(
This is exactly the same as:
http://ucause.ucoz.com/forum/56-447-1

but your message will be added directly smile also used in uCause

go to CP ---> Design ---> Design management (templates) ---> Forum ---> General Appearance of forum pages ---> After $BODY$ paste:

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?>
 
0 Thanked you For This Useful Post:
ParadoxDate: Tuesday, 2011-07-05, 7:46 PM | Message # 2
Haunter
Group: Senior Members
Messages: 468
Awards: 6
Reputation: 11
Status: :-(
Nice script. wink

Request Terminated_
 
0 Thanked you For This Useful Post:
SirDarknight(Tonmoy)Date: Tuesday, 2011-07-05, 7:47 PM | Message # 3
Member
Group: Senior Members
Messages: 894
Awards: 10
Reputation: 15
Status: :-(
I like it

Please Give Me A Award or + Rep If My Post Helps You

Please Give Me A Award or + Rep If You Like my Scripts
 
0 Thanked you For This Useful Post:
AnimorphDate: Tuesday, 2011-07-05, 7:51 PM | Message # 4
uCause forum Admin
Group: Developer
Messages: 2835
Awards: 73
Status: :-(
Its used in uCause and working
 
0 Thanked you For This Useful Post:
MeepDate: Tuesday, 2011-07-05, 8:13 PM | Message # 5
Member
Group: Senior Members
Messages: 28
Awards: 0
Reputation: 1
Status: :-(
Lovely scripts smile
 
0 Thanked you For This Useful Post:
HermesDate: Tuesday, 2011-07-05, 8:30 PM | Message # 6
Member
Group: Senior Members
Messages: 455
Awards: 7
Reputation: 8
Status: :-(
Animorph, Good job! smile
 
0 Thanked you For This Useful Post:
BlazerDate: Tuesday, 2011-07-05, 8:40 PM | Message # 7
Member
Group: Senior Members
Messages: 471
Awards: 2
Reputation: 4
Status: :-(
nice work
 
0 Thanked you For This Useful Post:
AnimorphDate: Tuesday, 2011-07-05, 9:01 PM | Message # 8
uCause forum Admin
Group: Developer
Messages: 2835
Awards: 73
Status: :-(
Blazer, Hermes, Meep, SirDarknight(Tonmoy), Paradox, Thankyou
 
0 Thanked you For This Useful Post:
jackassDate: Thursday, 2011-07-07, 1:02 AM | Message # 9
Member
Group: Senior Members
Messages: 262
Awards: 4
Reputation: 8
Status: :-(
It still works only after refresh...

 
0 Thanked you For This Useful Post:
HermesDate: Thursday, 2011-07-07, 2:29 AM | Message # 10
Member
Group: Senior Members
Messages: 455
Awards: 7
Reputation: 8
Status: :-(
jackass,

Not true! The script works for me now is already 2 months!
Scripts originating from the Russian interface and is exclusively customized to work with the English interface.
Act in accordance with installation instructions! (Delete the original, old script!)

... and uCause the first English forum to which was published this script wink


Message edited by Hermes - Thursday, 2011-07-07, 2:32 AM
 
0 Thanked you For This Useful Post:
AnimorphDate: Thursday, 2011-07-07, 1:17 PM | Message # 11
uCause forum Admin
Group: Developer
Messages: 2835
Awards: 73
Status: :-(
jackass, The scripts works perfectly i use it on uCause
 
0 Thanked you For This Useful Post:
jackassDate: Thursday, 2011-07-07, 7:50 PM | Message # 12
Member
Group: Senior Members
Messages: 262
Awards: 4
Reputation: 8
Status: :-(
Quote (Hermes)
work with the English interface

Well, I didn't know that, I am using Latvian interface tongue

So what I need to edit?


 
0 Thanked you For This Useful Post:
HermesDate: Friday, 2011-07-08, 4:03 AM | Message # 13
Member
Group: Senior Members
Messages: 455
Awards: 7
Reputation: 8
Status: :-(
Quote (jackass)
Well, I didn't know that, I am using Latvian interface


Code
<?if$PAGE_ID$='threadpage' or $PAGE_ID$='addthread' or $PAGE_ID$='addpoll'?><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); _uWnd.alert('<img src="/.s/img/wd/3/ajax.gif" border="0" alt="Загрузка">','Загрузка',{name: namewnd, w: 250, h: 80, tm: 0}); $("#frF16").attr("disabled", true); 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, 'Ошибка'); $("#frF16").attr("disabled", false); setTimeout(function(){ _uWnd.close(namewnd) },2000);} else if ($(dt).text().indexOf("Ответ добавлен") > -1) { $("textarea#message").val(""); $("form[name='addform'] input:file").val(""); _uWnd.content(namewnd, '<center>Добавлено</center>'); _uWnd.setTitle(namewnd, 'Успех'); $("#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, 'Во время отправки произошла обишка'); _uWnd.setTitle(namewnd, 'Не удалось'); $("#frF16").attr("disabled", false); setTimeout(function(){ _uWnd.close(namewnd) },2000); }};</script><?endif?>
 
0 Thanked you For This Useful Post:
jackassDate: Friday, 2011-07-08, 4:58 PM | Message # 14
Member
Group: Senior Members
Messages: 262
Awards: 4
Reputation: 8
Status: :-(
Hermes, this is with popup I still need to refresh!

 
0 Thanked you For This Useful Post:
HermesDate: Saturday, 2011-07-09, 3:54 AM | Message # 15
Member
Group: Senior Members
Messages: 455
Awards: 7
Reputation: 8
Status: :-(
Quote (jackass)
Hermes, this is with popup I still need to refresh!


jackass,

Upper script is original with all forums that use Russian interface. The script works.
Other assistance not know you offer. After not know the difference between Latvia and Russia. In addition, to shift the forum interface to Russian or English. But then you can have a problem with other scripts that are on your forum. Nevertheless, at each interface for which you decide you can put the translation. I am translating from English to Serbian forum, which is a language forum.
 
0 Thanked you For This Useful Post:
uCause Community » Trash & Archives » Forum » Post a Message without Popups V2
  • Page 1 of 2
  • 1
  • 2
  • »
Search:


"Making uCoz web designs simple and easy to use"
- uCause Developers