|
Post by mushoku on Aug 2, 2011 6:04:34 GMT
Hello, I have been having problems with the PM Warning Template located here. I cannot seem to find how to get to the template. Also, does this code only work for the creator of the site or for all administrators? Here is the link to my site: LinkThanks in advance!
|
|
Cam
Administrator
[M:5000]
Posts: 6,381
|
Post by Cam on Aug 2, 2011 6:20:47 GMT
Try this (I had to fix some bugs):
<table width="100%" align="center" cellspacing="1" cellpadding="4" class="bordercolor" id="pmTemplate" style="display: none;"> <tr> <td class="titlebg" colspan="2">Send Personal Message</td> </tr> <tr> <td class="windowbg2" width="20%">Subject:</td> <td class="windowbg" width="80%"><input type="text" id="pmSubjectness" value="" /></td> </tr> <tr> <td class="windowbg2" width="20%">To:</td> <td class="windowbg" width="80%"><input type="text" id="pmTowhom" value="" /></td> </tr> <tr> <td class="windowbg2" width="20%">Warning %:</td> <td class="windowbg" width="80%"><input type="text" id="pmWarning" value="" /></td> </tr> <tr> <td class="windowbg2" width="20%">Reason for warning?:</td> <td class="windowbg" width="80%"><input type="text" id="reason" value="" /></td> </tr> <tr> <td class="windowbg2" colspan="2"><input type="button" id="pmSubmit" value="Send Message" onclick="submitTemplate()" /></td> </tr> </table>
<script type="text/javascript"> <!--
/* PM Warning Template - Luke Mansell Thanks for the guidance Jordan [url]codercommunity.proboards.com[/url] */ if(pb_username == 'admin'){
if(pb_action == "pmsend") {
function showw(){ document.postForm.style.display = "none";
document.postForm.parentNode.insertBefore( document.getElementById("pmTemplate"), document.postForm.nextSibling );
document.getElementById("pmTemplate").style.display = ""; }
function submitTemplate() { var warning = "Hello, today we have given you a warning, this is because you have either broken the rules or other things. Your warning level is:"; var warning2 = " The admin has given a reason why you have got your warning: "; var warning3 = " Thank you, please try to follow the rules."; document.postForm.subject.value = document.getElementById("pmSubjectness").value; document.postForm.to.value = document.getElementById("pmTowhom").value; document.postForm.message.value += warning; document.postForm.message.value += document.getElementById("pmWarning").value; document.postForm.message.value += warning2; document.postForm.message.value += document.getElementById("reason").value; document.postForm.message.value += warning3;
document.postForm.submit();
} var button = '<center><a onclick="showw()" href="javascript: void(0)">Show Warning Template</a></center>'; document.write(button); } } //--> </script>
Put that in your global footers and then go to PM someone and at the bottom/near the bottom there will be a text link, click that and it should work
|
|
|
Post by mushoku on Aug 2, 2011 6:58:23 GMT
Thanks, it seems to work great on the main staff account (creator of the site's account). However, is there anyway to make the code so that other administrators can use the warning template as well?
|
|
Cam
Administrator
[M:5000]
Posts: 6,381
|
Post by Cam on Aug 2, 2011 7:20:35 GMT
Yeah, I'll work on adding that
|
|
|
Post by mushoku on Aug 2, 2011 7:24:36 GMT
Thanks; that would be great! ^^
|
|
Jordan
Elite Poster
[M:5000]
Posts: 286
|
Post by Jordan on Aug 14, 2011 19:36:27 GMT
Change this line:
if(pb_username == 'admin'){
To:
var staff = /^(admin|staff1|staff2)$/i;
if(staff.test(pb_username)){
|
|
|
Post by mushoku on Aug 18, 2011 20:05:27 GMT
Change this line: if(pb_username == 'admin'){ To: var staff = /^(admin|staff1|staff2)$/i; if(staff.test(pb_username)){ It works great now. Thanks!
|
|
Jordan
Elite Poster
[M:5000]
Posts: 286
|
Post by Jordan on Aug 18, 2011 23:19:39 GMT
You're welcome.
|
|