Users Online Counter - English (Enhanced)
1.3.X (modified by MP)
Want to know how many users are on your board and your website? Install this mod to find out.
V1.1:
- now it saves and displays (if it's turned on) what the day was with the most
users and how much users were online
- you can now disable the whole Users Online Bar from Admin Center
- if guestaccess is turned off "Guests" will not be displayed and counted
to the online counter file
V1.2:
- shows what a user is doing on the board
- shows a link to the online overview optional for all user or just admins
- shows the ips of the users to the admins in the online overview
- admin actions can be hidden for other users
V1.3:
- rewritten for YaBB 1 Gold - SP1
- added a fast find similar to what is in YaBB.pl
- code uses fclose/fopen now
- fixed some grammar in the english.lng file
- fixed a few layout problems
- added code to show users browsing the website
- other misc changes
Credits:
Original version by DaddyCool.
Gold version by dOCda S! (http://gpu.hackers.sk/hacks/).
SP1 version by Gobalopper.
Gobalopper
http://www.dune2k.com/
Sources/BoardIndex.pl
~;
}
## WHOSON MOD END ##
Sources/AdminEdit.pl
if ($Show_RecentBar) { $srbarchecked = "checked" }
## WHOSON MOD START ##
if ($Show_OnlineBar || $Show_OnlineBar eq "") { $onlbarchecked = "checked" }
if ($Show_MostUsers) { $smuchecked = "checked" }
if ($Show_WhosOn) { $swochecked = "checked" }
if ($onlopt) { $whoon = "checked" }
if ($adminwho) { $admindisplay = "checked" }
## WHOSON MOD END ##
$txt{'740'}
$mosttxt{'04'}
$mosttxt{'05'}
$who{'101'}
$who{'102'}
$who{'104'}
$who{'110'}
# Set as 0 or 1 if box was checked or not
my $fi;
## WHOSON MOD START ##
push(@onoff, "showonlinebar", "showmostusers", "showwhoson", "onlopt", "adminwho");
## WHOSON MOD END ##
$timeout = $FORM{'timeout'} || 5;
## WHOSON MOD START ##
$whotime = $FORM{'whotime'} || 30;
## WHOSON MOD END ##
\$Show_RecentBar = $showrecentbar; # Set to 1 to display the Recent Post on Board Index
## WHOSON MOD START ##
\$Show_OnlineBar = $showonlinebar; # Set to 1 to display the Who's Online List table row on Board Index
\$Show_MostUsers = $showmostusers; # Set to 1 to display the Line with Most Users Online in the Who's Online List
\$Show_WhosOn = $showwhoson; # Set to 1 to add the text Who's Online to your YaBB menu
\$onlopt = $onlopt; # Set to 1 to enable Online Overview for all
\$adminwho = $adminwho; # Set to 1 to enable the actions display in the Online Overview
\$whotime = $whotime; # Number of Seconds to refresh the Online table
## WHOSON MOD END ##
Sources/Subs.pl
$date = "$mon_num/$mday/$saveyear $txt{'107'} $hour\:$min\:$sec";
## WHOSON MOD START ##
$logdate = "$mon_num.$mday.$saveyear $txt{'107'} $hour\:$min\:$sec";
## WHOSON MOD END ##
fopen(LOG, "$vardir/log.txt");
my @online = ;
fclose(LOG);
fopen(LOG, ">$vardir/log.txt", 1);
print LOG "$field|$date\n";
foreach $curentry (@online) {
$curentry =~ s/\n//g;
($name, $date1) = split(/\|/, $curentry);
$date2 = $date;
chomp $date1;
chomp $date2;
&calctime;
if($name ne $field && $result <= $OnlineLogTime && $result >= 0) { print LOG "$curentry\n"; }
if(-e "$memberdir/$name.dat" && $result > $OnlineLogTime) {&WriteLastOnline($name, $date, "x", "x");}
}
fclose(LOG);
## WHOSON MOD START ##
fopen(LOG, "$vardir/log.txt");
my @online = ;
fclose(LOG);
fopen(LOG, ">$vardir/log.txt", 1);
print LOG "$field\|$logdate\|$date\|$username\|$INFO{'board'}\|$INFO{'action'}\|$INFO{'username'}\|$INFO{'num'}|$user_ip\n";
foreach $curentry (@online) {
$curentry =~ s/\n//g;
($name, $value, $name1, $name2, $name3, $name4, $name5, $name6, $ipinfo) = split(/\|/, $curentry);
$date1 = "$value";
$date2 = "$logdate";
&calctime;
if($name ne $field && $result <= $OnlineLogTime && $result >= 0 && $name ne $user_ip) { print LOG "$curentry\n"; }
if(-e "$memberdir/$name.dat" && $result > $OnlineLogTime) {&WriteLastOnline($name, $date, "x", "x");}
}
fclose(LOG);
## WHOSON MOD END ##
$yymenu .= qq~$menusep$img{'logout'}~;
}
if($Show_WhosOn && $username ne 'Guest') { $yymenu .= qq~$menusep$img{'whoson'}~; }
english.lng
$img{'website_sm'} = qq~$txt{'515'}~;
$img{'whoson'} = qq~$who{'2'}~;
$txt{'749'} = "The 'number of posts' box can only contain digits.";
## WHOSON MOD START ##
$mosttxt{'01'} = "The day with the most Users online was";
$mosttxt{'02'} = "with";
$mosttxt{'03'} = "Users!";
$mosttxt{'04'} = "Show Who's Online info on the Board Index?";
$mosttxt{'05'} = "Display 'Most Users Online' Info?";
$who{'1'} = "Name";
$who{'2'} = "Who's Online?";
$who{'3'} = "Date/Time";
$who{'4'} = "Action";
$who{'5'} = "is currently viewing the";
$who{'6'} = "forum index";
$who{'7'} = ".";
$who{'8'} = "is currently viewing the forum";
$who{'9'} = "is currently viewing who is";
$who{'10'} = "online";
$who{'11'} = ".";
$who{'12'} = "is currently using the ICQ Pager.";
$who{'13'} = "is requesting a password.";
$who{'14'} = "is saving the preferences.";
$who{'15'} = "edits the optical preferences.";
$who{'16'} = "posts a new thread in the forum";
$who{'17'} = "replies to the thread";
$who{'18'} = "in the forum";
$who{'19'} = "is currently viewing the thread";
$who{'20'} = "copies the thread";
$who{'21'} = "as a printable version.";
$who{'22'} = "edits the censored words.";
$who{'23'} = "saves the censored words.";
$who{'24'} = "edits the news.";
$who{'25'} = "edits the news.";
$who{'26'} = "moves a thread.";
$who{'27'} = "is currently (un)subscribing the notify option for";
$who{'28'} = ".";
$who{'29'} = "is removing old threads.";
$who{'30'} = "locks the thread";
$who{'31'} = "is currently registering.";
$who{'32'} = "is viewing the";
$who{'33'} = "agreement letter";
$who{'34'} = "is viewing the";
$who{'35'} = "help";
$who{'36'} = "is logging in.";
$who{'37'} = "has logged out.";
$who{'38'} = "removes a thread.";
$who{'39'} = "is modifying the thread";
$who{'40'} = "is modifying his/her user-profile.";
$who{'41'} = "is modifying the profile of";
$who{'42'} = "is trying to modify the profile of";
$who{'43'} = ".";
$who{'44'} = "is currently viewing the profile of";
$who{'45'} = "edits a category.";
$who{'46'} = "is reordering the categories.";
$who{'47'} = "deletes a category.";
$who{'48'} = "creates a new category.";
$who{'49'} = "edits a forum.";
$who{'50'} = "is reordering the forums.";
$who{'51'} = "creates a new forum.";
$who{'52'} = "is currently viewing the Admin Center.";
$who{'53'} = "is currently viewing all members.";
$who{'54'} = "writes a message to all members.";
$who{'55'} = "edits the membergroups.";
$who{'56'} = "is currently checking Instant Messages.";
$who{'57'} = "changes the Preferences for Instant Messages.";
$who{'58'} = "views the outbox for Instant Messages.";
$who{'59'} = "deletes an Instant Message.";
$who{'60'} = "writes an Instant Message.";
$who{'61'} = "sends an Instant Message.";
$who{'62'} = "views the Members List.";
$who{'63'} = "views the Members List sorted by letters.";
$who{'64'} = "views the list of the Top Posters.";
$who{'65'} = "views/edits the list of reserved names.";
$who{'66'} = "saves the list of reserved names.";
$who{'67'} = "marks the threads in Forum $boardname as read.";
$who{'68'} = "uses the search function.";
$who{'69'} = "is checking for updates.";
$who{'70'} = "is currently viewing the Memberslist through the Admin Center.";
$who{'71'} = "deletes the Log-File.";
$who{'72'} = "is currently in the Global Mods Center.";
$who{'73'} = "edits the preferences.";
$who{'74'} = "marks the whole board as read.";
$who{'75'} = "recounts the memberships.";
$who{'76'} = "views the recent posts list.";
$who{'77'} = "repairs all boards and topics.";
$who{'78'} = "rebuilds the members list.";
$who{'79'} = "deletes all his Instant Messages.";
$who{'80'} = "edits the Ban-List.";
$who{'81'} = "edits the Colors/Effects of the Membernames.";
$who{'82'} = "sends the thread";
$who{'83'} = "is viewing the Log-File.";
$who{'84'} = "is viewing his Notify List.";
$who{'85'} = "is searching for Members assigned to a MemberGroup.";
$who{'86'} = "recounts all board totals.";
$who{'87'} = "is viewing the recent posts of";
$who{'88'} = "adds Smilies to the list.";
$who{'89'} = "deletes the Log-File of the Admin-Registrations.";
$who{'90'} = "is viewing the Admin-Registrations Log-File.";
$who{'91'} = "rates a thread.";
$who{'92'} = "is viewing the hidden info of";
$who{'93'} = "is viewing the Forum Index of";
$who{'94'} = "tries to register without any success.";
$who{'95'} = "reads that the board is closed for new registrations.";
$who{'96'} = "is on the login screen.";
$who{'97'} = "stares at the login screen unable to remember the password.";
$who{'98'} = "There currently are";
$who{'99'} = "There currently is";
$who{'100a'} = "user on the board.";
$who{'100b'} = "users on the board.";
$who{'101'} = "Add 'Who's Online' text to YaBB's menu?";
$who{'102'} = "Allow Guests/Users to view Online Overview?";
$who{'103'} = "User";
$who{'104'} = "Show Admin actions to Guests/Users in Online Overview?";
$who{'105'} = "Guest";
$who{'106'} = "Hidden";
$who{'107'} = "private";
$who{'108'} = "This Page refreshes every";
$who{'109'} = "seconds";
$who{'110'} = "Seconds before refresh of the Online Overview page";
$who{'111'} = "main website";
## WHOSON MOD END ##
YaBB.pl
elsif ($action eq 'usersrecentposts') { require "$sourcedir/Profile.pl"; &usersrecentposts; }
## WHOSON MOD START ##
elsif ($action eq 'who') { require "$sourcedir/Who.pl"; &who; }
## WHOSON MOD END ##