aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2005-01-16 17:27:34 +0000
committerplegall <plg@piwigo.org>2005-01-16 17:27:34 +0000
commitb9f05888cb46c632e66333561bd9c139144a51bf (patch)
tree0d15da6942c254688da5ea028f15f8afa5895db3
parent908a78d2b45bdc501c481b56b53996f7c7fd1aaa (diff)
- calendar : use MySQL instead of PHP to find the day of the week
git-svn-id: http://piwigo.org/svn/trunk@697 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/category_calendar.inc.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/category_calendar.inc.php b/include/category_calendar.inc.php
index 481224d9d..9451e5684 100644
--- a/include/category_calendar.inc.php
+++ b/include/category_calendar.inc.php
@@ -320,6 +320,7 @@ elseif (!isset($page['calendar_day']))
{
$query = '
SELECT file,tn_ext,'.$conf['calendar_datefield'].',path
+ , DAYOFWEEK(\''.$calendar_day.'\') AS dow
FROM '.IMAGES_TABLE.' INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON id = image_id
'.$page['where'].'
AND '.$conf['calendar_datefield'].' = \''.$calendar_day.'\'
@@ -331,8 +332,7 @@ SELECT file,tn_ext,'.$conf['calendar_datefield'].',path
$thumbnail_src = get_thumbnail_src($row['path'], @$row['tn_ext']);
list($year,$month,$day) = explode('-', $calendar_day);
- $unixdate = mktime(0,0,0,$month,$day,$year);
- $name = $lang['day'][date("w", $unixdate)];
+ $name = $lang['day'][$row['dow']-1];
$name.= ' '.$day;
$name.= ' ('.$nb_pics.')';