Print Who Is Online 1.1 for SP1.3-SP1.3.2 Put information about how many guests and members are currently online on your homepage via SSI, Iframes or JavaScript. THIS MOD IS COMPATIBLE WITH SP1.3-SP1.3.2 ----------------------------------------------------- If your host supports SSI, follow these instructions: ----------------------------------------------------- 1. Rename the page where you want this information to be displayed to *.shtml 2. Open your *.shtml file and add one or more of the following tags where you want the information to be displayed: To display the number of guests online add: To display the number of registred members online add: To display the complete list of members online add: To display all these information at once use: You may have to replace "./cgi-bin/yabb/YaBB.pl" by your board path!!! ----------------------------- If you want to use an Iframe: ----------------------------- Add the following to your html page: If you want to change the colors, simply edit bgcolor, textcolor and linkcolor in that tag. You may have to replace "./cgi-bin/yabb/YaBB.pl" by your board path!!! ------------------------------ If you want to use JavaScript: ------------------------------ Note that JavaScript must be enabled on clients, otherwise they won't see anything!!! Add the following to your html page: To display the number of guests online add: To display the number of registred members online add: To display the complete list of members online add: To display all these information at once use: You may have to replace "./cgi-bin/yabb/YaBB.pl" by your board path!!! version 1.1: - added ability to change background-, text- and linkcolors for Iframes Michael Prager http://www.boardmod.org Sources/SubList.pl %director=( 'printwhoisonline',"Subs.pl&printwhoisonline", Sources\Subs.pl 1; sub printwhoisonline { $guests = 0; $numusers = 0; $users = ''; fopen(FILE, "$vardir/log.txt"); @entries = ; fclose(FILE); foreach $curentry (@entries) { chomp $curentry; ($name, $value) = split(/\|/, $curentry); if($name) { if(!$yyUDLoaded{$musername}) { &LoadUser($name); } if(exists $userprofile{$name}) { $numusers++; $users .= qq~ $userprofile{$name}->[1], \n~; } else { $guests++; } } } $users =~ s~, \n\Z~~; print "Content-type: text/html\n\n"; if ($INFO{'type'} eq "java") { if ($INFO{'group'} eq "guestcount") { print "document.write('$guests')"; } elsif ($INFO{'group'} eq "membercount") { print "document.write('$numusers')"; } elsif ($INFO{'group'} eq "members") { print "document.write('$users')"; } else { print qq~document.write('$guests $txt{'141'}, $numusers $txt{'142'}
$users')~; } } elsif ($INFO{'type'} eq "frame") { $bgcolor = $INFO{'bgcolor'} ? $INFO{'bgcolor'} : 'FFFFFF'; $textcolor = $INFO{'textcolor'} ? $INFO{'textcolor'} : "000000"; $linkcolor = $INFO{'linkcolor'} ? $INFO{'linkcolor'} : '0000FF'; print qq~ $guests $txt{'141'}, $numusers $txt{'142'}
$users ~; } else { if ($INFO{'group'} eq "guestcount") { print "$guests"; } elsif ($INFO{'group'} eq "membercount") { print "$numusers"; } elsif ($INFO{'group'} eq "members") { print "$users"; } else { print qq~$guests $txt{'141'}, $numusers $txt{'142'}
$users~; } } exit; }