Changeset 1817 for trunk/admin/history.php
- Timestamp:
- Feb 14, 2007, 11:53:02 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/history.php
r1782 r1817 95 95 } 96 96 97 $search['fields']['pictures'] = $_POST['pictures']; 98 $search['fields']['high'] = $_POST['high']; 99 97 100 // echo '<pre>'; print_r($search); echo '</pre>'; 98 101 … … 182 185 } 183 186 187 if (isset($page['search']['fields']['pictures'])) 188 { 189 $clause = null; 190 191 if ($page['search']['fields']['pictures'] == 'no') 192 { 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); 224 } 225 } 226 184 227 $clauses = prepend_append_array_items($clauses, '(', ')'); 185 228 … … 199 242 200 243 $query = ' 201 SELECT date, time, user_id, IP, section, category_id, tag_ids, image_id 244 SELECT 245 date, 246 time, 247 user_id, 248 IP, 249 section, 250 category_id, 251 tag_ids, 252 image_id, 253 is_high 202 254 FROM '.HISTORY_TABLE.' 203 255 WHERE '.$where_separator.' … … 299 351 ) 300 352 ); 353 354 if (isset($line['image_id'])) 355 { 356 if ($line['is_high'] == 'true') 357 { 358 $template->assign_block_vars('detail.high', array()); 359 } 360 else 361 { 362 $template->assign_block_vars('detail.no_high', array()); 363 } 364 } 301 365 } 302 366 } … … 352 416 { 353 417 $tokens = explode('-', $page['search']['fields']['date-before']); 354 355 (int)$tokens[0]; 356 (int)$tokens[1]; 357 (int)$tokens[2]; 358 } 418 419 $form['end_year'] = (int)$tokens[0]; 420 $form['end_month'] = (int)$tokens[1]; 421 $form['end_day'] = (int)$tokens[2]; 422 } 423 424 $form['pictures'] = $page['search']['fields']['pictures']; 425 $form['high'] = $page['search']['fields']['high']; 359 426 } 360 427 else … … 365 432 $form['start_month'] = $form['end_month'] = date('n'); 366 433 $form['start_day'] = $form['end_day'] = date('j'); 434 $form['pictures'] = 'yes'; 435 $form['high'] = 'yes'; 367 436 } 368 437 … … 380 449 ) 381 450 ); 451 452 foreach (array('pictures', 'high') as $block) 453 { 454 foreach (array('yes', 'no', 'only') as $item) 455 { 456 $selected = ''; 457 458 if ($item == $form[$block]) 459 { 460 $selected = 'selected="selected"'; 461 } 462 463 $template->assign_block_vars( 464 $block.'_option', 465 array( 466 'VALUE' => $item, 467 'CONTENT' => l10n($item), 468 'SELECTED' => $selected, 469 ) 470 ); 471 } 472 } 382 473 383 474 // +-----------------------------------------------------------------------+
Note: See TracChangeset
for help on using the changeset viewer.