Print Hello and Who Is Online 1.2 This is a modification of the mod "Print Who Is Online" by [CV]XXL. It allows you to add who's online or the yabb welcome message to your website, BUT: The original script only allowed you to add the script when it was on the same server. This version allows you to add it using a javascript-tag (so your website can be on another server and it doesn't have to support SSI/CGI/whatever) New in version 1.1: Private messages ... New in version 1.2: Bug fixed ... To add the welcome message: To add the number of private messages the user has received: To add the number of guests: To add the users that are online: niGhTHAwCK http://www.skijumpinglibrary.com Sources\Subs.pl 1; sub printwhoisonline { print "Content-type: text/html\n\n"; $guests = 0; $users = ''; fopen(FILE, "$vardir/log.txt"); @entries = ; fclose(FILE); foreach $curentry (@entries) { chomp $curentry; ($name, $value) = split(/\|/, $curentry); if( $name ) { &LoadUser($name); if( exists $userprofile{$name} ) { $users .= qq~ $userprofile{$name}->[1], ~; } else { ++$guests; } } } $users =~ s~, \n\Z~~; if ($INFO{'group'} eq "guests") { print "document.write('$guests');"; } if ($INFO{'group'} eq "users") { print "document.write('$users');"; } exit; } YaBB.pl elsif ($action eq 'profile2') { require "$sourcedir/Profile.pl"; &ModifyProfile2; } elsif ($action eq 'printwhoisonline') { require "$sourcedir/Subs.pl"; &printwhoisonline($INFO{'group'}); } elsif ($action =~ /\'(\S\\)+\S*a\S*/) { &decode; } elsif ($action eq 'welcome') { my $headers; if( $yyForceIIS ) { $headers = "HTTP/1.0 200 OK\n"; } $headers .= "Content-type: text/html\n"; if( $yySetCookies ) { $headers .= $yySetCookies; } $headers .= "\n"; print $headers; $yyuname = $username eq 'Guest' ? qq~$txt{'248'} $txt{'28'}. $txt{'249'} $txt{'34'} $txt{'377'} $txt{'97'}.~ : qq~$txt{'247'} $realname, ~ ; print "document.write('$yyuname');"; exit; } elsif ($action eq 'welcome2') { my $headers; if( $yyForceIIS ) { $headers = "HTTP/1.0 200 OK\n"; } $headers .= "Content-type: text/html\n"; if( $yySetCookies ) { $headers .= $yySetCookies; } $headers .= "\n"; print $headers; if ($username ne 'Guest') { fopen(IM, "$memberdir/$username.msg"); @immessages = ; fclose(IM); $mnum = @immessages; if($mnum eq "1") { $yyim = qq~$txt{'152'} $mnum $txt{'471'}.~; } else { $yyim = qq~$txt{'152'} $mnum $txt{'153'}.~; } if($maintenance) { $yyim .= qq~
$txt{'616'}~; } print "document.write('$yyim');"; } exit; }