Changeset 1890
- Timestamp:
- Mar 11, 2007, 3:48:17 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/history.php
r1883 r1890 99 99 100 100 $search['fields']['types'] = $_POST['types']; 101 102 $search['fields']['user'] = $_POST['user']; 101 103 102 104 // echo '<pre>'; print_r($search); echo '</pre>'; … … 169 171 170 172 $page['search'] = unserialize($serialized_rules); 173 174 if (isset($_GET['user_id'])) 175 { 176 if (!is_numeric($_GET['user_id'])) 177 { 178 die('user_id GET parameter must be an integer value'); 179 } 180 181 $page['search']['fields']['user'] = $_GET['user_id']; 182 183 $query =' 184 INSERT INTO '.SEARCH_TABLE.' 185 (rules) 186 VALUES 187 (\''.serialize($page['search']).'\') 188 ;'; 189 pwg_query($query); 190 191 $search_id = mysql_insert_id(); 192 193 redirect( 194 PHPWG_ROOT_PATH.'admin.php?page=history&search_id='.$search_id 195 ); 196 } 171 197 172 198 // echo '<pre>'; print_r($page['search']); echo '</pre>'; … … 218 244 } 219 245 } 246 247 if (isset($page['search']['fields']['user']) 248 and $page['search']['fields']['user'] != -1) 249 { 250 array_push( 251 $clauses, 252 'user_id = '.$page['search']['fields']['user'] 253 ); 254 } 220 255 221 256 $clauses = prepend_append_array_items($clauses, '(', ')'); … … 378 413 continue; 379 414 } 415 416 $user_string = ''; 417 if (isset($username_of[$line['user_id']])) 418 { 419 $user_string.= $username_of[$line['user_id']]; 420 } 421 else 422 { 423 $user_string.= $line['user_id']; 424 } 425 $user_string.= ' <a href="'; 426 $user_string.= PHPWG_ROOT_PATH.'admin.php?page=history'; 427 $user_string.= '&search_id='.$page['search_id']; 428 $user_string.= '&user_id='.$line['user_id']; 429 $user_string.= '">+</a>'; 380 430 381 431 $template->assign_block_vars( … … 384 434 'DATE' => $line['date'], 385 435 'TIME' => $line['time'], 386 'USER' => isset($username_of[$line['user_id']]) 387 ? $username_of[$line['user_id']] 388 : $line['user_id'] 389 , 436 'USER' => $user_string, 390 437 'IP' => $line['IP'], 391 438 'IMAGE' => isset($line['image_id']) … … 480 527 481 528 $form['types'] = $page['search']['fields']['types']; 529 530 if (isset($page['search']['fields']['user'])) 531 { 532 $form['user'] = $page['search']['fields']['user']; 533 } 534 else 535 { 536 $form['user'] = null; 537 } 482 538 } 483 539 else … … 523 579 ); 524 580 } 581 582 $template->assign_block_vars( 583 'user_option', 584 array( 585 'VALUE'=> -1, 586 'CONTENT' => '------------', 587 'SELECTED' => '' 588 ) 589 ); 590 591 $query = ' 592 SELECT 593 '.$conf['user_fields']['id'].' AS id, 594 '.$conf['user_fields']['username'].' AS username 595 FROM '.USERS_TABLE.' 596 ORDER BY username ASC 597 ;'; 598 $result = pwg_query($query); 599 600 while ($row = mysql_fetch_array($result)) 601 { 602 $selected = ''; 603 604 if ($row['id'] == $form['user']) 605 { 606 $selected = 'selected="selected"'; 607 } 608 609 $template->assign_block_vars( 610 'user_option', 611 array( 612 'VALUE' => $row['id'], 613 'CONTENT' => $row['username'], 614 'SELECTED' => $selected, 615 ) 616 ); 617 } 525 618 526 619 // +-----------------------------------------------------------------------+ -
trunk/template/yoga/admin/history.tpl
r1883 r1890 62 62 </label> 63 63 64 <label> 65 {lang:User} 66 <select name="user"> 67 <!-- BEGIN user_option --> 68 <option value="{user_option.VALUE}" {user_option.SELECTED}> 69 {user_option.CONTENT} 70 </option> 71 <!-- END user_option --> 72 </select> 73 </label> 74 64 75 <input class="submit" type="submit" name="submit" value="{lang:submit}" /> 65 76 </fieldset>
Note: See TracChangeset
for help on using the changeset viewer.