<?php

require_once '../thinkedit.init.php';
require_once ROOT . '/class/participation.class.php';
$participation = new participation('page');
// overwrite default some participate messages (you shoud use translate() here)
$participation->success_message = 'You did it!';
$participation->title = 'It\'s time to participate';
// send me a mail when soething new is posted
$participation->notification_email = 'test_email@test_email.com';
echo $participation->render();
예제 #2
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();
예제 #3
0
<?php 
                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();
                ?>
/*
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()
    {
예제 #5
0
<?php

require_once ROOT . '/class/participation.class.php';
$participation = new participation('annonce');
// définition des variables importantes :
$participation->title = 'Proposez un événement';
$participation->success_message = 'Votre contribution a bien été envoyée, elle sera validée et ajoutée sur le site';
$participation->failure_message = 'Problème technique : votre message n\'a pas été envoyé';
$participation->invalid_message = 'Votre contribution 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 événement sur yapaka.be : ';
// gère les posts le cas échéant
$participation->handlePost();
?>



<?php 
$annonces = $node->getChildren(array('type' => 'annonce'));
if ($annonces) {
    ?>
<br/>
<br/>
<br/>
<hr/>
<h1>Les annonces</h1>
<?php 
    foreach ($annonces as $annonce_node) {
        $annonce_content = $annonce_node->getContent();
/*
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 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();