###############################################################################
# Display.pl #
###############################################################################
# YaBB: Yet another Bulletin Board #
# Open-Source Community Software for Webmasters #
# Version: YaBB 3.0 Beta #
# Packaged: October 05, 2010 #
# Distributed by: http://www.yabbforum.com #
# =========================================================================== #
# Copyright (c) 2000-2010 YaBB (www.yabbforum.com) - All Rights Reserved. #
# Software by: The YaBB Development Team #
# with assistance from the YaBB community. #
###############################################################################
$displayplver = 'YaBB 3.0 Beta $Revision: 352 $';
if ($action eq 'detailedversion') { return 1; }
&LoadLanguage('Display');
&LoadLanguage('FA');
require "$templatesdir/$usedisplay/Display.template";
if ($iamgmod) { require "$vardir/gmodsettings.txt"; }
sub Display {
# Check if board was 'shown to all' - and whether they can view the topic
if (&AccessCheck($currentboard, '', $boardperms) ne "granted") { &fatal_error("no_access"); }
# Get the "NEW"est Post for this user.
my $newestpost;
if (!$iamguest && $max_log_days_old && $INFO{'start'} eq "new") {
# This decides which messages were already read in the thread to
# determing where the redirect should go. It is done by
# comparing times in the username.log and the boardnumber.txt files.
&getlog;
my $mnum = $INFO{'num'};
my $dlp = int($yyuserlog{$mnum}) > int($yyuserlog{"$currentboard--mark"}) ? int($yyuserlog{$mnum}) : int($yyuserlog{"$currentboard--mark"});
$dlp = $dlp > $date - ($max_log_days_old * 86400) ? $dlp : $date - ($max_log_days_old * 86400);
unless (ref($thread_arrayref{$mnum})) {
@{$thread_arrayref{$mnum}} = &read_DBorFILE(0,'',$datadir,$mnum,'txt');
}
my $i = -1;
foreach (@{$thread_arrayref{$mnum}}) {
$i++;
last if (split(/\|/, $_))[3] > $dlp;
}
$newestpost = $INFO{'start'} = $i;
}
# Post and Thread Tools
if($threadtools) {
&LoadTools(2,"addfav","remfav","addpoll","reply","add_notify","del_notify","print","sendtopic","markunread");
}
if($posttools) {
&LoadTools(1,"delete","admin_split","mquote","quote","modify","alertmod");
}
if ($buddyListEnabled) { &loadMyBuddy; }
my $viewnum = $INFO{'num'};
# strip off any non numeric values to avoid exploitation
$maxmessagedisplay ||= 10;
my ($msubthread, $mnum, $mstate, $mdate, $msub, $mname, $memail, $mreplies, $musername, $micon, $mip, $mlm, $mlmb);
my ($counter, $counterwords, $threadclass, $notify, $max, $start, $windowbg, $mreplyno, $pagedropindex, $template_viewers, $template_favorite, $template_pollmain, $navback, $mark_unread, $pollbutton, $icanbypass, $replybutton, $bypassReplyButton);
&LoadCensorList;
# Determine category
$curcat = ${$uid.$currentboard}{'cat'};
# Figure out the name of the category
&get_forum_master;
if ($currentboard eq $annboard) {
$vircurrentboard = $INFO{'virboard'};
$vircurcat = ${$uid.$vircurrentboard}{'cat'};
($vircat, undef) = split(/\|/, $catinfo{$vircurcat});
&ToChars($vircat);
($virboardname, undef) = split(/\|/, $board{$vircurrentboard},2);
&ToChars($virboardname);
}
($cat, $catperms) = split(/\|/, $catinfo{"$curcat"});
&ToChars($cat);
($boardname, $boardperms, $boardview) = split(/\|/, $board{$currentboard});
&ToChars($boardname);
# Check to make sure this thread isn't locked.
($mnum, $msubthread, $mname, $memail, $mdate, $mreplies, $musername, $micon, $mstate) = split(/\|/, $yyThreadLine);
if ($mstate =~ /m/) {
$msubthread =~ / dest=(\d+)\]/;
my $newnum = $1;
if (&checkfor_DBorFILE("$datadir/$newnum.txt")) {
$yySetLocation = "$scripturl?num=$newnum";
&redirectexit;
}
eval { require "$datadir/movedthreads.cgi" };
while (exists $moved_file{$newnum}) {
$newnum = $moved_file{$newnum};
next if exists $moved_file{$newnum};
if (&checkfor_DBorFILE("$datadir/$newnum.txt")) {
$yySetLocation = "$scripturl?num=$newnum";
&redirectexit;
}
}
}
($msubthread, undef) = &Split_Splice_Move($msubthread,0);
&ToChars($msubthread);
$msubthread = &Censor($msubthread);
# Build a list of this board's moderators.
if (keys %moderators > 0) {
if (keys %moderators == 1) { $showmods = qq~($display_txt{'298'}: ~; }
else { $showmods = qq~($display_txt{'63'}: ~; }
while ($_ = each(%moderators)) {
&FormatUserName($_);
$showmods .= &QuickLinks($_,1) . ", ";
}
$showmods =~ s/, \Z/)/;
}
if (keys %moderatorgroups > 0) {
if (keys %moderatorgroups == 1) { $showmodgroups = qq~($display_txt{'298a'}: ~; }
else { $showmodgroups = qq~($display_txt{'63a'}: ~; }
my ($tmpmodgrp,$thismodgrp);
while ($_ = each(%moderatorgroups)) {
$tmpmodgrp = $moderatorgroups{$_};
($thismodgrp, undef) = split(/\|/, $NoPost{$tmpmodgrp}, 2);
$showmodgroups .= qq~$thismodgrp, ~;
}
$showmodgroups =~ s/, \Z/)/;
}
## now we've established credentials,
## can this user bypass locks?
## work out who can bypass locked thread
if ($mstate =~ /l/i) {
$icanbypass = &checkUserLockBypass;
$enable_quickreply = 0;
} elsif ($staff) {
$icanbypass = 2;
}
my $permdate = &permtimer($mnum);
my $display_permalink = qq~$display_txt{'10'}~;
# Look for a poll file for this thread.
if (&AccessCheck($currentboard, 3) eq 'granted') {
$pollbutton = qq~$menusep$img{'addpoll'}~;
}
if (&checkfor_DBorFILE("$datadir/$viewnum.poll")) {
$has_poll = 1;
$pollbutton = '';
} else {
$has_poll = 0;
if ($useraddpoll == 0) { $pollbutton = ''; }
}
# Get the class of this thread, based on lock status and number of replies.
if ((!$iamguest || $enable_guestposting) && &AccessCheck($currentboard, 2) eq 'granted') {
# check if we want post pop up instead
my $postpopup;
$replybutton = qq~$menusep$img{'reply'} ~;
if ($display_postpopup) {
$postpopup = qq~PostPage('$scripturl?action=post;num=$viewnum;virboard=$vircurrentboard;title=PostReply','$currentboard')~;
$replybutton .= "javascript://";
$bypassReplyButton = $replybutton . qq~" onclick="if (confirm('$display_txt{'posttolocked'}')) {$postpopup}">$img{'reply'} ~;
}
elsif ($enable_quickreply && $enable_quickjump) {
$replybutton .= 'javascript:document.postmodify.message.focus();'
} else {
$replybutton .= qq~$scripturl?action=post;num=$viewnum;virboard=$vircurrentboard;title=PostReply~;
}
$replybutton .= qq~" onclick="$postpopup">$img{'reply'} ~;
}
$threadclass = 'thread';
## hidden threads
if ($mstate =~ /h/i) {
$threadclass = 'hide';
if (!$staff) { &fatal_error('no_access'); }
}
## locked thread
elsif ($mstate =~ /l/i) {
$threadclass = 'locked'; ## same icon regardless
$pollbutton = '';
if ($icanbypass) { $replybutton = $bypassReplyButton; }
else { $replybutton = ''; } # squish
}
elsif ($mreplies >= $VeryHotTopic) { $threadclass = 'veryhotthread'; }
elsif ($mreplies >= $HotTopic) { $threadclass = 'hotthread'; }
elsif ($mstate eq '') { $threadclass = 'thread'; }
if ($threadclass eq 'hide') { ## hidden
if ($mstate =~ /s/i && $mstate !~ /l/i) { $threadclass = 'hidesticky'; }
elsif ($mstate =~ /l/i && $mstate !~ /s/i) {
$threadclass = 'hidelock'; $pollbutton = '';
if ($icanbypass) { $replybutton = $bypassReplyButton; }
else { $replybutton = ''; } # squish
}
elsif ($mstate =~ /s/i && $mstate =~ /l/i) {
$threadclass = 'hidestickylock'; $pollbutton = '';
if ($icanbypass) { $replybutton = $bypassReplyButton; }
else { $replybutton = ''; } # squish
}
}
elsif ($threadclass eq 'locked' && $mstate =~ /s/i) {
$threadclass = 'stickylock';
if ($icanbypass) { $replybutton = $bypassReplyButton; }
else { $replybutton = ''; } # squish
}
elsif ($mstate =~ /s/i) { $threadclass = 'sticky'; }
elsif (${$mnum}{'board'} eq $annboard) { $threadclass = $threadclass eq 'locked' ? 'announcementlock' : 'announcement'; }
if (!$iamguest && &checkfor_DBorFILE("$datadir/$mnum.mail")) {
require "$sourcedir/Notify.pl";
&ManageThreadNotify("update", $mnum, $username, '', '', 1);
}
if ($showmodgroups ne "" && $showmods ne "") { $showmods .= qq~ - ~; }
# Build the page links list.
if (!$iamguest) {
(undef, $userthreadpage, undef) = split(/\|/, ${$uid.$username}{'pageindex'}, 3);
}
my ($pagetxtindex, $pagetextindex, $pagedropindex1, $pagedropindex2, $all, $allselected);
$postdisplaynum = 3; # max number of pages to display
$dropdisplaynum = 10;
$startpage = 0;
$max = $mreplies + 1;
if (substr($INFO{'start'}, 0, 3) eq 'all' && $showpageall != 0) { $maxmessagedisplay = $max; $all = 1; $allselected = qq~ selected="selected"~; $start = !$ttsreverse ? 0 : $mreplies; }
else { $start = $INFO{'start'} !~ /\d/ ? (!$ttsreverse ? 0 : $mreplies) : $INFO{'start'}; }
$start = $start > $mreplies ? $mreplies : $start;
$start = !$ttsreverse ? (int($start / $maxmessagedisplay) * $maxmessagedisplay) : (int(($mreplies - $start) / $maxmessagedisplay) * $maxmessagedisplay);
$tmpa = 1;
$pagenumb = int(($max - 1) / $maxmessagedisplay) + 1;
if ($start >= (($postdisplaynum - 1) * $maxmessagedisplay)) {
$startpage = $start - (($postdisplaynum - 1) * $maxmessagedisplay);
$tmpa = int($startpage / $maxmessagedisplay) + 1;
}
if ($max >= $start + ($postdisplaynum * $maxmessagedisplay)) { $endpage = $start + ($postdisplaynum * $maxmessagedisplay); }
else { $endpage = $max; }
$lastpn = int($mreplies / $maxmessagedisplay) + 1;
$lastptn = ($lastpn - 1) * $maxmessagedisplay;
$pageindex1 = qq~
$display_txt{'139'}: $pagenumb~;
$pageindex2 = $pageindex1;
if ($pagenumb > 1 || $all) {
if ($userthreadpage == 1 || $iamguest) {
$pagetxtindexst = qq~~;
if (!$iamguest) { $pagetxtindexst .= qq~
$display_txt{'139'}: ~; }
else { $pagetxtindexst .= qq~
$display_txt{'139'}: ~; }
if ($startpage > 0) { $pagetxtindex = qq~1 ... ~; }
if ($startpage == $maxmessagedisplay) { $pagetxtindex = qq~1 ~; }
for ($counter = $startpage; $counter < $endpage; $counter += $maxmessagedisplay) {
$pagetxtindex .= $start == $counter ? qq~$tmpa ~ : qq~$tmpa ~;
$tmpa++;
}
if ($endpage < $max - ($maxmessagedisplay)) { $pageindexadd = qq~... ~; }
if ($endpage != $max) { $pageindexadd .= qq~$lastpn~; }
$pagetxtindex .= qq~$pageindexadd~;
$pageindex1 = qq~$pagetxtindexst$pagetxtindex~;
$pageindex2 = $pageindex1;
} else {
$pagedropindex1 = qq~~;
$pagedropindex1 .= qq~
~;
$pagedropindex2 = $pagedropindex1;
$tstart = $start;
#if (substr($INFO{'start'}, 0, 3) eq "all") { ($tstart, $start) = split(/\-/, $INFO{'start'}); }
$d_indexpages = $pagenumb / $dropdisplaynum;
$i_indexpages = int($pagenumb / $dropdisplaynum);
if ($d_indexpages > $i_indexpages) { $indexpages = int($pagenumb / $dropdisplaynum) + 1; }
else { $indexpages = int($pagenumb / $dropdisplaynum) }
$selectedindex = int(($start / $maxmessagedisplay) / $dropdisplaynum);
if ($pagenumb > $dropdisplaynum) {
$pagedropindex1 .= qq~\n~;
}
$pagedropindex1 .= qq~ ~;
$pagedropindex2 .= qq~ ~;
$tmpmaxmessagedisplay = $maxmessagedisplay;
$prevpage = !$ttsreverse ? $start - $tmpmaxmessagedisplay : $mreplies - $start + $tmpmaxmessagedisplay;
$nextpage = !$ttsreverse ? $start + $maxmessagedisplay : $mreplies - $start - $maxmessagedisplay;
$pagedropindexpvbl = qq~
~;
$pagedropindexnxbl = qq~
~;
if ((!$ttsreverse and $start < $maxmessagedisplay) or ($ttsreverse and $prevpage > $mreplies)) { $pagedropindexpv .= qq~
~; }
else { $pagedropindexpv .= qq~
~; }
if ((!$ttsreverse and $nextpage > $lastptn) or ($ttsreverse and $nextpage < $mreplies - $lastptn)) { $pagedropindexnx .= qq~
~; }
else { $pagedropindexnx .= qq~
~; }
$pageindex1 = qq~$pagedropindex1~;
$pageindex2 = qq~$pagedropindex2~;
$pageindexjs = qq~
function SelDec(decparam, visel) {
splitparam = decparam.split("|");
var vistart = parseInt(splitparam[0]);
var viend = parseInt(splitparam[1]);
var maxpag = parseInt(splitparam[2]);
var pagstart = parseInt(splitparam[3]);
//var allpagstart = parseInt(splitparam[3]);
if(visel == 'xx' && decparam == '$pagejsindex') visel = '$tstart';
var pagedropindex = '
| ' + i + ' | '; else pagedropindex += '' + i + ' | '; pagstart ~ . (!$ttsreverse ? '+' : '-') . qq~= maxpag; } ~; if ($showpageall) { $pageindexjs .= qq~ if (vistart != viend) { if(visel == 'all') pagedropindex += '$pidtxt{'01'} | '; else pagedropindex += '$pidtxt{'01'} | '; } ~; } $pageindexjs .= qq~ if(visel != 'xx') pagedropindex += '$pagedropindexpv$pagedropindexnx | '; else pagedropindex += '$pagedropindexpvbl$pagedropindexnxbl | '; pagedropindex += '
~;
$template_sendtopic = $sendtopicmail ? qq~$menusep$img{'sendtopic'}~ : '';
$template_print = qq~$menusep$img{'print'}~;
if ($has_poll) { require "$sourcedir/Poll.pl"; &display_poll($viewnum); $template_pollmain = qq~$pollmain
$usernamelink~ if $enable_quoteuser && (!$iamguest || $enable_guestposting);
} else {
$usernamelink = qq~
$usernamelink~ if $enable_quickreply && $enable_quoteuser && (!$iamguest || $enable_guestposting);
}
if (!$movedflag || $staff) {
$quote_mname = $useraccount{$musername};
$quote_mname =~ s/'/\\'/g;
if ($display_postpopup) {
if ($enable_markquote) {
$template_markquote = qq~$menusep$img{'mquote'}~;
}
if (length($postmessage) <= $quick_quotelength) {
my $quickmessage = $postmessage;
if (!$nestedquotes) {
$quickmessage =~ s~(<(br|p).*?>){0,1}\[quote([^\]]*)\](.*?)\[/quote([^\]]*)\](<(br|p).*?>){0,1}~
~;
if ($extendedprofiles) {
require "$sourcedir/ExtendedProfiles.pl";
$template_ext_prof = &ext_viewinposts($musername);
}
# Jump to the "NEW" Post.
$usernamelink = qq~$usernamelink~ if $newestpost && $newestpost == $counter;
$tool_sep = $posttools ? "|||" : "";
$posthandelblock =~ s/({|<)yabb markquote(}|>)/$template_markquote$tool_sep/g;
$posthandelblock =~ s/({|<)yabb quote(}|>)/$template_quote$tool_sep/g;
$posthandelblock =~ s/({|<)yabb modify(}|>)/$template_modify$tool_sep/g;
$posthandelblock =~ s/({|<)yabb split(}|>)/$template_split$tool_sep/g;
$posthandelblock =~ s/({|<)yabb delete(}|>)/$template_delete$tool_sep/g;
$posthandelblock =~ s/({|<)yabb modalert(}|>)/$PMAlertButton$tool_sep/g;
$posthandelblock =~ s/\Q$menusep//i;
if(!$posttools) { $outside_ptsep = ''; }
my $outside_posttools_tmp = $outside_posttools;
$outside_posttools_tmp =~ s/({|<)yabb markquote(}|>)/$template_markquote$outside_ptsep/g;
$outside_posttools_tmp =~ s/({|<)yabb quote(}|>)/$template_quote$outside_ptsep/g;
$outside_posttools_tmp =~ s/({|<)yabb modify(}|>)/$template_modify$outside_ptsep/g;
$outside_posttools_tmp =~ s/({|<)yabb split(}|>)/$template_split$outside_ptsep/g;
$outside_posttools_tmp =~ s/({|<)yabb delete(}|>)/$template_delete$outside_ptsep/g;
$outside_posttools_tmp =~ s/({|<)yabb modalert(}|>)/$PMAlertButton$outside_ptsep/g;
if(!$posttools) {
$posthandelblock = $outside_posttools_tmp . $posthandelblock;
$outside_posttools_tmp = '';
} else {
$outside_posttools_tmp =~ s~\[tool=(.+?)\](.+?)\[/tool\]~$tmpimg{$1}~g;
$posthandelblock =~ s~\[tool=(.+?)\](.+?)\[/tool\]~$2~g;
}
# Post and Thread Tools
if($posttools) {
$posthandelblock = &MakeTools($counter, $maintxt{'63'}, $posthandelblock);
}
$contactblock =~ s/({|<)yabb email(}|>)/$template_email/g;
$contactblock =~ s/({|<)yabb profile(}|>)/$template_profile/g;
$contactblock =~ s/({|<)yabb pm(}|>)/$template_pm/g;
$contactblock =~ s/({|<)yabb www(}|>)/$template_www/g;
$contactblock =~ s/({|<)yabb aim(}|>)/$aimad/g;
$contactblock =~ s/({|<)yabb yim(}|>)/$yimad/g;
$contactblock =~ s/({|<)yabb icq(}|>)/$icqad/g;
$contactblock =~ s/({|<)yabb msn(}|>)/$msnad/g;
$contactblock =~ s/({|<)yabb gtalk(}|>)/$gtalkad/g;
$contactblock =~ s/({|<)yabb skype(}|>)/$skypead/g;
$contactblock =~ s/({|<)yabb myspace(}|>)/$myspacead/g;
$contactblock =~ s/({|<)yabb facebook(}|>)/$facebookad/g;
$contactblock =~ s/({|<)yabb addbuddy(}|>)/$addbuddy/g;
$contactblock =~ s/\Q$menusep//i;
$outblock =~ s/({|<)yabb images(}|>)/$imagesdir/g;
$outblock =~ s/({|<)yabb messageoptions(}|>)/$msgcontrol/g;
$outblock =~ s/({|<)yabb memberinfo(}|>)/$memberinfo/g;
$outblock =~ s/({|<)yabb userlink(}|>)/$usernamelink/g;
$outblock =~ s/({|<)yabb location(}|>)/$userlocation/g;
$outblock =~ s/({|<)yabb stars(}|>)/$memberstar{$musername}/g;
$outblock =~ s/({|<)yabb subject(}|>)/$msub/g;
$outblock =~ s/({|<)yabb msgimg(}|>)/$msgimg/g;
$outblock =~ s/({|<)yabb msgdate(}|>)/$messdate/g;
$outblock =~ s/({|<)yabb replycount(}|>)/$counterwords/g;
$outblock =~ s/({|<)yabb count(}|>)/$counter/g;
if ($showattach || $attachment) {
$outblock =~ s/({|<)yabb showatthr(}|>)/showattachhr/g;
$outblock =~ s/({|<)yabb att(}|>)/$attachment/g;
$outblock =~ s/({|<)yabb showatt(}|>)/$showattach/g;
} else {
$outblock =~ s/({|<)yabb hideatt(}|>)/ display: none;/g;
}
$outblock =~ s/({|<)yabb css(}|>)/$css/g;
$outblock =~ s/({|<)yabb gender(}|>)/${$uid.$musername}{'gender'}/g;
$outblock =~ s/({|<)yabb ext_prof(}|>)/$template_ext_prof/g;
$outblock =~ s/({|<)yabb postinfo(}|>)/$template_postinfo/g;
$outblock =~ s/({|<)yabb usertext(}|>)/${$uid.$musername}{'usertext'}/g if !$hideusertext;
$outblock =~ s/({|<)yabb userpic(}|>)/${$uid.$musername}{'userpic'}/g if !$hideavatar;
$outblock =~ s/({|<)yabb message(}|>)/$message/g;
$outblock =~ s/({|<)yabb modified(}|>)/$lastmodified/g;
if (!$hidesignat && ${$uid.$musername}{'signature'}) {
$outblock =~ s/({|<)yabb signature(}|>)/${$uid.$musername}{'signature'}/g;
$outblock =~ s/({|<)yabb signaturehr(}|>)/$signature_hr/g;
} else {
$outblock =~ s/({|<)yabb hidesignat(}|>)/ display: none;/;
}
$outblock =~ s/({|<)yabb ipimg(}|>)/$ipimg/g;
$outblock =~ s/({|<)yabb ip(}|>)/$mip/g;
$outblock =~ s/({|<)yabb outsideposttools(}|>)/$outside_posttools_tmp/g;
$outblock =~ s/({|<)yabb posthandellist(}|>)/$posthandelblock/g;
$outblock =~ s/({|<)yabb contactlist(}|>)/$contactblock/g;
$outblock =~ s/({|<)yabb admin(}|>)/$template_admin/g;
if ($accept_permalink == 1){
$outblock =~ s/({|<)yabb permalink(}|>)/$display_permalink/g;
} else {
$outblock =~ s/({|<)yabb permalink(}|>)//g;
}
$outblock =~ s/({|<)yabb useronline(}|>)/$userOnline/g;
$outblock =~ s/({|<)yabb isbuddy(}|>)/$buddyad/g;
$tmpoutblock .= $outblock;
$counter += !$ttsreverse ? 1 : -1;
}
undef %UserPM_Level;
# Insert 4
# Insert 5
my ($template_remove, $template_splice, $template_lock, $template_hide, $template_sticky, $template_multidelete);
if ($staff && $sessionvalid == 1) {
$template_remove = qq~$menusep$img{'admin_rem'}~;
$template_splice = qq~$menusep$img{'admin_move_split_splice'}~;
$template_lock = qq~$menusep$img{'admin_lock'}~;
$template_hide = qq~$menusep$img{'hide'}~;
$template_sticky = qq~$menusep$img{'admin_sticky'}~ if ${$mnum}{'board'} ne $annboard;
if (($iammod && $mdmod == 1) || ($iamadmin && $mdadmin == 1) || ($iamgmod && $mdglobal == 1)) {
$template_multidelete = qq~$menusep$img{'admin_del'}~;
}
}
if ($template_viewers) {
$topic_viewers = qq~
~;
$yynavback = qq~$tabsep « $img_txt{'103'} $tabsep $navback $tabsep~;
$boardtree = '';
$parentboard = $currentboard;
while($parentboard) {
my ($pboardname, undef, undef) = split(/\|/, $board{"$parentboard"});
&ToChars($pboardname);
if(${$uid.$parentboard}{'canpost'}) {
$pboardname = qq~$pboardname~;
} else {
$pboardname = qq~$pboardname~;
}
$boardtree = qq~ › $pboardname$boardtree~;
$parentboard = ${$uid.$parentboard}{'parent'};
}
$yynavigation = qq~› $template_cat$boardtree › $msubthread~;
# Create link to modify displayed post order if allowed
my $curthreadurl = (!$iamguest and $ttsureverse) ? qq~
$msubthread~ : $msubthread;
$tool_sep = $threadtools ? "|||" : "";
$threadhandellist =~ s/({|<)yabb markunread(}|>)/$mark_unread$tool_sep/g;
$threadhandellist =~ s/({|<)yabb reply(}|>)/$replybutton$tool_sep/g;
$threadhandellist =~ s/({|<)yabb poll(}|>)/$pollbutton$tool_sep/g;
$threadhandellist =~ s/({|<)yabb notify(}|>)/$notify$tool_sep/g;
$threadhandellist =~ s/({|<)yabb favorite(}|>)/$template_favorite$tool_sep/g;
$threadhandellist =~ s/({|<)yabb sendtopic(}|>)/$template_sendtopic$tool_sep/g;
$threadhandellist =~ s/({|<)yabb print(}|>)/$template_print$tool_sep/g;
$threadhandellist =~ s/\Q$menusep//i;
if(!$threadtools) { $outside_ttsep = ''; }
$outside_threadtools =~ s/({|<)yabb markunread(}|>)/$mark_unread/g;
$outside_threadtools =~ s/({|<)yabb reply(}|>)/$replybutton/g;
$outside_threadtools =~ s/({|<)yabb poll(}|>)/$pollbutton/g;
$outside_threadtools =~ s/({|<)yabb notify(}|>)/$notify/g;
$outside_threadtools =~ s/({|<)yabb favorite(}|>)/$template_favorite/g;
$outside_threadtools =~ s/({|<)yabb sendtopic(}|>)/$template_sendtopic/g;
$outside_threadtools =~ s/({|<)yabb print(}|>)/$template_print/g;
if(!$threadtools) {
$threadhandellist = $outside_threadtools . $threadhandellist;
$outside_threadtools = '';
} else {
$outside_threadtools =~ s~\[tool=(.+?)\](.+?)\[/tool\]~$tmpimg{$1}~g;
$threadhandellist =~ s~\[tool=(.+?)\](.+?)\[/tool\]~$2~g;
}
$threadhandellist2 = $threadhandellist;
# Thread Tools #
if($threadtools) {
$threadhandellist2 = &MakeTools("bottom",$maintxt{'62'},$threadhandellist2);
$threadhandellist = &MakeTools("top",$maintxt{'62'},$threadhandellist);
}
$adminhandellist =~ s/({|<)yabb remove(}|>)/$template_remove/g;
$adminhandellist =~ s/({|<)yabb splice(}|>)/$template_splice/g;
$adminhandellist =~ s/({|<)yabb lock(}|>)/$template_lock/g;
$adminhandellist =~ s/({|<)yabb hide(}|>)/$template_hide/g;
$adminhandellist =~ s/({|<)yabb sticky(}|>)/$template_sticky/g;
$adminhandellist =~ s/({|<)yabb multidelete(}|>)/$template_multidelete/g;
$adminhandellist =~ s/\Q$menusep//i;
$display_template =~ s/({|<)yabb home(}|>)/$template_home/g;
$display_template =~ s/({|<)yabb category(}|>)/$template_cat/g;
$display_template =~ s/({|<)yabb board(}|>)/$template_board/g;
$display_template =~ s/({|<)yabb moderators(}|>)/$template_mods/g;
$display_template =~ s/({|<)yabb topicviewers(}|>)/$topic_viewers/g;
$display_template =~ s/({|<)yabb prev(}|>)/$prevlink/g;
$display_template =~ s/({|<)yabb next(}|>)/$nextlink/g;
$display_template =~ s/({|<)yabb pageindex top(}|>)/$pageindex1/g;
$display_template =~ s/({|<)yabb pageindex bottom(}|>)/$pageindex2/g;
$display_template =~ s/({|<)yabb outsidethreadtools(}|>)/$outside_threadtools/g;
$display_template =~ s/({|<)yabb threadhandellist(}|>)/$threadhandellist/g;
$display_template =~ s/({|<)yabb threadhandellist2(}|>)/$threadhandellist2/g;
$display_template =~ s/({|<)yabb threadimage(}|>)/$template_threadimage/g;
$display_template =~ s/({|<)yabb threadurl(}|>)/$curthreadurl/g;
$display_template =~ s/({|<)yabb views(}|>)/ &NumberFormat(${$viewnum}{'views'} - 1) /eg;
my $formstart;
if ($icanbypass) {
# Board=$currentboard is necessary for multidel - DO NOT REMOVE!!
# This form is necessary to allow thread deletion in locked topics.
$formstart = qq~
~;
}
$formstart .= qq~