Exemple #1
0
function send_notifications($parent, $comment)
{
    global $server_name;
    $new_subject = $comment["subject"];
    $new_cid = $comment["cid"];
    $parent = $comment["parent"];
    while ($parent > 0) {
        $comment = db_get_rec("comment", $parent);
        $zid = $comment["zid"];
        if ($zid != "") {
            $a = article_info($comment);
            $subject = "Comment Reply";
            $body = "Your comment has a new reply.\n";
            $body .= "\n";
            $body .= "In the " . $a["type"] . ":\n";
            $body .= $a["title"] . "\n";
            $body .= $a["link"] . "\n";
            $body .= "\n";
            $body .= "Your original comment:\n";
            $body .= $comment["subject"] . "\n";
            $body .= "http://{$server_name}/comment/{$parent}\n";
            $body .= "\n";
            $body .= "The new reply:\n";
            $body .= "{$new_subject}\n";
            $body .= "http://{$server_name}/comment/{$new_cid}\n";
            $body .= "\n";
            send_web_mail($zid, $subject, $body, "", false);
        }
        $parent = $comment["parent"];
    }
}
Exemple #2
0
//
// Pipecode is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Pipecode.  If not, see <http://www.gnu.org/licenses/>.
//
include "mail.php";
if (http_post()) {
    $to = http_post_string("to", array("len" => 250, "valid" => "[a-z][A-Z][0-9]-_.<>@+ "));
    $subject = http_post_string("subject", array("len" => 250, "valid" => "[ALL]"));
    $body = http_post_string("body", array("len" => 64000, "valid" => "[ALL]"));
    $in_reply_to = http_post_string("in_reply_to", array("required" => false, "len" => 250, "valid" => "[a-z][A-Z][0-9]-_.@+-"));
    send_web_mail($to, $subject, $body, $in_reply_to);
    header("Location: /mail/");
    die;
}
$to = http_get_string("to", array("required" => false, "len" => 250, "valid" => "[a-z][A-Z][0-9]-_.<>@+ "));
$mid = http_get_int("mid", array("required" => false));
if ($mid > 0) {
    $message = db_get_rec("mail", $mid);
    $in_reply_to = $message["message_id"];
    $to = $message["mail_from"];
    $subject = $message["subject"];
    if (substr($subject, 0, 4) != "Re: ") {
        $subject = "Re: {$subject}";
    }
} else {
    $in_reply_to = "";