Example #1
0
function _useronline_init()
{
    load_plugin_textdomain('wp-useronline', '', dirname(plugin_basename(__FILE__)) . '/lang');
    require_once dirname(__FILE__) . '/core.php';
    require_once dirname(__FILE__) . '/template-tags.php';
    require_once dirname(__FILE__) . '/deprecated.php';
    require_once dirname(__FILE__) . '/widget.php';
    new scbTable('useronline', __FILE__, "\n\t\ttimestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n\t\tuser_type varchar( 20 ) NOT NULL default 'guest',\n\t\tuser_id bigint( 20 ) NOT NULL default 0,\n\t\tuser_name varchar( 250 ) NOT NULL default '',\n\t\tuser_ip varchar( 39 ) NOT NULL default '',\n\t\tuser_agent text NOT NULL,\n\t\tpage_title text NOT NULL,\n\t\tpage_url varchar( 255 ) NOT NULL default '',\n\t\treferral varchar( 255 ) NOT NULL default '',\n\t\tUNIQUE KEY useronline_id ( timestamp, user_type, user_ip )\n\t", 'delete_first');
    $most = new scbOptions('useronline_most', __FILE__, array('count' => 1, 'date' => current_time('timestamp')));
    $options = new scbOptions('useronline', __FILE__, array('timeout' => 300, 'url' => trailingslashit(get_bloginfo('url')) . 'useronline', 'names' => false, 'naming' => array('user' => __('1 User', 'wp-useronline'), 'users' => __('%COUNT% Users', 'wp-useronline'), 'member' => __('1 Member', 'wp-useronline'), 'members' => __('%COUNT% Members', 'wp-useronline'), 'guest' => __('1 Guest', 'wp-useronline'), 'guests' => __('%COUNT% Guests', 'wp-useronline'), 'bot' => __('1 Bot', 'wp-useronline'), 'bots' => __('%COUNT% Bots', 'wp-useronline')), 'templates' => array('useronline' => '<a href="%PAGE_URL%"><strong>%USERS%</strong> ' . __('Online', 'wp-useronline') . '</a>', 'browsingsite' => array('separators' => array('members' => __(',', 'wp-useronline') . ' ', 'guests' => __(',', 'wp-useronline') . ' ', 'bots' => __(',', 'wp-useronline') . ' '), 'text' => _x('Users', 'Template Element', 'wp-useronline') . ': <strong>%MEMBER_NAMES%%GUESTS_SEPARATOR%%GUESTS%%BOTS_SEPARATOR%%BOTS%</strong>'), 'browsingpage' => array('separators' => array('members' => __(',', 'wp-useronline') . ' ', 'guests' => __(',', 'wp-useronline') . ' ', 'bots' => __(',', 'wp-useronline') . ' '), 'text' => '<strong>%USERS%</strong> ' . __('Browsing This Page.', 'wp-useronline') . '<br />' . _x('Users', 'Template Element', 'wp-useronline') . ': <strong>%MEMBER_NAMES%%GUESTS_SEPARATOR%%GUESTS%%BOTS_SEPARATOR%%BOTS%</strong>'))));
    UserOnline_Core::init($options, $most);
    scbWidget::init('UserOnline_Widget', __FILE__, 'useronline');
    if (is_admin()) {
        require_once dirname(__FILE__) . '/admin.php';
        scbAdminPage::register('UserOnline_Admin_Integration', __FILE__);
        scbAdminPage::register('UserOnline_Options', __FILE__, UserOnline_Core::$options);
    }
    if (function_exists('stats_page')) {
        require_once dirname(__FILE__) . '/wp-stats.php';
    }
    #	scbUtil::do_uninstall( __FILE__ );
    #	scbUtil::do_activation( __FILE__ );
}