|
Viewing Single Post From: Automatic Welcome PM v1.5
|
|
Grandam99
|
Aug 5 2009, 07:14 PM
|
- Posts:
- 729
- Group:
- Members
- Member
- #56,265
- Joined:
- June 1, 2005
|
I had a test board made a while back, (wonderwoman skin testing site) that I disabled the new registration before, I just opened it for the new registration to test out this new code, and it seems to be working perfectly, so I have installed it on my pretty new site with few members on it, for those of you having problems, this is the way you change the code. This is what I have:
- Code:
-
<script language="javascript" type="text/javascript"> <!-- /* Automatic Welcome PM Originally by MKII */
appearFrom = ["GrandPrix08", 1] msgTitle = "Welcome Aboard" msgContents = "Welcome and Thanx for joining Pontiac-Tribute.com. I hope you have a wonderful time and look forward to communicating with you. Also, be sure to check out our Arcade that has hundreds of games you can play and even participate or create a tournament, located just under our site banner. Our goal is to have everyone mourn the death of once a great brand, and at the time, to have some fun. Thank you for becomming our newest family member"
home = "http://"+location.hostname home += location.pathname.match(/\/[^\/]+\//) ? "/" + location.pathname.substr(1).substr(0, location.pathname.substr(1).indexOf("/") + 1) : location.pathname + "/" home += "index.php?"
if(document.forms['REG']) document.forms['REG'].onsubmit = function() { if(!Validate()) return false document.cookie = "newMember=1; expires=" + new Date("1/1/2010").toGMTString() return true }
userLinks = document.getElementById("userlinks") userName = userLinks.getElementsByTagName("A")[0].innerHTML.replace(/<[^>]+>/g, "")
if(userLinks.innerHTML.match("Logged in")&&document.cookie.match("newMember=1")) { document.cookie = "newMember=0; expires=" + new Date().toGMTString() document.write("<iframe src='" + home + "act=Msg&CODE=4&MODE=1&entered_name=" + escape(userName) + "&msg_title=" + escape(msgTitle) + "&Post=" + escape(msgContents) + "' style='display:none'></iframe>") alert("You have a new personal message from "+ appearFrom[0]) }
if(location.href.match(/act=Msg&CODE=0*1/)) { td = document.getElementsByTagName("TD") for(i = 0; i < td.length; i++) if(td.innerHTML.replace(/<[^>]+>/g, "") == msgTitle) { a = td[i + 1].getElementsByTagName("A") a[0].href = home + "showuser=" + appearFrom[1] a[0].innerHTML = appearFrom[0] a[1].href = a[1].href.replace(/MID=\d+/, "MID=" + appearFrom[1]) } }
if(location.href.match(/MSID=\d+/)) { b = document.getElementsByTagName("B") for(i = 0; i < b.length; i++) if(b.innerHTML == msgTitle && b.parentNode.className == "postdetails") { td = document.getElementsByTagName("TD") for(n = 0; n < td.length; n++) if((td[n].className == "post1") && td[n].width != "100%") { a = td[n - 2].getElementsByTagName("A")[0] if(a.innerHTML.replace(/<[^>]+>/g,"") != userName) break a.href = home + "showuser=" + appearFrom[1] a.innerHTML = appearFrom[0] div = td[n + 1].getElementsByTagName("DIV") for(x = 0; x < div.length; x++) if(div[x].className == "signature") div[x].removeNode(false) a = td[n + 3].getElementsByTagName("A") for(x = 0; x < a.length; x++) if(a[x].href.match(/MID=\d+/)) a[x].href = a[x].href.replace(/MID=\d+/, "MID=" + appearFrom[1]) td[n + 1].colSpan = "2" td[n].removeNode(false) break } break } }
//--> </script>
Hope that helps.
|
|
|