############################################################################### # Display.pl # ############################################################################### # YaBB: Yet another Bulletin Board # # Open-Source Community Software for Webmasters # # Version: YaBB 1 Gold - SP 1.3 # # Released: December 2001; Updated April 6, 2003 # # Distributed by: http://www.yabbforum.com # # =========================================================================== # # Copyright (c) 2000-2003 YaBB (www.yabbforum.com) - All Rights Reserved. # # Software by: The YaBB Development Team # # with assistance from the YaBB community. # # Sponsored by: Xnull Internet Media, Inc. - http://www.ximinc.com # ############################################################################### $displayplver = "1 Gold - SP 1.3"; sub Display { require "$sourcedir/Karma.pl"; my $viewnum = $INFO{'num'}; if( $viewnum =~ /\D/ ) { &fatal_error($txt{'337'}); } if( $currentboard eq '' ) { &fatal_error($txt{'1'}); } $maxmessagedisplay ||= 10; my($favor, $isfavor); my($buffer,$views,$lastposter,$moderators,$counter,$counterwords,$pageindex,$msubthread,$mnum,$mstate,$mdate,$msub,$mname,$memail,$mreplies,$musername,$micon,$noposting,$threadclass,$notify,$max,$start,$bgcolornum,$windowbg,$mattach,$mip,$mlm,$mlmb,$lastmodified,$postinfo,$star,$sendm,$topicdate); my(@userprofile,@messages,@bgcolors); my $postinfosmily; # Determine what category we are in. fopen(FILE, "$boardsdir/$currentboard.ctb") || &fatal_error("300 $txt{'106'}: $txt{'23'} $currentboard.ctb"); $curcat = ; fclose(FILE); #$curcat = $cat; fopen(FILE, "$boardsdir/$curcat.cat") || &fatal_error("300 $txt{'106'}: $txt{'23'} $cat.cat"); $cat = ; fclose(FILE); # Load the membergroups list. fopen(FILE, "$vardir/membergroups.txt") || &fatal_error("100 $txt{'106'}: $txt{'23'} membergroups.txt"); @membergroups = ; fclose(FILE); # Mark current thread as read. ($mnum,$tmpa,$tmpa,$tmpa,$mdate) = split(/\|/,$yyThreadLine); &dumplog($mnum,$date); # Add 1 to the number of views of this thread. if(fopen(FILE, "$datadir/$viewnum.data")) { $tmpa = ; @other_stuff = ; fclose(FILE); chomp $tmpa; } elsif( -e "$datadir/$viewnum.data" ) { &fatal_error("102 $txt{'106'}: $txt{'23'} $viewnum.data"); } else { $tmpa = '0'; } ($tmpa, $tmpb) = split( /\|/, $tmpa ); $tmpa++; fopen(FILE, "+>$datadir/$viewnum.data") || &fatal_error("103 $txt{'106'}: $txt{'23'} $viewnum.data"); print FILE qq~$tmpa|$tmpb~; print FILE qq~\n~; print FILE @other_stuff; fclose(FILE); $views = $tmpa - 1; # Check to make sure this thread isn't locked. ($mnum,$msubthread,$mname,$memail,$mdate,$mreplies,$musername,$micon,$mstate) = split( /\|/, $yyThreadLine ); $noposting = $viewnum eq $mnum && $mstate == 1 ? 1 : 0; # Get the class of this thread, based on lock status and number of replies. $replybutton = qq~$img{'reply'}~; $threadclass = 'thread'; if( $mstate == 1 ) { $threadclass = 'locked'; $replybutton = ""; } elsif( $mreplies > 24 ) { $threadclass = 'veryhotthread'; } elsif( $mreplies > 14 ) { $threadclass = 'hotthread'; } elsif( $mstate == 0 ) { $threadclass = 'thread'; } fopen(FILE, "$boardsdir/sticky.stk") || &fatal_error("300 $txt{'106'}: $txt{'23'} sticky.stk"); @stickys = ; fclose(FILE); foreach $curnum (@stickys) { if ($mnum == $curnum) { if($threadclass eq 'locked') { $threadclass = 'stickylock'; } else { $threadclass = 'sticky'; } } } &LoadCensorList; # Load Censor List # Build a list of this board's moderators. if( scalar keys %moderators > 0 ) { if( scalar keys %moderators == 1 ) { $showmods = qq~($txt{'298'}: ~; } else { $showmods = qq~($txt{'299'}: ~; } while( $_ = each(%moderators) ) { &FormatUserName($_); $showmods .= qq~$moderators{$_}, ~; } $showmods =~ s/, \Z/)/; } if($enable_notification) { my $startnum = $start || '0'; $notify = qq~$menusep$img{'notify'}~; } $isfavor = ''; if($enable_favorites && $username ne 'Guest') { my $startnum = $start || '0'; $favor = qq~$menusep$img{'favora'}~; if(-e "$datadir/$viewnum.fav") { fopen(FILE, "$datadir/$viewnum.fav"); @favnames = ; fclose(FILE); foreach $chfav (@favnames) { chomp $chfav; if($username eq $chfav) { $favor = qq~$menusep$img{'favorr'}~; $isfavor = qq~$fav{'8'} ~; last; } } } $notify = $favor .= $notify; } &jumpto; # create the jumpto list # look for thread header for this topic if (-e "$datadir/$viewnum.head") { require "$sourcedir/ThreadHeader.pl"; &ShowHeader($viewnum);} # Build the page links list. $postdisplaynum = 3; # max number of pages to display $max = $mreplies + 1; $start = $INFO{'start'} || 0; $start = $start > $mreplies ? $mreplies : $start; $start = ( int( $start / $maxmessagedisplay ) ) * $maxmessagedisplay; $tmpa = 1; $tmpx = int( $max / $maxmessagedisplay ); if ($start >= (($postdisplaynum-1) * $maxmessagedisplay)) { $startpage = $start - (($postdisplaynum-1) * $maxmessagedisplay); $tmpa = int( $startpage / $maxmessagedisplay ) + 1; } if ($max >= $start + ($postdisplaynum * $maxmessagedisplay)) { $endpage = $start + ($postdisplaynum * $maxmessagedisplay); } else { $endpage = $max } if ($start != 0) { $previous=$start-$maxmessagedisplay; $pageindex = qq~ $pnptxt{'1'} $pnptxt{'3'} ~; } if ($startpage > 0) { $pageindex .= qq~1 ... ~; } elsif ($startpage == $maxmessagedisplay) { $pageindex .= qq~1 ~;} for( $counter = $startpage; $counter < $endpage; $counter += $maxmessagedisplay ) { $pageindex .= $start == $counter ? qq~$tmpa ~ : qq~$tmpa ~; $tmpa++; } $tmpx = $max - $maxmessagedisplay; $outerpn = int($tmpx / $maxmessagedisplay) + 0; $lastpn = int($mreplies / $maxmessagedisplay) + 1; $lastptn = ($lastpn - 1) * $maxmessagedisplay; if ($endpage < $max - ($maxmessagedisplay) ) {$pageindexadd = qq~ ... ~;} if ($endpage != $max) {$pageindexadd .= qq~ $lastpn~;} if ($start != $lastptn) { $next=$start+$maxmessagedisplay; $pageindexadd .= qq~ $pnptxt{'4'} $pnptxt{'2'}~;} $pageindex .= $pageindexadd; foreach (@censored) { ($tmpa,$tmpb) = @{$_}; $msubthread =~ s~\Q$tmpa\E~$tmpb~gi; } $curthreadurl = $curposlinks ? qq~$msubthread~ : $msubthread; ################################ ### START PREVIOUS/NEXT PLUS ### fopen(FILE, "$boardsdir/$INFO{'board'}.txt"); @threads = ; fclose(FILE); $thisthreadpos = -1; $numthreads = @threads; #work out where this thread is in the list for ($i = 0; $i < $numthreads; $i++) { if ($threads[$i] =~ /^$viewnum/) { $thisthreadpos = $i; } } ($junk, $curtitle) = split(/\|/, $threads[$thisthreadpos]); #do we have a previous or next thread to link to? $previouspos = ($thisthreadpos - 1 >= 0) ? $thisthreadpos - 1 : -1; $nextpos = ($thisthreadpos + 1 < $numthreads) ? $thisthreadpos + 1 : -1; #construct previous link if ($previouspos >= 0) { ($previd, $prevtitle, $junk, $junk, $prevdate) = split(/\|/, $threads[$previouspos]); #should we abbreviate the thread title? if (length($prevtitle) > 20) { $prevtitle = substr($prevtitle, 0, 20) . '...'; } #make sure the link goes to the last page of the thread display fopen(FILE, "$datadir/$previd.txt"); @num_posts = ; fclose(FILE); $num_posts = @num_posts; $num_posts--; #is the previous thread unread? $dlp = &getlog($previd); $threaddate = stringtotime($prevdate); $prevnew = ( $max_log_days_old && $dlp < $threaddate && $username ne 'Guest' && &getlog("$INFO{'board'}--mark") < $threaddate ) ? 'previous_new' : 'previous'; $previouslink = qq~$txt{'768'}: $prevtitle  $prevtitle  «- ~; } else { $previouslink = ''; } #construct next link if ($nextpos > 0) { ($nextid, $nexttitle, $junk, $junk, $nextdate) = split(/\|/, $threads[$nextpos]); #should we abbreviate the thread title? if (length($nexttitle) > 15) { $nexttitle = substr($nexttitle, 0, 20) . '...'; } #make sure the link goes to the last page of the thread display fopen(FILE, "$datadir/$nextid.txt"); @num_posts = ; fclose(FILE); $num_posts = @num_posts; $num_posts--; #is the next thread unread? $dlp = &getlog($nextid); $threaddate = stringtotime($nextdate); $nextnew = ( $max_log_days_old && $dlp < $threaddate && $username ne 'Guest' && &getlog("$INFO{'board'}--mark") < $threaddate ) ? 'next_new' : 'next'; $nextlink = qq~ -»  $nexttitle  $txt{'767'}: $nexttitle~; } else { $nextlink = ''; } $nav = ''; $nav = qq~$previouslink $txt{'33'} $nextlink~; ### END PREVIOUS/NEXT PLUS ##### ################################ if(!-e ("$vardir/$viewnum.rate") && $autoapplyrate{$currentboard} == 1) { if(!-e ("$vardir/rateslist.txt")) { fopen(FILE, ">$vardir/rateslist.txt", 1); print FILE "|1|1|1\n"; fclose(FILE); } fopen(FILE, "$vardir/rateslist.txt"); @ratelist = ; $listnum = @ratelist; fclose(FILE); $namestart = ""; $namestart .= qq($msubthread|$date); $ratelink = qq~$scripturl?board=$currentboard;action=display;num=$viewnum~; fopen( FILE, ">$vardir/$viewnum.rate", 1); print FILE "$boardname\n"; print FILE "$namestart\n"; print FILE "\n"; print FILE "0.00|0\n"; print FILE "$ratelink\n"; fclose(FILE); fopen(FILE, ">$vardir/rateslist.txt", 1); foreach $currate (@ratelist) { chomp $currate; print FILE "$currate\n"; } print FILE "$viewnum|$username\n"; fclose(FILE); } if($autoapplyrate{$currentboard} != 1) { if(-e ("$vardir/$viewnum.rate")) { $admin_rate = qq~$img{'rem_rating'}~; } else { $admin_rate = qq~$img{'add_rating'}~; } } $yymain .= qq~ ~; if( $enable_favorites && $enable_favdrop && $username ne 'Guest' ) { require "$sourcedir/Favor.pl"; &favordrop; $yymain .= qq~ ~; } $yymain .= qq~
$favselect
   $mbname
   $cat
   $boardname
$showmods
   $curthreadurl
$nav
$txt{'139'}: $pageindex $replybutton$notify$menusep $img{'sendtopic'}$menusep $img{'print'}
~; if(-e ("$vardir/$viewnum.rate") && $start == 0) { my ($rateicon); if($mstate == 0) { $rateicon = 'rate' } elsif($mstate == 1) { $rateicon = 'ratelock' } fopen(FILE, "$vardir/rateslist.txt"); @ratelist = ; fclose(FILE); fopen(FILE, ">$vardir/rateslist.txt", 1); foreach $currate (@ratelist) { chomp $currate; ($thiscurrate, $thiscurusr, $thiscurstate) = split(/\|/, $currate); if($thiscurrate ne $viewnum) { print FILE "$currate\n"; } else { print FILE "$thiscurrate|$thiscurusr|$mstate\n"; } } fclose(FILE); @rateinfo = (); fopen(RATEFILEREAD,"$vardir/$viewnum.rate"); @rateinfo = ; $lines = @rateinfo; fclose(RATEFILEREAD); chomp @rateinfo; ($thisname, $dummy) = split(/\|/,$rateinfo[1]); $thisuser = $username; if($thisuser eq "Guest") { $thisuser = $user_ip } $totalrate = 0; $raters = $lines - 5; if($raters > 0) { for($i=5; $i < $lines; $i++) { ($thisrater, $thisrate) = split(/\|/,$rateinfo[$i]); if($thisuser eq $thisrater) { $intrate = int($thisrate); $check[$intrate] = "selected"; } $totalrate = $totalrate + $thisrate; } $therate = sprintf ("%.2f", ($totalrate/$raters)); } else { $therate = "0.00" } ($rating, $clicks) = split(/\|/,$rateinfo[3]); $barrate = $rating * 10; $ratebar = ""; $ratebar1 = ""; $ratebar2 = ""; $barchart = int($barrate); $barchart1 = 100 - $barchart; if ($barchart < 1) {$ratebar = "$ratebar";} else { $ratebar = qq~~; } if ($barchart > 99) {$ratebar1 = "$ratebar1";} else { $ratebar1 = qq~~; } $ratebar2 = qq~$ratebar$ratebar1~; @barhight = (); @itembar = (); $maxhight = 0; $y = 0; for($x=1;$x<11;$x++) { $itembar[$y] = ""; $barhight[$y] = 0; for($i=5;$i<$lines;$i++) { ($dummy, $otherate, $dummy1, $dummy2, $dummy3) = split(/\|/,$rateinfo[$i]); if($otherate == $x) { $barhight[$y]++ } } if($barhight[$y] > $maxhight) { $maxhight = $barhight[$y] } if($barhight[$y] == 0) { $barhightdig[$y] = " "; } else { $barhightdig[$y] = $barhight[$y]; } $y++; } if($maxhight <= 5) { $maxhight = 5; $scaleincr = 1; for($i=0;$i<10;$i++) { $barhight[$i] = $barhight[$i] * 20; } } else { $tmpmaxhight = int($maxhight / 5); $tmpmaxhight = $tmpmaxhight + 1; $maxhight = $tmpmaxhight * 5; $scaleincr = $maxhight / 5; for($i=0;$i<10;$i++) { if($barhight[$i] > 0) { $bartemp = ($barhight[$i] * 100); $barhight[$i] = int(($bartemp / $maxhight) + 0.5); } } } $scaledig = $maxhight; for($i=0;$i<5;$i++) { $barscaledig[$i] = $scaledig; $scaledig = $scaledig - $scaleincr; } for($y=0;$y<10;$y++) { $itembar[$y] = ""; if($barhight[$y] == 0) { $itembar[$y] = qq~
~; } else { $itembar[$y] = qq~$barhightdig[$y]
~; } } $yymain .= qq~
   $ratetxt{'02a'}  $txt{'118'}: $msubthread
~; if($rateinfo[2] ne "") { $descrip = $rateinfo[2]; $descrip =~ s~\&\&~
~g; $message = $descrip; &wrap; if($enable_ubbc) { if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; $descrip = $message; $yymain .= qq~ ~; } $yymain .= qq~
$descrip
~; if($username ne "Guest" || $guest_rate) { if($mstate == 0) { $yymain .= qq~ ~; } else { $yymain .= qq~ ~; } } else { $yymain .= qq~ ~; } $yymain .= qq~
$ratetxt{'03'}:
$txt{'456'}
$ratetxt{'21'}
$ratetxt{'02a'}: $ratebar2
$ratetxt{'02a'}: $therate
$ratetxt{'05'}: $raters
~; for($i=0;$i<10;$i++) { $yymain .= qq~ ~; } $yymain .= qq~ ~; for($i=0;$i<10;$i++) { $ratedig = $i + 1; $yymain .= qq~ ~; } $yymain .= qq~
~; for($i=0;$i<5;$i++) { $yymain .= qq~ ~; } $yymain .= qq~

$barscaledig[$i]

$itembar[$i] ~; for($i=0;$i<5;$i++) { $yymain .= qq~ ~; } $yymain .= qq~

$barscaledig[$i]


$ratedig

~; } $yymain .= qq~
   $txt{'29'}  $txt{'118'}: $isfavor$msubthread  ($txt{'641'} $views $txt{'642'})
~; # Load background color list. @bgcolors = ( $color{windowbg}, $color{windowbg2} ); $bgcolornum = scalar @bgcolors; @cssvalues = ( "windowbg","windowbg2" ); $cssnum = scalar @bgcolors; if(!$MenuType) { $sm = 1; } $counter = 0; fopen(FILE,"$datadir/$viewnum.txt") || &fatal_error("104 $txt{'106'}: $txt{'23'} $viewnum.txt"); # Skip past the posts in this thread until we reach $start. while($counter < $start && ($buffer = )) { $counter++; } $#messages = $maxmessagedisplay - 1; for($counter = 0; $counter < $maxmessagedisplay && ($buffer = ); $counter++) { $messages[$counter] = $buffer; } fclose(FILE); $#messages = $counter - 1; $counter = $start; $yymain .= qq~
~; # For each post in this thread: foreach (@messages) { undef $realgroup; $windowbg = $bgcolors[($counter % $bgcolornum)]; $css = $cssvalues[($counter % $cssnum)]; chomp; ($msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $postmessage, $ns, $mlm, $mlmb) = split(/[\|]/, $_); $lastmoduser = $mlmb; # Should we show "last modified by?" if( $mlm && $showmodify && $mlm ne "" && $mlmb ne "") { $mlm = &timeformat($mlm); &LoadUser($mlmb); $mlmb = $userprofile{$mlmb}->[1] || $mlmb || $txt{'470'}; $lastmodified = qq~« $txt{'211'}: $mlm $txt{'525'} $mlmb »~; } else { $mlm = '-'; $lastmodified = ''; } $msub ||= $txt{'24'}; $messdate = &timeformat($mdate); if ($settings[7] eq 'Administrator' || $settings[7] eq 'Global Moderator' && $allow_mod == 1) { $mip = $mip } else { $mip = "$txt{'511'}"; } $sendm = ''; # If the user isn't a guest, load his/her info. if($musername ne 'Guest' && ! $yyUDLoaded{$musername} && -e("$memberdir/$musername.dat") ) { &LoadUserDisplay($musername); # If user is not in memory, s/he must be loaded. } my($loccode, $displocal, $dispcountry, $dispcontin, $dispx, $dispy, $dispstate, $dispflag, $disptext); if($yyUDLoaded{$musername}) { @userprofile = @{$userprofile{$musername}}; ($loccode, $displocal, $dispcountry, $dispcontin, $dispx, $dispy, $dispstate) = split(/\|/, $userprofile[15]); if($dispcountry ne "") { if($view_flag) { if($loccode eq "x1") { $dispflag = qq~$dispcountry ~; } elsif($loccode eq "x0") { $dispflag = qq~$dispcountry ~; } else { $dispflag = ""; } } if($view_text) { my($initstat, $namestat, $disploc); if($dispstate ne "") { ($initstat, $namestat) = split(/\,/, $dispstate); } if($displocal ne "") { $disploc = qq~$displocal $initstat~; } if($loccode eq "x1") { $disptext = qq~$disploc~; } elsif($loccode eq "x0") { $disptext = qq~$disploc~; } else { $disptext = ""; } } } $displayname = $userprofile[1]; fopen(NUMBERFILEREAD,"$memberdir/$musername.yam"); @number = ; fclose(NUMBERFILEREAD); chomp @number; if ($musername eq "admin") { $displaynumb = ''; } else { $displaynumb = qq~$membtxt{'23'} $number[0]~; } $star = $memberstar{$musername}; $memberinfo = $memberinfo{$musername}; $memberinfo =~ s~\n~~g; $icqad = $icqad{$musername}; $yimon = $yimon{$musername}; #homepage mod - do we want a link if (-e("$memberdir/$useraccount{$musername}.home")) { unless ($username eq 'Guest' && !$guests_view_hp) { fopen(FILE, "$memberdir/$useraccount{$musername}.home"); $hp = ; fclose(FILE); chomp $hp; ($junk, $junk, $hp_banned) = split(/\|/, $hp); if ($hp_banned) { $homepage_link = ''; } else { $homepage_link = qq~ $hp_txt{'1'}~; } } } else { $homepage_link = ''; } if($username ne 'Guest') { # Allow instant message sending if current user is a member. $sendm = qq~$menusep$img{'message_sm'}~; } $usernamelink = $link{$musername}; $postinfo = qq~$txt{'26'}: $userprofile[6]
~; # Post Info Smilies Code Starts here # if($userprofile[6] < 10) { $postinfosmily = qq~
~; } if($userprofile[6] > 9 && $userprofile[6] < 25) { $postinfosmily = qq~
~; } if($userprofile[6] > 24 && $userprofile[6] < 50) { $postinfosmily = qq~
~; } if($userprofile[6] > 49 && $userprofile[6] < 100) { $postinfosmily = qq~
~; } if($userprofile[6] > 99 && $userprofile[6] < 150) { $postinfosmily = qq~
~; } if($userprofile[6] > 149 && $userprofile[6] < 200) { $postinfosmily = qq~
~; } if($userprofile[6] > 199 && $userprofile[6] < 250) { $postinfosmily = qq~
~; } if($userprofile[6] > 249 && $userprofile[6] < 300) { $postinfosmily = qq~
~; } if($userprofile[6] > 299 && $userprofile[6] < 400) { $postinfosmily = qq~
~; } if($userprofile[6] > 399 && $userprofile[6] < 500) { $postinfosmily = qq~
~; } if($userprofile[6] > 499 && $userprofile[6] < 750) { $postinfosmily = qq~
~; } if($userprofile[6] > 749 && $userprofile[6] < 1000) { $postinfosmily = qq~
~; } if($userprofile[6] > 999 && $userprofile[6] < 1250) { $postinfosmily = qq~
~; } if($userprofile[6] > 1249 && $userprofile[6] < 1500) { $postinfosmily = qq~
~; } if($userprofile[6] > 1499 && $userprofile[6] < 2000) { $postinfosmily = qq~
~; } if($userprofile[6] > 1999 && $userprofile[6] < 2500) { $postinfosmily = qq~
~; } if($userprofile[6] > 2499 && $userprofile[6] < 3000) { $postinfosmily = qq~
~; } if($userprofile[6] > 2999 && $userprofile[6] < 4000) { $postinfosmily = qq~
~; } if($userprofile[6] > 3999 && $userprofile[6] < 5000) { $postinfosmily = qq~
~; } if($userprofile[6] > 4999 && $userprofile[6] < 6000) { $postinfosmily = qq~
~; } if($userprofile[6] > 5999 && $userprofile[6] < 7000) { $postinfosmily = qq~
~; } if($userprofile[6] > 6999 && $userprofile[6] < 8000) { $postinfosmily = qq~
~; } if($userprofile[6] > 7999 && $userprofile[6] < 9000) { $postinfosmily = qq~
~; } if($userprofile[6] > 8999 && $userprofile[6] < 10000) { $postinfosmily = qq~
~; } if($userprofile[6] > 9999) { $postinfosmily = qq~
~; } # End Post Info Smiley Code # $memail = $userprofile[2]; $karmainfo = "
$karmatxt{'1'} " . &getKarma($musername); my($inMemberGroup) = &isInMemberGroup; if (($username ne "Guest") && ($inMemberGroup == 1)){ $karmainfo .= "
 $karmatxt{'2'} |  $karmatxt{'3'}"; } $onlinemem = $img{'mem_offline'}; foreach $curentry (@online_log) { my ($tmp_name, $tmp_online, $tmp_ip, $tmp_time, $dummy ) = split( /\|/, $curentry, 5 ); if (($time - $tmp_time) > ($OnlineLogTime * 60)) {last;} if($tmp_name && $tmp_online) { if(lc $tmp_name eq lc $musername) {$onlinemem = $img{'mem_online'}; last;} } } if ($disprealinfo == 1) { if ($userprofile[7] ne "Global Moderator" && $userprofile[7] ne "Administrator") { undef $star; require "$sourcedir/MemberGroups.pl"; $realname=$musername; &Load_Real_Group; $realgroup = "$memrealinfo{$realname}"; $star = $memberstar{$musername}; if ($memrealinfo{$realname} eq "$memberinfo{$musername}") { $realgroup = ""; } } } } else { $musername = "Guest"; $displaynumb = ''; $star = ''; # former member mod $memberinfo = "$formermember"; # end former member mod $icqad = ''; $yimon = ''; $usernamelink = qq~$mname~; $onlinemem = ""; if ($memberinfo eq "$txt{'28'}") { $usernamelink = qq~$mname
~; } $postinfo = ''; $postinfosmily = ''; @userprofile = (); $displayname = $mname; $homepage_link = ''; } # Censor the subject and message. foreach (@censored) { ($tmpa,$tmpb) = @{$_}; $postmessage =~ s~\Q$tmpa\E~$tmpb~gi; $msub =~ s~\Q$tmpa\E~$tmpb~gi; } # Run UBBC interpreter on the message. $message = $postmessage; # put the message back into the proper variable to do ubbc on it ### Begin Enable HTML Mod if ($message =~ /\#enable_html/isg) { $html_username = $musername; if ($lastmoduser ne $html_username && $lastmoduser ne '') { $html_username = $lastmoduser; } $message_backup = $message; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($html_username); $message = $message_backup; if ($enable_html == 1) { $message =~ s/\#enable_html//isg; $message =~ s/
/\n/ig; &FromHTML($message); } } else { $enable_html = 0; } if ($enable_html != 1) { &wrap; if($enable_ubbc) { if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; } ### End Enable HTML Mod $profbutton = $profilebutton && $musername ne 'Guest' ? qq~$img{'viewprofile_sm'}$menusep~ : ''; if($counter != 0) { $counterwords = "$txt{'146'} #$counter"; } else { $counterwords = ""; } # Print the post and user info for the poster. $yymain .= qq~
$onlinemem $usernamelink
$memberinfo
~; if($musername ne "Guest") { if($view_flag) { $yymain .= qq~$dispflag ~; } if($view_text) { $yymain .= qq~$disptext~; } if($view_flag || $view_text) { $yymain .= qq~
~; } $yymain .= qq~ $star
~; if ($view_numb) { $yymain .= qq~ $displaynumb

~; } else { $yymain .= qq~
~; } $yymain .= qq~ $karmainfo $userprofile[13]$userprofile[12]
$userprofile[8] $icqad   $userprofile[10] $yimon   $userprofile[9]
~; } if($musername eq "Guest" && $settings[7] eq "Administrator" || ($settings[7] eq 'Global Moderator') { $yymain .= qq~
$img{'email_sm'}

~; } elsif($musername eq "Guest" || $username eq 'Guest') { $yymain .= qq~

~; } elsif ($userprofile[19] ne "checked" || $settings[7] eq "Administrator" || $settings[7] eq "Global Moderator" || $allow_hide_email ne 1) { $yymain .= qq~ $profbutton$userprofile[4] $img{'email_sm'}$sendm$homepage_link

~; } else { $yymain .= qq~ $profbutton$userprofile[4]$sendm$homepage_link

~; } fopen(FILE, "$memberdir/$useraccount{$musername}.zod"); @sign = ; fclose(FILE); chomp @sign; $test = $sign[0]; if($test eq '') {$test = "blank";} elsif($test eq "$zodtxt{'1a'}"){$test = "Aries";} elsif($test eq "$zodtxt{'1b'}"){$test = "Taurus";} elsif($test eq "$zodtxt{'1c'}"){$test = "Gemini";} elsif($test eq "$zodtxt{'1d'}"){$test = "Cancer";} elsif($test eq "$zodtxt{'1e'}"){$test = "Leo";} elsif($test eq "$zodtxt{'1f'}"){$test = "Virgo";} elsif($test eq "$zodtxt{'1g'}"){$test = "Libra";} elsif($test eq "$zodtxt{'1h'}"){$test = "Scorpio";} elsif($test eq "$zodtxt{'1i'}"){$test = "Sagittarius";} elsif($test eq "$zodtxt{'1j'}"){$test = "Capricorn";} elsif($test eq "$zodtxt{'1k'}"){$test = "Aquarius";} elsif($test eq "$zodtxt{'1l'}"){$test = "Pisces";} if($test eq $sign[0]) { $yymain .= qq~ $zodtxt{'2'} $sign[0]
$userprofile[11] $postinfo ~; } else { $yymain .= qq~ $userprofile[11] $postinfo ~; if ($mstate != 1) { $yymain .= qq~
$qatxt{'1'}
$qatxt{'2'}
$qatxt{'3'}~; } $yymain .= qq~ ~; } $yymain .= qq~ ~; require "$sourcedir/ExtendedProfiles.pl"; $yymain .= ext_viewinposts($musername) . qq~ $postinfosmily
$msub
« $counterwords $txt{'30'}: $messdate »
~; if ($settings[20] eq "checked") { $yymain .= qq~ $img{'go_top'}$menusep$img{'go_bottom'}$menusep ~; ; } if ($mstate != 1) { $yymain .= qq~ $rtm{'22'} $rtm{'22'} $menusep $img{'replyquote'}$menusep$img{'modify'} ~; if(exists $moderators{$username} || $settings[7] eq 'Administrator' || $username eq $musername || $settings[7] eq 'Global Moderator') { $yymain .= qq~ $menusep$img{'delete'}~; if((exists $moderators{$username} && $mdmod eq 1) || ($settings[7] eq 'Administrator' && $mdadmin eq 1) || ($settings[7] eq 'Global Moderator' && $mdglobal eq 1)) { $yymain .= qq~ ~; } } } $yymain .= qq~

$message
$lastmodified $mip
$userprofile[5]
Back to top
~; $counter++; } $yymain .= qq~
$txt{'139'}: $pageindex $replybutton$notify$menusep $img{'sendtopic'}$menusep $img{'print'}

~; $yymain .= qq~
~; if(exists $moderators{$username} || $settings[7] eq 'Administrator' || $settings[7] eq 'Global Moderator') { if($settings[7] eq 'Administrator') {$sadminf = $img{'admin_func'};} else {$sadminf = $img{'moderator_func'};} $yymain .= qq~$sadminf  $img{'admin_move'}$menusep ~; if($ss_advanced eq "1") { $yymain .= qq~ $img{'admin_split_splice'}$menusep~; } else { $yymain .= qq~ $img{'admin_split'}$menusep $img{'admin_splice'}$menusep~; } $yymain .= qq~ $img{'admin_rem'}$menusep $img{'admin_lock'}$menusep $img{'admin_sticky'} ~; if (!-e "$datadir/$viewnum.head") { $yymain .= qq~ $img{'admin_header'}~;} $yymain .= qq~ $menusep$admin_rate ~; } if((exists $moderators{$username} && $mdmod eq 1) || ($settings[7] eq 'Administrator' && $mdadmin eq 1) || ($settings[7] eq 'Global Moderator' && $mdglobal eq 1)) { if ($mstate != 1) {$yymain .= qq~~;} } $yymain .= qq~ $selecthtml
$nav
~; ### Quick Reply Box 1.3 ### # MBCO2 Reply access check if ($reply_users{$currentboard} || $reply_groups{$currentboard}) { my $access = &AccessCheck($currentboard, 2) || ""; if ($access eq "denied") {$enable_quickreply = 0;} } if ($username ne "Guest" && $mstate != 1 && $enable_quickreply == 1) { $yymain .= qq~
$qrb_txt{'2'}
~; if ($enable_quicksmilies == 1) { if ($smiliestyle eq 1){$smiliewinlink = "$scripturl?action=smilieput";} else { $smiliewinlink = "$scripturl?action=smilieindex";} $moresmilieslist = ""; $more_smilie_array = ""; $i=0; if ($showadded eq 1){ # show added smilies on smiley bar while($SmilieURL[$i]) { if ($SmilieURL[$i]=~ /\//i) {$tmpurl = $SmilieURL[$i];} else {$tmpurl = qq~$imagesdir/$SmilieURL[$i]~;} $moresmilieslist .= qq~ document.write("+'$SmilieLinebreak[$i] ");\n~; $tmpcode = $SmilieCode[$i]; $tmpcode =~ s/\"/"+'"'+"/g; &FromHTML($tmpcode); $tmpcode =~ s/$/\$/g; $tmpcode =~ s/@/\@/g; $more_smilie_array .= qq~" $tmpcode", ~; $i++; } } if ($showsmdir eq 1){ # show auto smilies on smiley bar opendir(DIR, "$smiliesdir"); @contents = readdir(DIR); closedir(DIR); foreach $line (sort {uc($a) cmp uc($b)} @contents){ ($name, $extension) = split (/\./, $line); if ($extension =~ /gif/i || $extension =~ /jpg/i || $extension =~ /jpeg/i || $extension =~ /png/i ){ if ($line !~ /banner/i) { $moresmilieslist .= qq~ document.write("$name ");\n~; $more_smilie_array .= qq~" [smiley=$line]", ~; $i++ } } } } $more_smilie_array .= qq~""~; $yymain .= qq~ ~; } $yymain .= qq~
$txt{'70'}:
$txt{'297'}: ~; if ($showadded == 3 || ($showadded == 2 && $detachblock == 1) || $showsmdir == 3 || ($showsmdir == 2 && $detachblock == 1)){ $yymain .= qq~ $smiltxt{'1'}~; } $yymain .= qq~
$txt{'72'}:
 
~; } ### Quick Reply Box 1.3 ### $yytitle = $msubthread; &template; exit; } 1;