예제 #1
0
function afficher_commentaires_recursif($page, $wiki, $premier = true)
{
    $output = '';
    $comments = $wiki->LoadComments($page);
    // display comments themselves
    if ($comments) {
        $valcomment = array();
        $i = 0;
        foreach ($comments as $comment) {
            $valcomment['commentaires'][$i]['tag'] = $comment["tag"];
            $valcomment['commentaires'][$i]['body'] = $wiki->Format($comment["body"]);
            $valcomment['commentaires'][$i]['infos'] = "de " . $wiki->Format($comment["user"]) . ", " . date("\\l d.m.Y &\\a\\g\\r\\av; H:i:s", strtotime($comment["time"]));
            $valcomment['commentaires'][$i]['actions'] = '';
            if ($wiki->HasAccess("comment", $comment['tag'])) {
                $valcomment['commentaires'][$i]['actions'] .= '<a href="' . $wiki->href('', $comment['tag']) . '" class="repondre_commentaire">R&eacute;pondre</a> ';
            }
            if ($wiki->HasAccess('write', $comment['tag']) || $wiki->UserIsOwner($comment['tag']) || $wiki->UserIsAdmin($comment['tag'])) {
                $valcomment['commentaires'][$i]['actions'] .= '<a href="' . $wiki->href('edit', $comment['tag']) . '" class="editer_commentaire">Editer</a> ';
            }
            if ($wiki->UserIsOwner($comment['tag']) || $wiki->UserIsAdmin()) {
                $valcomment['commentaires'][$i]['actions'] .= '<a href="' . $wiki->href('deletepage', $comment['tag']) . '" class="supprimer_commentaire">Supprimer</a>' . "\n";
            }
            $valcomment['commentaires'][$i]['reponses'] = afficher_commentaires_recursif($comment['tag'], $wiki, false);
            $i++;
        }
        include_once 'squelettephp.class.php';
        $squelcomment = new SquelettePhp('tools/tags/presentation/commentaire_microblog.tpl.html');
        $squelcomment->set($valcomment);
        $output .= $squelcomment->analyser();
    } elseif ($premier && $wiki->HasAccess("comment", $page)) {
        $output .= 'Soyez le premier &agrave; &eacute;crire un commentaire!' . "\n";
    }
    if ($premier && $wiki->HasAccess("comment", $page)) {
        // display comment form
        $output .= "<div class=\"microblogcommentform\">\n";
        $output .= $wiki->FormOpen("addcomment", $page) . '
				<textarea name="body" class="commentaire_microblog" rows="3" cols="20"></textarea><br />
				<input type="button" class="bouton_microblog" value="Ajouter votre commentaire" accesskey="s" />' . $wiki->FormClose();
        $output .= "</div>\n";
    }
    return $output;
}
예제 #2
0
        $squel = new SquelettePhp('tools/tags/presentation/' . $template);
        $valtemplate['class'] = $class;
        $valtemplate['lien'] = $this->href('', $microblogpost['tag']);
        $valtemplate['nompage'] = $microblogpost['tag'];
        if ($template == 'liste_microblog.tpl.html') {
            $squel->set($valtemplate);
            $text .= '<ul>' . $squel->analyser() . '</ul>';
        } else {
            $valtemplate['user'] = $this->Format($microblogpost["user"]);
            $valtemplate['date'] = date("\\l d.m.Y &\\a\\g\\r\\av; H:i:s", strtotime($microblogpost["time"]));
            $valtemplate['billet'] = $this->Format($microblogpost["body"]);
            // load comments for this page
            include_once 'tools/tags/libs/tags.functions.php';
            $valtemplate['commentaire'] = '<strong class="lien_commenter">Commentaires</strong>' . "\n";
            $valtemplate['commentaire'] .= "<div class=\"commentaires_billet_microblog\">\n";
            $valtemplate['commentaire'] .= afficher_commentaires_recursif($microblogpost['tag'], $this);
            $valtemplate['commentaire'] .= "</div>\n";
            //liens d'actions sur le billet
            $valtemplate['edition'] = '<a href="' . $this->href('', $microblogpost['tag']) . '" class="voir_billet">Afficher</a> ';
            if ($this->HasAccess('write', $microblogpost['tag'])) {
                $valtemplate['edition'] .= '<a href="' . $this->href('edit', $microblogpost['tag']) . '" class="editer_billet">Editer</a> ';
            }
            if ($this->UserIsOwner($microblogpost['tag']) || $this->UserIsAdmin()) {
                $valtemplate['edition'] .= '<a href="' . $this->href('deletepage', $microblogpost['tag']) . '" class="supprimer_billet">Supprimer</a>' . "\n";
            }
            $squel->set($valtemplate);
            $text .= $squel->analyser();
        }
    }
}
if ($vue == 'accordeon') {
예제 #3
0
function afficher_commentaires_recursif($page, $wiki, $premier = true)
{
    $output = '';
    $comments = $wiki->LoadComments($page);
    $valcomment['tag'] = $page;
    $valcomment['commentaires'] = array();
    // display comments themselves
    if ($comments) {
        $valcomment = array();
        $i = 0;
        foreach ($comments as $comment) {
            $valcomment['commentaires'][$i]['tag'] = $comment["tag"];
            $valcomment['commentaires'][$i]['body'] = $wiki->Format($comment["body"]);
            $valcomment['commentaires'][$i]['infos'] = "de " . $wiki->Format($comment["user"]) . ", " . date("\\l d.m.Y &\\a\\g\\r\\av; H:i:s", strtotime($comment["time"]));
            $valcomment['commentaires'][$i]['actions'] = '';
            if ($wiki->HasAccess("comment", $comment['tag'])) {
                $valcomment['commentaires'][$i]['actions'] .= '<a href="' . $wiki->href('', $comment['tag']) . '" class="repondre_commentaire">R&eacute;pondre</a> ';
            }
            if ($wiki->HasAccess('write', $comment['tag']) || $wiki->UserIsOwner($comment['tag']) || $wiki->UserIsAdmin($comment['tag'])) {
                $valcomment['commentaires'][$i]['actions'] .= '<a href="' . $wiki->href('edit', $comment['tag']) . '" class="editer_commentaire">Editer</a> ';
            }
            if ($wiki->UserIsOwner($comment['tag']) || $wiki->UserIsAdmin()) {
                $valcomment['commentaires'][$i]['actions'] .= '<a href="' . $wiki->href('deletepage', $comment['tag']) . '" class="supprimer_commentaire">Supprimer</a>' . "\n";
            }
            $valcomment['commentaires'][$i]['reponses'] = afficher_commentaires_recursif($comment['tag'], $wiki, false);
            $i++;
        }
    }
    // formulaire d'ajout de commentaire
    $valcomment['commentform'] = '';
    if ($premier && $wiki->HasAccess("comment", $page)) {
        $valcomment['commentform'] .= "<div class=\"microblog-comment-form\">\n";
        $valcomment['commentform'] .= $wiki->FormOpen("addcomment", $page) . '
				<textarea name="body" class="comment-microblog" rows="3" placeholder="Ecrire votre commentaire ici..."></textarea>
				<button class="btn btn-primary btn-microblog" name="action" value="addcomment">Ajouter votre commentaire</button>' . $wiki->FormClose();
        $valcomment['commentform'] .= "<div class=\"clear\"></div></div>\n";
    }
    include_once 'squelettephp.class.php';
    $squelcomment = new SquelettePhp('tools/tags/presentation/templates/comment_list.tpl.html');
    $squelcomment->set($valcomment);
    $output .= $squelcomment->analyser();
    return $output;
}
예제 #4
0
                    $_SESSION["show_comments"][$tag] = 0;
                    break;
                case "1":
                    $_SESSION["show_comments"][$tag] = 1;
                    break;
            }
        }
        // display comments!
        include_once 'tools/tags/libs/tags.functions.php';
        $gestioncommentaire = '<strong class="lien_commenter">Commentaires sur cette page.' . "\n";
        if ($this->UserIsOwner() || $this->UserIsAdmin()) {
            $gestioncommentaire .= '<a href="' . $this->href('closecomments') . '" title="D&eacute;sactiver les commentaires sur cette page">D&eacute;sactiver les commentaires</a>' . "\n";
        }
        $gestioncommentaire .= '.</strong>' . "\n";
        $gestioncommentaire .= "<div class=\"commentaires_billet_microblog\">\n";
        $gestioncommentaire .= afficher_commentaires_recursif($this->getPageTag(), $this);
        $gestioncommentaire .= "</div>\n";
        $output .= $gestioncommentaire;
    }
} else {
    if ($this->UserIsOwner() || $this->UserIsAdmin()) {
        $output .= '<div class="admin_commenter">Commentaires d&eacute;sactiv&eacute;s ' . "\n" . '<a href="' . $this->href('opencomments') . '" title="Activer les commentaires sur cette page">Activer les commentaires</a>.</div>' . "\n";
    }
}
// on affiche la liste des mots clés disponibles pour cette page
if (!CACHER_MOTS_CLES) {
    $tabtagsexistants = $this->GetAllTags($this->GetPageTag());
    $tagspage = array();
    foreach ($tabtagsexistants as $tab) {
        $tagspage[] = $tab["value"];
    }