Changeset 1061
- Timestamp:
- Mar 1, 2006, 5:33:52 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/identification.php
r1056 r1061 36 36 if ( !empty($_GET['redirect']) ) 37 37 { 38 $redirect_to = $_GET['redirect'];38 $redirect_to = urldecode($_GET['redirect']); 39 39 if ( $user['is_the_guest'] ) 40 40 { … … 99 99 'U_HOME' => PHPWG_ROOT_PATH.'category.php', 100 100 'U_REDIRECT' => $redirect_to, 101 101 102 102 'F_LOGIN_ACTION' => PHPWG_ROOT_PATH.'identification.php' 103 103 )); -
trunk/include/calendar_monthly.class.php
r1059 r1061 114 114 $this->build_nav_bar( 115 115 CDAY, 116 $this->get_all_days_in_month(117 $this->date_components[CYEAR] ,$this->date_components[CMONTH] 118 )116 range( 1, $this->get_all_days_in_month( 117 $this->date_components[CYEAR] ,$this->date_components[CMONTH] ) 118 ) 119 119 ); // days 120 120 } … … 212 212 $nb_days = 31; 213 213 } 214 return range(1, $nb_days);214 return $nb_days; 215 215 } 216 216 … … 325 325 function build_month_calendar() 326 326 { 327 $query='SELECT DISTINCT(DA TE_FORMAT('.$this->date_field.',"%d")) as period,328 COUNT( id) as count';327 $query='SELECT DISTINCT(DAYOFMONTH('.$this->date_field.')) as period, 328 COUNT( DISTINCT(id) ) as count'; 329 329 $query.= $this->inner_sql; 330 330 $query.= $this->get_date_where($this->date_components); … … 335 335 while ($row = mysql_fetch_array($result)) 336 336 { 337 $d = $row['period'];337 $d = (int)$row['period']; 338 338 $items[$d] = array('nb_images'=>$row['count']); 339 339 } … … 343 343 $this->date_components[CDAY]=$day; 344 344 $query = ' 345 SELECT file,tn_ext,path, DAYOFWEEK('.$this->date_field.')-1 as dw';345 SELECT file,tn_ext,path, width, height, DAYOFWEEK('.$this->date_field.')-1 as dow'; 346 346 $query.= $this->inner_sql; 347 347 $query.= $this->get_date_where(); … … 354 354 $items[$day]['tn_path'] = get_thumbnail_src($row['path'], @$row['tn_ext']); 355 355 $items[$day]['tn_file'] = $row['file']; 356 $items[$day]['tn_dw'] = $row['dw']; 357 } 358 359 global $lang, $template; 360 $template->assign_block_vars('thumbnails', array()); 361 $template->assign_block_vars('thumbnails.line', array()); 362 foreach ( $items as $day=>$data) 363 { 364 $url_base = $this->url_base. 365 $this->date_components[CYEAR].'-'. 366 $this->date_components[CMONTH].'-'.$day; 367 368 $thumbnail_title = $lang['day'][$data['tn_dw']] . ' ' . $day; 369 $name = $thumbnail_title .' ('.$data['nb_images'].')'; 370 371 $template->assign_block_vars( 372 'thumbnails.line.thumbnail', 356 $items[$day]['width'] = $row['width']; 357 $items[$day]['height'] = $row['height']; 358 $items[$day]['dow'] = $row['dow']; 359 } 360 361 global $lang, $template, $conf; 362 363 if ( !empty($items) 364 and $conf['calendar_month_cell_width']>0 365 and $conf['calendar_month_cell_height']>0) 366 { 367 list($known_day) = array_keys($items); 368 $known_dow = $items[$known_day]['dow']; 369 $first_day_dow = ($known_dow-($known_day-1))%7; 370 if ($first_day_dow<0) 371 { 372 $first_day_dow += 7; 373 } 374 //first_day_dow = week day corresponding to the first day of this month 375 $wday_labels = $lang['day']; 376 377 // BEGIN - pass now in week starting Monday 378 if ($first_day_dow==0) 379 { 380 $first_day_dow = 6; 381 } 382 else 383 { 384 $first_day_dow -= 1; 385 } 386 array_push( $wday_labels, array_shift($wday_labels) ); 387 // END - pass now in week starting Monday 388 389 $cell_width = $conf['calendar_month_cell_width']; 390 $cell_height = $conf['calendar_month_cell_height']; 391 392 $template->set_filenames( 393 array( 394 'month_calendar'=>'month_calendar.tpl', 395 ) 396 ); 397 398 $template->assign_block_vars('calendar.thumbnails', 373 399 array( 374 'IMAGE'=>$data['tn_path'], 375 'IMAGE_ALT'=>$data['tn_file'], 376 'IMAGE_TITLE'=>$thumbnail_title, 377 'U_IMG_LINK'=>$url_base 378 ) 379 ); 380 $template->assign_block_vars( 381 'thumbnails.line.thumbnail.category_name', 382 array( 383 'NAME' => $name 400 'WIDTH'=>$cell_width, 401 'HEIGHT'=>$cell_height, 384 402 ) 385 ); 403 ); 404 405 //fill the heading with day names 406 $template->assign_block_vars('calendar.thumbnails.head', array()); 407 foreach( $wday_labels as $d => $label) 408 { 409 $template->assign_block_vars('calendar.thumbnails.head.col', 410 array('LABEL'=>$label) 411 ); 412 } 413 414 $template->assign_block_vars('calendar.thumbnails.row', array()); 415 416 //fill the empty days in the week before first day of this month 417 for ($i=0; $i<$first_day_dow; $i++) 418 { 419 $template->assign_block_vars('calendar.thumbnails.row.col', array()); 420 $template->assign_block_vars('calendar.thumbnails.row.col.blank', array()); 421 } 422 for ($day=1; $day<=$this->get_all_days_in_month( 423 $this->date_components[CYEAR] ,$this->date_components[CMONTH]); $day++) 424 { 425 $dow = ($first_day_dow + $day-1)%7; 426 if ($dow==0) 427 { 428 $template->assign_block_vars('calendar.thumbnails.row', array()); 429 } 430 $template->assign_block_vars('calendar.thumbnails.row.col', array()); 431 if ( !isset($items[$day]) ) 432 { 433 $template->assign_block_vars('calendar.thumbnails.row.col.empty', 434 array('LABEL'=>$day)); 435 } 436 else 437 { 438 // first try to guess thumbnail size 439 if ( !empty($items[$day]['width']) ) 440 { 441 $tn_size = get_picture_size( 442 $items[$day]['width'], $items[$day]['height'], 443 $conf['tn_width'], $conf['tn_height'] ); 444 } 445 else 446 {// item not an image (tn is either mime type or an image) 447 $tn_size = @getimagesize($items[$day]['tn_path']); 448 } 449 $tn_width = $tn_size[0]; 450 $tn_height = $tn_size[1]; 451 452 // now need to fit the thumbnail of size tn_size within 453 // a cell of size cell_size by playing with CSS position (left/top) 454 // and the width and height of <img>. 455 $ratio_w = $tn_width/$cell_width; 456 $ratio_h = $tn_height/$cell_height; 457 458 $pos_top=$pos_left=0; 459 $img_width=$img_height=''; 460 if ( $ratio_w>1 and $ratio_h>1) 461 {// cell completely smaller than the thumbnail so we will let the browser 462 // resize the thumbnail 463 if ($ratio_w > $ratio_h ) 464 {// thumbnail ratio compared to cell -> wide format 465 $img_height = 'height="'.$cell_height.'"'; 466 $browser_img_width = $cell_height*$tn_width/$tn_height; 467 $pos_left = ($tn_width-$browser_img_width)/2; 468 } 469 else 470 { 471 $img_width = 'width="'.$cell_width.'"'; 472 $browser_img_height = $cell_width*$tn_height/$tn_width; 473 $pos_top = ($tn_height-$browser_img_height)/2; 474 } 475 } 476 else 477 { 478 $pos_left = ($tn_width-$cell_width)/2; 479 $pos_top = ($tn_height-$cell_height)/2; 480 } 481 482 $css_style = ''; 483 if ( round($pos_left)!=0) 484 { 485 $css_style.='left:'.round(-$pos_left).'px;'; 486 } 487 if ( round($pos_top)!=0) 488 { 489 $css_style.='top:'.round(-$pos_top).'px;'; 490 } 491 $url = $this->url_base. 492 $this->date_components[CYEAR].'-'. 493 $this->date_components[CMONTH].'-'.$day; 494 $alt = $wday_labels[$dow] . ' ' . $day. 495 ' ('.$items[$day]['nb_images'].')'; 496 $template->assign_block_vars('calendar.thumbnails.row.col.full', 497 array( 498 'LABEL' => $day, 499 'IMAGE' => $items[$day]['tn_path'], 500 'U_IMG_LINK'=> $url, 501 'STYLE' => $css_style, 502 'IMG_WIDTH' => $img_width, 503 'IMG_HEIGHT'=> $img_height, 504 'IMAGE_ALT' => $alt, 505 ) 506 ); 507 } 508 } 509 //fill the empty days in the week after the last day of this month 510 while ( $dow<6 ) 511 { 512 $template->assign_block_vars('calendar.thumbnails.row.col', array()); 513 $template->assign_block_vars('calendar.thumbnails.row.col.blank', array()); 514 $dow++; 515 } 516 $template->assign_var_from_handle('MONTH_CALENDAR', 'month_calendar'); 517 } 518 else 519 { 520 $template->assign_block_vars('thumbnails', array()); 521 $template->assign_block_vars('thumbnails.line', array()); 522 foreach ( $items as $day=>$data) 523 { 524 $url = $this->url_base. 525 $this->date_components[CYEAR].'-'. 526 $this->date_components[CMONTH].'-'.$day; 527 528 $thumbnail_title = $lang['day'][$data['dow']] . ' ' . $day; 529 $name = $thumbnail_title .' ('.$data['nb_images'].')'; 530 531 $template->assign_block_vars( 532 'thumbnails.line.thumbnail', 533 array( 534 'IMAGE'=>$data['tn_path'], 535 'IMAGE_ALT'=>$data['tn_file'], 536 'IMAGE_TITLE'=>$thumbnail_title, 537 'U_IMG_LINK'=>$url 538 ) 539 ); 540 $template->assign_block_vars( 541 'thumbnails.line.thumbnail.category_name', 542 array( 543 'NAME' => $name 544 ) 545 ); 546 } 386 547 } 387 548 -
trunk/include/config_default.inc.php
r1059 r1061 103 103 $conf['calendar_show_empty'] = true; 104 104 105 // calendar_month_cell_width, calendar_month_cell_height : define the 106 // width and the height of a cell in the monthly calendar when viewing a 107 // given month. a value of 0 means that the pretty view is not shown. 108 // a good suggestion would be to have the width and the height equal 109 // and smaller than tn_width and tn_height. NOTE THAT tn_width AND tn_height 110 // MUST CORRESPOND APPROXIMATIVELY TO YOUR REAL THUMBNAIL SIZE, OTHERWISE 111 // THE IMAGES WILL NOT SHOW CORRECTLY 112 $conf['calendar_month_cell_width'] =80; 113 $conf['calendar_month_cell_height']=80; 114 105 115 // newcat_default_commentable : at creation, must a category be commentable 106 116 // or not ? -
trunk/include/functions_category.inc.php
r1059 r1061 48 48 { 49 49 $login_url = './identification.php?redirect='. 50 htmlentities(htmlentities($_SERVER['REQUEST_URI']));50 urlencode(urlencode($_SERVER['REQUEST_URI'])); 51 51 if ( ! $user['is_the_guest'] ) 52 52 { -
trunk/template/yoga/admin/rating.tpl
-
Property
svn:eol-style
set to
native
r1042 r1061 2 2 3 3 <form action="" method="GET" id="update"> 4 <fieldset> 5 <legend></legend> 4 6 <input type="hidden" name="page" value="rating" /> 5 <fieldset>6 7 7 <ul> 8 8 … … 40 40 </p> 41 41 </form> 42 43 42 <div class="navigationBar">{NAVBAR}</div> 44 45 43 <table width="100%"> 46 44 <tr class="throw"> -
Property
svn:eol-style
set to
-
trunk/template/yoga/category.tpl
r1059 r1061 168 168 <!-- END calbar --> 169 169 <!-- END calendar --> 170 171 {MONTH_CALENDAR} 170 172 171 173 <!-- BEGIN thumbnails --> -
trunk/template/yoga/content.css
r1059 r1061 180 180 181 181 182 /* begin chronology/calendar elements*/ 182 183 #content DIV.calendarViews { 183 184 display: block; … … 200 201 margin: 0 2px; 201 202 border: 1px solid gray; 202 color: dark-gray;203 203 } 204 204 … … 207 207 margin: 0 2px; 208 208 border: 1px solid gray; 209 color: lightgray;210 209 } 211 210 … … 225 224 } 226 225 226 /* nice looking month calendar*/ 227 .calMonth { border: none; border-collapse: collapse; } 228 229 TD.calDayCellFull, TD.calDayCellEmpty, TD.calDayCellBlank 230 { 231 text-align:left; 232 vertical-align: top; 233 font: bold 18px Arial, Helvetica, sans-serif; 234 } 235 236 TD.calDayHead { font: bold 12px Arial, Helvetica, sans-serif; } 237 238 DIV.calImg 239 { 240 overflow: hidden; 241 vertical-align: bottom; 242 z-index: 1; 243 position: relative; /*<- this required by IE*/ 244 } 245 246 .calImg img 247 { 248 position: relative; 249 border: 0; 250 } 251 252 .calBackDate { 253 padding-left: 4px; 254 padding-top: 0px; 255 z-index: 2; 256 position: absolute; 257 text-align: left; 258 vertical-align: top; 259 } 260 261 .calForeDate { 262 padding-left: 5px; 263 padding-top: 1px; 264 z-index: 3; 265 position: absolute; 266 text-align: left; 267 vertical-align: top; 268 } -
trunk/template/yoga/theme/clear/theme.css
-
Property
svn:eol-style
set to
native
r978 r1061 78 78 } 79 79 80 /*calendar elements*/ 81 SPAN.calItemSel { color: dark-gray; } 82 83 SPAN.calItemEmpty { color: lightgray; } 84 85 86 /* nice looking month calendar*/ 87 TD.calDayCellEmpty, TD.calDayCellFull { border: 1px solid #7E7262;} 88 89 TD.calDayCellEmpty { color: lightgray; } 90 91 .calBackDate { color: #000; } 92 .calForeDate { color: #fff; } -
Property
svn:eol-style
set to
-
trunk/template/yoga/theme/dark/theme.css
r1059 r1061 115 115 } 116 116 117 SPAN.calItemSel { 118 color: #fff48e; 119 } 117 /*calendar elements*/ 118 SPAN.calItemSel { color: #fff48e; } 120 119 121 SPAN.calItemEmpty { 122 color: darkgray; 123 } 120 SPAN.calItemEmpty { color: darkgray; } 121 122 /* nice looking month calendar*/ 123 TD.calDayCellEmpty, TD.calDayCellFull { border: 1px solid gray;} 124 125 TD.calDayCellEmpty { color: lightgray; } 126 127 .calBackDate { color: #000; } 128 .calForeDate { color: #fff; }
Note: See TracChangeset
for help on using the changeset viewer.