[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: yes you're probably right even though I'm not able to test it. So I imagine then you don't know if with your mod the batch process stops when it encounters an error? Is this a general board question?


Exactly what error are you talking about? THe one you mentioned before was that it lost its connection to mysql...and that happened during the topic replay notification part which occurs after the mass email mailing is complete (so I imagine that email went out ok). Do you mean some other error?
khisanthax
Registered User
Posts: 443
Joined: Sun Mar 02, 2003 1:49 am

Post by khisanthax »

during the topic replay notification part which occurs after the mass email mailing is complete


That's what I needed to know, thank you SO much, you're mod has really helped me out. I'm sorry for any confusion that I have caused.
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

khisanthax wrote:
during the topic replay notification part which occurs after the mass email mailing is complete


That's what I needed to know, thank you SO much, you're mod has really helped me out. I'm sorry for any confusion that I have caused.


I'm glad it's working out for you, but you still have that pesky issue of a mysql timeout that occurs after the email is sent and, while that is not caused by this mod, it is something that admins of big boards who want to use this mod (or even the regular mass email function of an unmodded board) will want to know about.

Does your board run on a third party host or your own server? If your own server, you could probably just increase the timeout settings in php.ini (or maybe there's another way to do this directly with mysql)? If you are running on a third party host, maybe you could talk to the support people there about increasing the relevant time out settings.

Beyond that, the only thing I can suggest if you want to fix this at a more fundamental level is to check out that megamail mod I mentioned earlier ( http://www.phpbb.com/phpBB/viewtopic.ph ... 729#561729 ) and replace the email code that appears in this mod with the email code that appears in that mod. The email code for each is pretty modular so it probably wouldn't be too tough to do that, but since my board is only 150 users I don't feel the urge to do that myself.
User avatar
musa_ajk
Registered User
Posts: 11
Joined: Thu Feb 03, 2005 10:37 am

omitting hidden groups

Post by musa_ajk »

Hi Alan.

Has anyone mentioned in the email post mod about omitting hidden groups from the list of groups to send to?

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

Re: omitting hidden groups

Post by asinshesq »

musa_ajk wrote: Hi Alan.

Has anyone mentioned in the email post mod about omitting hidden groups from the list of groups to send to?

Thanks. :)


That never occurred to me, since I only allow admins to use this function on my board. But it should be easy to fix. Give this a try and let us know if it works:

Code: Select all

OPEN
posting.php

FIND
			WHERE group_single_user = 0

AFTER, ADD
			AND group_type <> 2
There is similar coding in admin/admin_mass_email.php but I assume you would want to include hidden groups in the list of groups that the admin can choose to email to, correct?
User avatar
musa_ajk
Registered User
Posts: 11
Joined: Thu Feb 03, 2005 10:37 am

Re: omitting hidden groups

Post by musa_ajk »

asinshesq wrote:
musa_ajk wrote:Hi Alan.

Has anyone mentioned in the email post mod about omitting hidden groups from the list of groups to send to?

Thanks. :)


That never occurred to me, since I only allow admins to use this function on my board. But it should be easy to fix. Give this a try and let us know if it works:

Code: Select all

OPEN
posting.php

FIND
			WHERE group_single_user = 0

AFTER, ADD
			AND group_type <> 2
There is similar coding in admin/admin_mass_email.php but I assume you would want to include hidden groups in the list of groups that the admin can choose to email to, correct?


That worked - just what was needed.

Thanks, your a super star once again.
:P :) :mrgreen:
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: omitting hidden groups

Post by asinshesq »

musa_ajk wrote: ...That worked - just what was needed....


Actually, it occurs to me that you may not want to do what I sugggested, since it will hide the hidden groups from the admin and from members of the hidden groups too.

If you need a workaround that will show hidden groups for the admin (and possibly for members of the hidden groups), let me know and I'll take a look at it. It will be very easy to show the hidden groups for admins but it would be somewhat more involved to show hidden groups to the members of those hidden groups.

(Note for other users of this mod: this discussion about hidden groups is not relevant for most of the users of this mod since it is only relevant if you install the mod to the mod that allows regular users to email posts.)
User avatar
musa_ajk
Registered User
Posts: 11
Joined: Thu Feb 03, 2005 10:37 am

Post by musa_ajk »

Hi Alan.

The change I made from your tweak was relevant this morning. Just now before you posted I had a request to actually include the users in the hidden groups, in contrast to the request this morning. :roll:

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

Post by asinshesq »

musa_ajk wrote: Hi Alan.

The change I made from your tweak was relevant this morning. Just now before you posted I had a request to actually include the users in the hidden groups, in contrast to the request this morning. :roll:

Thanks anyway.


OK, I'll look at it and see what I can do sometime in the next few days if I have the time.
User avatar
musa_ajk
Registered User
Posts: 11
Joined: Thu Feb 03, 2005 10:37 am

Post by musa_ajk »

Hi Alan.

I think you misunderstood here. It's okay - just reverted back to what it was before the tweak.

Thanks again. :)
charanis
Registered User
Posts: 1
Joined: Fri Jan 21, 2005 8:31 pm
Location: atlanta
Contact:

This may not be the place but what about mailman email posts

Post by charanis »

I have an email list that we use as a newsgroup. About 50 people all send to one address and it then send to everyone. Some have said they would rather do this in a BB. I was considering this mod as a way to sort of get there but its only one way. Any mods you know of that will simulate Yahoo newsgroups - posting either via web or email.

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

Re: This may not be the place but what about mailman email p

Post by asinshesq »

charanis wrote: I have an email list that we use as a newsgroup. About 50 people all send to one address and it then send to everyone. Some have said they would rather do this in a BB. I was considering this mod as a way to sort of get there but its only one way. Any mods you know of that will simulate Yahoo newsgroups - posting either via web or email.

Jim


I'm not really sure what you are looking for.

This mod would allow the poster (if he checks a box) to cause the post to be emailed to everyone. And you could easily change things so that the checkbox was checked by default (or always on) so that you didn't have to rely on people checking anything. Is that what you want?

Alternatively, there are other mods out there that collect a bunch of new posts on the board once a day, digest them and email them out as one big email to eveyone...maybe that's what you are looking for?
User avatar
musa_ajk
Registered User
Posts: 11
Joined: Thu Feb 03, 2005 10:37 am

users within groups not receiving emails...

Post by musa_ajk »

Hi Alan.

Shortly after implementing the change below, certain users within a selected group stopped receiving emails. After many hours checking the configuration of users, groups and forums, found out that if "include users even if they are....." is ticked it then works.

In posting.php, the line for "include users..." is just above "poster signs..." . Maybe I'm missing something but I can't see anything wrong here - can you?:

$template->assign_vars(array(

'L_DESIGNATED_GROUPS_CP' => $lang['Designated_groups_CP'],
'L_DESIGNATED_GROUPS_CP_EXPLAIN' => $lang['Designated_groups_CP_explain'],
'L_GROUPS' => $lang['Usergroups'],
'L_SELECT' => $lang['Select'],
'L_DESIGNATE' => $lang['Send_email'],
'L_CANCEL_EMAIL' => $lang['Cancel_email'],
'L_MARK_ALL_GROUPS' => $lang['Mark_all_groups'],
'L_UNMARK_ALL_GROUPS' => $lang['Unmark_all_groups'],
'L_INCLUDE_TEXT' => $lang['Include_text'],
'L_INCLUDE_UNAUTHORIZED_USERS' => $lang['Include_unauthorized_users'],
'L_POSTER_SIGNS' => $lang['Poster_signs'],

'S_HIDDEN_FIELDS' => '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" /><input type="hidden" name="' . POST_POST_URL . '" value="' . $post_id . '" /><input type="hidden" name="mode" value="' . $mode . '" /><input type="hidden" name="notify" value="' . $notify_user . '" />',
'S_DESIGNATED_GROUPS_CP_ACTION' => append_sid("posting.$phpEx"),
'S_INCLUDE_TEXT' => 'checked="checked"',
'S_INCLUDE_UNAUTHORIZED_USERS' => '',
'S_POSTER_SIGNS' => 'checked="checked"')

);
asinshesq wrote:
asinshesq wrote:...As for your last question, if you are using the mod to the mod that allows users to have posts they are emailing signed by them rather than the board, you should be able to change the default so that the email by default gets signed by the user doing this...

Code: Select all

...
Sounds like maybe you tried that already...
[/quote] 

Here's the problem: there's a typo in my mod where it refers to S_POSTER_SIGNS in the template.

So, try this (you've already done the first part so you only need to make teh second change):

[code]
OPEN
posting.php

FIND
			'S_POSTER_SIGNS' => '')

REPLACE WITH
			'S_POSTER_SIGNS' => 'checked="checked"')

OPEN
templates/subSilver/designated_groups_cp_body.tpl

IN-LINE FIND
{S_POSTER SIGNS}

IN-LINE REPLACE WITH
{S_POSTER_SIGNS}
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: users within groups not receiving emails...

Post by asinshesq »

musa_ajk wrote: Hi Alan.

Shortly after implementing the change below, certain users within a selected group stopped receiving emails. After many hours checking the configuration of users, groups and forums, found out that if "include users even if they are....." is ticked it then works.

In posting.php, the line for "include users..." is just above "poster signs..." . Maybe I'm missing something but I can't see anything wrong here - can you?...


I don't see anything wrong there either, and I doubt that's the problem.

The mod is set up so that by default a user only will get an email notification of a post if he is authorized to view that post (though you can override that default by checking the box you are talking about). I set things up that way because otherwise people who do not have read rights in a given forum would get an email notification of a post in that forum and when they click the link they would get a message that there is no such post (since they are not authroized to read the post).

Are you really sure that the users in question have rights to read posts in the forum in question? It is not enough to say that some other members of the very same group are successfully receiving the emails, because those other members may be in still other groups that have authorization to read that forum (or the individual users may have been granted user level permission to read that forum).

Having said that, if you are really sure that some of these members have read permissions (which you can test by asking them if they are able to go to the forum and read the post in question), then there is a problem somewhere that we should be able to track down. The code that figures out whether a particular person has permission is the following code that the mod puts in includes/functions.post.php:

Code: Select all

			if( !$include_unauthorized_users )
			{
				// ok, let's limit the recipients to users who are allowed to read this particular forum...
				if( $group_id != -1 )
				{
				// if 'all users' is not checked (i.e. group_id !=-1), look up all users in the selected groups who are authorized to be in this forum
					$sql = "SELECT DISTINCT u.user_id, u.user_email, u.user_lang, u.username, f.forum_name
					FROM " . USERS_TABLE . " u
					INNER JOIN " . USER_GROUP_TABLE . " ug ON u.user_id = ug.user_id
					LEFT OUTER JOIN " . AUTH_ACCESS_TABLE . " aa ON ug.group_id = aa.group_id,
					" . FORUMS_TABLE . " f,
					" . USER_GROUP_TABLE . " ug2,
					" . GROUPS_TABLE . " g
					WHERE u.user_id NOT IN (" . ANONYMOUS . $user_id_sql . ")
					AND f.forum_id = $forum_id
					AND u.user_active = 1
					AND
					(
						( aa.forum_id = $forum_id AND aa.auth_read = 1 )
						OR f.auth_read <= " . AUTH_REG . "
						OR (u.user_level = " . MOD . " AND f.auth_read = " . AUTH_MOD . ")
						OR u.user_level = " . ADMIN . "
					)
					AND ug2.user_id = u.user_id
					AND g.group_id = ug2.group_id
					AND g.group_notify = 1";
				}
				else
				{
				// if 'all users' is checked (i.e. group_id =-1), look up all active users who are authorized to be in this forum
					$sql = "SELECT DISTINCT u.user_id, u.user_email, u.user_lang, u.username, f.forum_name
					FROM " . USERS_TABLE . " u
					INNER JOIN " . USER_GROUP_TABLE . " ug ON u.user_id = ug.user_id 
					LEFT OUTER JOIN " . AUTH_ACCESS_TABLE . " aa ON ug.group_id = aa.group_id, 
					" . FORUMS_TABLE . " f
					WHERE u.user_id NOT IN (" . ANONYMOUS . $user_id_sql . ")
					AND f.forum_id = $forum_id
					AND u.user_active = 1
					AND
					(
						( aa.forum_id = $forum_id AND aa.auth_read = 1	)
						OR f.auth_read <= " . AUTH_REG . "
						OR (u.user_level = " . MOD . " AND f.auth_read = " . AUTH_MOD . ")
						OR u.user_level = " . ADMIN . "
					)";
				}
			}
User avatar
musa_ajk
Registered User
Posts: 11
Joined: Thu Feb 03, 2005 10:37 am

Post by musa_ajk »

Hi Alan.

These users certainly do have authorisation - they are moderators of said forum. I'll check the code for includes/functions.post.php - there might have been an error made by myself, who knows.

Thanks. :P :oops:
Post Reply

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