We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
  • Pages:
  • 1
  • 2
[ C ] Mod for Topic Auto Tool; Custom tool for replies made by members
Topic Started: Jun 21 2011, 01:51 PM (1,675 Views)
BettiePage
Member Avatar
Member
[ *  * ]
Board Address: http://s4.zetaboards.com/iwgc/index/
Board Software: ZetaBoards
Description: There isn't a whole lot of documentation on the Auto Tool system so I hope that someone can help with this. I would like a tool that can automatically make a reply to a post in a certain forum that would make it easy to post a score. I would like for any member to be able to use it and not have it be restricted to a certain member group. Is this possible to do with the Auto Tool System that is currently in place?

I would like for the following text to appear as a pre-written message (without the quotes):

"Round #?

Name: Score (OFFICIAL) playing in ? mode.
Name: Score (OFFICIAL or FUN) playing in ? mode.

OPTIONAL- Whatever other good sportsmanship message or game account information."


If I need a script to accomplish this, I would like the member to be able to fill in the information requested and then choose the post to reply to, say from a dropdown list. If I could have it so I could add my own links to the individual posts on that list that would be fantastic.

I hope I explained this properly. Let me know if you need me to clarify anything. Thanks!

Offline Profile Goto Top
 
Replies:
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
I only don't get the popup from fast reply, I get it in the other two ways though. Neither one of them post the information, however.
Offline Profile Goto Top
 
BettiePage
Member Avatar
Member
[ *  * ]
Ok, I've played with this some more and found that while in the main forum view the tool does not post. That's ok because I dont want it to post from there, so it should not show on that page.

There are three other places in the individual post that the autotool shows up, one is next to the topic moderation on the bottom left of the post. When I select the tool from there it posts as follows:

"OFFICIAL Round #: 2 AM or TPT/X: AMPlayer 1mePlayer 2you

OPTIONAL- Whatever other good sportsmanship message or game account information you would like to add: testing autotool"

It also appears in the quick reply box and when you add a reply to a topic under moderation options, but does not function from there.

The form should look like this:

OFFICIAL Round #: text input area
AM or TPT/X: text input area
Player 1: text input area
Player 2: text input area
Whatever other good sportsmanship message or game account information you would like to add (OPTIONAL): text input area


The resulting text output should look like this (obviously not in those exact words) with each entry on it's own line:

Round 2
AM
BettiePage: 60
JoeCool: 58

Great game, wish I could have done better. Oh well I'll get you next time :P .


I think there should be a cancel button on the form, don't you agree?

Is it possible to remove the tool from showing in other places and keep it to the spot next to the mod options at the bottom left corner of the post?

Is there a character limit on the optional score accounting? If so, there should not be and there doesn't seem to be a way to make line breaks when writing in the text box on the form. I test posted a rather long score accounting and it stretched the page waaaaaaaay right. Some of my members can be rather chatty and we like it that way :) .

Thanks so much for you help Q, it is really appreciated.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code:
 
select[name="autotools"] option[value="#"], span.right select[name="amt_menu"] option[value="#"] {
display: none;
}
Use that to remove the option from the forum page and fast reply, replace # with the ID of the autotool.
Offline Profile Goto Top
 
Quozzo
Member Avatar
By the blood of Sanguinius!
[ *  *  *  *  * ]
Give this a try
Code:
 
<script type='text/javascript'>
$('button[name=btn_amt_menu]').click(function(){
var s = $('select[name=amt_menu] option:selected').text();
var c = $('.bx_open').length;
var cx = $('.bx_open:checked');
if(s == "Score" && !c){
showLightbox($('form:first').attr('action').split("t=")[1],$('input[name=f]:first').val());
return false;
}else if(s == "Score" && c && cx.length == 1){
showLightbox(cx.attr("value"),$('form:first').attr('action').split("f=")[1]);
return false;
}else if(s == "Score" && c && cx.length != 1){
alert('you can only select one topic to use this autotool');
return false;
};
});

$('#fast-reply .btn_default').click(function(){
if($('select[name=autotools] option:selected').text() == "Score"){
showLightbox($('form:first').attr('action').split("t=")[1],$('input[name=f]:first').val());
return false;
};
});

function showLightbox(topic,forum){
$('body').append("<div class='lightbox' style='background-color: white; border-radius: 10px; text-align: left; padding: 10px; position: fixed; bottom:50%; left:35%; width:30%; z-index:999;'><span class='close' style='float:right;cursor:pointer;'>X</span>OFFICIAL Round #: <input name='input1' /><br />AM or TPT/X: <input name='input2' /><br /><br />Player 1: <input name='input3' /><br />Player 2: <input name='input4' /><br /><br />OPTIONAL- Whatever other good sportsmanship message or game account information you would like to add:<br /><textarea name='input5' rows='5'></textarea><br /><br /><button onClick='sendit("+topic+","+forum+")'>Send</button></div><div class='lightbox' style='background-color:rgba(0,0,0,0.5);position:fixed;width:100%;height:100%;z-index:998;bottom:0%;left:0%;'></div>");
};

$('.close').live('click', function(){
$('.lightbox').remove();
});

function sendit(topic,forum){
var content = "Round: "+$('input[name=input1]').val()+"\n"+$('input[name=input2]').val()+"\n"+$('input[name=input3]').val()+"\n"+$('input[name=input4]').val()+"\n\n"+$('textarea[name=input5]').val();
$('.lightbox').remove();
$.get(main_url+"post/?mode=2&type=1&f="+forum+"&t="+topic,function(d){
$.post(main_url+"post/",{mode:2,type:1,f:forum,t:topic,emo:1,ast:$("input[name=ast]",d).val(),xc:$("input[name=xc]",d).val(),post: content,q:0,qhash:$("input[name=qhash]",d).val(),sd:1,fcolor:'',helpbox:'Quote Text',zbpost:0,attach1:'',mod_opts:'',sig:1,post_submit:''});
location.href = location.href;
});
};
</script>
Offline Profile Goto Top
 
BettiePage
Member Avatar
Member
[ *  * ]
OMG!!! This thing is awesome BUT....you knew there was one :ermm:

My members can't see it :stunned: only I can. HELP!
Ok Quozzo, here is an update on this. Upon further testing and some video assistance for the members that couldn't see it, this is what we found:

In IE8 with Windows XP it works.
In Opera, Firefox and IE9 with Vista and on a Mac with Firefox it is invisible to the user.

I have no idea what is going on. If it has something to do with the autotool itself or what. I was logged in as Admin and as a regular member and could see it and use it just fine.
Edited by BettiePage, Jul 16 2011, 11:04 AM.
Offline Profile Goto Top
 
Quozzo
Member Avatar
By the blood of Sanguinius!
[ *  *  *  *  * ]
try this instead, you need to remove the autotool from the ACP as it adds its own button.

[edit]

Code:
 
<script type='text/javascript'>
$('.posts .c_foot .right,.topic .c_foot .left').append("<select class='memtools'><optgroup label='Member Tools'><option>Score</option></optgroup></select><button class='memtools_btn' type='button'>Submit</button>");

$('.memtools_btn').click(function(){
var s = $('.memtools option:selected').text();
var c = $('.bx_open').length;
var cx = $('.bx_open:checked');
if(s == "Score" && !c){
showLightbox($('form:first').attr('action').split("t=")[1],$('input[name=f]:first').val());
return false;
}else if(s == "Score" && c && cx.length == 1){
showLightbox(cx.attr("value"),$('form:first').attr('action').split("f=")[1]);
return false;
}else if(s == "Score" && c && cx.length != 1){
alert('you can only select one topic to use this autotool');
return false;
};
});

function showLightbox(topic,forum){
$('body').append("<div class='lightbox' style='background-color: white; border-radius: 10px; text-align: left; padding: 10px; position: fixed; bottom:50%; left:35%; width:30%; z-index:999;'><span class='close' style='float:right;cursor:pointer;'>X</span>OFFICIAL Round #: <input name='input1' /><br />AM or TPT/X: <input name='input2' /><br /><br />Player 1: <input name='input3' /><br />Player 2: <input name='input4' /><br /><br />OPTIONAL- Whatever other good sportsmanship message or game account information you would like to add:<br /><textarea name='input5' rows='5'></textarea><br /><br /><button onClick='sendit("+topic+","+forum+")'>Send</button></div><div class='lightbox' style='background-color:rgba(0,0,0,0.5);position:fixed;width:100%;height:100%;z-index:998;bottom:0%;left:0%;'></div>");
};

$('.close').live('click', function(){
$('.lightbox').remove();
});

function sendit(topic,forum){
var content = "Round: "+$('input[name=input1]').val()+"\n"+$('input[name=input2]').val()+"\n"+$('input[name=input3]').val()+"\n"+$('input[name=input4]').val()+"\n\n"+$('textarea[name=input5]').val();
$('.lightbox').remove();
$.get(main_url+"post/?mode=2&type=1&f="+forum+"&t="+topic,function(d){
$.post(main_url+"post/",{mode:2,type:1,f:forum,t:topic,emo:1,ast:$("input[name=ast]",d).val(),xc:$("input[name=xc]",d).val(),post: content,q:0,qhash:$("input[name=qhash]",d).val(),sd:1,fcolor:'',helpbox:'Quote Text',zbpost:0,attach1:'',mod_opts:'',sig:1,post_submit:''});
var loc = location.href;
if(/topic/.test(loc)){
location.href = loc;
};
});
};
</script>


omg, ive a banging headache and forgot to post the actual code lol.
Edited by Quozzo, Jul 16 2011, 09:42 PM.
Offline Profile Goto Top
 
BettiePage
Member Avatar
Member
[ *  * ]
Hey Q, this revision is even better than the last except that it doesn't seem to work in anything other that IE. Is there a fix for that?
Offline Profile Goto Top
 
Quozzo
Member Avatar
By the blood of Sanguinius!
[ *  *  *  *  * ]
The only problem i can see is that some browsers don't refresh the page when its posts, a quick tap on f5 should suffice. What browsers are having problems?
Offline Profile Goto Top
 
BettiePage
Member Avatar
Member
[ *  * ]
Hi Q, it is the strangest thing. It works for me in IE8, but for others it doesn't. He has javascript enabled and he can't even see it. I even posted screenshots of where to find it and they atill can't see it. I am the only one who can.

Is there something in the code that prevents someone who is not an Admin from using it? That is the only thing I can think of. All members regardless of their rank or permissions need to be able to use the tool, except probationary, guests and validating.

The following member groups need permission to use the tool; Admins, Members, Trustee & Charter Member. Perhaps there needs to be something added to the existing code that allows those groups to see and use the tool???
Edited by BettiePage, Jul 19 2011, 03:11 PM.
Offline Profile Goto Top
 
Quozzo
Member Avatar
By the blood of Sanguinius!
[ *  *  *  *  * ]
This will show the option in topics for members but not in a forum, that's for mods only ;)
Code:
 
<script type='text/javascript'>
if(/topic/.test(location.href) && !$('.topic .c_foot .left').length){
$('.c_view').parent().after("<tr><td colspan='2' class='c_foot'><div class='left'></div></td></tr>");
};
$('.posts .c_foot .right,.topic .c_foot .left').append("<select class='memtools'><optgroup label='Member Tools'><option>Score</option></optgroup></select><button class='memtools_btn' type='button'>Submit</button>");

$('.memtools_btn').live('click', function(){
var s = $('.memtools option:selected').text();
var c = $('.bx_open').length;
var cx = $('.bx_open:checked');
if(s == "Score" && !c){
showLightbox($('form:first').attr('action').split("t=")[1],$('input[name=f]:first').val());
return false;
}else if(s == "Score" && c && cx.length == 1){
showLightbox(cx.attr("value"),$('form:first').attr('action').split("f=")[1]);
return false;
}else if(s == "Score" && c && cx.length != 1){
alert('you can only select one topic to use this autotool');
return false;
};
});

function showLightbox(topic,forum){
$('body').append("<div class='lightbox' style='background-color: white; border-radius: 10px; text-align: left; padding: 10px; position: fixed; bottom:50%; left:35%; width:30%; z-index:999;'><span class='close' style='float:right;cursor:pointer;'>X</span>OFFICIAL Round #: <input name='input1' /><br />AM or TPT/X: <input name='input2' /><br /><br />Player 1: <input name='input3' /><br />Player 2: <input name='input4' /><br /><br />OPTIONAL- Whatever other good sportsmanship message or game account information you would like to add:<br /><textarea name='input5' rows='5'></textarea><br /><br /><button onClick='sendit("+topic+","+forum+")'>Send</button></div><div class='lightbox' style='background-color:rgba(0,0,0,0.5);position:fixed;width:100%;height:100%;z-index:998;bottom:0%;left:0%;'></div>");
};

$('.close').live('click', function(){
$('.lightbox').remove();
});

function sendit(topic,forum){
var content = "Round: "+$('input[name=input1]').val()+"\n"+$('input[name=input2]').val()+"\n"+$('input[name=input3]').val()+"\n"+$('input[name=input4]').val()+"\n\n"+$('textarea[name=input5]').val();
$('.lightbox').remove();
$.get(main_url+"post/?mode=2&type=1&f="+forum+"&t="+topic,function(d){
$.post(main_url+"post/",{mode:2,type:1,f:forum,t:topic,emo:1,ast:$("input[name=ast]",d).val(),xc:$("input[name=xc]",d).val(),post: content,q:0,qhash:$("input[name=qhash]",d).val(),sd:1,fcolor:'',helpbox:'Quote Text',zbpost:0,attach1:'',mod_opts:'',sig:1,post_submit:''});
var loc = location.href;
if(/topic/.test(loc)){
location.href = loc;
};
});
};
</script>


Thanks for the PM too, you edited the post after i read it so i had no idea you needed something else.
Offline Profile Goto Top
 
Minato
Member Avatar
Let Me Be With You
[ *  *  *  *  * ]
Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic
  • Pages:
  • 1
  • 2