[Devel] r264 - branches/dui
svn at agendadulibre.org
svn at agendadulibre.org
Lun 9 Avr 12:35:45 CEST 2007
Author: ldayot
Date: Mon Apr 9 12:35:41 2007
New Revision: 264
Log:
== Reprise du code ==
* unification des appels à la base mysql par l'objet db()
* traitement des avertissements, notamment en ajoutant des isset ou @ dans les conditions
* ajout d'un title aux liens mois/année précédent(e)/suivant(e) (accessibilité)
* unification de la forme (ajout de <p>) aux formulaire de sélection de la région
* ajout d'un bouton [Ok] dans le formulaire de sélection de la région (accessibilité, fonctionne même
sans javascript)
== Ajout de fonctions ==
* carte faisant figurer le nombre d'événements dans le mois à venir par région
Attention, il y a un changement dans la structure de la table regions de
la base de données. Voir dans UPGRADE !
Added:
branches/dui/regionimage.php
Modified:
branches/dui/UPGRADE
branches/dui/bd.inc.php
branches/dui/diff.inc.php
branches/dui/funcs.inc.php
branches/dui/ical.php
branches/dui/icallist.php
branches/dui/index.php
branches/dui/infos.php
branches/dui/listevents.php
branches/dui/map.php
branches/dui/moderate.php
branches/dui/moderateinfos.php
branches/dui/passgen.php
branches/dui/rss.php
branches/dui/rsslist.php
branches/dui/schema.sql
branches/dui/session.inc.php
branches/dui/showevent.php
branches/dui/stats.php
branches/dui/submit-script-doc.php
branches/dui/submit.php
branches/dui/tags.php
branches/dui/testevent.php
Modified: branches/dui/UPGRADE
==============================================================================
--- branches/dui/UPGRADE (original)
+++ branches/dui/UPGRADE Mon Apr 9 12:35:41 2007
@@ -8,3 +8,37 @@
ALTER TABLE events ADD tags VARCHAR(255) NOT NULL DEFAULT ''
+Revision lower than 2007-04-09
+==============================
+
+Execute following SQL command:
+
+ALTER TABLE regions ADD `mapzone` text;
+
+REPLACE INTO `regions` VALUES (1, 'Alsace', '501,118,490,136,485,154,480,167,480,178,479,194,480,203,476,208,467,208,461,201,459,194,454,188,454,179,463,158,460,152,462,150,461,145,468,141,464,134,467,129,462,126,460,127,452,123,459,115,467,122,476,123,481,113,502,116');
+REPLACE INTO `regions` VALUES (2, 'Aquitaine', '131,318,124,365,130,363,133,369,125,371,111,432,97,443,99,446,112,448,113,454,109,459,110,463,120,456,119,464,142,471,145,476,156,475,158,471,173,447,167,433,162,433,160,428,165,423,165,412,174,410,176,414,182,408,198,407,203,408,213,396,210,389,219,388,216,380,237,356,234,346,228,342,230,336,228,333,230,329,219,318,210,319,206,312,202,313,197,322,190,327,188,335,181,341,179,339,176,342,177,345,162,344,159,340,160,336,154,331,149,333,155,353,150,352,144,330,131,318');
+REPLACE INTO `regions` VALUES (3, 'Auvergne', '301,251,295,255,286,255,286,264,276,267,271,271,277,278,285,285,285,295,284,301,276,308,282,317,279,334,274,333,270,345,263,355,265,364,267,372,278,371,286,358,295,362,302,373,303,375,318,359,325,369,335,370,347,357,355,353,357,342,353,332,339,337,336,328,341,325,326,308,332,281,341,274,330,265,326,255,321,260,306,258,302,251');
+REPLACE INTO `regions` VALUES (4, 'Basse-Normandie', '115,72,118,79,117,91,126,103,126,131,131,136,126,137,127,144,131,146,140,143,157,150,167,147,173,148,175,142,180,147,184,153,186,155,191,150,197,149,200,152,200,160,206,162,214,165,216,165,222,150,218,137,209,125,202,126,204,106,198,93,175,101,154,94,144,95,138,84,141,78,140,75,128,77,123,76');
+REPLACE INTO `regions` VALUES (5, 'Bourgogne', '305,158,301,165,301,171,303,175,307,181,303,186,298,194,294,196,298,203,296,207,299,213,297,218,300,223,301,251,307,257,317,257,324,256,328,255,329,265,334,265,342,272,344,276,339,277,336,280,339,285,354,285,358,277,363,281,369,280,371,284,374,283,378,264,382,267,388,265,394,269,397,268,396,261,397,253,394,248,397,244,395,241,392,241,391,237,397,234,399,224,399,216,395,208,398,204,398,201,393,203,388,202,387,198,376,194,380,186,373,184,371,178,363,176,361,179,352,180,345,181,341,183,335,183,330,169,326,171,325,162,317,156,303,158,305,159');
+REPLACE INTO `regions` VALUES (6, 'Bretagne', '86,202,90,202,94,199,99,197,99,191,106,191,119,188,125,183,135,186,141,177,144,170,141,158,145,151,143,144,136,144,132,146,126,143,124,136,117,136,114,131,106,133,100,136,96,132,81,140,68,119,50,120,46,127,38,125,36,129,32,123,23,127,16,125,4,128,1,142,14,143,13,147,4,146,7,152,14,151,18,160,1,161,15,175,27,173,35,179,47,182,59,194,75,193,69,197,88,202');
+REPLACE INTO `regions` VALUES (7, 'Centre', '244,125,249,128,249,143,253,149,257,156,262,163,275,162,282,165,279,172,303,170,305,179,301,185,300,191,294,194,295,220,300,222,302,250,295,254,285,254,284,262,269,271,256,270,254,268,231,272,219,259,207,235,194,240,185,225,192,199,196,202,217,184,216,173,219,169,214,166,222,152,219,139,227,132,238,134,244,124,244,125');
+REPLACE INTO `regions` VALUES (8, 'Champagne-Ardenne', '348,66,348,79,340,85,341,97,326,103,327,109,330,108,329,113,325,113,323,118,326,122,320,130,317,135,322,146,318,150,317,155,320,161,326,170,333,170,335,178,342,183,348,180,353,183,359,181,364,176,374,180,373,184,379,187,377,196,391,201,392,203,395,200,397,197,407,196,407,190,413,183,406,175,406,164,394,156,393,149,378,143,377,135,373,130,376,124,379,120,375,116,376,106,381,99,380,88,391,88,390,82,372,71,370,64,372,56,366,56,367,62,360,66,348,66');
+REPLACE INTO `regions` VALUES (9, 'Corse', '518,447,513,442,515,420,511,419,510,439,504,436,490,443,482,444,481,451,474,456,480,460,477,465,479,471,484,474,479,479,476,483,479,486,486,482,484,488,480,492,483,496,490,498,485,502,489,509,494,509,501,515,508,513,509,504,512,496,512,485,518,474,518,472');
+REPLACE INTO `regions` VALUES (10, 'Franche-Comté', '424,269,424,264,438,249,439,238,462,217,456,213,455,207,462,203,462,199,458,199,458,192,452,190,453,186,443,182,437,183,428,181,423,177,415,183,410,187,408,189,405,197,399,198,395,200,399,204,397,208,396,208,400,218,398,229,394,237,390,240,395,242,398,245,394,248,397,253,399,261,394,265,397,267,395,273,402,279,407,276,413,280,420,275,423,268');
+REPLACE INTO `regions` VALUES (11, 'Haute-Normandie', '241,59,228,66,203,73,194,78,191,89,197,91,202,92,199,100,203,125,210,127,218,139,226,132,237,134,244,126,244,116,249,115,252,107,254,94,252,78,255,67,240,59');
+REPLACE INTO `regions` VALUES (12, 'Île-de-France', '251,109,248,116,243,117,244,124,248,131,249,144,255,149,259,155,262,162,270,160,272,163,280,163,282,168,282,175,290,172,300,170,302,161,307,158,316,156,317,149,322,145,318,136,317,134,320,130,314,127,308,120,301,116,295,112,293,117,283,114,277,109,268,109,262,111,253,109,252,108');
+REPLACE INTO `regions` VALUES (13, 'Languedoc-Roussillon', '305,500,300,494,308,457,319,455,339,440,349,439,352,444,361,436,360,430,369,428,371,418,375,413,373,407,370,394,365,392,363,395,355,392,353,396,345,394,343,386,340,383,335,370,322,370,318,361,301,379,306,398,310,401,317,403,311,409,319,413,292,435,283,434,285,447,269,444,267,448,252,446,244,454,247,460,254,463,259,469,256,474,252,481,253,486,264,483,262,489,248,495,246,501,260,510,270,503,279,510,291,504,304,500,304,499,303,500,302,500');
+REPLACE INTO `regions` VALUES (14, 'Limousin', '230,271,215,278,211,284,213,290,217,297,212,297,211,304,206,308,203,313,211,312,211,319,219,317,228,328,233,327,231,332,229,334,230,339,227,341,231,344,235,346,236,353,243,352,249,357,264,356,266,350,269,339,273,336,273,330,280,333,280,312,279,306,275,307,285,296,283,290,282,279,271,274,272,268,259,270,255,266,251,272,244,269,238,272,228,271,229,271');
+REPLACE INTO `regions` VALUES (15, 'Lorraine', '392,86,389,89,381,88,378,91,381,102,377,107,375,114,378,121,378,125,375,128,377,137,379,143,395,152,397,160,406,164,406,172,405,174,414,183,421,176,427,181,435,181,439,182,448,183,453,185,455,172,459,163,461,158,458,154,460,150,458,145,463,144,467,139,465,133,467,128,457,126,452,124,455,119,458,112,465,119,476,121,479,115,477,109,470,107,465,111,457,109,452,106,447,108,446,110,431,90,423,89,418,94,412,94,410,89,399,88,398,92,393,86,392,86');
+REPLACE INTO `regions` VALUES (16, 'Midi-Pyrénées', '236,354,237,359,217,379,217,380,220,389,212,389,215,395,210,402,207,406,201,411,197,409,186,412,178,411,180,415,171,414,169,412,164,414,167,425,160,428,162,432,172,435,174,443,170,456,159,470,160,477,168,486,177,485,184,486,192,483,197,486,203,479,219,482,221,487,229,488,231,492,245,494,248,495,260,490,258,486,251,483,254,477,255,470,257,468,252,463,246,460,245,451,252,444,257,446,265,447,270,444,275,445,284,445,283,432,291,433,297,430,303,428,301,423,310,423,313,418,318,415,313,410,315,403,305,399,302,378,294,363,286,359,279,374,273,373,266,375,264,373,266,365,262,358,252,358,245,356,242,351,235,352');
+REPLACE INTO `regions` VALUES (17, 'Nord-Pas-de-Calais', '250,41,250,6,253,8,280,0,285,1,287,6,288,14,296,21,304,17,311,17,313,32,325,35,328,45,344,43,345,53,347,58,347,63,345,64,329,60,308,63,291,57,280,53,283,50,273,49,266,48,260,41,250,40,251,40,251,39');
+REPLACE INTO `regions` VALUES (18, 'Pays de la Loire', '145,145,145,155,142,160,144,172,135,186,124,182,114,190,99,191,95,201,83,209,88,215,97,211,111,216,97,215,94,221,102,228,96,240,106,254,105,259,120,271,134,275,138,271,154,273,157,270,154,265,156,259,153,251,153,245,147,235,156,235,163,229,176,230,184,226,192,199,194,203,202,198,213,186,217,183,214,176,219,169,201,159,198,148,182,155,177,142,172,148,167,146,158,150,145,145');
+REPLACE INTO `regions` VALUES (19, 'Picardie', '247,49,242,57,253,68,256,77,253,82,255,91,254,99,255,105,252,108,259,111,269,107,269,111,277,110,285,116,294,114,297,112,319,130,328,122,323,118,324,112,329,112,329,109,326,106,326,102,341,98,339,83,347,79,346,65,331,59,322,60,313,62,301,59,292,58,291,54,282,56,282,48,272,51,268,50,262,43,250,41,248,45,252,51,249,50,247,49');
+REPLACE INTO `regions` VALUES (20, 'Poitou-Charentes', '148,235,154,245,153,251,156,259,154,266,157,272,153,274,140,270,132,275,131,282,136,288,135,297,128,302,128,309,143,319,148,332,154,329,160,335,161,341,176,344,177,339,187,335,190,325,197,319,207,308,212,301,209,295,217,295,212,290,212,279,228,273,221,262,217,258,207,235,203,240,193,238,190,230,186,228,176,229,160,230,155,235,147,235');
+REPLACE INTO `regions` VALUES (21, 'Provence-Alpes-Côte d''Azur', '370,394,372,407,379,411,367,432,361,432,360,437,351,445,367,445,374,451,382,448,384,439,391,440,393,444,385,451,400,450,401,458,418,462,423,468,432,464,435,468,438,463,457,456,451,451,491,420,489,414,498,400,492,398,487,404,462,390,463,376,471,367,446,345,442,349,438,345,432,348,439,355,439,361,428,361,415,373,408,374,410,382,409,384,403,381,401,390,412,396,410,403,401,403,393,399,389,393,385,397,385,387,379,388,382,398,375,397,373,393,370,394');
+REPLACE INTO `regions` VALUES (22, 'Rhône-Alpes', '336,280,331,284,332,293,335,295,330,298,328,301,332,304,329,308,337,323,342,326,338,331,339,334,347,336,355,331,357,338,362,342,359,346,356,344,357,350,352,355,348,362,342,361,335,369,338,376,343,387,346,394,352,397,358,392,360,396,365,393,368,396,372,394,379,397,382,397,381,394,379,391,381,387,385,388,387,391,385,395,389,396,391,394,392,399,402,401,405,404,411,400,412,394,400,390,400,381,411,384,409,379,408,376,415,374,419,369,431,360,437,361,440,357,434,351,431,349,435,346,442,348,462,341,468,336,470,327,463,321,462,313,454,307,464,297,454,282,456,275,451,271,431,274,434,280,431,286,421,287,420,283,428,277,427,271,420,272,419,279,413,279,408,275,404,279,388,265,379,266,372,284,368,279,357,277,356,285,336,287,336,279');
+REPLACE INTO `regions` VALUES (23, 'Guadeloupe', NULL);
+REPLACE INTO `regions` VALUES (24, 'Guyane', NULL);
+REPLACE INTO `regions` VALUES (25, 'Martinique', NULL);
+REPLACE INTO `regions` VALUES (26, 'Réunion', NULL);
+REPLACE INTO `regions` VALUES (27, 'Autre pays', NULL);
Modified: branches/dui/bd.inc.php
==============================================================================
--- branches/dui/bd.inc.php (original)
+++ branches/dui/bd.inc.php Mon Apr 9 12:35:41 2007
@@ -18,6 +18,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
+ *
+ * $Id: top.inc.php,v 1.51 2007/03/10 16:22:12 ldayot Exp $
*/
include("bd-private.inc.php");
@@ -38,13 +40,13 @@
global $pass;
global $bdd;
- if(mysql_connect($host,$user,$pass)==FALSE)
+ if(@mysql_connect($host,$user,$pass)==FALSE)
{
echo "Probleme de connexion à la base de données sur $host.\n";
return 0;
}
- if(mysql_select_db($bdd) == FALSE)
+ if(@mysql_select_db($bdd) == FALSE)
{
echo "Probleme de selection de la base de données $bdd sur $host.\n";
return 0;
@@ -53,7 +55,7 @@
function query ($query)
{
- if( ($result = mysql_query($query)) == FALSE)
+ if( ($result = @mysql_query($query)) == FALSE)
{
echo "Probleme dans la syntaxe de $query : " . mysql_error() . "\n";
return 0;
@@ -67,6 +69,31 @@
return mysql_insert_id ();
}
+ function fetchObject ($result)
+ {
+ return mysql_fetch_object($result);
+ }
+
+ function fetchArray ($result)
+ {
+ return mysql_fetch_array($result);
+ }
+
+ function fetchRow ($result)
+ {
+ return mysql_fetch_row($result);
+ }
+
+ function freeResult ($result)
+ {
+ return mysql_free_result($result);
+ }
+
+ function numRows ($result)
+ {
+ return mysql_num_rows($result);
+ }
+
/**
* Converts the argument of an SQL request in a format accepted by MySQL.
*
@@ -84,6 +111,6 @@
return $value;
}
-}
+} // end class
-?>
\ No newline at end of file
+?>
Modified: branches/dui/diff.inc.php
==============================================================================
--- branches/dui/diff.inc.php (original)
+++ branches/dui/diff.inc.php Mon Apr 9 12:35:41 2007
@@ -41,7 +41,9 @@
$outcount = 0; # output counter
$hit1 = "" ; # hit in left
$hit2 = "" ; # hit in right
-
+ $stop = 0; # max loop control
+ $out = ""; # output string
+
while (
$c1 < $max1 # have next line in left
and
@@ -252,4 +254,4 @@
}
-?>
\ No newline at end of file
+?>
Modified: branches/dui/funcs.inc.php
==============================================================================
--- branches/dui/funcs.inc.php (original)
+++ branches/dui/funcs.inc.php Mon Apr 9 12:35:41 2007
@@ -18,8 +18,19 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
+ *
+ * $Id: top.inc.php,v 1.51 2007/03/10 16:22:12 ldayot Exp $
*/
+
+if (! function_exists("_"))
+{
+ function _($text)
+ {
+ return $text;
+ }
+}
+
/*
* Compute an absolute URL for the website
*
@@ -47,6 +58,8 @@
function put_header ($title)
{
+ global $db;
+
calendar_setlocale();
$db = new db();
@@ -60,6 +73,9 @@
exit;
}
+ // LD added : force charset
+ header("Content-type: text/html; charset=ISO-8859-1");
+
echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>";
?>
@@ -77,7 +93,7 @@
rss_feed_header ("rss.php?region=all", "Agenda du Libre, toutes les régions");
- while ($row = mysql_fetch_object($region_list))
+ while ($row = $db->fetchobject($region_list))
{
rss_feed_header ("rss.php?region=" . $row->id, "Agenda du Libre, " . $row->name);
}
@@ -235,11 +251,11 @@
return;
}
- if (mysql_num_rows ($result) > 0)
+ if ($db->numRows ($result) > 0)
{
echo " <ul>\n";
- while ($ret = mysql_fetch_object ($result))
+ while ($ret = $db->fetchObject ($result))
{
echo " <li><a href=\"showevent.php?id=" . $ret->id . "\">\n";
echo " <b>" . str_replace("-", " ", stripslashes($ret->city)) . "</b>: ";
@@ -349,7 +365,7 @@
else
$req = $db->query ("select id from events where start_time < '" . $date . "' and region=" . $region);
- return (mysql_num_rows($req) != 0);
+ return ($db->numRows($req) != 0);
}
function has_event_in_future($db, $month, $year, $region)
@@ -360,7 +376,7 @@
else
$req = $db->query ("select id from events where start_time >= '" . $date . "' and region=" . $region);
- return (mysql_num_rows($req) != 0);
+ return ($db->numRows($req) != 0);
}
function one_month_calendar($db, $month, $year, $region)
@@ -386,16 +402,17 @@
*/
echo "<h2 class=\"calendar\">\n";
if (has_event_in_past($db, $month, $year, $region))
- echo " <a href=\"?year=".$prev_year."&month=".$prev_month."&region=".$region."\"> << </a>\n";
+ echo " <a href=\"?year=".$prev_year."&month=".$prev_month."&region=".$region."\" title=\"". date_month2string($prev_month)." ".$prev_year. "\"> << </a>\n";
echo " <span id=\"month_name\">".date_month2string($month)." ";
echo " <a href=\"?year=".$year."&region=".$region."\">".$year."</a>"."</span>\n";
if (has_event_in_future($db, $next_month, $next_year, $region))
- echo " <a href=\"?year=".$next_year."&month=".$next_month."&region=".$region."\"> >> </a>\n";
+ echo " <a href=\"?year=".$next_year."&month=".$next_month."&region=".$region."\" title=\"". date_month2string($next_month)." ".$next_year. "\"> >> </a>\n";
echo "</h2>\n\n";
echo "<form method='get' action='index.php?year=" . $year . "&month=".$month ."' class='calendar'><p>\n";
- echo "<select onchange=\"window.location='?year=" . $year . "&month=" .
+ echo "<input type ='hidden' name='year' value='$year' /><input type ='hidden' name='month' value='$month' />\n";
+ echo "<select name='region' onchange=\"window.location='?year=" . $year . "&month=" .
$month . "&region=' + this.options[this.selectedIndex].value\">\n";
$ret = $db->query ("select * from regions");
@@ -408,7 +425,7 @@
echo "<option value=\"all\">Toutes les régions</option>\n";
- while ($row = mysql_fetch_object($ret))
+ while ($row = $db->fetchObject($ret))
{
if ($row->id == $region)
echo
@@ -418,7 +435,7 @@
"<option value=\"" . $row->id . "\">" . $row->name . "</option>\n";
}
- echo "</select></p>";
+ echo "</select> <input type='submit' value='". _("Ok"). "' /></p>";
echo "</form>";
/*
@@ -440,14 +457,14 @@
$prev_year = $year - 1;
echo "<h2 class=\"calendar\">\n";
if (has_event_in_past($db, 1, $year, $region))
- echo " <a href=\"?year=".$prev_year."&region=".$region."\"> << </a>\n";
+ echo " <a href=\"?year=".$prev_year."&region=".$region."\" title=\"". $prev_year. "\"> << </a>\n";
echo " <span id=\"month_name\">".$year."</span>\n";
if (has_event_in_future($db, 1, $next_year, $region))
- echo " <a href=\"?year=".$next_year."&region=".$region."\"> >> </a>\n";
+ echo " <a href=\"?year=".$next_year."&region=".$region."\" title=\"". $next_year. "\"> >> </a>\n";
- echo "<form>";
-
- echo "<select onchange=\"window.location='?year=" . $year .
+ echo "<form class='calendar'><p>";
+ echo "<input type ='hidden' name='year' value='$year' />\n";
+ echo "<select name='region' onchange=\"window.location='?year=" . $year .
"&region=' + this.options[this.selectedIndex].value\">\n";
$ret = $db->query ("select * from regions");
@@ -460,7 +477,7 @@
echo "<option value=\"all\">Toutes les régions</option>\n";
- while ($row = mysql_fetch_object($ret))
+ while ($row = $db->fetchObject($ret))
{
if ($row->id == $region)
echo
@@ -470,7 +487,7 @@
"<option value=\"" . $row->id . "\">" . $row->name . "</option>\n";
}
- echo "</select>";
+ echo "</select> <input type='submit' value='". _("Ok"). "' /></p>";
echo "</form>";
echo "</h2>\n\n";
@@ -507,7 +524,7 @@
return FALSE;
}
- return mysql_fetch_object($result);
+ return $db->fetchObject($result);
}
function region_find ($db, $id)
@@ -517,7 +534,7 @@
if ($ret == FALSE)
return "Région inconnue";
- $row = mysql_fetch_object ($ret);
+ $row = $db->fetchObject ($ret);
return $row->name;
}
@@ -534,8 +551,8 @@
echo "<select name=\"" . $name . "\">\n";
- while ($row = mysql_fetch_object($ret))
- {
+ while ($row = $db->fetchObject($ret))
+ {
if ($row->id == $current)
{
echo " <option value=\"" . $row->id . "\" selected=\"selected\">" . $row->name . "</option>\n";
@@ -544,7 +561,7 @@
{
echo " <option value=\"" . $row->id . "\">" . $row->name . "</option>\n";
}
- }
+ }
echo "</select>";
}
@@ -576,7 +593,7 @@
$start_day = onlyday_timestamp2humanreadable($start);
if ($start_day == onlyday_timestamp2humanreadable($end)) {
- $date = "<p>Le " . $start_day . ", de "
+ $date = "<p>Le " . $start_day . ", de "
. onlyhour_timestamp2humanreadable($start) . " à "
. onlyhour_timestamp2humanreadable($end) . ".</p>\n";
} else {
@@ -599,17 +616,17 @@
$result .= "<p>Évènement à portée <b>" . ($locality == 1 ? "nationale" : "locale") . "</b></p>";
if ($tags != "")
- {
- $tags = split(" ", $tags);
- $result .= "<p>Tags: ";
- for ($i = 0; $i < count($tags); $i++)
+ {
+ $tags = split(" ", $tags);
+ $result .= "<p>Tags: ";
+ for ($i = 0; $i < count($tags); $i++)
{
$result .= "<a href=\"listevents.php?tag=" . $tags[$i] . "\">" . $tags[$i] . "</a>";
if ($i != count($tags) - 1)
$result .= ", ";
}
- $result .= "</p>";
- }
+ $result .= "</p>";
+ }
return $result;
}
@@ -715,7 +732,7 @@
/* Function to safely get identifiers from forms */
function get_safe_integer($name, $default)
{
- if (ereg("^[0-9]+$", $_GET[$name])) { // match only positive integers
+ if (isset($_GET[$name]) && ereg("^[0-9]+$", $_GET[$name])) { // match only positive integers
return $_GET[$name];
} else {
return $default;
Modified: branches/dui/ical.php
==============================================================================
--- branches/dui/ical.php (original)
+++ branches/dui/ical.php Mon Apr 9 12:35:41 2007
@@ -17,6 +17,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
+ *
+ * $Id: top.inc.php,v 1.51 2007/03/10 16:22:12 ldayot Exp $
*/
include("bd.inc.php");
@@ -107,7 +109,7 @@
else
ical_start_calendar($region, $tag);
-while ($event = mysql_fetch_object($list))
+while ($event = $db->fetchObject($list))
{
ical_display_event ($event->id, utf8_encode(strip_tags($event->city)),
date_mysql2timestamp ($event->start_time),
Modified: branches/dui/icallist.php
==============================================================================
--- branches/dui/icallist.php (original)
+++ branches/dui/icallist.php Mon Apr 9 12:35:41 2007
@@ -18,6 +18,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
+ *
+ * $Id: top.inc.php,v 1.51 2007/03/10 16:22:12 ldayot Exp $
*/
include("bd.inc.php");
@@ -44,7 +46,7 @@
echo " <li><a href=\"" . calendar_absolute_url("ical.php?region=all", "webcal") . "\">Toutes les régions</a></li>\n\n";
-while ($row = mysql_fetch_object($ret))
+while ($row = $db->fetchObject($ret))
{
echo " <li><a href=\"" . calendar_absolute_url("ical.php?region=" . $row->id, "webcal") . "\">" . $row->name . "</a></li>\n";
}
@@ -83,4 +85,4 @@
</li>
</ul>
-<?php put_footer(); ?>
\ No newline at end of file
+<?php put_footer(); ?>
Modified: branches/dui/index.php
==============================================================================
--- branches/dui/index.php (original)
+++ branches/dui/index.php Mon Apr 9 12:35:41 2007
@@ -18,6 +18,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
+ *
+ * $Id: top.inc.php,v 1.51 2007/03/10 16:22:12 ldayot Exp $
*/
/**@file
@@ -32,7 +34,7 @@
$db = new db();
-if ($_GET['region'] &&
+if (isset($_GET['region']) &&
($_GET['region'] == "all" ||
ereg("^[0-9][0-9]?", $_GET['region'])))
{
@@ -46,7 +48,7 @@
/*
* Compute the month to be displayed in the agenda
*/
-if($_GET['year'] && ! $_GET['month'])
+if(isset($_GET['year']) && ! isset($_GET['month']) )
{
if (ereg("^[0-9]{4}", $_GET['year']))
$year = $_GET['year'];
@@ -55,7 +57,7 @@
year_calendar ($db, $year, $region);
}
-else if($_GET['month'] && $_GET['year'])
+else if (isset($_GET['month']) && isset($_GET['year']))
{
if (ereg("^[0-9]{1,2}", $_GET['month']) // month is N or NN
&& ereg("^[0-9]{4}", $_GET['year']) // year is NNNN
@@ -76,4 +78,4 @@
}
put_footer();
-?>
\ No newline at end of file
+?>
Modified: branches/dui/infos.php
==============================================================================
--- branches/dui/infos.php (original)
+++ branches/dui/infos.php Mon Apr 9 12:35:41 2007
@@ -18,6 +18,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
+ *
+ * $Id: top.inc.php,v 1.51 2007/03/10 16:22:12 ldayot Exp $
*/
include("bd.inc.php");
Modified: branches/dui/listevents.php
==============================================================================
--- branches/dui/listevents.php (original)
+++ branches/dui/listevents.php Mon Apr 9 12:35:41 2007
@@ -18,6 +18,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
+ *
+ * $Id: top.inc.php,v 1.51 2007/03/10 16:22:12 ldayot Exp $
*/
include("bd.inc.php");
@@ -25,8 +27,9 @@
function list_events($events)
{
+ global $db;
echo " <ul>\n";
- while($event = mysql_fetch_object($events))
+ while($event = $db->fetchObject($events))
{
echo "<li>";
echo "<a href=\"showevent.php?id=" . $event->id . "\">";
@@ -69,15 +72,15 @@
exit;
}
-if (mysql_num_rows($events))
+if ($db->numRows($events))
{
$hasevent = TRUE;
echo "<p>";
echo "<b>Prochainement</b>";
- if (mysql_num_rows($events) == 1)
+ if ($db->numRows($events) == 1)
echo ", un évènement :";
else
- echo ", " . mysql_num_rows($events) . " évènements :";
+ echo ", " . $db->numRows($events) . " évènements :";
echo "</p>";
list_events($events);
}
@@ -92,15 +95,15 @@
exit;
}
-if (mysql_num_rows($events))
+if ($db->numRows($events))
{
$hasevent = TRUE;
echo "<p>";
echo "<b>Dans le passé</b>";
- if (mysql_num_rows($events) == 1)
+ if ($db->numRows($events) == 1)
echo ", un évènement :";
else
- echo ", " . mysql_num_rows($events) . " évènements :";
+ echo ", " . $db->numRows($events) . " évènements :";
echo "</p>";
list_events($events);
}
@@ -110,4 +113,3 @@
put_footer();
?>
-
Modified: branches/dui/map.php
==============================================================================
--- branches/dui/map.php (original)
+++ branches/dui/map.php Mon Apr 9 12:35:41 2007
@@ -18,6 +18,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
+ *
+ * $Id: top.inc.php,v 1.51 2007/03/10 16:22:12 ldayot Exp $
*/
include("bd.inc.php");
@@ -38,7 +40,7 @@
if ($regions == FALSE)
return FALSE;
- while ($region = mysql_fetch_object ($regions))
+ while ($region = $db->fetchObject ($regions))
{
echo "<dl class=\"region-map-event\" style=\"display: none;\" id=\"region-" . $region->id . "\">";
@@ -58,7 +60,7 @@
echo "<dd>";
- if (mysql_num_rows ($events) == 0)
+ if ($db->numRows ($events) == 0)
{
echo "Pas d'évènements prévus ce mois.<br/>";
}
@@ -66,7 +68,7 @@
{
echo "Évènements des 30 prochains jours: <ul>\n";
- while ($event = mysql_fetch_object ($events))
+ while ($event = $db->fetchObject ($events))
{
$start_time_str = strftime ("%A %d %B", date_mysql2timestamp ($event->start_time));
$end_time_str = strftime ("%A %d %B", date_mysql2timestamp ($event->end_time));
@@ -83,7 +85,7 @@
$lugs = $db->query ("select distinct region, name, url from lugs where region = '" .
$region->id . "'");
- if (mysql_num_rows ($lugs) == 0)
+ if ($db->numRows ($lugs) == 0)
{
echo "Pas de groupes d'utilisateur.<br/>";
}
@@ -93,15 +95,15 @@
echo " <ul>";
- while ($lug = mysql_fetch_object ($lugs))
+ while ($lug = $db->fetchObject ($lugs))
{
echo "<li><a href=\"" . $lug->url . "\">" . $lug->name . "</a> (";
$dpts = $db->query ("select distinct department from lugs where name = '" . $lug->name . "'");
$i = 1;
- while ($dpt = mysql_fetch_object ($dpts))
+ while ($dpt = $db->fetchObject ($dpts))
{
echo $dpt->department;
- if ($i != mysql_num_rows($dpts))
+ if ($i != $db->numRows($dpts))
echo ", ";
$i++;
}
@@ -115,6 +117,27 @@
}
}
+function generate_region_map($db, $mapName)
+{
+ // Begin html map
+ $return = "<map name=\"{$mapName}\">\n";
+
+ // get regions from database
+ if (! $regions = $db->query ("SELECT * FROM regions WHERE mapzone IS NOT NULL ORDER BY name") )
+ return FALSE;
+
+ // for each region
+ while ($region = $db->fetchObject ($regions))
+ {
+ $return .= "<area shape=\"poly\" coords=\"{$region->mapzone}\" title=\"{$region->name}\" href=\"#\" onClick=\"document.getElementById('box').innerHTML = document.getElementById('region-{$region->id}').innerHTML\" />";
+ } // end while
+ // end html map
+ $return .= "</map>\n";
+
+ return $return;
+} // end function generate_region_map
+
+
$db = new db();
calendar_setlocale();
@@ -125,43 +148,13 @@
generate_event_description ($db);
-?>
+$mapName="map";
+
+echo "<p><img id=\"region-map\" src=\"regionimage.php?img=adl-regions.png\" width=\"519\" height=\"516\" usemap=\"#{$mapName}\" alt=\"". _("Carte de France"). "\" />";
-<p>
- <img id="region-map" src="adl-regions.png" width="519" height="516" usemap="#map" />
- <map name="map">
- <area shape="poly"
- coords="86,202,90,202,94,199,99,197,99,191,106,191,119,188,125,183,135,186,141,177,144,170,141,158,145,151,143,144,136,144,132,146,126,143,124,136,117,136,114,131,106,133,100,136,96,132,81,140,68,119,50,120,46,127,38,125,36,129,32,123,23,127,16,125,4,128,1,142,14,143,13,147,4,146,7,152,14,151,18,160,1,161,15,175,27,173,35,179,47,182,59,194,75,193,69,197,88,202"
- alt="Bretagne" href="#" onClick="document.getElementById('box').innerHTML = document.getElementById('region-6').innerHTML" />
- <area shape="poly"
- coords="145,145,145,155,142,160,144,172,135,186,124,182,114,190,99,191,95,201,83,209,88,215,97,211,111,216,97,215,94,221,102,228,96,240,106,254,105,259,120,271,134,275,138,271,154,273,157,270,154,265,156,259,153,251,153,245,147,235,156,235,163,229,176,230,184,226,192,199,194,203,202,198,213,186,217,183,214,176,219,169,201,159,198,148,182,155,177,142,172,148,167,146,158,150,145,145"
- alt="Pays de la Loire" href="#" onClick="document.getElementById('box').innerHTML = document.getElementById('region-18').innerHTML" />
- <area shape="poly"
- coords="115,72,118,79,117,91,126,103,126,131,131,136,126,137,127,144,131,146,140,143,157,150,167,147,173,148,175,142,180,147,184,153,186,155,191,150,197,149,200,152,200,160,206,162,214,165,216,165,222,150,218,137,209,125,202,126,204,106,198,93,175,101,154,94,144,95,138,84,141,78,140,75,128,77,123,76"
- alt="Basse Normandie" href="#" onClick="document.getElementById('box').innerHTML = document.getElementById('region-4').innerHTML" />
-<area shape="poly" coords="241,59,228,66,203,73,194,78,191,89,197,91,202,92,199,100,203,125,210,127,218,139,226,132,237,134,244,126,244,116,249,115,252,107,254,94,252,78,255,67,240,59" alt="Haute Normandie" href="#" onClick="document.getElementById('box').innerHTML = document.getElementById('region-11').innerHTML" />
-<area shape="poly" coords="247,49,242,57,253,68,256,77,253,82,255,91,254,99,255,105,252,108,259,111,269,107,269,111,277,110,285,116,294,114,297,112,319,130,328,122,323,118,324,112,329,112,329,109,326,106,326,102,341,98,339,83,347,79,346,65,331,59,322,60,313,62,301,59,292,58,291,54,282,56,282,48,272,51,268,50,262,43,250,41,248,45,252,51,249,50,247,49" alt="Picardie" href="#" onClick="document.getElementById('box').innerHTML = document.getElementById('region-19').innerHTML" />
-<area shape="poly" coords="250,41,250,6,253,8,280,0,285,1,287,6,288,14,296,21,304,17,311,17,313,32,325,35,328,45,344,43,345,53,347,58,347,63,345,64,329,60,308,63,291,57,280,53,283,50,273,49,266,48,260,41,250,40,251,40,251,39" alt="Nord Pas de Calais" href="#" onClick="document.getElementById('box').innerHTML = document.getElementById('region-17').innerHTML" />
-<area shape="poly" coords="348,66,348,79,340,85,341,97,326,103,327,109,330,108,329,113,325,113,323,118,326,122,320,130,317,135,322,146,318,150,317,155,320,161,326,170,333,170,335,178,342,183,348,180,353,183,359,181,364,176,374,180,373,184,379,187,377,196,391,201,392,203,395,200,397,197,407,196,407,190,413,183,406,175,406,164,394,156,393,149,378,143,377,135,373,130,376,124,379,120,375,116,376,106,381,99,380,88,391,88,390,82,372,71,370,64,372,56,366,56,367,62,360,66,348,66" alt="Champagne Ardenne" href="#" onClick="document.getElementById('box').innerHTML = document.getElementById('region-8').innerHTML" />
-<area shape="poly" coords="251,109,248,116,243,117,244,124,248,131,249,144,255,149,259,155,262,162,270,160,272,163,280,163,282,168,282,175,290,172,300,170,302,161,307,158,316,156,317,149,322,145,318,136,317,134,320,130,314,127,308,120,301,116,295,112,293,117,283,114,277,109,268,109,262,111,253,109,252,108" alt="Ile de France" href="#" onClick="document.getElementById('box').innerHTML = document.getElementById('region-12').innerHTML" />
-<area shape="poly" coords="392,86,389,89,381,88,378,91,381,102,377,107,375,114,378,121,378,125,375,128,377,137,379,143,395,152,397,160,406,164,406,172,405,174,414,183,421,176,427,181,435,181,439,182,448,183,453,185,455,172,459,163,461,158,458,154,460,150,458,145,463,144,467,139,465,133,467,128,457,126,452,124,455,119,458,112,465,119,476,121,479,115,477,109,470,107,465,111,457,109,452,106,447,108,446,110,431,90,423,89,418,94,412,94,410,89,399,88,398,92,393,86,392,86" alt="Lorraine" href="#" onClick="document.getElementById('box').innerHTML = document.getElementById('region-15').innerHTML" />
-<area shape="poly" coords="501,118,490,136,485,154,480,167,480,178,479,194,480,203,476,208,467,208,461,201,459,194,454,188,454,179,463,158,460,152,462,150,461,145,468,141,464,134,467,129,462,126,460,127,452,123,459,115,467,122,476,123,481,113,502,116" alt="Alsace" href="#" onClick="document.getElementById('box').innerHTML = document.getElementById('region-1').innerHTML" />
-<area shape="poly" coords="424,269,424,264,438,249,439,238,462,217,456,213,455,207,462,203,462,199,458,199,458,192,452,190,453,186,443,182,437,183,428,181,423,177,415,183,410,187,408,189,405,197,399,198,395,200,399,204,397,208,396,208,400,218,398,229,394,237,390,240,395,242,398,245,394,248,397,253,399,261,394,265,397,267,395,273,402,279,407,276,413,280,420,275,423,268" alt="Franche Comté" href="#" onClick="document.getElementById('box').innerHTML = document.getElementById('region-10').innerHTML" />
-<area shape="poly" coords="305,158,301,165,301,171,303,175,307,181,303,186,298,194,294,196,298,203,296,207,299,213,297,218,300,223,301,251,307,257,317,257,324,256,328,255,329,265,334,265,342,272,344,276,339,277,336,280,339,285,354,285,358,277,363,281,369,280,371,284,374,283,378,264,382,267,388,265,394,269,397,268,396,261,397,253,394,248,397,244,395,241,392,241,391,237,397,234,399,224,399,216,395,208,398,204,398,201,393,203,388,202,387,198,376,194,380,186,373,184,371,178,363,176,361,179,352,180,345,181,341,183,335,183,330,169,326,171,325,162,317,156,303,158,305,159" alt="Bourgnogne" href="#" onClick="document.getElementById('box').innerHTML = document.getElementById('region-5').innerHTML" />
-<area shape="poly" coords="336,280,331,284,332,293,335,295,330,298,328,301,332,304,329,308,337,323,342,326,338,331,339,334,347,336,355,331,357,338,362,342,359,346,356,344,357,350,352,355,348,362,342,361,335,369,338,376,343,387,346,394,352,397,358,392,360,396,365,393,368,396,372,394,379,397,382,397,381,394,379,391,381,387,385,388,387,391,385,395,389,396,391,394,392,399,402,401,405,404,411,400,412,394,400,390,400,381,411,384,409,379,408,376,415,374,419,369,431,360,437,361,440,357,434,351,431,349,435,346,442,348,462,341,468,336,470,327,463,321,462,313,454,307,464,297,454,282,456,275,451,271,431,274,434,280,431,286,421,287,420,283,428,277,427,271,420,272,419,279,413,279,408,275,404,279,388,265,379,266,372,284,368,279,357,277,356,285,336,287,336,279" alt="Rhone Alpes" href="#" onClick="document.getElementById('box').innerHTML = document.getElementById('region-22').innerHTML" />
-<area shape="poly" coords="301,251,295,255,286,255,286,264,276,267,271,271,277,278,285,285,285,295,284,301,276,308,282,317,279,334,274,333,270,345,263,355,265,364,267,372,278,371,286,358,295,362,302,373,303,375,318,359,325,369,335,370,347,357,355,353,357,342,353,332,339,337,336,328,341,325,326,308,332,281,341,274,330,265,326,255,321,260,306,258,302,251" alt="Auvergne" href="#" onClick="document.getElementById('box').innerHTML = document.getElementById('region-3').innerHTML" />
-<area shape="poly" coords="230,271,215,278,211,284,213,290,217,297,212,297,211,304,206,308,203,313,211,312,211,319,219,317,228,328,233,327,231,332,229,334,230,339,227,341,231,344,235,346,236,353,243,352,249,357,264,356,266,350,269,339,273,336,273,330,280,333,280,312,279,306,275,307,285,296,283,290,282,279,271,274,272,268,259,270,255,266,251,272,244,269,238,272,228,271,229,271" alt="Limousin" href="#" onClick="document.getElementById('box').innerHTML = document.getElementById('region-14').innerHTML" />
-<area shape="poly" coords="244,125,249,128,249,143,253,149,257,156,262,163,275,162,282,165,279,172,303,170,305,179,301,185,300,191,294,194,295,220,300,222,302,250,295,254,285,254,284,262,269,271,256,270,254,268,231,272,219,259,207,235,194,240,185,225,192,199,196,202,217,184,216,173,219,169,214,166,222,152,219,139,227,132,238,134,244,124,244,125" alt="Centre" href="#" onClick="document.getElementById('box').innerHTML = document.getElementById('region-7').innerHTML" />
-<area shape="poly" coords="148,235,154,245,153,251,156,259,154,266,157,272,153,274,140,270,132,275,131,282,136,288,135,297,128,302,128,309,143,319,148,332,154,329,160,335,161,341,176,344,177,339,187,335,190,325,197,319,207,308,212,301,209,295,217,295,212,290,212,279,228,273,221,262,217,258,207,235,203,240,193,238,190,230,186,228,176,229,160,230,155,235,147,235" alt="Poitou Charentes" href="#" onClick="document.getElementById('box').innerHTML = document.getElementById('region-20').innerHTML" />
-<area shape="poly" coords="131,318,124,365,130,363,133,369,125,371,111,432,97,443,99,446,112,448,113,454,109,459,110,463,120,456,119,464,142,471,145,476,156,475,158,471,173,447,167,433,162,433,160,428,165,423,165,412,174,410,176,414,182,408,198,407,203,408,213,396,210,389,219,388,216,380,237,356,234,346,228,342,230,336,228,333,230,329,219,318,210,319,206,312,202,313,197,322,190,327,188,335,181,341,179,339,176,342,177,345,162,344,159,340,160,336,154,331,149,333,155,353,150,352,144,330,131,318" alt="Aquitaine" href="#" onClick="document.getElementById('box').innerHTML = document.getElementById('region-2').innerHTML" />
-<area shape="poly" coords="236,354,237,359,217,379,217,380,220,389,212,389,215,395,210,402,207,406,201,411,197,409,186,412,178,411,180,415,171,414,169,412,164,414,167,425,160,428,162,432,172,435,174,443,170,456,159,470,160,477,168,486,177,485,184,486,192,483,197,486,203,479,219,482,221,487,229,488,231,492,245,494,248,495,260,490,258,486,251,483,254,477,255,470,257,468,252,463,246,460,245,451,252,444,257,446,265,447,270,444,275,445,284,445,283,432,291,433,297,430,303,428,301,423,310,423,313,418,318,415,313,410,315,403,305,399,302,378,294,363,286,359,279,374,273,373,266,375,264,373,266,365,262,358,252,358,245,356,242,351,235,352" alt="Midi-Pyrénées" href="#" onClick="document.getElementById('box').innerHTML = document.getElementById('region-16').innerHTML" />
-<area shape="poly" coords="305,500,300,494,308,457,319,455,339,440,349,439,352,444,361,436,360,430,369,428,371,418,375,413,373,407,370,394,365,392,363,395,355,392,353,396,345,394,343,386,340,383,335,370,322,370,318,361,301,379,306,398,310,401,317,403,311,409,319,413,292,435,283,434,285,447,269,444,267,448,252,446,244,454,247,460,254,463,259,469,256,474,252,481,253,486,264,483,262,489,248,495,246,501,260,510,270,503,279,510,291,504,304,500,304,499,303,500,302,500" alt="Languedoc Rousillon" href="#" onClick="document.getElementById('box').innerHTML = document.getElementById('region-13').innerHTML" />
-<area shape="poly" coords="370,394,372,407,379,411,367,432,361,432,360,437,351,445,367,445,374,451,382,448,384,439,391,440,393,444,385,451,400,450,401,458,418,462,423,468,432,464,435,468,438,463,457,456,451,451,491,420,489,414,498,400,492,398,487,404,462,390,463,376,471,367,446,345,442,349,438,345,432,348,439,355,439,361,428,361,415,373,408,374,410,382,409,384,403,381,401,390,412,396,410,403,401,403,393,399,389,393,385,397,385,387,379,388,382,398,375,397,373,393,370,394" alt="Paca" href="#" onClick="document.getElementById('box').innerHTML = document.getElementById('region-21').innerHTML" />
-<area shape="poly" coords="518,447,513,442,515,420,511,419,510,439,504,436,490,443,482,444,481,451,474,456,480,460,477,465,479,471,484,474,479,479,476,483,479,486,486,482,484,488,480,492,483,496,490,498,485,502,489,509,494,509,501,515,508,513,509,504,512,496,512,485,518,474,518,472" alt="Corse" href="#" onClick="document.getElementById('box').innerHTML = document.getElementById('region-9').innerHTML" />
-</map>
+echo generate_region_map($db, $mapName);
- </p>
+echo "</p>";
-<?php
put_footer();
-?>
+?>
\ No newline at end of file
Modified: branches/dui/moderate.php
==============================================================================
--- branches/dui/moderate.php (original)
+++ branches/dui/moderate.php Mon Apr 9 12:35:41 2007
@@ -37,7 +37,7 @@
return -1;
}
- $row = mysql_fetch_object ($ret);
+ $row = $db->fetchObject ($ret);
return $row->login;
}
@@ -55,7 +55,7 @@
return -1;
}
- $oldevent = mysql_fetch_object ($ret);
+ $oldevent = $db->fetchObject ($ret);
$sql = "UPDATE events SET " .
"title=" . $db->quote_smart ($title) . ", " .
@@ -119,7 +119,7 @@
return -1;
}
- $row = mysql_fetch_object($ret);
+ $row = $db->fetchObject($ret);
$email = $row->contact;
$title = $row->title;
$link = calendar_absolute_url("showevent.php?id=".$id);
@@ -163,7 +163,7 @@
return -1;
}
- $row = mysql_fetch_object($ret);
+ $row = $db->fetchObject($ret);
$sql = "DELETE FROM events WHERE id=" . $db->quote_smart($id);
@@ -207,12 +207,12 @@
return -1;
}
- if (mysql_num_rows ($ret) != 1)
+ if ($db->numRows ($ret) != 1)
{
return -1;
}
- $row = mysql_fetch_object($ret);
+ $row = $db->fetchObject($ret);
return $row->id;
}
@@ -222,7 +222,7 @@
if (! $session->exists("agenda_libre_id"))
{
- if (! $_POST['__user_identify'])
+ if (! isset($_POST['__user_identify']))
{
put_header("Modération");
@@ -270,7 +270,7 @@
/*
* Edit an event
*/
-if ($_POST['__event_edit'])
+if (isset($_POST['__event_edit']))
{
$event = fetch_event($db, $id);
@@ -298,7 +298,7 @@
/*
* Save modifications made to an event
*/
-else if ($_POST['__event_save'])
+else if (isset($_POST['__event_save']))
{
$ret = save_event ($db, $id,
$_POST['__event_title'],
@@ -337,7 +337,7 @@
/*
* Accept an event
*/
-else if ($_POST['__event_accept'])
+else if (isset($_POST['__event_accept']))
{
accept_event ($db, $id, $session->value("agenda_libre_id"));
}
@@ -345,7 +345,7 @@
/*
* Delete an event because it has not relation with free software.
*/
-else if ($_POST['__event_delete_notrelated'])
+else if (isset($_POST['__event_delete_notrelated']))
{
delete_event ($db, $id, $session->value("agenda_libre_id"),
wordwrap("Toutefois, l'évènement proposé n'a pour l'instant pas retenu l'attention des modérateurs. En effet, l'évènement proposé ne concerne pas le Logiciel Libre, ou bien le lien avec le Logiciel Libre n'est pas évident dans la formulation actuelle, ou alors il s'agit d'un évènement ou d'une formation payante et coûteuse. Si l'évènement concerne vraiment le Logiciel Libre et qu'il ne s'agit pas d'une formation payante, n'hésitez pas à le soumettre à nouveau avec une description plus claire."));
@@ -355,13 +355,13 @@
* Delete an event because its description doesn't have enough
* informations.
*/
-else if ($_POST['__event_delete_notenough'])
+else if (isset($_POST['__event_delete_notenough']))
{
delete_event ($db, $id, $session->value("agenda_libre_id"),
wordwrap("Votre évènement a tout à fait sa place dans l'Agenda du Libre, mais les modérateurs trouvent que la description de celui-ci n'est pas tout à fait assez complète pour être validée.\n\nLa description doit être compréhensible par un nouveau venu dans le monde du Libre, et doit donc préciser le principe de la rencontre, le public visé, la rôle du ou des Logiciels Libres qui seront exposés, etc. Même si il s'agit d'une rencontre régulière, n'hésitez pas à répéter à chaque fois ces informations, elles sont importantes.\n\nNous vous invitons donc vivement à soumettre à nouveau cet évènement avec une description plus complète."));
}
-else if ($_POST['__event_delete_double'])
+else if (isset($_POST['__event_delete_double']))
{
delete_event ($db, $id, $session->value("agenda_libre_id"),
wordwrap("L'évènement que vous proposez est déjà présent dans l'Agenda du Libre.\n\n"));
@@ -383,7 +383,7 @@
echo "<hr/>";
-while ($row = mysql_fetch_object($ret))
+while ($row = $db->fetchObject($ret))
{
echo "<a name=\"" . $row->id . "\"></a>\n";
echo "<form action=\"?id=" . $row->id . "\" method=\"post\">\n";
Modified: branches/dui/moderateinfos.php
==============================================================================
--- branches/dui/moderateinfos.php (original)
+++ branches/dui/moderateinfos.php Mon Apr 9 12:35:41 2007
@@ -18,6 +18,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
+ *
+ * $Id: top.inc.php,v 1.51 2007/03/10 16:22:12 ldayot Exp $
*/
include("bd.inc.php");
Modified: branches/dui/passgen.php
==============================================================================
--- branches/dui/passgen.php (original)
+++ branches/dui/passgen.php Mon Apr 9 12:35:41 2007
@@ -18,6 +18,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
+ *
+ * $Id: top.inc.php,v 1.51 2007/03/10 16:22:12 ldayot Exp $
*/
include("bd.inc.php");
@@ -31,7 +33,7 @@
{
$result = $db->query ("select(md5('" . $_POST['__password'] . "'))");
- $row = mysql_fetch_row($result);
+ $row = $db->fetchRow($result);
echo "Votre mot de passe hashé est : " . $row[0] . "<br/>";
@@ -51,5 +53,3 @@
put_footer();
?>
-
-
Added: branches/dui/regionimage.php
==============================================================================
--- (empty file)
+++ branches/dui/regionimage.php Mon Apr 9 12:35:41 2007
@@ -0,0 +1,90 @@
+<?php
+
+/* Copyright 2004-2007
+ * - Mélanie Bats <melanie POINT bats CHEZ utbm POINT fr>
+ * - Thomas Petazzoni <thomas POINT petazzoni CHEZ enix POINT org>
+ * - Loic Dayot <ldayot CHEZ ouvaton POINT org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * $Id: top.inc.php,v 1.51 2007/03/10 16:22:12 ldayot Exp $
+ */
+
+include("bd.inc.php");
+include("bd-private.inc.php");
+include("funcs.inc.php");
+
+function generate_event_count($db, $img)
+{
+ $black = ImageColorAllocate ($img, 0, 0, 0);
+ $font_size = 5;
+
+ $start = mktime();
+ $end = mktime() + (30 * 24 * 60 * 60); // one month
+
+ if (! $regions = $db->query ("SELECT * FROM regions WHERE mapzone IS NOT NULL") )
+ return FALSE;
+
+ while ($region = $db->fetchObject ($regions))
+ {
+ // get events for next month in this region
+ $events = $db->query ("SELECT COUNT(*) as count FROM events WHERE " .
+ "(start_time <= '" . date_timestamp2mysql($end) . "') AND " .
+ "(end_time >= '" . date_timestamp2mysql($start) . "') AND " .
+ "((region=" . $region->id . ")) AND (moderated=1)");
+ if ($record = $db->fetchObject($events)) // there if events in this region
+ if ($record->count > 0) {
+
+ // find middle of zone
+ $mapzone = explode(",", $region->mapzone);
+ $n=0; // count of coords
+ $xmax=$ymax=-1;
+ $xmin=$ymin=2000; // sum of coords
+ while (isset($mapzone[$n])) {
+ $x=$mapzone[$n++];
+ $y=$mapzone[$n++];
+ if ($x<$xmin) $xmin=$x;
+ if ($x>$xmax) $xmax=$x;
+ if ($y<$ymin) $ymin=$y;
+ if ($y>$ymax) $ymax=$y;
+ } // end while isset
+ $width = imagefontwidth($font_size);
+ $x = round($xmin+($xmax-$xmin)/2-($width/2*strlen("{$record->count}")));
+ $y = round($ymin+($ymax-$ymin)/2-(imagefontheight($font_size)/2));
+ // Add count on image
+ imagestring($img, $font_size, $x, $y, "{$record->count}", $black);
+ }
+
+ } // end while
+
+}
+
+$db = new db();
+
+//calendar_setlocale();
+//echo generate_region_map($db, $mapName);
+
+$pic = imagecreatefrompng($_REQUEST["img"]) or die (_("Cannot initialize new GD image stream"));
+$ctr = imagecolortransparent($pic, imagecolorat ($pic, 1, 1));
+
+generate_event_count($db, $pic);
+
+header("Content-Type: image/png");
+ImagePng($pic);
+
+ImageDestroy($pic);
+
+?>
\ No newline at end of file
Modified: branches/dui/rss.php
==============================================================================
--- branches/dui/rss.php (original)
+++ branches/dui/rss.php Mon Apr 9 12:35:41 2007
@@ -18,6 +18,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
+ *
+ * $Id: top.inc.php,v 1.51 2007/03/10 16:22:12 ldayot Exp $
*/
include("bd.inc.php");
@@ -100,7 +102,7 @@
exit;
}
-while ($event = mysql_fetch_object($list))
+while ($event = $db->fetchObject($list))
{
echo " <rdf:li rdf:resource=\"" . calendar_absolute_url("showevent.php?id=" . $event->id) . "\"/>\n";
}
@@ -117,7 +119,7 @@
exit;
}
-while ($event = mysql_fetch_object($list))
+while ($event = $db->fetchObject($list))
{
$start_timestamp = date_mysql2timestamp($event->start_time);
$start_day = onlyday_timestamp2humanreadable($start_timestamp);
@@ -165,6 +167,3 @@
}
echo "</rdf:RDF>\n";
-
-
-
Modified: branches/dui/rsslist.php
==============================================================================
--- branches/dui/rsslist.php (original)
+++ branches/dui/rsslist.php Mon Apr 9 12:35:41 2007
@@ -18,6 +18,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
+ *
+ * $Id: top.inc.php,v 1.51 2007/03/10 16:22:12 ldayot Exp $
*/
include("bd.inc.php");
@@ -44,7 +46,7 @@
echo " <li><a href=\"rss.php?region=all\">Toutes les régions</a></li>\n\n";
-while ($row = mysql_fetch_object($ret))
+while ($row = $db->fetchObject($ret))
{
echo " <li><a href=\"rss.php?region=" . $row->id . "\">" . $row->name . "</a></li>\n";
}
@@ -71,4 +73,4 @@
</li>
</ul>
-<?php put_footer(); ?>
\ No newline at end of file
+<?php put_footer(); ?>
Modified: branches/dui/schema.sql
==============================================================================
--- branches/dui/schema.sql (original)
+++ branches/dui/schema.sql Mon Apr 9 12:35:41 2007
@@ -18,36 +18,37 @@
CREATE TABLE `regions` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL default '',
+ `mapzone` text,
PRIMARY KEY (`id`)
) TYPE=MyISAM;
-INSERT INTO `regions` VALUES (1,'Alsace');
-INSERT INTO `regions` VALUES (2,'Aquitaine');
-INSERT INTO `regions` VALUES (3,'Auvergne');
-INSERT INTO `regions` VALUES (4,'Basse-Normandie');
-INSERT INTO `regions` VALUES (5,'Bourgogne');
-INSERT INTO `regions` VALUES (6,'Bretagne');
-INSERT INTO `regions` VALUES (7,'Centre');
-INSERT INTO `regions` VALUES (8,'Champagne-Ardenne');
-INSERT INTO `regions` VALUES (9,'Corse');
-INSERT INTO `regions` VALUES (10,'Franche-Comté');
-INSERT INTO `regions` VALUES (11,'Haute-Normandie');
-INSERT INTO `regions` VALUES (12,'Île-de-France');
-INSERT INTO `regions` VALUES (13,'Languedoc-Roussillon');
-INSERT INTO `regions` VALUES (14,'Limousin');
-INSERT INTO `regions` VALUES (15,'Lorraine');
-INSERT INTO `regions` VALUES (16,'Midi-Pyrénées');
-INSERT INTO `regions` VALUES (17,'Nord-Pas-de-Calais');
-INSERT INTO `regions` VALUES (18,'Pays de la Loire');
-INSERT INTO `regions` VALUES (19,'Picardie');
-INSERT INTO `regions` VALUES (20,'Poitou-Charentes');
-INSERT INTO `regions` VALUES (21,'Provence-Alpes-Côte d\'Azur');
-INSERT INTO `regions` VALUES (22,'Rhône-Alpes');
-INSERT INTO `regions` VALUES (23,'Guadeloupe');
-INSERT INTO `regions` VALUES (24,'Guyane');
-INSERT INTO `regions` VALUES (25,'Martinique');
-INSERT INTO `regions` VALUES (26,'Réunion');
-INSERT INTO `regions` VALUES (27,'Autre pays');
+INSERT INTO `regions` VALUES (1, 'Alsace', '501,118,490,136,485,154,480,167,480,178,479,194,480,203,476,208,467,208,461,201,459,194,454,188,454,179,463,158,460,152,462,150,461,145,468,141,464,134,467,129,462,126,460,127,452,123,459,115,467,122,476,123,481,113,502,116');
+INSERT INTO `regions` VALUES (2, 'Aquitaine', '131,318,124,365,130,363,133,369,125,371,111,432,97,443,99,446,112,448,113,454,109,459,110,463,120,456,119,464,142,471,145,476,156,475,158,471,173,447,167,433,162,433,160,428,165,423,165,412,174,410,176,414,182,408,198,407,203,408,213,396,210,389,219,388,216,380,237,356,234,346,228,342,230,336,228,333,230,329,219,318,210,319,206,312,202,313,197,322,190,327,188,335,181,341,179,339,176,342,177,345,162,344,159,340,160,336,154,331,149,333,155,353,150,352,144,330,131,318');
+INSERT INTO `regions` VALUES (3, 'Auvergne', '301,251,295,255,286,255,286,264,276,267,271,271,277,278,285,285,285,295,284,301,276,308,282,317,279,334,274,333,270,345,263,355,265,364,267,372,278,371,286,358,295,362,302,373,303,375,318,359,325,369,335,370,347,357,355,353,357,342,353,332,339,337,336,328,341,325,326,308,332,281,341,274,330,265,326,255,321,260,306,258,302,251');
+INSERT INTO `regions` VALUES (4, 'Basse-Normandie', '115,72,118,79,117,91,126,103,126,131,131,136,126,137,127,144,131,146,140,143,157,150,167,147,173,148,175,142,180,147,184,153,186,155,191,150,197,149,200,152,200,160,206,162,214,165,216,165,222,150,218,137,209,125,202,126,204,106,198,93,175,101,154,94,144,95,138,84,141,78,140,75,128,77,123,76');
+INSERT INTO `regions` VALUES (5, 'Bourgogne', '305,158,301,165,301,171,303,175,307,181,303,186,298,194,294,196,298,203,296,207,299,213,297,218,300,223,301,251,307,257,317,257,324,256,328,255,329,265,334,265,342,272,344,276,339,277,336,280,339,285,354,285,358,277,363,281,369,280,371,284,374,283,378,264,382,267,388,265,394,269,397,268,396,261,397,253,394,248,397,244,395,241,392,241,391,237,397,234,399,224,399,216,395,208,398,204,398,201,393,203,388,202,387,198,376,194,380,186,373,184,371,178,363,176,361,179,352,180,345,181,341,183,335,183,330,169,326,171,325,162,317,156,303,158,305,159');
+INSERT INTO `regions` VALUES (6, 'Bretagne', '86,202,90,202,94,199,99,197,99,191,106,191,119,188,125,183,135,186,141,177,144,170,141,158,145,151,143,144,136,144,132,146,126,143,124,136,117,136,114,131,106,133,100,136,96,132,81,140,68,119,50,120,46,127,38,125,36,129,32,123,23,127,16,125,4,128,1,142,14,143,13,147,4,146,7,152,14,151,18,160,1,161,15,175,27,173,35,179,47,182,59,194,75,193,69,197,88,202');
+INSERT INTO `regions` VALUES (7, 'Centre', '244,125,249,128,249,143,253,149,257,156,262,163,275,162,282,165,279,172,303,170,305,179,301,185,300,191,294,194,295,220,300,222,302,250,295,254,285,254,284,262,269,271,256,270,254,268,231,272,219,259,207,235,194,240,185,225,192,199,196,202,217,184,216,173,219,169,214,166,222,152,219,139,227,132,238,134,244,124,244,125');
+INSERT INTO `regions` VALUES (8, 'Champagne-Ardenne', '348,66,348,79,340,85,341,97,326,103,327,109,330,108,329,113,325,113,323,118,326,122,320,130,317,135,322,146,318,150,317,155,320,161,326,170,333,170,335,178,342,183,348,180,353,183,359,181,364,176,374,180,373,184,379,187,377,196,391,201,392,203,395,200,397,197,407,196,407,190,413,183,406,175,406,164,394,156,393,149,378,143,377,135,373,130,376,124,379,120,375,116,376,106,381,99,380,88,391,88,390,82,372,71,370,64,372,56,366,56,367,62,360,66,348,66');
+INSERT INTO `regions` VALUES (9, 'Corse', '518,447,513,442,515,420,511,419,510,439,504,436,490,443,482,444,481,451,474,456,480,460,477,465,479,471,484,474,479,479,476,483,479,486,486,482,484,488,480,492,483,496,490,498,485,502,489,509,494,509,501,515,508,513,509,504,512,496,512,485,518,474,518,472');
+INSERT INTO `regions` VALUES (10, 'Franche-Comté', '424,269,424,264,438,249,439,238,462,217,456,213,455,207,462,203,462,199,458,199,458,192,452,190,453,186,443,182,437,183,428,181,423,177,415,183,410,187,408,189,405,197,399,198,395,200,399,204,397,208,396,208,400,218,398,229,394,237,390,240,395,242,398,245,394,248,397,253,399,261,394,265,397,267,395,273,402,279,407,276,413,280,420,275,423,268');
+INSERT INTO `regions` VALUES (11, 'Haute-Normandie', '241,59,228,66,203,73,194,78,191,89,197,91,202,92,199,100,203,125,210,127,218,139,226,132,237,134,244,126,244,116,249,115,252,107,254,94,252,78,255,67,240,59');
+INSERT INTO `regions` VALUES (12, 'Île-de-France', '251,109,248,116,243,117,244,124,248,131,249,144,255,149,259,155,262,162,270,160,272,163,280,163,282,168,282,175,290,172,300,170,302,161,307,158,316,156,317,149,322,145,318,136,317,134,320,130,314,127,308,120,301,116,295,112,293,117,283,114,277,109,268,109,262,111,253,109,252,108');
+INSERT INTO `regions` VALUES (13, 'Languedoc-Roussillon', '305,500,300,494,308,457,319,455,339,440,349,439,352,444,361,436,360,430,369,428,371,418,375,413,373,407,370,394,365,392,363,395,355,392,353,396,345,394,343,386,340,383,335,370,322,370,318,361,301,379,306,398,310,401,317,403,311,409,319,413,292,435,283,434,285,447,269,444,267,448,252,446,244,454,247,460,254,463,259,469,256,474,252,481,253,486,264,483,262,489,248,495,246,501,260,510,270,503,279,510,291,504,304,500,304,499,303,500,302,500');
+INSERT INTO `regions` VALUES (14, 'Limousin', '230,271,215,278,211,284,213,290,217,297,212,297,211,304,206,308,203,313,211,312,211,319,219,317,228,328,233,327,231,332,229,334,230,339,227,341,231,344,235,346,236,353,243,352,249,357,264,356,266,350,269,339,273,336,273,330,280,333,280,312,279,306,275,307,285,296,283,290,282,279,271,274,272,268,259,270,255,266,251,272,244,269,238,272,228,271,229,271');
+INSERT INTO `regions` VALUES (15, 'Lorraine', '392,86,389,89,381,88,378,91,381,102,377,107,375,114,378,121,378,125,375,128,377,137,379,143,395,152,397,160,406,164,406,172,405,174,414,183,421,176,427,181,435,181,439,182,448,183,453,185,455,172,459,163,461,158,458,154,460,150,458,145,463,144,467,139,465,133,467,128,457,126,452,124,455,119,458,112,465,119,476,121,479,115,477,109,470,107,465,111,457,109,452,106,447,108,446,110,431,90,423,89,418,94,412,94,410,89,399,88,398,92,393,86,392,86');
+INSERT INTO `regions` VALUES (16, 'Midi-Pyrénées', '236,354,237,359,217,379,217,380,220,389,212,389,215,395,210,402,207,406,201,411,197,409,186,412,178,411,180,415,171,414,169,412,164,414,167,425,160,428,162,432,172,435,174,443,170,456,159,470,160,477,168,486,177,485,184,486,192,483,197,486,203,479,219,482,221,487,229,488,231,492,245,494,248,495,260,490,258,486,251,483,254,477,255,470,257,468,252,463,246,460,245,451,252,444,257,446,265,447,270,444,275,445,284,445,283,432,291,433,297,430,303,428,301,423,310,423,313,418,318,415,313,410,315,403,305,399,302,378,294,363,286,359,279,374,273,373,266,375,264,373,266,365,262,358,252,358,245,356,242,351,235,352');
+INSERT INTO `regions` VALUES (17, 'Nord-Pas-de-Calais', '250,41,250,6,253,8,280,0,285,1,287,6,288,14,296,21,304,17,311,17,313,32,325,35,328,45,344,43,345,53,347,58,347,63,345,64,329,60,308,63,291,57,280,53,283,50,273,49,266,48,260,41,250,40,251,40,251,39');
+INSERT INTO `regions` VALUES (18, 'Pays de la Loire', '145,145,145,155,142,160,144,172,135,186,124,182,114,190,99,191,95,201,83,209,88,215,97,211,111,216,97,215,94,221,102,228,96,240,106,254,105,259,120,271,134,275,138,271,154,273,157,270,154,265,156,259,153,251,153,245,147,235,156,235,163,229,176,230,184,226,192,199,194,203,202,198,213,186,217,183,214,176,219,169,201,159,198,148,182,155,177,142,172,148,167,146,158,150,145,145');
+INSERT INTO `regions` VALUES (19, 'Picardie', '247,49,242,57,253,68,256,77,253,82,255,91,254,99,255,105,252,108,259,111,269,107,269,111,277,110,285,116,294,114,297,112,319,130,328,122,323,118,324,112,329,112,329,109,326,106,326,102,341,98,339,83,347,79,346,65,331,59,322,60,313,62,301,59,292,58,291,54,282,56,282,48,272,51,268,50,262,43,250,41,248,45,252,51,249,50,247,49');
+INSERT INTO `regions` VALUES (20, 'Poitou-Charentes', '148,235,154,245,153,251,156,259,154,266,157,272,153,274,140,270,132,275,131,282,136,288,135,297,128,302,128,309,143,319,148,332,154,329,160,335,161,341,176,344,177,339,187,335,190,325,197,319,207,308,212,301,209,295,217,295,212,290,212,279,228,273,221,262,217,258,207,235,203,240,193,238,190,230,186,228,176,229,160,230,155,235,147,235');
+INSERT INTO `regions` VALUES (21, 'Provence-Alpes-Côte d''Azur', '370,394,372,407,379,411,367,432,361,432,360,437,351,445,367,445,374,451,382,448,384,439,391,440,393,444,385,451,400,450,401,458,418,462,423,468,432,464,435,468,438,463,457,456,451,451,491,420,489,414,498,400,492,398,487,404,462,390,463,376,471,367,446,345,442,349,438,345,432,348,439,355,439,361,428,361,415,373,408,374,410,382,409,384,403,381,401,390,412,396,410,403,401,403,393,399,389,393,385,397,385,387,379,388,382,398,375,397,373,393,370,394');
+INSERT INTO `regions` VALUES (22, 'Rhône-Alpes', '336,280,331,284,332,293,335,295,330,298,328,301,332,304,329,308,337,323,342,326,338,331,339,334,347,336,355,331,357,338,362,342,359,346,356,344,357,350,352,355,348,362,342,361,335,369,338,376,343,387,346,394,352,397,358,392,360,396,365,393,368,396,372,394,379,397,382,397,381,394,379,391,381,387,385,388,387,391,385,395,389,396,391,394,392,399,402,401,405,404,411,400,412,394,400,390,400,381,411,384,409,379,408,376,415,374,419,369,431,360,437,361,440,357,434,351,431,349,435,346,442,348,462,341,468,336,470,327,463,321,462,313,454,307,464,297,454,282,456,275,451,271,431,274,434,280,431,286,421,287,420,283,428,277,427,271,420,272,419,279,413,279,408,275,404,279,388,265,379,266,372,284,368,279,357,277,356,285,336,287,336,279');
+INSERT INTO `regions` VALUES (23, 'Guadeloupe', NULL);
+INSERT INTO `regions` VALUES (24, 'Guyane', NULL);
+INSERT INTO `regions` VALUES (25, 'Martinique', NULL);
+INSERT INTO `regions` VALUES (26, 'Réunion', NULL);
+INSERT INTO `regions` VALUES (27, 'Autre pays', NULL);
CREATE TABLE `users` (
`id` int(11) NOT NULL auto_increment,
Modified: branches/dui/session.inc.php
==============================================================================
--- branches/dui/session.inc.php (original)
+++ branches/dui/session.inc.php Mon Apr 9 12:35:41 2007
@@ -18,6 +18,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
+ *
+ * $Id: top.inc.php,v 1.51 2007/03/10 16:22:12 ldayot Exp $
*/
class session
Modified: branches/dui/showevent.php
==============================================================================
--- branches/dui/showevent.php (original)
+++ branches/dui/showevent.php Mon Apr 9 12:35:41 2007
@@ -18,6 +18,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
+ *
+ * $Id: top.inc.php,v 1.51 2007/03/10 16:22:12 ldayot Exp $
*/
include("bd.inc.php");
@@ -36,7 +38,7 @@
$lugs = $db->query ("select distinct region, name, url from lugs where region = '" .
$event->region . "'");
- if (mysql_num_rows ($lugs) == 0)
+ if ($db->numRows ($lugs) == 0)
{
echo "Pas de groupes d'utilisateur.<br/>";
}
@@ -44,7 +46,7 @@
{
echo " <ul>";
- while ($lug = mysql_fetch_object ($lugs))
+ while ($lug = $db->fetchObject ($lugs))
{
echo "<li><a href=\"" . $lug->url . "\">" . $lug->name . "</a> (";
$dpts = $db->query ("select distinct department from lugs where name = '" . $lug->name . "'");
@@ -52,7 +54,7 @@
while ($dpt = mysql_fetch_object ($dpts))
{
echo $dpt->department;
- if ($i != mysql_num_rows($dpts))
+ if ($i != $db->numRows($dpts))
echo ", ";
$i++;
}
@@ -91,4 +93,4 @@
put_footer();
-?>
\ No newline at end of file
+?>
Modified: branches/dui/stats.php
==============================================================================
--- branches/dui/stats.php (original)
+++ branches/dui/stats.php Mon Apr 9 12:35:41 2007
@@ -19,6 +19,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
+ *
+ * $Id: top.inc.php,v 1.51 2007/03/10 16:22:12 ldayot Exp $
*/
include("bd.inc.php");
@@ -58,7 +60,7 @@
echo "<table class=\"stats\">";
$i = 0;
-while ($row = mysql_fetch_row($result))
+while ($row = $db->fetchRow($result))
{
if ($i % 2 == 0)
echo "<tr class=\"odd\">";
@@ -83,7 +85,7 @@
echo "<table class=\"stats\">";
$i = 0;
-while ($row = mysql_fetch_object($result))
+while ($row = $db->fetchObject($result))
{
if ($i % 2 == 0)
echo "<tr class=\"odd\">";
@@ -106,7 +108,7 @@
echo "<table class=\"stats\">";
$i = 0;
-while ($row = mysql_fetch_row($result))
+while ($row = $db->fetchRow($result))
{
ereg("([0-9]{4})-([0-9]{1,2})", $row[0], $elems);
$date = mktime (0, 0, 0, $elems[2]+1, 0, $elems[1]);
@@ -131,4 +133,4 @@
<p>Des statistiques Web générées par Webalizer <a href="stats/">sont disponibles</a>. Elles sont protégées par le login <i>stats</i>, mot de passe <i>Cuntipshaf6</i> pour éviter le <i>spam de referers</i>.</p>
-<?php put_footer(); ?>
\ No newline at end of file
+<?php put_footer(); ?>
Modified: branches/dui/submit-script-doc.php
==============================================================================
--- branches/dui/submit-script-doc.php (original)
+++ branches/dui/submit-script-doc.php Mon Apr 9 12:35:41 2007
@@ -18,6 +18,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
+ *
+ * $Id: top.inc.php,v 1.51 2007/03/10 16:22:12 ldayot Exp $
*/
include("bd.inc.php");
Modified: branches/dui/submit.php
==============================================================================
--- branches/dui/submit.php (original)
+++ branches/dui/submit.php Mon Apr 9 12:35:41 2007
@@ -1,4 +1,3 @@
-
<?php
/* Copyright 2004-2007
@@ -19,6 +18,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
+ *
+ * $Id: top.inc.php,v 1.51 2007/03/10 16:22:12 ldayot Exp $
*/
include("bd.inc.php");
@@ -190,7 +191,7 @@
$end = mktime() + 60;
/* Convert form date to timestamp */
-if ($_POST['__event_start_day'])
+if (isset($_POST['__event_start_day']))
{
$start = mktime($_POST['__event_start_hour'],
$_POST['__event_start_minute'],
@@ -200,7 +201,7 @@
$_POST['__event_start_year']);
}
-if ($_POST['__event_end_day'])
+if (isset($_POST['__event_end_day']))
{
$end = mktime($_POST['__event_end_hour'],
$_POST['__event_end_minute'],
@@ -211,7 +212,7 @@
}
/* If user submitted event */
-if ($_POST['__event_save'])
+if (isset($_POST['__event_save']))
{
$ret = add_event ($db, $_POST['__event_title'],
$start, $end,
@@ -254,7 +255,7 @@
}
/* Preview event */
-else if ($_POST['__event_preview'])
+else if (isset($_POST['__event_preview']))
{
echo "<hr/>";
echo format_event ($db, $_POST['__event_title'],
@@ -343,19 +344,19 @@
echo "<form method=\"post\" action=\"submit.php\">";
-echo $_POST['__event_title'];
+if (isset($_POST['__event_title'])) echo $_POST['__event_title'];
/* Display edit form */
-edit_event ($db, $_POST['__event_title'],
+edit_event ($db, @$_POST['__event_title'],
$start, $end,
- ($_POST['__event_description'] ? $_POST['__event_description'] : "<p></p>"),
- $_POST['__event_city'],
- $_POST['__event_region'],
- $_POST['__event_locality'],
- $_POST['__event_url'],
- $_POST['__event_contact'],
- $_POST['__event_submitter'],
- $_POST['__event_tags'],
+ (isset($_POST['__event_description']) ? $_POST['__event_description'] : "<p></p>"),
+ @$_POST['__event_city'],
+ @$_POST['__event_region'],
+ @$_POST['__event_locality'],
+ @$_POST['__event_url'],
+ @$_POST['__event_contact'],
+ @$_POST['__event_submitter'],
+ @$_POST['__event_tags'],
TRUE);
echo "</form>\n";
Modified: branches/dui/tags.php
==============================================================================
--- branches/dui/tags.php (original)
+++ branches/dui/tags.php Mon Apr 9 12:35:41 2007
@@ -18,6 +18,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
+ *
+ * $Id: top.inc.php,v 1.51 2007/03/10 16:22:12 ldayot Exp $
*/
include("bd.inc.php");
@@ -39,7 +41,7 @@
}
$tags = array();
-while($event = mysql_fetch_object($events))
+while($event = $db->fetchObject($events))
{
foreach(split(" ", $event->tags) as $tag)
{
@@ -81,4 +83,4 @@
put_footer();
-?>
\ No newline at end of file
+?>
Modified: branches/dui/testevent.php
==============================================================================
--- branches/dui/testevent.php (original)
+++ branches/dui/testevent.php Mon Apr 9 12:35:41 2007
@@ -18,6 +18,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
+ *
+ * $Id: top.inc.php,v 1.51 2007/03/10 16:22:12 ldayot Exp $
*/
include("bd.inc.php");
@@ -45,10 +47,10 @@
echo "<li><a href=\"" . $lug->url . "\">" . $lug->name . "</a> (";
$dpts = $db->query ("select distinct department from lugs where name = '" . $lug->name . "'");
$i = 1;
- while ($dpt = mysql_fetch_object ($dpts))
+ while ($dpt = $db->fetchObject ($dpts))
{
echo $dpt->department;
- if ($i != mysql_num_rows($dpts))
+ if ($i != $db->numRows($dpts))
echo ", ";
$i++;
}
@@ -93,4 +95,4 @@
put_footer();
-?>
\ No newline at end of file
+?>
Plus d'informations sur la liste de diffusion Devel