You are not buying this theme. This is only a preview for 5 sec Who's Online WordPress plugin. Features shown appear exactly the same in all themes.

Sidebar Widget

Just like any other widget you have to activate it by drag-n-dropping it in your Appearance – Widgets admin interface. The predefined txt is shown on the sidebar of this page. You can of course edit it in any way like. If you check the “Automatically add paragraphs” option WP will automatically convert line breaks in HTML breaks (<br />). The following variables are available to use in widget (and shortcode):

  • {total_cnt} – total number of users online
  • {guests_cnt} – number of guests/anonymous users online
  • {loggedin_cnt} – number of logged in users online
  • {loggedin_list} – comma separated list of logged in users online; ie: john, steve, peter
  • {loggedin_li} – <li> list of logged in users online, not wrapped in <ul>; ie: <li>john</li>, <li>steve</li>, <li>peter</li>
  • {loggedin_list_links} – comma separated list of logged in users online with links to their posts page; ie: <a href=”/archives/author/john/”>john</a>, <a href=”/archives/author/steve/”>steve</a>
  • {loggedin_li_links} – <li> list of logged in users online with links to their posts page, not wrapped in <ul>; ie: <li><a href=”/archives/author/john/”>john</a></li>, <li><a href=”/archives/author/steve/”>steve</a></li>
  • {loggedin_avatars} – <IMG> elements with logged in users (gr)avatars; img size 96×96. Images have “.avatar-96″ CSS class

Shortcode

The same syntax and variables used in the widget are used in the shortcode – [whos-online]. Just write the text you like and put {var-name} on places you whish to substitute with real values.
As well as writing text in the shortcode itself you can reference a custom field – [whos-online]$custom-field-name[/whos-online]. Then put the desired txt in custom field named “cutom-field-name”.

Dashboard Widget

As soon as you install the plugin your Admin Dashboard will have a new widget. By default it’s added as the last one, on the bottom. Of course you can move, minimize or disable it as any other Dashboard widget.
Numbers shown on widget: total users online, guests online, registered online and list of registered users online.

Admin Users Module Enhancement

If you open the Users module in your WP admin you’ll see a new column – Last Visit. It shows you the last visit time of registered users.
If the users has never visited the site after plugin installation it displays “Unknown” . If the user is still online it reads “A few minutes ago”, otherwise it displays the date and time in your WP date/time format (Options-General).

Theme PHP function

If you want to hard-code some of Who’s Online functionalities in theme files we’ve provided a function called get_whos_online(). It returns an array of values. Apart from the standard variables available in the shortcode and widget it also provides additional user info such as ID, username, email, etc. Sample output:

array (
  'total_cnt' => 2,
  'guests_cnt' => 1,
  'loggedin_cnt' => 1,
  'loggedin_li' => '<li>gordan</li>',
  'loggedin_list' => 'gordan',
  'loggedin_li_links' => '<li><a href="http://wptest.wt/author/gordan/">gordan</a></li>',
  'loggedin_list_links' => '<a href="http://wptest.wt/author/gordan/">gordan</a>',
  'loggedin_users' =>
  array (
    0 =>
    stdClass::__set_state(array(
       'ID' => '1',
       'user_login' => 'gordan',
       'user_nicename' => 'gordan',
       'user_email' => 'gordan@webtvornica.com',
       'display_name' => 'gordan',
       'last_visit_ts' => '1295877908',
       'posts_url' => 'http://wptest.wt/author/gordan/',
    )),
  ),
)

Comments are closed.