First of all I would like to say that this code was made by the idea of a member on smfsupport (
this is the topic). He brought me on the idea to make the code. First I wanted to modify the Secret Menu code for him, but it didn't work, so I totally re-writed the code and so the new code was created.
The code I present today has actually the same function as the secret menu code, exept that this version supports multiple words, so that the secret menu will popup on multiple inputs.
This is the code, it must be put in the Headers:
<script type="text/javascript">
<!-- The Secret Menu (multiple words mod) Warning -->
<!-- This script is made by Qub1. Find more scripts like this at http://qub1.smfforfree.com/ -->
// Variables and handler configuration
var word = new Array(), Letter = new Array(), Code;
document.onkeypress = check_key;
// Forebidden Words
word[0] = "FOREBIDDEN WORD";
word[1] = "FOREBIDDEN WORD";
word[2] = "FOREBIDDEN WORD";
word[3] = "FOREBIDDEN WORD";
// Reset Counters
for (i = 0; i < word.length; i++) {
Letter[i] = 0;
}
// Event handler
function check_key(key) {
try {
Code = event.keyCode;
} catch(e) {
Code = key.which;
}
for (i = 0; i < word.length; i++) {
if (String.fromCharCode(Code).toLowerCase() == word[i].charAt(Letter[i])) {
Letter[i]++;
} else {
Letter[i] = 0;
}
if (Letter[i] == word[i].length) {
Letter[i] = 0;
trigger(word[i]);
}
}
}
// IF the word has been typed
function trigger(word) {
alert("YOUR POPUP MESSAGE HERE. You typed: " + word);
}
</script>
Just replace FORBIDDEN WORD with the words you don't allow, and if you want more words just enter more of this:
Code:
word[X] = "FOREBIDDEN WORD";
Replace the X with the correct number in the forbidden words list.
And edit the YOUR POPUP MESSAGE HERE text with the text you want to popup, and edit the You typed: text with whatever you want.
Thanks,
Qub1 out~