Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by chrispadfield chrispadfield is offline
Developer Last Online: Oct 2008 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 05-29-2001 Last Update: Never Installs: 7
 
No support by the author.

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

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 10-15-2001, 05:13 PM
Pie'oh'pah
Guest
 
Posts: n/a
Default

No i must stand corrected: It's happening even if users are registered...

-Pie
Reply With Quote
  #13  
Old 10-16-2001, 09:19 AM
claytonp claytonp is offline
 
Join Date: Nov 2001
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #14  
Old 10-16-2001, 03:10 PM
webhost's Avatar
webhost webhost is offline
 
Join Date: Oct 2001
Location: St. Louis
Posts: 577
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>");
            }
          }
        }
      } 
Reply With Quote
  #15  
Old 10-16-2001, 05:42 PM
Stasik Stasik is offline
 
Join Date: Nov 2001
Posts: 233
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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"
Reply With Quote
  #16  
Old 10-16-2001, 06:51 PM
chrispadfield's Avatar
chrispadfield chrispadfield is offline
 
Join Date: Oct 2001
Posts: 180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #17  
Old 10-16-2001, 06:55 PM
Stasik Stasik is offline
 
Join Date: Nov 2001
Posts: 233
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

that was linebrake
Reply With Quote
  #18  
Old 10-16-2001, 09:11 PM
webhost's Avatar
webhost webhost is offline
 
Join Date: Oct 2001
Location: St. Louis
Posts: 577
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Tested and works great on my board and 2 others.
Reply With Quote
  #19  
Old 10-17-2001, 12:39 AM
VirtueTech VirtueTech is offline
 
Join Date: Oct 2001
Posts: 189
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I can't believe I overlooked this.
Reply With Quote
  #20  
Old 10-17-2001, 01:09 AM
WizyWyg's Avatar
WizyWyg WizyWyg is offline
 
Join Date: Oct 2001
Posts: 63
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi can someone repost the code in its entirety with all the corrections. looking through the coding and this site is somewhat driving me cross eyed
Reply With Quote
  #21  
Old 10-17-2001, 08:41 AM
chrispadfield's Avatar
chrispadfield chrispadfield is offline
 
Join Date: Oct 2001
Posts: 180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by WizyWyg
Hi can someone repost the code in its entirety with all the corrections. looking through the coding and this site is somewhat driving me cross eyed
my code in the 1st post still works for me
Reply With Quote
Reply


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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:28 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04622 seconds
  • Memory Usage 2,331KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete