| ############################################################################### |
| ############################################################################### |
| # Recent.pl # |
| # Recent.pm # |
| |
| # $Date: 01.05.16 $ # |
| ############################################################################### |
| ############################################################################### |
| # YaBB: Yet another Bulletin Board # |
| # YaBB: Yet another Bulletin Board # |
| # Open-Source Community Software for Webmasters # |
| # Open-Source Community Software for Webmasters # |
| # Version: YaBB 2.5.2 # |
| # Version: YaBB 2.6.12 # |
| # Packaged: October 21, 2012 # |
| # Packaged: January 5, 2016 # |
| # Distributed by: http://www.yabbforum.com # |
| # Distributed by: http://www.yabbforum.com # |
| # =========================================================================== # |
| # =========================================================================== # |
| # Copyright (c) 2000-2012 YaBB (www.yabbforum.com) - All Rights Reserved. # |
| # Copyright (c) 2000-2016 YaBB (www.yabbforum.com) - All Rights Reserved. # |
| # Software by: The YaBB Development Team # |
| # Software by: The YaBB Development Team # |
| # with assistance from the YaBB community. # |
| # with assistance from the YaBB community. # |
| ############################################################################### |
| ############################################################################### |
| |
| # use strict; |
| $recentplver = 'YaBB 2.5.2 $Revision: 1.0 $'; |
| # use warnings; |
| if ($action eq 'detailedversion') { return 1; } |
| # no warnings qw(uninitialized once); |
| |
| use CGI::Carp qw(fatalsToBrowser); |
| |
| our $VERSION = '2.6.12'; |
| |
| |
| |
| # from YaBB3.0 build 100 # |
| |
| $recentpmver = 'YaBB 2.6.12 $Revision: 1710 $'; |
| |
| if ( $action eq 'detailedversion' ) { return 1; } |
| |
| |
| # Sub RecentTopics shows all the most recently posted topics |
| # Sub RecentTopics shows all the most recently posted topics |
| # Meaning each thread will show up ONCE in the list. |
| # Meaning each thread will show up ONCE in the list. |
| |
| |
| # Sub RecentPosts will show the X last POSTS |
| # Sub RecentPosts will show the X last POSTS |
| # Even if they are all from the same thread |
| # Even if they are all from the same thread |
| |
| get_template('Display'); |
| |
| |
| sub RecentTopics { |
| sub RecentPosts { |
| &spam_protection; |
| spam_protection(); |
| |
| |
| my $display = $INFO{'display'} || 10; |
| my $display = isempty( $FORM{'display'}, 10 ); |
| if ($display < 0) { $display = 5; } |
| if ( $display < 0 ) { $display = 5; } |
| elsif ($display > $maxrecentdisplay) { $display = $maxrecentdisplay; } |
| elsif ( $display > $maxrecentdisplay ) { $display = $maxrecentdisplay; } |
| my (@memset, @categories, %data, $numfound, $curcat, %catid, %catname, %cataccess, %catboards, $openmemgr, @membergroups, %openmemgr, $curboard, @threads, @boardinfo, $i, $c, @messages, $tnum, $tsub, $tname, $temail, $tdate, $treplies, $tusername, $ticon, $tstate, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $mns, $mtime, $counter, $board, $notify); |
| |
| $numfound = 0; |
| $numfound = 0; |
| |
| |
| unless ($mloaded == 1) { require "$boardsdir/forum.master"; } |
| get_forum_master(); |
| foreach $catid (@categoryorder) { |
| |
| $boardlist = $cat{$catid}; |
| *recursive_check2 = sub { |
| |
| foreach my $curboard (@_) { |
| (@bdlist) = split(/\,/, $boardlist); |
| ( $boardname{$curboard}, $boardperms, $boardview ) = |
| ($catname, $catperms) = split(/\|/, $catinfo{$catid}); |
| split /\|/xsm, $board{$curboard}; |
| $cataccess = &CatAccess($catperms); |
| |
| if (!$cataccess) { next; } |
| my $access = AccessCheck( $curboard, q{}, $boardperms ); |
| |
| if ( !$iamadmin && $access ne 'granted' ) { next; } |
| foreach $curboard (@bdlist) { |
| |
| ($boardname{$curboard}, $boardperms, $boardview) = split(/\|/, $board{$curboard}); |
| if ( ${ $uid . $curboard }{'brdpasswr'} ) { |
| |
| my $bdmods = ${ $uid . $curboard }{'mods'}; |
| my $access = &AccessCheck($curboard, '', $boardperms); |
| $bdmods =~ s/\, /\,/gsm; |
| if (!$iamadmin && $access ne "granted") { next; } |
| $bdmods =~ s/\ /\,/gsm; |
| |
| my %moderators = (); |
| $catid{$curboard} = $catid; |
| my $pswiammod = 0; |
| $catname{$curboard} = $catname; |
| foreach my $curuser ( split /\,/xsm, $bdmods ) { |
| |
| if ( $username eq $curuser ) { $pswiammod = 1; } |
| fopen(REC_BDTXT, "$boardsdir/$curboard.txt"); |
| } |
| for ($i = 0; $i < $display && ($buffer = <REC_BDTXT>); $i++) { |
| my $bdmodgroups = ${ $uid . $curboard }{'modgroups'}; |
| ($tnum, $tsub, $tname, $temail, $tdate, $treplies, $tusername, $ticon, $tstate) = split(/\|/, $buffer); |
| $bdmodgroups =~ s/\, /\,/gsm; |
| chomp $tstate; |
| my %moderatorgroups = (); |
| if ($tstate !~ /h/ || $iamadmin || $iamgmod) { |
| foreach my $curgroup ( split /\,/xsm, $bdmodgroups ) { |
| $mtime = $tdate; |
| if ( ${ $uid . $username }{'position'} eq $curgroup ) { |
| $data[$numfound] = "$mtime|$curboard|$tnum|$treplies|$tusername|$tname|$tstate"; |
| $pswiammod = 1; |
| $numfound++; |
| } |
| } |
| foreach my $memberaddgroups ( split /\, /sm, |
| } |
| ${ $uid . $username }{'addgroups'} ) |
| fclose(REC_BDTXT); |
| { |
| } |
| chomp $memberaddgroups; |
| } |
| if ( $memberaddgroups eq $curgroup ) { |
| |
| $pswiammod = 1; |
| @data = sort {$b <=> $a} @data; |
| last; |
| $numfound = 0; |
| } |
| |
| } |
| for ($i = 0; $i < @data; $i++) { |
| } |
| ($mtime, $curboard, $tnum, $treplies, $tusername, $tname, $tstate) = split(/\|/, $data[$i]); |
| my $cookiename = "$cookiepassword$curboard$username"; |
| $tstart = $mtime; |
| my $crypass = ${ $uid . $curboard }{'brdpassw'}; |
| fopen(REC_THRETXT, "$datadir/$tnum.txt") || next; |
| if ( !$iamadmin |
| while (<REC_THRETXT>) { $message = $_; } |
| && !$iamgmod |
| |
| && !$pswiammod |
| # get only the last post for this thread. |
| && $yyCookies{$cookiename} ne $crypass ) |
| fclose(REC_THRETXT); |
| { |
| chomp $message; |
| next; |
| |
| } |
| if ($message) { |
| } |
| ($msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns) = split(/\|/, $message); |
| |
| $messages[$numfound] = "$curboard|$tnum|$treplies|$tusername|$tname|$msub|$mname|$memail|$mdate|$musername|$micon|$mattach|$mip|$message|$mns|$tstate|$tstart"; |
| $catid{$curboard} = $catid; |
| $numfound++; |
| $catname{$curboard} = $catname; |
| } |
| |
| if ($numfound == $display) { last; } |
| fopen( REC_BDTXT, "$boardsdir/$curboard.txt" ); |
| } |
| @buffer = <REC_BDTXT>; |
| |
| for my $i ( 0 .. ( $display - 1 ) ) { |
| if ($numfound > 0) { |
| if ( $buffer[$i] ) { |
| $counter = 1; |
| ( |
| &LoadCensorList; |
| $tnum, $tsub, $tname, |
| } else { |
| $temail, $tdate, $treplies, |
| $yymain .= qq~<hr class="hr" /><b>$maintxt{'170'}</b><hr />~; |
| $tusername, $ticon, $tstate |
| } |
| ) = split /\|/xsm, $buffer[$i]; |
| |
| chomp $tstate; |
| for ($i = 0; $i < $numfound; $i++) { |
| if ( $tstate !~ /h/sm || $iamadmin || $iamgmod ) { |
| ($board, $tnum, $c, $tusername, $tname, $msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns, $tstate, $trstart) = split(/\|/, $messages[$i]); |
| $mtime = $tdate; |
| $displayname = $mname; |
| $data[$numfound] = |
| |
| "$mtime|$curboard|$tnum|$treplies|$tusername|$tname|$tstate"; |
| if ($tusername ne 'Guest' && -e ("$memberdir/$tusername.vars")) { &LoadUser($tusername); } |
| $numfound++; |
| if (${$uid.$tusername}{'regtime'}) { |
| } |
| $registrationdate = ${$uid.$tusername}{'regtime'}; |
| } |
| } else { |
| } |
| $registrationdate = $date; |
| fclose(REC_BDTXT); |
| } |
| |
| |
| if ( $subboard{$curboard} ) { |
| if (${$uid.$tusername}{'regdate'} && $trstart > $registrationdate) { |
| recursive_check2( split /\|/xsm, $subboard{$curboard} ); |
| $tname = qq~<a href="$scripturl?action=viewprofile;username=$useraccount{$tusername}">${$uid.$tusername}{'realname'}</a>~; |
| } |
| } elsif ($tusername !~ m~Guest~ && $trstart < $registrationdate) { |
| } |
| $tname = qq~$tname - $maintxt{'470a'}~; |
| }; |
| } else { |
| |
| $tname = "$tname ($maintxt{'28'})"; |
| foreach my $catid (@categoryorder) { |
| } |
| |
| |
| (@bdlist) = split /\,/xsm, $cat{$catid}; |
| if ($musername ne 'Guest' && -e ("$memberdir/$musername.vars")) { &LoadUser($musername); } |
| |
| if (${$uid.$musername}{'regtime'}) { |
| ( $catname, $catperms ) = split /\|/xsm, $catinfo{$catid}; |
| $registrationdate = ${$uid.$musername}{'regtime'}; |
| $cataccess = CatAccess($catperms); |
| } else { |
| if ( !$cataccess ) { next; } |
| $registrationdate = $date; |
| |
| } |
| recursive_check2(@bdlist); |
| |
| } |
| if (${$uid.$musername}{'regdate'} && $mdate > $registrationdate) { |
| @data = reverse sort { $a cmp $b } @data; |
| $mname = qq~<a href="$scripturl?action=viewprofile;username=$useraccount{$musername}">${$uid.$musername}{'realname'}</a>~; |
| |
| } elsif ($musername !~ m~Guest~ && $mdate < $registrationdate) { |
| $numfound = 0; |
| $mname = qq~$mname - $maintxt{'470a'}~; |
| $threadfound = @data > $display ? $display : @data; |
| } else { |
| |
| $mname = "$mname ($maintxt{'28'})"; |
| for my $i ( 0 .. ( $threadfound - 1 ) ) { |
| } |
| ( $mtime, $curboard, $tnum, $treplies, $tusername, $tname, $tstate ) = |
| |
| split /\|/xsm, $data[$i]; |
| &wrap; |
| |
| ($message, undef) = &Split_Splice_Move($message,$tnum); |
| # No need to check for hidden topics here, it was done above |
| if ($enable_ubbc) { |
| $tstart = $mtime; |
| $ns = $mns; |
| fopen( REC_THRETXT, "$datadir/$tnum.txt" ) || next; |
| if (!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } |
| @mess = <REC_THRETXT>; |
| &DoUBBC; |
| fclose(REC_THRETXT); |
| } |
| |
| &wrap2; |
| $threadfrom = @mess > $display ? @mess - $display : 0; |
| &ToChars($message); |
| for my $c ( $threadfrom .. @mess ) { |
| $message = &Censor($message); |
| if ( $mess[$c] ) { |
| |
| ( |
| ($msub, undef) = &Split_Splice_Move($msub,0); |
| $msub, $mname, $memail, $mdate, $musername, |
| &ToChars($msub); |
| $micon, $mattach, $mip, $message, $mns |
| $msub = &Censor($msub); |
| ) = split /\|/xsm, $mess[$c]; |
| |
| $mtime = $mdate; |
| if ($iamguest) { |
| $messages[$numfound] = |
| $notify = ''; |
| "$mtime|$curboard|$tnum|$c|$tusername|$tname|$msub|$mname|$memail|$mdate|$musername|$micon|$mattach|$mip|$message|$mns|$tstate|$tstart"; |
| } else { |
| $numfound++; |
| if (${$uid.$username}{'thread_notifications'} =~ /\b$tnum\b/) { |
| } |
| $notify = qq~$menusep<a href="$scripturl?action=notify3;num=$tnum/$c;oldnotify=1">$img{'del_notify'}</a>~; |
| } |
| } else { |
| } |
| $notify = qq~$menusep<a href="$scripturl?action=notify2;num=$tnum/$c;oldnotify=1">$img{'add_notify'}</a>~; |
| |
| } |
| @messages = reverse sort { $a cmp $b } @messages; |
| } |
| |
| |
| if ( $numfound > 0 ) { |
| $mdate = &timeformat($mdate); |
| if ( $numfound > $display ) { $numfound = $display; } |
| |
| LoadCensorList(); |
| $yymain .= qq~ |
| } |
| <table border="0" width="100%" cellspacing="1" class="bordercolor" style="table-layout: fixed;"> |
| else { |
| <tr> |
| $yymain .= qq~<hr class="hr"><b>$maintxt{'170'}</b><hr />~; |
| <td align="center" width="5%" class="titlebg">$counter</td> |
| } |
| <td align="left" width="95%" class="titlebg"> <a href="$scripturl?catselect=$catid{$board}"><u>$catname{$board}</u></a> / <a href="$scripturl?board=$board"><u>$boardname{$board}</u></a> / <a href="$scripturl?num=$tnum/$c#$c"><u>$msub</u></a><br /> |
| |
| <span class="small">$maintxt{'30'}: $mdate</span> </td> |
| for my $i ( 0 .. ( $numfound - 1 ) ) { |
| </tr> |
| ( |
| <tr> |
| $dummy, $board, $tnum, $c, $tusername, $tname, |
| <td colspan="2"> |
| $msub, $mname, $memail, $mdate, $musername, $micon, |
| <table border="0" width="100%" class="catbg"> |
| $mattach, $mip, $message, $mns, $tstate, $trstart |
| <tr> |
| ) = split /\|/xsm, $messages[$i]; |
| <td align="left">$maintxt{'109'} $tname | $maintxt{'197'} $mname</td> |
| $displayname = $mname; |
| <td align="right"> ~; |
| |
| |
| if ( $tusername ne 'Guest' && -e ("$memberdir/$tusername.vars") ) { |
| if ($tstate != 1 && (!$iamguest || $enable_guestposting)) { |
| LoadUser($tusername); |
| $yymain .= qq~<a href="$scripturl?board=$board;action=post;num=$tnum/$c#$c;title=PostReply">$img{'reply'}</a>$menusep<a href="$scripturl?board=$board;action=post;num=$tnum;quote=$c;title=PostReply">$img{'recentquote'}</a>$notify ~; |
| } |
| } |
| if ( ${ $uid . $tusername }{'regtime'} ) { |
| |
| $registrationdate = ${ $uid . $tusername }{'regtime'}; |
| $yymain .= qq~ |
| } |
| </td> |
| else { |
| </tr> |
| $registrationdate = $date; |
| </table> |
| } |
| </td> |
| |
| </tr> |
| if ( ${ $uid . $tusername }{'regdate'} && $trstart > $registrationdate ) |
| <tr> |
| { |
| <td align="left" height="80" colspan="2" class="windowbg2" valign="top"><div class="message" style="float: left; width: 99%; overflow: auto;">$message</div></td> |
| if ( $iamguest ) { |
| </tr> |
| $tname = qq~$format_unbold{$tusername}~; |
| </table><br /> |
| } |
| ~; |
| else { |
| ++$counter; |
| $tname = |
| } |
| qq~<a href="$scripturl?action=viewprofile;username=$useraccount{$tusername}" rel="nofollow">$format_unbold{$tusername}</a>~; |
| |
| } |
| $yynavigation = qq~› $maintxt{'215'}~; |
| } |
| $yytitle = $maintxt{'215'}; |
| elsif ( $tusername !~ m{Guest}sm && $trstart < $registrationdate ) { |
| &template; |
| $tname = qq~$tname - $maintxt{'470a'}~; |
| |
| } |
| |
| else { |
| |
| $tname = "$tname ($maintxt{'28'})"; |
| |
| } |
| |
| |
| |
| if ( $musername ne 'Guest' && -e ("$memberdir/$musername.vars") ) { |
| |
| LoadUser($musername); |
| |
| } |
| |
| if ( ${ $uid . $musername }{'regtime'} ) { |
| |
| $registrationdate = ${ $uid . $musername }{'regtime'}; |
| |
| } |
| |
| else { |
| |
| $registrationdate = $date; |
| |
| } |
| |
| |
| |
| if ( ${ $uid . $musername }{'regdate'} && $mdate > $registrationdate ) { |
| |
| if ( $iamguest ) { |
| |
| $mname = qq~$format_unbold{$musername}~; |
| |
| } |
| |
| else { |
| |
| $mname = |
| |
| qq~<a href="$scripturl?action=viewprofile;username=$useraccount{$musername}" rel="nofollow">$format_unbold{$musername}</a>~; |
| |
| } |
| |
| } |
| |
| elsif ( $musername !~ m{Guest}sm && $mdate < $registrationdate ) { |
| |
| $mname = qq~$mname - $maintxt{'470a'}~; |
| |
| } |
| |
| else { |
| |
| $mname = "$mname ($maintxt{'28'})"; |
| |
| } |
| |
| |
| |
| wrap(); |
| |
| $movedflag = q{}; |
| |
| ( $message, $movedflag ) = Split_Splice_Move( $message, $tnum ); |
| |
| if ($enable_ubbc) { |
| |
| $ns = $mns; |
| |
| enable_yabbc(); |
| |
| DoUBBC(); |
| |
| } |
| |
| wrap2(); |
| |
| ToChars($message); |
| |
| $message = Censor($message); |
| |
| |
| |
| ( $msub, undef ) = Split_Splice_Move( $msub, 0 ); |
| |
| ToChars($msub); |
| |
| $msub = Censor($msub); |
| |
| |
| |
| if ($iamguest) { |
| |
| $notify = q{}; |
| |
| } |
| |
| else { |
| |
| if ( ${ $uid . $username }{'thread_notifications'} =~ |
| |
| /\b$tnum\b/xsm ) |
| |
| { |
| |
| $notify = |
| |
| qq~$menusep<a href="$scripturl?action=notify3;num=$tnum/$c;oldnotify=1">$img{'del_notify'}</a>~; |
| |
| } |
| |
| else { |
| |
| $notify = |
| |
| qq~$menusep<a href="$scripturl?action=notify2;num=$tnum/$c;oldnotify=1">$img{'add_notify'}</a>~; |
| |
| } |
| |
| } |
| |
| $mdate = timeformat($mdate); |
| |
| |
| |
| # generate a sub board tree |
| |
| my $boardtree = q{}; |
| |
| my $parentboard = $board; |
| |
| while ($parentboard) { |
| |
| my ( $pboardname, undef, undef ) = |
| |
| split /\|/xsm, $board{$parentboard}; |
| |
| if ( ${ $uid . $parentboard }{'canpost'} |
| |
| || !$subboard{$parentboard} ) |
| |
| { |
| |
| $pboardname = |
| |
| qq~<a href="$scripturl?board=$parentboard"><span class="under">$pboardname</span></a>~; |
| |
| } |
| |
| else { |
| |
| $pboardname = |
| |
| qq~<a href="$scripturl?boardselect=$parentboard;subboards=1"><span class="under">$pboardname</span></a>~; |
| |
| } |
| |
| $boardtree = qq~ / $pboardname$boardtree~; |
| |
| $my_cat = ${ $uid . $parentboard }{'cat'}; |
| |
| $parentboard = ${ $uid . $parentboard }{'parent'}; |
| |
| } |
| |
| $counter = $i + 1; |
| |
| |
| |
| if ( $tstate != 1 && ( !$iamguest || $enable_guestposting ) ) { |
| |
| $my_tstate = $myrecent_mess; |
| |
| $my_tstate =~ s/{yabb tnum}/$tnum/gsm; |
| |
| $my_tstate =~ s/{yabb c}/$c/gsm; |
| |
| } |
| |
| |
| |
| $yymain .= $myrecent; |
| |
| $yymain =~ s/{yabb counter}/$counter/sm; |
| |
| $yymain =~ s/{yabb catbrd}/$my_cat/sm; |
| |
| $yymain =~ s/{yabb catname}/$catname{$board}/sm; |
| |
| $yymain =~ s/{yabb boardtree}/$boardtree/sm; |
| |
| $yymain =~ s/{yabb tnum}/$tnum\/$c#$c/sm; |
| |
| $yymain =~ s/{yabb msub}/$msub/sm; |
| |
| $yymain =~ s/{yabb mdate}/$mdate/sm; |
| |
| $yymain =~ s/{yabb tname}/$tname/sm; |
| |
| $yymain =~ s/{yabb mname}/$mname/sm; |
| |
| $yymain =~ s/{yabb my_tstate}/$my_tstate/sm; |
| |
| $yymain =~ s/{yabb message}/$message/sm; |
| |
| } |
| |
| |
| |
| $yynavigation = qq~› $maintxt{'214'}~; |
| |
| $yytitle = $maintxt{'214'}; |
| |
| template(); |
| |
| return; |
| } |
| } |
| |
| |
| sub RecentPosts { |
| sub RecentTopics { |
| &spam_protection; |
| spam_protection(); |
| |
| |
| |
| $recent_topics = $action eq 'recenttopics' ? 1 : 0; |
| |
| |
| |
| $display = $FORM{'display'} || $INFO{'display'} || 10; |
| |
| if ( $display < 0 ) { $display = 5; } |
| |
| elsif ( $display > $maxrecentdisplay ) { $display = $maxrecentdisplay; } |
| |
| |
| |
| $numfound = 0; |
| |
| get_forum_master(); |
| |
| foreach my $catid (@categoryorder) { |
| |
| my ( $catname, $catperms ) = split /\|/xsm, $catinfo{$catid}; |
| |
| if ( !CatAccess($catperms) ) { next; } |
| |
| (@bdlist) = split /\,/xsm, $cat{$catid}; |
| |
| recursive_check(@bdlist); |
| |
| } |
| |
| |
| |
| @data = reverse sort { $a cmp $b } @data; |
| |
| |
| |
| $numfound = 0; |
| |
| $notify = |
| |
| $recent_topics |
| |
| ? scalar @data |
| |
| : ( @data > $display ? $display : scalar @data ); |
| |
| for my $i ( 0 .. ( $notify - 1 ) ) { |
| |
| ( $mtime, $curboard, $tnum, $treplies, $tusername, $tname, $tstate ) = |
| |
| split /\|/xsm, $data[$i]; |
| |
| |
| |
| fopen( REC_THRETXT, "$datadir/$tnum.txt" ) || next; |
| |
| @mess = <REC_THRETXT>; |
| |
| fclose(REC_THRETXT); |
| |
| |
| |
| for my $c ( $#mess .. @mess ) { |
| |
| chomp $mess[$c]; |
| |
| if ( $mess[$c] ) { |
| |
| ( |
| |
| $msub, $mname, $memail, $mdate, $musername, |
| |
| $micon, $mreplyno, $mip, $message, $mns |
| |
| ) = split /\|/xsm, $mess[$c]; |
| |
| $messages[$numfound] = |
| |
| "$mdate|$curboard|$tnum|$c|$tusername|$tname|$msub|$mname|$memail|$mdate|$musername|$micon|$mreplyno|$mip|$message|$mns|$tstate|$mtime"; |
| |
| $numfound++; |
| |
| } |
| |
| } |
| |
| if ( $recent_topics && $numfound == $display ) { last; } |
| |
| } |
| |
| |
| |
| @messages = reverse sort { $a cmp $b } @messages; |
| |
| |
| |
| if ( $numfound > 0 ) { |
| |
| if ( $numfound > $display ) { $numfound = $display; } |
| |
| LoadCensorList(); |
| |
| $icanbypass = checkUserLockBypass(); |
| |
| } |
| |
| else { |
| |
| $yymain .= qq~<hr class="hr" /><b>$maintxt{'170'}</b><hr />~; |
| |
| } |
| |
| |
| |
| for my $i ( 0 .. ( $numfound - 1 ) ) { |
| |
| ( |
| |
| $dummy, $board, $tnum, $c, $tusername, $tname, |
| |
| $msub, $mname, $memail, $mdate, $musername, $micon, |
| |
| $mattach, $mip, $message, $mns, $tstate, $trstart |
| |
| ) = split /\|/xsm, $messages[$i]; |
| |
| $displayname = $mname; |
| |
| |
| |
| if ( $tusername ne 'Guest' && -e ("$memberdir/$tusername.vars") ) { |
| |
| LoadUser($tusername); |
| |
| } |
| |
| if ( ${ $uid . $tusername }{'regtime'} ) { |
| |
| $registrationdate = ${ $uid . $tusername }{'regtime'}; |
| |
| } |
| |
| else { |
| |
| $registrationdate = $date; |
| |
| } |
| |
| |
| |
| if ( ${ $uid . $tusername }{'regdate'} && $trstart > $registrationdate ) |
| |
| { |
| |
| if ( $iamguest ) { |
| |
| $tname = qq~$format_unbold{$tusername}~; |
| |
| } |
| |
| else { |
| |
| $tname = |
| |
| qq~<a href="$scripturl?action=viewprofile;username=$useraccount{$tusername}" rel="nofollow">$format_unbold{$tusername}</a>~; |
| |
| } |
| |
| } |
| |
| elsif ( $tusername !~ m{Guest}sm && $trstart < $registrationdate ) { |
| |
| $tname = qq~$tname - $maintxt{'470a'}~; |
| |
| } |
| |
| else { |
| |
| $tname = "$tname ($maintxt{'28'})"; |
| |
| } |
| |
| |
| |
| if ( $musername ne 'Guest' && -e ("$memberdir/$musername.vars") ) { |
| |
| LoadUser($musername); |
| |
| } |
| |
| if ( ${ $uid . $musername }{'regtime'} ) { |
| |
| $registrationdate = ${ $uid . $musername }{'regtime'}; |
| |
| } |
| |
| else { |
| |
| $registrationdate = $date; |
| |
| } |
| |
| |
| |
| if ( ${ $uid . $musername }{'regdate'} && $mdate > $registrationdate ) { |
| |
| if ( $iamguest ) { |
| |
| $mname = qq~$format_unbold{$tusername}~; |
| |
| } |
| |
| else { |
| |
| $mname = |
| |
| qq~<a href="$scripturl?action=viewprofile;username=$useraccount{$musername}" rel="nofollow">$format_unbold{$musername}</a>~; |
| |
| } |
| |
| } |
| |
| elsif ( $musername !~ m{Guest}sm && $mdate < $registrationdate ) { |
| |
| $mname = qq~$mname - $maintxt{'470a'}~; |
| |
| } |
| |
| else { |
| |
| $mname = "$mname ($maintxt{'28'})"; |
| |
| } |
| |
| |
| |
| wrap(); |
| |
| $movedflag = q{}; |
| |
| ( $message, $movedflag ) = Split_Splice_Move( $message, $tnum ); |
| |
| if ($enable_ubbc) { |
| |
| $ns = $mns; |
| |
| enable_yabbc(); |
| |
| DoUBBC(); |
| |
| } |
| |
| wrap2(); |
| |
| ToChars($message); |
| |
| $message = Censor($message); |
| |
| |
| |
| ( $msub, undef ) = Split_Splice_Move( $msub, 0 ); |
| |
| ToChars($msub); |
| |
| $msub = Censor($msub); |
| |
| |
| |
| if ($iamguest) { |
| |
| $notify = q{}; |
| |
| } |
| |
| else { |
| |
| if ( ${ $uid . $username }{'thread_notifications'} =~ |
| |
| /\b$tnum\b/xsm ) |
| |
| { |
| |
| $notify = |
| |
| qq~$menusep<a href="$scripturl?action=notify3;num=$tnum/$c;oldnotify=1">$img{'del_notify'}</a>~; |
| |
| } |
| |
| else { |
| |
| $notify = |
| |
| qq~$menusep<a href="$scripturl?action=notify2;num=$tnum/$c;oldnotify=1">$img{'add_notify'}</a>~; |
| |
| } |
| |
| } |
| |
| $mdate = timeformat($mdate); |
| |
| |
| |
| # generate a sub board tree |
| |
| my $boardtree = q{}; |
| |
| my $parentboard = $board; |
| |
| while ($parentboard) { |
| |
| my ( $pboardname, undef, undef ) = |
| |
| split /\|/xsm, $board{"$parentboard"}; |
| |
| if ( ${ $uid . $parentboard }{'canpost'} |
| |
| || !$subboard{$parentboard} ) |
| |
| { |
| |
| $pboardname = |
| |
| qq~<a href="$scripturl?board=$parentboard"><span class="under">$pboardname</span></a>~; |
| |
| } |
| |
| else { |
| |
| $pboardname = |
| |
| qq~<a href="$scripturl?boardselect=$parentboard&subboards=1"><span class="under">$pboardname</span></a>~; |
| |
| } |
| |
| $boardtree = qq~ / $pboardname$boardtree~; |
| |
| $my_cat = ${ $uid . $parentboard }{'cat'}; |
| |
| ( $my_catname, undef ) = split /\|/xsm, $catinfo{$my_cat}; |
| |
| $parentboard = ${ $uid . $parentboard }{'parent'}; |
| |
| } |
| |
| $counter = $i + 1; |
| |
| |
| |
| if ( $tstate != 1 && ( !$iamguest || $enable_guestposting ) ) { |
| |
| $my_tstate = $myrecent_mess; |
| |
| $my_tstate =~ s/{yabb tnum}/$tnum/gsm; |
| |
| $my_tstate =~ s/{yabb c}/$c/gsm; |
| |
| } |
| |
| |
| |
| $yymain .= $myrecent; |
| |
| $yymain =~ s/{yabb counter}/$counter/sm; |
| |
| $yymain =~ s/{yabb catbrd}/$my_cat/sm; |
| |
| $yymain =~ s/{yabb catname}/$my_catname/sm; |
| |
| $yymain =~ s/{yabb boardtree}/$boardtree/sm; |
| |
| $yymain =~ s/{yabb tnum}/$tnum\/$c#$c/sm; |
| |
| $yymain =~ s/{yabb msub}/$msub/sm; |
| |
| $yymain =~ s/{yabb mdate}/$mdate/sm; |
| |
| $yymain =~ s/{yabb tname}/$tname/sm; |
| |
| $yymain =~ s/{yabb mname}/$mname/sm; |
| |
| $yymain =~ s/{yabb my_tstate}/$my_tstate/sm; |
| |
| $yymain =~ s/{yabb message}/$message/sm; |
| |
| } |
| |
| |
| |
| $yynavigation = qq~› $maintxt{'214b'}~; |
| |
| $yytitle = $maintxt{'214b'}; |
| |
| template(); |
| |
| return; |
| |
| } |
| |
| |
| my $display = $FORM{'display'} ||= 10; |
| sub recursive_check { |
| if ($display < 0) { $display = 5; } |
| my @x = @_; |
| elsif ($display > $maxrecentdisplay) { $display = $maxrecentdisplay; } |
| foreach my $curboard (@x) { |
| my (@memset, @categories, %data, $numfound, $curcat, %catid, %catname, %cataccess, %catboards, $openmemgr, @membergroups, %openmemgr, $curboard, @threads, @boardinfo, $i, $c, @messages, $tnum, $tsub, $tname, $temail, $tdate, $treplies, $tusername, $ticon, $tstate, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $mns, $mtime, $counter, $board, $notify); |
| ( $boardname{$curboard}, $boardperms, undef ) = split /\|/xsm, |
| $numfound = 0; |
| $board{$curboard}; |
| |
| |
| unless ($mloaded == 1) { require "$boardsdir/forum.master"; } |
| my $access = AccessCheck( $curboard, q{}, $boardperms ); |
| foreach $catid (@categoryorder) { |
| if ( !$iamadmin && $access ne 'granted' ) { next; } |
| $boardlist = $cat{$catid}; |
| |
| |
| if ( ${ $uid . $curboard }{'brdpasswr'} ) { |
| (@bdlist) = split(/\,/, $boardlist); |
| my $bdmods = ${ $uid . $curboard }{'mods'}; |
| ($catname, $catperms) = split(/\|/, $catinfo{$catid}); |
| $bdmods =~ s/\, /\,/gsm; |
| $cataccess = &CatAccess($catperms); |
| $bdmods =~ s/\ /\,/gsm; |
| if (!$cataccess) { next; } |
| my %moderators = (); |
| |
| my $pswiammod = 0; |
| foreach $curboard (@bdlist) { |
| foreach my $curuser ( split /\,/xsm, $bdmods ) { |
| ($boardname{$curboard}, $boardperms, $boardview) = split(/\|/, $board{$curboard}); |
| if ( $username eq $curuser ) { $pswiammod = 1; } |
| |
| } |
| my $access = &AccessCheck($curboard, '', $boardperms); |
| my $bdmodgroups = ${ $uid . $curboard }{'modgroups'}; |
| if (!$iamadmin && $access ne "granted") { next; } |
| $bdmodgroups =~ s/\, /\,/gsm; |
| |
| my %moderatorgroups = (); |
| $catid{$curboard} = $catid; |
| foreach my $curgroup ( split /\,/xsm, $bdmodgroups ) { |
| $catname{$curboard} = $catname; |
| if ( ${ $uid . $username }{'position'} eq $curgroup ) { |
| |
| $pswiammod = 1; |
| fopen(REC_BDTXT, "$boardsdir/$curboard.txt"); |
| } |
| for ($i = 0; $i < $display && ($buffer = <REC_BDTXT>); $i++) { |
| foreach my $memberaddgroups ( split /\, /sm, |
| ($tnum, $tsub, $tname, $temail, $tdate, $treplies, $tusername, $ticon, $tstate) = split(/\|/, $buffer); |
| ${ $uid . $username }{'addgroups'} ) |
| chomp $tstate; |
| { |
| if ($tstate !~ /h/ || $iamadmin || $iamgmod) { |
| chomp $memberaddgroups; |
| $mtime = $tdate; |
| if ( $memberaddgroups eq $curgroup ) { |
| $data[$numfound] = "$mtime|$curboard|$tnum|$treplies|$tusername|$tname|$tstate"; |
| $pswiammod = 1; |
| $numfound++; |
| last; |
| } |
| } |
| } |
| } |
| fclose(REC_BDTXT); |
| } |
| } |
| my $cookiename = "$cookiepassword$curboard$username"; |
| } |
| my $crypass = ${ $uid . $curboard }{'brdpassw'}; |
| |
| if ( !$iamadmin |
| @data = sort {$b <=> $a} @data; |
| && !$iamgmod |
| |
| && !$pswiammod |
| $numfound = 0; |
| && $yyCookies{$cookiename} ne $crypass ) |
| $threadfound = @data > $display ? $display : @data; |
| { |
| |
| next; |
| for ($i = 0; $i < $threadfound; $i++) { |
| } |
| ($mtime, $curboard, $tnum, $treplies, $tusername, $tname, $tstate) = split(/\|/, $data[$i]); |
| } |
| # No need to check for hidden topics here, it was done above |
| |
| $tstart = $mtime; |
| $catid{$curboard} = $catid; |
| fopen(REC_THRETXT, "$datadir/$tnum.txt") || next; |
| $catname{$curboard} = $catname; |
| @mess = <REC_THRETXT>; |
| |
| fclose(REC_THRETXT); |
| fopen( REC_BDTXT, "$boardsdir/$curboard.txt" ); |
| |
| @buffer = <REC_BDTXT>; |
| $threadfrom = @mess > $display ? @mess - $display : 0; |
| if ( !$display ) { |
| for ($ii = $threadfrom; $ii < @mess + 1; $ii++) { |
| $display = scalar @buffer; |
| if ($mess[$ii]) { |
| } |
| ($msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns) = split(/\|/, $mess[$ii]); |
| for my $i ( 0 .. ( $display - 1 ) ) { |
| $mtime = $mdate; |
| if ( $buffer[$i] ) { |
| $messages[$numfound] = "$mtime|$curboard|$tnum|$ii|$tusername|$tname|$msub|$mname|$memail|$mdate|$musername|$micon|$mattach|$mip|$message|$mns|$tstate|$tstart"; |
| ( |
| $numfound++; |
| $tnum, $tsub, $tname, $temail, $tdate, |
| } |
| $treplies, $tusername, $ticon, $tstate |
| } |
| ) = split /\|/xsm, $buffer[$i]; |
| } |
| chomp $tstate; |
| |
| if ( $tstate !~ /h/sm || $iamadmin || $iamgmod ) { |
| @messages = sort {$b <=> $a} @messages; |
| $mtime = $tdate; |
| |
| $data[$numfound] = |
| if ($numfound > 0) { |
| "$mtime|$curboard|$tnum|$treplies|$tusername|$tname|$tstate"; |
| if ($numfound > $display) { $numfound = $display; } |
| $numfound++; |
| $counter = 1; |
| } |
| &LoadCensorList; |
| } |
| } else { |
| } |
| $yymain .= qq~<hr class="hr"><b>$maintxt{'170'}</b><hr>~; |
| fclose(REC_BDTXT); |
| } |
| if ( $subboard{$curboard} ) { |
| |
| recursive_check( split /\|/xsm, $subboard{$curboard} ); |
| for ($i = 0; $i < $numfound; $i++) { |
| } |
| ($dummy, $board, $tnum, $c, $tusername, $tname, $msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns, $tstate, $trstart) = split(/\|/, $messages[$i]); |
| } |
| $displayname = $mname; |
| return; |
| |
| |
| if ($tusername ne 'Guest' && -e ("$memberdir/$tusername.vars")) { &LoadUser($tusername); } |
| |
| if (${$uid.$tusername}{'regtime'}) { |
| |
| $registrationdate = ${$uid.$tusername}{'regtime'}; |
| |
| } else { |
| |
| $registrationdate = $date; |
| |
| } |
| |
| |
| |
| if (${$uid.$tusername}{'regdate'} && $trstart > $registrationdate) { |
| |
| $tname = qq~<a href="$scripturl?action=viewprofile;username=$useraccount{$tusername}">${$uid.$tusername}{'realname'}</a>~; |
| |
| } elsif ($tusername !~ m~Guest~ && $trstart < $registrationdate) { |
| |
| $tname = qq~$tname - $maintxt{'470a'}~; |
| |
| } else { |
| |
| $tname = "$tname ($maintxt{'28'})"; |
| |
| } |
| |
| |
| |
| if ($musername ne 'Guest' && -e ("$memberdir/$musername.vars")) { &LoadUser($musername); } |
| |
| if (${$uid.$musername}{'regtime'}) { |
| |
| $registrationdate = ${$uid.$musername}{'regtime'}; |
| |
| } else { |
| |
| $registrationdate = $date; |
| |
| } |
| |
| |
| |
| if (${$uid.$musername}{'regdate'} && $mdate > $registrationdate) { |
| |
| $mname = qq~<a href="$scripturl?action=viewprofile;username=$useraccount{$musername}">${$uid.$musername}{'realname'}</a>~; |
| |
| } elsif ($musername !~ m~Guest~ && $mdate < $registrationdate) { |
| |
| $mname = qq~$mname - $maintxt{'470a'}~; |
| |
| } else { |
| |
| $mname = "$mname ($maintxt{'28'})"; |
| |
| } |
| |
| |
| |
| &wrap; |
| |
| ($message, undef) = &Split_Splice_Move($message,$tnum); |
| |
| if ($enable_ubbc) { |
| |
| $ns = $mns; |
| |
| if (!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } |
| |
| &DoUBBC; |
| |
| } |
| |
| &wrap2; |
| |
| &ToChars($message); |
| |
| $message = &Censor($message); |
| |
| |
| |
| ($msub, undef) = &Split_Splice_Move($msub,0); |
| |
| &ToChars($msub); |
| |
| $msub = &Censor($msub); |
| |
| |
| |
| if ($iamguest) { |
| |
| $notify = ''; |
| |
| } else { |
| |
| if (${$uid.$username}{'thread_notifications'} =~ /\b$tnum\b/) { |
| |
| $notify = qq~$menusep<a href="$scripturl?action=notify3;num=$tnum/$c;oldnotify=1">$img{'del_notify'}</a>~; |
| |
| } else { |
| |
| $notify = qq~$menusep<a href="$scripturl?action=notify2;num=$tnum/$c;oldnotify=1">$img{'add_notify'}</a>~; |
| |
| } |
| |
| } |
| |
| $mdate = &timeformat($mdate); |
| |
| $yymain .= qq~ |
| |
| <table border="0" width="100%" cellspacing="1" class="bordercolor" style="table-layout: fixed;"> |
| |
| <tr> |
| |
| <td align="center" width="5%" class="titlebg">$counter</td> |
| |
| <td align="left" width="95%" class="titlebg"> <a href="$scripturl?catselect=$catid{$board}"><u>$catname{$board}</u></a> / <a href="$scripturl?board=$board"><u>$boardname{$board}</u></a> / <a href="$scripturl?num=$tnum/$c#$c"><u>$msub</u></a><br /> |
| |
| <span class="small">$maintxt{'30'}: $mdate</span> </td> |
| |
| </tr> |
| |
| <tr> |
| |
| <td colspan="2"> |
| |
| <table border="0" width="100%" class="catbg"> |
| |
| <tr> |
| |
| <td align="left">$maintxt{'109'} $tname | $maintxt{'197'} $mname</td> |
| |
| <td align="right"> ~; |
| |
| |
| |
| if ($tstate != 1 && (!$iamguest || $enable_guestposting)) { |
| |
| $yymain .= qq~<a href="$scripturl?board=$board;action=post;num=$tnum/$c#$c;title=PostReply">$img{'reply'}</a>$menusep<a href="$scripturl?board=$board;action=post;num=$tnum;quote=$c;title=PostReply">$img{'recentquote'}</a>$notify ~; |
| |
| } |
| |
| |
| |
| $yymain .= qq~ |
| |
| </td> |
| |
| </tr> |
| |
| </table> |
| |
| </td> |
| |
| </tr> |
| |
| <tr> |
| |
| <td align="left" height="80" colspan="2" class="windowbg2" valign="top"><div style="float: left; width: 99%; overflow: auto;">$message</div></td> |
| |
| </tr> |
| |
| </table><br /> |
| |
| ~; |
| |
| ++$counter; |
| |
| } |
| |
| |
| |
| if ($img_greybox) { |
| |
| $yyinlinestyle .= qq~<link href="$yyhtml_root/greybox/gb_styles.css" rel="stylesheet" type="text/css" />\n~; |
| |
| $yyjavascript .= qq~ |
| |
| var GB_ROOT_DIR = "$yyhtml_root/greybox/"; |
| |
| // --> |
| |
| </script> |
| |
| <script type="text/javascript" src="$yyhtml_root/AJS.js"></script> |
| |
| <script type="text/javascript" src="$yyhtml_root/AJS_fx.js"></script> |
| |
| <script type="text/javascript" src="$yyhtml_root/greybox/gb_scripts.js"></script> |
| |
| <script type="text/javascript"> |
| |
| <!--~; |
| |
| } |
| |
| |
| |
| $yynavigation = qq~› $maintxt{'214'}~; |
| |
| $yytitle = $maintxt{'214'}; |
| |
| &template; |
| |
| } |
| } |
| |
| |
| 1; |
| 1; |
| |
| |