The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Who is online code

2 posters

Go down

Solved Who is online code

Post by FIB February 16th 2015, 9:18 am

I found this code on here for a portal widget, which  was written by  Ange Tuteurhttps://help.forumotion.com/t138594-who-s-online  I have tried it but it's not working correctly can anyone help with this.


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>

Produces this which doesn't show any figures. 

Who is online code  Captur35


Last edited by FIB on February 17th 2015, 9:14 am; edited 1 time in total
avatar
FIB
Forumember

Male Posts : 491
Reputation : 2
Language : English
Location : UK

http://ourbulgariaforum.freeforums.eu/

Back to top Go down

Solved Re: Who is online code

Post by FIB February 17th 2015, 8:46 am

Any ideas anyone?
avatar
FIB
Forumember

Male Posts : 491
Reputation : 2
Language : English
Location : UK

http://ourbulgariaforum.freeforums.eu/

Back to top Go down

Solved Re: Who is online code

Post by Ange Tuteur February 17th 2015, 9:10 am

Hi @FIB,

That one looks to only work on phpbb3. You can find the updated code here : http://fmdesign.forumotion.com/t291-widget-custom-who-is-online-module
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Who is online code

Post by FIB February 17th 2015, 9:13 am

Thank you Ange Wink
avatar
FIB
Forumember

Male Posts : 491
Reputation : 2
Language : English
Location : UK

http://ourbulgariaforum.freeforums.eu/

Back to top Go down

Solved Re: Who is online code

Post by Ange Tuteur February 17th 2015, 9:51 am

You're welcome Smile

Topic archived

Have a nice day. ^^
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Back to top

- Similar topics

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