[2.0.21] email posts or messages to combinations of groups

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
28
70%
Very Good
9
23%
Good
1
3%
Fair
2
5%
Poor
0
No votes
 
Total votes: 40

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

khisanthax wrote: When I post a new topic and try to email to a group it says it cannot find the forum. When I try to reply and send the email to a group it says I have to choose a topic to reply to. Do you have any idea what might be causing this?


Errrr....how about you made a mistake in installing the mod? ;)

Seriously, did you use easymod to install? If not, I suggest you go back to your backups and install it again, this time using easymod. Otherwise, it's going to be a pain (not impossible, but a pain) to track this down.
khisanthax
Registered User
Posts: 443
Joined: Sun Mar 02, 2003 1:49 am

Post by khisanthax »

I didn't use easy mod but I checked again and it appears to be all in place. Does this mod have any known problems with PCP or with the forum hierarchy mod?
JasonMSM
Registered User
Posts: 3
Joined: Sat Feb 18, 2006 11:12 pm

Post by JasonMSM »

Is there a simple (ha!) way to remove the option for "All Registered Users" so that only a group I designate is 'checkable' and/or visible in the list of groups seen? I've enabled it so that all users can do the mass email, but given that I'll have one group who wishes to receive email, and one who won't, I'd like to limit it to only one option. I read the code listed in posting.php based on your mod, but I'm a php newb so I'm not really sure how to code it so that this happens. I was also wondering what the coding would be so that the mass email would only be applicable for a 'new post' rather than a 'reply'...I saw that you had referenced the Hermann mod as being easier to use for this purpose, but I find yours a bit more elegant for what I'm trying to do overall, so if it was possible, I'd prefer to mod your mod than to use the forum notification mod.
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

JasonMSM wrote: Is there a simple (ha!) way to remove the option for "All Registered Users" so that only a group I designate is 'checkable' and/or visible in the list of groups seen? I've enabled it so that all users can do the mass email, but given that I'll have one group who wishes to receive email, and one who won't, I'd like to limit it to only one option...


I see this is your first post to phpbb.com, Jason. Welcome. You'll find the people at this forum very helpful...I suspect because we were all newbies once and remember how bewildering it was.

Anyway, it should be easy to get rid of the all registered users option and limit the choices to particular groups. There's the elegant way where you get to choose in a group's permissions whether people should be able to mass email posts to that group and there's the kludge where you just hard code into the main script the constraint on which group_ids you want include in the target group list. I'll give you the kludge because the other way is quite a bit more coding:

Code: Select all

OPEN
posting.php

FIND
			if( $is_auth['auth_mod'] || $is_auth['auth_emailposts'] )
			{
				// since this is a moderator or specifically authorized to email posts, do not limit the group lookup sql
				$sql_limit_groups = '';

				// now feed the template the information for the 'All users' row...
				$group_id = -1;
				$group_name = $lang['All_registered_users'];
				$group_notify = FALSE;
				// note that if you want 'all users' to be selected by default, change
				// the preceding line to $group_notify = TRUE;

				$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
				$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];

				$template->assign_block_vars('listrow', array(
				'ROW_COLOR' => '#' . $row_color,
				'ROW_CLASS' => $row_class,

				'S_MARK_ID' => $group_id,
				'S_DEFAULT_DESIGNATED_GROUPS' => ( $group_notify ) ? 'checked="checked"' : '',

				'U_GROUP_NAME' => $group_name)
				);
			}
			else
			{
				// since this is not a moderator or speicfically authorized to email posts, limit the group lookup
				// sql to instances where the user is a moderator of a group
				$temp_user_id = $userdata['user_id'];
				$sql_limit_groups = "AND group_moderator = $temp_user_id";
			}

REPLACE WITH
			// mod to email posts mod so that users can only email posts to a specified subset of groups...
			// replaced the next if and else statements that used to be here with 
			// a new $sql_limit_groups definition that confines the target groups to those specified in that definition...
			// note that you need to fill in the parenthetical in the next line with a comma delineated list of the group_ids 
			// for all groups you want to show up as target groups for an emailing of posts.
			// For example, if you want to include the groups with group_ids 5 and 7, the parenthetical would read (5,7) 
			// but if you only want to include the grouo with group_id 4 the parenthetical would read (4)
			$sql_limit_groups = "AND group_id IN ()";
JasonMSM wrote: ...I was also wondering what the coding would be so that the mass email would only be applicable for a 'new post' rather than a 'reply'...I saw that you had referenced the Hermann mod as being easier to use for this purpose, but I find yours a bit more elegant for what I'm trying to do overall, so if it was possible, I'd prefer to mod your mod than to use the forum notification mod.


I wasn't sure if you were asking for all new topics to automatically get emailed to the users in a specified group or whether you were instead trying to enable people who post new topics to choose whether or not to mail them. If the later (i.e. if you want to give posters the power to choose whether to email new topics), try this (and if you meant you wanted all new topics to automatically get emailed to specified groups, that shouldn't be too hard either...let me know):

Code: Select all

OPEN
posting.php

FIND
// now, check to see if the user is the right kind of user who should have a checkbox option
if( $is_auth['auth_mod'] || $is_auth['auth_emailposts'] || $group_moderator['cnt'] <> 0 )

REPLACE WITH
// mod to email posts mod so that only new posts rather than replies can be emailed...changed the next block of code...
// now, check to see if the user is the right kind of user who should have a checkbox option
// and check to see if this is a new post (we'll allow only new posts to be emailed) 
if( ($is_auth['auth_mod'] || $is_auth['auth_emailposts'] || $group_moderator['cnt'] <> 0) && $mode == 'newtopic' )
Make sure that you click the quote button on this post and then copy and paste the above code into a text editor, since otherwise you may be messing up the format in a way that will mess up the script.

Please keep in mind that I dashed both of these hacks off without really studying them and haven't tested either, so you may need to play with things to get them to work properly. If you have trouble, feel free to come back and ask for help. And remember to back your files up before you try this so that it's easy to revert if you need to.
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

khisanthax wrote: I didn't use easy mod but I checked again and it appears to be all in place. Does this mod have any known problems with PCP or with the forum hierarchy mod?

Sorry, I don't use either. Why don't you check over at ptirhiik's place and see if any of them have got this working with CH or PCP. If there is no incompatibility and you don't know where to start in debugging this, come back here and we can talk some more.

If there is an incompatibity, someone has probably harmonized the two but if not, again come back here and we'll talk.
JasonMSM
Registered User
Posts: 3
Joined: Sat Feb 18, 2006 11:12 pm

Post by JasonMSM »

asinshesq wrote: I see this is your first post to phpbb.com, Jason. Welcome. You'll find the people at this forum very helpful...I suspect because we were all newbies once and remember how bewildering it was.

Thank you for the kind words, you've already been unbelievably helpful!
Anyway, it should be easy to get rid of the all registered users option and limit the choices to particular groups. There's the elegant way where you get to choose in a group's permissions whether people should be able to mass email posts to that group and there's the kludge where you just hard code into the main script the constraint on which group_ids you want include in the target group list. I'll give you the kludge because the other way is quite a bit more coding:

My question here (so far, the code looks to have worked perfectly) is how I know which group is which? is this simply a trial and error process, or is there a simple way to determine which group is designated which number? The way the code set up (which is PERFECT!) with my inputting 1 group (I tried group 2 as a test) now leaves no option to check a group - it's automatic, which is EXACTLY what I was looking for, but my lack of experience leaves me a bit short in determining which group is which numerically...
I wasn't sure if you were asking for all new topics to automatically get emailed to the users in a specified group or whether you were instead trying to enable people who post new topics to choose whether or not to mail them. If the later (i.e. if you want to give posters the power to choose whether to email new topics), try this (and if you meant you wanted all new topics to automatically get emailed to specified groups, that shouldn't be too hard either...let me know):

The code you gave was perfect! Works flawlessly and does exactly what I was looking for! Thanks so much for that!
Make sure that you click the quote button on this post and then copy and paste the above code into a text editor, since otherwise you may be messing up the format in a way that will mess up the script.
Please keep in mind that I dashed both of these hacks off without really studying them and haven't tested either, so you may need to play with things to get them to work properly. If you have trouble, feel free to come back and ask for help. And remember to back your files up before you try this so that it's easy to revert if you need to.
Now you're just bragging! ;) They worked wonderfully, thanks again. I'm sure I'll be back with more questions as I tweak and tune the board a little more.
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

JasonMSM wrote: ...My question here (so far, the code looks to have worked perfectly) is how I know which group is which?...

You can click the usergroups link at the top of your forum index and then click 'view information' for the group you are interested in. Now look up at the address in your browser and you will see part of the address looks something like this:groupcp.php?g=___ (where the blank is a simple number). That number is the group_id.
JasonMSM wrote: ...The way the code set up (which is PERFECT!) with my inputting 1 group (I tried group 2 as a test) now leaves no option to check a group - it's automatic, which is EXACTLY what I was looking for, but my lack of experience leaves me a bit short in determining which group is which numerically...

I suspect that if you have a real group_id in there, it will give you an option as to whether to select that group or not. If you want, you can set it up so that the checkbox is checked by default. Just do this:

Code: Select all

OPEN
posting.php

FIND
				$group_name = $row['group_name'];
				$group_notify = FALSE;

REPLACE WITH
				$group_name = $row['group_name'];
				$group_notify = TRUE;
Make sure you change the right line, because there is more than one line in posting.php that reads $group_notify = FALSE;

If you do that, then when the screen comes up the group or groups you have specified in that parenthetical I mentioned in my last post will all be checked by default but the user will be allowed to uncheck them if he wants.
JasonMSM
Registered User
Posts: 3
Joined: Sat Feb 18, 2006 11:12 pm

Post by JasonMSM »

Beautiful! Everything works great, and the option list shows up as the single group. Thank you again!
drb
Registered User
Posts: 137
Joined: Tue Nov 08, 2005 4:37 pm

Post by drb »

Hi,
I am trying to sort of have a newsletter for my forum. Unfortunately, existing MODs are abandoned or non-functional.
I think if I tweak this MOD to suit my wish, then it will be the apt one.

I realize that it can send emails to subscribed people during a post by admin/moderator. I am wondering if they can add some more content or text in the email while sending it rather than just the 'post' content.

Is that possible?

thanks,

drb
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

drb wrote: ...I realize that it can send emails to subscribed people during a post by admin/moderator. I am wondering if they can add some more content or text in the email while sending it rather than just the 'post' content...

I'm not sure exactly what you want to do. The mod allows the admin (or other authorized users) to email real posts to selected groups, but on top of that the mod also allows the admin to write an email that isn't a post (with any text he wants and as long as he wants) and mass email that out to selected groups. Is that what you are talking about or do you have something else in mind?
drb
Registered User
Posts: 137
Joined: Tue Nov 08, 2005 4:37 pm

Post by drb »

Sorry I wasn't clear.

Admin mass mailing all users is by default there. Your MOD adds another capability of mass mailing to selected people. Am i right?

What I really wish is:
like a newsletter.
According to your MOD, say I the admin and making a post and wish to send that detail to all subscribed users to that particular forum. Your MOD basically sends the actual content of the post.

My question is can I edit that and add some more content while sending that email? I mean in addition to the post's real content, I wish to have some more 'typed' content while sending.

Is that possible?

hope I am clear.

thanks,

drb
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

drb wrote: ...My question is can I edit that and add some more content while sending that email? I mean in addition to the post's real content, I wish to have some more 'typed' content while sending....

But if that's what you want to do, why wouldn't you just copy the post and paste it into a mass email that the admin edits (to add content) and sends to whichever groups he wants?

It wouldn't be that hard to add the capability to add additional content to a post being emailed, but since I don't need that for my board I don't think I'll be doing it myself. However, I'd be happy to answer questions or point you in the right direction if you have some php skills and want to take a crack at it.
drb
Registered User
Posts: 137
Joined: Tue Nov 08, 2005 4:37 pm

Post by drb »

well, wanted it to be automatic as much as possible. It gets tedious to do that everyday. And on top of that, i have no php skills.

well, for the time being, i will go with this MOD and see.

thanks.
penelope_b
Registered User
Posts: 70
Joined: Thu Dec 01, 2005 3:37 am

Post by penelope_b »

I'm having a bit of a difficult time figuring out exactly what this mod does.

I've been looking for a mod that will let my users create usergroups and let people join them. Then be able to Mass PM/Email said usergroups. We have a sort of travelling concert contingent, and it would make things easier on people who are rooming/travelling/whatever to have a board based Mass PM function based on usergroups they control.

Does this mod meet any of that desire? :P
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

This mod has nothing to do with creating groups. What it does is to enable authorized users to email posts to one or more user groups that have already been esatablished.
Post Reply

Return to “[2.0.x] MOD Database Releases”