Forum ZitePLUS

La communauté des utilisateurs du CMS ZitePLUS

Vous n'êtes pas identifié(e).

#1 22/05/2016 17:13:51

dedega
Membre
Lieu : Malemort / Correze
Inscription : 10/09/2008
Messages : 131
Site Web

Agenda dans Zite+

Bonjour,

Je voudrais intégrer un agenda dans mon site, j'ai trouvé un code PHP mais je n'arrive pas à le faire fonctionner ?

Si quelqu’un et preneur pour se pencher sur le problème,

merci d'avance

<?php

/**
 * Wikazzle 0.1 beta, Copyleft (C) 2007 BohwaZ, Under GNU/GPL License
 * http://bohwaz.net/ - http://dev.kd2.org/
 */

// Titre du calendrier
define('TITLE', 'Wikazzle');

// Mot de passe d'accès au calendrier
define('PASSWORD', 'waza');

// Limite d'accès
// none = Aucune limite
// write = Demande le mot de passe pour modifier le calendrier
// read = demande le mot de passe aussi pour pouvoir voir le calendrier
define('ACCESS_LIMIT', 'write');

// Le fichier où seront stockées les données
define('STORAGE_FILE', dirname(__FILE__) . '/wikazzle.datas.php');

function strip_slashes_from_user_data(&$array)
{
    foreach ($array as $k => $v)
    {
        if (is_array($v))
        {
            strip_slashes_from_user_data($array[$k]);
            continue;
        }
        $array[$k] = stripslashes($v);
    }
}

if (get_magic_quotes_gpc())
{
    strip_slashes_from_user_data($_GET);
    strip_slashes_from_user_data($_POST);
    strip_slashes_from_user_data($_COOKIE);
}

function redirect($path='')
{
    $url = 'http' . (!empty($_SERVER['HTTPS']) ? 's' : '') . '://' .
        $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'] . $path;
    header('Location: '.$url);
    exit;
}

class Wikazzle
{
    protected $datas = array();
    private $needSave = false;

    public function __construct()
    {
        if (file_exists(STORAGE_FILE))
        {
            $this->datas = unserialize(file_get_contents(STORAGE_FILE));
        }

        @session_start();
    }

    public function __destruct()
    {
        if ($this->needSave)
        {
            $datas = serialize($this->datas);
            file_put_contents(STORAGE_FILE, $datas);
        }
    }

    private function needSave()
    {
        $this->needSave = true;
    }

    public function getOccupationForDay($day)
    {
        if (isset($this->datas[$day]))
        {
            return $this->datas[$day];
        }
        return false;
    }

    public function freeOccupationForDay($day)
    {
        unset($this->datas[$day]);
        $this->needSave();
    }

    public function setOccupationForDay($day, $people, $notes='')
    {
        $this->datas[$day] = array('people' => $people, 'notes' => $notes);
        $this->needSave();
    }

    public function authLogin($login, $password)
    {
        if ($password != PASSWORD)
        {
            return false;
        }

        $_SESSION['auth'] = $login;
        return true;
    }

    public function authLogout()
    {
        $_SESSION = array();
    }

    public function authCheck()
    {
        if (!empty($_SESSION['auth']))
            return $_SESSION['auth'];

        return false;
    }
}

class Render
{
    private $wk = false;
    private $months = array(1 => "Janvier", "Février", "Mars", "Avril", "Mai",
        "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre");
    private $days = array(1 => "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi",
        "Samedi", "Dimanche");
    private $colors = array("ffdbfc", "eedbff", "e2dbff", "dbffe4", "dbe9ff", "dbfcff",
        "e9ffb3", "eeffdb", "fdffdb", "ffd085", "b5ffa7",  "e3d4ae", "ffdbdb", "fff1db");

    public function __construct($wk)
    {
        $this->wk =& $wk;
    }

    private function getColor($string)
    {
        $string = strtolower($string);

        while ($string[$n])
        {
            $txt_sum += ord($string[$n++]);
        }

        $txt_sum %= count($this->colors);
        return $this->colors[$txt_sum];
    }

    private function head()
    {
        echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
        <head>
            <title>'.TITLE.'</title>
            <style type="text/css">
            * { margin: 0; padding: 0; }
            body { font-family: Arial, sans-serif; padding: 1em; max-width: 80em; background: #fff no-repeat 1em 1em
            url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPkAAABECAMAAAB0xWMJAAAAwFBMVEX8B4T9Eov%2BGZL8KZP%2BMJwvmcv%2BPJ85n9H%2BSahKpNL%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kJggg%3D%3D);}
            a { color: #009; }
            a:hover { color: red; }
            h1,#logged,#anonymous { margin-left: 280px; }
            #logged { color: darkblue; } #anonymous { color: darkred; }
            #logged,#anonymous { margin-bottom: 1em; }
            table.calendar { border-collapse: collapse; width: 100%; }
            .calendar caption { font-size: 1.3em; font-weight: bold; border-bottom: 2px solid #000; text-align: center; }
            .calendar thead .links { height: 1em; line-height: 1em; font-family: Arial, sans-serif; }
            .calendar thead .links a { color: #900; font-weight: bold; font-size: 4em; text-decoration: none; }
            .calendar thead .links a:hover { color: blue; }
            .calendar thead .links .prev { text-align: left; }
            .calendar thead .links .next { text-align: right; }
            .calendar thead .days th { text-align: center; border: 1px solid #999; width: 14%; padding: 0.2em; }
            .calendar tbody td.free, .calendar tbody td.taken { border: 1px solid #ccc; padding: 0.3em; padding-top: 0;
            vertical-align: top; }
            .calendar tbody td h3 { font-family: Georgia, serif; font-size: 1.5em; color: #999;
            font-weight: normal; text-align: center; border-bottom: 2px dashed #eee; margin-bottom: 0.4em; }
            .calendar tbody td p { text-align: center; margin-bottom: 0.2em; }
            .calendar tbody td.lastday { border-color: #666; background: repeat-y -10px
            url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAABCAYAAADeko4lAAAABmJLR0QA%2FwD%2FAP%2BgvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1wkMDhYR%2BJ%2Fj0QAAAB10RVh0Q29tbWVudABDcmVhdGVkIHdpdGggVGhlIEdJTVDvZCVuAAAAHElEQVQI12OcMWPGfwYGhs9I%2BAsUo4vhYqOoBQB2YRTYJKiD%2BwAAAABJRU5ErkJggg%3D%3D); }
            .calendar tbody td.today { border: 2px solid #000; }
            .calendar tbody td.free p.occupation { color: #060; }
            .calendar tbody td.taken p.occupation { color: #600; font-weight: bold; }
            .calendar tbody td.taken { background-color: #fee; border-color: #000; }
            .calendar tbody td .notes { font-size: 0.9em; }
            .calendar tbody td.taken h3 { border-color: #999; color: #000; }
            .calendar tbody td p.adm { font-size: 0.8em; margin: 0; }
            fieldset { border: 1px solid #ccc; padding: 0.5em; }
            fieldset legend { font-weight: bold; padding: 0.5em; }
            fieldset dl dt label { font-weight: bold; cursor: pointer; }
            fieldset dl dd { margin: 0.5em; }
            input[type=text], input[type=password], input[type=submit] { padding: 0.2em; font-size: 1.2em; }
            input[type=submit] { font-size: 1.3em; font-weight: bold; }
            form p.submit { padding: 0.5em; }
            p.error { margin: 1em; padding: 0.5em; border: 1px solid red; background: #fee; }
            </style>
        </head>

        <body>
        <h1>'.TITLE.'</h1>
        ';

        if ($this->wk->authCheck())
        {
            echo '
        <div id="logged">
            <p>Connecté en tant que <strong>'.$this->escape($this->wk->authCheck()).'</strong>.</p>
            <p><a href="?logout">Déconnexion</a></p>
        </div>';
        }
        else
        {
            echo '
        <div id="anonymous">
            <p>Vous n\'êtes pas connecté. ';

            if (ACCESS_LIMIT == 'write')
                echo 'Vous devez vous connecter pour modifier le calendrier.';
            else if (ACCESS_LIMIT == 'none')
                echo 'Vous pouvez vous connecter pour faciliter les modifications du calendrier.';

            echo '</p>
            <p><a href="?login">Connexion</a></p>
        </div>';
        }
    }

    private function foot()
    {
        echo '
        </body>
        </html>';
    }

    private function escape($str)
    {
        return htmlspecialchars($str);
    }

    public function login($msg='')
    {
        $this->head();

        if (!empty($msg))
        {
            echo '<p class="error">'.$this->escape($msg).'</p>';
        }

        echo '<form method="post" action="?" id="loginForm">
        <fieldset>
            <legend>Connexion</legend>
            <dl>
                <dt><label for="f_login">Pseudo/Nom</label></dt>
                <dd><input type="text" name="login" value="" id="f_login" /></dd>
                <dt><label for="f_password">Mot de passe</label></dt>
                <dd><input type="password" name="password" value="" id="f_password" /></dd>
            </dl>
            <p class="submit">
                <input type="submit" value="Connexion" />
            </p>
        </fieldset>
        </form>
        ';

        $this->foot();
    }

    public function calendar()
    {
        $this->head();

        if (!empty($_GET['y']))
            $year = (int) $_GET['y'];
        else
            $year = date('Y');

        if (!empty($_GET['m']))
            $month = (int) $_GET['m'];
        else
            $month = date('m');

        $month = sprintf("%02d", $month);
        $year = sprintf("%04d", $year);

        $ts_first = mktime(0, 0, 0, $month, 1, $year);
        $today = date('Ymd');
        list($month, $year, $weekday) = explode(',', strftime('%m,%Y,%w', $ts_first));
        $weekday = ($weekday + 7 - 1) % 7; #adjust for $first_day
        $days_in_month = date('t', $ts_first);

        if ($month == 12)
            $next = '?y=' . ($year+1) . '&amp;m=01';
        else
            $next = '?y=' . $year . '&amp;m=' . ($month+1);

        if ($month == 1)
            $prev = '?y=' . ($year-1) . '&amp;m=12';
        else
            $prev = '?y=' . $year . '&amp;m=' . ($month-1);

        echo '
        <script type="text/javascript">
        function freeOccupation(Id)
        {
            if (confirm("Libérer vraiment ?"))
            {
                var form = document.createElement("form");
                form.action = "?"
                form.method = "post";

                var input = document.createElement("input");
                input.type = "hidden";
                input.name = "free";
                input.value = Id;

                form.appendChild(input);
                document.getElementsByTagName("body")[0].appendChild(form);
                form.submit();
            }
        }
        </script>
        <table class="calendar">
            <caption>'.$this->months[(int)$month].' '.$year.'</caption>
            <thead>
                <tr class="links">
                    <th class="prev" colspan="3"><a href="'.$prev.'" title="Mois précédent">&larr;</a></th>
                    <th class="next" colspan="4"><a href="'.$next.'" title="Mois suivant">&rarr;</a></th>
                </tr>
                <tr class="days">
        ';

        for ($i=1; $i<=7; $i++)
        {
            echo '<th>'.$this->days[$i].'</th>';
        }

        echo '
                </tr>
            </thead>
            <tbody>
                <tr>
        ';

        for ($i=1; $i <= $weekday; $i++)
        {
            echo '
                    <td class="empty"></td>';
        }

        for ($day=1; $day <= $days_in_month; $day++, $weekday++)
        {
            $day = sprintf("%02d", $day);
            $id = $year.$month.$day;

            if ($weekday == 7)
            {
                $weekday = 0;
                echo '
                </tr>
                <tr>';
            }

            $class = '';
            if ($weekday == 6)
                $class .= 'lastday';

            if ($id == $today)
                $class .= ' today';

            if ($d = $this->wk->getOccupationForDay($id))
            {
                echo '
                    <td class="taken '.$class.'" style="background-color: #'.$this->getColor($d['people']).';"><h3>'.(int)$day.'</h3>
                        <p class="occupation">'.$this->escape($d['people']).'</p>';

                if (!empty($d['notes']))
                    echo '<p class="notes">'.nl2br($this->escape($d['notes'])).'</p>';

                if ($this->wk->authCheck())
                    echo '<p class="adm"><a href="?setOccupation='.$id.'">Modifier</a> |
                    <a href="#" onclick="freeOccupation('.$id.'); return false;">Libérer</a></p>';

                echo '
                    </td>';
            }
            else
            {
                echo '
                    <td class="free '.$class.'"><h3>'.(int)$day.'</h3>
                        <p class="occupation">Libre</p>';

                if ($this->wk->authCheck())
                    echo '<p class="adm"><a href="?setOccupation='.$id.'">Occuper</a></p>';

                echo '
                    </td>';
            }
        }

        for ($i=$weekday; $i <= 7; $i++)
        {
            echo '
                    <td class="empty"></td>';
        }

        echo '
                </tr>
            </tbody>
        </table>';

        $this->foot();
    }

    public function setOccupation($day)
    {
        $this->head();

        if ($occ = $this->wk->getOccupationForDay($day))
        {
            $people = $occ['people'];
            $notes = $occ['notes'];

            echo '<p class="error">Attention ce jour est déjà occupé.</p>';
        }
        else
        {
            $people = $this->wk->authCheck();
            $notes = '';
        }

        $jour = substr($day, -2) . '/' . substr($day, 4, 2) . '/' . substr($day, 0, 4);
        echo '<form method="post" action="?" id="occupationForm">
        <fieldset>
            <legend>Occuper le '.$jour.'</legend>
            <dl>
                <dt><label for="f_people">Personne(s)</label> (obligatoire)</dt>
                <dd><input type="text" name="people" size="50" id="f_people" value="'.$this->escape($people).'" /></dd>
                <dt><label for="f_notes">Notes</label></dt>
                <dd><textarea name="notes" id="f_notes" cols="50" rows="5">'.$this->escape($notes).'</textarea></dd>
            </dl>
            <p class="submit">
                <input type="hidden" name="day" value="'.$day.'" />
                <input type="submit" name="setOccupation" value="Enregistrer" />
            </p>
        </fieldset>
        </form>';

        $this->foot();
    }
}

$wk = new Wikazzle;
$render = new Render(&$wk);
$error = '';

if ($wk->authCheck() || ACCESS_LIMIT == 'none')
{
    if (!empty($_POST['setOccupation']))
    {
        if (empty($_POST['people']) || empty($_POST['day']))
            $error = 'EMPTY';
        else
        {
            if (empty($_POST['notes']))
                $_POST['notes'] = '';

            $wk->setOccupationForDay($_POST['day'], $_POST['people'], $_POST['notes']);
            $error = 'OK';
        }
        redirect();
    }
    else if (!empty($_POST['free']))
    {
        $wk->freeOccupationForDay($_POST['free']);
        redirect();
    }
}
else
{
    if (!empty($_POST['login']) && !empty($_POST['password']))
    {
        if (!$wk->authLogin($_POST['login'], $_POST['password']))
        {
            $error = 'MISMATCH';
        }
        else
        {
            redirect('?success');
        }
    }
}


if ((!$wk->authCheck() && ACCESS_LIMIT == 'read') || isset($_REQUEST['login']))
{
    if (empty($error) && ACCESS_LIMIT == 'read')
        $msg = 'Vous avez besoin de vous connecter pour accéder à cette page.';

    if ($error == 'MISMATCH')
        $msg = 'Mauvais mot de passe.';

    $render->login($msg);
}
elseif ($wk->authCheck() && isset($_GET['setOccupation']))
{
    $render->setOccupation($_GET['setOccupation']);
}
elseif (isset($_GET['logout']))
{
    $wk->authLogout();
    redirect();
}
else
{
    $render->calendar();
}

?>

dedega
big_smile

Hors ligne

#2 23/05/2016 17:04:55

Stefpei
Membre
Lieu : Nantes
Inscription : 12/06/2009
Messages : 354
Site Web

Re : Agenda dans Zite+

Salut dedega,

j'avais testé et installé ce script, sans trop de soucis...

En fonction ici sur ZitePlus : http://www.c-too.com/planning/index.php?perma=planning

Plus d'explications ici : https://ziteplus.giausserand.fr/forum/v … hp?id=1383


Stéphane
Webdesign AvantageWeb

Hors ligne

#3 24/05/2016 00:50:54

dedega
Membre
Lieu : Malemort / Correze
Inscription : 10/09/2008
Messages : 131
Site Web

Re : Agenda dans Zite+

Merci pour la réponse

c'est tout à fait ce que je cherche.

mais je ne sais pas comment le faire fonctionner ?

page blanche quand je clique sur le lien de la page ou est le code php. ??

j'ai validé la page (Agenda) temporairement sur mon site www.cabrive-volley.com

Je n'ai pas réussi de le faire fonctionner, j'ai intégré celui de Google.

Dernière modification par dedega (26/10/2016 10:39:35)

Hors ligne

Pied de page des forums