Mini agenda capricieux

Hello,

Je suis chez OVH et avec un spip 1.8.2.g, je vais passer sous une version
plus récente très vite mais avant j'ai une question, car une de mes
fonctions est capricieuse.

J'utilise cette contribution :
http://www.ac-rouen.fr/tice/Un-mini-agenda-mensuel-pour-SPIP et depuis un
petit moment il ne m'affiche plus rien comme événement à venir alors qu'ils
sont bel et bien publié ??? Voir le site http://www.damienyzerbyt.be

Est-ce que le serveur qui m'héberge pourrait en être la cause ? Comment sur
un mutuellisé puis je savoir la date et l'heure du serveur ?

Amitié

@+

Paul

En voila un quifonctionne à toi de l'adapter coté css

<BOUCLE_principale(RUBRIQUES){id_rubrique=ta rub}>
<?php
    $calendrier_mois=$_GET['calendrier_mois'];
    $calendrier_annee=$_GET['calendrier_annee'];

<table width="110" border="0" cellspacing="0" cellpadding="0"
style="border:1px solid #072F67;" bgcolor="#072F67">
  <tr class="boton_agenda">

  <td align="center" valign="top"> <font color="#FFFFFF" size="2"
face="Verdana, Arial, Helvetica, sans-serif"><strong>AGENDA</strong></font>
  </tr>

            <tr>
             <td height="1" bgcolor="#072F67"></td>
            </tr>
  <tr>
    <td valign="top">
<table width="110" border="0" cellpadding="0" cellspacing="0"
bgcolor="#FFFFFF">
                    <tr>
                      <td align="right" valign="top">
       <?php
$months = array('', 'january', 'february', 'march', 'april', 'may', 'june',
'july', 'august', 'september', 'october', 'november', 'december');
$days = array('su', 'mo', 'tu', 'we', 'th', 'fr', 'sa');

function mkdate($month, $day, $year)
{
return mktime(0, 0, 0, $month, $day, $year);
}

function preparation_URL($texte_URL,$mois_URL,$annee_URL)
    {
    $position = StrPos($texte_URL,"calendrier_mois");
    $texte_remplacement =
"calendrier_mois=".$mois_URL."&calendrier_annee=".$annee_URL;
    if ($position!==FALSE)
        {
        $texte_URL = substr_replace
($texte_URL,$texte_remplacement,$position);}
        else { $presence = StrPos($texte_URL,"?");
                if ($presence==FALSE)
                  {$texte_URL = $texte_URL."?".$texte_remplacement;}
                else
                  {$texte_URL = $texte_URL."&".$texte_remplacement;}
              }
    return $texte_URL;
    }

if(isset($GLOBALS['var_nav_month'])) {
$cal_day = mkdate($GLOBALS['var_nav_month'], 1, $GLOBALS['var_nav_year']);
} else {
$cal_day = time();
}

$$D = intval(date('d', $cal_day));
if (isset($calendrier_mois)) {
$M = $calendrier_mois;
} else {$M = intval(date('m', $cal_day));}
if (isset($calendrier_annee)) {
$Y = $calendrier_annee;
} else {$Y = intval(date('Y', $cal_day));}

$events = array();

<BOUCLE_evenements(ARTICLES){branche}{annee_redac!=0000}>
<?php

$date = ereg_replace("^([0-9]{4})-([0-9]{2})-([0-9]{2}).*$", "\\1\\2\\3",
'#DATE_REDAC');
if ($date > date("Ymd", mkdate($M, $D - 31, $Y)) && $date < date("Ymd",
mkdate($M, $D + 31, $Y))) {
  if (!isset($events[$date])) {
   $events[$date] = array();
  }
  $events[$date] = array('link' => '#URL_ARTICLE', 'title' =>
'[(#TITRE|texte_script)]', 'logo' => "");
}
$titulo='[(#TITRE|texte_script)]';

</BOUCLE_evenements>

<table width="110" cellpadding="1" cellspacing="0" align="center"
class="small_mini">
<tr class="calendar_this_month">
<th colspan="7" valign="middle" style="font-size:11px; font-family:Verdana,
Arial, Helvetica, sans-serif; color:#3F3A3A;">
  <?php
        $mes = $months [$M];
        if ($M==1){
            $calendrier_mois_moins=12;
            $calendrier_annee_moins=$Y-1;}
        else {
            $calendrier_mois_moins=$M-1;
            $calendrier_annee_moins=$Y;}
        if ($M==12){
            $calendrier_mois_plus=1;
            $calendrier_annee_plus=$Y+1;}
        else {
            $calendrier_mois_plus=$M+1;
            $calendrier_annee_plus=$Y;}
  echo '<a
href="'.preparation_URL('#SELF',$calendrier_mois_moins,$calendrier_annee_moi
ns).'"title="Mois pr&eacute;c&eacute;dent"><img
src="images/pucemoisgauche.gif" border="0">
        </a>'.$mes.' '.$Y.'<a
href="'.preparation_URL('#SELF',$calendrier_mois_plus,$calendrier_annee_plus
).'"title="Mois suivant">
        <img src="images/pucemois.gif" border="0"></a>';

</th>
</tr>
<tr>
<?php

for($i = 1; $i < 8; $i++) {
  echo '<th width="14%" class="calendar_head_mini">'.$days[$i%7].'</th>';
}
$TempD = 1;
if(date('w', mkdate($M, 1, $Y)) != 1) {
  echo '</tr><tr>';
  $tmp = '';
  while(date('w', mkdate($M, $TempD, $Y)) != 1) {
   $TempD--;
   $case = '<td width="14%" valign="top" class="calendar_not_this_month">';
   $case .= date('j', mkdate($M, $TempD, $Y));
   $date = date('Ymd', mkdate($M, $TempD, $Y));

   $case .= '</td>';
   $tmp = $case.$tmp;
  }
  echo $tmp;
}
$TempD = 1;
while((date('m', mkdate($M, $TempD, $Y)) == $M) || (date('w', mkdate($M,
$TempD, $Y)) != 1)) {
  if(date('w', mkdate($M, $TempD, $Y)) == 1) {
   echo '</tr><tr>';
  }
  echo '<td width="6%" valign="top" class="calendar_'.(date('m', mkdate($M,
$TempD, $Y)) != $M ? 'not_' : '').'this_'.(date('Ymd', mkdate($M, $TempD,
$Y)) == date('Ymd') ? 'day' : 'month').'">';
  $date = date('Ymd', mkdate($M, $TempD, $Y));
  if (isset($events[$date])) {
    echo '<a href="'.$events[$date]['link'].'" class="agenda_mini"
title="'.$events[$date]['title'].'">'. date('j', mkdate($M, $TempD, $Y))
.'</a>';
  }
  else {
  echo date('j', mkdate($M, $TempD, $Y));
  }
  echo '</td>';
  $TempD++;
}

</tr>
</table>

</td>
                    </tr>
                </table>
</td>
  </tr>
  <tr>
              <td height="1" bgcolor="#072F67"></td>
            </tr>
  <tr bgcolor="#FFFFFF">
    <td valign="top">
<B_agenda_global>
<table width="50%" border="0" cellspacing="0" cellpadding="2">
      <tr>
        <td><table width="50%" border="0" cellpadding="0" cellspacing="0"
style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:9px;
color:#3F3A3A;">
          <BOUCLE_agenda_global(ARTICLES){id_rubrique=75} {par date_redac}
{age_redac <= 0}>
          <tr>
            <td align="left" valign="top" nowrap>
[(#DATE_REDAC|jour)-][(#DATE_REDAC|mois):] </td>
            <td width="50%" align="left" valign="top"><a
href="#URL_ARTICLE">#TITRE</a><br>
            </td>
          </tr>
          </BOUCLE_agenda_global>
        </table></td>
      </tr>
    </table>
</B_agenda_global>
<table width="100%" border="0" cellspacing="0" cellpadding="1">
  <tr>
    <td align="left" valign="top"><font style="font-family:Verdana, Arial,
Helvetica, sans-serif; font-size:10px; color:#3F3A3A;">
    Il n'y a aucun &eacute;v&egrave;nement &agrave; venir pour ce
mois</font></td>
  </tr>
</table>
<//B_agenda_global>
</td>
  </tr>
</table>
</BOUCLE_principale>

Par contre n'oublies pas de mettre ton num de rubrique et eventuellement tes
images dans le php (le 3) pour les pues avant et après

BB

---- Original Message ----
From: "Paul" <paul@hmpnet.be>
To: <spip@rezo.net>
Sent: Wednesday, August 02, 2006 9:10 PM
Subject: [Spip] Mini agenda capricieux

Hello,

Je suis chez OVH et avec un spip 1.8.2.g, je vais passer sous une
version plus récente très vite mais avant j'ai une question, car une
de mes fonctions est capricieuse.

J'utilise cette contribution :
Académie de Normandie | Académie de Normandie et
depuis un petit moment il ne m'affiche plus rien comme événement à
venir alors qu'ils sont bel et bien publié ??? Voir le site
http://www.damienyzerbyt.be

Est-ce que le serveur qui m'héberge pourrait en être la cause ?
Comment sur un mutuellisé puis je savoir la date et l'heure du
serveur ?

Amitié

@+

Paul

_______________________________________________
liste spip
spip@rezo.net - désabonnement : spip-off@rezo.net
Infos et archives : http://listes.rezo.net/mailman/listinfo/spip
Documentation de SPIP : http://www.spip.net/
irc://irc.freenode.net/spip
FAQ : http://www.spip-contrib.net/spikini/FaQ

.....................::::::IIIII:::::::...................
http://www.la-plume-et-lencrier.com
http://palabres.la-plume-et-lencrier.com
http://www.la-plume-et-lencrier.info
http://editions.la-plume-et-lencrier.info
http://www2.la-plume-et-lencrier.com
............................................................
         LA PLUME ET L'ENCRIER
             Association Loi 1901