###############################################################################
# BoardIndex.pl #
###############################################################################
# YaBB: Yet another Bulletin Board #
# Open-Source Community Software for Webmasters #
# Version: YaBB 3.0 Beta #
# Packaged: October 05, 2010 #
# Distributed by: http://www.yabbforum.com #
# =========================================================================== #
# Copyright (c) 2000-2010 YaBB (www.yabbforum.com) - All Rights Reserved. #
# Software by: The YaBB Development Team #
# with assistance from the YaBB community. #
###############################################################################
$boardindexplver = 'YaBB 3.0 Beta $Revision: 349 $';
if ($action eq 'detailedversion') { return 1; }
&LoadLanguage('BoardIndex');
sub BoardIndex {
my ($users, $lspostid, $lspostbd, $lssub, $lsposttime, $lsposter, $lsreply, $lsdatetime, $lastthreadtime, @goodboards, @loadboards, $guestlist);
$totalm = 0;
$totalt = 0;
$lastposttime = 0;
$lastthreadtime = 0;
if($INFO{'boardselect'}) { $subboard_sel = $INFO{'boardselect'}; }
# if sub board is selected but none exists with that name, show everything
if($subboard_sel && !$subboard{$subboard_sel}) {
$subboard_sel = 0;
}
require "$templatesdir/$useboard/BoardIndex.template";
my ($numusers, $guests, $numbots, $user_in_log, $guest_in_log) = (0,0,0,0,0);
# dont do this stuff when we're calling for sub board display
if(!$subboard_sel) {
&GetBotlist;
my $lastonline = $date - ($OnlineLogTime * 60);
foreach (@logentries) {
($name, $date1, $last_ip, $last_host) = split(/\|/, $_);
if (!$last_ip) { $last_ip = qq~$boardindex_txt{'no_ip'}~; }
my $is_a_bot = &Is_Bot($last_host);
if ($is_a_bot){
$numbots++;
$bot_count{$is_a_bot}++;
} elsif ($name) {
if (&LoadUser($name)) {
if ($name eq $username) { $user_in_log = 1; }
elsif (${$uid.$name}{'lastonline'} < $lastonline) { next; }
if ($iamadmin || $iamgmod) {
$numusers++;
$users .= &QuickLinks($name);
$users .= (${$uid.$name}{'stealth'} ? "*" : "") .
((($iamadmin && $show_online_ip_admin) || ($iamgmod && $show_online_ip_gmod)) ? " ($last_ip), " : ", ");
} elsif (!${$uid.$name}{'stealth'}) {
$numusers++;
$users .= &QuickLinks($name) . ", ";
}
} else {
if ($name eq $user_ip) { $guest_in_log = 1; }
$guests++;
if (($iamadmin && $show_online_ip_admin) || ($iamgmod && $show_online_ip_gmod)) {
$guestlist .= qq~$last_ip, ~;
}
}
}
}
if (!$iamguest && !$user_in_log) {
$guests-- if $guests;
$numusers++;
$users .= &QuickLinks($username);
if ($iamadmin || $iamgmod) {
$users .= ${$uid.$username}{'stealth'} ? "*" : "";
if (($iamadmin && $show_online_ip_admin) || ($iamgmod && $show_online_ip_gmod)) {
$users .= " ($user_ip)";
$guestlist =~ s|$last_ip, ||o;
}
}
} elsif ($iamguest && !$iambot && !$guest_in_log) {
$guests++;
}
if ($numusers) {
$users =~ s~, \Z~~;
$users .= qq~
~;
}
if ($guestlist) { # build the guest list
$guestlist =~ s/, $//;
$guestlist = qq~$guestlist
~;
}
if ($numbots) { # build the bot list
foreach (sort keys(%bot_count)) { $botlist .= qq~$_ ($bot_count{$_}), ~; }
$botlist =~ s/, $//;
$botlist = qq~$botlist~;
}
if (!$INFO{'catselect'}) {
$yytitle = $boardindex_txt{'18'};
} else {
($tmpcat, $tmpmod, $tmpcol) = split(/\|/, $catinfo{ $INFO{'catselect'} });
&ToChars($tmpcat);
$yytitle = qq~$tmpcat~;
$yynavigation = qq~› $tmpcat~;
}
if (!$iamguest) { &Collapse_Load; }
}
my @tmplist;
if($subboard_sel) {
push(@tmplist, $subboard_sel);
} else {
push(@tmplist, @categoryorder);
}
# first get all the boards based on the categories found in forum.master or the provided sub board
foreach $catid (@tmplist) {
if ($INFO{'catselect'} ne $catid && $INFO{'catselect'} && !$subboard_sel) { next; }
# get boards in category if we're not looking for subboards
if(!$subboard_sel) {
(@bdlist) = split(/\,/, $cat{$catid});
my ($catname, $catperms, $catallowcol) = split(/\|/, $catinfo{"$catid"});
# Category Permissions Check
my $access = &CatAccess($catperms);
if (!$access) { next; }
$cat_boardcnt{$catid} = 0;
} else {
(@bdlist) = split(/\|/, $subboard{$catid});
}
# next determine all the boards a user has access to
foreach $curboard (@bdlist) {
# now fill all the neccesary hashes to show all board index stuff
if (!exists $board{$curboard}) {
&gostRemove($catid, $curboard);
next;
}
# hide the actual global announcement board for all normal users but admins and gmods
if ($annboard eq $curboard && !$iamadmin && !$iamgmod) { next; }
my ($boardname, $boardperms, $boardview) = split(/\|/, $board{"$curboard"});
my $access = &AccessCheck($curboard, '', $boardperms);
if (!$iamadmin && $access ne "granted" && $boardview != 1) { next; }
# Now check subboards that won't be displayed but we need their latest info
if($subboard{$curboard}) {
# recursively check access to all sub boards then add them to load list
&recursive_boards(split(/\|/,$subboard{$curboard}));
sub recursive_boards {
foreach $childbd (@_) {
# now fill all the neccesary hashes to show all board index stuff
if (!exists $board{$childbd}) {
&gostRemove($catid, $childbd);
next;
}
# hide the actual global announcement board for all normal users but admins and gmods
if ($annboard eq $childbd && !$iamadmin && !$iamgmod) { next; }
my ($boardname, $boardperms, $boardview) = split(/\|/, $board{"$childbd"});
my $access = &AccessCheck($childbd, '', $boardperms);
if (!$iamadmin && $access ne "granted" && $boardview != 1) { next; }
# add it to list of boards to load data
push(@loadboards, $childbd);
# make recursive call if this board has more children
if($subboard{$childbd}) { &recursive_boards(split(/\|/,$subboard{$childbd})); }
}
}
}
# if it's a sub board don't add to category count
if(!${$uid.$curboard}{'parent'}) {
$cat_boardcnt{$catid}++;
}
push(@goodboards, "$catid|$curboard");
push(@loadboards, $curboard);
}
}
&BoardTotals("load", @loadboards);
&getlog;
my $dmax = $date - ($max_log_days_old * 86400);
# if loading subboard list by ajax we don't need this
if (!$INFO{'a'})
{
# showcase poll start
my $polltemp;
if (&checkfor_DBorFILE("$datadir/poll.showcase")) {
my $scthreadnum = (&read_DBorFILE(0,'',$datadir,'poll','showcase'))[0];
# Look for a valid poll file.
my $pollthread;
if (&checkfor_DBorFILE("$datadir/$scthreadnum.poll")) {
&MessageTotals("load",$scthreadnum);
if ($iamadmin || $iamgmod) {
$pollthread = 1;
} else {
my $curcat = ${$uid.${$scthreadnum}{'board'}}{'cat'};
my $catperms = (split /\|/,$catinfo{$curcat})[1];
$pollthread = 1 if &CatAccess($catperms);
my $boardperms = (split /\|/,$board{${$scthreadnum}{'board'}})[1];
$pollthread = &AccessCheck(${$scthreadnum}{'board'}, '', $boardperms) eq 'granted' ? $pollthread : 0;
}
}
if ($pollthread) {
my $tempcurrentboard = $currentboard;
$currentboard = ${$scthreadnum}{'board'};
my $tempstaff = $staff;
$staff = 0 unless $iamadmin || $iamgmod;
require "$sourcedir/Poll.pl";
&display_poll($scthreadnum,1);
$staff = $tempstaff;
$polltemp = qq~~ . $pollmain . '
';
$currentboard = $tempcurrentboard;
}
}
# showcase poll end
} else {
# get rid of the tag in the template
$boardindex_template =~ s/({|<)yabb pollshowcase(}|>)//g;
}
foreach $curboard (@loadboards) {
chomp $curboard;
my $iammodhere = '';
foreach my $curuser (split(/, ?/, ${$uid.$curboard}{'mods'})) {
if ($username eq $curuser) { $iammodhere = 1; }
}
foreach my $curgroup (split(/, /, ${$uid.$curboard}{'modgroups'})) {
if (${$uid.$username}{'position'} eq $curgroup) { $iammodhere = 1; }
foreach (split(/,/, ${$uid.$username}{'addgroups'})) {
if ($_ eq $curgroup) { $iammodhere = 1; last; }
}
}
# if this is a parent board and it can't be posted in, set lastposttime to 0 so subboards will show latest data
if($subboard{$curboard} && !${$uid.$curboard}{'canpost'}) {
${$uid.$curboard}{'lastposttime'} = 0;
}
$lastposttime = ${$uid.$curboard}{'lastposttime'};
# hide hidden threads for ordinary members and guests in all loaded boards
if (!$iammodhere && !$iamadmin && !$iamgmod && ${$uid.$curboard}{'lasttopicstate'} =~ /h/i) {
${$uid.$curboard}{'lastpostid'} = '';
${$uid.$curboard}{'lastsubject'} = '';
${$uid.$curboard}{'lastreply'} = '';
${$uid.$curboard}{'lastposter'} = $boardindex_txt{'470'};
${$uid.$curboard}{'lastposttime'} = '';
$lastposttime{$curboard} = $boardindex_txt{'470'};
my ($messageid, $messagestate);
foreach (&read_DBorFILE(0,'',$boardsdir,$curboard,'txt')) {
($messageid, undef, undef, undef, undef, undef, undef, undef, $messagestate) = split(/\|/, $_);
if ($messagestate !~ /h/i) {
next if !(@lastthreadmessages = &read_DBorFILE(0,'',$datadir,$messageid,'txt'));
my @lastmessage = split(/\|/, $lastthreadmessages[$#lastthreadmessages], 6);
${$uid.$curboard}{'lastpostid'} = $messageid;
${$uid.$curboard}{'lastsubject'} = $lastmessage[0];
${$uid.$curboard}{'lastreply'} = $#lastthreadmessages;
${$uid.$curboard}{'lastposter'} = $lastmessage[4] eq "Guest" ? qq~Guest-$lastmessage[1]~ : $lastmessage[4];
${$uid.$curboard}{'lastposttime'} = $lastmessage[3];
$lastposttime{$curboard} = &timeformat($lastmessage[3]);
last;
}
}
}
${$uid.$curboard}{'lastposttime'} = (${$uid.$curboard}{'lastposttime'} eq 'N/A' || !${$uid.$curboard}{'lastposttime'}) ? $boardindex_txt{'470'} : ${$uid.$curboard}{'lastposttime'};
if (${$uid.$curboard}{'lastposttime'} > 0) { $lastposttime{$curboard} = &timeformat(${$uid.$curboard}{'lastposttime'}); }
else { $lastposttime{$curboard} = $boardindex_txt{'470'}; }
$lastpostrealtime{$curboard} = (${$uid.$curboard}{'lastposttime'} eq 'N/A' || !${$uid.$curboard}{'lastposttime'}) ? 0 : ${$uid.$curboard}{'lastposttime'};
$lsreply{$curboard} = ${$uid.$curboard}{'lastreply'} + 1;
if (${$uid.$curboard}{'lastposter'} =~ m~\AGuest-(.*)~) {
${$uid.$curboard}{'lastposter'} = $1 . " ($maintxt{'28'})";
$lastposterguest{$curboard} = 1;
}
${$uid.$curboard}{'lastposter'} = ${$uid.$curboard}{'lastposter'} eq 'N/A' || !${$uid.$curboard}{'lastposter'} ? $boardindex_txt{'470'} : ${$uid.$curboard}{'lastposter'};
${$uid.$curboard}{'messagecount'} = ${$uid.$curboard}{'messagecount'} || 0;
${$uid.$curboard}{'threadcount'} = ${$uid.$curboard}{'threadcount'} || 0;
$totalm += ${$uid.$curboard}{'messagecount'};
$totalt += ${$uid.$curboard}{'threadcount'};
if (!$iamguest && $max_log_days_old && $lastpostrealtime{$curboard} && ((!$yyuserlog{$curboard} && $lastpostrealtime{$curboard} > $dmax) || ($yyuserlog{$curboard} > $dmax && $yyuserlog{$curboard} < $lastpostrealtime{$curboard}))) {
$new_boards{$curboard} = 1;
}
# determine the true last post on all the boards a user has access to
if (${$uid.$curboard}{'lastposttime'} > $lastthreadtime && $lastposttime{$curboard} ne $boardindex_txt{'470'}) {
$lsdatetime = $lastposttime{$curboard};
$lsposter = ${$uid.$curboard}{'lastposter'};
$lssub = ${$uid.$curboard}{'lastsubject'};
$lspostid = ${$uid.$curboard}{'lastpostid'};
$lsreply = ${$uid.$curboard}{'lastreply'};
$lastthreadtime = ${$uid.$curboard}{'lastposttime'};
$lspostbd = $curboard;
}
}
# make a copy of new boards has to update the tree if a sub board has a new post, but keep original so we know which individual boards are new
my %new_icon = %new_boards;
# count boards to see if we print anything when we're looking for subboards
my $brd_count;
&LoadCensorList;
foreach $catid (@tmplist) {
if ($INFO{'catselect'} ne $catid && $INFO{'catselect'} && !$subboard_sel) { next; }
my ($catname, $catperms, $catallowcol, $catimage);
# get boards in category if we're not looking for subboards
if(!$subboard_sel) {
(@bdlist) = split(/\,/, $cat{$catid});
($catname, $catperms, $catallowcol, $catimage) = split(/\|/, $catinfo{"$catid"});
&ToChars($catname);
# Category Permissions Check
$cataccess = &CatAccess($catperms);
if (!$cataccess) { next; }
} else {
(@bdlist) = split(/\|/, $subboard{$catid});
my ($boardname, $boardperms, $boardview) = split(/\|/, $board{$catid});
&ToChars($boardname);
($catname, $catperms, $catallowcol, $catimage) = (qq~$boardindex_txt{'65'} '$boardname'~, 0, 0, '');
}
# Skip any empty categories.
if ($cat_boardcnt{$catid} == 0 && !$subboard_sel) { next; }
if (!$iamguest) {
my $newmsg = 0;
$newms{$catname} = '';
$newrowicon{$catname} = '';
$newrowstart{$catname} = '';
$newrowend{$catname} = '';
$collapse_link = '';
if ($catallowcol) {
$collapse_link = qq~~;
}
# loop through any collapsed boards to find new posts in it and change the image to match
# Now shows this whether minimized or not, for Javascript hiding/showing. (Unilat)
if ($INFO{'catselect'} eq '') {
foreach my $boardinfo (@goodboards) {
my $testcat;
($testcat, $curboard) = split(/\|/, $boardinfo);
if ($testcat ne $catid) { next; }
# as we fill the vars based on all boards we need to skip any cat already shown before
if ($new_icon{$curboard}) {
my (undef, $boardperms, $boardview) = split(/\|/, $board{"$curboard"});
if (&AccessCheck($curboard, '', $boardperms) eq "granted") { $newmsg = 1; }
}
}
if ($catallowcol) {
$template_catnames .= qq~"$catid",~;
$newrowend{$catname} = qq~~;
if ($catcol{$catid}) {
$newrowstart{$catname} = qq~
~;
$newms{$catname} = $boardindex_exptxt{'5'};
} else {
$newrowicon{$catname} = qq~
~;
$newms{$catname} = $boardindex_exptxt{'6'};
}
if ($catcol{$catid}) {
$hash{$catname} = qq~
~;
} else {
$hash{$catname} = qq~
~;
}
} else {
$template_boardtable = qq~id="$catid"~;
$template_colboardtable = qq~id="col$catid" style="display:none;"~;
}
} else {
$collapse_link = ''; $hash{$catname} = '';
$template_boardtable = qq~id="$catid"~;
$template_colboardtable = qq~id="col$catid" style="display:none;"~;
}
$catlink = qq~$collapse_link $hash{$catname} $catname~;
} else {
$template_boardtable = qq~id="$catid"~;
$template_colboardtable = qq~id="col$catid" style="display:none;"~;
$catlink = qq~$catname~;
}
# Don't need the category headers if we're loading ajax subboards
if (!$INFO{'a'}) {
$templatecat = $catheader;
$tmpcatimg = "";
if ($catimage ne '') {
if ($catimage =~ /\//i) { $catimage = qq~
~;
} else {
$new = qq~
~;
}
} else {
$new = qq~
~;
}
if (!$bdpic) {
if($subboard_sel) {
$bdpic = 'subboards.gif';
} else {
$bdpic = 'boards.gif';
}
}
$lastposter = ${$uid.$curboard}{'lastposter'};
$lastposter =~ s~\AGuest-(.*)~$1 ($maintxt{'28'})~i;
unless ($lastposterguest{$curboard} || ${$uid.$curboard}{'lastposter'} eq $boardindex_txt{'470'}) {
&LoadUser($lastposter);
if ((${$uid.$lastposter}{'regdate'} && ${$uid.$curboard}{'lastposttime'} > ${$uid.$lastposter}{'regtime'}) || ${$uid.$lastposter}{'position'} eq "Administrator" || ${$uid.$lastposter}{'position'} eq "Global Moderator") {
$lastposter = qq~${$uid.$lastposter}{'realname'}~;
} else {
# Need to load thread to see lastposters DISPLAYname if is Ex-Member
my @x = &read_DBorFILE(0,'',$datadir,${$uid.$curboard}{'lastpostid'},'txt');
$lastposter = (split(/\|/, $x[$#x], 3))[1] . " - $boardindex_txt{'470a'}";
}
}
${$uid.$curboard}{'lastposter'} ||= $boardindex_txt{'470'};
${$uid.$curboard}{'lastposttime'} ||= $boardindex_txt{'470'};
if ($bdpic =~ /\//i) { $bdpic = qq~
~;
} else {
$sub_new = qq~
~;
}
my $boardinfotxt = $new_boards{$childbd} ? $boardindex_txt{'67'} : $boardindex_txt{'68'};
if ($subboard{$childbd}) {
if ($childcnt{$childbd} > 1) {
$boardinfotxt .= qq~ $sub_new_cnt{$childbd} $boardindex_txt{'69'} $childcnt{$childbd} $boardindex_txt{'70'}~;
} else {
if($sub_new_cnt{$childbd}) {
$boardinfotxt .= qq~ $childcnt{$childbd} $boardindex_txt{'71'}~;
} else {
$boardinfotxt .= qq~ $childcnt{$childbd} $boardindex_txt{'72'}~;
}
}
}
$tmp_sublinks =~ s/({|<)yabb boardname(}|>)/$chldboardname/g;
$tmp_sublinks =~ s/({|<)yabb boardurl(}|>)/$scripturl\?board\=$childbd/g;
$tmp_sublinks =~ s/({|<)yabb new(}|>)/$sub_new/g;
$tmp_sublinks =~ s/({|<)yabb boardinfo(}|>)/$boardinfotxt/g;
$template_subboards .= qq~$tmp_sublinks, ~;
}
$template_subboards =~ s/, $//g;
my $sub_txt = $boardindex_txt{'64'};
if($sub_count == 1) { $sub_txt = $boardindex_txt{'66'}; }
elsif($sub_count == 0) { $sub_txt = ''; $tmp_sublist = '';}
# drop down arrow for expanding sub boards
# only do this if 1 or more sub boards and if this is an ajax call we dont want infinite levels of subboards
my $subdropdown;
if ($sub_count > 0) {
# don't make an ajax dropdown if we are calling from ajax. All those dropdowns would get confusing.
if ($INFO{'a'}) {
$subdropdown = qq~$sub_txt~;
} else {
$subdropdown = qq~
$sub_txt~;
}
}
$tmp_sublist =~ s/({|<)yabb subboardlinks(}|>)/$template_subboards/g;
$tmp_sublist =~ s/({|<)yabb subdropdown(}|>)/$subdropdown/g;
}
my $altbrdcolor = (($alternateboardcolor % 2) == 1) ? "windowbg" : "windowbg2";
my $boardanchor = $curboard;
if($boardanchor =~ m~\A[^az]~i) {$boardanchor =~ s~(.*?)~b$1~;}
my $lasttopiclink = qq~$lasttopictxt~;
if (${$uid.$curboard}{'threadcount'} < 0) { ${$uid.$curboard}{'threadcount'} = 0; }
if (${$uid.$curboard}{'messagecount'} < 0) { ${$uid.$curboard}{'messagecount'} = 0; }
${$uid.$curboard}{'threadcount'} = &NumberFormat(${$uid.$curboard}{'threadcount'});
${$uid.$curboard}{'messagecount'} = &NumberFormat(${$uid.$curboard}{'messagecount'});
# if it's a parent board that cant be posted in, just show sub board list when clicked vs. message index
if($subboard{$curboard} && !${$uid.$curboard}{'canpost'}) {
$templateblock =~ s/({|<)yabb boardurl(}|>)/$scripturl\?boardselect\=$curboard/g;
} else {
$templateblock =~ s/({|<)yabb boardurl(}|>)/$scripturl\?board\=$curboard/g;
}
# Make hidden table rows for drop down message list
$expandmessages = qq~
~;
$messagedropdown = qq~
~;
$templateblock =~ s/({|<)yabb expandmessages(}|>)/$expandmessages/g;
$templateblock =~ s/({|<)yabb messagedropdown(}|>)/$messagedropdown/g;
$templateblock =~ s/({|<)yabb boardanchor(}|>)/$boardanchor/g;
$templateblock =~ s/({|<)yabb new(}|>)/$new/g;
$templateblock =~ s/({|<)yabb boardpic(}|>)/$bdpic/g;
$templateblock =~ s/({|<)yabb boardname(}|>)/$boardname/g;
$templateblock =~ s/({|<)yabb boarddesc(}|>)/$bddescr/g;
$templateblock =~ s/({|<)yabb moderators(}|>)/$showmods$showmodgroups/g;
$templateblock =~ s/({|<)yabb threadcount(}|>)/${$uid.$curboard}{'threadcount'}/g;
$templateblock =~ s/({|<)yabb messagecount(}|>)/${$uid.$curboard}{'messagecount'}/g;
$templateblock =~ s/({|<)yabb lastpostlink(}|>)/$lastpostlink/g;
$templateblock =~ s/({|<)yabb lastposter(}|>)/$lastposter/g;
$templateblock =~ s/({|<)yabb lasttopiclink(}|>)/$lasttopiclink/g;
$templateblock =~ s/({|<)yabb altbrdcolor(}|>)/$altbrdcolor/g;
$templateblock =~ s/({|<)yabb altbrdcolor(}|>)/$altbrdcolor/g;
$templateblock =~ s/({|<)yabb subboardlist(}|>)/$tmp_sublist/g;
$tmptemplateblock .= $templateblock;
$alternateboardcolor++;
}
}
$tmptemplateblock .= $INFO{'a'} ? "" : $catfooter;
++$catcount;
}
if (!$iamguest && !$subboard_sel) {
if (${$uid.$username}{'im_imspop'}) {
$yymain .= qq~\n\n~;
} else {
$yymain .= qq~\n\n~;
}
my $imsweredeleted = 0;
if (${$username}{'PMmnum'} > $numibox && $numibox && $enable_imlimit) {
&Del_Max_IM('msg',$numibox);
$imsweredeleted = ${$username}{'PMmnum'} - $numibox;
$yymain .= qq~\n~;
${$username}{'PMmnum'} = $numibox;
}
if (${$username}{'PMmoutnum'} > $numobox && $numobox && $enable_imlimit) {
&Del_Max_IM('outbox',$numobox);
$imsweredeleted = ${$username}{'PMmoutnum'} - $numobox;
$yymain .= qq~\n~;
${$username}{'PMmoutnum'} = $numobox;
}
if (${$username}{'PMstorenum'} > $numstore && $numstore && $enable_imlimit) {
&Del_Max_IM('imstore',$numstore);
$imsweredeleted = ${$username}{'PMstorenum'} - $numstore;
$yymain .= qq~\n~;
${$username}{'PMstorenum'} = $numstore;
}
if ($imsweredeleted) {
&buildIMS($username, 'update');
&LoadIMs();
}
$ims = '';
if ($PM_level == 1 || ($PM_level == 2 && $staff) || ($PM_level == 3 && ($iamadmin || $iamgmod))){
$ims = qq~$boardindex_txt{'795'} ${$username}{'PMmnum'} $boardindex_txt{'796'}~;
if (${$username}{'PMmnum'} > 0) {
if (${$username}{'PMimnewcount'} == 1) {
$ims .= qq~ $boardindex_imtxt{'24'} ${$username}{'PMimnewcount'} $boardindex_imtxt{'25'}.~;
} else {
$ims .= qq~ $boardindex_imtxt{'24'} ${$username}{'PMimnewcount'} $boardindex_imtxt{'26'}.~;
}
} else {
$ims .= qq~.~;
}
}
if ($INFO{'catselect'} eq '') {
if ($colbutton) { $col_vis = ""; }
else { $col_vis = " style='display:none;'"; }
if (${$uid.$username}{'cathide'}) { $exp_vis = ""; }
else { $exp_vis = " style='display:none;'"; }
$expandlink = qq~$img{'expand'}$menusep~;
$collapselink = qq~$img{'collapse'}$menusep~;
$markalllink = qq~$img{'markallread'}~;
} else {
$markalllink = qq~$img{'markallread'}~;
$collapselink = '';
$expandlink = '';
}
}
if ($totalt < 0) { $totalt = 0; }
if ($totalm < 0) { $totalm = 0; }
$totalt = &NumberFormat($totalt);
$totalm = &NumberFormat($totalm);
# Template some stuff for sub boards before the rest
$boardindex_template =~ s/({|<)yabb catsblock(}|>)/$tmptemplateblock/g;
# no matter if this is ajax subboards, subboards at top of messageindex, or regular boardindex we need these vars now
$yymain .= qq~\n
~;
# don't show info center, login, etc. if we're calling from sub boards
if(!$subboard_sel) {
$guestson = qq~$boardindex_txt{'141'}: $guests~;
$userson = qq~$boardindex_txt{'142'}: $numusers~;
$botson = qq~$boardindex_txt{'143'}: $numbots~;
$totalusers = $numusers + $guests;
if (!&checkfor_DBorFILE("$vardir/mostlog.txt")) {
&write_DBorFILE(0,'',$vardir,'mostlog','txt',("$numusers|$date\n","$guests|$date\n","$totalusers|$date\n","$numbots|$date\n"));
}
@mostentries = &read_DBorFILE(1,'',$vardir,'mostlog','txt');
($mostmemb, $datememb) = split(/\|/, $mostentries[0]);
($mostguest, $dateguest) = split(/\|/, $mostentries[1]);
($mostusers, $dateusers) = split(/\|/, $mostentries[2]);
($mostbots, $datebots) = split(/\|/, $mostentries[3]);
chomp ($datememb, $dateguest, $dateusers, $datebots);
if ($numusers > $mostmemb || $guests > $mostguest || $numbots > $mostbots || $totalusers > $mostusers) {
if ($numusers > $mostmemb) { $mostmemb = $numusers; $datememb = $date; }
if ($guests > $mostguest) { $mostguest = $guests; $dateguest = $date; }
if ($totalusers > $mostusers) { $mostusers = $totalusers; $dateusers = $date; }
if ($numbots > $mostbots) { $mostbots = $numbots; $datebots = $date; }
&write_DBorFILE(0,'',$vardir,'mostlog','txt',("$mostmemb|$datememb\n","$mostguest|$dateguest\n","$mostusers|$dateusers\n","$mostbots|$datebots\n"));
}
$themostmembdate = &timeformat($datememb);
$themostguestdate = &timeformat($dateguest);
$themostuserdate = &timeformat($dateusers);
$themostbotsdate = &timeformat($datebots);
$mostmemb = &NumberFormat($mostmemb);
$mostguest = &NumberFormat($mostguest);
$mostusers = &NumberFormat($mostusers);
$mostbots = &NumberFormat($mostbots);
my $shared_login;
if ($iamguest) {
require "$sourcedir/LogInOut.pl";
$sharedLogin_title = '';
$shared_login = &sharedLogin;
}
my %tmpcolors;
$tmpcnt = 0;
$grpcolors = '';
($title, undef, undef, $color, $noshow, undef) = split(/\|/, $Group{'Administrator'}, 6);
if ($color && $noshow != 1) {
$tmpcnt++;
$tmpcolors{$tmpcnt} = qq~
~;
$rss_link = qq~
~ if $INFO{'catselect'};
$rss_text = qq~$boardindex_txt{'792'}~;
$rss_text = qq~$boardindex_txt{'792'}~ if $INFO{'catselect'};
}
$yyrssfeed = $rss_text;
$yyrss = $rss_link;
$boardindex_template =~ s/({|<)yabb rssfeed(}|>)/$rss_text/g;
$boardindex_template =~ s/({|<)yabb rss(}|>)/$rss_link/g;
$boardindex_template =~ s/({|<)yabb navigation(}|>)/ /g;
$boardindex_template =~ s/({|<)yabb pollshowcase(}|>)/$polltemp/g;
$boardindex_template =~ s/({|<)yabb selecthtml(}|>)//g;
$boardhandellist =~ s/({|<)yabb collapse(}|>)/$collapselink/g;
$boardhandellist =~ s/({|<)yabb expand(}|>)/$expandlink/g;
$boardhandellist =~ s/({|<)yabb markallread(}|>)/$markalllink/g;
$boardindex_template =~ s/({|<)yabb boardhandellist(}|>)/$boardhandellist/g;
$boardindex_template =~ s/({|<)yabb totaltopics(}|>)/$totalt/g;
$boardindex_template =~ s/({|<)yabb totalmessages(}|>)/$totalm/g;
if ($Show_RecentBar) {
($lssub, undef) = &Split_Splice_Move($lssub,0);
&ToChars($lssub);
$lssub = &Censor($lssub);
$tmlsdatetime = qq~($lsdatetime).