Results 1 to 15 of 28
Page 1 of 2
FirstFirst 1 2 ... LastLast

Thread: [RELEASE] v2.0 Email new thread notifications to subscribed users

  1. #1
    Senior Member chrispadfield is on a distinguished road chrispadfield's Avatar
    Join Date
    Aug 2000
    Location
    London, UK
    Age
    28
    Posts
    5,368

    [RELEASE] v2.0 Email new thread notifications to subscribed users

    A few have requested this, me especially so i made it.

    What it does: Emails all those who have subscribed to a forum an email telling them about a new thread.

    Extra queries: 1 upon every new thread. Extra time processing new threads as emails must be sent.

    code changes, 1 in newthread.php and 2 new templates.




    CODE CHANGE:

    Add:

    PHP Code:
    // This emails a new thread notification to those subscribed to the forum
        
    if ($enableemail) {
          
    // do emails

          
    $useremails=$DB_site->query("SELECT user.*
                                       FROM subscribeforum,user
                                       WHERE subscribeforum.forumid='$forumid'
                                         AND subscribeforum.userid=user.userid
                                         AND user.userid<>'$bbuserinfo[userid]'
                                        "
    );

                  
    $toemail=$val;
                  
    $forumtitle $foruminfo['title'];
                  
    $threadinfo['title'] = $subject;

          
    $bbuserinfo['username']=unhtmlspecialchars($bbuserinfo['username']);
          while (
    $touser=$DB_site->fetch_array($useremails)) {
            
    $touser['username']=unhtmlspecialchars($touser['username']);

            eval(
    "\$emailmsg = \"".gettemplate("email_newthread",1,0)."\";");
            eval(
    "\$emailsubject = \"".gettemplate("email_newthreadsubject",1,0)."\";");

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

    below the section //send email to moderators which ends with

    }
    }
    }
    }

    add two templates:

    i) email_newthread

    Code:
    Hello $touser[username],
    
    $bbuserinfo[username] has just started a new thread: in $foruminfo[title]
    This is a forum you have subscribed to at $bbtitle
    
    The thread title is: $threadinfo[title] 
    This thread is located at:
    $bburl/showthread.php?threadid=$threadid&goto=newpost
    
    Yours,
    $bbtitle team
    
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Unsubscription information:
    
    You are receiving these "new thread" notifications because 
    you are subscribed to the $foruminfo[title] forum. 
    
    To unsubscribe, please visit:
    $bburl/usercp.php
    and secondly

    email_newthreadsubject

    Code:
    New Thread in $foruminfo[title]
    any you are away
    Last edited by chrispadfield; Thu 31st May '01 at 11:31am.
     

  2. #2
    Senior Member chrispadfield is on a distinguished road chrispadfield's Avatar
    Join Date
    Aug 2000
    Location
    London, UK
    Age
    28
    Posts
    5,368
    please note if you are testing this you need two users because it will NOT send an email to the person who started the thread. Either remove the last line of the query

    PHP Code:
    AND user.userid<>'$bbuserinfo[userid]' 
    or use two different users.
     

  3. #3
    Senior Member chrispadfield is on a distinguished road chrispadfield's Avatar
    Join Date
    Aug 2000
    Location
    London, UK
    Age
    28
    Posts
    5,368
    oops, i left a line of debug code in.

    if you have already installed this, remove this line
    echo $touser;
    the code change had been updated so if you have not installed it yet don't worry.
     

  4. #4
    Senior Member mrlister is on a distinguished road mrlister's Avatar
    Join Date
    Nov 2000
    Location
    Burnaby, BC
    Posts
    371
    is it possible to make it so it does this every hour and every hour lists all the new threads within the thread.
    - MrLister
     

  5. #5
    Senior Member chrispadfield is on a distinguished road chrispadfield's Avatar
    Join Date
    Aug 2000
    Location
    London, UK
    Age
    28
    Posts
    5,368
    i am not sure what you mean. Why would you want to send them every hour when they can be done instantly? by the sounds of it you want something more like the community bulletin thing made by Kier/tubedog
     

  6. #6
    Senior Member chrispadfield is on a distinguished road chrispadfield's Avatar
    Join Date
    Aug 2000
    Location
    London, UK
    Age
    28
    Posts
    5,368
    sorry, another fix

    you need to change $threadinfo[threadid] to $threadid
     

  7. #7
    Senior Member Joe is on a distinguished road
    Join Date
    May 2000
    Location
    Highland, Utah.
    Age
    31
    Posts
    2,435
    The emails this sends out are from "nobody" at : nobody@snoturtle.serverhost.com

    How do i change this to Bike Forums with my real email addy?
     

  8. #8
    Senior Member chrispadfield is on a distinguished road chrispadfield's Avatar
    Join Date
    Aug 2000
    Location
    London, UK
    Age
    28
    Posts
    5,368
    mail($touser[email],$emailsubject,$emailmsg,"From: \"$bbtitle Mailer\" <$webmasteremail>");

    is the line that generates that and it is copied straight from the newreply.php code (which is where most of this code came from). I can't see how it can work in one place and not the other. sorry, not a clue.
     

  9. #9
    New Member Kevin Green is on a distinguished road Kevin Green's Avatar
    Join Date
    Oct 2001
    Location
    Frampton Cotterell, England
    Age
    48
    Posts
    10
    Hi,

    Very interested in this thread for user support purposes.

    Will it email users subscribed to the Forum when there are additions to any of the existing threads

    Will it email users if there are additions to the thread it has already notified them of?

    I ask because I am interested in having users emailed if there is a new thread or if there are any additions to existing threads regardless of whether they have been previously notified but perhaps failed to check the Forum.

    Many thanks

    kevin
     

  10. #10
    Senior Member Pie'oh'pah is on a distinguished road Pie'oh'pah's Avatar
    Join Date
    Jul 2001
    Location
    Germany
    Age
    39
    Posts
    157
    Hi,

    we have the same problem as Joe, when unregistered users are involved.

    -Pie
    I want to express my deepest compassion to all who have lost their loved ones in the latest terroristic attack

    >> Nuke Bin Laden yourself here <<

    Webmaster NÐE | Webmaster UA Forums | ArtworX ECL | Admin DiGL | Hosted at RWH | Portfolio

    My Stylez
    Red Darkness | Velvet Night | Dreadful Cyan
    Goodiez
    Table bgcolor change on hover | Onlinestatus modifications | German Templates

    *******************************\\\ ///
    ********************************(ô ô)
    -------------------ooO-(_)-Ooo-----------------
     

  11. #11
    Senior Member Pie'oh'pah is on a distinguished road Pie'oh'pah's Avatar
    Join Date
    Jul 2001
    Location
    Germany
    Age
    39
    Posts
    157
    No i must stand corrected: It's happening even if users are registered...

    -Pie
    I want to express my deepest compassion to all who have lost their loved ones in the latest terroristic attack

    >> Nuke Bin Laden yourself here <<

    Webmaster NÐE | Webmaster UA Forums | ArtworX ECL | Admin DiGL | Hosted at RWH | Portfolio

    My Stylez
    Red Darkness | Velvet Night | Dreadful Cyan
    Goodiez
    Table bgcolor change on hover | Onlinestatus modifications | German Templates

    *******************************\\\ ///
    ********************************(ô ô)
    -------------------ooO-(_)-Ooo-----------------
     

  12. #12
    Member claytonp is on a distinguished road
    Join Date
    Oct 2001
    Posts
    33
    Hello,

    I thought I would attempt this code hack myself, however I cannot locate the following in newthread.php

    below the section //send email to moderators which ends with

    }
    }
    }
    }

    as indicated by chrispadfield. Am I doing something wrong.

    I have already created the two templates.


    Regards,

    Clayton
     

  13. #13
    Senior Member express is on a distinguished road express's Avatar
    Join Date
    Apr 2001
    Location
    Flora Il
    Age
    47
    Posts
    1,457
    Below This


    PHP Code:

    // send email to moderators
          
    if ($enableemail) {
            
    $moderators=$DB_site->query_first("SELECT CONCAT(newthreademail,' ',newpostemail) AS newthreademail FROM forum WHERE forumid='$forumid'");

            
    $modtable=$DB_site->query("SELECT DISTINCT user.email FROM moderator,user WHERE moderator.userid=user.userid AND forumid IN ($foruminfo[parentlist]) AND (newthreademail=1 OR newpostemail=1)");
            while(
    $thismod=$DB_site->fetch_array($modtable)) {
              
    $moderators['newthreademail'].=" $thismod[email]";
            }

            if (
    $moderators['newthreademail']!="") {
              
    $mods=explode(" ",trim($moderators['newthreademail']));
              while (list(
    $key,$val)=each($mods)) {

                if (
    trim($val)!="") {
                  
    $toemail=$val;
                  
    $forumtitle $foruminfo['title'];
                  
    $threadinfo['title'] = $subject;

                  eval(
    "\$emailmsg = \"".gettemplate("email_moderator",1,0)."\";");
                  eval(
    "\$emailsubject = \"".gettemplate("emailsubject_moderator",1,0)."\";");
                  
    mail($toemail,$emailsubject,$emailmsg,"From: \"$bbtitle Mailer\" <$webmasteremail>");
                }
              }
            }
          } 
     

  14. #14
    Senior Member Stasik is on a distinguished road Stasik's Avatar
    Join Date
    Apr 2001
    Location
    Earth
    Posts
    210
    to fix "nobody" problem replace"
    Code:
    eval("\$emailsubject = \"".gettemplate("email_newthreadsubject",1,0)."\";");
    with:
    Code:
    eval("\$emailsubject = \"".gettemplate("emailsubject_moderator",1,0)."\";");
    then you can delete teplate called "email_newthreadsubject"
     

  15. #15
    Senior Member chrispadfield is on a distinguished road chrispadfield's Avatar
    Join Date
    Aug 2000
    Location
    London, UK
    Age
    28
    Posts
    5,368
    not quite sure how that will help as that edits the subject of the email not where it is from. Unless you have a linebreak in the subject template, that might make it not work.
     

Page 1 of 2
FirstFirst 1 2 ... LastLast

Similar Threads

  1. How do I stop email notifications to subscribed threads?
    By ipscone in forum vBulletin 2 'How Do I' and Troubleshooting
    Replies: 7
    Last Post: Fri 1st Aug '03, 10:05pm
  2. Email Notifications Going to Wrong Users
    By Rachael in forum vBulletin 2 'How Do I' and Troubleshooting
    Replies: 10
    Last Post: Sun 22nd Jun '03, 2:59pm
  3. No reply link in subscribed email notifications.
    By magnusson2u in forum vBulletin 2 'How Do I' and Troubleshooting
    Replies: 1
    Last Post: Mon 23rd Dec '02, 1:37pm
  4. confused about subscribed threads/email notifications
    By brookelyn in forum vBulletin 2 Suggestions and Feedback
    Replies: 2
    Last Post: Mon 29th Jan '01, 7:10pm

Bookmarks

Posting Permissions

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts