Objet : devel-adl
Archives de la liste
- From: svn AT agendadulibre.org
- To: devel AT agendadulibre.org
- Subject: [Devel] r485 - branches/generic
- Date: Fri, 8 Oct 2010 02:23:13 +0200 (CEST)
- List-archive: <http://agendadulibre.org/pipermail/devel>
- List-id: Developpement de l'Agenda du Libre <devel.agendadulibre.org>
Author: ploc
Date: Fri Oct 8 02:23:12 2010
New Revision: 485
Log:
replacing MySQL NOW() function by PHP date function in order to take care the
timezone set in the config file (useful when the server is not in the same
timezone as the agenda users)
Modified:
branches/generic/addnoteevent.php
branches/generic/listevents.php
branches/generic/requestinfosevent.php
branches/generic/submit.php
branches/generic/validateevent.php
Modified: branches/generic/addnoteevent.php
==============================================================================
--- branches/generic/addnoteevent.php Fri Oct 8 01:41:31 2010 (r484)
+++ branches/generic/addnoteevent.php Fri Oct 8 02:23:12 2010 (r485)
@@ -37,9 +37,10 @@
$id = get_safe_integer('id', 0);
+ $now = date("Y-m-d H:i:s");
$sql = "insert into notes (contents, date, event_id, author_id) values (" .
$db->quote_smart($_POST['__event_note_text']) . "," .
- "NOW()" . "," .
+ "'" . $now . "'" . "," .
$id . "," .
$user->get() . ")";
Modified: branches/generic/listevents.php
==============================================================================
--- branches/generic/listevents.php Fri Oct 8 01:41:31 2010 (r484)
+++ branches/generic/listevents.php Fri Oct 8 02:23:12 2010 (r485)
@@ -64,8 +64,9 @@
echo "<h2>Les évènements <i>" . $_GET['tag'] . "</i></h2>\n";
$hasevent = FALSE;
+$now = date("Y-m-d H:i:s");
$sql = "select id, title, city, start_time, end_time from events " .
- "where (concat(' ', tags, ' ') like '% " . $_GET['tag'] . " %') and
(start_time > NOW()) and (moderated=1) order by start_time ";
+ "where (concat(' ', tags, ' ') like '% " . $_GET['tag'] . " %') and
(start_time > '" . $now . "') and (moderated=1) order by start_time ";
$events = $db->query($sql);
if (! $events)
{
@@ -88,7 +89,7 @@
}
$sql = "select id, title, city, start_time, end_time from events ".
- "where (concat(' ', tags, ' ') like '% " . $_GET['tag'] . " %') and
(start_time < NOW()) and (moderated=1) order by start_time desc";
+ "where (concat(' ', tags, ' ') like '% " . $_GET['tag'] . " %') and
(start_time < '" . $now . "') and (moderated=1) order by start_time desc";
$events = $db->query($sql);
if (! $events)
{
Modified: branches/generic/requestinfosevent.php
==============================================================================
--- branches/generic/requestinfosevent.php Fri Oct 8 01:41:31 2010
(r484)
+++ branches/generic/requestinfosevent.php Fri Oct 8 02:23:12 2010
(r485)
@@ -76,9 +76,10 @@
"<p>Demande d'informations complémentaires :</p>" .
"<pre>" . wordwrap(stripslashes($_POST["__text"])) . "</pre>";
+ $now = date("Y-m-d H:i:s");
$sql = "insert into notes (contents, date, event_id, author_id) values (" .
$db->quote_smart($note) . "," .
- "NOW()" . "," .
+ "'" . $now . "'" . "," .
$id . "," .
$user->get() . ")";
Modified: branches/generic/submit.php
==============================================================================
--- branches/generic/submit.php Fri Oct 8 01:41:31 2010 (r484)
+++ branches/generic/submit.php Fri Oct 8 02:23:12 2010 (r485)
@@ -181,6 +181,7 @@
$submitter_mail_id = md5(uniqid(rand(), true));
/* Checks are done, add to database */
+ $now = date("Y-m-d H:i:s");
$sql = "INSERT INTO events
(title,description,start_time,end_time,city,region,locality,url,contact,submitter,tags,moderated,secret,submission_time,moderator_mail_id,submitter_mail_id)
values (" .
$db->quote_smart($title) . "," .
$db->quote_smart($description) . "," .
@@ -195,7 +196,7 @@
$db->quote_smart($tags) . "," .
"'0'" . "," .
"'" . $secret . "'" . "," .
- "NOW()" . "," .
+ "'" . $now . "'" . "," .
"'" . $moderator_mail_id . "'" . "," .
"'" . $submitter_mail_id . "'" .
")";
Modified: branches/generic/validateevent.php
==============================================================================
--- branches/generic/validateevent.php Fri Oct 8 01:41:31 2010 (r484)
+++ branches/generic/validateevent.php Fri Oct 8 02:23:12 2010 (r485)
@@ -48,7 +48,8 @@
$link = calendar_absolute_url("showevent.php?id=".$id);
/* Accept event */
- $sql = "update events set moderated=1, decision_time=NOW() where id=" .
$db->quote_smart($id);
+ $now = date("Y-m-d H:i:s");
+ $sql = "update events set moderated=1, decision_time='" . $now . "' where
id=" . $db->quote_smart($id);
$ret = $db->query ($sql);
if ($ret == FALSE)
{
- [Devel] r485 - branches/generic, svn, 08/10/2010
Archives gérées par MHonArc 2.6.16.