Users in Template
1.0
This version for YaBB 1 Gold SP 1.3 and 1.3.1
As with any mod, please back up your files before applying.
This mod adds current users online info to the forum template in the form:
Users online: Total:1 Forum Administrators: Admin Global Moderators: None Users: None Guests: 0
-------------------------------
Installation:
See FAQ at www.boardmod.org to learn more about installing mods.
Be sure that the files you are modding are the most current for your forum.
Apply the mod manually or with BoardMod.
Upload modified english.lng, Subs.pl, and template.html files in ASCII mode.
Chmod template.html file to 777.
-------------------------------
To Use:
To add the Users in Template info to your forum, add this tag to
your forum template:
where you want the info to appear. Note that the info is wrapped
in a table and in a single line.
Onscreen text is found in the language file. Fonts and colors are set using
CSS definition .UinT01 in the forum template. Other layout changes would
have to be made in the Subs.pl file.
-------------------------------
This mod is based on LooneyPandora's Whoson script. The only changes I made
were to move his script to the template and to remove some line breaks.
Ironwing
http://www.mineralarts.com/cgi/yabbsp1/YaBB.pl
english.lng
1;
$UinTtxt{'01'} = "None";
$UinTtxt{'02'} = "Global Moderators";
Sources/Subs.pl
$yyboardname = $mbname;
######### Start UsersinTemplate mod
$guests = 0;
$counter = 0;
$modcounter = 0;
$admincounter = 0;
$users = '';
$moderators = '';
$admins = '';
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} ) {
if ($userprofile{$name}->[7] eq "Administrator") {
$admins .= qq~ $userprofile{$name}->[1], \n~;
$admincounter++;
} elsif ($userprofile{$name}->[7] eq "Global Moderator") {
$moderators .= qq~ $userprofile{$name}->[1], \n~;
$modcounter++;
} else {
$users .= qq~ $userprofile{$name}->[1], \n~;
$counter++;
}
} else { ++$guests; }
}
}
$users =~ s~, \n\Z~~;
$moderators =~ s~, \n\Z~~;
$admins =~ s~, \n\Z~~;
$countonl = $counter + $admincounter + $modcounter + $guests;
chomp $users;
if($users eq '') {
$users = "$UinTtxt{'01'}";
}
chomp $admins;
if($admins eq '') {
$admins = "$UinTtxt{'01'}";
}
chomp $moderators;
if($moderators eq '') {
$moderators = "$UinTtxt{'01'}";
}
if($countonl eq '') {
$countonl = "$UinTtxt{'01'}";
}
$yyUinT = qq~