Changeset 12118
- Timestamp:
- Sep 8, 2011, 8:22:27 PM (13 years ago)
- Location:
- trunk/include
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/calendar_base.class.php
r8728 r12118 221 221 222 222 $level_items = simple_hash_from_query($query, 'period', 'nb_images'); 223 $level_items = array_to_int($level_items);224 223 225 224 if ( count($level_items)==1 and … … 293 292 $current = implode('-', $page['chronology_date'] ); 294 293 $upper_items = array_from_query( $query, 'period'); 295 $upper_items = array_to_int($upper_items);296 294 297 295 usort($upper_items, 'version_compare'); -
trunk/include/calendar_monthly.class.php
r8728 r12118 225 225 assert( count($page['chronology_date']) == 0 ); 226 226 $query=' 227 SELECT '.pwg_db_get_date_YYYYMM($this->date_field).' as period,' 228 .pwg_db_get_year($this->date_field).' as year, ' 229 .pwg_db_get_month($this->date_field).' as month, 230 count(distinct id) as count'; 227 SELECT '.pwg_db_get_date_YYYYMM($this->date_field).' as period, 228 COUNT(distinct id) as count'; 231 229 $query.= $this->inner_sql; 232 230 $query.= $this->get_date_where(); 233 231 $query.= ' 234 GROUP BY period , year, month235 ORDER BY year DESC, monthASC';232 GROUP BY period 233 ORDER BY '.pwg_db_get_year($this->date_field).' DESC, '.pwg_db_get_month($this->date_field).' ASC'; 236 234 237 235 $result = pwg_query($query); … … 369 367 $items[$day]['height'] = $row['height']; 370 368 $items[$day]['dow'] = $row['dow']; 371 372 if ('sunday' == $conf['week_starts_on'])373 {374 $items[$day]['dow']++;375 }376 369 } 377 370 … … 390 383 $wday_labels = $lang['day']; 391 384 392 // BEGIN - pass now in week starting Monday393 if ($first_day_dow==0)394 {395 $first_day_dow = 6;396 }397 else398 {399 $first_day_dow -= 1;400 }401 402 385 if ('monday' == $conf['week_starts_on']) 403 386 { 387 if ($first_day_dow==0) 388 { 389 $first_day_dow = 6; 390 } 391 else 392 { 393 $first_day_dow -= 1; 394 } 395 404 396 array_push( $wday_labels, array_shift($wday_labels) ); 405 397 } 406 // END - pass now in week starting Monday407 398 408 399 $cell_width = $conf['calendar_month_cell_width']; -
trunk/include/calendar_weekly.class.php
r8728 r12118 41 41 { 42 42 parent::initialize($inner_sql); 43 global $lang ;43 global $lang, $conf; 44 44 $week_no_labels=array(); 45 45 for ($i=1; $i<=53; $i++) … … 65 65 //Comment next lines for week starting on Sunday or if MySQL version<4.0.17 66 66 //WEEK(date,5) = "0-53 - Week 1=the first week with a Monday in this year" 67 $this->calendar_levels[CWEEK]['sql'] = pwg_db_get_week($this->date_field, 5).'+1'; 68 $this->calendar_levels[CDAY]['sql'] = pwg_db_get_weekday($this->date_field); 69 array_push( $this->calendar_levels[CDAY]['labels'], 70 array_shift( $this->calendar_levels[CDAY]['labels'] ) ); 67 if ('monday' == $conf['week_starts_on']) 68 { 69 $this->calendar_levels[CWEEK]['sql'] = pwg_db_get_week($this->date_field, 5).'+1'; 70 $this->calendar_levels[CDAY]['sql'] = pwg_db_get_weekday($this->date_field); 71 array_push( $this->calendar_levels[CDAY]['labels'], 72 array_shift( $this->calendar_levels[CDAY]['labels'] ) ); 73 } 71 74 } 72 75 -
trunk/include/functions_calendar.inc.php
r8728 r12118 290 290 pwg_debug('end initialize_calendar'); 291 291 } 292 293 function array_to_int($array)294 {295 $result = array();296 foreach ($array as $k => $v)297 {298 if ((int)$k==$k)299 {300 $key = (int) $k;301 }302 else303 {304 $key = $k;305 }306 if (is_array($v))307 {308 $result[$key] = array_to_int($v);309 }310 else311 {312 if (is_int($v))313 {314 $value = (int) $v;315 }316 else317 {318 $value = $v;319 }320 $result[$key] = $value;321 }322 }323 return $result;324 }325 292 ?> -
trunk/include/functions_tag.inc.php
r11317 r12118 229 229 } 230 230 $query .=' 231 GROUP BY tag_id, t.id, t.name, t.url_name'; 231 GROUP BY t.id 232 ORDER BY '; 232 233 if ($max_tags>0) 233 234 { 234 $query .= ' 235 ORDER BY counter DESC 235 $query .= 'counter DESC 236 236 LIMIT '.$max_tags; 237 } 238 else 239 { 240 $query .= 'NULL'; 237 241 } 238 242
Note: See TracChangeset
for help on using the changeset viewer.