Welcome Guest [Log In] [Register]
We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Automatic Welcome PM v1.5; Originally by MKII, Edited by Dove
Topic Started: Jan 23 2005, 08:02 PM (7,090 Views)
Dove
xtrm.exe now loading...
 *   *   *  
This code is based on MKII's Automatic Welcome PM and I have a modiefied it a bit so it shows the left side panel. (avatar and post details)

Be sure to add a + at the of every line but except for the last one. For extra space (extra line) add a \n right after the \n before it and before the " after it.

Username You Want To Appear
(Set the number to the user's id number that you want it to appear as, ex:#1 is usually the admin.)


Welcome Message :: PM Title
(This is the topic's title)


Body :: PM Message.
(This is where you post the message you want to send to the new member)


Quote:
 
<script language="javascript" type="text/javascript">
<!--
/*
Automatic Welcome PM
Originally by MKII
*/

appearFrom = ["Username You Want To Appear", 1]
msgTitle = "Welcome Message :: PM Title"
msgContents = "Body :: PM Message.\n"

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>


PS: This code goes in the Footer of your Board Wrappers.
Offline Profile Quote Post Goto Top
 
mrman
Unregistered

And where do I put this?
Quote Post Goto Top
 
Dove
xtrm.exe now loading...
 *   *   *  
This code goes in the Footer of your Board Wrappers.
Offline Profile Quote Post Goto Top
 
mrman
Unregistered

Ok. Thanks.

EDIT:
It makes the forums slow when I sign in as a new user.
Quote Post Goto Top
 
Gogf
Member Avatar
Indescribable
 *   *   *   *   *   *  
Awesome, version 1.5!
Offline Profile Quote Post Goto Top
 
Spheric Al
Member
 *  
sweet code dude! ;) I'm using this one for sure!
Offline Profile Quote Post Goto Top
 
0101man
571
 *   *   *   *  
Oh cool , not to bad!
Offline Profile Quote Post Goto Top
 
zing
Member Avatar
Member
 *  
I have my own forum in my own paid host. I tried this one but it seemed to be conflicted with my mother tounge typing code. Hmm, I don't know whether there's something wrong. Anyway, thanks.
Offline Profile Quote Post Goto Top
 
Wimper
Socom Clans Inc. Site Owner
 *   *  
now how do you make it so that it shows that you have a message in the inbox?
Offline Profile Quote Post Goto Top
 
Dove
xtrm.exe now loading...
 *   *   *  
Wimper
January 25, 2005 09:29 AM
now how do you make it so that it shows that you have a message in the inbox?

A pop-up will be send to the new member automatically.
Offline Profile Quote Post Goto Top
 
Typhoon Omi
Member Avatar
[:Gerannium Knight:]
 *   *   *   *   *  
Is it possible to have it send more than one PM? (i.e. so more than one admin can 'send' a PM to a new user)?
Offline Profile Quote Post Goto Top
 
Wimper
Socom Clans Inc. Site Owner
 *   *  
dove i messaged you can you help me set this code up please?
Offline Profile Quote Post Goto Top
 
Dennis
Member Avatar
Future Dennis does not necessarily condone the contents of this message.
 *   *   *   *   *   *   *  
Nice job! :)
Offline Profile Quote Post Goto Top
 
Wimper
Socom Clans Inc. Site Owner
 *   *  
can anyone help me set mine up? I already have the message ready to go so that the person just has minor editing to do
Offline Profile Quote Post Goto Top
 
Wimper
Socom Clans Inc. Site Owner
 *   *  
Ok I was wondering if anyone can fix this and tell me what is wrong


Ok here is the script that I am using and please edit what you think would need to be edited for it to work.


Code:
 
<script language="javascript" type="text/javascript">
<!--
/*
Automatic Welcome PM
Originally by MKII
*/

appearFrom = ["Username You Want To Appear", 1]
msgTitle = "Welcome to Socom Clans:: Welcome to Socom Clans"
msgContents = "Body :: Welcome to SocomClans.tk.We have 50,000 codes in our database and we are getting more everyday.Our member list is expanding and we are turning into the best site on the net.

We want all members to post.We would rather you go to the spam topics and spam then not post at all.If you do not make the post limit before the allouted time your name will be deleted.There are Rule links all around the site and make sure thats the first thing you check out.Our staff members are always watching to see if you are following the rules.Some actions that you take may result in a warning,some may result in a ban or suspension.The best rule is to stay clean and you wont be warned.Dont get me wrong.Our staff at this site does care for the members.But if you dont obey the laws you will get the consequences,no questions asked!

Ask our staff about anything you want in the Ask The Staff Section.The staff is very well trained.Well that is all I have for you to read so I will close out with this.Tell all your friends about this site and how great we treat you.We will be looking to see if you post because if you dont you will get deleted..\n"

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[i].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[i].innerHTML == msgTitle && b[i].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>


Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · Code Snippets · Next Topic »
Add Reply