Changeset 1844 for trunk/admin/history.php
- Timestamp:
- Feb 21, 2007, 12:40:02 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/history.php
r1821 r1844 59 59 } 60 60 61 $types = array('none', 'picture', 'high', 'other'); 62 61 63 // +-----------------------------------------------------------------------+ 62 64 // | Check Access and exit when user status is not ok | … … 95 97 } 96 98 97 $search['fields']['pictures'] = $_POST['pictures']; 98 $search['fields']['high'] = $_POST['high']; 99 $search['fields']['types'] = $_POST['types']; 99 100 100 101 // echo '<pre>'; print_r($search); echo '</pre>'; … … 185 186 } 186 187 187 if (isset($page['search']['fields'][' pictures']))188 { 189 $ clause = null;188 if (isset($page['search']['fields']['types'])) 189 { 190 $local_clauses = array(); 190 191 191 if ($page['search']['fields']['pictures'] == 'no') 192 foreach ($types as $type) { 193 if (in_array($type, $page['search']['fields']['types'])) { 194 $clause = 'image_type '; 195 if ($type == 'none') 196 { 197 $clause.= 'IS NULL'; 198 } 199 else 200 { 201 $clause.= "= '".$type."'"; 202 } 203 204 array_push($local_clauses, $clause); 205 } 206 } 207 208 if (count($local_clauses) > 0) 192 209 { 193 $clause = 'image_id IS NULL'; 194 } 195 196 if ($page['search']['fields']['pictures'] == 'only') 197 { 198 $clause = 'image_id IS NOT NULL'; 199 } 200 201 if (isset($clause)) 202 { 203 array_push($clauses, $clause); 204 } 205 } 206 207 if (isset($page['search']['fields']['high'])) 208 { 209 $clause = null; 210 211 if ($page['search']['fields']['high'] == 'no') 212 { 213 $clause = "is_high IS NULL or is_high = 'false'"; 214 } 215 216 if ($page['search']['fields']['high'] == 'only') 217 { 218 $clause = "is_high = 'true'"; 219 } 220 221 if (isset($clause)) 222 { 223 array_push($clauses, $clause); 210 array_push( 211 $clauses, 212 implode(' OR ', $local_clauses) 213 ); 224 214 } 225 215 } … … 237 227 FROM '.HISTORY_TABLE.' 238 228 WHERE '.$where_separator.' 239 '; 240 229 ;'; 230 231 // echo '<pre>'.$query.'</pre>'; 232 241 233 list($page['nb_lines']) = mysql_fetch_row(pwg_query($query)); 242 234 … … 251 243 tag_ids, 252 244 image_id, 253 i s_high245 image_type 254 246 FROM '.HISTORY_TABLE.' 255 247 WHERE '.$where_separator.' … … 345 337 : 'deleted '.$line['image_id']) 346 338 : $line['image_id'], 339 'TYPE' => $line['image_type'], 347 340 'SECTION' => $line['section'], 348 341 'CATEGORY' => isset($line['category_id']) … … 355 348 ) 356 349 ); 357 358 if (isset($line['image_id']))359 {360 if ($line['is_high'] == 'true')361 {362 $template->assign_block_vars('detail.high', array());363 }364 else365 {366 $template->assign_block_vars('detail.no_high', array());367 }368 }369 350 } 370 351 } … … 426 407 } 427 408 428 $form['pictures'] = $page['search']['fields']['pictures']; 429 $form['high'] = $page['search']['fields']['high']; 409 $form['types'] = $page['search']['fields']['types']; 430 410 } 431 411 else … … 436 416 $form['start_month'] = $form['end_month'] = date('n'); 437 417 $form['start_day'] = $form['end_day'] = date('j'); 438 $form['pictures'] = 'yes'; 439 $form['high'] = 'yes'; 418 $form['types'] = $types; 440 419 } 441 420 … … 454 433 ); 455 434 456 foreach (array('pictures', 'high') as $block) 457 { 458 foreach (array('yes', 'no', 'only') as $item) 459 { 460 $selected = ''; 461 462 if ($item == $form[$block]) 463 { 464 $selected = 'selected="selected"'; 465 } 466 467 $template->assign_block_vars( 468 $block.'_option', 469 array( 470 'VALUE' => $item, 471 'CONTENT' => l10n($item), 472 'SELECTED' => $selected, 473 ) 474 ); 475 } 435 foreach ($types as $option) 436 { 437 $selected = ''; 438 439 if (in_array($option, $form['types'])) 440 { 441 $selected = 'selected="selected"'; 442 } 443 444 $template->assign_block_vars( 445 'types_option', 446 array( 447 'VALUE' => $option, 448 'CONTENT' => l10n($option), 449 'SELECTED' => $selected, 450 ) 451 ); 476 452 } 477 453
Note: See TracChangeset
for help on using the changeset viewer.