Seite 1 von 1
					
				Email-notification-hack bei neuem Topic
				Verfasst: 18.08.2003 20:00
				von Elmar
				Huhu, 
gibt's sowas für 2.04+? 
Der untere ist für 1.4+ 
Code: Alles auswählen
//EMAIL NOTIFICATION HACK - Sends notification to users and includes message 
mail("user@email","$subject","Neuer Post von $userdata[username].\n\nSubject: $subject\n\nMessage:\n$message\n\n\n********************\nReply to this message in the \"$forum_name\" forum at http://www.xxx.xx","From:$userdata[user_email]"); 
 
 
in der newtopic.php 
Thx, E:
 
			 
			
					
				
				Verfasst: 19.08.2003 08:28
				von hmueller
				Hallo,
http://www.phpbbhacks.com/viewhack.php?id=293
Soweit ich weis, sendet dieser Hack aber nicht nur bei neuen Themen, sondern bei allen neuen Beiträgen (in abonnierten Foren) eine Mail.
 
			 
			
					
				
				Verfasst: 19.08.2003 10:54
				von Elmar
				Danke, den Hack kenne ich auch.
Code: Alles auswählen
switch ( $mode )
	{
		case 'editpost':
		case 'newtopic':
		case 'reply':
			$username = ( !empty($HTTP_POST_VARS['username']) ) ? $HTTP_POST_VARS['username'] : '';
			$subject = ( !empty($HTTP_POST_VARS['subject']) ) ? trim($HTTP_POST_VARS['subject']) : '';
			$message = ( !empty($HTTP_POST_VARS['message']) ) ? $HTTP_POST_VARS['message'] : '';
			$poll_title = ( isset($HTTP_POST_VARS['poll_title']) && $is_auth['auth_pollcreate'] ) ? $HTTP_POST_VARS['poll_title'] : '';
			$poll_options = ( isset($HTTP_POST_VARS['poll_option_text']) && $is_auth['auth_pollcreate'] ) ? $HTTP_POST_VARS['poll_option_text'] : '';
			$poll_length = ( isset($HTTP_POST_VARS['poll_length']) && $is_auth['auth_pollcreate'] ) ? $HTTP_POST_VARS['poll_length'] : '';
			$bbcode_uid = '';
			prepare_post($mode, $post_data, $bbcode_on, $html_on, $smilies_on, $error_msg, $username, $bbcode_uid, $subject, $message, $poll_title, $poll_options, $poll_length);
			if ( $error_msg == '' )
			{
				$topic_type = ( $topic_type != $post_data['topic_type'] && !$is_auth['auth_sticky'] && !$is_auth['auth_announce'] ) ? $post_data['topic_type'] : $topic_type;
				submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("\'", "''", $username), str_replace("\'", "''", $subject), str_replace("\'", "''", $message), str_replace("\'", "''", $poll_title), $poll_options, $poll_length);
			
			//EMAIL NOTIFICATION HACK - Sends notification to users and includes message 
                        mail("user@email","$subject","Neuer Post von $userdata[username].\n\nSubject: $subject\n\nMessage:\n$message\n\n\n********************\nReply to this message in the \"$forum_name\" forum at http://www.xxx.xx","From:$userdata[user_email]"); 
 
Wenn ich das so in der posting.php einfüge, klappt das,  aber ich bekomme wegen 
case 'editpost':
case 'newtopic':
case 'reply':
natürlich eine Mail bei allen 3.
Wie kann ich das nur auf newtopic beschränken?
Thx.
 
			 
			
					
				
				Verfasst: 19.08.2003 13:09
				von Acid
				..verschiebe mal case 'newtopic':  über case 'editpost':  und trage dann den mail-Code nach case 'newtopic':  ein (am Ende muss dann noch break; geschrieben werden.
			 
			
					
				
				Verfasst: 19.08.2003 13:47
				von Elmar
				Code: Alles auswählen
case 'newtopic':
		//EMAIL NOTIFICATION HACK - Sends notification to users and includes message 
                        mail("user@email.de","$subject","Neues Topic von $userdata[username].\n\nSubject: $subject\n\nMessage:\n$message\n\n\n********************\nReply to this message in the \"$forum_name\" forum at http://www.xxx.xx","From:$userdata[user_email]"); 
		
		case 'editpost':
		case 'reply':
jetzt geht es. Wenn ich ein break; vor editpost mache, kommt ein Error.
Danke 

 
			 
			
					
				
				Verfasst: 19.08.2003 15:10
				von Acid
				..hmm, du hast auch auf phpbbhacks.com gepostet oder? Poste dort mal die Antwort, falls es noch jemand anderer wissen will. 
Wird alles korrekt angezeigt.. Forenname etc. !?
 
			 
			
					
				
				Verfasst: 19.08.2003 15:20
				von Elmar
				Yeps, er bringt mir folgendes:
Neuer Post von Elmar.
Subject: 234
Message:
345
********************
Reply to this message in the "Testforum" forum at 
http://www.xxx.xx
ich poste das mal schnell dort 

 
			 
			
					
				
				Verfasst: 19.08.2003 16:41
				von Elmar
				
			 
			
					
				
				Verfasst: 28.08.2003 07:38
				von sausebaby
				wie kann ich das bei version 2.06 abändern damit ich so schön benachrichtigt werde wenn auch neue post's erscheinen..??
wenn möglich in einzelne punkte schreiben.... da ich noch anfänger bin, damit ich keinen fehler mache..*zwinker* 
liebe gutenmorgen grüße von
sausebaby