D:\my docs\My Received Files\Yabb\Yabb\YaBB_2.5_AEB\cgi-bin\yabb2_old\Sources\MessageIndex.pl D:\WEBSITES\testbed\cgi-bin\yabb252\Sources\MessageIndex.pl
############################################################################### ###############################################################################
# MessageIndex.pl                                                             # # MessageIndex.pl                                                             #
############################################################################### ###############################################################################
# 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 Anniversary Edition                                # # Version:        YaBB 2.5.2                                                  #
# Packaged:       July 04, 2010                                               # # Packaged:       September 30, 2012                                          #
# Distributed by: http://www.yabbforum.com                                    # # Distributed by: http://www.yabbforum.com                                    #
# =========================================================================== # # =========================================================================== #
# Copyright (c) 2000-2010 YaBB (www.yabbforum.com) - All Rights Reserved.     # # Copyright (c) 2000-2012 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.                      #
# Sponsored by: Xnull Internet Media, Inc. - http://www.ximinc.com            #    
#               Your source for web hosting, web design, and domains.         #    
############################################################################### ###############################################################################
   
$messageindexplver = 'YaBB 2.5 AE $Revision: 1.52 $'; $messageindexplver = 'YaBB 2.5.2 $Revision: 1.0 $';
if ($action eq 'detailedversion') { return 1; } if ($action eq 'detailedversion') { return 1; }
   
&LoadLanguage('MessageIndex'); &LoadLanguage('MessageIndex');
require "$templatesdir/$usemessage/MessageIndex.template"; require "$templatesdir/$usemessage/MessageIndex.template";
   
sub MessageIndex { sub MessageIndex {
   # Check if board was 'shown to all' - and whether they can view the board    # Check if board was 'shown to all' - and whether they can view the board
   if (&AccessCheck($currentboard, '', $boardperms) ne "granted") { &fatal_error("no_access"); }    if (&AccessCheck($currentboard, '', $boardperms) ne "granted") { &fatal_error("no_access"); }
   if ($annboard eq $currentboard && !$iamadmin && !$iamgmod) { &fatal_error("no_access"); }    if ($annboard eq $currentboard && !$iamadmin && !$iamgmod) { &fatal_error("no_access"); }
   
   my ($counter, $mcount, $buffer, $pages, $showmods, $mnum, $msub, $mname, $memail, $mdate, $mreplies, $musername, $micon, $mstate, $dlp, $threadlength);    my ($counter, $mcount, $buffer, $pages, $showmods, $mnum, $msub, $mname, $memail, $mdate, $mreplies, $musername, $micon, $mstate, $dlp, $threadlength);
   my ($numanns, $threadcount, $countsticky, $countnosticky, $stkynum, @tmpanns, @anns, @threadlist, @stickythreadlist, @nostickythreadlist, @threads);    my ($numanns, $threadcount, $countsticky, $countnosticky, $stkynum, @tmpanns, @anns, @threadlist, @stickythreadlist, @nostickythreadlist, @threads);
   &BoardTotals("load", $currentboard);    &BoardTotals("load", $currentboard);
   
   # Build a list of the board's moderators.    # Build a list of the board's moderators.
   if (keys %moderators > 0) {    if (keys %moderators > 0) {
       if (keys %moderators == 1) { $showmods = qq~($messageindex_txt{'298'}: ~; }        if (keys %moderators == 1) { $showmods = qq~($messageindex_txt{'298'}: ~; }
       else { $showmods = qq~($messageindex_txt{'63'}: ~; }        else { $showmods = qq~($messageindex_txt{'63'}: ~; }
   
       while ($_ = each(%moderators)) {        while ($_ = each(%moderators)) {
           &FormatUserName($_);            &FormatUserName($_);
           $showmods .= &QuickLinks($_,1) . ", ";            $showmods .= &QuickLinks($_,1) . ", ";
       }        }
       $showmods =~ s/, \Z/)/;        $showmods =~ s/, \Z/)/;
   }    }
   if (keys %moderatorgroups > 0) {    if (keys %moderatorgroups > 0) {
       if (keys %moderatorgroups == 1) { $showmodgroups = qq~($messageindex_txt{'298a'}: ~; }        if (keys %moderatorgroups == 1) { $showmodgroups = qq~($messageindex_txt{'298a'}: ~; }
       else { $showmodgroups = qq~($messageindex_txt{'63a'}: ~; }        else { $showmodgroups = qq~($messageindex_txt{'63a'}: ~; }
   
       my ($tmpmodgrp,$thismodgrp);        my ($tmpmodgrp,$thismodgrp);
       while ($_ = each(%moderatorgroups)) {        while ($_ = each(%moderatorgroups)) {
           $tmpmodgrp = $moderatorgroups{$_};            $tmpmodgrp = $moderatorgroups{$_};
           ($thismodgrp, undef) = split(/\|/, $NoPost{$tmpmodgrp}, 2);            ($thismodgrp, undef) = split(/\|/, $NoPost{$tmpmodgrp}, 2);
           $showmodgroups .= qq~$thismodgrp, ~;            $showmodgroups .= qq~$thismodgrp, ~;
       }        }
       $showmodgroups =~ s/, \Z/)/;        $showmodgroups =~ s/, \Z/)/;
   }    }
   if ($showmodgroups ne "" && $showmods ne "") { $showmods .= qq~ - ~; }    if ($showmodgroups ne "" && $showmods ne "") { $showmods .= qq~ - ~; }
   
   # Load announcements, if they exist.    # Load announcements, if they exist.
   if ($annboard && $annboard ne $currentboard && ${$uid.$currentboard}{'rbin'} != 1) {    if ($annboard && $annboard ne $currentboard && ${$uid.$currentboard}{'rbin'} != 1) {
       chomp $annboard;        chomp $annboard;
       fopen(ANN, "$boardsdir/$annboard.txt");        fopen(ANN, "$boardsdir/$annboard.txt");
       @tmpanns = <ANN>;        @tmpanns = <ANN>;
       fclose(ANN);        fclose(ANN);
       foreach my $realanns (@tmpanns) {        foreach my $realanns (@tmpanns) {
           my $threadstatus = (split /\|/, $realanns)[8];            my $threadstatus = (split /\|/, $realanns)[8];
           if ($threadstatus =~ /h/i && !$iamadmin && !$iamgmod && !$iammod) { next; }            if ($threadstatus =~ /h/i && !$iamadmin && !$iamgmod && !$iammod) { next; }
           push (@threads, $realanns);            push (@threads, $realanns);
           $numanns++;            $numanns++;
       }        }
       undef @tmpanns;        undef @tmpanns;
   }    }
   
   # Determine what category we are in.    # Determine what category we are in.
   $catid = ${$uid.$currentboard}{'cat'};    $catid = ${$uid.$currentboard}{'cat'};
   ($cat, undef) = split(/\|/, $catinfo{$catid});    ($cat, undef) = split(/\|/, $catinfo{$catid});
   &ToChars($cat);    &ToChars($cat);
   
   fopen(BRDTXT, "$boardsdir/$currentboard.txt") || &fatal_error("cannot_open","$boardsdir/$currentboard.txt", 1);    fopen(BRDTXT, "$boardsdir/$currentboard.txt") || &fatal_error("cannot_open","$boardsdir/$currentboard.txt", 1);
   @threadlist = <BRDTXT>;    @threadlist = <BRDTXT>;
   fclose(BRDTXT);    fclose(BRDTXT);
   foreach my $threadlist (@threadlist) {    foreach my $threadlist (@threadlist) {
       my $threadstatus = (split /\|/, $threadlist)[8];        my $threadstatus = (split /\|/, $threadlist)[8];
       if ($threadstatus =~ /h/i && !$iamadmin && !$iamgmod && !$iammod) { next; }        if ($threadstatus =~ /h/i && !$iamadmin && !$iamgmod && !$iammod) { next; }
       if ($threadstatus =~ /s/i) {        if ($threadstatus =~ /s/i) {
           push (@threads, $threadlist);            push (@threads, $threadlist);
           $countsticky++;            $countsticky++;
       } else {        } else {
           $nostickythreadlist[$threadcount] = $threadlist;            $nostickythreadlist[$threadcount] = $threadlist;
           $threadcount++;            $threadcount++;
       }        }
   }    }
   undef @threadlist;    undef @threadlist;
   
   $threadcount = $threadcount + $countsticky + $numanns;    $threadcount = $threadcount + $countsticky + $numanns;
   my $maxindex = $INFO{'view'} eq 'all' ? $threadcount : $maxdisplay;    my $maxindex = $INFO{'view'} eq 'all' ? $threadcount : $maxdisplay;
   
   # There are three kinds of lies: lies, damned lies, and statistics.    # There are three kinds of lies: lies, damned lies, and statistics.
   # - Mark Twain    # - Mark Twain
   
   # Construct the page links for this board.    # Construct the page links for this board.
   if (!$iamguest) { ($usermessagepage, undef, undef, undef) = split(/\|/, ${$uid.$username}{'pageindex'}); }    if (!$iamguest) { ($usermessagepage, undef, undef, undef) = split(/\|/, ${$uid.$username}{'pageindex'}); }
   my ($pagetxtindex, $pagetextindex, $pagedropindex1, $pagedropindex2, $all, $allselected);    my ($pagetxtindex, $pagetextindex, $pagedropindex1, $pagedropindex2, $all, $allselected);
   $indexdisplaynum = 3;              # max number of pages to display    $indexdisplaynum = 3;              # max number of pages to display
   $dropdisplaynum  = 10;    $dropdisplaynum  = 10;
   $startpage = 0;    $startpage = 0;
   $max = $threadcount;    $max = $threadcount;
   if (substr($INFO{'start'}, 0, 3) eq 'all' && $showpageall != 0) { $maxindex = $max; $all = 1; $allselected = qq~ selected="selected"~; $start = 0; }    if (substr($INFO{'start'}, 0, 3) eq 'all' && $showpageall != 0) { $maxindex = $max; $all = 1; $allselected = qq~ selected="selected"~; $start = 0; }
   else { $start = $INFO{'start'} || 0; }    else { $start = $INFO{'start'} || 0; }
   if ($start > $threadcount - 1) { $start = $threadcount - 1; }    if ($start > $threadcount - 1) { $start = $threadcount - 1; }
   elsif ($start < 0) { $start = 0; }    elsif ($start < 0) { $start = 0; }
   $start    = int($start / $maxindex) * $maxindex;    $start    = int($start / $maxindex) * $maxindex;
   $tmpa     = 1;    $tmpa     = 1;
   $pagenumb = int(($threadcount - 1) / $maxindex) + 1;    $pagenumb = int(($threadcount - 1) / $maxindex) + 1;
   
   if ($start >= (($indexdisplaynum - 1) * $maxindex)) {    if ($start >= (($indexdisplaynum - 1) * $maxindex)) {
       $startpage = $start - (($indexdisplaynum - 1) * $maxindex);        $startpage = $start - (($indexdisplaynum - 1) * $maxindex);
       $tmpa = int($startpage / $maxindex) + 1;        $tmpa = int($startpage / $maxindex) + 1;
   }    }
   if ($threadcount >= $start + ($indexdisplaynum * $maxindex)) { $endpage = $start + ($indexdisplaynum * $maxindex); }    if ($threadcount >= $start + ($indexdisplaynum * $maxindex)) { $endpage = $start + ($indexdisplaynum * $maxindex); }
   else { $endpage = $threadcount }    else { $endpage = $threadcount }
   $lastpn = int(($threadcount - 1) / $maxindex) + 1;    $lastpn = int(($threadcount - 1) / $maxindex) + 1;
   $lastptn = ($lastpn - 1) * $maxindex;    $lastptn = ($lastpn - 1) * $maxindex;
   $pageindex1 = qq~<span class="small" style="float: left; height: 21px; margin: 0px; margin-top: 2px;"><img src="$imagesdir/index_togl.gif" border="0" alt="$messageindex_txt{'19'}" title="$messageindex_txt{'19'}" style="vertical-align: middle;" /> $messageindex_txt{'139'}: $pagenumb</span>~;    $pageindex1 = qq~<span class="small" style="float: left; height: 21px; margin: 0px; margin-top: 2px;"><img src="$imagesdir/index_togl.gif" border="0" alt="$messageindex_txt{'19'}" title="$messageindex_txt{'19'}" style="vertical-align: middle;" /> $messageindex_txt{'139'}: $pagenumb</span>~;
   $pageindex2 = $pageindex1;    $pageindex2 = $pageindex1;
   if ($pagenumb > 1 || $all) {    if ($pagenumb > 1 || $all) {
   
       if ($usermessagepage == 1 || $iamguest) {        if ($usermessagepage == 1 || $iamguest) {
           $pagetxtindexst = qq~<span class="small" style="float: left; height: 21px; margin: 0px; margin-top: 2px;">~;            $pagetxtindexst = qq~<span class="small" style="float: left; height: 21px; margin: 0px; margin-top: 2px;">~;
           if (!$iamguest) { $pagetxtindexst .= qq~<a href="$scripturl?board=$INFO{'board'};start=$start;action=messagepagedrop"><img src="$imagesdir/index_togl.gif" border="0" alt="$messageindex_txt{'19'}" title="$messageindex_txt{'19'}" style="vertical-align: middle;" /></a> $messageindex_txt{'139'}: ~; }            if (!$iamguest) { $pagetxtindexst .= qq~<a href="$scripturl?board=$INFO{'board'};start=$start;action=messagepagedrop"><img src="$imagesdir/index_togl.gif" border="0" alt="$messageindex_txt{'19'}" title="$messageindex_txt{'19'}" style="vertical-align: middle;" /></a> $messageindex_txt{'139'}: ~; }
           else { $pagetxtindexst .= qq~<img src="$imagesdir/index_togl.gif" border="0" alt="$messageindex_txt{'139'}" title="$messageindex_txt{'139'}" style="vertical-align: middle;" /> $messageindex_txt{'139'}: ~; }            else { $pagetxtindexst .= qq~<img src="$imagesdir/index_togl.gif" border="0" alt="$messageindex_txt{'139'}" title="$messageindex_txt{'139'}" style="vertical-align: middle;" /> $messageindex_txt{'139'}: ~; }
           if ($startpage > 0) { $pagetxtindex = qq~<a href="$scripturl?board=$currentboard/0" style="font-weight: normal;">1</a>&nbsp;<a href='javascript: void(0);' onclick='ListPages2("$currentboard","$threadcount");'>...</a>&nbsp;~; }            if ($startpage > 0) { $pagetxtindex = qq~<a href="$scripturl?board=$currentboard/0" style="font-weight: normal;">1</a>&nbsp;<a href='javascript: void(0);' onclick='ListPages2("$currentboard","$threadcount");'>...</a>&nbsp;~; }
           if ($startpage == $maxindex) { $pagetxtindex = qq~<a href="$scripturl?board=$currentboard/0" style="font-weight: normal;">1</a>&nbsp;~; }            if ($startpage == $maxindex) { $pagetxtindex = qq~<a href="$scripturl?board=$currentboard/0" style="font-weight: normal;">1</a>&nbsp;~; }
           for ($counter = $startpage; $counter < $endpage; $counter += $maxindex) {            for ($counter = $startpage; $counter < $endpage; $counter += $maxindex) {
               $pagetxtindex .= $start == $counter ? qq~<b>$tmpa</b>&nbsp;~ : qq~<a href="$scripturl?board=$currentboard/$counter" style="font-weight: normal;">$tmpa</a>&nbsp;~;                $pagetxtindex .= $start == $counter ? qq~<b>$tmpa</b>&nbsp;~ : qq~<a href="$scripturl?board=$currentboard/$counter" style="font-weight: normal;">$tmpa</a>&nbsp;~;
               $tmpa++;                $tmpa++;
           }            }
           if ($endpage < $threadcount - $maxindex) { $pageindexadd = qq~<a href='javascript: void(0);' onclick='ListPages2("$currentboard","$threadcount");'>...</a>&nbsp;~; }            if ($endpage < $threadcount - $maxindex) { $pageindexadd = qq~<a href='javascript: void(0);' onclick='ListPages2("$currentboard","$threadcount");'>...</a>&nbsp;~; }
           if ($endpage != $threadcount) { $pageindexadd .= qq~<a href="$scripturl?board=$currentboard/$lastptn" style="font-weight: normal;">$lastpn</a>~; }            if ($endpage != $threadcount) { $pageindexadd .= qq~<a href="$scripturl?board=$currentboard/$lastptn" style="font-weight: normal;">$lastpn</a>~; }
   
           $pagetxtindex .= $pageindexadd;            $pagetxtindex .= $pageindexadd;
           $pageindex1 = qq~$pagetxtindexst $pagetxtindex</span>~;            $pageindex1 = qq~$pagetxtindexst $pagetxtindex</span>~;
           $pageindex2 = $pageindex1;            $pageindex2 = $pageindex1;
       } else {        } else {
           $pagedropindex1 = qq~<span style="float: left; width: 350px; margin: 0px; margin-top: 2px; border: 0px;">~;            $pagedropindex1 = qq~<span style="float: left; width: 350px; margin: 0px; margin-top: 2px; border: 0px;">~;
           $pagedropindex1 .= qq~<span style="float: left; height: 21px; margin: 0; margin-right: 4px;"><a href="$scripturl?board=$INFO{'board'};start=$start;action=messagepagetext"><img src="$imagesdir/index_togl.gif" border="0" alt="$messageindex_txt{'19'}" title="$messageindex_txt{'19'}" /></a></span>~;            $pagedropindex1 .= qq~<span style="float: left; height: 21px; margin: 0; margin-right: 4px;"><a href="$scripturl?board=$INFO{'board'};start=$start;action=messagepagetext"><img src="$imagesdir/index_togl.gif" border="0" alt="$messageindex_txt{'19'}" title="$messageindex_txt{'19'}" /></a></span>~;
           $pagedropindex2 = $pagedropindex1;            $pagedropindex2 = $pagedropindex1;
           $tstart = $start;            $tstart = $start;
           #if (substr($INFO{'start'}, 0, 3) eq "all") { ($tstart, $start) = split(/\-/, $INFO{'start'}); }            #if (substr($INFO{'start'}, 0, 3) eq "all") { ($tstart, $start) = split(/\-/, $INFO{'start'}); }
           $d_indexpages = $pagenumb / $dropdisplaynum;            $d_indexpages = $pagenumb / $dropdisplaynum;
           $i_indexpages = int($pagenumb / $dropdisplaynum);            $i_indexpages = int($pagenumb / $dropdisplaynum);
           if ($d_indexpages > $i_indexpages) { $indexpages = int($pagenumb / $dropdisplaynum) + 1; }            if ($d_indexpages > $i_indexpages) { $indexpages = int($pagenumb / $dropdisplaynum) + 1; }
           else { $indexpages = int($pagenumb / $dropdisplaynum) }            else { $indexpages = int($pagenumb / $dropdisplaynum) }
           $selectedindex = int(($start / $maxindex) / $dropdisplaynum);            $selectedindex = int(($start / $maxindex) / $dropdisplaynum);
   
           if ($pagenumb > $dropdisplaynum) {            if ($pagenumb > $dropdisplaynum) {
               $pagedropindex1 .= qq~<span style="float: left; height: 21px; margin: 0;"><select size="1" name="decselector1" id="decselector1" style="font-size: 9px; border: 2px inset;" onchange="if(this.options[this.selectedIndex].value) SelDec(this.options[this.selectedIndex].value, 'xx')">\n~;                $pagedropindex1 .= qq~<span style="float: left; height: 21px; margin: 0;"><select size="1" name="decselector1" id="decselector1" style="font-size: 9px; border: 2px inset;" onchange="if(this.options[this.selectedIndex].value) SelDec(this.options[this.selectedIndex].value, 'xx')">\n~;
               $pagedropindex2 .= qq~<span style="float: left; height: 21px; margin: 0;"><select size="1" name="decselector2" id="decselector2" style="font-size: 9px; border: 2px inset;" onchange="if(this.options[this.selectedIndex].value) SelDec(this.options[this.selectedIndex].value, 'xx')">\n~;                $pagedropindex2 .= qq~<span style="float: left; height: 21px; margin: 0;"><select size="1" name="decselector2" id="decselector2" style="font-size: 9px; border: 2px inset;" onchange="if(this.options[this.selectedIndex].value) SelDec(this.options[this.selectedIndex].value, 'xx')">\n~;
           }            }
           for ($i = 0; $i < $indexpages; $i++) {            for ($i = 0; $i < $indexpages; $i++) {
               $indexpage = ($i * $dropdisplaynum) * $maxindex;                $indexpage = ($i * $dropdisplaynum) * $maxindex;
   
               $indexstart = ($i * $dropdisplaynum) + 1;                $indexstart = ($i * $dropdisplaynum) + 1;
               $indexend = $indexstart + ($dropdisplaynum - 1);                $indexend = $indexstart + ($dropdisplaynum - 1);
               if ($indexend > $pagenumb)    { $indexend   = $pagenumb; }                if ($indexend > $pagenumb)    { $indexend   = $pagenumb; }
               if ($indexstart == $indexend) { $indxoption = qq~$indexstart~; }                if ($indexstart == $indexend) { $indxoption = qq~$indexstart~; }
               else { $indxoption = qq~$indexstart-$indexend~; }                else { $indxoption = qq~$indexstart-$indexend~; }
               $selected = "";                $selected = "";
               if ($i == $selectedindex) {                if ($i == $selectedindex) {
                   $selected = qq~ selected="selected"~;                    $selected = qq~ selected="selected"~;
                   $pagejsindex = qq~$indexstart|$indexend|$maxindex|$indexpage~;                    $pagejsindex = qq~$indexstart|$indexend|$maxindex|$indexpage~;
               }                }
               if ($pagenumb > $dropdisplaynum) {                if ($pagenumb > $dropdisplaynum) {
                   $pagedropindex1 .= qq~<option value="$indexstart|$indexend|$maxindex|$indexpage"$selected>$indxoption</option>\n~;                    $pagedropindex1 .= qq~<option value="$indexstart|$indexend|$maxindex|$indexpage"$selected>$indxoption</option>\n~;
                   $pagedropindex2 .= qq~<option value="$indexstart|$indexend|$maxindex|$indexpage"$selected>$indxoption</option>\n~;                    $pagedropindex2 .= qq~<option value="$indexstart|$indexend|$maxindex|$indexpage"$selected>$indxoption</option>\n~;
               }                }
           }            }
           if ($pagenumb > $dropdisplaynum) {            if ($pagenumb > $dropdisplaynum) {
               $pagedropindex1 .= qq~</select>\n</span>~;                $pagedropindex1 .= qq~</select>\n</span>~;
               $pagedropindex2 .= qq~</select>\n</span>~;                $pagedropindex2 .= qq~</select>\n</span>~;
           }            }
           $pagedropindex1 .= qq~<span id="ViewIndex1" class="droppageindex" style="height: 14px; visibility: hidden">&nbsp;</span>~;            $pagedropindex1 .= qq~<span id="ViewIndex1" class="droppageindex" style="height: 14px; visibility: hidden">&nbsp;</span>~;
           $pagedropindex2 .= qq~<span id="ViewIndex2" class="droppageindex" style="height: 14px; visibility: hidden">&nbsp;</span>~;            $pagedropindex2 .= qq~<span id="ViewIndex2" class="droppageindex" style="height: 14px; visibility: hidden">&nbsp;</span>~;
           $tmpmaxindex = $maxindex;            $tmpmaxindex = $maxindex;
           #if (substr($INFO{'start'}, 0, 3) eq "all") { $maxindex = $maxindex * $dropdisplaynum; }            #if (substr($INFO{'start'}, 0, 3) eq "all") { $maxindex = $maxindex * $dropdisplaynum; }
           $prevpage = $start - $tmpmaxindex;            $prevpage = $start - $tmpmaxindex;
           $nextpage = $start + $maxindex;            $nextpage = $start + $maxindex;
           $pagedropindexpvbl = qq~<img src="$imagesdir/index_left0.gif" height="14" width="13" border="0" alt="" style="margin: 0px; display: inline; vertical-align: middle;" />~;            $pagedropindexpvbl = qq~<img src="$imagesdir/index_left0.gif" height="14" width="13" border="0" alt="" style="margin: 0px; display: inline; vertical-align: middle;" />~;
           $pagedropindexnxbl = qq~<img src="$imagesdir/index_right0.gif" height="14" width="13" border="0" alt="" style="margin: 0px; display: inline; vertical-align: middle;" />~;            $pagedropindexnxbl = qq~<img src="$imagesdir/index_right0.gif" height="14" width="13" border="0" alt="" style="margin: 0px; display: inline; vertical-align: middle;" />~;
           if ($start < $maxindex) { $pagedropindexpv .= qq~<img src="$imagesdir/index_left0.gif" height="14" width="13" border="0" alt="" style="display: inline; vertical-align: middle;" />~; }            if ($start < $maxindex) { $pagedropindexpv .= qq~<img src="$imagesdir/index_left0.gif" height="14" width="13" border="0" alt="" style="display: inline; vertical-align: middle;" />~; }
           else { $pagedropindexpv .= qq~<img src="$imagesdir/index_left.gif" border="0" height="14" width="13" alt="$pidtxt{'02'}" title="$pidtxt{'02'}" style="display: inline; vertical-align: middle; cursor: pointer;" onclick="location.href=\\'$scripturl?board=$currentboard/$prevpage\\'" ondblclick="location.href=\\'$scripturl?board=$currentboard/0\\'" />~; }            else { $pagedropindexpv .= qq~<img src="$imagesdir/index_left.gif" border="0" height="14" width="13" alt="$pidtxt{'02'}" title="$pidtxt{'02'}" style="display: inline; vertical-align: middle; cursor: pointer;" onclick="location.href=\\'$scripturl?board=$currentboard/$prevpage\\'" ondblclick="location.href=\\'$scripturl?board=$currentboard/0\\'" />~; }
           if ($nextpage > $lastptn) { $pagedropindexnx .= qq~<img src="$imagesdir/index_right0.gif" border="0" height="14" width="13" alt="" style="display: inline; vertical-align: middle;" />~; }            if ($nextpage > $lastptn) { $pagedropindexnx .= qq~<img src="$imagesdir/index_right0.gif" border="0" height="14" width="13" alt="" style="display: inline; vertical-align: middle;" />~; }
           else { $pagedropindexnx .= qq~<img src="$imagesdir/index_right.gif" height="14" width="13" border="0" alt="$pidtxt{'03'}" title="$pidtxt{'03'}" style="display: inline; vertical-align: middle; cursor: pointer;" onclick="location.href=\\'$scripturl?board=$currentboard/$nextpage\\'" ondblclick="location.href=\\'$scripturl?board=$currentboard/$lastptn\\'" />~; }            else { $pagedropindexnx .= qq~<img src="$imagesdir/index_right.gif" height="14" width="13" border="0" alt="$pidtxt{'03'}" title="$pidtxt{'03'}" style="display: inline; vertical-align: middle; cursor: pointer;" onclick="location.href=\\'$scripturl?board=$currentboard/$nextpage\\'" ondblclick="location.href=\\'$scripturl?board=$currentboard/$lastptn\\'" />~; }
           $pageindex1 = qq~$pagedropindex1</span>~;            $pageindex1 = qq~$pagedropindex1</span>~;
           $pageindex2 = qq~$pagedropindex2</span>~;            $pageindex2 = qq~$pagedropindex2</span>~;
   
           $pageindexjs = qq~            $pageindexjs = qq~
<script language="JavaScript1.2" type="text/javascript"> <script language="JavaScript1.2" type="text/javascript">
<!--   <!--  
   function SelDec(decparam, visel) {    function SelDec(decparam, visel) {
       splitparam = decparam.split("|");        splitparam = decparam.split("|");
       var vistart = parseInt(splitparam[0]);        var vistart = parseInt(splitparam[0]);
       var viend = parseInt(splitparam[1]);        var viend = parseInt(splitparam[1]);
       var maxpag = parseInt(splitparam[2]);        var maxpag = parseInt(splitparam[2]);
       var pagstart = parseInt(splitparam[3]);        var pagstart = parseInt(splitparam[3]);
       //var allpagstart = parseInt(splitparam[3]);        //var allpagstart = parseInt(splitparam[3]);
       if (visel == 'xx' && decparam == '$pagejsindex') visel = '$tstart';        if (visel == 'xx' && decparam == '$pagejsindex') visel = '$tstart';
       var pagedropindex = '<table border="0" cellpadding="0" cellspacing="0"><tr>';        var pagedropindex = '<table border="0" cellpadding="0" cellspacing="0"><tr>';
       for(i=vistart; i<=viend; i++) {        for(i=vistart; i<=viend; i++) {
           if (visel == pagstart) pagedropindex += '<td class="titlebg" height="14" style="height: 14px; padding-left: 1px; padding-right: 1px; font-size: 9px; font-weight: bold;">' + i + '</td>';            if (visel == pagstart) pagedropindex += '<td class="titlebg" height="14" style="height: 14px; padding-left: 1px; padding-right: 1px; font-size: 9px; font-weight: bold;">' + i + '</td>';
           else pagedropindex += '<td height="14" class="droppages"><a href="$scripturl?board=$currentboard/' + pagstart + '">' + i + '</a></td>';            else pagedropindex += '<td height="14" class="droppages"><a href="$scripturl?board=$currentboard/' + pagstart + '">' + i + '</a></td>';
           pagstart += maxpag;            pagstart += maxpag;
       }        }
       ~;        ~;
       if ($showpageall) {        if ($showpageall) {
           $pageindexjs .= qq~            $pageindexjs .= qq~
           if (vistart != viend) {            if (vistart != viend) {
               if(visel == 'all') pagedropindex += '<td class="titlebg" height="14" style="height: 14px; padding-left: 1px; padding-right: 1px; font-size: 9px; font-weight: normal;"><b>$pidtxt{'01'}</b></td>';                if(visel == 'all') pagedropindex += '<td class="titlebg" height="14" style="height: 14px; padding-left: 1px; padding-right: 1px; font-size: 9px; font-weight: normal;"><b>$pidtxt{'01'}</b></td>';
               else pagedropindex += '<td height="14" class="droppages"><a href="$scripturl?board=$currentboard/all">$pidtxt{'01'}</a></td>';                else pagedropindex += '<td height="14" class="droppages"><a href="$scripturl?board=$currentboard/all">$pidtxt{'01'}</a></td>';
           }            }
           ~;            ~;
       }        }
       $pageindexjs .= qq~        $pageindexjs .= qq~
       if(visel != 'xx') pagedropindex += '<td height="14" class="small" style="height: 14px; padding-left: 4px;">$pagedropindexpv$pagedropindexnx</td>';        if(visel != 'xx') pagedropindex += '<td height="14" class="small" style="height: 14px; padding-left: 4px;">$pagedropindexpv$pagedropindexnx</td>';
       else pagedropindex += '<td height="14" class="small" style="height: 14px; padding-left: 4px;">$pagedropindexpvbl$pagedropindexnxbl</td>';        else pagedropindex += '<td height="14" class="small" style="height: 14px; padding-left: 4px;">$pagedropindexpvbl$pagedropindexnxbl</td>';
       pagedropindex += '</tr></table>';        pagedropindex += '</tr></table>';
       document.getElementById("ViewIndex1").innerHTML=pagedropindex;        document.getElementById("ViewIndex1").innerHTML=pagedropindex;
       document.getElementById("ViewIndex1").style.visibility = "visible";        document.getElementById("ViewIndex1").style.visibility = "visible";
       document.getElementById("ViewIndex2").innerHTML=pagedropindex;        document.getElementById("ViewIndex2").innerHTML=pagedropindex;
       document.getElementById("ViewIndex2").style.visibility = "visible";        document.getElementById("ViewIndex2").style.visibility = "visible";
       ~;        ~;
           if ($pagenumb > $dropdisplaynum) {            if ($pagenumb > $dropdisplaynum) {
               $pageindexjs .= qq~                $pageindexjs .= qq~
       document.getElementById("decselector1").value = decparam;        document.getElementById("decselector1").value = decparam;
       document.getElementById("decselector2").value = decparam;        document.getElementById("decselector2").value = decparam;
       ~;        ~;
           }            }
           $pageindexjs .= qq~            $pageindexjs .= qq~
   }    }
   document.onload = SelDec('$pagejsindex', '$tstart');    document.onload = SelDec('$pagejsindex', '$tstart');
//--> //-->
</script> </script>
~; ~;
       }        }
   }    }
   
   if ($start <= $#threads) { $stkynum = scalar @threads; }    if ($start <= $#threads) { $stkynum = scalar @threads; }
   push (@threads, @nostickythreadlist);    push (@threads, @nostickythreadlist);
   undef @nostickythreadlist;    undef @nostickythreadlist;
   @threads = splice(@threads, $start, $maxindex);    @threads = splice(@threads, $start, $maxindex);
   chomp @threads;    chomp @threads;
   
   my %attachments;    my %attachments;
   if (-s "$vardir/attachments.txt" > 5) {    if (-s "$vardir/attachments.txt" > 5) {
       fopen(ATM, "$vardir/attachments.txt");        fopen(ATM, "$vardir/attachments.txt");
       while (<ATM>) {        while (<ATM>) {
           $attachments{(split(/\|/, $_, 2))[0]}++;            $attachments{(split(/\|/, $_, 2))[0]}++;
       }        }
       fclose(ATM);        fclose(ATM);
   }    }
   
   &LoadCensorList;    &LoadCensorList;
   
   # Print the header and board info.    # Print the header and board info.
   &ToChars($boardname);    &ToChars($boardname);
   if ((($iammod && $modview == 1 && !$iamadmin && !$iamgmod) || ($iamadmin && $adminview == 1) || ($iamgmod && $gmodview == 1)) && $sessionvalid == 1) {    if ((($iammod && $modview == 1 && !$iamadmin && !$iamgmod) || ($iamadmin && $adminview == 1) || ($iamgmod && $gmodview == 1)) && $sessionvalid == 1) {
       $yymain .= qq~<script language="JavaScript1.2" src="$yyhtml_root/ubbc.js" type="text/javascript"></script>~;        $yymain .= qq~<script language="JavaScript1.2" src="$yyhtml_root/ubbc.js" type="text/javascript"></script>~;
   }    }
   
   my $homelink = qq~<a href="$scripturl">$mbname</a>~;    my $homelink = qq~<a href="$scripturl">$mbname</a>~;
   my $catlink = qq~<a href="$scripturl?catselect=$catid">$cat</a>~;    my $catlink = qq~<a href="$scripturl?catselect=$catid">$cat</a>~;
   my $boardlink = qq~<a href="$scripturl?board=$currentboard" class="a"><b>$boardname</b></a>~;    my $boardlink = qq~<a href="$scripturl?board=$currentboard" class="a"><b>$boardname</b></a>~;
   my $modslink = qq~$showmods~;    my $modslink = qq~$showmods~;
   
   # check howmany col's must be spanned    # check howmany col's must be spanned
   if ((($iamadmin && $adminview >= 1) || ($iamgmod && $gmodview >= 1) || ($iammod && $modview >= 1 && !$iamadmin && !$iamgmod)) && $sessionvalid == 1) {    if ((($iamadmin && $adminview >= 1) || ($iamgmod && $gmodview >= 1) || ($iammod && $modview >= 1 && !$iamadmin && !$iamgmod)) && $sessionvalid == 1) {
       $colspan = 8;        $colspan = 8;
   } else {    } else {
       $colspan = 7;        $colspan = 7;
   }    }
   
   if (!$iamguest) {    if (!$iamguest) {
       $markalllink = qq~$menusep<a href="javascript:MarkAllAsRead('$scripturl?board=$INFO{'board'};action=markasread','$imagesdir')">$img{'markboardread'}</a>~;        $markalllink = qq~$menusep<a href="javascript:MarkAllAsRead('$scripturl?board=$INFO{'board'};action=markasread','$imagesdir')">$img{'markboardread'}</a>~;
       $notify_board = qq~$menusep<a href="$scripturl?action=boardnotify;board=$INFO{'board'}">$img{'notify'}</a>~;        $notify_board = qq~$menusep<a href="$scripturl?action=boardnotify;board=$INFO{'board'}">$img{'notify'}</a>~;
   }    }
   
   if (&AccessCheck($currentboard, 1) eq "granted") {    if (&AccessCheck($currentboard, 1) eq "granted") {
       # when Quick-Post and Quick-Jump: focus message first, then the subject to have a better display        # when Quick-Post and Quick-Jump: focus message first, then the subject to have a better display
       $postlink = qq~$menusep<a href="~ . ($enable_quickpost && $enable_quickjump ? 'javascript:document.postmodify.message.focus();document.postmodify.subject.focus();' : qq~$scripturl?board=$INFO{'board'};action=post;title=StartNewTopic~) . qq~">$img{'newthread'}</a>~;        $postlink = qq~$menusep<a href="~ . ($enable_quickpost && $enable_quickjump ? 'javascript:document.postmodify.message.focus();document.postmodify.subject.focus();' : qq~$scripturl?board=$INFO{'board'};action=post;title=StartNewTopic~) . qq~">$img{'newthread'}</a>~;
   }    }
   if (&AccessCheck($currentboard, 3) eq "granted") {    if (&AccessCheck($currentboard, 3) eq "granted") {
       $polllink = qq~$menusep<a href="$scripturl?board=$INFO{'board'};action=post;title=CreatePoll">$img{'createpoll'}</a>~;        $polllink = qq~$menusep<a href="$scripturl?board=$INFO{'board'};action=post;title=CreatePoll">$img{'createpoll'}</a>~;
   }    }
   
   if ((($iamadmin && $adminview == 3) || ($iamgmod && $gmodview == 3) || ($iammod && $modview == 3 && !$iamadmin && !$iamgmod)) && $sessionvalid == 1) {    if ((($iamadmin && $adminview == 3) || ($iamgmod && $gmodview == 3) || ($iammod && $modview == 3 && !$iamadmin && !$iamgmod)) && $sessionvalid == 1) {
       if ($currentboard eq $annboard) {        if ($currentboard eq $annboard) {
           $adminlink = qq~<img src="$imagesdir/announcementlock.gif" alt="$messageindex_txt{'104'}" title="$messageindex_txt{'104'}" border="0" /><img src="$imagesdir/hide.gif" alt="$messageindex_txt{'844'}" title="$messageindex_txt{'844'}" border="0" /><img src="$imagesdir/admin_move.gif" alt="$messageindex_txt{'132'}" title="$messageindex_txt{'132'}" border="0" /><img src="$imagesdir/admin_rem.gif" alt="$messageindex_txt{'54'}" title="$messageindex_txt{'54'}" border="0" />~;            $adminlink = qq~<img src="$imagesdir/announcementlock.gif" alt="$messageindex_txt{'104'}" title="$messageindex_txt{'104'}" border="0" /><img src="$imagesdir/hide.gif" alt="$messageindex_txt{'844'}" title="$messageindex_txt{'844'}" border="0" /><img src="$imagesdir/admin_move.gif" alt="$messageindex_txt{'132'}" title="$messageindex_txt{'132'}" border="0" /><img src="$imagesdir/admin_rem.gif" alt="$messageindex_txt{'54'}" title="$messageindex_txt{'54'}" border="0" />~;
       } else {        } else {
           $adminlink = qq~<img src="$imagesdir/locked.gif" alt="$messageindex_txt{'104'}" title="$messageindex_txt{'104'}" border="0" /><img src="$imagesdir/sticky.gif" alt="$messageindex_txt{'781'}" title="$messageindex_txt{'781'}" border="0" /><img src="$imagesdir/hide.gif" alt="$messageindex_txt{'844'}" title="$messageindex_txt{'844'}" border="0" /><img src="$imagesdir/admin_move.gif" alt="$messageindex_txt{'132'}" title="$messageindex_txt{'132'}" border="0" /><img src="$imagesdir/admin_rem.gif" alt="$messageindex_txt{'54'}" title="$messageindex_txt{'54'}" border="0" />~;            $adminlink = qq~<img src="$imagesdir/locked.gif" alt="$messageindex_txt{'104'}" title="$messageindex_txt{'104'}" border="0" /><img src="$imagesdir/sticky.gif" alt="$messageindex_txt{'781'}" title="$messageindex_txt{'781'}" border="0" /><img src="$imagesdir/hide.gif" alt="$messageindex_txt{'844'}" title="$messageindex_txt{'844'}" border="0" /><img src="$imagesdir/admin_move.gif" alt="$messageindex_txt{'132'}" title="$messageindex_txt{'132'}" border="0" /><img src="$imagesdir/admin_rem.gif" alt="$messageindex_txt{'54'}" title="$messageindex_txt{'54'}" border="0" />~;
       }        }
       $adminheader =~ s/({|<)yabb admin(}|>)/$adminlink/g;        $adminheader =~ s/({|<)yabb admin(}|>)/$adminlink/g;
   } elsif ((($iamadmin && $adminview != 0) || ($iamgmod && $gmodview != 0) || ($iammod && $modview != 0 && !$iamadmin && !$iamgmod)) && $sessionvalid == 1) {    } elsif ((($iamadmin && $adminview != 0) || ($iamgmod && $gmodview != 0) || ($iammod && $modview != 0 && !$iamadmin && !$iamgmod)) && $sessionvalid == 1) {
       $adminlink = qq~$messageindex_txt{'2'}~;        $adminlink = qq~$messageindex_txt{'2'}~;
       $adminheader =~ s/({|<)yabb admin(}|>)/$adminlink/g;        $adminheader =~ s/({|<)yabb admin(}|>)/$adminlink/g;
   }    }
   
   # check to display moderator column    # check to display moderator column
   my $tmpstickyheader;    my $tmpstickyheader;
   if ($stkynum) {    if ($stkynum) {
       $stickyheader =~ s/({|<)yabb colspan(}|>)/$colspan/g;        $stickyheader =~ s/({|<)yabb colspan(}|>)/$colspan/g;
       $tmpstickyheader = $stickyheader;        $tmpstickyheader = $stickyheader;
   }    }
   
   # load Favorites in a hash    # load Favorites in a hash
   if (${$uid.$username}{'favorites'}) { foreach (split(/,/, ${$uid.$username}{'favorites'})) { $favicon{$_} = 1; } }    if (${$uid.$username}{'favorites'}) { foreach (split(/,/, ${$uid.$username}{'favorites'})) { $favicon{$_} = 1; } }
   
   # Begin printing the message index for current board.    # Begin printing the message index for current board.
   $counter = $start;    $counter = $start;
   &dumplog($currentboard); # Mark current board as seen    &dumplog($currentboard); # Mark current board as seen
   my $dmax = $date - ($max_log_days_old * 86400);    my $dmax = $date - ($max_log_days_old * 86400);
   foreach (@threads) {    foreach (@threads) {
       ($mnum, $msub, $mname, $memail, $mdate, $mreplies, $musername, $micon, $mstate) = split(/\|/, $_);        ($mnum, $msub, $mname, $memail, $mdate, $mreplies, $musername, $micon, $mstate) = split(/\|/, $_);
   
       &MessageTotals('load', $mnum);        &MessageTotals('load', $mnum);
   
       my $goodboard = $mstate =~ /a/i ? $annboard : $currentboard;        my $goodboard = $mstate =~ /a/i ? $annboard : $currentboard;
       if (${$mnum}{'board'} ne $goodboard) {        if (${$mnum}{'board'} ne $goodboard) {
           ${$mnum}{'board'} = $goodboard if $goodboard;            ${$mnum}{'board'} = $goodboard if $goodboard;
           &MessageTotals('recover', $mnum);            &MessageTotals('recover', $mnum);
       }        }
   
       $permlinkboard = ${$mnum}{'board'} eq $annboard ? $annboard : $currentboard;        $permlinkboard = ${$mnum}{'board'} eq $annboard ? $annboard : $currentboard;
       my $permdate = &permtimer($_);         my $permdate = &permtimer($mnum); 
       my $message_permalink = qq~<a href="http://$perm_domain/$symlink$permdate/$permlinkboard/$mnum">$messageindex_txt{'10'}</a>~;        my $message_permalink = qq~<a href="http://$perm_domain/$symlink$permdate/$permlinkboard/$mnum">$messageindex_txt{'10'}</a>~;
   
       $threadclass = 'thread';        $threadclass = 'thread';
       if ($mstate =~ /h/i) { $threadclass = 'hide'; }        if ($mstate =~ /h/i) { $threadclass = 'hide'; }
       elsif ($mstate =~ /l/i) { $threadclass = 'locked'; }        elsif ($mstate =~ /l/i) { $threadclass = 'locked'; }
       elsif ($mreplies >= $VeryHotTopic) { $threadclass = 'veryhotthread'; }        elsif ($mreplies >= $VeryHotTopic) { $threadclass = 'veryhotthread'; }
       elsif ($mreplies >= $HotTopic) { $threadclass = 'hotthread'; }        elsif ($mreplies >= $HotTopic) { $threadclass = 'hotthread'; }
       elsif ($mstate == '') { $threadclass = 'thread'; }        elsif ($mstate == '') { $threadclass = 'thread'; }
       if ($threadclass eq 'hide' && $mstate =~ /s/i && $mstate !~ /l/i) { $threadclass = 'hidesticky'; }        if ($threadclass eq 'hide' && $mstate =~ /s/i && $mstate !~ /l/i) { $threadclass = 'hidesticky'; }
       elsif ($threadclass eq 'hide' && $mstate =~ /l/i && $mstate !~ /s/i) { $threadclass = 'hidelock'; }        elsif ($threadclass eq 'hide' && $mstate =~ /l/i && $mstate !~ /s/i) { $threadclass = 'hidelock'; }
       elsif ($threadclass eq 'hide' && $mstate =~ /s/i && $mstate =~ /l/i) { $threadclass = 'hidestickylock'; }        elsif ($threadclass eq 'hide' && $mstate =~ /s/i && $mstate =~ /l/i) { $threadclass = 'hidestickylock'; }
       elsif ($threadclass eq 'locked' && $mstate =~ /s/i && $mstate !~ /h/i) { $threadclass = 'stickylock'; }        elsif ($threadclass eq 'locked' && $mstate =~ /s/i && $mstate !~ /h/i) { $threadclass = 'stickylock'; }
       elsif ($mstate =~ /s/i && $mstate !~ /h/i) { $threadclass = 'sticky'; }        elsif ($mstate =~ /s/i && $mstate !~ /h/i) { $threadclass = 'sticky'; }
       elsif (${$mnum}{'board'} eq $annboard && $mstate !~ /h/i) { $threadclass = $threadclass eq 'locked' ? 'announcementlock' : 'announcement'; }        elsif (${$mnum}{'board'} eq $annboard && $mstate !~ /h/i) { $threadclass = $threadclass eq 'locked' ? 'announcementlock' : 'announcement'; }
   
       my ($movedSubject, $movedFlag) = &Split_Splice_Move($msub,$mnum);        my ($movedSubject, $movedFlag) = &Split_Splice_Move($msub,$mnum);
       $threadclass = 'locked_moved' if $movedFlag;        $threadclass = 'locked_moved' if $movedFlag;
   
       if (!$iamguest && $max_log_days_old) {        if (!$iamguest && $max_log_days_old) {
           # Decide if thread should have the "NEW" indicator next to it.            # Decide if thread should have the "NEW" indicator next to it.
           # Do this by reading the user's log for last read time on thread,            # Do this by reading the user's log for last read time on thread,
           # and compare to the last post time on the thread.            # and compare to the last post time on the thread.
           $dlp = int($yyuserlog{$mnum}) > int($yyuserlog{"$currentboard--mark"}) ? int($yyuserlog{$mnum}) : int($yyuserlog{"$currentboard--mark"});            $dlp = int($yyuserlog{$mnum}) > int($yyuserlog{"$currentboard--mark"}) ? int($yyuserlog{$mnum}) : int($yyuserlog{"$currentboard--mark"});
           if (!$movedFlag && ($yyuserlog{"$mnum--unread"} || (!$dlp && $mdate > $dmax) || ($dlp > $dmax && $dlp < $mdate))) {            if (!$movedFlag && ($yyuserlog{"$mnum--unread"} || (!$dlp && $mdate > $dmax) || ($dlp > $dmax && $dlp < $mdate))) {
               if (${$mnum}{'board'} eq $annboard) {                if (${$mnum}{'board'} eq $annboard) {
                   $new = qq~<a href="$scripturl?virboard=$currentboard;num=$mnum/new#new"><img src="$imagesdir/new.gif" alt="$messageindex_txt{'302'}" title="$messageindex_txt{'302'}" border="0"/></a>~;                    $new = qq~<a href="$scripturl?virboard=$currentboard;num=$mnum/new#new"><img src="$imagesdir/new.gif" alt="$messageindex_txt{'302'}" title="$messageindex_txt{'302'}" border="0"/></a>~;
               } else {                } else {
                   $new = qq~<a href="$scripturl?num=$mnum/new#new"><img src="$imagesdir/new.gif" alt="$messageindex_txt{'302'}" title="$messageindex_txt{'302'}" border="0"/></a>~;                    $new = qq~<a href="$scripturl?num=$mnum/new#new"><img src="$imagesdir/new.gif" alt="$messageindex_txt{'302'}" title="$messageindex_txt{'302'}" border="0"/></a>~;
               }                }
           } else {            } else {
               $new = '';                $new = '';
           }            }
       }        }
   
       $micon = qq~<img src="$imagesdir/$micon.gif" alt="" border="0" align="middle" />~;        $micon = qq~<img src="$imagesdir/$micon.gif" alt="" border="0" align="middle" />~;
       $mpoll = "";        $mpoll = "";
       if (-e "$datadir/$mnum.poll") {        if (-e "$datadir/$mnum.poll") {
           $mpoll = qq~<b>$messageindex_txt{'15'}: </b>~;            $mpoll = qq~<b>$messageindex_txt{'15'}: </b>~;
           fopen(POLL, "$datadir/$mnum.poll");            fopen(POLL, "$datadir/$mnum.poll");
           my @poll = <POLL>;            my @poll = <POLL>;
           fclose(POLL);            fclose(POLL);
           my ($poll_question, $poll_locked, $poll_uname, $poll_name, $poll_email, $poll_date, $guest_vote, $hide_results, $multi_vote, $poll_mod, $poll_modname, $poll_comment, $vote_limit, $pie_radius, $pie_legends, $poll_end) = split(/\|/, $poll[0]);            my ($poll_question, $poll_locked, $poll_uname, $poll_name, $poll_email, $poll_date, $guest_vote, $hide_results, $multi_vote, $poll_mod, $poll_modname, $poll_comment, $vote_limit, $pie_radius, $pie_legends, $poll_end) = split(/\|/, $poll[0]);
           chomp $poll_end;            chomp $poll_end;
           if ($poll_end && !$poll_locked && $poll_end < $date) {            if ($poll_end && !$poll_locked && $poll_end < $date) {
               $poll_locked = 1;                $poll_locked = 1;
               $poll_end = '';                $poll_end = '';
               $poll[0] = "$poll_question|$poll_locked|$poll_uname|$poll_name|$poll_email|$poll_date|$guest_vote|$hide_results|$multi_vote|$poll_mod|$poll_modname|$poll_comment|$vote_limit|$pie_radius|$pie_legends|$poll_end\n";                $poll[0] = "$poll_question|$poll_locked|$poll_uname|$poll_name|$poll_email|$poll_date|$guest_vote|$hide_results|$multi_vote|$poll_mod|$poll_modname|$poll_comment|$vote_limit|$pie_radius|$pie_legends|$poll_end\n";
               fopen(POLL, ">$datadir/$mnum.poll");                fopen(POLL, ">$datadir/$mnum.poll");
               print POLL @poll;                print POLL @poll;
               fclose(POLL);                fclose(POLL);
           }            }
           $micon = qq~$img{'pollicon'}~;            $micon = qq~$img{'pollicon'}~;
           if ($poll_locked) { $micon = $img{'polliconclosed'}; }            if ($poll_locked) { $micon = $img{'polliconclosed'}; }
           elsif (!$iamguest && $max_log_days_old && $mdate > $date - ($max_log_days_old * 86400)) {            elsif (!$iamguest && $max_log_days_old && $mdate > $date - ($max_log_days_old * 86400)) {
               if ($dlp < $createpoll_date) {                if ($dlp < $createpoll_date) {
                   $micon = qq~$img{'polliconnew'}~;                    $micon = qq~$img{'polliconnew'}~;
               } else {                } else {
                   fopen(POLLED, "$datadir/$mnum.polled");                    fopen(POLLED, "$datadir/$mnum.polled");
                   $polled = <POLLED>;                    $polled = <POLLED>;
                   fclose(POLLED);                    fclose(POLLED);
                   (undef, undef, undef, $vote_date, undef) = split(/\|/, $polled);                    (undef, undef, undef, $vote_date, undef) = split(/\|/, $polled);
                   if ($dlp < $vote_date) { $micon = qq~$img{'polliconnew'}~; }                    if ($dlp < $vote_date) { $micon = qq~$img{'polliconnew'}~; }
               }                }
           }            }
       }        }
   
       # Load the current nickname of the account name of the thread starter.        # Load the current nickname of the account name of the thread starter.
       if ($musername ne 'Guest') {        if ($musername ne 'Guest') {
           &LoadUser($musername);            &LoadUser($musername);
           # See if they are an ex-member.            # See if they are an ex-member.
           if ((${$uid.$musername}{'regdate'} && $mdate > ${$uid.$musername}{'regtime'}) || ${$uid.$musername}{'position'} eq "Administrator" || ${$uid.$musername}{'position'} eq "Global Moderator") {            if ((${$uid.$musername}{'regdate'} && $mdate > ${$uid.$musername}{'regtime'}) || ${$uid.$musername}{'position'} eq "Administrator" || ${$uid.$musername}{'position'} eq "Global Moderator") {
               $mname = qq~<a href="$scripturl?action=viewprofile;username=$useraccount{$musername}">${$uid.$musername}{'realname'}</a>~;                $mname = qq~<a href="$scripturl?action=viewprofile;username=$useraccount{$musername}">${$uid.$musername}{'realname'}</a>~;
           } else {            } else {
               $mname .= qq~ ($messageindex_txt{'470a'})~;                $mname .= qq~ ($messageindex_txt{'470a'})~;
           }            }
       } else {        } else {
           $mname .= " ($maintxt{'28'})";            $mname .= " ($maintxt{'28'})";
       }        }
   
       # Build the page links list.        # Build the page links list.
       my ($pages, $pagesall);        my ($pages, $pagesall);
       if ($showpageall) { $pagesall = qq~<a href="$scripturl?num=$mnum/all">$pidtxt{'01'}</a>~; }        if ($showpageall) { $pagesall = qq~<a href="$scripturl?num=$mnum/all">$pidtxt{'01'}</a>~; }
       if (int(($mreplies + 1) / $maxmessagedisplay) > 6) {        if (int(($mreplies + 1) / $maxmessagedisplay) > 6) {
           $pages = qq~ <a href="$scripturl?num=$mnum/~ . (!$ttsreverse ? "0#0" : "$mreplies#$mreplies") . qq~">1</a>~;            $pages = qq~ <a href="$scripturl?num=$mnum/~ . (!$ttsreverse ? "0#0" : "$mreplies#$mreplies") . qq~">1</a>~;
           $pages .= qq~ <a href="$scripturl?num=$mnum/~ . (!$ttsreverse ? "$maxmessagedisplay#$maxmessagedisplay" : ($mreplies - $maxmessagedisplay) . '#' . ($mreplies - $maxmessagedisplay)) . qq~">2</a>~;            $pages .= qq~ <a href="$scripturl?num=$mnum/~ . (!$ttsreverse ? "$maxmessagedisplay#$maxmessagedisplay" : ($mreplies - $maxmessagedisplay) . '#' . ($mreplies - $maxmessagedisplay)) . qq~">2</a>~;
           $endpage = int($mreplies / $maxmessagedisplay) + 1;            $endpage = int($mreplies / $maxmessagedisplay) + 1;
           $i = ($endpage - 1) * $maxmessagedisplay;            $i = ($endpage - 1) * $maxmessagedisplay;
           $j = $i - $maxmessagedisplay;            $j = $i - $maxmessagedisplay;
           $k = $endpage - 1;            $k = $endpage - 1;
           $tmpa = $endpage - 2;            $tmpa = $endpage - 2;
           $tmpb = $j - $maxmessagedisplay;            $tmpb = $j - $maxmessagedisplay;
           $pages .= qq~ <a href="javascript:void(0);" onclick="ListPages($mnum);">...</a>~;            $pages .= qq~ <a href="javascript:void(0);" onclick="ListPages($mnum);">...</a>~;
           $pages .= qq~ <a href="$scripturl?num=$mnum/~ . (!$ttsreverse ? "$tmpb#$tmpb" : ($mreplies - $tmpb) . '#' . ($mreplies - $tmpb)) . qq~">$tmpa</a>~;            $pages .= qq~ <a href="$scripturl?num=$mnum/~ . (!$ttsreverse ? "$tmpb#$tmpb" : ($mreplies - $tmpb) . '#' . ($mreplies - $tmpb)) . qq~">$tmpa</a>~;
           $pages .= qq~ <a href="$scripturl?num=$mnum/~ . (!$ttsreverse ? "$j#$j" : ($mreplies - $j) . '#' . ($mreplies - $j)) . qq~">$k</a>~;            $pages .= qq~ <a href="$scripturl?num=$mnum/~ . (!$ttsreverse ? "$j#$j" : ($mreplies - $j) . '#' . ($mreplies - $j)) . qq~">$k</a>~;
           $pages .= qq~ <a href="$scripturl?num=$mnum/~ . (!$ttsreverse ? "$i#$i" : ($mreplies - $i) . '#' . ($mreplies - $i)) . qq~">$endpage</a>~;            $pages .= qq~ <a href="$scripturl?num=$mnum/~ . (!$ttsreverse ? "$i#$i" : ($mreplies - $i) . '#' . ($mreplies - $i)) . qq~">$endpage</a>~;
           $pages = qq~<br /><span class="small">&#171; $messageindex_txt{'139'} $pages $pagesall &#187;</span>~;            $pages = qq~<br /><span class="small">&#171; $messageindex_txt{'139'} $pages $pagesall &#187;</span>~;
       } elsif ($mreplies + 1 > $maxmessagedisplay) {        } elsif ($mreplies + 1 > $maxmessagedisplay) {
           $tmpa = 1;            $tmpa = 1;
           for ($tmpb = 0; $tmpb < $mreplies + 1; $tmpb += $maxmessagedisplay) {            for ($tmpb = 0; $tmpb < $mreplies + 1; $tmpb += $maxmessagedisplay) {
               $pages .= qq~<a href="$scripturl?num=$mnum/~ . (!$ttsreverse ? "$tmpb#$tmpb" : ($mreplies - $tmpb) . '#' . ($mreplies - $tmpb)) . qq~">$tmpa</a>\n~;                $pages .= qq~<a href="$scripturl?num=$mnum/~ . (!$ttsreverse ? "$tmpb#$tmpb" : ($mreplies - $tmpb) . '#' . ($mreplies - $tmpb)) . qq~">$tmpa</a>\n~;
               ++$tmpa;                ++$tmpa;
           }            }
           $pages =~ s/\n\Z//;            $pages =~ s/\n\Z//;
           $pages = qq~<br /><span class="small">&#171; $messageindex_txt{'139'} $pages $pagesall &#187;</span>~;            $pages = qq~<br /><span class="small">&#171; $messageindex_txt{'139'} $pages $pagesall &#187;</span>~;
       }        }
   
       # build number of views        # build number of views
       my $views = ${$mnum}{'views'} ? ${$mnum}{'views'} - 1 : 0;        my $views = ${$mnum}{'views'} ? ${$mnum}{'views'} - 1 : 0;
       $lastposter = ${$mnum}{'lastposter'};        $lastposter = ${$mnum}{'lastposter'};
       if ($lastposter =~ m~\AGuest-(.*)~) {        if ($lastposter =~ m~\AGuest-(.*)~) {
           $lastposter = $1 . " ($maintxt{'28'})";            $lastposter = $1 . " ($maintxt{'28'})";
       } else {        } else {
           &LoadUser($lastposter);            &LoadUser($lastposter);
           if ((${$uid.$lastposter}{'regdate'} && ${$mnum}{'lastpostdate'} > ${$uid.$lastposter}{'regtime'}) || ${$uid.$lastposter}{'position'} eq "Administrator" || ${$uid.$lastposter}{'position'} eq "Global Moderator") {            if ((${$uid.$lastposter}{'regdate'} && ${$mnum}{'lastpostdate'} > ${$uid.$lastposter}{'regtime'}) || ${$uid.$lastposter}{'position'} eq "Administrator" || ${$uid.$lastposter}{'position'} eq "Global Moderator") {
               $lastposter = qq~<a href="$scripturl?action=viewprofile;username=$useraccount{$lastposter}">${$uid.$lastposter}{'realname'}</a>~;                $lastposter = qq~<a href="$scripturl?action=viewprofile;username=$useraccount{$lastposter}">${$uid.$lastposter}{'realname'}</a>~;
           } else {            } else {
               # Need to load thread to see lastposters DISPLAYname if is Ex-Member                # Need to load thread to see lastposters DISPLAYname if is Ex-Member
               fopen(EXMEMBERTHREAD, "$datadir/$mnum.txt") || &fatal_error('cannot_open', "$datadir/$mnum.txt", 1);                fopen(EXMEMBERTHREAD, "$datadir/$mnum.txt") || &fatal_error('cannot_open', "$datadir/$mnum.txt", 1);
               my @x = <EXMEMBERTHREAD>;                my @x = <EXMEMBERTHREAD>;
               fclose(EXMEMBERTHREAD);                fclose(EXMEMBERTHREAD);
               $lastposter = (split(/\|/, $x[$#x], 3))[1] . " - $messageindex_txt{'470a'}";                $lastposter = (split(/\|/, $x[$#x], 3))[1] . " - $messageindex_txt{'470a'}";
           }            }
       }        }
       $lastpostername = $lastposter || $messageindex_txt{'470'};        $lastpostername = $lastposter || $messageindex_txt{'470'};
   
       if (($stkynum && ($counter >= $stkynum)) && ($stkyshowed < 1)) {        if (($stkynum && ($counter >= $stkynum)) && ($stkyshowed < 1)) {
           $nonstickyheader =~ s/({|<)yabb colspan(}|>)/$colspan/g;            $nonstickyheader =~ s/({|<)yabb colspan(}|>)/$colspan/g;
           $tmptempbar .= $nonstickyheader;            $tmptempbar .= $nonstickyheader;
           $stkyshowed = 1;            $stkyshowed = 1;
       }        }
   
       # Check if the thread contains attachments and create a paper-clip icon if it does        # Check if the thread contains attachments and create a paper-clip icon if it does
       my $alt = $attachments{$mnum} == 1 ? $messageindex_txt{'5'} : $messageindex_txt{'4'};        my $alt = $attachments{$mnum} == 1 ? $messageindex_txt{'5'} : $messageindex_txt{'4'};
       $temp_attachment = $attachments{$mnum} ?        $temp_attachment = $attachments{$mnum} ?
           (($guest_media_disallowed && $iamguest) ?            (($guest_media_disallowed && $iamguest) ?
               qq~<img src="$imagesdir/paperclip.gif" alt="$messageindex_txt{'3'} $attachments{$mnum} $alt" title="$messageindex_txt{'3'} $attachments{$mnum} $alt" />~ :                  qq~<img src="$imagesdir/paperclip.gif" alt="$messageindex_txt{'3'} $attachments{$mnum} $alt" title="$messageindex_txt{'3'} $attachments{$mnum} $alt" />~ :  
               qq~<a href="javascript:void(window.open('$scripturl?action=viewdownloads;thread=$mnum','_blank','width=800,height=650,scrollbars=yes,resizable=yes,menubar=no,toolbar=no,top=150,left=150'))">~ . qq~<img src="$imagesdir/paperclip.gif" alt="$messageindex_txt{'3'} $attachments{$mnum} $alt" title="$messageindex_txt{'3'} $attachments{$mnum} $alt" style="border-style:none;" /></a>~) :                qq~<a href="javascript:void(window.open('$scripturl?action=viewdownloads;thread=$mnum','_blank','width=800,height=650,scrollbars=yes,resizable=yes,menubar=no,toolbar=no,top=150,left=150'))">~ . qq~<img src="$imagesdir/paperclip.gif" alt="$messageindex_txt{'3'} $attachments{$mnum} $alt" title="$messageindex_txt{'3'} $attachments{$mnum} $alt" style="border-style:none;" /></a>~) :
           "";            "";
   
       $mcount++;        $mcount++;
       # Print the thread info.        # Print the thread info.
       $mydate = &timeformat($mdate);        $mydate = &timeformat($mdate);
       if ((($iamadmin && $adminview == 3) || ($iamgmod && $gmodview == 3) || ($iammod && $modview == 3 && !$iamadmin && !$iamgmod)) && $sessionvalid == 1) {        if ((($iamadmin && $adminview == 3) || ($iamgmod && $gmodview == 3) || ($iammod && $modview == 3 && !$iamadmin && !$iamgmod)) && $sessionvalid == 1) {
           if ($currentboard eq $annboard) {            if ($currentboard eq $annboard) {
               $adminbar = qq~                $adminbar = qq~
       <input type="checkbox" name="lockadmin$mcount" class="windowbg" style="border: 0px;" value="$mnum" />        <input type="checkbox" name="lockadmin$mcount" class="windowbg" style="border: 0px;" value="$mnum" />
       <input type="checkbox" name="hideadmin$mcount" class="windowbg" style="border: 0px;" value="$mnum" />        <input type="checkbox" name="hideadmin$mcount" class="windowbg" style="border: 0px;" value="$mnum" />
       <input type="checkbox" name="moveadmin$mcount" class="windowbg" style="border: 0px;" value="$mnum" />        <input type="checkbox" name="moveadmin$mcount" class="windowbg" style="border: 0px;" value="$mnum" />
       <input type="checkbox" name="deleteadmin$mcount" class="windowbg" style="border: 0px;" value="$mnum" />        <input type="checkbox" name="deleteadmin$mcount" class="windowbg" style="border: 0px;" value="$mnum" />
       ~;        ~;
           } elsif ($counter < $numanns) {            } elsif ($counter < $numanns) {
               $adminbar = qq~&nbsp;~;                $adminbar = qq~&nbsp;~;
           } else {            } else {
               $adminbar = qq~                $adminbar = qq~
       <input type="checkbox" name="lockadmin$mcount" class="windowbg" style="border: 0px;" value="$mnum" />        <input type="checkbox" name="lockadmin$mcount" class="windowbg" style="border: 0px;" value="$mnum" />
       <input type="checkbox" name="stickadmin$mcount" class="windowbg" style="border: 0px;" value="$mnum" />        <input type="checkbox" name="stickadmin$mcount" class="windowbg" style="border: 0px;" value="$mnum" />
       <input type="checkbox" name="hideadmin$mcount" class="windowbg" style="border: 0px;" value="$mnum" />        <input type="checkbox" name="hideadmin$mcount" class="windowbg" style="border: 0px;" value="$mnum" />
       <input type="checkbox" name="moveadmin$mcount" class="windowbg" style="border: 0px;" value="$mnum" />        <input type="checkbox" name="moveadmin$mcount" class="windowbg" style="border: 0px;" value="$mnum" />
       <input type="checkbox" name="deleteadmin$mcount" class="windowbg" style="border: 0px;" value="$mnum" />        <input type="checkbox" name="deleteadmin$mcount" class="windowbg" style="border: 0px;" value="$mnum" />
       ~;        ~;
           }            }
           $admincol = $admincolumn;            $admincol = $admincolumn;
           $admincol =~ s/({|<)yabb admin(}|>)/$adminbar/g;            $admincol =~ s/({|<)yabb admin(}|>)/$adminbar/g;
       } elsif ((($iamadmin && $adminview == 2) || ($iamgmod && $gmodview == 2) || ($iammod && $modview == 2 && !$iamadmin && !$iamgmod)) && $sessionvalid == 1) {        } elsif ((($iamadmin && $adminview == 2) || ($iamgmod && $gmodview == 2) || ($iammod && $modview == 2 && !$iamadmin && !$iamgmod)) && $sessionvalid == 1) {
           if ($currentboard ne $annboard && $counter < $numanns) {            if ($currentboard ne $annboard && $counter < $numanns) {
               $adminbar = qq~&nbsp;~;                $adminbar = qq~&nbsp;~;
           } else {            } else {
               $adminbar = qq~<input type="checkbox" name="admin$mcount" class="windowbg" style="border: 0px;" value="$mnum" />~;                $adminbar = qq~<input type="checkbox" name="admin$mcount" class="windowbg" style="border: 0px;" value="$mnum" />~;
           }            }
           $admincol = $admincolumn;            $admincol = $admincolumn;
           $admincol =~ s/({|<)yabb admin(}|>)/$adminbar/g;            $admincol =~ s/({|<)yabb admin(}|>)/$adminbar/g;
       } elsif ((($iamadmin && $adminview == 1) || ($iamgmod && $gmodview == 1) || ($iammod && $modview == 1 && !$iamadmin && !$iamgmod)) && $sessionvalid == 1) {        } elsif ((($iamadmin && $adminview == 1) || ($iamgmod && $gmodview == 1) || ($iammod && $modview == 1 && !$iamadmin && !$iamgmod)) && $sessionvalid == 1) {
           if ($currentboard eq $annboard) {            if ($currentboard eq $annboard) {
               $adminbar = qq~                $adminbar = qq~
       <a href="$scripturl?action=lock;thread=$mnum;tomessageindex=1"><img src="$imagesdir/announcementlock.gif" alt="$messageindex_txt{'104'}" title="$messageindex_txt{'104'}" border="0" /></a>&nbsp;        <a href="$scripturl?action=lock;thread=$mnum;tomessageindex=1"><img src="$imagesdir/announcementlock.gif" alt="$messageindex_txt{'104'}" title="$messageindex_txt{'104'}" border="0" /></a>&nbsp;
       <a href="$scripturl?action=hide;thread=$mnum;tomessageindex=1"><img src="$imagesdir/hide.gif" alt="$messageindex_txt{'844'}" title="$messageindex_txt{'844'}" border="0" /></a>&nbsp;        <a href="$scripturl?action=hide;thread=$mnum;tomessageindex=1"><img src="$imagesdir/hide.gif" alt="$messageindex_txt{'844'}" title="$messageindex_txt{'844'}" border="0" /></a>&nbsp;
       <a href="javascript:void(window.open('$scripturl?action=split_splice;board=$currentboard;thread=$mnum;oldposts=all;leave=0;newcat=${$uid.$currentboard}{'cat'};newboard=$currentboard;position=end','_blank','width=800,height=650,scrollbars=yes,resizable=yes,menubar=no,toolbar=no,top=150,left=150'))"><img src="$imagesdir/admin_move.gif" alt="$messageindex_txt{'132'}" title="$messageindex_txt{'132'}" border="0" /></a>&nbsp;        <a href="javascript:void(window.open('$scripturl?action=split_splice;board=$currentboard;thread=$mnum;oldposts=all;leave=0;newcat=${$uid.$currentboard}{'cat'};newboard=$currentboard;position=end','_blank','width=800,height=650,scrollbars=yes,resizable=yes,menubar=no,toolbar=no,top=150,left=150'))"><img src="$imagesdir/admin_move.gif" alt="$messageindex_txt{'132'}" title="$messageindex_txt{'132'}" border="0" /></a>&nbsp;
       <a href="$scripturl?action=removethread;thread=$mnum" onclick="return confirm('$messageindex_txt{'162'}')"><img src="$imagesdir/admin_rem.gif" alt="$messageindex_txt{'54'}" title="$messageindex_txt{'54'}" border="0" /></a>        <a href="$scripturl?action=removethread;thread=$mnum" onclick="return confirm('$messageindex_txt{'162'}')"><img src="$imagesdir/admin_rem.gif" alt="$messageindex_txt{'54'}" title="$messageindex_txt{'54'}" border="0" /></a>
       ~;        ~;
           } elsif ($counter < $numanns) {            } elsif ($counter < $numanns) {
               $adminbar = qq~&nbsp;~;                $adminbar = qq~&nbsp;~;
           } else {            } else {
               $adminbar = qq~                $adminbar = qq~
       <a href="$scripturl?action=lock;thread=$mnum;tomessageindex=1"><img src="$imagesdir/locked.gif" alt="$messageindex_txt{'104'}" title="$messageindex_txt{'104'}" border="0" /></a>&nbsp;        <a href="$scripturl?action=lock;thread=$mnum;tomessageindex=1"><img src="$imagesdir/locked.gif" alt="$messageindex_txt{'104'}" title="$messageindex_txt{'104'}" border="0" /></a>&nbsp;
       <a href="$scripturl?action=sticky;thread=$mnum"><img src="$imagesdir/sticky.gif" alt="$messageindex_txt{'781'}" title="$messageindex_txt{'781'}" border="0" /></a>&nbsp;        <a href="$scripturl?action=sticky;thread=$mnum"><img src="$imagesdir/sticky.gif" alt="$messageindex_txt{'781'}" title="$messageindex_txt{'781'}" border="0" /></a>&nbsp;
       <a href="$scripturl?action=hide;thread=$mnum;tomessageindex=1"><img src="$imagesdir/hide.gif" alt="$messageindex_txt{'844'}" title="$messageindex_txt{'844'}" border="0" /></a>&nbsp;        <a href="$scripturl?action=hide;thread=$mnum;tomessageindex=1"><img src="$imagesdir/hide.gif" alt="$messageindex_txt{'844'}" title="$messageindex_txt{'844'}" border="0" /></a>&nbsp;
       <a href="javascript:void(window.open('$scripturl?action=split_splice;board=$currentboard;thread=$mnum;oldposts=all;leave=0;newcat=${$uid.$currentboard}{'cat'};newboard=$currentboard;position=end','_blank','width=800,height=650,scrollbars=yes,resizable=yes,menubar=no,toolbar=no,top=150,left=150'))"><img src="$imagesdir/admin_move.gif" alt="$messageindex_txt{'132'}" title="$messageindex_txt{'132'}" border="0" /></a>&nbsp;        <a href="javascript:void(window.open('$scripturl?action=split_splice;board=$currentboard;thread=$mnum;oldposts=all;leave=0;newcat=${$uid.$currentboard}{'cat'};newboard=$currentboard;position=end','_blank','width=800,height=650,scrollbars=yes,resizable=yes,menubar=no,toolbar=no,top=150,left=150'))"><img src="$imagesdir/admin_move.gif" alt="$messageindex_txt{'132'}" title="$messageindex_txt{'132'}" border="0" /></a>&nbsp;
       <a href="$scripturl?action=removethread;thread=$mnum" onclick="return confirm('$messageindex_txt{'162'}')"><img src="$imagesdir/admin_rem.gif" alt="$messageindex_txt{'54'}" title="$messageindex_txt{'54'}" border="0" /></a>        <a href="$scripturl?action=removethread;thread=$mnum" onclick="return confirm('$messageindex_txt{'162'}')"><img src="$imagesdir/admin_rem.gif" alt="$messageindex_txt{'54'}" title="$messageindex_txt{'54'}" border="0" /></a>
       ~;        ~;
           }            }
           $admincol = $admincolumn;            $admincol = $admincolumn;
           $admincol =~ s/({|<)yabb admin(}|>)/$adminbar/g;            $admincol =~ s/({|<)yabb admin(}|>)/$adminbar/g;
       }        }
   
       $msub = &Censor($msub);        $msub = &Censor($msub);
       &ToChars($msub);        &ToChars($msub);
       if(!$movedFlag) {        if(!$movedFlag) {
           if (${$mnum}{'board'} eq $annboard) {            if (${$mnum}{'board'} eq $annboard) {
               $msublink = qq~<a href="$scripturl?virboard=$currentboard;num=$mnum">$msub</a>~;                $msublink = qq~<a href="$scripturl?virboard=$currentboard;num=$mnum">$msub</a>~;
           } else {            } else {
               $msublink = qq~<a href="$scripturl?num=$mnum">$msub</a>~;                $msublink = qq~<a href="$scripturl?num=$mnum">$msub</a>~;
           }            }
       } elsif ($movedFlag < 100) {        } elsif ($movedFlag < 100) {
           &Split_Splice_Move($msub,0);            &Split_Splice_Move($msub,0);
           $msublink = qq~$msub<br /><span class="small">$movedSubject</span>~;            $msublink = qq~$msub<br /><span class="small">$movedSubject</span>~;
       } else {        } else {
           $msub =~ /^(Re: )?\[m.*?\]: '(.*)'/; # newer then code in &Split_Splice_Move            $msub =~ /^(Re: )?\[m.*?\]: '(.*)'/; # newer then code in &Split_Splice_Move
           $msublink = qq~$maintxt{'758'}: '<a href="$scripturl?num=$movedFlag">$2</a>'<br /><span class="small">$movedSubject</span>~;            $msublink = qq~$maintxt{'758'}: '<a href="$scripturl?num=$movedFlag">$2</a>'<br /><span class="small">$movedSubject</span>~;
       }        }
   
       my $tempbar = $movedFlag ? $threadbarMoved : $threadbar;        my $tempbar = $movedFlag ? $threadbarMoved : $threadbar;
       $tempbar =~ s/({|<)yabb admin column(}|>)/$admincol/g;        $tempbar =~ s/({|<)yabb admin column(}|>)/$admincol/g;
       $tempbar =~ s/({|<)yabb threadpic(}|>)/<img src="$imagesdir\/$threadclass.gif" alt="" \/>/g;        $tempbar =~ s/({|<)yabb threadpic(}|>)/<img src="$imagesdir\/$threadclass.gif" alt="" \/>/g;
       $tempbar =~ s/({|<)yabb icon(}|>)/$micon/g;        $tempbar =~ s/({|<)yabb icon(}|>)/$micon/g;
       $tempbar =~ s/({|<)yabb new(}|>)/$new/g;        $tempbar =~ s/({|<)yabb new(}|>)/$new/g;
       $tempbar =~ s/({|<)yabb poll(}|>)/$mpoll/g;        $tempbar =~ s/({|<)yabb poll(}|>)/$mpoll/g;
       $tempbar =~ s/({|<)yabb favorite(}|>)/ ($favicon{$mnum} ? qq~<img src="$imagesdir\/addfav.gif" alt="$img_txt{'70'}" title="$img_txt{'70'}" \/>~ : '') /eg;        $tempbar =~ s/({|<)yabb favorite(}|>)/ ($favicon{$mnum} ? qq~<img src="$imagesdir\/addfav.gif" alt="$img_txt{'70'}" title="$img_txt{'70'}" \/>~ : '') /eg;
       $tempbar =~ s/({|<)yabb subjectlink(}|>)/$msublink/g;        $tempbar =~ s/({|<)yabb subjectlink(}|>)/$msublink/g;
       $tempbar =~ s/({|<)yabb attachmenticon(}|>)/$temp_attachment/g;        $tempbar =~ s/({|<)yabb attachmenticon(}|>)/$temp_attachment/g;
       $tempbar =~ s/({|<)yabb pages(}|>)/$pages/g;        $tempbar =~ s/({|<)yabb pages(}|>)/$pages/g;
       $tempbar =~ s/({|<)yabb starter(}|>)/$mname/g;        $tempbar =~ s/({|<)yabb starter(}|>)/$mname/g;
       $tempbar =~ s/({|<)yabb replies(}|>)/ &NumberFormat($mreplies) /eg;        $tempbar =~ s/({|<)yabb replies(}|>)/ &NumberFormat($mreplies) /eg;
       $tempbar =~ s/({|<)yabb views(}|>)/ &NumberFormat($views) /eg;        $tempbar =~ s/({|<)yabb views(}|>)/ &NumberFormat($views) /eg;
       $tempbar =~ s/({|<)yabb lastpostlink(}|>)/<a href="$scripturl?num=$mnum\/$mreplies#$mreplies">$img{'lastpost'} $mydate<\/a>/g;        $tempbar =~ s/({|<)yabb lastpostlink(}|>)/<a href="$scripturl?num=$mnum\/$mreplies#$mreplies">$img{'lastpost'} $mydate<\/a>/g;
       $tempbar =~ s/({|<)yabb lastposter(}|>)/$lastpostername/g;        $tempbar =~ s/({|<)yabb lastposter(}|>)/$lastpostername/g;
       if($accept_permalink == 1) {        if($accept_permalink == 1) {
           $tempbar =~ s/({|<)yabb permalink(}|>)/$message_permalink/g;            $tempbar =~ s/({|<)yabb permalink(}|>)/$message_permalink/g;
       } else {        } else {
           $tempbar =~ s/({|<)yabb permalink(}|>)//g;            $tempbar =~ s/({|<)yabb permalink(}|>)//g;
       }        }
       $tmptempbar .= $tempbar;        $tmptempbar .= $tempbar;
       $counter++;        $counter++;
   }    }
   
   # Put a "no messages" message if no threads exisit - just a  bit more friendly...    # Put a "no messages" message if no threads exisit - just a  bit more friendly...
   if (!$tmptempbar) {    if (!$tmptempbar) {
       $tmptempbar = qq~        $tmptempbar = qq~
       <tr>        <tr>
           <td class="windowbg2" valign="middle" align="center" colspan="$colspan"><br />$messageindex_txt{'841'}<br /><br /></td>            <td class="windowbg2" valign="middle" align="center" colspan="$colspan"><br />$messageindex_txt{'841'}<br /><br /></td>
       </tr>        </tr>
       ~;        ~;
   }    }
   
   my $multiview = 0;    my $multiview = 0;
   my $tmptempfooter;    my $tmptempfooter;
   if    ((($iamadmin && $adminview == 3) || ($iamgmod && $gmodview == 3) || ($iammod && $modview == 3 && !$iamadmin && !$iamgmod)) && $sessionvalid == 1) { $multiview = 3; }    if    ((($iamadmin && $adminview == 3) || ($iamgmod && $gmodview == 3) || ($iammod && $modview == 3 && !$iamadmin && !$iamgmod)) && $sessionvalid == 1) { $multiview = 3; }
   elsif ((($iamadmin && $adminview == 2) || ($iamgmod && $gmodview == 2) || ($iammod && $modview == 2 && !$iamadmin && !$iamgmod)) && $sessionvalid == 1) { $multiview = 2; }    elsif ((($iamadmin && $adminview == 2) || ($iamgmod && $gmodview == 2) || ($iammod && $modview == 2 && !$iamadmin && !$iamgmod)) && $sessionvalid == 1) { $multiview = 2; }
   
   if ($multiview >= 2) {    if ($multiview >= 2) {
       my $boardlist = &moveto;        my $boardlist = &moveto;
       if ($multiview eq '3') {        if ($multiview eq '3') {
           $tempfooter    = $subfooterbar;            $tempfooter    = $subfooterbar;
           $adminselector = qq~            $adminselector = qq~
               <label for="toboard">$messageindex_txt{'133'}</label>: <input type="checkbox" name="newinfo" value="1" title="$messageindex_txt{199}" class="titlebg" style="border: 0px;" ondblclick="alert('$messageindex_txt{200}')" /> <select name="toboard" id="toboard">$boardlist</select><input type="submit" value="$messageindex_txt{'462'}" class="button" />                <label for="toboard">$messageindex_txt{'133'}</label>: <input type="checkbox" name="newinfo" value="1" title="$messageindex_txt{199}" class="titlebg" style="border: 0px;" ondblclick="alert('$messageindex_txt{200}')" /> <select name="toboard" id="toboard">$boardlist</select><input type="submit" value="$messageindex_txt{'462'}" class="button" />
           ~;            ~;
           if ($currentboard eq $annboard) {            if ($currentboard eq $annboard) {
               $admincheckboxes = qq~                $admincheckboxes = qq~
               <input type="checkbox" name="lockall" value="" class="titlebg" style="border: 0px;" onclick="if (this.checked) checkAll(1); else uncheckAll(1);" />                <input type="checkbox" name="lockall" value="" class="titlebg" style="border: 0px;" onclick="if (this.checked) checkAll(1); else uncheckAll(1);" />
               <input type="checkbox" name="hideall" value="" class="titlebg" style="border: 0px;" onclick="if (this.checked) checkAll(2); else uncheckAll(2);" />                <input type="checkbox" name="hideall" value="" class="titlebg" style="border: 0px;" onclick="if (this.checked) checkAll(2); else uncheckAll(2);" />
               <input type="checkbox" name="moveall" value="" class="titlebg" style="border: 0px;" onclick="if (this.checked) checkAll(3); else uncheckAll(3);" />                <input type="checkbox" name="moveall" value="" class="titlebg" style="border: 0px;" onclick="if (this.checked) checkAll(3); else uncheckAll(3);" />
               <input type="checkbox" name="deleteall" value="" class="titlebg" style="border: 0px;" onclick="if (this.checked) checkAll(4); else uncheckAll(4);" />                <input type="checkbox" name="deleteall" value="" class="titlebg" style="border: 0px;" onclick="if (this.checked) checkAll(4); else uncheckAll(4);" />
               <input type="hidden" name="fromboard" value="$currentboard" />                <input type="hidden" name="fromboard" value="$currentboard" />
           ~;            ~;
           } else {            } else {
               $admincheckboxes = qq~                $admincheckboxes = qq~
               <input type="checkbox" name="lockall" value="" class="titlebg" style="border: 0px;" onclick="if (this.checked) checkAll(1); else uncheckAll(1);" />                <input type="checkbox" name="lockall" value="" class="titlebg" style="border: 0px;" onclick="if (this.checked) checkAll(1); else uncheckAll(1);" />
               <input type="checkbox" name="stickall" value="" class="titlebg" style="border: 0px;" onclick="if (this.checked) checkAll(2); else uncheckAll(2);" />                <input type="checkbox" name="stickall" value="" class="titlebg" style="border: 0px;" onclick="if (this.checked) checkAll(2); else uncheckAll(2);" />
               <input type="checkbox" name="hideall" value="" class="titlebg" style="border: 0px;" onclick="if (this.checked) checkAll(3); else uncheckAll(3);" />                <input type="checkbox" name="hideall" value="" class="titlebg" style="border: 0px;" onclick="if (this.checked) checkAll(3); else uncheckAll(3);" />
               <input type="checkbox" name="moveall" value="" class="titlebg" style="border: 0px;" onclick="if (this.checked) checkAll(4); else uncheckAll(4);" />                <input type="checkbox" name="moveall" value="" class="titlebg" style="border: 0px;" onclick="if (this.checked) checkAll(4); else uncheckAll(4);" />
               <input type="checkbox" name="deleteall" value="" class="titlebg" style="border: 0px;" onclick="if (this.checked) checkAll(5); else uncheckAll(5);" />                <input type="checkbox" name="deleteall" value="" class="titlebg" style="border: 0px;" onclick="if (this.checked) checkAll(5); else uncheckAll(5);" />
               <input type="hidden" name="fromboard" value="$currentboard" />                <input type="hidden" name="fromboard" value="$currentboard" />
           ~;            ~;
           }            }
           $tempfooter =~ s/({|<)yabb admin selector(}|>)/$adminselector/g;            $tempfooter =~ s/({|<)yabb admin selector(}|>)/$adminselector/g;
           $tempfooter =~ s/({|<)yabb admin checkboxes(}|>)/$admincheckboxes/g;            $tempfooter =~ s/({|<)yabb admin checkboxes(}|>)/$admincheckboxes/g;
       } elsif ($multiview eq '2') {        } elsif ($multiview eq '2') {
           $tempfooter = $subfooterbar;            $tempfooter = $subfooterbar;
           if ($currentboard eq $annboard) {            if ($currentboard eq $annboard) {
               $adminselector = qq~                $adminselector = qq~
               <input type="radio" name="multiaction" id="multiactionlock" value="lock" class="titlebg" style="border: 0px;" /> <label for="multiactionlock">$messageindex_txt{'104'}</label>                <input type="radio" name="multiaction" id="multiactionlock" value="lock" class="titlebg" style="border: 0px;" /> <label for="multiactionlock">$messageindex_txt{'104'}</label>
               <input type="radio" name="multiaction" id="multiactionhide" value="hide" class="titlebg" style="border: 0px;" /> <label for="multiactionhide">$messageindex_txt{'844'}</label>                <input type="radio" name="multiaction" id="multiactionhide" value="hide" class="titlebg" style="border: 0px;" /> <label for="multiactionhide">$messageindex_txt{'844'}</label>
               <input type="radio" name="multiaction" id="multiactiondelete" value="delete" class="titlebg" style="border: 0px;" /> <label for="multiactiondelete">$messageindex_txt{'31'}</label>                <input type="radio" name="multiaction" id="multiactiondelete" value="delete" class="titlebg" style="border: 0px;" /> <label for="multiactiondelete">$messageindex_txt{'31'}</label>
               <input type="radio" name="multiaction" id="multiactionmove" value="move" class="titlebg" style="border: 0px;" /> <label for="multiactionmove">$messageindex_txt{'133'}</label>: <input type="checkbox" name="newinfo" value="1" title="$messageindex_txt{199}" class="titlebg" style="border: 0px;" ondblclick="alert('$messageindex_txt{200}')" /> <select name="toboard" onchange="document.multiadmin.multiaction[3].checked=true;">$boardlist</select>                <input type="radio" name="multiaction" id="multiactionmove" value="move" class="titlebg" style="border: 0px;" /> <label for="multiactionmove">$messageindex_txt{'133'}</label>: <input type="checkbox" name="newinfo" value="1" title="$messageindex_txt{199}" class="titlebg" style="border: 0px;" ondblclick="alert('$messageindex_txt{200}')" /> <select name="toboard" onchange="document.multiadmin.multiaction[3].checked=true;">$boardlist</select>
               <input type="hidden" name="fromboard" value="$currentboard" />                <input type="hidden" name="fromboard" value="$currentboard" />
               <input type="submit" value="$messageindex_txt{'462'}" class="button" />                <input type="submit" value="$messageindex_txt{'462'}" class="button" />
           ~;            ~;
           } else {            } else {
               $adminselector = qq~                $adminselector = qq~
               <input type="radio" name="multiaction" id="multiactionlock" value="lock" class="titlebg" style="border: 0px;" /> <label for="multiactionlock">$messageindex_txt{'104'}</label>                <input type="radio" name="multiaction" id="multiactionlock" value="lock" class="titlebg" style="border: 0px;" /> <label for="multiactionlock">$messageindex_txt{'104'}</label>
               <input type="radio" name="multiaction" id="multiactionstick" value="stick" class="titlebg" style="border: 0px;" /> <label for="multiactionstick">$messageindex_txt{'781'}</label>                <input type="radio" name="multiaction" id="multiactionstick" value="stick" class="titlebg" style="border: 0px;" /> <label for="multiactionstick">$messageindex_txt{'781'}</label>
               <input type="radio" name="multiaction" id="multiactionhide" value="hide" class="titlebg" style="border: 0px;" /> <label for="multiactionhide">$messageindex_txt{'844'}</label>                <input type="radio" name="multiaction" id="multiactionhide" value="hide" class="titlebg" style="border: 0px;" /> <label for="multiactionhide">$messageindex_txt{'844'}</label>
               <input type="radio" name="multiaction" id="multiactiondelete" value="delete" class="titlebg" style="border: 0px;" /> <label for="multiactiondelete">$messageindex_txt{'31'}</label>                <input type="radio" name="multiaction" id="multiactiondelete" value="delete" class="titlebg" style="border: 0px;" /> <label for="multiactiondelete">$messageindex_txt{'31'}</label>
               <input type="radio" name="multiaction" id="multiactionmove" value="move" class="titlebg" style="border: 0px;" /> <label for="multiactionmove">$messageindex_txt{'133'}</label>: <input type="checkbox" name="newinfo" value="1" title="$messageindex_txt{199}" class="titlebg" style="border: 0px;" ondblclick="alert('$messageindex_txt{200}')" /> <select name="toboard" onchange="document.multiadmin.multiaction[4].checked=true;">$boardlist</select>                <input type="radio" name="multiaction" id="multiactionmove" value="move" class="titlebg" style="border: 0px;" /> <label for="multiactionmove">$messageindex_txt{'133'}</label>: <input type="checkbox" name="newinfo" value="1" title="$messageindex_txt{199}" class="titlebg" style="border: 0px;" ondblclick="alert('$messageindex_txt{200}')" /> <select name="toboard" onchange="document.multiadmin.multiaction[4].checked=true;">$boardlist</select>
               <input type="hidden" name="fromboard" value="$currentboard" />                <input type="hidden" name="fromboard" value="$currentboard" />
               <input type="submit" value="$messageindex_txt{'462'}" class="button" />                <input type="submit" value="$messageindex_txt{'462'}" class="button" />
           ~;            ~;
           }            }
           $admincheckboxes = qq~            $admincheckboxes = qq~
               <input type="checkbox" name="checkall" id="checkall" value="" class="titlebg" style="border: 0px;" onclick="if (this.checked) checkAll(0); else uncheckAll(0);" />                <input type="checkbox" name="checkall" id="checkall" value="" class="titlebg" style="border: 0px;" onclick="if (this.checked) checkAll(0); else uncheckAll(0);" />
           ~;            ~;
           $tempfooter =~ s/({|<)yabb admin selector(}|>)/$adminselector/g;            $tempfooter =~ s/({|<)yabb admin selector(}|>)/$adminselector/g;
           $tempfooter =~ s/({|<)yabb admin checkboxes(}|>)/$admincheckboxes/g;            $tempfooter =~ s/({|<)yabb admin checkboxes(}|>)/$admincheckboxes/g;
       }        }
   }    }
   $tmptempfooter .= $tempfooter;    $tmptempfooter .= $tempfooter;
   
   $yabbicons = qq~    $yabbicons = qq~
   <img src="$imagesdir/thread.gif" alt="$messageindex_txt{'457'}" title="$messageindex_txt{'457'}" /> $messageindex_txt{'457'}<br />    <img src="$imagesdir/thread.gif" alt="$messageindex_txt{'457'}" title="$messageindex_txt{'457'}" /> $messageindex_txt{'457'}<br />
   <img src="$imagesdir/sticky.gif" alt="$messageindex_txt{'779'}" title="$messageindex_txt{'779'}" /> $messageindex_txt{'779'}<br />    <img src="$imagesdir/sticky.gif" alt="$messageindex_txt{'779'}" title="$messageindex_txt{'779'}" /> $messageindex_txt{'779'}<br />
   <img src="$imagesdir/locked.gif" alt="$messageindex_txt{'456'}" title="$messageindex_txt{'456'}" /> $messageindex_txt{'456'}<br />    <img src="$imagesdir/locked.gif" alt="$messageindex_txt{'456'}" title="$messageindex_txt{'456'}" /> $messageindex_txt{'456'}<br />
   <img src="$imagesdir/stickylock.gif" alt="$messageindex_txt{'456'}" title="$messageindex_txt{'780'}" /> $messageindex_txt{'780'}<br />    <img src="$imagesdir/stickylock.gif" alt="$messageindex_txt{'456'}" title="$messageindex_txt{'780'}" /> $messageindex_txt{'780'}<br />
   <img src="$imagesdir/locked_moved.gif" alt="$messageindex_txt{'845'}" title="$messageindex_txt{'845'}" /> $messageindex_txt{'845'}<br />    <img src="$imagesdir/locked_moved.gif" alt="$messageindex_txt{'845'}" title="$messageindex_txt{'845'}" /> $messageindex_txt{'845'}<br />
~; ~;
   if (($iamadmin || $iamgmod || $iammod) && $sessionvalid == 1) {    if (($iamadmin || $iamgmod || $iammod) && $sessionvalid == 1) {
       $yabbadminicons = qq~<img src="$imagesdir/hide.gif" alt="$messageindex_txt{'458'}" title="$messageindex_txt{'458'}" /> $messageindex_txt{'458'}<br />~;        $yabbadminicons = qq~<img src="$imagesdir/hide.gif" alt="$messageindex_txt{'458'}" title="$messageindex_txt{'458'}" /> $messageindex_txt{'458'}<br />~;
       $yabbadminicons .= qq~<img src="$imagesdir/hidesticky.gif" alt="$messageindex_txt{'459'}" title="$messageindex_txt{'459'}" /> $messageindex_txt{'459'}<br />~;        $yabbadminicons .= qq~<img src="$imagesdir/hidesticky.gif" alt="$messageindex_txt{'459'}" title="$messageindex_txt{'459'}" /> $messageindex_txt{'459'}<br />~;
       $yabbadminicons .= qq~<img src="$imagesdir/hidelock.gif" alt="$messageindex_txt{'460'}" title="$messageindex_txt{'460'}" /> $messageindex_txt{'460'}<br />~;        $yabbadminicons .= qq~<img src="$imagesdir/hidelock.gif" alt="$messageindex_txt{'460'}" title="$messageindex_txt{'460'}" /> $messageindex_txt{'460'}<br />~;
       $yabbadminicons .= qq~<img src="$imagesdir/hidestickylock.gif" alt="$messageindex_txt{'461'}" title="$messageindex_txt{'461'}" /> $messageindex_txt{'461'}<br />~;        $yabbadminicons .= qq~<img src="$imagesdir/hidestickylock.gif" alt="$messageindex_txt{'461'}" title="$messageindex_txt{'461'}" /> $messageindex_txt{'461'}<br />~;
   }    }
   $yabbadminicons .= qq~    $yabbadminicons .= qq~
   <img src="$imagesdir/announcement.gif" alt="$messageindex_txt{'779a'}" title="$messageindex_txt{'779a'}" /> $messageindex_txt{'779a'}<br />    <img src="$imagesdir/announcement.gif" alt="$messageindex_txt{'779a'}" title="$messageindex_txt{'779a'}" /> $messageindex_txt{'779a'}<br />
   <img src="$imagesdir/announcementlock.gif" alt="$messageindex_txt{'779b'}" title="$messageindex_txt{'779b'}" /> $messageindex_txt{'779b'}<br />    <img src="$imagesdir/announcementlock.gif" alt="$messageindex_txt{'779b'}" title="$messageindex_txt{'779b'}" /> $messageindex_txt{'779b'}<br />
   <img src="$imagesdir/hotthread.gif" alt="$messageindex_txt{'454'} $HotTopic $messageindex_txt{'454a'}" title="$messageindex_txt{'454'} $HotTopic $messageindex_txt{'454a'}" /> $messageindex_txt{'454'} $HotTopic $messageindex_txt{'454a'}<br />    <img src="$imagesdir/hotthread.gif" alt="$messageindex_txt{'454'} $HotTopic $messageindex_txt{'454a'}" title="$messageindex_txt{'454'} $HotTopic $messageindex_txt{'454a'}" /> $messageindex_txt{'454'} $HotTopic $messageindex_txt{'454a'}<br />
   <img src="$imagesdir/veryhotthread.gif" alt="$messageindex_txt{'455'} $VeryHotTopic $messageindex_txt{'454a'}" title="$messageindex_txt{'455'} $VeryHotTopic $messageindex_txt{'454a'}" /> $messageindex_txt{'455'} $VeryHotTopic $messageindex_txt{'454a'}<br />    <img src="$imagesdir/veryhotthread.gif" alt="$messageindex_txt{'455'} $VeryHotTopic $messageindex_txt{'454a'}" title="$messageindex_txt{'455'} $VeryHotTopic $messageindex_txt{'454a'}" /> $messageindex_txt{'455'} $VeryHotTopic $messageindex_txt{'454a'}<br />
~; ~;
   
   &LoadAccess;    &LoadAccess;
   
   #template it    #template it
   $messageindex_template =~ s/({|<)yabb board(}|>)/$boardlink/g;    $messageindex_template =~ s/({|<)yabb board(}|>)/$boardlink/g;
   $template_mods = qq~$modslink$showmodgroups~;    $template_mods = qq~$modslink$showmodgroups~;
   
   my ($rss_link, $rss_text);    my ($rss_link, $rss_text);
   if (!$rss_disabled) {    if (!$rss_disabled) {
       $rss_link = qq~<a href="$scripturl?action=RSSboard;board=$currentboard" target="_blank"><img src="$imagesdir/rss.png" border="0" alt="$maintxt{'rssfeed'}" title="$maintxt{'rssfeed'}" style="vertical-align: middle;" /></a>~;        $rss_link = qq~<a href="$scripturl?action=RSSboard;board=$currentboard" target="_blank"><img src="$imagesdir/rss.png" border="0" alt="$maintxt{'rssfeed'}" title="$maintxt{'rssfeed'}" style="vertical-align: middle;" /></a>~;
       $rss_text = qq~<a href="$scripturl?action=RSSboard;board=$INFO{'board'}" target="_blank">$messageindex_txt{843}</a>~;        $rss_text = qq~<a href="$scripturl?action=RSSboard;board=$INFO{'board'}" target="_blank">$messageindex_txt{843}</a>~;
   }    }
   $yyrssfeed = $rss_text;    $yyrssfeed = $rss_text;
   $yyrss = $rss_link;    $yyrss = $rss_link;
   $messageindex_template =~ s/({|<)yabb rssfeed(}|>)/$rss_text/g;    $messageindex_template =~ s/({|<)yabb rssfeed(}|>)/$rss_text/g;
   $messageindex_template =~ s/({|<)yabb rss(}|>)/$rss_link/g;    $messageindex_template =~ s/({|<)yabb rss(}|>)/$rss_link/g;
   
   $messageindex_template =~ s/({|<)yabb home(}|>)/$homelink/g;    $messageindex_template =~ s/({|<)yabb home(}|>)/$homelink/g;
   $messageindex_template =~ s/({|<)yabb category(}|>)/$catlink/g;    $messageindex_template =~ s/({|<)yabb category(}|>)/$catlink/g;
   $messageindex_template =~ s/({|<)yabb board(}|>)/$boardlink/g;    $messageindex_template =~ s/({|<)yabb board(}|>)/$boardlink/g;
   $messageindex_template =~ s/({|<)yabb moderators(}|>)/$template_mods/g;    $messageindex_template =~ s/({|<)yabb moderators(}|>)/$template_mods/g;
   
   if ($ShowBDescrip) {    if ($ShowBDescrip) {
       if ($bdescrip ne "") {        if ($bdescrip ne "") {
           &ToChars($bdescrip);            &ToChars($bdescrip);
           $boarddescription      =~ s/({|<)yabb boarddescription(}|>)/$bdescrip/g;            $boarddescription      =~ s/({|<)yabb boarddescription(}|>)/$bdescrip/g;
           $messageindex_template =~ s/({|<)yabb description(}|>)/$boarddescription/g;            $messageindex_template =~ s/({|<)yabb description(}|>)/$boarddescription/g;
       }        }
       else {        else {
           $messageindex_template =~ s/({|<)yabb description(}|>)//g;            $messageindex_template =~ s/({|<)yabb description(}|>)//g;
       }        }
       if (${$uid.$currentboard}{'ann'} == 1)  { ${$uid.$currentboard}{'pic'} = "ann.gif"; }        if (${$uid.$currentboard}{'ann'} == 1)  { ${$uid.$currentboard}{'pic'} = "ann.gif"; }
       elsif (${$uid.$currentboard}{'rbin'} == 1) { ${$uid.$currentboard}{'pic'} = "recycle.gif"; }        elsif (${$uid.$currentboard}{'rbin'} == 1) { ${$uid.$currentboard}{'pic'} = "recycle.gif"; }
       else { if (!${$uid.$currentboard}{'pic'}) { ${$uid.$currentboard}{'pic'} = "boards.gif"; } }        else { if (!${$uid.$currentboard}{'pic'}) { ${$uid.$currentboard}{'pic'} = "boards.gif"; } }
       $bdpic = ${$uid.$currentboard}{'pic'};        $bdpic = ${$uid.$currentboard}{'pic'};
       if ($bdpic =~ /\//i) { $bdpic = qq~ <img src="$bdpic" alt="$boardname" title="$boardname" border="0" align="middle" /> ~; }        if ($bdpic =~ /\//i) { $bdpic = qq~ <img src="$bdpic" alt="$boardname" title="$boardname" border="0" align="middle" /> ~; }
       elsif ($bdpic) { $bdpic = qq~ <img src="$imagesdir/$bdpic" alt="$boardname" title="$boardname" border="0" align="middle" /> ~; }        elsif ($bdpic) { $bdpic = qq~ <img src="$imagesdir/$bdpic" alt="$boardname" title="$boardname" border="0" align="middle" /> ~; }
       $messageindex_template =~ s/({|<)yabb bdpicture(}|>)/$bdpic/g;        $messageindex_template =~ s/({|<)yabb bdpicture(}|>)/$bdpic/g;
       $tmpthreadcount = &NumberFormat(${$uid.$currentboard}{'threadcount'});        $tmpthreadcount = &NumberFormat(${$uid.$currentboard}{'threadcount'});
       $tmpmessagecount = &NumberFormat(${$uid.$currentboard}{'messagecount'});        $tmpmessagecount = &NumberFormat(${$uid.$currentboard}{'messagecount'});
       $messageindex_template =~ s/({|<)yabb threadcount(}|>)/$tmpthreadcount/g;        $messageindex_template =~ s/({|<)yabb threadcount(}|>)/$tmpthreadcount/g;
       $messageindex_template =~ s/({|<)yabb messagecount(}|>)/$tmpmessagecount/g;        $messageindex_template =~ s/({|<)yabb messagecount(}|>)/$tmpmessagecount/g;
   }    }
   $messageindex_template =~ s/({|<)yabb colspan(}|>)/$colspan/g;    $messageindex_template =~ s/({|<)yabb colspan(}|>)/$colspan/g;
   
   $topichandellist =~ s/({|<)yabb notify button(}|>)/$notify_board/g;    $topichandellist =~ s/({|<)yabb notify button(}|>)/$notify_board/g;
   $topichandellist =~ s/({|<)yabb markall button(}|>)/$markalllink/g;    $topichandellist =~ s/({|<)yabb markall button(}|>)/$markalllink/g;
   $topichandellist =~ s/({|<)yabb new post button(}|>)/$postlink/g;    $topichandellist =~ s/({|<)yabb new post button(}|>)/$postlink/g;
   $topichandellist =~ s/({|<)yabb new poll button(}|>)/$polllink/g;    $topichandellist =~ s/({|<)yabb new poll button(}|>)/$polllink/g;
   $topichandellist =~ s/\Q$menusep//i;    $topichandellist =~ s/\Q$menusep//i;
   
   $messageindex_template =~ s/({|<)yabb topichandellist(}|>)/$topichandellist/g;    $messageindex_template =~ s/({|<)yabb topichandellist(}|>)/$topichandellist/g;
   $messageindex_template =~ s/({|<)yabb pageindex top(}|>)/$pageindex1/g;    $messageindex_template =~ s/({|<)yabb pageindex top(}|>)/$pageindex1/g;
   $messageindex_template =~ s/({|<)yabb pageindex bottom(}|>)/$pageindex2/g;    $messageindex_template =~ s/({|<)yabb pageindex bottom(}|>)/$pageindex2/g;
   
   if ((($iamadmin && $adminview == 3) || ($iamgmod && $gmodview == 3) || ($iammod && $modview == 3 && !$iamadmin && !$iamgmod)) && $sessionvalid == 1) {    if ((($iamadmin && $adminview == 3) || ($iamgmod && $gmodview == 3) || ($iammod && $modview == 3 && !$iamadmin && !$iamgmod)) && $sessionvalid == 1) {
       $messageindex_template =~ s/({|<)yabb admin column(}|>)/$adminheader/g;        $messageindex_template =~ s/({|<)yabb admin column(}|>)/$adminheader/g;
   } elsif ((($iamadmin && $adminview != 0) || ($iamgmod && $gmodview != 0) || ($iammod && $modview != 0 && !$iamadmin && !$iamgmod)) && $sessionvalid == 1) {    } elsif ((($iamadmin && $adminview != 0) || ($iamgmod && $gmodview != 0) || ($iammod && $modview != 0 && !$iamadmin && !$iamgmod)) && $sessionvalid == 1) {
       $messageindex_template =~ s/({|<)yabb admin column(}|>)/$adminheader/g;        $messageindex_template =~ s/({|<)yabb admin column(}|>)/$adminheader/g;
   } else {    } else {
       $messageindex_template =~ s/({|<)yabb admin column(}|>)//g;        $messageindex_template =~ s/({|<)yabb admin column(}|>)//g;
   }    }
   
   if ((($iamadmin && $adminview >= 2) || ($iamgmod && $gmodview >= 2) || ($iammod && $modview >= 2 && !$iamadmin && !$iamgmod)) && $sessionvalid == 1) {    if ((($iamadmin && $adminview >= 2) || ($iamgmod && $gmodview >= 2) || ($iammod && $modview >= 2 && !$iamadmin && !$iamgmod)) && $sessionvalid == 1) {
       $formstart = qq~<form name="multiadmin" action="$scripturl?board=$currentboard;action=multiadmin" method="post" style="display: inline">~;        $formstart = qq~<form name="multiadmin" action="$scripturl?board=$currentboard;action=multiadmin" method="post" style="display: inline">~;
       $formend   = qq~<input type="hidden" name="allpost" value="$INFO{'start'}" /></form>~;        $formend   = qq~<input type="hidden" name="allpost" value="$INFO{'start'}" /></form>~;
       $messageindex_template =~ s/({|<)yabb modupdate(}|>)/$formstart/g;        $messageindex_template =~ s/({|<)yabb modupdate(}|>)/$formstart/g;
       $messageindex_template =~ s/({|<)yabb modupdateend(}|>)/$formend/g;        $messageindex_template =~ s/({|<)yabb modupdateend(}|>)/$formend/g;
   } else {    } else {
       $messageindex_template =~ s/({|<)yabb modupdate(}|>)//g;        $messageindex_template =~ s/({|<)yabb modupdate(}|>)//g;
       $messageindex_template =~ s/({|<)yabb modupdateend(}|>)//g;        $messageindex_template =~ s/({|<)yabb modupdateend(}|>)//g;
   }    }
   if ($tmpstickyheader) {    if ($tmpstickyheader) {
       $messageindex_template =~ s/({|<)yabb stickyblock(}|>)/$tmpstickyheader/g;