Changeset 1109 for trunk/include/section_init.inc.php
- Timestamp:
- Mar 28, 2006, 4:16:34 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/section_init.inc.php
r1094 r1109 85 85 $next_token = 0; 86 86 if (basename($_SERVER['SCRIPT_FILENAME']) == 'picture.php') 87 { // the last token must be the identifier for the picture 88 $token = array_pop($tokens); 87 { // the first token must be the identifier for the picture 88 if ( isset($_GET['image_id']) 89 and isset($_GET['cat']) and is_numeric($_GET['cat']) ) 90 {// url compatibility with versions below 1.6 91 $url = make_picture_url( array( 92 'section' => 'categories', 93 'category' => $_GET['cat'], 94 'image_id' => $_GET['image_id'] 95 ) ); 96 redirect($url); 97 } 98 $token = $tokens[$next_token]; 99 $next_token++; 89 100 if ( is_numeric($token) ) 90 101 { … … 93 104 else 94 105 { 95 preg_match('/^(\d+-)?( (.*)[_\.]html?)?$/', $token, $matches);106 preg_match('/^(\d+-)?(.*)?$/', $token, $matches); 96 107 if (isset($matches[1]) and is_numeric($matches[1]=rtrim($matches[1],'-')) ) 97 108 { 98 109 $page['image_id'] = $matches[1]; 99 if ( !empty($matches[ 3]) )110 if ( !empty($matches[2]) ) 100 111 { 101 $page['image_file'] = $matches[ 3];112 $page['image_file'] = $matches[2]; 102 113 } 103 114 … … 105 116 else 106 117 { 107 if ( !empty($matches[ 3]) )118 if ( !empty($matches[2]) ) 108 119 { 109 $page['image_file'] = $matches[ 3];120 $page['image_file'] = $matches[2]; 110 121 } 111 122 else … … 117 128 } 118 129 119 if (0 === strpos($tokens[$next_token], 'cat '))130 if (0 === strpos($tokens[$next_token], 'categor')) 120 131 { 121 132 $page['section'] = 'categories'; … … 214 225 $next_token++; 215 226 } 216 else217 {218 $page['section'] = 'categories';219 $next_token++;220 }221 227 222 228 for ($i = $next_token; ; $i++)
Note: See TracChangeset
for help on using the changeset viewer.