Changeset 1893
- Timestamp:
- Mar 11, 2007, 6:40:59 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/history.php
r1892 r1893 466 466 $last_line = $page['start'] + $conf['nb_logs_page']; 467 467 468 $total_filesize = 0; 468 $summary['total_filesize'] = 0; 469 $summary['guests_IP'] = array(); 469 470 470 471 foreach ($history_lines as $line) 471 472 { 473 // FIXME when we watch the representative of a non image element, it is 474 // the not the representative filesize that is counted (as it is 475 // unknown) but the non image element filesize. Proposed solution: add 476 // #images.representative_filesize and add 'representative' in the 477 // choices of #history.image_type. 478 472 479 if (isset($line['image_type'])) 473 480 { … … 476 483 if (isset($high_filesize_of_image[$line['image_id']])) 477 484 { 478 $total_filesize+= $high_filesize_of_image[$line['image_id']]; 485 $summary['total_filesize']+= 486 $high_filesize_of_image[$line['image_id']]; 479 487 } 480 488 } … … 483 491 if (isset($filesize_of_image[$line['image_id']])) 484 492 { 485 $total_filesize+= $filesize_of_image[$line['image_id']]; 493 $summary['total_filesize']+= 494 $filesize_of_image[$line['image_id']]; 486 495 } 487 496 } 497 } 498 499 if ($line['user_id'] == $conf['guest_id']) 500 { 501 if (!isset($summary['guests_IP'][ $line['IP'] ])) 502 { 503 $summary['guests_IP'][ $line['IP'] ] = 0; 504 } 505 506 $summary['guests_IP'][ $line['IP'] ]++; 488 507 } 489 508 … … 557 576 } 558 577 578 $summary['nb_guests'] = 0; 579 if (count(array_keys($summary['guests_IP'])) > 0) 580 { 581 $summary['nb_guests'] = count(array_keys($summary['guests_IP'])); 582 583 // we delete the "guest" from the $username_of hash so that it is 584 // avoided in next steps 585 unset($username_of[ $conf['guest_id'] ]); 586 } 587 588 $summary['nb_members'] = count($username_of); 589 590 $member_strings = array(); 591 foreach ($username_of as $user_id => $user_name) 592 { 593 $member_string = $user_name.' <a href="'; 594 $member_string.= PHPWG_ROOT_PATH.'admin.php?page=history'; 595 $member_string.= '&search_id='.$page['search_id']; 596 $member_string.= '&user_id='.$user_id; 597 $member_string.= '">+</a>'; 598 599 $member_strings[] = $member_string; 600 } 601 559 602 $template->assign_block_vars( 560 603 'summary', 561 604 array( 562 'FILESIZE' => $total_filesize.' KB', 605 'NB_LINES' => sprintf( 606 l10n('%d lines filtered'), 607 $page['nb_lines'] 608 ), 609 'FILESIZE' => $summary['total_filesize'].' KB', 610 'USERS' => sprintf( 611 l10n('%d users'), 612 $summary['nb_members'] + $summary['nb_guests'] 613 ), 614 'MEMBERS' => sprintf( 615 l10n('%d members: %s'), 616 $summary['nb_members'], 617 implode( 618 ', ', 619 $member_strings 620 ) 621 ), 622 'GUESTS' => sprintf( 623 l10n('%d guests'), 624 $summary['nb_guests'] 625 ), 563 626 ) 564 627 ); -
trunk/template/yoga/admin/history.tpl
r1892 r1893 92 92 93 93 <ul> 94 <li>{summary.NB_LINES}</li> 94 95 <li>{summary.FILESIZE}</li> 96 <li> 97 {summary.USERS} 98 <ul> 99 <li>{summary.MEMBERS}</li> 100 <li>{summary.GUESTS}</li> 101 </ul> 102 </li> 95 103 </ul> 96 104 </fieldset>
Note: See TracChangeset
for help on using the changeset viewer.