Changeset 1086 for trunk/picture.php
- Timestamp:
- Mar 17, 2006, 5:13:19 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/picture.php
r1085 r1086 64 64 if ($page['current_rank'] != $page['first_rank']) 65 65 { 66 // "go to first picture of this section" link is displayed only if the 67 // displayed item is not the first. 68 $template->assign_block_vars( 69 'first', 70 array( 71 'U_IMG' => duplicate_picture_URL( 72 // redefinitions 73 array( 74 'image_id' => $page['items'][ $page['first_rank'] ], 75 ), 76 // removes 77 array() 78 ) 79 ) 80 ); 81 82 // caching previous item : readability purpose 66 // caching first & previous item : readability purpose 83 67 $page['previous_item'] = $page['items'][ $page['current_rank'] - 1 ]; 68 $page['first_item'] = $page['items'][ $page['first_rank'] ]; 84 69 } 85 70 86 71 if ($page['current_rank'] != $page['last_rank']) 87 72 { 88 // "go to last picture of this section" link is displayed only if the 89 // displayed item is not the last. 90 $template->assign_block_vars( 91 'last', 92 array( 93 'U_IMG' => duplicate_picture_URL( 94 // redefinitions 95 array( 96 'image_id' => $page['items'][ $page['last_rank'] ], 97 ), 98 // removes 99 array() 100 ) 101 ) 102 ); 103 104 // caching next item : readability purpose 73 // caching next & last item : readability purpose 105 74 $page['next_item'] = $page['items'][ $page['current_rank'] + 1 ]; 75 $page['last_item'] = $page['items'][ $page['last_rank'] ]; 106 76 } 107 77 … … 145 115 146 116 redirect($url_self); 147 117 148 118 break; 149 119 } … … 165 135 redirect($url_self); 166 136 } 167 137 168 138 break; 169 139 } … … 179 149 pwg_query($query); 180 150 } 181 151 182 152 redirect($url_self); 183 153 184 154 break; 185 155 } … … 244 214 } 245 215 usort($related_categories, 'global_rank_compare'); 246 //------------------------- ------------ prev, current & next picture management216 //-------------------------first, prev, current, next & last picture management 247 217 $picture = array(); 248 218 … … 251 221 { 252 222 array_push($ids, $page['previous_item']); 223 array_push($ids, $page['first_item']); 253 224 } 254 225 if (isset($page['next_item'])) 255 226 { 256 227 array_push($ids, $page['next_item']); 228 array_push($ids, $page['last_item']); 257 229 } 258 230 … … 269 241 if (isset($page['previous_item']) and $row['id'] == $page['previous_item']) 270 242 { 271 $i = 'prev ';243 $i = 'previous'; 272 244 } 273 245 else if (isset($page['next_item']) and $row['id'] == $page['next_item']) 274 246 { 275 247 $i = 'next'; 248 } 249 else if (isset($page['first_item']) and $row['id'] == $page['first_item']) 250 { 251 $i = 'first'; 252 } 253 else if (isset($page['last_item']) and $row['id'] == $page['last_item']) 254 { 255 $i = 'last'; 276 256 } 277 257 else … … 351 331 ) 352 332 ); 333 334 if ('previous'==$i and $page['previous_item']==$page['first_item']) 335 { 336 $picture['first'] = $picture[$i]; 337 } 338 if ('next'==$i and $page['next_item']==$page['last_item']) 339 { 340 $picture['last'] = $picture[$i]; 341 } 353 342 } 354 343 … … 428 417 $page['body_id'] = 'thePicturePage'; 429 418 //------------------------------------------------------- navigation management 430 if (isset($page['previous_item'])) 431 { 432 $template->assign_block_vars( 433 'previous', 434 array( 435 'TITLE_IMG' => $picture['prev']['name'], 436 'IMG' => $picture['prev']['thumbnail'], 437 'U_IMG' => $picture['prev']['url'], 438 'U_IMG_SRC' => $picture['prev']['src'] 439 ) 440 ); 441 } 442 443 if (isset($page['next_item'])) 444 { 445 $template->assign_block_vars( 446 'next', 447 array( 448 'TITLE_IMG' => $picture['next']['name'], 449 'IMG' => $picture['next']['thumbnail'], 450 'U_IMG' => $picture['next']['url'], 451 'U_IMG_SRC' => $picture['next']['src'] // allow navigator to preload 452 ) 453 ); 419 foreach ( array('first','previous','next','last') as $which_image ) 420 { 421 if (isset($picture[$which_image])) 422 { 423 $template->assign_block_vars( 424 $which_image, 425 array( 426 'TITLE_IMG' => $picture[$which_image]['name'], 427 'IMG' => $picture[$which_image]['thumbnail'], 428 'U_IMG' => $picture[$which_image]['url'], 429 'U_IMG_SRC' => $picture[$which_image]['src'] 430 ) 431 ); 432 } 454 433 } 455 434 … … 520 499 { 521 500 $uuid = uniqid(rand()); 522 501 523 502 $template->assign_block_vars( 524 503 'high', … … 528 507 ) 529 508 ); 530 509 531 510 $template->assign_block_vars( 532 511 'download', … … 572 551 $result = pwg_query($query); 573 552 $row = mysql_fetch_array($result); 574 553 575 554 if ($row['nb_fav'] == 0) 576 555 { … … 642 621 { 643 622 $val = format_date($picture['current']['date_creation']); 644 $infos['INFO_CREATION_DATE'] = '<a href="'. 645 PHPWG_ROOT_PATH.'category.php?calendar=created-c-'. 646 $picture['current']['date_creation'].'">'.$val.'</a>'; 623 $url = make_index_URL( 624 array( 625 'chronology' => 626 array( 627 'field'=>'created', 628 'style'=>'monthly', 629 'view'=>'list', 630 ), 631 'chronology_date' => explode('-', $picture['current']['date_creation']) 632 ) 633 ); 634 $infos['INFO_CREATION_DATE'] = '<a href="'.$url.'">'.$val.'</a>'; 647 635 } 648 636 else … … 653 641 // date of availability 654 642 $val = format_date($picture['current']['date_available'], 'mysql_datetime'); 655 $infos['INFO_POSTED_DATE'] = '<a href="'. 656 PHPWG_ROOT_PATH.'category.php?calendar=posted-c-'. 657 substr($picture['current']['date_available'],0,10).'">'.$val.'</a>'; 643 $url = make_index_URL( 644 array( 645 'chronology' => 646 array( 647 'field'=>'posted', 648 'style'=>'monthly', 649 'view'=>'list', 650 ), 651 'chronology_date' => explode('-', substr($picture['current']['date_available'],0,10)) 652 ) 653 ); 654 $infos['INFO_POSTED_DATE'] = '<a href="'.$url.'">'.$val.'</a>'; 658 655 659 656 // size in pixels
Note: See TracChangeset
for help on using the changeset viewer.