Active users in this forum
1.3
* Important: Mod renamed and the discription has been changed! *
If you want to see how many people are in a certain forum on your board use this mod. If there are no users in a forum it will show as, • Active users in this forum: None, if there is more than one it will show as • Active users in this forum: 10 (or how ever many there are).
* Note: if you installed users_on_forum.mod version 1.0 you MUST uninstall it then install this.
» Version 1.1 (version listed as 1.0)
• Fixed bug where it said users always equaled "No Active Users", fixed it so it would say 0 and the real #'s on the other forums.
» Version 1.2
• Fixed the 0 number to show none. It looked bad with 0 there.
• Reworded what BoardIndex shows, use to be: Active users on this board, now it's Active users in this forum.
• Fixed some of the HTML and PERL code.
» Version 1.3 (Current release)
• Fixed the funniest bug I thought I'd never do, I did an error in subs.pl. Uninstall any older version and this one will FINALY work like a charm. ;) Sorry for that bug that got me 3 e-mails and took someone sending me their log.txt file to me. It's all fixed now and you won't get the 'dubbles' bug that lists 1 person as 2 people logged on.
On first run you may get "None" for all the boards, the active log (log.txt) must be updated, and as users click it updates. Don't worry if it doesn't work for about 3 to 9 min.
» No bugs have been found in this version. If you happen to find one please let me know so I can fix it (justin@starsabers.com or starsabers@starwarssource.net).
StarSaber
http://starsabers.starwarssource.net/cgi-bin/jfa/YaBB.pl
Sources/BoardIndex.pl
$lastposter ||= $txt{'470'};
$lastposttime ||= $txt{'470'};
# Start Active users in this forum mod
# Get memcount, first set to zero
$membercount = 0;
fopen(FILE, "$vardir/log.txt");
@entries = ;
fclose(FILE);
foreach $curentry (@entries) {
chomp $curentry;
($name, $value, $openthreadnow) = split(/\|/, $curentry);
if( $name ) {
&LoadUser($name);
if( exists $userprofile{$name} ) {
$users .= qq~ $userprofile{$name}->[1], \n~;
}
else { ++$guests; }
}
# Add one user to total.
if ($openthreadnow eq $curboard) { $currentlyopen2 = ++$membercount; }
}
# If there are no people on a forum print "None"
if ($membercount == 0) { $membercount = "None"; }
# Mod Finished Active users in this forum mod
$curboarddescr
»
$curboarddescr
• Active users in this forum: $membercount
•
Sources/Subs.pl
$field="$username";
$openthreadnow="$currentboard";
print LOG "$field\|$date\n";
print LOG "$field\|$date\|$openthreadnow\n";