Ejemplo n.º 1
0
if ($forums = $node->getChildren(array('type' => 'forum'))) {
    ?>

<?php 
    // on ne prend que le premier forum défini dans ce node, pour ne pas avoir plusieurs forums sur une même page
    $forum = $forums[0];
    $forum_content = $forum->getContent();
    ?>




<?php 
    require_once ROOT . '/class/participation.class.php';
    $participation = new participation('discussion');
    $participation->setParentNode($forum);
    // définition des variables importantes :
    $participation->title = $forum_content->getTitle();
    $participation->success_message = 'Votre message a bien été posté !';
    $participation->failure_message = 'Problème technique : votre message n\'a pas été envoyé';
    $participation->invalid_message = 'Votre message n\'est pas valable : certains champ doivent être remplis correctement. Vérifiez ci dessous et ré-essayez';
    $participation->enable_moderation = false;
    $participation->enable_captcha = true;
    $participation->captcha_title = 'Vérification';
    $participation->captcha_help = 'Veuillez entrer le code ci dessous pour vérifier que vous êtes un humain';
    $participation->captcha_error = 'Le code que vous avez entré n\'est pas le bon';
    // personne qui reçoit un mail quand il y a du neuf
    $participation->notification_email = '*****@*****.**';
    $participation->notification_email_subject = 'Un commentaire sur yapaka.be : ';
    $participation->handlePost();
    //print_r($participation);
This is a concept that must be extended.
Work in progress, only interface is defined here
Participation is a tool to let the public of a website participate actively.
This means : 
- adding comments
- respond to polls
- adding any kind of (allowed) content
This is translated to : render a public friendly form to add content to a website.
*/
/*
Example implementation (will be commented out later) :
*/
// Simple use : render a comment post form
$participation = new participation('discussion');
$participation->render();
// where is this stuff being put ?
$participation->setParentNode($node->getId());
// enable publishing "a posteriori"
$participation->enableModeration();
// enable instant publishing if user fills a captcha
$participation->enableCaptcha();
// Various strings
$participation->setTitle('Please submit your comment bellow');
$participation->setSucces('Good!, your comment has been posted');
$participation->setFailure('Too bad, it didn\'t work');
class participation
{
    function render()
    {
    }
}
Ejemplo n.º 3
0
                echo nl2br($discussion_content->get('body'));
                ?>
</p>
</div>




<?php 
                /**************** affichage formulaire de participation *******************/
                ?>

<?php 
                require_once ROOT . '/class/participation.class.php';
                $participation = new participation('discussion');
                $participation->setParentNode($discussion_node);
                // définition des variables importantes :
                $participation->title = 'Donnez votre avis';
                $participation->success_message = 'Votre message a bien été envoyé, il sera validé et ajouté sur le site';
                $participation->failure_message = 'Problème technique : votre message n\'a pas été envoyé';
                $participation->invalid_message = 'Votre message n\'est pas valable : certains champ doivent être remplis correctement. Vérifiez ci dessous et ré-essayez';
                $participation->enable_moderation = false;
                // personne qui reçoit un mail quand il y a du neuf
                $participation->notification_email = '*****@*****.**';
                $participation->notification_email_subject = 'Un commentaire sur yapaka.be : ';
                $participation->handlePost();
                print_r($participation);
                echo $participation->render();
                ?>

<?php 
- adding comments
- respond to polls
- adding any kind of (allowed) content
This is translated to : render a public friendly form to add content to a website.
*/
/*
Example implementation can be found in /doc/participation.txt
*/
// Simple use : render a comment post form
$participation = new participation('discussion');
$participation->render();
$participation->renderForm();
// ?
// where is this stuff being put ?
// default to the curent node (global $node)
$participation->setParentNode($node);
// enable publishing "a posteriori"
// else comment / item is published imediately
$participation->enableModeration();
// enable instant publishing if user fills a captcha
// this disables moderation
$participation->enableCaptcha();
// Will add a preview button to let visitors preview their participation before submiting
// need mor thinking on this one as well
$participation->enablePreview();
// enable akismet.com spam check
// this disables moderation
$participation->enableAkismet();
// will send an email to $email when something is posted
$participation->notifyByEmail($email);
// Various strings