SoCal
« Automatic Welcome PM »

Welcome Guest. Please Login or Register.
Sept 2, 2010, 4:40pm




SoCal :: SoCal Codes :: ProBoards Codes :: Automatic Welcome PM
Page 1 of 4 » Jump to page   Go    [Search This Thread][Send Topic To Friend] [Print]
 AuthorTopic: Automatic Welcome PM (Read 13,494 times)
california
[image]
I'm not here...
member is offline

[avatar]



Joined: Nov 2004
Gender: Male
Posts: 6,425
 Automatic Welcome PM
« Thread Started on Mar 30, 2006, 9:14am »

Don't get too excited -- or maybe you should. Though no real PM ever gets sent with this code, the user will never know the difference, as the "fake" PM looks and works exactly like a real one. But isn't this against the TOS? No, it isn't :)

Want a Preview? Register at this Test Board

This code sets a cookie that "sends" a welcoming PM to a new user when they register. It updates their PM count in the welcome table and info center and is capable of being marked as read/unread and deleted like any other PM. The only thing the user can't do is quote it (but they won't notice).

You can edit who the PM gets sent from as well as of course the subject and content of the PM. Unfortunately there's one extra step involved in using this code, other than just the actual code in the headers/footers...


THE FIRST STEP

No, you cannot skip this. You cannot use the code without doing it. Period. If you're too lazy to do it or even read this, forget about using the code. Now. Are we clear? Okay... what you need to do is create a new thread on your board somewhere. It doesn't matter where. Maybe in a hidden board. But it can't be pass-protected and it must be accessible to new members. In this thread you put whatever you want to appear in the welcome PM. This thread IS the welcome PM. Don't have any replies in the thread. PMs don't have replies. Lock the thread or disable posting in the board that it's inside.

Created your welcome PM thread? Good, now copy the URL of the thread. That's the thing in the address bar that starts with http. Copy it all, not just part of it, and save it because you'll need it for the "welcomeLink" variable in the code. Now you're done with the first step.


THE SECOND STEP

Make sure you have done the first step. It's really important.


THE CODE

Copy the code below into your GLOBAL FOOTER:

Code:
<script type="text/javascript">
<!--
/* welcome PM sent automatically to new users by california
©2006 SoCal Codes, [url]http://socal.proboards26.com[/url]
Do not redistribute or repost without permission */

// General Customization
var welcomeLink = "http://socal.proboards26.com/index.cgi?board=INTRO&action=display&n=1&thread=1408";
var pmSubject = "Welcome";
var replyToUser = "admin";
var replyToName = "admin display name";
var replyToGroup = "group1";

// Edit these if you have custom images for any of them
var imopen = "http://s3.images.proboards.com/imopen.gif";
var imclose = "http://s3.images.proboards.com/imclose.gif";
var im_inbox = "http://s3.images.proboards.com/buttons/im_inbox.gif";
var im_new = "http://s3.images.proboards.com/buttons/im_new.gif";
var im_outbox = "http://s3.images.proboards.com/buttons/im_outbox.gif";
var im_config = "http://s3.images.proboards.com/buttons/im_config.gif";
var im_reply = "http://s3.images.proboards.com/buttons/reply.gif";
var im_delete = "http://s3.images.proboards.com/buttons/delete.gif";


// Don't edit below here
var iTable = document.getElementsByTagName("table");
var iCell = document.getElementsByTagName("td");
var iLink = document.getElementsByTagName("a");
var cookieRe = new RegExp("\\b(welcome_"+pb_username+"=(un)?read_(.+?))(;|$)", "");
function getPBTime(){
&nbsp; &nbsp; var fObj = iCell[2].getElementsByTagName("font")[0];
&nbsp; &nbsp; return (fObj && fObj.lastChild && fObj.lastChild.nodeName == "#text") ? fObj.lastChild.data : 'N/A';
}
function getTimeFrag(sendTime){
&nbsp; &nbsp; var sArr = sendTime.split(',');
&nbsp; &nbsp; var dayNum = (sArr[0].match(/(\d+)/)) ? parseInt(RegExp.$1)+1 : 1;
&nbsp; &nbsp; var dF = document.createDocumentFragment();
&nbsp; &nbsp; if(getPBTime().split(',')[0] == sArr[0]){
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; var todayBold = document.createElement("b");
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; todayBold.appendChild(document.createTextNode("Today"));
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; dF.appendChild(todayBold);
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; dF.appendChild(document.createTextNode(" at"+sArr[2]));
&nbsp; &nbsp; }else if(getPBTime().split(',')[0] == sArr[0].replace(/\d+/g, dayNum)){
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; dF.appendChild(document.createTextNode("Yesterday at"+sArr[2]));
&nbsp; &nbsp; }else{
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; dF.appendChild(document.createTextNode(sendTime));
&nbsp; &nbsp; }
&nbsp; &nbsp; return dF;
}
function loadExternal(file){
&nbsp; &nbsp; document.write('<script type="text/javascript" src="http://www.iycatacombs.com/socal/resources/scripts/'+file+'"></scr'+'ipt>');
}
function deleteWelcomePM(){
&nbsp; &nbsp; document.cookie = "welcome_"+pb_username+"=deleted;";
}
if(welcomeLink.match(/^\/?(index\.cgi)?\?/)){
&nbsp; &nbsp; welcomeLink = "http://"+location.hostname.replace('www.', '')+'/'+welcomeLink;
}else if(welcomeLink.match(/^(www\.)?\w+\.proboards/)){
&nbsp; &nbsp; welcomeLink = "http://"+welcomeLink.replace('www.', '');
}
if(document.cookie.match(cookieRe)){
&nbsp; &nbsp; if(location.href == (welcomeLink+"&welcomepm=1")) loadExternal("welcomepm1.js");
&nbsp; &nbsp; loadExternal("welcomepm2.js");
}
if(location.href.match(/action=register2/) && document.loginform){
&nbsp; &nbsp; var exp = (new Date((new Date()).getTime()+100000000000)).toString();
&nbsp; &nbsp; document.cookie = "welcome_"+document.loginform.username.value+"=unread_"+escape(getPBTime())+"; expires="+exp+";";
}

// -->
</script>


It won't work at all if you don't put it in the GLOBAL FOOTER. Not the main header. Not a board footer. The GLOBAL FOOTER. Now you have to edit the variables:


var welcomeLink = "URL OF THREAD";
Don't know what this is? Then do me a favor and slap yourself really hard for not reading THE FIRST STEP, then scroll up and read it. Or just leave it at what it is in the example. The code won't work but it's nice advertising for us :P


var pmSubject = "Welcome";
This is what the subject of the welcome PM will be. Chances are it will end up including the word "Welcome" in it...


var replyToUser = "admin";
var replyToName = "admin display name";
var replyToGroup = "group1";
If you want the main admin to be sending the PM then the only thing you need to edit here is the replyToName variable, where you put the main admin's display name. If I were using the code here I'd put "california" for example. This is what shows up in the "From:" field of the PM and for consistency should probably be whoever posted the welcome PM thread in THE FIRST STEP. If it's not the main admin, edit the user and the group. The groups are all "group1", "group2", "group3", etc., check the user's member group. If they're an administrator they're probably group1. If they're not an administrator, why are they sending the welcome PM? Probably safe to leave it at group1. All it determines is the color of the username link if you have colored member groups.


// Edit these if you have custom images for any of them
var imopen = "http://www.proboards.com/v4images/imopen.gif";
var imclose = "http://www.proboards.com/v4images/imclose.gif";
var im_inbox = "http://www.proboards8.com/v4images/buttons/im_inbox.gif";
var im_new = "http://www.proboards8.com/v4images/buttons/im_new.gif";
var im_outbox = "http://www.proboards8.com/v4images/buttons/im_outbox.gif";
var im_config = "http://www.proboards8.com/v4images/buttons/im_config.gif";
var im_reply = "http://www.proboards8.com/v4images/buttons/reply.gif";
var im_delete = "http://www.proboards8.com/v4images/buttons/delete.gif";
Like the comment says, you only need to edit these if you have custom images for them. Visit the URLs to figure out what images they are. Mostly the PM images obviously. If you have different images for different skins, you could do something like this:

Code:
// Edit these if you have custom images for any of them
if(pb_skinid == 1){
&nbsp; &nbsp; var imopen = "URL OF IMOPEN FOR SKIN 1";
&nbsp; &nbsp; var imclose = "URL OF IMCLOSE FOR SKIN 1";
&nbsp; &nbsp; var im_inbox = "URL OF IM_INBOX FOR SKIN 1";
&nbsp; &nbsp; var im_new = "URL OF IM_NEW FOR SKIN 1";
&nbsp; &nbsp; var im_outbox = "URL OF IM_OUTBOX FOR SKIN 1";
&nbsp; &nbsp; var im_config = "URL OF IM_CONFIG FOR SKIN 1";
&nbsp; &nbsp; var im_reply = "URL OF REPLY FOR SKIN 1";
&nbsp; &nbsp; var im_delete = "URL OF DELETE FOR SKIN 1";
}else if(pb_skinid == 2){
&nbsp; &nbsp; var imopen = "URL OF IMOPEN FOR SKIN 2";
&nbsp; &nbsp; var imclose = "URL OF IMCLOSE FOR SKIN 2";
&nbsp; &nbsp; var im_inbox = "URL OF IM_INBOX FOR SKIN 2";
&nbsp; &nbsp; var im_new = "URL OF IM_NEW FOR SKIN 2";
&nbsp; &nbsp; var im_outbox = "URL OF IM_OUTBOX FOR SKIN 2";
&nbsp; &nbsp; var im_config = "URL OF IM_CONFIG FOR SKIN 2";
&nbsp; &nbsp; var im_reply = "URL OF REPLY FOR SKIN 2";
&nbsp; &nbsp; var im_delete = "URL OF DELETE FOR SKIN 2";
}else if(pb_skinid == 3){
&nbsp; &nbsp; var imopen = "URL OF IMOPEN FOR SKIN 3";
&nbsp; &nbsp; var imclose = "URL OF IMCLOSE FOR SKIN 3";
&nbsp; &nbsp; var im_inbox = "URL OF IM_INBOX FOR SKIN 3";
&nbsp; &nbsp; var im_new = "URL OF IM_NEW FOR SKIN 3";
&nbsp; &nbsp; var im_outbox = "URL OF IM_OUTBOX FOR SKIN 3";
&nbsp; &nbsp; var im_config = "URL OF IM_CONFIG FOR SKIN 3";
&nbsp; &nbsp; var im_reply = "URL OF REPLY FOR SKIN 3";
&nbsp; &nbsp; var im_delete = "URL OF DELETE FOR SKIN 3";
}



Using a PM Bar Code?

If you're using a code that hides the "Hey X, you have X..." message, and replaces it with some sort of bar or button or message that appears elsewhere, you need to put that code below this welcome PM code, in the global footer, or it will not show the updated count.
« Last Edit: Nov 3, 2006, 12:47pm by Chris »Link to Post - Back to Top  IP: Logged

[image]
uhw
Guest
 Re: Automatic Welcome PM
« Reply #1 on Mar 30, 2006, 9:21am »

Board URL: http://

Nice code! lol i thought it was agaisnt ToS? I guess it must have changed or maybe the code was accepted cause it doesnt actually send the pm and im ranting again.....Well done!
Link to Post - Back to Top  IP: Logged
california
[image]
I'm not here...
member is offline

[avatar]



Joined: Nov 2004
Gender: Male
Posts: 6,425
 Re: Automatic Welcome PM
« Reply #2 on Mar 30, 2006, 9:28am »

Automatically submitting any form (which would be required for the code if it were a real PM) is not allowed. But this isn't a real PM and no form needs to be submitted.
Link to Post - Back to Top  IP: Logged

[image]
Matt
[image]
Warning: Purple is a horrible color
Expires: When you admit it.
member is offline

[avatar]

The Purple One


[homepage]

Joined: Oct 2005
Gender: Male
Posts: 1,224
Location: Indiana
 Re: Automatic Welcome PM
« Reply #3 on Mar 30, 2006, 5:50pm »

Board URL: http://
Link to Post - Back to Top  IP: Logged

[image]

california
[image]
I'm not here...
member is offline

[avatar]



Joined: Nov 2004
Gender: Male
Posts: 6,425
 Re: Automatic Welcome PM
« Reply #4 on Mar 30, 2006, 6:06pm »


Quote:
Board URL: http://


Want to elaborate on that?
Link to Post - Back to Top  IP: Logged

[image]
Ross
[image]
member is offline




[homepage]

Joined: Oct 2005
Gender: Male
Posts: 64
Location: UK
 Re: Automatic Welcome PM
« Reply #5 on Mar 30, 2006, 6:12pm »

Well done Cali. Good job, as always :) The thing that always stopped me doing it as a fake PM like that was the mini-profile not being accurate. I never thought of using a hidden board to put the message in ;)

Now, are you going to post this over at PBS to keep the members happy or will I have to steal your ideas and do my own version? j/k :P
Link to Post - Back to Top  IP: Logged

[image]
Signup for a free message board with 100s of Cool features and more being added all the time!
california
[image]
I'm not here...
member is offline

[avatar]



Joined: Nov 2004
Gender: Male
Posts: 6,425
 Re: Automatic Welcome PM
« Reply #6 on Mar 30, 2006, 6:37pm »

I'm just waiting for the TOS check on it so you don't reject it ;)
Link to Post - Back to Top  IP: Logged

[image]
raydog10
[image]
member is offline

[avatar]

Doggy Style



Joined: Mar 2006
Gender: Male
Posts: 12
 Re: Automatic Welcome PM
« Reply #7 on Mar 31, 2006, 10:29am »

Board URL: http://arecibopb.proboards59.com

Im Getting this message when trying to open the message as a new member "You specified multiple actions." and the pm bar on my menu bar does not reconize the new pm, only the info section at the bottom of the page. Please help me out. Thanxs
Link to Post - Back to Top  IP: Logged

Nice Dogs finish Last!
Anselm
[image]
member is offline



[msn]
[homepage]

Joined: Sept 2005
Gender: Male
Posts: 197
Location: Wales
 Re: Automatic Welcome PM
« Reply #8 on Mar 31, 2006, 10:49am »

A very good code cali. How you've done it is clever. Well done, I might use ;)
Link to Post - Back to Top  IP: Logged

[image]
raydog10
[image]
member is offline

[avatar]

Doggy Style



Joined: Mar 2006
Gender: Male
Posts: 12
 Re: Automatic Welcome PM
« Reply #9 on Mar 31, 2006, 7:28pm »

Board URL: http://arecibopb.proboards59.com I need help om getting an error messing when testing it with a new member plusit wont notify me of a new pm on my menu bar.... Please help
Link to Post - Back to Top  IP: Logged

Nice Dogs finish Last!
california
[image]
I'm not here...
member is offline

[avatar]



Joined: Nov 2004
Gender: Male
Posts: 6,425
 Re: Automatic Welcome PM
« Reply #10 on Apr 1, 2006, 2:09am »

Put any codes that modify the welcome table (basically your entire global header, essentially) in your global footer below this welcome PM code, and see if that helps.
Link to Post - Back to Top  IP: Logged

[image]
Chexdex
[image]
member is offline



[msn] [aim]
[homepage]

Joined: Dec 2005
Gender: Female
Posts: 68
Location: USA
 Re: Automatic Welcome PM
« Reply #11 on Apr 2, 2006, 4:17pm »

Board URL: http://charmed411p3.proboards75.com/index.cgi

Cali how do you know if the code work? Is their a way to find out?
Link to Post - Back to Top  IP: Logged
Swoofer
[image]
member is offline





Joined: Jun 2005
Posts: 118
 Re: Automatic Welcome PM
« Reply #12 on Apr 2, 2006, 4:18pm »

Board URL: http://talkinsports.proboards32.com

Not working for me.

I made a board viewable by guests, hid it, wrote my pm, put the code in the global footer, made a test account, and nothing...
Link to Post - Back to Top  IP: Logged
california
[image]
I'm not here...
member is offline

[avatar]



Joined: Nov 2004
Gender: Male
Posts: 6,425
 Re: Automatic Welcome PM
« Reply #13 on Apr 3, 2006, 2:36am »


Quote:
Board URL: http://charmed411p3.proboards75.com/index.cgi

Cali how do you know if the code work? Is their a way to find out?


Do what GEO/Swoofer described.
« Last Edit: Apr 3, 2006, 2:36am by california »Link to Post - Back to Top  IP: Logged

[image]
california
[image]
I'm not here...
member is offline

[avatar]



Joined: Nov 2004
Gender: Male
Posts: 6,425
 Re: Automatic Welcome PM
« Reply #14 on Apr 3, 2006, 2:37am »


Quote:
Board URL: http://talkinsports.proboards32.com

Not working for me.

I made a board viewable by guests, hid it, wrote my pm, put the code in the global footer, made a test account, and nothing...


It probably will work if you actually check the PMs. But the PM bar code won't show the udpated messages unless you place it below this code in the global footer.
Link to Post - Back to Top  IP: Logged

[image]
Page 1 of 4 » Jump to page   Go    [Search This Thread][Send Topic To Friend] [Print]

Click Here To Make This Board Ad-Free


This Board Hosted For FREE By ProBoards
Get Your Own Free Message Boards & Free Forums!
Terms of Service | Privacy Policy | Report Abuse | Mobile