Changeset 1092 for trunk/include/section_init.inc.php
- Timestamp:
- Mar 22, 2006, 2:01:47 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/section_init.inc.php
-
Property
svn:keywords
set to
Author Date Id Revision
r1090 r1092 7 7 // | branch : BSF (Best So Far) 8 8 // | file : $RCSfile$ 9 // | last update : $Date : 2006-01-27 02:11:43 +0100 (ven, 27 jan 2006)$10 // | last modifier : $Author : rvelices$11 // | revision : $Revision : 1014$9 // | last update : $Date$ 10 // | last modifier : $Author$ 11 // | revision : $Revision$ 12 12 // +-----------------------------------------------------------------------+ 13 13 // | This program is free software; you can redistribute it and/or modify | … … 85 85 $next_token = 0; 86 86 if (basename($_SERVER['SCRIPT_NAME']) == 'picture.php') 87 { 88 89 // the first token must be the numeric identifier of the picture 90 preg_match('/(\d+)/', $tokens[$next_token], $matches); 91 if (!isset($matches[1])) 92 { 93 die('Fatal: picture identifier is missing'); 94 } 95 $page['image_id'] = $matches[1]; 96 97 $next_token++; 87 { // the last token must be the identifier for the picture 88 $token = array_pop($tokens); 89 if ( is_numeric($token) ) 90 { 91 $page['image_id'] = $token; 92 } 93 else 94 { 95 preg_match('/^(\d+-)?((.*)[_\.]html?)?$/', $token, $matches); 96 if ( isset($matches[1]) and is_numeric($matches[1]) ) 97 { 98 $page['image_id'] = $matches[1]; 99 if ( !empty($matches[3]) ) 100 { 101 $page['image_file'] = $matches[3]; 102 } 103 } 104 else 105 { 106 if ( !empty($matches[3]) ) 107 { 108 $page['image_file'] = $matches[3]; 109 } 110 else 111 { 112 die('Fatal: picture identifier is missing'); 113 } 114 } 115 } 98 116 } 99 117 … … 274 292 'uppercats' => $result['uppercats'], 275 293 276 'title' => get_cat_display_name($result['name'], '', false),277 ) 278 ); 279 280 if (!isset($ _GET['calendar']))294 'title' => get_cat_display_name($result['name'], null, false), 295 ) 296 ); 297 298 if (!isset($page['chronology_field'])) 281 299 { 282 300 $query = ' … … 322 340 FROM '.IMAGES_TABLE.' 323 341 INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id = ic.image_id 324 WHERE '.get_sql_search_clause($ _GET['search']).'342 WHERE '.get_sql_search_clause($page['search']).' 325 343 AND '.$forbidden.' 326 344 '.$conf['order_by'].' … … 490 508 } 491 509 510 if (basename($_SERVER['SCRIPT_NAME']) == 'picture.php' 511 and !isset($page['image_id']) ) 512 { 513 $query = ' 514 SELECT id,file 515 FROM '.IMAGES_TABLE .' 516 WHERE id IN ('.implode(',',$page['items']).') 517 AND file LIKE "' . $page['image_file'] . '.%" ESCAPE "|"' 518 ; 519 $result = pwg_query($query); 520 if (mysql_num_rows($result)>0) 521 { 522 list($page['image_id'], $page['image_file']) = mysql_fetch_row($result); 523 } 524 } 492 525 ?> -
Property
svn:keywords
set to
Note: See TracChangeset
for help on using the changeset viewer.