<?php /** Et si l'utilisateur a dejà débloqué le potin ? */ include_once 'modele/notifications.php'; include_once 'modele/infos_potin.php'; include_once 'modele/appartient_au_groupe.php'; $infos_notif = infos_notif($_GET['id_notif'], $bdd); if ($id_user == $infos_notif['id_user']) { notif_vue($_GET['id_notif'], $bdd); // L'user a vu la notification if (appartient_au_groupe($id_user, groupe_du_potin($_GET['id_potin'], $bdd), $bdd)) { $potin_courant = infos_potin($_GET['id_potin'], $bdd); include 'vue/afficher_potin_brouille.php'; } else { echo 'Vous ne pouvez accéder à ce potin'; } }
<?php include_once 'modele/notifications.php'; $message = infos_notif($_GET['id_notif'], $bdd); notif_vue($_GET['id_notif'], $bdd); ?> <h2>Nouveau message</h2> <div class="bs-callout bs-callout-default"> <p> <?php echo $message['description']; ?> </p> </div>
if ($notifs == 'erreur_nonotif') { echo ' 0 '; } else { $nb_notifs = count($notifs); echo ' <span class="label label-danger">' . $nb_notifs . '</span> '; } ?> <span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <?php if ($notifs == 'erreur_nonotif') { echo '<li><a>Aucune notification</a></li>'; } else { foreach ($notifs as $key => $value) { $notif_courante = infos_notif($value, $bdd); echo '<li>'; if ($notif_courante['type'] == 'nouv_potin') { include_once 'modele/infos_groupe.php'; $nom_gpe_notif = infos_groupe($notif_courante['ref_bis'], $bdd); echo '<a href="' . INDEX . '?page=notif_new_potin&id_potin=' . $notif_courante['ref'] . '&id_notif=' . $value . '">Un nouveau potin a été écrit sur vous dans ' . $nom_gpe_notif['nom'] . ' !</a>'; } else { if ($notif_courante['type'] == 'comment_mypotin') { echo '<a href="' . INDEX . '?page=notif_new_comment&id_potin=' . $notif_courante['ref'] . '&id_notif=' . $value . '">Un nouveau commentaire a été écrit sur l\'un de vos potins</a>'; } else { if ($notif_courante['type'] == 'reply_comment') { echo '<a href="' . INDEX . '?page=notif_new_comment&id_potin=' . $notif_courante['ref'] . '&id_notif=' . $value . '">On a répondu à l\'un de vos commentaires</a>'; } else { if ($notif_courante['type'] == 'message') { echo '<a href="' . INDEX . '?page=notif_message&id_notif=' . $value . '">' . $notif_courante['description'] . '</a>'; } else {