This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ require_once( AOC_PATH . '/includes/users-widget.php' ); /** * Widget class to list last user access to the site. * @package AOC * @subpackage Login * @since 0.8 */ final class aocLoggedIn extends aocUsersWidget { /** * Widget StartUp. * @see aocUsersWidget::startUp() */ protected function widgetLoad () { $this->wID = 'aoc_logged_in'; $this->wTitle = __('Logged in users', $this->PID); $this->wOptions = array( 'classname' => 'widget_loggedin_recent', 'description' => __('Latest users that accessed the site.', $this->PID) ); } /** * Widget Output. * @see WP_Widget::widget() */ public function widget ( $args, $instance ) { global $wpdb; extract ( $args, EXTR_SKIP); $number = (int) $instance['number']; if ( 1 > $number ) { $number = 5; } elseif ( 20 < $number ) { $number = 20; } echo $before_widget; if ( !empty($instance['title']) ) { echo $before_title. $instance['title'] . $after_title; } echo ''; echo $after_widget; } }