Warning: The author of this contribution does not provide support for it anymore.

Board watch

Exclude quotes from notifications - Board watch

Exclude quotes from notifications

by Seibertron » Tue May 07, 2013 9:03 pm

I modified the Board Watch notifications so that it would include the POSTTEXT value. I would like to exclude the quotes from other people and only include the new text that the user posted. Is there a quick method already established to exclude quotes?

FYI ... Board Watch is a great modification. Loving what it does so far.
Seibertron.com
http://www.seibertron.com
The Ultimate Transformers Fansite
User avatar
Seibertron
Registered User
Posts: 57
Joined: Tue Oct 01, 2002 7:54 pm
Location: Chicago, IL
Contact:

Re: Exclude quotes from notifications

by asinshesq » Tue May 07, 2013 9:10 pm

Nohting already established. What are you trying to accomplish? Do you mean that whenever there are quote tags in a post, you want everything between the quote tags to be deleted? Wouldn't be that hard, but that strikes me as an odd thing to do so I am guessing I don't really understand what you are looking for,
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: Exclude quotes from notifications

by Seibertron » Tue May 07, 2013 9:17 pm

asinshesq wrote:Nohting already established. What are you trying to accomplish? Do you mean that whenever there are quote tags in a post, you want everything between the quote tags to be deleted? Wouldn't be that hard, but that strikes me as an odd thing to do so I am guessing I don't really understand what you are looking for,


Thank you for your prompt reply. That is exactly what I'm looking for. Maybe it is an odd thing. The users on my site use multiple quotes frequently so I'm just trying to think of ways to reduce the amount of text that is included with the email notifications while maintaining the user's actual message. I thought about limiting the amount of text that is sent per your instructions for that mod, but was concerned about it only showing the part that is quoted which I didn't think would be as useful to other users than if only the text from the new message was included. The problem I can think my request would cause though is a user who took the time to respond to multiple quotes separately would end up with a really odd notification that was sent out to the other subscribers.
Seibertron.com
http://www.seibertron.com
The Ultimate Transformers Fansite
User avatar
Seibertron
Registered User
Posts: 57
Joined: Tue Oct 01, 2002 7:54 pm
Location: Chicago, IL
Contact:

Re: Exclude quotes from notifications

by asinshesq » Tue May 07, 2013 9:21 pm

You could have any quote show up as "[quote omitted]".
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: Exclude quotes from notifications

by asinshesq » Tue May 07, 2013 10:02 pm

If you just want the email notification to skip a line whenever it runs into a quote, insert "[quote of ___ omitted]" or "[quote omitted]" and skip another line, try this (I haven't tested this so you may need to tinker with it to make it work and to make it look like you want):

Code: Select all

OPEN
includes/functions_boardwatch.php

FIND
   // 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);

REPLACE WITH
   // Next, replace open and close quote tags with plain text versions
   $text = preg_replace('/\[quote=\"(.*?)\"' . $bbcode_uid . '\](.*?)\[\/quote' . $bbcode_uid . '\]/', $newline . '[quote of \\1 omitted]', $text);
   $text = preg_replace('/\[quote' . $bbcode_uid . '(.*?)\[\/quote' . $bbcode_uid . '\]/', $newline . '[quote omitted]', $text);


[edited on may 8 and may 9 to fix REPLACE WITH code]
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: Exclude quotes from notifications

by asinshesq » Thu May 09, 2013 9:55 pm

Seibertron, I slightly tinkered with the code above and tested it....it works. It replaces any anonymous quote with '[quote omitted'] and replaces any named quote of ____ with ['quote of _____ omitted]'.
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: Exclude quotes from notifications

by Seibertron » Thu May 09, 2013 10:25 pm

asinshesq wrote:Seibertron, I slightly tinkered with the code above and tested it....it works. It replaces any anonymous quote with '[quote omitted'] and replaces any named quote of ____ with ['quote of _____ omitted]'.


Awesome. Thank you for the update. I'll give it a try.

I love the board watch mod. It's excellent and is a great update to phpBB. Wish I had discovered it sooner. Thank you for all of the work that you put into this.
Seibertron.com
http://www.seibertron.com
The Ultimate Transformers Fansite
User avatar
Seibertron
Registered User
Posts: 57
Joined: Tue Oct 01, 2002 7:54 pm
Location: Chicago, IL
Contact:


cron