
Code:
- <script type="text/javascript">
- <!--
- /* An Attempt At Anti-Spam Bot Situation
- By {XF}Äs$@§sîñ™, http://www.xf-clan.net
- Code from http://www.utopiangfx.proboards56.com/index.cgi
- This Header Stays Intact */
-
- // List all the characters you wish to use
- var charsToUse = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
-
- var sMax = "8"; // Number of security letters to print
-
- var sColor = "CD3333"; // The color of the code when it is given to the Guest when posting
-
- function returnCode() {
- var lCounter = 0;
- var storeData = '';
- while (lCounter != sMax) {
- storeData += charsToUse.charAt(Math.floor(Math.random() * (charsToUse.length-1)));
- lCounter++;
- }
- return storeData;
- }
-
- if (pb_username.match(/Guest/) && document.postForm) {
- var tRow = document.postForm.message.parentNode.parentNode.parentNode;
- var firstCell = tRow.parentNode.insertRow(tRow.rowIndex+1).insertCell(0);
- firstCell.className = "windowbg";
- var subHeader = document.createElement("font");
- subHeader.style.fontSize = "12px";
- subHeader.appendChild(document.createTextNode("Anti-Spam Code:"));
- firstCell.appendChild(subHeader);
- var secondCell = firstCell.parentNode.insertCell(1);
- secondCell.className = "windowbg";
- var cDesc = document.createElement("font");
- cDesc.style.fontSize = "10px";
- cDesc.appendChild(document.createTextNode("The following code needs to be inputted below: "));
- secondCell.appendChild(cDesc);
- var spamCode = document.createElement("span");
- spamCode.setAttribute("id", "antiSpamCode");
- spamCode.style.fontSize = "10px";
- spamCode.style.fontWeight = "bold";
- spamCode.style.color = sColor;
- secondCell.appendChild(spamCode);
- secondCell.appendChild(document.createElement("br"));
- var cCode = cDesc.cloneNode(false);
- cCode.appendChild(document.createTextNode("Please enter the Anti-Spam code (The Anti-Spam code is case sensitive): "));
- secondCell.appendChild(cCode);
- var cField = document.createElement("input");
- cField.setAttribute("id", "antiSpamCodeInput");
- cField.setAttribute("size", "10");
- cField.setAttribute("maxLength", sMax);
- secondCell.appendChild(cField);
- cField.style.marginTop = "5px";
-
- document.postForm.onsubmit = function() {
- var c = document.getElementById("antiSpamCodeInput").value;
- if (c == "" || c != document.getElementById("antiSpamCode").firstChild.data) {
- alert("The Anti-Spam Code which you have given is invalid. Please enter again. Thank You.");
- return false;
- }
- }
-
- window.onload = function() {
- document.getElementById("antiSpamCode").appendChild(document.createTextNode(returnCode()));
- }
- }
- //-->
- </script>