Jul 23, 2008

Firefox Greasemonkey - Invision Board Tool For Warning - IPB warning shortcut

Free Web Hosting, No Ads > CONTRIBUTE > The Internet > Web Browsers > Browser Plug-in and Extension

free web hosting

Firefox Greasemonkey - Invision Board Tool For Warning - IPB warning shortcut

BuffaloHELP
Greasemonkey is popular for Firefox users in making any webpage to give that a little personal touch.

I found Greasemonkey extension for IPB for moderating WARN feature. You can have lists of commonly used warning messages and have it as pull-down menu style when issuing a warning. Very cool! The simple thing about this extension is how easy to modify to fit your needs.

This extension, called IPB Moderator Reasonator ( http://www.whiteacid.org/greasemonkey/#ipb...ator_reasonator ), shows only when you are at the warning page. Installation is very simple. After the installation open Manage User Scripts and edit the URL to your own IPB forum board (currently installed for Trap17 on my Firefox).

It is simply amazing.

The source code is listed here just in case the site does not show

CODE
// ==UserScript==
// @name           IPB moderator reasonator
// @namespace      http://mywebsite.com/myscripts
// @description    Provides a select box with common reasons to warn people on the IPB warning page
// @include       http://www.cirticalsecurity.net/index.php?act=warn&type=add&*
// ==/UserScript==

textarea = document.getElementsByName('reason')[0]
parent = textarea.parentNode
br = document.createElement('br')
//The drop down menu
select = document.createElement('select')
select.setAttribute('onchange','warn_add_reason(this.value)')
//Now lets create the "append rules link" button
button = document.createElement('input')
button.type = "button"
button.value = "append rules link"
button.setAttribute('onclick','warn_add_rules()')

//Add the reasons
reasons = new Array()
reasons[0] = new Array("Select a reason","Select a reason") //Do not change
reasons[1] = new Array("Multiple consecutive posts","You have created several consecutive posts in one thread. This is usually regarded as spam.")
reasons[2] = new Array("Linking to a site/program with relation to hacking it","You have linked to a site with relation to hacking it, this is against our rules. I have removed your thread.")
reasons[3] = new Array("Spamming","You have have spammed, the offending post has been removed")
reasons[4] = new Array("Necroposting","You have posted a non-constructive post in a long dead topic.")
reasons[5] = new Array("Abuse","You have been abusing other members on the forum.")
reasons[6] = new Array("Posting spoilers","You have posted blatant spoilers.")
reasons[7] = new Array("Asking for warez","You have asked where you can get illegal programs/music/films.")
reasons[8] = new Array("Giving link to warez","You have given links to illegal programs/music/films.")
reasons[9] = new Array("Signature too large","Your signature is too large.")
reasons[10] = new Array("Avatar too large","Your avatar is too large.")

for (i=0; i<reasons.length; i++)
{
    eval("child_"+i+" = document.createElement('option')")
    reason = escape(reasons[i][1]) //so quotes can be used
    eval("child_"+i+".value = '"+reason+"'")
    eval("child_"+i+".innerHTML = '"+reasons[i][0]+"'")
    eval("select.appendChild(child_"+i+")")
}

parent.insertBefore(select,textarea)
parent.insertBefore(button,textarea)
parent.insertBefore(br,textarea)

// executed from within the page
function warn_add_reason(reason)
{
    document.getElementsByName('reason')[0].value = unescape(reason)
}
function warn_add_rules()
{
    domain        = location.href.substr(0,location.href.substring(8,location.href.length).indexOf("/")+8) //get the domain name
    document.getElementsByName('reason')[0].value += "\n[url=\""+domain+"/?act=boardrules\"]Read the rules[/url]"
}
unsafeWindow.eval(warn_add_reason.toString())
unsafeWindow.eval(warn_add_rules.toString())

 

 

 


Reply

jlhaslip
As you find and install Greasemonkey, there are a couple of thinghs to edit in the script. The changes can be performed after the install by selecting the Greasemonkey extension in the Tools Menu.

To Change the url and text string for the "Rules Link",
Find :
CODE
document.getElementsByName('reason')[0].value += "\n[url=\""+domain+"/?act=boardrules\"]Read the rules[/url]"
}

Change to :
CODE
document.getElementsByName('reason')[0].value += "\n[url=\""+domain+"/?act=Help&CODE=01&HID=18\"]Trap17 Readme [/url]"
}


To Change the Host and page which triggers the Dropdown menu,
Find :
CODE
// @include       http://www.cirticalsecurity.net/index.php?act=warn&type=add&*

Change to :
CODE
// @include       http://www.trap17.com/forums/index.php?act=warn&type=add&*



Also, the Drop-down can be made tpo appear when you are reducing a warning by including the following Wildcard string in the list of pages:

CODE
http://www.trap17.com/forums/index.php?act=warn&type=minus&*


It might be suitable to add the reasons for reducing the warnings if you are going to do this.
Choose to edit the script in the Tools > Greasemonkey > Manage Script > Edit. (specify your Editor of choice)

 

 

 


Reply

electriic ink
That's great! It will certainly save a fair amount of time. I've changed the reasons so that they are more suited to Trap17 but moderators of other IPB forums could easily use this as well:

CODE
reasons[0] = new Array("Select a reason","Select a reason for adding to the warning") //Do not change
reasons[1] = new Array("===================================", "Select a reason for adding to the warning")
reasons[2] = new Array("Abusing Members","Abuse of other members on the forum:")
reasons[3] = new Array("Advertising", "Advertising:")
reasons[4] = new Array("CODE tags for code missing","Posting code without CODE tags:")
reasons[5] = new Array("Double Posting","Double posting:")
reasons[6] = new Array("Illegible Text Style (Repeated Offence)", "Illegible Text Style:")
reasons[7] = new Array("Lack of Contribution","Posting lacking contribution:")
reasons[8] = new Array("Personal Information Posted","Posting private information:")
reasons[9] = new Array("Plagiarising","Direct copy and pasting without use of QUOTE tags:")
reasons[10] = new Array("Pornography", "Pornographical material:")
reasons[11] = new Array("Posting a link to an illegal website","Posting a link to an illegal website:")
reasons[12] = new Array("Referral links","Posting referral links:")
reasons[13] = new Array("Signature Too Big (Repeated Offence)","Signature still too large.")
reasons[14] = new Array("Triple Posting", "Triple posting:")
reasons[15] = new Array("Warez Discussion","Engaging in the discussion of warez:")
reasons[16] = new Array("===================================", "Select a reason for adding to the warning")
reasons[17] = new Array("Other Offence", "")


If you wanted to use the script so it dealt with lowering the warning then you'd need to use this code:

Immediately after reasons = new Array(), add:
CODE
if (location.href.substr(53,3) == "add") {


This works for trap17.com but not necessarily for other domains. For other domains, the number you would need to change is 53. How do you find what number to change it to? You take a normal link to warn a member:

http://www.trap17.com/forums/index.php?act=warn&type=add&mid=3709&t=1&st=0

Count how many characters there are up to the blue letter and that's your number! A painstakingly long process but I can't think of another way to do it (my JS knowledge is very limited). Anyway:

Then you insert all your reasons to raise the warn level of the member. Eg:

CODE
reasons[0] = new Array("Select a reason","Select a reason for adding to the warning") //Do not change
reasons[1] = new Array("===================================", "Select a reason for adding to the warning")
reasons[2] = new Array("Abusing Members","Abuse of other members on the forum:")
reasons[3] = new Array("Advertising", "Advertising:")
reasons[4] = new Array("CODE tags for code missing","Posting code without CODE tags:")
reasons[5] = new Array("Double Posting","Double posting:")
reasons[6] = new Array("Illegible Text Style (Repeated Offence)", "Illegible Text Style:")
reasons[7] = new Array("Lack of Contribution","Posting lacking contribution:")
reasons[8] = new Array("Personal Information Posted","Posting private information:")
reasons[9] = new Array("Plagiarising","Direct copy and pasting without use of QUOTE tags:")
reasons[10] = new Array("Pornography", "Pornographical material:")
reasons[11] = new Array("Posting a link to an illegal website","Posting a link to an illegal website:")
reasons[12] = new Array("Referral links","Posting referral links:")
reasons[13] = new Array("Signature Too Big (Repeated Offence)","Signature still too large.")
reasons[14] = new Array("Triple Posting", "Triple posting:")
reasons[15] = new Array("Warez Discussion","Engaging in the discussion of warez:")
reasons[16] = new Array("===================================", "Select a reason for adding to the warning")
reasons[17] = new Array("Other Offence", "")


Put this code in:
CODE
} else {


Then, put all you reasons for lowering a member's warning. Eg:

CODE
reasons[0] = new Array("Select a reason","Select a reason for lowering the warning") //Do not change
reasons[1] = new Array("===================================", "Select a reason for lowering the warning")
reasons[2] = new Array("Good posts", "Good posts recently")
reasons[3] = new Array("Helpful member", "Thanks for being a helpful member")
reasons[4] = new Array("Reporting posts", "Thanks for reporting some posts recently")
reasons[5] = new Array("Superb post", "Fantastic post:")
reasons[6] = new Array("===================================", "Select a reason for lowering the warning")
reasons[7] = new Array("Other Reason", "")


Put this code in:
CODE
}


Then it should act as two scripts that perform similar functions. It displays reasons to add to or lower warnings on their relevant pages. The next step, of course, would be to make it so that auto-writes the PM.

Thanks BuffaloHELP!

Reply

jlhaslip
The easiest way to mod this thing might be by using the edit capabilities within the Greasemonkey itself.
Just install the script as per the author's page, then select to edit the script from Tools > Greasemonkey > Manage Users Sripts > Edit.
Cut and paste the following re-structured page into the editor, overwriting the original, to make the script suitable for Trap17 Mods.

CODE

// ==UserScript==
// @name IPB moderator reasonator - Trap17 version
// @namespace http://www.trap17.com/forums/index.php?sho...t=0#entry313464
// @description Provides a select box with common reasons to warn people on the IPB warning page
// @include http://www.trap17.com/forums/index.php?act=warn&*
// ==/UserScript==

textarea = document.getElementsByName('reason')[0]
parent = textarea.parentNode
br = document.createElement('br')
//The drop down menu
select = document.createElement('select')
select.setAttribute('onchange','warn_add_reason(this.value)')
//Now lets create the "append rules link" button
button = document.createElement('input')
button.type = "button"
button.value = "append rules link"
button.setAttribute('onclick','warn_add_rules()')

//Add the reasons
reasons = new Array()
if (location.href.substr(53,3) == "add") {
reasons[0] = new Array("Select a reason","Select a reason for adding to the warning") //Do not change
reasons[1] = new Array("===================================", "Select a reason for adding to the warning")
reasons[2] = new Array("Abusing Members","Abuse of other members on the forum:")
reasons[3] = new Array("Advertising", "Advertising:")
reasons[4] = new Array("CODE tags for code missing","Posting code without CODE tags:")
reasons[5] = new Array("Double Posting","Double posting:")
reasons[6] = new Array("Illegible Text Style (Repeated Offence)", "Illegible Text Style:")
reasons[7] = new Array("Lack of Contribution","Posting lacking contribution:")
reasons[8] = new Array("Personal Information Posted","Posting private information:")
reasons[9] = new Array("Plagiarising","Direct copy and pasting without use of QUOTE tags:")
reasons[10] = new Array("Pornography", "Pornographical material:")
reasons[11] = new Array("Posting a link to an illegal website","Posting a link to an illegal website:")
reasons[12] = new Array("Referral links","Posting referral links:")
reasons[13] = new Array("Signature Too Big (Repeated Offence)","Signature still too large.")
reasons[14] = new Array("Triple Posting", "Triple posting:")
reasons[15] = new Array("Warez Discussion","Engaging in the discussion of warez:")
reasons[16] = new Array("===================================", "Select a reason for adding to the warning")
reasons[17] = new Array("Other Offence", "")
} else {
reasons[0] = new Array("Select a reason","Select a reason for lowering the warning") //Do not change
reasons[1] = new Array("===================================", "Select a reason for lowering the warning")
reasons[2] = new Array("Good posts", "Good posts recently")
reasons[3] = new Array("Helpful member", "Thanks for being a helpful member")
reasons[4] = new Array("Reporting posts", "Thanks for reporting some posts recently")
reasons[5] = new Array("Superb post", "Fantastic post:")
reasons[6] = new Array("===================================", "Select a reason for lowering the warning")
reasons[7] = new Array("Other Reason", "")
}
for (i=0; i<reasons.length; i++)
{
eval("child_"+i+" = document.createElement('option')")
reason = escape(reasons[i][1]) //so quotes can be used
eval("child_"+i+".value = '"+reason+"'")
eval("child_"+i+".innerHTML = '"+reasons[i][0]+"'")
eval("select.appendChild(child_"+i+")")
}

parent.insertBefore(select,textarea)
parent.insertBefore(button,textarea)
parent.insertBefore(br,textarea)

// executed from within the page
function warn_add_reason(reason)
{
document.getElementsByName('reason')[0].value = unescape(reason)
}
function warn_add_rules()
{
domain = location.href.substr(0,location.href.substring(8,location.href.length).indexOf("/")+8) //get the domain name
document.getElementsByName('reason')[0].value += "\nTrap17 Readme "
}
unsafeWindow.eval(warn_add_reason.toString())
unsafeWindow.eval(warn_add_rules.toString())


Notice from BuffaloHELP:
Note that "trap17 readme" link has been parsed within the CODEBOX. Please remove "http://" after [url= and you'll be fine. See the original code posted for clarification

Reply

BuffaloHELP
The disadvantage of reverse engineering is that this code needs to be first understood before it can be customized. And I, not knowing any javascript, took a bit longer to figure out what makes this thing tick.

By editing following lines with my modification, you can have the same pull-down option to appear whenever you are FAST REPLY or REPLY mode.

Edit to:

1) First line
CODE
textarea = document.getElementsByName('Post')[0]


2) Find function warn_add_reason(reason)
CODE
document.getElementsByName('Post')[0].value = unescape(reason)


3) Find function warn_add_rules()
CODE
document.getElementsByName('Post')[0].value += "\n[url=\""+domain+"/?act=boardrules\"]Read the rules[/url]"


All I did was replace 'reason' textarea name to 'Post' name tag.

I initially used @include as a wild card to test it out without prejudice. But the better @include would be
CODE
@include    http://www.trap17.com/forums/*

Since IP.Board sets <textarea name="Post"... having a wider include will work to an advantage.

I also believe that having different scripts with prescripted reasons are better than having one script with all possible reasons.

One behavior I noticed is that the pull-down menu will override anything in the <textarea>. "append rules link" will append but as soon as you select another pull-down option, it will be cleared and inserted with the new selection. This is something to be considered when trying to use this while edting a post (it will clear the original post and replace it with your message). The javascript "append rules link" method should be used in this case.

The next agenda would be to modify the script and insertion to automatically fill in PM subject and PM message with the same pull-down option during the warn issuing stage. **DONE**

Find function warn_add_reason(reason) and change to
CODE
function warn_add_reason(reason)
{
    document.getElementsByName('reason')[0].value = unescape(reason)
    // add to PM box according to reasons
    document.getElementsByName('subject')[0].value = "Warning level adjusted"
    document.getElementsByName('contact')[0].value = unescape(reason)
}


Find function warn_add_rules() and change to
CODE
function warn_add_rules()
{
    domain        = location.href.substr(0,location.href.substring(8,location.href.length).indexOf("/")+8) //get the domain name
    document.getElementsByName('reason')[0].value += "\n[url=\""+domain+"/?act=boardrules\"]Read the rules[/url]"
    // add to PM box when clicked
    document.getElementsByName('contact')[0].value += "\n[url=\""+domain+"/?act=boardrules\"]Read the rules[/url]"
}


These changes will allow warning reason, PM subject and PM message areas to be filled in simultaneously smile.gif All done and have fun!

Next agenda is to see if it's possible if this plug can only be used by approved moderators (or any other Greasemonkey user scripts--since anyone with Firefox can use this mod, especially if we develop one for post edit message plug-ins)

Reply

Imtay22
Well I will try to use this for my board. Thanks for the find BuffaloHELP! But first i have to buy an invision licence though...

Reply

Saint_Michael
Wouldn't doing a little copying and pasting of the group permission set up fix that little technicality.

most likely you will find that php string that sets up the file permissions for admin and mods in the admin files that list the group permissions in it.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : firefox, greasemonkey, invision, board, tool, warning, ipb, warning, shortcut

  1. Firefox 3 Dream Package Updates
    Extentions that Have been Updated up to 3preb5 (1)
  2. Firefox Extension Dream Package #5: Last Batch Of 2007
    (2)
    Well I thought I kick in one more package of add-ons for the firefox browser for 2007; although some
    of these should have been in my last topic since most of them are google related, or rather google
    search engine related. Before we go into this last batch of add-ons here are the links to my
    previous topics on the different dream packages worth of google add-ons for you firefox users to
    use. Dream Package #1 Dream Package #2 Dream Package #3 Dream Package #4 ImageCounter
    WOW!! I wonder what this does, if you remember the link counter in Dream Package....
  3. Firefox Extension Dream Package #4 - The New Google Batch
    (0)
    Well I thought I take in another round of firefox extensions that can be used by anyone, and with
    the batch I have today it is a mix of web designers, google users, and people who like to count and
    know how much space firefox takes up. So before I get going on the new stuff I thought I toss up
    the links to the previous Firefox Extension Dream Package Topics for a nice little package deal for
    you the firefox user. Dream Package #1 Dream Package #2 Dream Package #3 Also I like to toss
    out a reminder to the Firefox 3.0 users that you have to wait for most of these ....
  4. Best Of Firefox Extension ?
    Everthing about mozilla firefox extensions/ addons (16)
    I know this is a bit tough to decide from everyones perspective... But i thought there are always
    some winners and losers. So... i thought i will post this question to the forum and see what others
    think about this. There are some extensions... without that people cannot have their browsers... I
    am totally addicted to some of the extensions without which i cannot open my browser. Rather than
    explaining and speaking about the performance , features and usability of the extensions...it will
    be better to post your addictive level to that extension. Like i mean how it is....
  5. Firefox Extension Dream Package #3 - The Quirky Ones
    (2)
    Well I thought I go browse the add ons and extensions once again but this time I thought I go for
    the quirky, oddball, and somewhat useful stuff to add to firefox. As usual I give a brief
    description of what it is, what version it can work on and its download page. Advance Dork I
    found this one to be very interesting due to the fact it makes remember googles operators or use
    them on the fly. Googles operates of course are things like this site:, intitle: ext:. As fr its
    usefulness I would say it is a pretty good tool to have because it can be use by web designe....
  6. Firefox Extensions Dream Package #2: Browser Effects
    (0)
    Well the last time I made this topic it was for web designer extensions that can be used, this topic
    will cover various extensions, such as security and privacy, web data and more. Cooliris
    Previews The first extension I will talk about is Cooliris Previews, which is an extension in
    which a user just has to hover over a link and then a blue square appears, then all you have to do
    is hover over that blue square and the link opens up into a min browser and shows the contents. Now
    being a long time trap user I have clicked on so many topics that my hands hurt, a....
  7. Firefox Themes?
    (5)
    I use RedShift v2, I'm hoping the guy who does the shift themes makes a blue one for FF2 soon,
    right now red is the only one available. I also have pitchdark and blue ice, but I don't use
    them that often.....
  8. Fireftp
    A Firefox Add-on (9)
    Hello FireFTP opens a basic file transfer protocol window in a Firefox browser tab; for uploading
    and downloading files to and from the Web, it makes your work easy ... you can get it from here ....
  9. Greasemonkey For Firefox
    Alter any page on the net to your liking... (2)
    I'll be honest with you from the start. I use this mainly on MySpace.com. With this extension,
    you can use JavaScript to alter any page anywhere! You can remove the ads off of specific
    websites, you can even customize the stylesheets if you know what you're doing! If
    you've ever been on MySpace.com, you know the annoying home page with all the ads and
    announcements. Well I have made my own script to clean it up a bit to match my profile. Here is a
    screenshot of my MySpace's homepage: http://ihave.goldbananas.com/others/myspace_home_new.jpg
    I&#....
  10. Firefox Extentions
    Have an "essential" plugin? Share it with others. (12)
    Ok, I'll spare you all of the pro firefox propaganda. You all know it is the best browser out
    there--else you wouldn't be reading this page. Here are a few of my favorite extentions
    (plugins): 1) Adblock An absolute essential for me. Are you sick of all those obnoxious banner
    ads? Of popups? Of flash ads? Well adblock lets you remove all of them. The interface is great,
    and it is encredibly customisable. I'm so used to using it that when I use a different computer
    I and shocked at how much visual polution exists on the web. For those of you with....
  11. Firefox Extensions
    Which ones do you use? (13)
    Which Firefox extensions do you use? I use: - NoScript (blocks bad javascripts, there are some on
    Trap17 forums, but I allowed JUST Trap17.com domain, not the other domains on the forums). - Gmail
    Notifier (Notifies me when a new e-mail comes) - AdBlock (block ads) - CustomizeGoogle (Customize
    the Google web site like remove ads) - Tabbrowser Preferneces (edit tabs of the Mozilla Firefox) -
    FlashGot (not sure exactly this is, I just downloaded it because it was popular /tongue.gif'
    border='0' style='vertical-align:middle' alt='tongue.gif' /> ) - PDF Download (lets y....
  12. New Rapidshare Hack For Firefox Users
    (20)
    QUOTE The hot new Firefox plug-in takes browser customization to a whole new level by letting
    users filter site content or change page behaviors. The glory of open-source software is that it
    allows anyone with the inclination and the scripting knowledge to get under the hood and hot-rod
    their computing environment. But most of the time, that advantage is available only to people with
    the programming skills to make the changes they want. That's where Greasemonkey, a free plug-in
    for Firefox, comes in -- it simplifies hacking the browser. Released at the end 2004....

    1. Looking for firefox, greasemonkey, invision, board, tool, warning, ipb, warning, shortcut

Searching Video's for firefox, greasemonkey, invision, board, tool, warning, ipb, warning, shortcut
advertisement



Firefox Greasemonkey - Invision Board Tool For Warning - IPB warning shortcut



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE