%PDF- %PDF-
Direktori : /home/alliance/domains/sedl.alnetis.fr/public_html/ |
Current File : /home/alliance/domains/sedl.alnetis.fr/public_html/a-forum-add-comment.php |
<?php include_once("inc/config.php"); include_once("inc/functions.php"); include_once("inc/session.php"); include_once("inc/init.php"); include_once("inc/phpmailer/class.phpmailer.php"); verif_co(); verif_get($_POST['post']); $db = new BaseOps(); $fo = new Forum(); $next_id = $db->next_id("forum_comment"); if(isset($_POST['parent']) && $_POST['parent'] != "") { $values = array ( "id" => $next_id, "user" => $_SESSION['id'], "post" => $_POST['post'], "parent" => $_POST['parent'], "date" => time(), "texte" => $_POST['textecomment'] ); } else { $values = array ( "id" => $next_id, "user" => $_SESSION['id'], "post" => $_POST['post'], "date" => time(), "texte" => $_POST['textecomment'] ); } $post=$fo->get($_POST['post']); $message='Une nouvelle réponse au message a été ajouté au forum.<br/><br/><a href="http://sedl.alnetis.fr/admin/forum.php">'.$_POST['titrepost'].'</a>'; $header = get_temp("templates/newsletter/header_page.php", $url_site); $footer = get_temp("templates/newsletter/header_page.php", $url_site); $message=$header.$message.$footer; $subject="=?UTF-8?B?".base64_encode(stripslashes("Nouveau message sur le forum"))."?="; $headers= "From: \"SEDL\" <".$email_contact.">\n"; $headers.='Content-type: text/html; charset=utf-8'; $mail = new PHPMailer(); $mail->CharSet = 'UTF-8'; $mail->From = "sedl@octomail.info"; $mail->FromName = "SEDL"; $mail->addReplyTo($email_contact); $mail->Subject =$subject; $mail->MsgHTML($message); $mail->IsSMTP(); // telling the class to use SMTP $mail->SMTPDebug = 0; // enables SMTP debug information (for testing) $mail->SMTPAuth = true; // enable SMTP authentication $mail->Host = "smtp.octomail.info"; // sets the SMTP server $mail->Port = 587; // set the SMTP port for the GMAIL server $mail->Username = "sedl@octomail.info"; // SMTP account username $mail->Password = "2UFvaB1eqj5QeQv8"; $mail->MsgHTML($message); $mail->AddAddress($email_contact); $mail->Send(); $mail->ClearAddresses(); $db->insert("forum_comment", $values); //Modification du Lastmod du post $where = "id = ".$_POST['post']; $values = array ( "lastmod" => time()); $db->update("forum_post", $values, $where); //Affichage du commentaire $comment = $fo->get_comment($next_id); if($comment) { ?> <li id="comment-<?=$comment['id']?>" class="comments flexcontent"> <img src="<?=$comment['flag']?>" class="forumpostflag" alt="<?=$comment['nompart']?>" /> <div class="commentcontent"> <div class="comment"> <?php if(true): //if($post['usertype'] == 2): ?> <span class="commentuser"><?=$comment['nompart']?></span> <?php else: ?> <a href="<?=$comment['urlpart']?>" class="commentuser"><?=$comment['nompart']?></a> <?php endif; ?> <?=$comment['texte']?></div> <div class="actions"> <?php if($comment['user'] == $_SESSION['id']):?> <a class="forumaction deletecomment" data-comment="<?=$comment['id']?>" data-post="<?=$_POST['post']?>"><i class="fas fa-times"></i> <?=lang('supprimer');?></a> <?php endif; ?> <span class="commentdate"><?=$comment['dateformat']?></span> </div> </div> </li> <?php } ?>