Changeset 1086 for trunk/include/section_init.inc.php
- Timestamp:
- Mar 17, 2006, 5:13:19 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/section_init.inc.php
r1082 r1086 79 79 } 80 80 $page['image_id'] = $matches[1]; 81 82 $next_token++; 83 } 84 81 82 $next_token++; 83 } 84 85 85 if (0 === strpos($tokens[$next_token], 'cat')) 86 86 { 87 87 $page['section'] = 'categories'; 88 88 $next_token++; 89 89 90 90 if (isset($tokens[$next_token]) 91 and preg_match('/ (\d+)/', $tokens[$next_token], $matches))91 and preg_match('/^(\d+)/', $tokens[$next_token], $matches)) 92 92 { 93 93 $page['category'] = $matches[1]; … … 99 99 $page['section'] = 'tags'; 100 100 $page['tags'] = array(); 101 102 $next_token++; 103 101 102 $next_token++; 103 104 104 for ($i = $next_token; ; $i++) 105 105 { … … 108 108 break; 109 109 } 110 110 111 111 preg_match('/^(\d+)/', $tokens[$i], $matches); 112 112 if (!isset($matches[1])) … … 123 123 array_push($page['tags'], $matches[1]); 124 124 } 125 125 126 126 $next_token = $i; 127 127 } … … 155 155 $page['section'] = 'search'; 156 156 $next_token++; 157 157 158 158 preg_match('/(\d+)/', $tokens[$next_token], $matches); 159 159 if (!isset($matches[1])) … … 185 185 $next_token++; 186 186 } 187 187 188 188 for ($i = $next_token; ; $i++) 189 189 { … … 192 192 break; 193 193 } 194 194 195 195 if (preg_match('/^start-(\d+)/', $tokens[$i], $matches)) 196 196 { … … 198 198 } 199 199 200 if (preg_match('/^calendar-(.+)$/', $tokens[$i], $matches)) 201 { 202 // TODO: decide with rvelices how we name calendar/chronology is the 203 // URL 204 $_GET['calendar'] = $matches[1]; 200 if (preg_match('/^posted|created/', $tokens[$i] )) 201 { 202 $chronology_tokens = explode('-', $tokens[$i] ); 203 $page['chronology']['field'] = $chronology_tokens[0]; 204 array_shift($chronology_tokens); 205 $page['chronology']['style'] = $chronology_tokens[0]; 206 array_shift($chronology_tokens); 207 if ( count($chronology_tokens)>0 ) 208 { 209 if ('list'==$chronology_tokens[0] or 210 'calendar'==$chronology_tokens[0]) 211 { 212 $page['chronology']['view'] = $chronology_tokens[0]; 213 array_shift($chronology_tokens); 214 } 215 $page['chronology_date'] = $chronology_tokens; 216 } 205 217 } 206 218 } … … 220 232 $conf['order_by'] = str_replace( 221 233 'ORDER BY ', 222 'ORDER BY '.$orders[ $_COOKIE['pwg_image_order'] ][1].',', 234 'ORDER BY '.$orders[ $_COOKIE['pwg_image_order'] ][1].',', 223 235 $conf['order_by'] 224 236 ); … … 234 246 { 235 247 $result = get_cat_info($page['category']); 236 248 237 249 $page = array_merge( 238 250 $page, … … 247 259 'cat_id_uppercat' => $result['id_uppercat'], 248 260 'uppercats' => $result['uppercats'], 249 261 250 262 'title' => get_cat_display_name($result['name'], '', false), 251 263 ) 252 264 ); 253 265 254 266 if (!isset($_GET['calendar'])) 255 267 { … … 262 274 ;'; 263 275 $page['items'] = array_from_query($query, 'image_id'); 264 276 265 277 $page['thumbnails_include'] = 266 278 $result['nb_images'] > 0 … … 388 400 LIMIT 0, '.$conf['top_number'].' 389 401 ;'; 390 402 391 403 $page = array_merge( 392 404 $page, … … 405 417 $page['super_order_by'] = true; 406 418 $conf['order_by'] = ' ORDER BY average_rate DESC, id ASC'; 407 419 408 420 $query =' 409 421 SELECT DISTINCT(id) … … 437 449 '.$conf['order_by'].' 438 450 ;'; 439 451 440 452 $page = array_merge( 441 453 $page, … … 447 459 ); 448 460 } 449 461 450 462 if (!isset($page['cat_nb_images'])) 451 463 { … … 458 470 // +-----------------------------------------------------------------------+ 459 471 460 if (isset($ _GET['calendar']))472 if (isset($page['chronology'])) 461 473 { 462 474 include_once( PHPWG_ROOT_PATH.'include/functions_calendar.inc.php' );
Note: See TracChangeset
for help on using the changeset viewer.