Welcome Guest [Log In] [Register]
Search Members Calendar | Rules ZB Code Index IF Code Index
ZBCode
  • Navigation
  • ZBCode
  • Coding Resources
  • Code Requests
  • Completed Requests
  • [Completed] [ZB] Appeal Offense Form
Hey, welcome to ZBCode, the premier coding forum for ZB. Here you fill find some of the best Invisionfree and Zetaboards Codes on the network! Unfortunately, you're sorta hovering around in guest mode at the moment; why not join in on the fun? Register an account and you can start accessing the wealth of resources we have available here. Enjoy your stay at ZBCode, and remember to tell all your friends about us; the more members, the more codes available. ;)

Interested in joining? Click here.


If you are already a member of ZBCode, feel free to login right here:

Username:   Password:
Locked Topic
  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
[Completed] [ZB] Appeal Offense Form
Tweet Topic Started: Sep 9 2009, 08:30 PM (1,497 Views)
Firestrife2 Sep 16 2009, 03:00 PM Post #31
Member Avatar


Posts:
159
Group:
Dedicated
Member
#2,094
Joined:
Jan 21, 2009
I found a few small errors that I made, but this should work fine. By the way, only edit the "If(location.href.match" if your page is named something other than appeal. In that case, replace Both of them like this:

if(location.href.match(/pages\/\PAGENAME/i)){

You should know where to edit everything else. I'm putting some [ b ] tags in the actual message, just because I think it looks better. Has the same effect you would want + better design xD.

Code:
 
getuser=document.getElementById('top_info').getElementsByTagName('strong')[0];

if(!getuser.innerHTML.match("Guest")){
if(location.href.match(/pages\/\appeal/i)){
$("button[name=sendit]").click(function(){
message = "[b]Username:[/b] "+$('#top_info strong a').html()+"\n[b]Date:[/b] "+$('input[name=date]').val()+"\n[b]Offence commited:[/b] "+$('input[name=offence]').val()+"\n[b]Why it should be removed:[/b]\n"+$('textarea[name=reason]').val()+"\n\n[b]Additional comments:[/b]\n"+$('textarea[name=reason]').val()
$.get(main_url + 'msg/?c=2', function(e) {
var xc = $('input[name=xc]',e).val(), msg = $('input[name=msg]',e).val(), secure = $('input[name=secure]', e).val(), fwd = $('input[name=fwd]').val(), convo = $('input[name=convo]',e).val(), draft_edit = $('input[name=draft_edit]',e).val(), name = "Brandt", title = "Offence appeal";
$.post(main_url + 'msg/?c=3&sd=1', {
xc:xc, msg:msg, secure:secure, fwd:fwd, convo:convo, draft_edit:draft_edit, name:name, title:title, post:message },
function(r) {
$("#appealoffense").html("<tr><td>Appeal sent. Please wait at least 24 hours for an administrator to take any action/response toward the appeal.</td></tr>");
});
});
});
}
}else{
if(location.href.match(/pages\/\appeal/i)){
$("button[name=sendit]").click(function(){
alert("Guests may not use the Appeal Offense system. Please log in.");});
}
}



If you notice after "function(r){" I added "$("#appealoffense").html("<tr><td>Appeal sent. Please wait at least 24 hours for an administrator to take any action/response toward the appeal.</td></tr>");" instead of an alert. It is a lot smoother and I like it a lot better xD. If not you can just replace that with "alert("Appeal Sent."); otherwise this is the template you should use:

Code:
 
<div class="category">
<table class="cat_head">
<tr>
<td>
<h2>
<div align="center">Contest an Offense</div>
</h2>
</td>
</tr>
</table>
</div>
<table>

<tr>
<td style="width:25%">

</td>
<td style="width:75%">

</td>
</tr>
<tr>
<td>
<span style="font-weight:bold;">How to contest an offense:</span>
</td>
<td>
If your Scapers' Clearing account has accumulated an offense or offenses, such as a warning, ban, or other restriction, and you feel as if it should be removed, please fill out the below forms and submit it to forum administration for further review. <p></p>For more information on account termination & suspension, please click <a href="http://s1.zetaboards.com/Scapers_Clearing/topic/1960389/1/?x=15">here</a>. <p></p>If you are unsure of what offenses you may have, please inquire about them by private messaging <a href="http://s1.zetaboards.com/Scapers_Clearing/profile/316319/">Brandt.</a></div></div>
</td>
</tr>
<tr>
<td colspan="2">
<span style="line-height:10%">

</span>
</td>
</tr>
</table>

<table id="appealoffense">
<tr>
<th colspan="2">
<h2>
Please fill out the below fields:
</h2>
</th>
</tr>
<tr>
<td>
<span style="font-weight:bold;">Date:</span>
</td>
<td>
<input name='date'></input><br>
</td>
</tr>
<tr>
<td>
<span style="font-weight:bold;">Offense committed:</span>
</td>
<td>
<input name='offence'></input><br>
</td>
</tr>
<tr>
<td>
<span style="font-weight:bold;">Why it should be removed:</span>
</td>
<td>
<textarea name='reason'></textarea><br><br>
</td>
</tr>
<tr>
<td>
<span style="font-weight:bold;">Additional information:</span>
</td>
<td>
<textarea name='additional'></textarea><br>
</td>
</tr>

<td colspan="2">
<span style="line-height:10%">

</span>
</td>
</tr>

</table>
<p></p>
<button name='sendit'>Submit</button>


Enjoy.

Did ya lose me? I feel like you might have...If you're confused tell me what to put where and I'll do it :3.
Posted Image

Posted Image
Offline Profile Goto Top
 
Desire Law Sep 16 2009, 04:46 PM Post #32


Posts:
114
Group:
Dedicated
Member
#3,362
Joined:
Jul 26, 2009
Coding language
None
It still doesn't seem to function properly, but it likely was an error on my part. I'll test it out later when I'm not so busy. ;)
Offline Profile Goto Top
 
stargazer Sep 17 2009, 09:37 AM Post #33


Posts:
219
Group:
Dedicated
Member
#2,299
Joined:
Feb 11, 2009
Coding language
HTML/CSS
Thank you, I will test this.

Gregor, have you had any luck on sending the appeal to a staff access only forum?
Offline Profile Goto Top
 
RedBldSandman Sep 17 2009, 11:01 AM Post #34
Member Avatar
ZIPPY!

Posts:
482
Group:
Coding Staff
Member
#2,122
Joined:
Jan 25, 2009
I made one just for funsies:
Code:
 
<div class="category">
<table class="cat_head">
<tr>
<td>
<h2>
<div align="center">Contest an Offense</div>
</h2>
</td>
</tr>
</table>
</div>
<table>
<tr>
<td style="width:25%">

</td>
<td style="width:75%">

</td>
</tr>
<tr>
<td>
<span style="font-weight:bold;">How to contest an offense:</span>
</td>
<td>
If your Scapers' Clearing account has accumulated an offense or multiple offenses, such as a warning, ban, or another restriction and you feel that it should be removed, please fill out the below form and submit it to forum administration for further review. <p></p>For more information on account termination & suspension, please click <a href="http://s1.zetaboards.com/Scapers_Clearing/topic/1960389/1/?x=15">here</a>. <p></p>If you are unsure of what offenses you may have, please inquire about them by private messaging <a href="http://s1.zetaboards.com/Scapers_Clearing/profile/316319/">Brandt.</a></div></div>
</td>
</tr>
<tr>
<td colspan="2">
<span style="line-height:10%">

</span>
</td>
</tr>
</table>

<table id="app_table">
<tr>
<th colspan="2">
<h2>
Please fill out the below fields:
</h2>
</th>
</tr>
<tr>
<td>
<span style="font-weight:bold;">Date:</span>
</td>
<td>
<input name='app_date'></input><br />
</td>
</tr>
<tr>
<td>
<span style="font-weight:bold;">Offense committed:</span>
</td>
<td>
<input name='app_offence'></input><br />
</td>
</tr>
<tr>
<td>
<span style="font-weight:bold;">Reason for removal:</span>
</td>
<td>
<textarea name='app_reason'></textarea><br />
</td>
</tr>
<tr>
<td>
<span style="font-weight:bold;">Additional information:</span>
</td>
<td>
<textarea name='app_additional'></textarea><br />
</td>
</tr>

</table>
<div id="app_ajax" style="text-align:center;">
<br />
<button name='app_send'>Submit</button>
</div>
<script type="text/javascript">

var app_recipient = "RECIPIENT NAME"

jQuery("button[name='app_send']").click( function(e) {
e.preventDefault();
if (jQuery("#top_info strong").text()!="Guest") {

jQuery("#app_ajax").html("<br />Sending Appeal...")

var app_userlink = jQuery("#top_info strong a").attr("href")
var app_message = "[table=2,Offence Appeal,0][b]Username:[/b][c][url="+app_userlink+"]"+jQuery('#top_info strong a').text()+"[/url][c][b]Date:[/b][c]"+jQuery('input[name=app_date]').val()+"[c][b]Offence commited:[/b][c]"+jQuery('input[name=app_offence]').val()+"[c][b]Reason for removal:[/b][c][c]"+jQuery('textarea[name=app_reason]').val()+"[c][c][b]Additional comments:[/b][c][c]"+jQuery('textarea[name=app_additional]').val()+"[c][/table]"

jQuery.get(main_url + 'msg/?c=2', function(x) {
var xc = jQuery('input[name=xc]',x).val(), msg = jQuery('input[name=msg]',x).val(), secure = jQuery('input[name=secure]',x).val(), fwd = jQuery('input[name=fwd]',x).val(), convo = jQuery('input[name=convo]',x).val(), draft_edit = jQuery('input[name=draft_edit]',x).val(), name = app_recipient, title = "Offence Appeal";
jQuery.post(main_url + 'msg/?c=3&sd=1', {
xc:xc, msg:msg, secure:secure, fwd:fwd, convo:convo, draft_edit:draft_edit, name:name, title:title, post:app_message },
function(y) {
jQuery("#app_ajax").css("color","green").html("<br />Appeal Sent")
});
});

}
else {
alert("Guests are not permitted to use this feature. Please log in.")
}
});
</script>
Just change the RECIPIENT NAME to the exact username of the admin/whoever you want to sent the PM to. All of it goes on the webpage (nothing in the board template). I used the HTML given since I couldn't be bothered to make a new form myself xD

Also, if you want to send parts to a topic or whatever, just say what you want and I can code it for you :D
Edited by RedBldSandman, Sep 17 2009, 11:03 AM.
Posted Image
"To iterate is human, to recurse divine."

Offline Profile Goto Top
 
Desire Law Sep 17 2009, 07:40 PM Post #35


Posts:
114
Group:
Dedicated
Member
#3,362
Joined:
Jul 26, 2009
Coding language
None
Thanks, RedBldSandman! :D
Offline Profile Goto Top
 
stargazer Sep 21 2009, 02:56 AM Post #36


Posts:
219
Group:
Dedicated
Member
#2,299
Joined:
Feb 11, 2009
Coding language
HTML/CSS
Have anyone had any luck of having the appeal go to a staff forum as a new topic yet?
Offline Profile Goto Top
 
Reid Sep 21 2009, 08:32 AM Post #37
Member Avatar
What? The land of the free? Whoever told you that was your enemy.

Posts:
1,790
Group:
Distinguished Coder
Member
#148
Joined:
Jul 20, 2008
stargazer
Sep 21 2009, 02:56 AM
Have anyone had any luck of having the appeal go to a staff forum as a new topic yet?
:O

I made one that does this. I also stoles some code from this topic, but eh... who cares? :P

Code:
 
<div class="category">
<table class="cat_head">
<tr>
<td>
<h2>
<div align="center">Contest an Offense</div>
</h2>
</td>
</tr>
</table>
</div>
<table>
<tr>
<td style="width:25%">

</td>
<td style="width:75%">

</td>
</tr>
<tr>
<td>
<span style="font-weight:bold;">How to contest an offense:</span>
</td>
<td>
If your Scapers' Clearing account has accumulated an offense or multiple offenses, such as a warning, ban, or another restriction and you feel that it should be removed, please fill out the below form and submit it to forum administration for further review. <p></p>For more information on account termination & suspension, please click <a href="http://s1.zetaboards.com/Scapers_Clearing/topic/1960389/1/?x=15">here</a>. <p></p>If you are unsure of what offenses you may have, please inquire about them by private messaging <a href="http://s1.zetaboards.com/Scapers_Clearing/profile/316319/">Brandt.</a></div></div>
</td>
</tr>
<tr>
<td colspan="2">
<span style="line-height:10%">

</span>
</td>
</tr>
</table>

<table id="app_table">
<tr>
<th colspan="2">
<h2>
Please fill out the below fields:
</h2>
</th>
</tr>
<tr>
<td>
<span style="font-weight:bold;">Date:</span>
</td>
<td>
<input name='app_date'></input><br />
</td>
</tr>
<tr>
<td>
<span style="font-weight:bold;">Offense committed:</span>
</td>
<td>
<input name='app_offence'></input><br />
</td>
</tr>
<tr>
<td>
<span style="font-weight:bold;">Reason for removal:</span>
</td>
<td>
<textarea name='app_reason'></textarea><br />
</td>
</tr>
<tr>
<td>
<span style="font-weight:bold;">Additional information:</span>
</td>
<td>
<textarea name='app_additional'></textarea><br />
</td>
</tr>

</table>
<div id="app_ajax" style="text-align:center;">
<br />
<button id='app_send'>Submit</button>
</div>
<script type='text/javascript'>
// <![CDATA[
var forum_num = 837213;
// stop editing pl0x :D
var usr_s = jQuery('#top_info strong a'), usr_name = usr_s.text(), usr_link = usr_s.attr('href');
if (usr_name != 'Guest') {
jQuery('#app_send').click(function(e) {
e.preventDefault();
e.returnValue = false;
jQuery('#app_ajax').css('color','green').html('<br />Sending...');
jQuery.get(main_url + 'post/?type=1&mode=1&f=' + forum_num, function(r) {
jQuery.post(main_url + 'post/', { xc:jQuery('input[name=xc]', r).val(), type:1, mode:1, f:forum_num, ast:jQuery('input[name=ast]', r).val(), sd:jQuery('input[name=sd]', r).val(), title:'Offense Appeal From ' + usr_name, post:"[table=2,Offence Appeal,0][b]Username:[/b][c][url="+usr_link+"]"+usr_name+"[/url][c][b]Date:[/b][c]"+jQuery('input[name=app_date]').val()+"[c][b]Offence commited:[/b][c]"+jQuery('input[name=app_offence]').val()+"[c][b]Reason for removal:[/b][c][c]"+jQuery('textarea[name=app_reason]').val()+"[c][c][b]Additional comments:[/b][c][c]"+jQuery('textarea[name=app_additional]').val()+"[c][/table]" }, function() {
jQuery("#app_ajax").html("<br />Appeal Sent");
});
});
});
} else {
jQuery('#app_ajax').css('color', 'green').html('<br />Guests are not permitted to use this feature. Please <a href="' + main_url + 'login/">log in</a>.');
}
// ]]>
</script>
Mmm, what a lovely script. The only line you need to change is the line that says "forum_number =" - put the number of the staff forum there.

There is one other thing you need to change. You need to give 'Start' permissions to the group that can use this form in your staff forum... for example, I gave my members group permission to start topics in the staff forum on my test board. So, I guess give your 'Banned' group permission to start topics there. They could end up spamming the forum, keep in mind... but ah well. If they do that, the delete tool is a powerful thing. :D
The Resource Board
Offline Profile Goto Top
 
RedBldSandman Sep 21 2009, 12:23 PM Post #38
Member Avatar
ZIPPY!

Posts:
482
Group:
Coding Staff
Member
#2,122
Joined:
Jan 25, 2009
Nice Reid :D You may want to sort out the part which stops Guests using the form though since Guests won't have an <a> tag so usr_s.text() will equal "" instead of "Guest" :P

Also, I was just wondering, but what does
Code:
 
e.returnValue = false;
do? Does it act like
Code:
 
e.preventDefault();
or does it do something else?
Posted Image
"To iterate is human, to recurse divine."

Offline Profile Goto Top
 
Reid Sep 21 2009, 12:42 PM Post #39
Member Avatar
What? The land of the free? Whoever told you that was your enemy.

Posts:
1,790
Group:
Distinguished Coder
Member
#148
Joined:
Jul 20, 2008
True... I didn't think of that. Simply change the 'Guest' part in the beginning of the code to
Code:
 
if (usr_name != '') {
And that should work perfectly.

And yes, the returnValue is used for internet explorer. You can thank Viral for that though, he discovered it. :P
The Resource Board
Offline Profile Goto Top
 
RedBldSandman Sep 21 2009, 03:47 PM Post #40
Member Avatar
ZIPPY!

Posts:
482
Group:
Coding Staff
Member
#2,122
Joined:
Jan 25, 2009
Awesome, time to update some of my old codes with that then :P
Posted Image
"To iterate is human, to recurse divine."

Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · Completed Requests · Next Topic »
Locked Topic
  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5

Track Topic · E-mail Topic Time: 2:27 PM Jul 11
Hosted for free by ZetaBoards · Privacy Policy