Uutiset:

Wondering if this will always be free?  See why free is better.

Main Menu
Advertisement:

How to add extra code to Post button

Aloittaja SwissRed, tammikuu 08, 2006, 07:39:27 AP

« edellinen - seuraava »

SwissRed

Hi

I want to add an extra code to the post button in the Post Reply page. I want the post to send to an email everytime when the board id is say 20. How shall i go about doing this?

SwissRed

OK. I found the answer after get more info in the forum. To share with you:

Find this code in Post.php

Lainaa// This is a new topic or an already existing one. Save it.
   else
   
         createPost($msgOptions, $topicOptions, $posterOptions);

and add the following like this:

Lainaa// This is a new topic or an already existing one. Save it.
   else
   {
      if ($board == 12)
      {
         $to      = '[email protected]';
         $subject = $_POST['subject'];
         $message = $_POST['message'];
         $headers = 'From: [email protected]' . "\r\n" .
                 'X-Mailer: PHP/' . phpversion();
         mail($to, $subject, $message, $headers);
      }

      createPost($msgOptions, $topicOptions, $posterOptions);

And that is it. $Board == 12 because i only want reply from this board to send the email everytime to me.

Hope this helps someone.

Gargoyle

That's pretty cool... This would be very useful if you had a site problems board so you would get an e-mail notification of a new post to that board.

No I am wondering if there isn't a built in feature that will do this...... ??

Advertisement: