• Page 1 of 1
  • 1
uCause Community » Trash & Archives » Forum » Post a Message without Popups
Post a Message without Popups
AnimorphDate: Monday, 2011-06-27, 2:04 PM | Message # 1
uCause forum Admin
Group: Developer
Messages: 2835
Awards: 73
Status: :-(


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); _uWnd.alert('<img src="/.s/img/wd/3/ajax.gif" border="0" alt="download">','download',{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, 'Add Message'); $("#frF16").attr("disabled", false); setTimeout(function(){ _uWnd.close(namewnd) },2000);} else if ($(dt).text().indexOf("Message Added.") > -1) { $("textarea#message").val(""); $("form[name='addform'] input:file").val(""); _uWnd.content(namewnd, '<center>Added</center>'); _uWnd.setTitle(namewnd, 'Message Added.'); $("#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, 'Your Message has been added, Refresh the page to see it.'); _uWnd.setTitle(namewnd, 'Message Added.'); $("#frF16").attr("disabled", false); setTimeout(function(){ _uWnd.close(namewnd) },2000); }};</script><?endif?>
Attachments: 5596064.jpg(115.3 Kb)
 
0 Thanked you For This Useful Post:
BlazerDate: Monday, 2011-06-27, 4:05 PM | Message # 2
Member
Group: Senior Members
Messages: 471
Awards: 2
Reputation: 4
Status: :-(
Nice smile
 
0 Thanked you For This Useful Post:
jackassDate: Friday, 2011-07-01, 6:53 PM | Message # 3
Member
Group: Senior Members
Messages: 262
Awards: 4
Reputation: 8
Status: :-(
But still you need to refresh the page to see changes... Right?

 
0 Thanked you For This Useful Post:
AnimorphDate: Friday, 2011-07-01, 10:46 PM | Message # 4
uCause forum Admin
Group: Developer
Messages: 2835
Awards: 73
Status: :-(
jackass, yep , it only doesn't pop up anymore
 
0 Thanked you For This Useful Post:
BlazerDate: Friday, 2011-07-01, 11:57 PM | Message # 5
Member
Group: Senior Members
Messages: 471
Awards: 2
Reputation: 4
Status: :-(
Animorph, Can you make auto refresh ?
 
0 Thanked you For This Useful Post:
AnimorphDate: Friday, 2011-07-01, 11:57 PM | Message # 6
uCause forum Admin
Group: Developer
Messages: 2835
Awards: 73
Status: :-(
Blazer, I'm trying to smile
 
0 Thanked you For This Useful Post:
jackassDate: Sunday, 2011-07-03, 2:26 AM | Message # 7
Member
Group: Senior Members
Messages: 262
Awards: 4
Reputation: 8
Status: :-(
Animorph, without auto refresh this script will make people confused...

Quote
So did I add this message or no... cry


Like that tongue


 
0 Thanked you For This Useful Post:
BlazerDate: Sunday, 2011-07-03, 2:39 AM | Message # 8
Member
Group: Senior Members
Messages: 471
Awards: 2
Reputation: 4
Status: :-(
you can say instead of "Your Message has been added" - "Your Message has been added, Refresh the page to see it"
 
0 Thanked you For This Useful Post:
AnimorphDate: Sunday, 2011-07-03, 3:19 PM | Message # 9
uCause forum Admin
Group: Developer
Messages: 2835
Awards: 73
Status: :-(
Blazer, Good idea for now smile
 
0 Thanked you For This Useful Post:
HermesDate: Sunday, 2011-07-03, 3:22 PM | Message # 10
Member
Group: Senior Members
Messages: 455
Awards: 7
Reputation: 8
Status: :-(
jackass, Blazer,

Animorph, Know the solution, but not to boast wink
 
0 Thanked you For This Useful Post:
uCause Community » Trash & Archives » Forum » Post a Message without Popups
  • Page 1 of 1
  • 1
Search:


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