Accéder au contenu.
Menu Sympa

devel - [Devel] r95 - trunk

Objet : devel-adl

Archives de la liste

[Devel] r95 - trunk


Chronologique Discussions 
  • From: thomas AT lolut.utbm.info
  • To: devel AT agendadulibre.org
  • Subject: [Devel] r95 - trunk
  • Date: Sat, 17 Sep 2005 19:09:54 +0200 (CEST)
  • List-archive: <http://lolut.utbm.info/pipermail/devel>
  • List-id: Developpement de l'Agenda du Libre <devel.agendadulibre.org>

Author: thomas
Date: 2005-09-17 19:09:53 +0200 (Sat, 17 Sep 2005)
New Revision: 95

Modified:
trunk/calendar.css
trunk/funcs.inc.php
trunk/index.php
trunk/infos.php
Log:
Integration du calendrier annuel propose par David Mentre. Mise a jour de la
page des informations.

Modified: trunk/calendar.css
===================================================================
--- trunk/calendar.css 2005-09-17 16:44:06 UTC (rev 94)
+++ trunk/calendar.css 2005-09-17 17:09:53 UTC (rev 95)
@@ -48,10 +48,14 @@
margin: 5px 5px 5px 5px;
}

-h2 {
+h2.calendar {
text-align: center;
}

+h3.calendar {
+ text-align: center;
+}
+
a:link, a:visited {
font-weight: bold;
text-decoration: none;

Modified: trunk/funcs.inc.php
===================================================================
--- trunk/funcs.inc.php 2005-09-17 16:44:06 UTC (rev 94)
+++ trunk/funcs.inc.php 2005-09-17 17:09:53 UTC (rev 95)
@@ -271,6 +271,70 @@
echo "</table>\n";
}

+function one_month_calendar($db, $month, $year)
+{
+ /*
+ * Compute previous and next months
+ */
+ $next = get_next_month($month, $year);
+ $next_year = $next['year'];
+ $next_month = $next['month'];
+
+ $prev = get_prev_month($month, $year);
+ $prev_year = $prev['year'];
+ $prev_month = $prev['month'];
+
+ /*
+ * Display links for previous and next months
+ */
+ echo "<h2 class=\"calendar\">\n";
+ echo " <a href=\"?year=".$prev_year."&amp;month=".$prev_month."\">
&lt;&lt; </a>\n";
+ echo " <span id=\"month_name\">".date_month2string($month)." ";
+ echo " <a href=\"?year=".$year."\">".$year."</a>"."</span>\n";
+ echo " <a href=\"?year=".$next_year."&amp;month=".$next_month."\">
&gt;&gt; </a>\n";
+ echo "</h2>\n\n";
+
+ /*
+ * Display the calendar
+ */
+ calendar($db, $month, $year);
+}
+
+function year_calendar($db, $year)
+{
+ /*
+ * Display links for previous and next years
+ */
+ $next_year = $year + 1;
+ $prev_year = $year - 1;
+ echo "<h2 class=\"calendar\">\n";
+ echo " <a href=\"?year=".$prev_year."\"> &lt;&lt; </a>\n";
+ echo " <span id=\"month_name\">".$year."</span>\n";
+ echo " <a href=\"?year=".$next_year."\"> &gt;&gt; </a>\n";
+ echo "</h2>\n\n";
+
+ /*
+ * Display the calendar over 12 months starting from current one
+ */
+ $num = 0;
+ $month = date("n");
+ while ($num < 12) {
+ // month header, with a link to the single month on a page
+ echo "<h3 class=\"calendar\">\n";
+ echo " <a href=\"?year=".$year."&amp;month=".$month."\">\n";
+ echo " <span id=\"month_name\">".date_month2string($month)."
".$year."</span>\n";
+ echo " </a>\n";
+ echo "</h3>\n\n";
+
+ calendar($db, $month, $year);
+
+ $next = get_next_month($month, $year);
+ $year = $next['year'];
+ $month = $next['month'];
+ $num++;
+ }
+}
+
function fetch_event($db, $id)
{
$result = $db->query ("select * from events where id=" .
$db->quote_smart($id));

Modified: trunk/index.php
===================================================================
--- trunk/index.php 2005-09-17 16:44:06 UTC (rev 94)
+++ trunk/index.php 2005-09-17 17:09:53 UTC (rev 95)
@@ -35,8 +35,16 @@
/*
* Compute the month to be displayed in the agenda
*/
-if($_GET['month'] && $_GET['year'])
+if($_GET['year'] && ! $_GET['month'])
{
+ if (ereg("^[0-9]{4}", $_GET['year']))
+ $year = $_GET['year'];
+ else
+ $year = date("Y");
+ year_calendar ($db, $year);
+}
+else if($_GET['month'] && $_GET['year'])
+{
if (ereg("^[0-9]{1,2}", $_GET['month']) // month is N or NN
&& ereg("^[0-9]{4}", $_GET['year']) // year is NNNN
&& 1 <= $_GET['month'] && $_GET['month'] <= 12) {
@@ -46,37 +54,14 @@
$year = date("Y");
$month = date("n");
}
+ one_month_calendar ($db, $month, $year);
}
else
{
$year = date("Y");
$month = date("n");
+ one_month_calendar ($db, $month, $year);
}

-/*
- * Compute previous and next months
- */
-$next = get_next_month($month, $year);
-$next_year = $next['year'];
-$next_month = $next['month'];
-
-$prev = get_prev_month($month, $year);
-$prev_year = $prev['year'];
-$prev_month = $prev['month'];
-
-/*
- * Display links for previous and next months
- */
-echo "<h2>\n";
-echo " <a href=\"?year=".$prev_year."&amp;month=".$prev_month."\"> &lt;&lt;
</a>\n";
-echo " <span id=\"month_name\">". date_month2string($month)."
".$year."</span>\n";
-echo " <a href=\"?year=".$next_year."&amp;month=".$next_month."\"> &gt;&gt;
</a>\n";
-echo "</h2>\n\n";
-
-/*
- * Display the calendar
- */
-calendar($db, $month, $year);
-
put_footer();
?>
\ No newline at end of file

Modified: trunk/infos.php
===================================================================
--- trunk/infos.php 2005-09-17 16:44:06 UTC (rev 94)
+++ trunk/infos.php 2005-09-17 17:09:53 UTC (rev 95)
@@ -27,7 +27,7 @@

?>

-<h2>Informations</h2>
+<h2 style="text-align: center">Informations</h2>

<h3>Pourquoi ?</h3>

@@ -194,8 +194,28 @@
</ul>
</li>

- <li>
+ <li>19/08/2005
+ <ul>
+ <li>Depuis cette date, tous les nouveaux comptes cr��s sur <a
href="http://linuxfr.org";>LinuxFr</a> disposent par d�faut d'une bo�te
<i>Agenda du Libre</i> affichant les �v�nements pour les 30 jours � venir</li>
+ </ul>
+ </li>

+ <li>15/09/2005
+ <ul>
+ <li>L'Agenda du Libre est maintenant r�f�renc� par <a
href="http://www.lea-linux.org";>Lea-Linux</a></li>
+ </ul>
+ </li>
+
+
+
+ <li>17/09/2005
+ <ul>
+ <li>D�veloppement de la g�n�ration de <a href="icallist.php">calendriers
<i>iCal</i></a>. Comme pour les flux RSS, il y a un calendrier disponible
pour chaque r�gion, ainsi qu'un calendrier national</li>
+ <li>Int�gration des patches de validation des entr�es de David Mentr�</li>
+ <li>Int�gration du patch de David Mentr� ajoutant le calendrier
annuel</li>
+ </ul>
+ </li>
+
</ul>







  • [Devel] r95 - trunk, thomas, 17/09/2005

Archives gérées par MHonArc 2.6.16.

Haut de le page