[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

morris082
Registered User
Posts: 2
Joined: Tue Mar 15, 2005 6:07 am

automatically to all

Post by morris082 »

hey -

installed the mod and works brilliantly - but i'm trying to modify the mod and am stumped as i'm new to php/mysql interaction.

I've seen this subject come up, and it was replied to with "it can be done with tinkering" -- which is where I need a bit of help...

Is it possible to adjust everything so that when any user submits any new post/thread, an email will be sent to All users of the forum (its a small forum, so this isn't so mad).

I'm loving all the other edits & such you've been making by the way -- learning a great deal by walking through it. ..

cheers for any help, and thanks regardless if not...

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

Re: automatically to all

Post by asinshesq »

morris082 wrote: hey -

installed the mod and works brilliantly - but i'm trying to modify the mod and am stumped as i'm new to php/mysql interaction.

I've seen this subject come up, and it was replied to with "it can be done with tinkering" -- which is where I need a bit of help...

Is it possible to adjust everything so that when any user submits any new post/thread, an email will be sent to All users of the forum (its a small forum, so this isn't so mad).

I'm loving all the other edits & such you've been making by the way -- learning a great deal by walking through it. ..

cheers for any help, and thanks regardless if not...

-morris


Yes, but if all you are trying to do is to allow people to receive emails when any posts are posted (which they can opt out of if they prefer), you're better off installing the forum notification mod. Then, use this mod only for times when you want people to get a particlar post (notice of hte post or the actual text itself) whether or not they have opted in.
khisanthax
Registered User
Posts: 443
Joined: Sun Mar 02, 2003 1:49 am

Post by khisanthax »

another question:

so far this only works for new topics, can I make it to work for reply's as well?
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

khisanthax wrote: another question:

so far this only works for new topics, can I make it to work for reply's as well?


The mod works fine on replies as well as new topics. Are you saying that the mail to designated groups checkbox does not appear wehn you are replying? If that is the case, there is something wrong with your installation (conflict with another mod, etc.) I'm sure we can track it down, though.

So, what are you seeing...do you get the checkbox when you reply?
khisanthax
Registered User
Posts: 443
Joined: Sun Mar 02, 2003 1:49 am

Post by khisanthax »

I feel stupid, it did work. I thought I tried it and it didn't work. My humble apologies. Great mod btw!
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

khisanthax wrote: I feel stupid, it did work. I thought I tried it and it didn't work. My humble apologies. Great mod btw!


No big deal...glad it's all working for you.
zible
Registered User
Posts: 18
Joined: Fri Jul 02, 2004 7:30 am

Post by zible »

What would you need to tinker with to get this mod to work for Moderators of a patricular topic?

For example I want moderators of one topic to be able to email out those posts, and moderators of a different section to do that section.

The only thing I can think of so far is putting all the moderators in a group and allowing that group to send emails.

But I'd like to restrict it to each section they moderate, is this possible?

By the way, friggen works brilliant. Didn't copy over the files for me, and had a problem because of a previous installed mod, but reading the instructions help....
zible
Registered User
Posts: 18
Joined: Fri Jul 02, 2004 7:30 am

Post by zible »

I also get an error when trying to include the tweak to kill the bbcode:


Warning: Compilation failed: missing terminating ] for character class at offset 1 in c:\domains\dead-lands.com\wwwroot\forum\includes\bbcode.php on line 914

Warning: Cannot modify header information - headers already sent by (output started at c:\domains\dead-lands.com\wwwroot\forum\includes\bbcode.php:914) in c:\domains\dead-lands.com\wwwroot\forum\includes\page_header.php on line 480

Warning: Cannot modify header information - headers already sent by (output started at c:\domains\dead-lands.com\wwwroot\forum\includes\bbcode.php:914) in c:\domains\dead-lands.com\wwwroot\forum\includes\page_header.php on line 482

Warning: Cannot modify header information - headers already sent by (output started at c:\domains\dead-lands.com\wwwroot\forum\includes\bbcode.php:914) in c:\domains\dead-lands.com\wwwroot\forum\includes\page_header.php on line 483


My code in bbcode.php is

Code: Select all

/**
*   The next function does the following:
*   -   turns any quote or code bbcode tag into a simple plain text lead-in to or
*      exit from the quote or code block (if the post has a quote tag that specifies
*      a particular person that is being quoted, the code adds at the beginning the plain text
*      words "written by John Brown" or whoever the quote is from),
*
*   -   turns the [*] bbocode (marking a list item) into a simple plain text asterisk,
*
*   -   turns a url or img with an alias into a simple plain text url or img with brackets around it and
*
*   -   strips out all other bbcode.
*
*   Thanks to Merlin Sythove for helping me (asinshesq) come up with this code
*/
function bbcode_process_to_plain_text($text, $bbcode_uid = '')
{
   global $lang;
   // First, add a colon before bbcode_uid since all bbcode_uid identifiers are always preceded by a colon
   $bbcode_uid = ':' . $bbcode_uid;

   // Next, remove slashes
   $text = trim(stripslashes($text));

   // Now, we define the plain text markers used for [ quote ] and [ code ] blocks, list items, and [ img ] open and close tags
   $newline = "\r\n";
   $q1 = $newline . '>>>>>>>>>>>>>>>>>>>>>>' . $newline; // quote or code opening marker'
   $q2 = $newline . '<<<<<<<<<<<<<<<<<<<<<<' . $newline; $newline; // quote or code closing marker'
   $l1 = $newline . '   (*) '; // list item marker
   $img1 = '[image at: '; // img opening marker
   $img2 = ' ]'; // img closing marker

   // Next, replace open and close quote tags with plain text versions
   $text = preg_replace('/\[quote' . $bbcode_uid . '=\"(.*?)\"\]/', $newline . '\\1 '. $lang['wrote'].':'.$q1, $text);
   $text = preg_replace('/\[quote' . $bbcode_uid . '\]/', $newline . $lang['Quote'].':'.$q1, $text);
   $text = preg_replace('/\[\/quote' . $bbcode_uid . '\]/', $q2, $text);

   // And now, replace code tags with plain text versions
   $text = preg_replace('/\[code:?1*' . $bbcode_uid . '\]/', $newline . $lang['Code'].':'.$q1, $text);
   $text = preg_replace('/\[\/code:?1*' . $bbcode_uid . '\]/', $q2, $text);

   // Now, replace any open or close brackets that have been converted by phpbb into [ or ] (e.g if nexted inside of code tags)
   $text = preg_replace('/[/', '[', $text);
   $text = preg_replace('/]/', ']', $text);

   // Next, change list item bbcode ([*]) into simple asterisks (note: does not process list numbers or letters)
   $text = preg_replace('/\[\*' . $bbcode_uid . '\]/', $l1, $text);

   // Now, process image and url bbcode (get rid of aliases and insert the actual image or url address; put images inside of square prackets).
   $text = preg_replace('/\[img' . $bbcode_uid . '\](.*?)\[\/img' . $bbcode_uid . '\]/', $img1 .'\\1' . $img2, $text);
   $text = preg_replace('/\[url=(.*?)\](.*?)\[\/url\]/', '\\1', $text);
   $text = preg_replace('/\[url\](.*?)\[\/url\]/', '\\1', $text);

   // Now, remove all bracketed expressions with bbcode_uid identifier in them
   $text = preg_replace('/\[([^[]*?)' . $bbcode_uid . '([^]]*?)\]/', '', $text);

   // And finally, change multiple blank lines into one blank line
   $text = preg_replace('/(\\r\\n){3,}/s', $newline.$newline, $text);

   return $text;
}
particularly line 914 is

Code: Select all

 913  // Now, replace any open or close brackets that have been converted by phpbb into [ or ] (e.g if nexted inside of code tags)
914   $text = preg_replace('/[/', '[', $text);
915   $text = preg_replace('/]/', ']', $text);
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

zible wrote: ...
particularly line 914 is

Code: Select all

 913  // Now, replace any open or close brackets that have been converted by phpbb into [ or ] (e.g if nexted inside of code tags)
914   $text = preg_replace('/[/', '[', $text);
915   $text = preg_replace('/]/', ']', $text);


LOL, I'm having trouble showing on this board how those two lines should read because one of the square brackets in each line is not a square bracket at all but instead is the code for a square bracket. Here's what it looks like when I separate the code a bit:

Code: Select all

 $text = preg_replace('/&#91 ;/', '[', $text);
$text = preg_replace('/&#93 ;/', ']', $text); 
All I did there was to skip a space between 91 and the semicolon and skip a space between the 93 and the semicolon so you can see what thet code really looks like. The characters &#91 ; and &#93 ; are actually code for '[' and ']' but when I type them together here all you see are [ and ]. So, change /[/ to /&#91 ;/ (without any skipped space between the 91 and the semicolon) and change /]/ to /&#93 ;/ without any skipped space between the 93 and the semicolon and see if that does the job.
zible
Registered User
Posts: 18
Joined: Fri Jul 02, 2004 7:30 am

Post by zible »

Worked like a charm. No more errors and looks great. I'll be playing with the mass-email text a bit, but this is one heck of a mod.
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

zible wrote: Worked like a charm. No more errors and looks great. I'll be playing with the mass-email text a bit, but this is one heck of a mod.


Glad it worked out, and thanks for the kind words!
rduval
Registered User
Posts: 13
Joined: Sat Jan 03, 2004 5:05 pm

Post by rduval »

This thing is awesome and works well on 2.0.13 as well FYI.

BTW, Has anyone ever seen a mod where the admin can force a particular forum to always email everyone whenever there is a post to the forum?
mattbugz
Registered User
Posts: 97
Joined: Wed Jun 30, 2004 2:24 pm

Post by mattbugz »

rduval wrote: This thing is awesome and works well on 2.0.13 as well FYI.

BTW, Has anyone ever seen a mod where the admin can force a particular forum to always email everyone whenever there is a post to the forum?


Yes, there's something in the Beta forum that has a similar mod you speak of. I forget the name of it off hand, but do a search and you'll find it.
--
Regards,
Matt
Carpe_Diemond
Registered User
Posts: 4
Joined: Mon Mar 21, 2005 12:18 am
Location: Across the computer

A Clarification on the Mass Mail MOD

Post by Carpe_Diemond »

Hi asinshesq,

Thank you very much for developing such a useful MOD.

I understand that this MOD splits the users into "chunks" and sends e-mail according to the number in each chunk. But what happens if I want to send an e-mail to 1000 registered users and the SMTP provider has a limit, say 250, SMTP relays per day? Can your MOD manage to "queue" the e-mails so that it can send 250 e-mails per day?

Regards,
Good judgement comes from experience. Experience comes from bad judgement.
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: A Clarification on the Mass Mail MOD

Post by asinshesq »

Carpe_Diemond wrote: Hi asinshesq,

Thank you very much for developing such a useful MOD.

I understand that this MOD splits the users into "chunks" and sends e-mail according to the number in each chunk. But what happens if I want to send an e-mail to 1000 registered users and the SMTP provider has a limit, say 250, SMTP relays per day? Can your MOD manage to "queue" the e-mails so that it can send 250 e-mails per day?

Regards,


Time to get a new ISP ;)

No, this mod mostly relies onh the normal phpbb email function plus simple email chunking. IF your ISP is as unfriendly as you describe, you should do a search for another mod called mega mail. Another user apparantly has adapted that mod for use with this one, so you could use the two together.
Post Reply

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