PM Mod - Welcome Message - Postet den (1432 Views)
Average Member
Jorrit787
Innlegg: 681
681
I am working on a function that automatically send a new registering user a welcome PM, but I've gotten stuck somehwere in the middle blackeye I created a file called inc_func_pm , and right now it contains the following function:

<deleted>

(Does this belong in the DEV forum?)<
   
 Sidestørrelse 
Postet den
Senior Member
MarkJH
Innlegg: 1722
1722
Best of luck with this MOD, Jorrit. There is a Welcome PM MOD available here but it hasn't been updated for four years. Would be a great feature! bigsmile<
Bandlink.net - http://www.bandlink.net/
Bandlink Music Forums - http://www.bandlink.net/forum/
Postet den
Average Member
Jorrit787
Innlegg: 681
681
I'm having trouble getting the MEMBER_ID to send the Welcome PM to from the database. Right now the code I have is this:
Code:
	'### Forum SQL - Get the Member ID to send the Welcome PM to
strSql = "SELECT MEMBER_ID FROM " & strTablePrefix & "MEMBERS "
strSql = strSql & " WHERE M_WPMSENT = 0 "

set rsMember = my_conn.Execute(strSql)

strPMNID = rsMember

RsMember.close
set RsMember = nothing
Is this the right way to select the MEMBER_ID and to pass it on to PMNID (the value that determines to whom the PM is sent) question<
Postet den
Junior Member
TStewartFan
Innlegg: 190
190
I took out that widdle pm mod out from my site so I don't know for sure if anything if this will be right but it outta be close. Two things with this sql statement which presents a problem....what happens if there is never a value of 0?!? You will get an error page that the statement is true so you need an if else statement. And the second it doesn't appear as if it is saving anything. Try something like this:

'### Forum SQL - Get the Member ID to send the Welcome PM to
strSql = "SELECT MEMBER_ID FROM " & strTablePrefix & "MEMBERS "
strSql = strSql & " WHERE M_WPMSENT = 0 "

set rsMember = my_conn.Execute(strSql)
do while not rsMember.EOF
myMember = rsMember ("MEMBER_ID")

'the action you want to perform goes here

rsMember.MoveNext
loop
rsMember.close
set RsMember = nothing

Essientially this will run through the database and perform an action if a member has a value = to 0. Also be sure within the loop to update the value to 1 otherwise the loop will run forever. Again this is just an educated guess based on past sql statements I have had to write but since I don't have the mod installed anymore I can't test the theory out for you. Good luck!<
If You Have to Ask, You Wouldn't Understand.
Postet den
Average Member
Jorrit787
Innlegg: 681
681
And the second it doesn't appear as if it is saving anything.
The code above is not the whole code... I'm not that dense bigsmile
I think I'm about done... I'll do some final bug-checking and then I'll post the MOD here. So far the MOD sends the new user a welcome PM and it notifies Admins of the new member's registration.<
Postet den
Average Member
mortioli
Innlegg: 898
898
This MOD is just what I needed, so was wondering if you managed to complete it?
Thanks,
Oli<
Postet den
Average Member
mortioli
Innlegg: 898
898
*bump* ?<
Postet den
Average Member
mortioli
Innlegg: 898
898
Sorry to bump again, but does anyone know if this was ever continued please?
Thanks<
Postet den
Senior Member
MarkJH
Innlegg: 1722
1722
Sounds like you might be better off emailing Jorrit. Would be a very nice MOD to have available, that one.<
Bandlink.net - http://www.bandlink.net/
Bandlink Music Forums - http://www.bandlink.net/forum/
Postet den
Average Member
Jorrit787
Innlegg: 681
681
Several people have emailed me about this; I am not working on this any more.<
Postet den
Senior Member
MarkJH
Innlegg: 1722
1722
Hmm. Maybe you could post what you have? A lot of people would be interested in this and it's a shame that it was left in limbo after:

I think I'm about done...
<
Bandlink.net - http://www.bandlink.net/
Bandlink Music Forums - http://www.bandlink.net/forum/
Du må legge inn en melding