aboutsummaryrefslogtreecommitdiffstats
path: root/include/calendar_monthly.class.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2006-02-23 02:30:19 +0000
committerrvelices <rv-github@modusoptimus.com>2006-02-23 02:30:19 +0000
commit34538a62f4ac8bc6db41580058fdd040abaa3183 (patch)
treefdde1ecefd0ec41f20d3d5e2d1bcc87357d3e493 /include/calendar_monthly.class.php
parentfe8fbac3cf9af0464d2b0990c88631ff9fd803ac (diff)
new calendar completely integrated
git-svn-id: http://piwigo.org/svn/trunk@1051 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/calendar_monthly.class.php')
-rw-r--r--include/calendar_monthly.class.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/calendar_monthly.class.php b/include/calendar_monthly.class.php
index cc50a6641..3103880c3 100644
--- a/include/calendar_monthly.class.php
+++ b/include/calendar_monthly.class.php
@@ -126,7 +126,7 @@ function get_date_where($requested, $max_levels=3)
$res .= ' AND DAY('.$this->date_field.')='.$requested[2];
}
}
- $res = " AND $this->date_field BETWEEN '$b' AND '$e'" . $res;
+ $res = " AND $this->date_field BETWEEN '$b' AND '$e 23:59:59'" . $res;
}
else
{
@@ -235,12 +235,14 @@ function build_year_calendar(&$requested)
{
$url_base = $this->url_base.'c-'.$requested[0].'-'.$month;
- $nav_bar = '<span class="calCalHead"><a href="'.$url_base.'">'.$lang['month'][$month].'</a>';
+ $nav_bar = '<span class="calCalHead"><a href="'.$url_base.'">';
+ $nav_bar .= $lang['month'][$month].'</a>';
$nav_bar .= ' ('.$month_data['nb_images'].')';
$nav_bar .= '</span><br>';
$url_base .= '-';
- $nav_bar .= $this->get_nav_bar_from_items( $url_base, $month_data['children'], $requested[1], 'calCal', false );
+ $nav_bar .= $this->get_nav_bar_from_items( $url_base,
+ $month_data['children'], $requested[1], 'calCal', false );
$template->assign_block_vars( 'calendar.calbar',
array( 'BAR' => $nav_bar)
@@ -278,6 +280,9 @@ function build_month_calendar($requested)
SELECT file,tn_ext,path, DAYOFWEEK('.$this->date_field.')-1 as dw';
$query.= $this->inner_sql;
$query.= $this->get_date_where($requested);
+ $query.= '
+ ORDER BY RAND()
+ LIMIT 0,1';
$row = mysql_fetch_array(pwg_query($query));
@@ -305,5 +310,4 @@ SELECT file,tn_ext,path, DAYOFWEEK('.$this->date_field.')-1 as dw';
}
}
-
?> \ No newline at end of file