The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Staff Online Widget

View previous topic View next topic Go down

Staff Online Widget

Post by refresh101 on May 4th 2013, 3:45 pm

Can Any One Tell Me How To Put A Staff Online Widget?

refresh101
Forumember

Posts : 241
Reputation : 4
Language : English

Back to top Go down

Re: Staff Online Widget

Post by Adi. on May 4th 2013, 6:06 pm


Adi.
New Member

Posts : 2
Reputation : 1
Language : Romanian

Back to top Go down

Re: Staff Online Widget

Post by refresh101 on May 5th 2013, 2:30 am

Thats Why I Post Here Because I Dont Understand Anything There Sad AnyOne Help Please.

refresh101
Forumember

Posts : 241
Reputation : 4
Language : English

Back to top Go down

Re: Staff Online Widget

Post by tommycoo on May 5th 2013, 3:35 am

please read this post carefully from the first page http://www.avacweb.com/t114-online-list-widget Smile

tommycoo
Forumember

Male Posts : 615
Reputation : 9
Language : Indonesia

http://www.atlanta.forumid.net

Back to top Go down

Re: Staff Online Widget

Post by refresh101 on May 5th 2013, 4:21 am

TommyCo Thats Why I Said I Cant UnderStand It Already Read That Can Anyone DO It For Me?

refresh101
Forumember

Posts : 241
Reputation : 4
Language : English

Back to top Go down

Re: Staff Online Widget

Post by tommycoo on May 5th 2013, 6:01 am

first you need to put your online widget in first widget, then put the staff online below the online widget. Then it should be work Very Happy

tommycoo
Forumember

Male Posts : 615
Reputation : 9
Language : Indonesia

http://www.atlanta.forumid.net

Back to top Go down

Re: Staff Online Widget

Post by refresh101 on May 5th 2013, 6:29 am

What ? I Dont Understand You Tommy Can You Please Give Me The Full Tutorial Please Very Happy

refresh101
Forumember

Posts : 241
Reputation : 4
Language : English

Back to top Go down

Re: Staff Online Widget

Post by tommycoo on May 5th 2013, 9:47 am

first you need to set your widget like this



the staff widget code is this
Code:
        <style>.staffname{display:block;}</style>
            <div id="onlineStaff">
            <span class="staffname">admin</span>
            <span class="staffname">More name here..</span>
            </div>
        <script>
        jQuery(function() {
          var x = jQuery('.module', document.getElementById('left'))[0].innerHTML;
          var y = jQuery('.staffname', document.getElementById('onlineStaff'));
          for (var i=0, l = y.length; i<l; i++) {
            if (x.indexOf(y[i].innerHTML) > 0) {
              y[i].innerHTML+=" - Online";
            }
            else { y[i].innerHTML+=" - Offline"; }
          }
        });
        </script>

if your widget on the right side then you need to change this part
Code:
          var x = jQuery('.module', document.getElementById('left'))[0].innerHTML;

to this
Code:
          var x = jQuery('.module', document.getElementById('right'))[0].innerHTML;

that only work in phpbb3 and punbb, that i tested work Smile

tommycoo
Forumember

Male Posts : 615
Reputation : 9
Language : Indonesia

http://www.atlanta.forumid.net

Back to top Go down

Re: Staff Online Widget

Post by refresh101 on May 5th 2013, 9:50 am

Well Let Me Try It Very Happy

refresh101
Forumember

Posts : 241
Reputation : 4
Language : English

Back to top Go down

Re: Staff Online Widget

Post by refresh101 on May 5th 2013, 9:56 am

Okay It Works But I Want To Remove The Who Is Online Widget And The Online/Offline I Want Icon Not A Word Is That Possible.

BTW. Thanks For The Code And Please Answer Very Happy

refresh101
Forumember

Posts : 241
Reputation : 4
Language : English

Back to top Go down

Re: Staff Online Widget

Post by tommycoo on May 5th 2013, 10:03 am

for hide the who is online widget, i don't if this code working. i just copied from LG

here change all script with this
Code:
<script>
jQuery(function() {
  var x = jQuery('.column:last .module')[1];
  var y = jQuery('.staffname', document.getElementById('onlineStaff'));
  x.style.display = 'none';
  for (var i=0, l = y.length; i<l; i++) {
    if (x.indexOf(y[i].innerHTML) > 0) {
      y[i].innerHTML+=" - Online";
    }
    else { y[i].innerHTML+=" - Offline"; }
  }
});
</script>

if you want to change it to image.
then you must change this line
Code:
      y[i].innerHTML+=" - Online";
    } else { y[i].innerHTML+=" - Offline"; }

to this
Code:
      y[i].innerHTML+=' <img src="'+'URL OF ONLINE IMAGE'+'">';
    } else { y[i].innerHTML+='<img src="'+'URL OF OFFLINE IMAGE'+'">'; }

tommycoo
Forumember

Male Posts : 615
Reputation : 9
Language : Indonesia

http://www.atlanta.forumid.net

Back to top Go down

Re: Staff Online Widget

Post by BL@DE on May 5th 2013, 10:07 am

sorry to but in. can this be done for phpbb2 ?

BL@DE
Forumember

Male Posts : 153
Reputation : 10
Language : English
Location : England

Back to top Go down

Re: Staff Online Widget

Post by Ultron's Vision on May 5th 2013, 10:24 am

LGforum provided a way how to do this, yes.

Anyway, you created that widget, put the Online Staff Widget underneath it, then add this code in your Staff Widget.

Code:
<script type="text/javascript"> jQuery(function() { var x = document.getElementById('right').getElementsByTagName('table')[8]; var y = document.getElementById('onlineStaff').getElementsByTagName('span'); for (i=0; i<y.length; i++) { if (x.innerHTML.indexOf(y[i].innerHTML) == 1) y[i].innerHTML+=" - Online"; else y[i].innerHTML+=" - Offline"; } }); </script>

If you want the Who is Online widget to disappear, add this code to the JavaScript pages:

Code:
jQuery(document).ready(function(){

jQuery('#right table:nth-of-type(8)').css('display','none');

});

Ultron's Vision
Forumember

Male Posts : 634
Reputation : 45
Language : English | German | HTML | JavaScript | PHP | C++ | Perl | Java
Location : Vienna, Austria

http://duelacademy.net

Back to top Go down

Re: Staff Online Widget

Post by refresh101 on May 5th 2013, 10:33 am

Sir Ultron Its Not Working It Only Shows The Table Only Doesnt Seem Working Sad

refresh101
Forumember

Posts : 241
Reputation : 4
Language : English

Back to top Go down

Re: Staff Online Widget

Post by BL@DE on May 5th 2013, 10:40 am

ok thxs for that mate. can this be put on the portal ?

BL@DE
Forumember

Male Posts : 153
Reputation : 10
Language : English
Location : England

Back to top Go down

Re: Staff Online Widget

Post by Ultron's Vision on May 5th 2013, 10:46 am

Okay, step by step.

First of all, create a new widget (go to: Administration Panel -> Modules -> Forum widget management -> Create a new widget (usually, it'll be displayed as a green plus)) titled Staff Widget or any nice name you want it to have. Add the widget on top of all widgets - this is important so that the code works a bit easier.
The widget should contain this code:

Code:
<div id="onlineStaff">
<span class="staffname">refresh101</span>
</div>
<script type="text/javascript"> jQuery(function() { var x = document.getElementById('right').getElementsByTagName('table')[8]; var y = document.getElementById('onlineStaff').getElementsByTagName('span'); for (i=0; i<y.length; i++) { if (x.innerHTML.indexOf(y[i].innerHTML) == 1) y[i].innerHTML+=" - Online" /* replace "- Online" with "- <img src='your image URL here, preferably an icon */; else y[i].innerHTML+=" - Offline" /*replace "- Offline" with "- <img src='your image URL here, preferably an icon */; } }); </script>

Hit save, add it to the top of the widget list on the right side, then look for the predefined 'Who is Online' widget and drag it UNDERNEATH the newly created widget.
I commented inside the code what you need to do if you want images instead of text.

Next, do this part only if you do not want to see the Who is Online widget, add it under Administration Panel -> Modules -> JavaScript pages -> Create a new JavaScript:

Code:
$(document).ready(function(){

$('#right table:nth-of-type(8)').css('display','none');

});

Ultron's Vision
Forumember

Male Posts : 634
Reputation : 45
Language : English | German | HTML | JavaScript | PHP | C++ | Perl | Java
Location : Vienna, Austria

http://duelacademy.net

Back to top Go down

Re: Staff Online Widget

Post by refresh101 on May 5th 2013, 10:52 am

The Whos Online List Show Ultra Vision Sad


Last edited by refresh101 on May 5th 2013, 11:00 am; edited 2 times in total

refresh101
Forumember

Posts : 241
Reputation : 4
Language : English

Back to top Go down

Re: Staff Online Widget

Post by BL@DE on May 5th 2013, 10:54 am

refresh101 can u help me out with this plz mate ?

BL@DE
Forumember

Male Posts : 153
Reputation : 10
Language : English
Location : England

Back to top Go down

Re: Staff Online Widget

Post by refresh101 on May 5th 2013, 10:56 am

Make Your Own Thread Bl@de. Very Happy


EDIT: Please Dont Lock The Topic Yet Because I Still Dont Know How To Hide Whos Online. Widget. Thank You Very Happy


The Whos Online Still In The Forum Ultron's Vision Sad

refresh101
Forumember

Posts : 241
Reputation : 4
Language : English

Back to top Go down

Re: Staff Online Widget

Post by Jophy on May 5th 2013, 2:37 pm

@refresh101 wrote:Well Let Me Try It Very Happy

@refresh101 wrote:Okay It Works But I Want To Remove The Who Is Online Widget And The Online/Offline I Want Icon Not A Word Is That Possible.

BTW. Thanks For The Code And Please Answer Very Happy
Please don't double/triple post. Your post need to be separated by 24 hours before bumping, replying or adding more information. Please use the edit button instead! The next time you do it again you'll earn a serious warning.

Jophy
ForumGuru

Male Posts : 17924
Reputation : 835
Language : English
Location : Somewhere

Back to top Go down

View previous topic View next topic Back to top


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