Who's Online ?

Go down

In progress Who's Online ?

Post by Matrix317 on Tue 27 Jan 2015 - 8:10

How to do this for the Portal? Who's Online

Matrix317
New Member

Posts : 21
Reputation : 1
Language : England

http://testaillla.foorumi.biz/forum

Back to top Go down

In progress Re: Who's Online ?

Post by Matrix317 on Wed 28 Jan 2015 - 6:23

Bump

Matrix317
New Member

Posts : 21
Reputation : 1
Language : England

http://testaillla.foorumi.biz/forum

Back to top Go down

In progress Re: Who's Online ?

Post by Ange Tuteur on Wed 28 Jan 2015 - 22:41

Hello @Matrix317,

By default there is a who is online modules that you can drag and drop onto your portal.

Go to Administration Panel > Modules > Portal widgets management

Under your portal structure, drag and drop "who is online" from "existing widgets" into your structure and save.


If you want it like the widget in your example, click "create a widget" instead.

Widget name : Your choice
Use a table type : Yes
Paste this as the source :
Code:
<style type="text/css">#whois_module .label { font-size:10px; padding-left:8px; position:relative; }
#whois_module .label:before { content:"."; font-size:0px; background:#6A6; border-radius:3px; box-shadow:0 0 3px #6C6; display:inline-block; height:5px; width:5px; position:absolute; top:3px; left:0; }
#whois_online { height:100px; overflow:auto; }</style>

<div id="whois_module">
  <div><span class="label">Guests :</span> <span id="whois_guests">0</span></div>
  <div><span class="label">Hidden :</span> <span id="whois_hidden">0</span></div>
  <div><span class="label">Registered :</span> <span id="whois_registered">0</span></div>
  <div>
    <span class="label">Users Online :</span>
    <div id="whois_online"></div>
  </div>
  <a href="#update" id="whois_refresh">Refresh</a>
</div>
 
<script type="text/javascript">//<![CDATA[
(function() {
  var cache = 5*60*1000, storage = window.localStorage;
  if (storage.whoisHTML && storage.whoisCache > +new Date - cache) document.getElementById('whois_module').innerHTML = storage.whoisHTML;
  else getOnline();
  document.getElementById('whois_refresh').onclick = function() {
    document.getElementById('whois_online').innerHTML = '';
    getOnline();
    return false;
  }
 
  function getOnline() {
    jQuery.get('/viewonline',function(data){
      document.getElementById('whois_guests').innerHTML = jQuery('h1.page-title + p',data).text().match(/(\d+)/)[1];
      document.getElementById('whois_hidden').innerHTML = jQuery('h1.page-title',data).text().match(/^.*? \d+ .*? (\d+) .*/)[1]
      document.getElementById('whois_registered').innerHTML = jQuery('h1.page-title',data).text().match(/^.*? (\d+) .*? \d+ .*/)[1];
      for (var i=0,a=jQuery('.forumbg tbody tr',data); i<a.length; i++) document.getElementById('whois_online').innerHTML += '<div class="whois_row">' + a[i].firstChild.innerHTML + '</div>';
      storage && (storage.whoisCache = +new Date, storage.whoisHTML = document.getElementById('whois_module').innerHTML);
    });
  }
})();
//]]></script>

Save, and then drag and drop the widget from "personal widgets" into your portal.
avatar
Ange Tuteur
Forumaster

Male Posts : 13195
Reputation : 2910
Language : EN10, FR5, JA5
Location : Macungie, PA

https://github.com/SethClydesdale

Back to top Go down

In progress Re: Who's Online ?

Post by _Twisted_Mods_ on Fri 13 Feb 2015 - 2:12

Has this request been completed?
If so could you edit your first post and change the post icon to Solved.
Thank you!
avatar
_Twisted_Mods_
Helper
Helper

Male Posts : 2064
Reputation : 314
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum