Author |
Topic |
JBaldwin
Junior Member
USA
137 Posts |
|
brian33433
New Member
60 Posts |
Posted - 23 June 2006 : 03:32:02
|
well i don't have the mod installed, but whtever your using to emil your members you can write some code to just add that particular database field, if you past what email mod your using i'll take a look....
Brian http://nightclubtonight.com< |
When it happens after dark, its twice as nice... http://nightclubtonight.com |
Edited by - brian33433 on 23 June 2006 03:33:01 |
|
|
JBaldwin
Junior Member
USA
137 Posts |
Posted - 23 June 2006 : 10:43:54
|
I am using the Email All Users Mod to email the entire forum and I have made changes to that mod already to email selected members (with selected criteria from FORUM_MEMBERS table. I think I would have to do a series of JOINS in the SQL STRING to accomplish what I want, but I do not know enough about JOINS to do so.
admin_pop_mail.txt
The database fields for the USERGROUP MOD that I installed are...
[CREATE]
USERGROUPS
USERGROUP_ID
USERGROUP_NAME#varchar(100)##
USERGROUP_DESC#memo#NULL#
USERGROUP_TYPE#int##0
AUTOJOIN#int##0
MEM_HIDE#int##0
MOD_HIDE#int##0
[END]
[CREATE]
USERGROUP_USERS
USERGROUP_ID#int##
MEMBER_ID#int##
MEMBER_TYPE#int##1
[END]
[CREATE]
ALLOWED_USERGROUPS
USERGROUP_ID#int##
FORUM_ID#int##
PERMS#int##0
[END]
[INSERT]
CONFIG_NEW
(C_VARIABLE,C_VALUE)#('STRUGVIEW','0')
(C_VARIABLE,C_VALUE)#('STRUGMEMVIEW','0')
(C_VARIABLE,C_VALUE)#('STRUGMODFORUMS','0')
[END]
< |
AbsolutelyFreerolls.com - Poker Freeroll Listings, Poker Forum and Poker News
|
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 23 June 2006 : 12:49:15
|
The UserGroup MOD includes a function to get an array of Member ID's for a particular group. I don't have it in front of me at the moment, but it might be a starting point.< |
|
|
brian33433
New Member
60 Posts |
Posted - 23 June 2006 : 17:09:38
|
Ok i think you should look in this direction, its kinda tough cuse i don't have the mod installed, but if i get a chance i will look install it on my test server. you may need to create a inc_mail 2
it seems the to key db fields you need to impliment in the strsql are USERGROUPS, USERGROUP_ID, USERGROUP_NAME
change strSql = strSql & " FROM " & strMemberTablePrefix & "USERGROUPS_ID"
basicaly you need the "from" to send to usergroup_id and not member_id
then make changes as so on, let me know if you get anywhere with this, otherwise i'll try to get the mod going on my test server
this should give you a point in the right direction
on the same file or w/ the newsletter mod. if anyone know how to create it so you can email certin members from choosing check boxs would love to do this.
good luck brian http://nightclubtonight.com < |
When it happens after dark, its twice as nice... http://nightclubtonight.com |
Edited by - brian33433 on 23 June 2006 17:15:37 |
|
|
JBaldwin
Junior Member
USA
137 Posts |
Posted - 28 June 2006 : 10:43:20
|
Ok. I have installed the Usergroups Mod. I want to email a usergroup much like with the "Email All Users" mod, but only to certain usergroups. I took the "Email All Usergroups" mod and tried to alter the SQL Statement. I used a JOIN for the MEMBERS and USERGROUP_USERS tables. The way I have it here:
www.jbaldwin.net/misc/admin_mail_usergroups1.txt
I get this error:
SELECT FORUM_MEMBERS.*, FORUM_USERGROUP_USERS.* FROM FORUM_MEMBERS LEFT JOIN FORUM_USERGROUP_USERS ON FORUM_MEMBERS.MEMBER_ID=FORUM_USERGROUP_USERS.MEMBER_ID WHERE FORUM_MEMBERS.M_STATUS = 1 AND FORUM_MEMBERS.M_RECEIVE_EMAIL = 1 AND FORUM_USERGROUP_USERS.USERGROUP_ID = 2
Sending E-Mail
Microsoft VBScript runtime error '800a000d'
Type mismatch: '[string: "Demo"]'
/forum/forum2/admin_pop_mail_usergroups.asp, line 128
It is caused by this section in the code:
Select Case Member_Level
Case 1
strMessage = strMessage & "a member of usergroup 1 "
Case 2
strMessage = strMessage & "a member of usergroup 2 "
End Select
Now, if I comment out that section, it says it sends the email, however, I do not receive an EMAIL?? I am hoping this is something simple, but I honestly have no idea....LOL :
SELECT FORUM_MEMBERS.*, FORUM_USERGROUP_USERS.* FROM FORUM_MEMBERS LEFT JOIN FORUM_USERGROUP_USERS ON FORUM_MEMBERS.MEMBER_ID=FORUM_USERGROUP_USERS.MEMBER_ID WHERE FORUM_MEMBERS.M_STATUS = 1 AND FORUM_MEMBERS.M_RECEIVE_EMAIL = 1 AND FORUM_USERGROUP_USERS.USERGROUP_ID = 2
Sending E-Mail
Sent 1 E-Mail
Close Window
...and to further add to my confusion, if I add a Response.Write to see what the variables are that the SQL is pulling:
Response.Write Member_Name & " --- " & Member_Email & " --- " & Usergroup_ID & "<hr>"
It is pulling out some odd variables, it looks like it is only pulling data from the USERGROUPS_ID table.
Sending E-Mail
797 (this is actually Member ID) --- 1 (this could be Status, level or...) --- Demo (this is the Member Name)------------------------------------------------
Microsoft VBScript runtime error '800a000d'
Type mismatch: '[string: "Demo"]'
/forum/forum2/admin_pop_mail_usergroups.asp, line 131
Have I thoroughly confused everyone here? I know I've confused myself for SURE! LOL. Put a fork in me, I'm done. < |
AbsolutelyFreerolls.com - Poker Freeroll Listings, Poker Forum and Poker News
|
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 28 June 2006 : 11:16:26
|
The UserGroup MOD adds a function called "getGroupMembership" that returns a comma-delimited list of either the Group ID's a person belongs to, or a comma-delimited list of Member ID's in a group.
Assuming the GroupID is 2, you could do something like this:
strMemList = getGroupMembership(2,2) 'The first value is the ID, the second is an indication of if its a group or member id you just passed.
If strMemList <> "" Then
strSQL = "SELECT M.M_EMAIL FROM " & strMemberTablePrefix & "MEMBERS M " & _
"WEHRE M.MEMBER_ID IN (" & strMemList & ") AND M.M_STATUS = 1 AND M.M_RECEIVE_EMAIL = 1"
End If
This should give you a recordset of all the email addresses. I may be missing a few minor details, but this should get you started. < |
|
|
JBaldwin
Junior Member
USA
137 Posts |
Posted - 28 June 2006 : 12:16:49
|
my head hurts now. I officially pass the torch to someone with higher ASP skills than mine (which shouldn't be THAT difficult - as mine are minimal at BEST). If I stay on this any further, my laptop will officially become airborne, LOL.
I know how to add items and variables to MEMBERS table and send emails that way, maybe I'll go this route instead of trying to use USERGROUPS. ARGHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH< |
AbsolutelyFreerolls.com - Poker Freeroll Listings, Poker Forum and Poker News
|
|
|
brian33433
New Member
60 Posts |
Posted - 28 June 2006 : 12:38:23
|
well once again i don't know that mod, but what if you make a duplicate of email all users, and set that up with usergroup_id instead of member_id.
just seems easier then dealing with all new arrays
(just my 2 cents)< |
When it happens after dark, its twice as nice... http://nightclubtonight.com |
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 28 June 2006 : 13:10:31
|
quote: Originally posted by brian33433
well once again i don't know that mod, but what if you make a duplicate of email all users, and set that up with usergroup_id instead of member_id.
All that is going to do is get you the array of MemberIDs. That's why I suggested using the bit I posted to get a recordset of e-mail addresses for the people in that usergroup.
If I've got time this weekend I may take a crack at it, but I can't promise anything. Bobby wants the Jesus Joshua 24:15 and Warsong Records sites re-built for the Sept. release of their new CD... it doesn't exactly leave me much spare time.< |
|
|
PPSSWeb
Junior Member
312 Posts |
Posted - 28 June 2006 : 15:18:28
|
The following JOIN seems to work in my minor testing:
strSql = "SELECT M.MEMBER_ID, M.M_Email FROM " & strMemberTablePrefix & "MEMBERS M " &_ "INNER JOIN " & strTablePrefix & "USERGROUP_USERS UM ON M.MEMBER_ID = UM.MEMBER_ID " &_ "WHERE UM.MEMBER_TYPE = 1 AND UM.USERGROUP_ID = " & GroupID & " ORDER BY M.M_NAME"
It is based on the view users section of usergroups.asp
Hope that helps< |
|
|
JBaldwin
Junior Member
USA
137 Posts |
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 28 June 2006 : 17:36:15
|
Ahhh I thought you were trying to make something modeled after the MOD, not built into the MOD.
Like I said earlier, if I have the time, I may take a crack at it this weekend. You're using the one that is posted on kwhipp's site, right?< |
|
|
JBaldwin
Junior Member
USA
137 Posts |
|
secretsquirrel
New Member
Australia
81 Posts |
Posted - 07 August 2007 : 14:24:57
|
I dont know what happened with this in the end. Did it get done? Could an email form be added in the usergroup manager to email selected usergroups?< |
Anyone who says a square peg does not fit into a circular hole has never seen a crazy bítch with a hammer |
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 07 August 2007 : 17:26:01
|
It was on my perpetual to-do list and never got to it...
Using some of the code above you would have a good start at giving it a shot yourself.< |
|
|
Topic |
|