vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Send Part of User's Reply with Email Notification (https://vborg.vbsupport.ru/showthread.php?t=34912)

Logician 02-08-2002 10:00 PM

Hiyas,

I dont like static email notifications and fancy coloring them up a bit. So this hack is one way to do it. (If I can spare time, more is likely to follow) ;)

This hack simply sends a small portion of user's reply to thread subscribers in their notification mail. It's also possible to send the whole reply, but I dont suggest this, because if they read it all, they wont visit the original thread. But just giving a hint and sending a few lines can be provoking to get them to your board ASAP.

It's an easy to install hack and you can easily customize it by choosing how many characters of the reply will be sent to the members.

I use this hack in V.2.2.2 and havent noticed any problems. Please report bugs in this thread..

Enjoy! \\=^))

Regards,
Logician

haas 02-09-2002 03:35 PM

Sounds interesting... Anything for get the members back :D

dost 02-09-2002 04:01 PM

Nice hack thanks, I'll try it. Does it strip vB code? If not, can you please add that feature.

Thanks

Logician 02-13-2002 08:51 AM

Hey there,

Quote:

Originally posted by dost
Does it strip vB code? If not, can you please add that feature.

Striping the VB code feature is not very easy to add. ;) I am adding other hacks to my board at the moment (and sharing them here) and if can find time for your request, I'll let you know.. :cool:

Regards,
Logician

djr 07-05-2002 10:32 PM

Logician,

Great hack! Very helpful to keep the users visiting the forums.

A question though: one of my mods is restricted to surf the web at his work, but is able to receive e-mail.

I want to enable full message posting for him, but limited to 50 chars for all other visitors.
I've tried the following code in newreply.php, but to no avail:
Code:

    if ($visible) {
                if ($bbuserinfo[userid]==xxx) {
                // LOGICIAN SEND PART OF USER REPLY WITH EMAIL NOTIFICATION HACK
                $logic_mes_sum= $message;
                } else {
                $logic_mes_sum= substr($message, 0, 50)."... ";
                }
                // LOGICIAN SEND PART OF USER REPLY WITH EMAIL NOTIFICATION HACK
                  sendnotification ($threadinfo['threadid'], $bbuserinfo['userid'], 0);
                    }

How can I enable full extracts for this specific user, but limited extracts for all others?

Logician 07-06-2002 07:26 AM

Quote:

Originally posted by djr
How can I enable full extracts for this specific user, but limited extracts for all others?
What you did it is uncorrect. (Revert your modification to original)You have to edit admin/functions:

Find:

PHP Code:

$touser['username']=unhtmlspecialchars($touser['username']); 

After that replace the part:

PHP Code:

 eval("\$emailmsg = \"".gettemplate("email_notify",1,0)."\";");
    eval(
"\$emailsubject = \"".gettemplate("emailsubject_notify",1,0)."\";");

    
mail($touser[email],$emailsubject,$emailmsg,"From: \"$bbtitle Mailer\" <$webmasteremail>"); 

As:

PHP Code:


if ($touser['userid']==X){
eval(
"\$emailmsg = \"".gettemplate("email_notify_special",1,0)."\";");
    eval(
"\$emailsubject = \"".gettemplate("emailsubject_notify",1,0)."\";");

    
mail($touser[email],$emailsubject,$emailmsg,"From: \"$bbtitle Mailer\" <$webmasteremail>");

}
else
{
eval(
"\$emailmsg = \"".gettemplate("email_notify",1,0)."\";");
    eval(
"\$emailsubject = \"".gettemplate("emailsubject_notify",1,0)."\";");

    
mail($touser[email],$emailsubject,$emailmsg,"From: \"$bbtitle Mailer\" <$webmasteremail>");


(Replace X with userid of your special user.)

Now add a new template named email_notify_special, the content is same with email_notify template, just one modification:
Replace $logic_mes_sum as $message in the new template.

I didnt test this but it should work..

Enjoy.. :)
Logician

djr 07-06-2002 10:16 PM

Logician,

Thank you, that worked flawlessly! :cool:

I had ofcourse reverted all my changes to your hack, because it gave me some errors. With this update the whole contents of the reply is sent by e-mail (tested on myself).

Again, great hack and great update! Thank you for quick reponse.

- djr

Massiel 07-07-2002 11:47 AM

Does this work with 2.2.6??

djr 07-07-2002 12:41 PM

yep, got 2.2.6 installed myself

MalaK_3araby 09-12-2002 10:21 PM

Logician ... Thanks man.

Talisman 10-16-2002 07:32 AM

Great hack, Logician. Thanks!

Our new group comes from another that's been around for years where some of us read online, but many subscribe to what's posted by way of a mailing list.

This will make a lot of people very happy.

Cheers!

leon2u 11-21-2002 10:46 AM

Hai there,

I want to use your hack but I need it for this:
My sub-forum is called UPDATES so whenever I make a new thread (and a new posting is made automatically of course) I want to have the message contents in my e-mailmoderator template. Your hack does not work all the way because in creating the thread it does not see the message contents. It works but only when you add a second posting in that thread.

Can you help me?

Doubledoom 03-17-2003 06:30 PM

Installed it on 2.3.0 - waiting for first email reply to check its working. ;)

However, install instructions were straightforward enough and there were no code differences to be concerned with.

Boofo 03-19-2003 07:28 AM

Sinan, did you ever find the time to come up with the code to strip out vbcode in the message? vb 3.0 has that feature and it would be good to have it for those of us who aren't going to upgrade right away. ;)

ryancooper 04-14-2003 12:05 AM

Great hack . . .The only problem I have is now there is no subject in the emails. . .

Logician 04-14-2003 05:58 AM

Quote:

Today at 03:59 AM ryancooper said this in Post #15
Great hack . . .The only problem I have is now there is no subject in the emails. . .
The hack does not touch anything related to the subject of the mail, so this can't be. :) Besides the emails (and its subject) sent are default vb notification mails, the hack does not change this behaviour either. It just adds some text inside mail, that's it.

I'd say uninstall it, make sure your default vb notifications has subjects, then reapply (carefully!) ;)

Ps. You look "unlicensed" here, please check your email address you use here in vbulletin.com and make sure it is authorized in members section of vbulletin.com. Thanks..

ryancooper 04-14-2003 10:16 AM

Will do and I added my email to VB.com

THanks. . . :bunny:

ryancooper 04-14-2003 01:19 PM

Found it it wasn;t anything you did I was a error in VB

http://www.vbulletin.com/forum/showt...threadid=68750

Thanks!

Logician 04-14-2003 02:24 PM

ok glad you find the culprit and thx for sharing here too..

TECK 04-14-2003 03:03 PM

Quote:

02-13-02 at 11:45 AM Logician said this in Post #4
Striping the VB code feature is not very easy to add...
Logician, you could try something like this:
Code:

$string = preg_replace( '~<[^\]]*>~' , '' , $string );
$string = str_replace( '"' , '' , $string );

That should take care of all your BB Code...
Let me know what you think. :)

Logician 04-14-2003 04:57 PM

Quote:

Today at 06:57 PM TECK said this in Post #20
Logician, you could try something like this:
Code:

$string = preg_replace( '~<[^\]]*>~' , '' , $string );
$string = str_replace( '"' , '' , $string );

That should take care of all your BB Code...
Let me know what you think. :)

Does it? I dont think so.. Have you tested it? :)

trafix 04-15-2003 01:12 AM

Quote:

Today at 01:13 AM ryancooper said this in Post #18
Found it it wasn;t anything you did I was a error in VB

http://www.vbulletin.com/forum/showt...threadid=68750

Thanks!

PHEW!! Had me worried there for a minuite..... I had the same problem, fixed now.

Thanks for posting the solution

TECK 04-15-2003 03:19 PM

Quote:

Yesterday at 06:51 PM Logician said this in Post #21
Does it? I dont think so.. Have you tested it? :)
I did not test it... but if my logic is good, that code will remove all bbcode from the content.
Basically removes everything in between [ brackets.
You can start working from there... to adjust it onto your hack.

Example, the code:
$string = preg_replace( '~<[^\]]*>~' , '' , $string );

can be also written as:
$string = preg_replace( '~[high]\[[/high][^\]]*[high]\][/high]~' , '' , $string );

and on and on...

M.C. 05-10-2003 10:27 PM

sorry... i didn`t understand any worl u said... just wonderin` how to make it work on 2.3.0 couse in admin/functions.php avarything changed now with email function... i`m bad in PHP so help me please just run that great hack on!

Thanx!

mccollin 08-25-2003 08:45 PM

This is very strange, not probably related to this HACK, but I can't get it installed because of it. First off, I only have 3 hacks installed on my site, and non that have anything to do with notifications.

I am losing the Subject in the email when I install this hack. I agree that it makes no sense for this to happen, because we don't touch that code, and the templates are separate. What I've narrowed it down to, is the email_notify template. If I change that template from the default, it loses the subject. I tried totally removing the hack, and just changing the email_notify template to add some text, and the subject was gone. I reverted to original, and it came back. This makes no sense. Anyone else run into this. I'm on 2.3.0

assassingod 08-25-2003 08:54 PM

Quote:

Today at 10:45 PM mccollin said this in Post #25
This is very strange, not probably related to this HACK, but I can't get it installed because of it. First off, I only have 3 hacks installed on my site, and non that have anything to do with notifications.

I am losing the Subject in the email when I install this hack. I agree that it makes no sense for this to happen, because we don't touch that code, and the templates are separate. What I've narrowed it down to, is the email_notify template. If I change that template from the default, it loses the subject. I tried totally removing the hack, and just changing the email_notify template to add some text, and the subject was gone. I reverted to original, and it came back. This makes no sense. Anyone else run into this. I'm on 2.3.0

Best to read the thread before posting;)
http://www.vbulletin.com/forum/showt...threadid=68750

mccollin 08-26-2003 12:38 PM

Thanks for the help. I read this whole thread twice, but never saw this info.

lalo landa 09-19-2003 07:55 AM

if U have an a html mail notify

to interprate the vbcodes remplace

PHP Code:

if ($visible) {
        
// LOGICIAN SEND PART OF USER REPLY WITH EMAIL NOTIFICATION HACK
        
$logic_mes_sumsubstr($message050)."...";
        
// LOGICIAN SEND PART OF USER REPLY WITH EMAIL NOTIFICATION HACK
          
sendnotification ($threadinfo['threadid'], $bbuserinfo['userid'], 0);
            } 

For this

PHP Code:

    // LOGICIAN SEND PART OF USER REPLY WITH EMAIL NOTIFICATION HACK
        
$logic_mes_sum$message=bbcodeparse2($message,0,1,1,1);
        
// LOGICIAN SEND PART OF USER REPLY WITH EMAIL NOTIFICATION HACK
          
sendnotification ($threadinfo['threadid'], $bbuserinfo['userid'], 0);
            } 

All the message will be showed

To send a html notify mail

This hack: https://vborg.vbsupport.ru/showthrea...104#post435104

midnightz 10-20-2003 11:12 PM

Is there a way or a hack to do this for PM's so the PM will be sent with the email alert?

Aaron1 03-23-2004 08:03 PM

Hi,

I moved my forum to a new server but suddenly i have a strange but annoying problem. Whenver someone subscribes to thread, the e-mail he gets sent looks terrible because it lacks linebreaks, i double checked if this hack isn't properly installed, but that's not the case. Anyone have a clue what could be the problem?

Btw all e-mails sent out misses linebreaks (br's) very weird.

Logician 03-24-2004 07:15 AM

Quote:

Originally Posted by Aaron1
Hi,

I moved my forum to a new server but suddenly i have a strange but annoying problem. Whenver someone subscribes to thread, the e-mail he gets sent looks terrible because it lacks linebreaks, i double checked if this hack isn't properly installed, but that's not the case. Anyone have a clue what could be the problem?

Btw all e-mails sent out misses linebreaks (br's) very weird.

Is it all emails that misses line breaks or only email that this hack sends?

Aaron1 03-24-2004 07:57 AM

That's the weird thing, all e-mails that are send out Logician, do you have an idea what could be the cause of that?

Aaron1 03-24-2004 01:18 PM

Shall I e-mail you the admin/functions.php if you want to take a look at it?



Here's an example how a notify e-mail looks like in my mailbox:


Hello Housequake, sowtob has just replied to a thread you have subscribed to entitled - Cosmic day???? - in the Trading/Discussion forum of Forum Home. Here is a small part of the reply: ---------------------------------------------------- He's back today or tomorrow I think.... ---------------------------------------------------- This thread is located at: http://www.housequake.com/forum/show...3&goto=newpost There may be other replies also, but you will not receive any more notifications until you visit the board again. Yours, Housequake.com ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Unsubscription information: To unsubscribe from this thread, please visit this page: http://www.housequake.com/forum/memb...threadid=15893 To unsubscribe from ALL threads, please visit this page: http://www.housequake.com/forum/memb...type=allthread

Logician 03-24-2004 05:52 PM

If all emails are like this, how can this be related to this hack? ^^ Have you checked email templates and confirmed that they are good in terms of line breaks?

Aaron1 03-24-2004 05:59 PM

I even triple checked my templates Logician, could it be something server side?
All templates seem to be stored without linebreaks automatically somehow.

Logician 03-24-2004 06:09 PM

Quote:

Originally Posted by Aaron1
I even triple checked my templates Logician, could it be something server side?
All templates seem to be stored without linebreaks automatically somehow.

Have you moved to a Window server? It sounds like it. Check here:
http://www.vbulletin.com/forum/showthread.php?t=25810

Aaron1 03-24-2004 06:18 PM

Yes! I did Logician, thanks for this link (otherwise i would have never found it) :-)

subu1 06-03-2004 07:21 PM

Hi,

Great Hack, big thxx, ist works....*click install*

glo 10-03-2004 07:12 AM

Quote:

Originally Posted by Aaron1
Shall I e-mail you the admin/functions.php if you want to take a look at it?



Here's an example how a notify e-mail looks like in my mailbox:


Hello Housequake, sowtob has just replied to a thread you have subscribed to entitled - Cosmic day???? - in the Trading/Discussion forum of Forum Home. Here is a small part of the reply: ---------------------------------------------------- He's back today or tomorrow I think.... ---------------------------------------------------- This thread is located at: http://www.housequake.com/forum/show...3&goto=newpost There may be other replies also, but you will not receive any more notifications until you visit the board again. Yours, Housequake.com ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Unsubscription information: To unsubscribe from this thread, please visit this page: http://www.housequake.com/forum/memb...threadid=15893 To unsubscribe from ALL threads, please visit this page: http://www.housequake.com/forum/memb...type=allthread

Hi Logician,

I have installed this hack onto my test board which is on my laptop using XP, and have seen that this problem occurs on windows servers, however my live site is on a Linux server, so will everything just translate across without any problems? ie will the line breaks be enforced, unlike when they are on Windows servers?

Logician 10-03-2004 10:46 AM

I'm using the hack both in linux and windows servers just fine.


All times are GMT. The time now is 05:18 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02157 seconds
  • Memory Usage 1,859KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (5)bbcode_php_printable
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete