| ############################################################################### |
| ############################################################################### |
| # Display.pl # |
| # Display.pm # |
| |
| # $Date: 01.05.16 $ # |
| ############################################################################### |
| ############################################################################### |
| # YaBB: Yet another Bulletin Board # |
| # YaBB: Yet another Bulletin Board # |
| # Open-Source Community Software for Webmasters # |
| # Open-Source Community Software for Webmasters # |
| # Version: YaBB 2.5.2 # |
| # Version: YaBB 2.6.12 # |
| # Packaged: October 21, 2012 # |
| # Packaged: January 5, 2016 # |
| # Distributed by: http://www.yabbforum.com # |
| # Distributed by: http://www.yabbforum.com # |
| # =========================================================================== # |
| # =========================================================================== # |
| # Copyright (c) 2000-2012 YaBB (www.yabbforum.com) - All Rights Reserved. # |
| # Copyright (c) 2000-2016 YaBB (www.yabbforum.com) - All Rights Reserved. # |
| # Software by: The YaBB Development Team # |
| # Software by: The YaBB Development Team # |
| # with assistance from the YaBB community. # |
| # with assistance from the YaBB community. # |
| ############################################################################### |
| ############################################################################### |
| |
| use CGI::Carp qw(fatalsToBrowser); |
| |
| our $VERSION = '2.6.12'; |
| |
| |
| $displayplver = 'YaBB 2.5.2 $Revision: 1.2 $'; |
| $displaypmver = 'YaBB 2.6.12 $Revision: 1710 $'; |
| if ($action eq 'detailedversion') { return 1; } |
| if ( $action eq 'detailedversion' ) { return 1; } |
| |
| |
| &LoadLanguage('Display'); |
| LoadLanguage('Display'); |
| &LoadLanguage('FA'); |
| LoadLanguage('FA'); |
| require "$templatesdir/$usedisplay/Display.template"; |
| get_micon(); |
| if ($iamgmod) { require "$vardir/gmodsettings.txt"; } |
| get_template('Display'); |
| |
| get_gmod(); |
| |
| |
| sub Display { |
| 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. |
| # Check if board was 'shown to all' - and whether they can view the topic |
| my $newestpost; |
| if ( AccessCheck( $currentboard, q{}, $boardperms ) ne 'granted' ) { |
| if (!$iamguest && $max_log_days_old && $INFO{'start'} eq "new") { |
| fatal_error('no_access'); |
| # 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. |
| if ( $enable_guest_view_limit && $guestaccess ) { |
| &getlog; |
| my $iambot = 0; |
| my $mnum = $INFO{'num'}; |
| my $user_host = |
| my $dlp = int($yyuserlog{$mnum}) > int($yyuserlog{"$currentboard--mark"}) ? int($yyuserlog{$mnum}) : int($yyuserlog{"$currentboard--mark"}); |
| ( gethostbyaddr pack( 'C4', split /\./xsm, $user_ip ), 2 )[0]; |
| $dlp = $dlp > $date - ($max_log_days_old * 86400) ? $dlp : $date - ($max_log_days_old * 86400); |
| if ( -e "$vardir/bots.hosts" ) { |
| |
| fopen( BOTS, "$vardir/bots.hosts" ) |
| unless (ref($thread_arrayref{$mnum})) { |
| or fatal_error( 'cannot_open', "$vardir/bots.hosts", 1 ); |
| fopen(MNUM, "$datadir/$mnum.txt"); |
| my @botlist = <BOTS>; |
| @{$thread_arrayref{$mnum}} = <MNUM>; |
| fclose(BOTS); |
| fclose(MNUM); |
| chomp @botlist; |
| } |
| foreach (@botlist) { |
| my $i = -1; |
| if ( $_ =~ /(.*?)\|(.*)/xsm ) { $bot_name = $1; } |
| foreach (@{$thread_arrayref{$mnum}}) { |
| if ( $user_host =~ /$bot_name/ixsm ) { $iambot = 1; } |
| $i++; |
| } |
| last if (split(/\|/, $_))[3] > $dlp; |
| } |
| } |
| if ( $iamguest |
| |
| && !$iambot |
| $newestpost = $INFO{'start'} = $i; |
| && $yyCookies{$cookieview} < $guest_view_limit ) |
| } |
| { |
| |
| if ( $yyCookies{$cookieview} ) { |
| if ($buddyListEnabled) { &loadMyBuddy; } |
| $gtvlcount = $yyCookies{$cookieview}; |
| my $viewnum = $INFO{'num'}; |
| $gtvlcount =~ s/\D//gsm; |
| |
| $gtvlcount++; |
| # strip off any non numeric values to avoid exploitation |
| } |
| $maxmessagedisplay ||= 10; |
| else { |
| my ($msubthread, $mnum, $mstate, $mdate, $msub, $mname, $memail, $mreplies, $musername, $micon, $mip, $mlm, $mlmb); |
| $gtvlcount = 1; |
| my ($counter, $counterwords, $threadclass, $notify, $max, $start, $windowbg, $mattach, $pagedropindex, $template_viewers, $template_favorite, $template_pollmain, $navback, $mark_unread, $pollbutton, $icanbypass, $replybutton, $bypassReplyButton); |
| } |
| |
| my $guest_view_limit_clength = q{+} . $cookieviewtime . 'm'; |
| &LoadCensorList; |
| $yySetCookies1 = write_cookie( |
| |
| -path => q{/}, |
| # Determine category |
| -name => $cookieview, |
| $curcat = ${$uid.$currentboard}{'cat'}; |
| -value => $gtvlcount, |
| |
| -expires => $guest_view_limit_clength |
| # Figure out the name of the category |
| ); |
| unless ($mloaded == 1) { require "$boardsdir/forum.master"; } |
| } |
| |
| elsif ($iamguest |
| if ($currentboard eq $annboard) { |
| && !$iambot |
| $vircurrentboard = $INFO{'virboard'}; |
| && $yyCookies{$cookieview} >= $guest_view_limit ) |
| $vircurcat = ${$uid.$vircurrentboard}{'cat'}; |
| { |
| ($vircat, undef) = split(/\|/, $catinfo{$vircurcat}); |
| if ($guest_view_limit_block) { |
| ($virboardname, undef) = split(/\|/, $board{$vircurrentboard},2); |
| $guest_view_limit_warn = q{}; |
| &ToChars($virboardname); |
| $yytitle = $display_txt{'guest_message'}; |
| } |
| $yynavigation = qq~› $display_txt{'guest_message'}~; |
| |
| $yymain .= $my_guest_limit; |
| ($cat, $catperms) = split(/\|/, $catinfo{"$curcat"}); |
| template(); |
| &ToChars($cat); |
| exit; |
| |
| } |
| ($boardname, $boardperms, $boardview) = split(/\|/, $board{$currentboard}); |
| else { |
| |
| $guest_view_limit_warn = $guest_view_limit_w; |
| &ToChars($boardname); |
| } |
| |
| } |
| # Check to make sure this thread isn't locked. |
| } |
| ($mnum, $msubthread, $mname, $memail, $mdate, $mreplies, $musername, $micon, $mstate) = split(/\|/, $yyThreadLine); |
| |
| |
| # Get the "NEW"est Post for this user. |
| if ($mstate =~ /m/) { |
| my $newestpost; |
| $msubthread =~ / dest=(\d+)\]/; |
| if ( !$iamguest && $max_log_days_old && $INFO{'start'} eq 'new' ) { |
| my $newnum = $1; |
| |
| if (-e "$datadir/$newnum.txt") { |
| # This decides which messages were already read in the thread to |
| $yySetLocation = "$scripturl?num=$newnum"; |
| # determining where the redirect should go. It is done by |
| &redirectexit; |
| # comparing times in the username.log and the boardnumber.txt files. |
| } |
| getlog(); |
| eval { require "$datadir/movedthreads.cgi" }; |
| my $mnum = $INFO{'num'}; |
| while (exists $moved_file{$newnum}) { |
| my $dlp = |
| $newnum = $moved_file{$newnum}; |
| int( $yyuserlog{$mnum} ) > int( $yyuserlog{"$currentboard--mark"} ) |
| next if exists $moved_file{$newnum}; |
| ? int( $yyuserlog{$mnum} ) |
| if (-e "$datadir/$newnum.txt") { |
| : int $yyuserlog{"$currentboard--mark"}; |
| $yySetLocation = "$scripturl?num=$newnum"; |
| $dlp = |
| &redirectexit; |
| $dlp > $date - ( $max_log_days_old * 86400 ) |
| } |
| ? $dlp |
| } |
| : $date - ( $max_log_days_old * 86400 ); |
| } |
| |
| |
| if ( !ref $thread_arrayref{$mnum} ) { |
| ($msubthread, undef) = &Split_Splice_Move($msubthread,0); |
| fopen( MNUM, "$datadir/$mnum.txt" ); |
| &ToChars($msubthread); |
| @{ $thread_arrayref{$mnum} } = <MNUM>; |
| $msubthread = &Censor($msubthread); |
| fclose(MNUM); |
| |
| } |
| # Build a list of this board's moderators. |
| my $i = -1; |
| if (keys %moderators > 0) { |
| foreach ( @{ $thread_arrayref{$mnum} } ) { |
| if (keys %moderators == 1) { $showmods = qq~($display_txt{'298'}: ~; } |
| $i++; |
| else { $showmods = qq~($display_txt{'63'}: ~; } |
| last if ( split /\|/xsm, $_ )[3] > $dlp; |
| |
| } |
| while ($_ = each(%moderators)) { |
| |
| &FormatUserName($_); |
| $newestpost = $INFO{'start'} = $i; |
| $showmods .= &QuickLinks($_,1) . ", "; |
| } |
| } |
| |
| $showmods =~ s/, \Z/)/; |
| # Post and Thread Tools |
| } |
| if ($useThreadtools) { |
| if (keys %moderatorgroups > 0) { |
| LoadTools( |
| if (keys %moderatorgroups == 1) { $showmodgroups = qq~($display_txt{'298a'}: ~; } |
| 2, 'addfav', 'remfav', 'addpoll', |
| else { $showmodgroups = qq~($display_txt{'63a'}: ~; } |
| 'reply', 'add_notify', 'del_notify', 'print', |
| |
| 'sendtopic', 'markunread' |
| my ($tmpmodgrp,$thismodgrp); |
| ); |
| while ($_ = each(%moderatorgroups)) { |
| } |
| $tmpmodgrp = $moderatorgroups{$_}; |
| if ($usePosttools) { |
| ($thismodgrp, undef) = split(/\|/, $NoPost{$tmpmodgrp}, 2); |
| LoadTools( 1, 'delete', 'admin_split', 'mquote', 'quote', 'modify', |
| $showmodgroups .= qq~$thismodgrp, ~; |
| 'printp', 'alertmod' ); |
| } |
| } |
| $showmodgroups =~ s/, \Z/)/; |
| |
| } |
| if ($buddyListEnabled) { loadMyBuddy(); } |
| |
| my $viewnum = $INFO{'num'}; |
| ## now we have established credentials, |
| |
| ## can this user bypass locks? |
| # strip off any non numeric values to avoid exploitation |
| ## work out who can bypass locked thread post only if bypass switched on |
| $maxmessagedisplay ||= 10; |
| if ($mstate =~ /l/i) { |
| my ( |
| if ($bypass_lock_perm) { $icanbypass = &checkUserLockBypass; } |
| $msubthread, $mnum, $mstate, $mdate, $msub, |
| $enable_quickreply = 0; |
| $mname, $memail, $mreplies, $musername, $micon, |
| } |
| $mip, $mlm, $mlmb |
| |
| ); |
| my $permdate = &permtimer($mnum); |
| my ( |
| my $display_permalink = qq~<a href="http://$perm_domain/$symlink$permdate/$currentboard/$mnum">$display_txt{'10'}</a>~; |
| $counter, $counterwords, $threadclass, |
| |
| $notify, $max, $start, |
| # Look for a poll file for this thread. |
| $mattach, $template_viewers, $template_favorite, |
| if (&AccessCheck($currentboard, 3) eq 'granted') { |
| $template_pollmain, $navback, $mark_unread, |
| $pollbutton = qq~$menusep<a href="$scripturl?action=post;num=$viewnum;virboard=$vircurrentboard;title=AddPoll">$img{'addpoll'}</a>~; |
| $pollbutton, $icanbypass, $replybutton, |
| } |
| $bypassReplyButton |
| if (-e "$datadir/$viewnum.poll") { |
| ); |
| $has_poll = 1; |
| |
| $pollbutton = ''; |
| LoadCensorList(); |
| } else { |
| |
| $has_poll = 0; |
| # Determine category |
| if ($useraddpoll == 0) { $pollbutton = ''; } |
| $curcat = ${ $uid . $currentboard }{'cat'}; |
| } |
| |
| |
| # Figure out the name of the category |
| # Get the class of this thread, based on lock status and number of replies. |
| get_forum_master(); |
| if ((!$iamguest || $enable_guestposting) && &AccessCheck($currentboard, 2) eq 'granted') { |
| |
| $replybutton = qq~$menusep<a href="~ . ($enable_quickreply && $enable_quickjump ? 'javascript:document.postmodify.message.focus();' : qq~$scripturl?action=post;num=$viewnum;virboard=$vircurrentboard;title=PostReply~); |
| if ( $currentboard eq $annboard ) { |
| $bypassReplyButton = $replybutton . qq~" onclick="return confirm('$display_txt{'posttolocked'}');">$img{'reply'}</a> ~; |
| $vircurrentboard = $INFO{'virboard'}; |
| $replybutton .= qq~">$img{'reply'}</a> ~; #" make my text-editor happy; |
| $vircurcat = ${ $uid . $vircurrentboard }{'cat'}; |
| } |
| ( $vircat, undef ) = split /\|/xsm, $catinfo{$vircurcat}; |
| |
| ToChars($vircat); |
| $threadclass = 'thread'; |
| ( $virboardname, undef ) = split /\|/xsm, $board{$vircurrentboard}, 2; |
| ## hidden threads |
| ToChars($virboardname); |
| if ($mstate =~ /h/i) { |
| } |
| $threadclass = 'hide'; |
| |
| if (!$iamadmin && !$iamgmod && !$iammod) { &fatal_error('no_access'); } |
| ( $cat, $catperms ) = split /\|/xsm, $catinfo{"$curcat"}; |
| } |
| ToChars($cat); |
| ## locked thread |
| |
| elsif ($mstate =~ /l/i) { |
| ( $boardname, $boardperms, $boardview ) = |
| $threadclass = 'locked'; ## same icon regardless |
| split /\|/xsm, $board{$currentboard}; |
| $pollbutton = ''; |
| |
| if ($icanbypass) { $replybutton = $bypassReplyButton; } |
| ToChars($boardname); |
| else { $replybutton = ''; } # squish |
| |
| } |
| # Check to make sure this thread isn't locked. |
| elsif ($mreplies >= $VeryHotTopic) { $threadclass = 'veryhotthread'; } |
| ( |
| elsif ($mreplies >= $HotTopic) { $threadclass = 'hotthread'; } |
| $mnum, $msubthread, $mname, $memail, $mdate, |
| elsif ($mstate eq '') { $threadclass = 'thread'; } |
| $mreplies, $musername, $micon, $mstate |
| |
| ) = split /\|/xsm, $yyThreadLine; |
| if ($threadclass eq 'hide') { ## hidden |
| |
| if ($mstate =~ /s/i && $mstate !~ /l/i) { $threadclass = 'hidesticky'; } |
| if ( $mstate =~ /m/sm ) { |
| elsif ($mstate =~ /l/i && $mstate !~ /s/i) { |
| if ( $msubthread =~ / dest=(\d+)\]/sm ) { |
| $threadclass = 'hidelock'; $pollbutton = ''; |
| my $newnum = $1; |
| if ($icanbypass) { $replybutton = $bypassReplyButton; } |
| } |
| else { $replybutton = ''; } # squish |
| if ( -e "$datadir/$newnum.txt" ) { |
| } |
| $yySetLocation = "$scripturl?num=$newnum"; |
| elsif ($mstate =~ /s/i && $mstate =~ /l/i) { |
| redirectexit(); |
| $threadclass = 'hidestickylock'; $pollbutton = ''; |
| } |
| if ($icanbypass) { $replybutton = $bypassReplyButton; } |
| if ( eval { require Variables::Movedthreads; 1 } ) { |
| else { $replybutton = ''; } # squish |
| while ( exists $moved_file{$newnum} ) { |
| } |
| $newnum = $moved_file{$newnum}; |
| } |
| next if exists $moved_file{$newnum}; |
| elsif ($threadclass eq 'locked' && $mstate =~ /s/i) { |
| if ( -e "$datadir/$newnum.txt" ) { |
| $threadclass = 'stickylock'; |
| $yySetLocation = "$scripturl?num=$newnum"; |
| if ($icanbypass) { $replybutton = $bypassReplyButton; } |
| redirectexit(); |
| else { $replybutton = ''; } # squish |
| } |
| } |
| } |
| elsif ($mstate =~ /s/i) { $threadclass = 'sticky'; } |
| } |
| elsif (${$mnum}{'board'} eq $annboard) { $threadclass = $threadclass eq 'locked' ? 'announcementlock' : 'announcement'; } |
| } |
| |
| |
| if (-e "$datadir/$mnum.mail" && !$iamguest) { |
| ( $msubthread, undef ) = Split_Splice_Move( $msubthread, 0 ); |
| require "$sourcedir/Notify.pl"; |
| ToChars($msubthread); |
| &ManageThreadNotify("update", $mnum, $username, '', '', '1'); |
| $msubthread = Censor($msubthread); |
| } |
| |
| |
| # Build a list of this board's moderators. |
| if ($showmodgroups ne "" && $showmods ne "") { $showmods .= qq~ - ~; } |
| if ( keys %moderators > 0 ) { |
| |
| if ( keys %moderators == 1 ) { $showmods = qq~($display_txt{'298'}: ~; } |
| # Build the page links list. |
| else { $showmods = qq~($display_txt{'63'}: ~; } |
| if (!$iamguest) { |
| |
| (undef, $userthreadpage, undef,undef) = split(/\|/, ${$uid.$username}{'pageindex'}); |
| while ( $_ = each %moderators ) { |
| } |
| FormatUserName($_); |
| my ($pagetxtindex, $pagetextindex, $pagedropindex1, $pagedropindex2, $all, $allselected); |
| $showmods .= QuickLinks( $_, 1 ) . q{, }; |
| $postdisplaynum = 3; # max number of pages to display |
| } |
| $dropdisplaynum = 10; |
| $showmods =~ s/, \Z/)/sm; |
| $startpage = 0; |
| } |
| $max = $mreplies + 1; |
| if ( keys %moderatorgroups > 0 ) { |
| if (substr($INFO{'start'}, 0, 3) eq 'all' && $showpageall != 0) { $maxmessagedisplay = $max; $all = 1; $allselected = qq~ selected="selected"~; $start = !$ttsreverse ? 0 : $mreplies; } |
| if ( keys %moderatorgroups == 1 ) { |
| else { $start = $INFO{'start'} !~ /\d/ ? (!$ttsreverse ? 0 : $mreplies) : $INFO{'start'}; } |
| $showmodgroups = qq~($display_txt{'298a'}: ~; |
| $start = $start > $mreplies ? $mreplies : $start; |
| } |
| $start = !$ttsreverse ? (int($start / $maxmessagedisplay) * $maxmessagedisplay) : (int(($mreplies - $start) / $maxmessagedisplay) * $maxmessagedisplay); |
| else { $showmodgroups = qq~($display_txt{'63a'}: ~; } |
| $tmpa = 1; |
| |
| $pagenumb = int(($max - 1) / $maxmessagedisplay) + 1; |
| my ( $tmpmodgrp, $thismodgrp ); |
| |
| while ( $_ = each %moderatorgroups ) { |
| if ($start >= (($postdisplaynum - 1) * $maxmessagedisplay)) { |
| $tmpmodgrp = $moderatorgroups{$_}; |
| $startpage = $start - (($postdisplaynum - 1) * $maxmessagedisplay); |
| ( $thismodgrp, undef ) = split /\|/xsm, $NoPost{$tmpmodgrp}, 2; |
| $tmpa = int($startpage / $maxmessagedisplay) + 1; |
| $showmodgroups .= qq~$thismodgrp, ~; |
| } |
| } |
| if ($max >= $start + ($postdisplaynum * $maxmessagedisplay)) { $endpage = $start + ($postdisplaynum * $maxmessagedisplay); } |
| $showmodgroups =~ s/, \Z/)/sm; |
| else { $endpage = $max; } |
| } |
| $lastpn = int($mreplies / $maxmessagedisplay) + 1; |
| |
| $lastptn = ($lastpn - 1) * $maxmessagedisplay; |
| ## now we have established credentials, |
| $pageindex1 = qq~<span class="small" style="float: left; height: 21px; margin: 0px; margin-top: 2px;"><img src="$imagesdir/index_togl.gif" border="0" alt="$display_txt{'19'}" title="$display_txt{'19'}" style="vertical-align: middle;" /> $display_txt{'139'}: $pagenumb</span>~; |
| ## can this user bypass locks? |
| $pageindex2 = $pageindex1; |
| ## work out who can bypass locked thread post only if bypass switched on |
| if ($pagenumb > 1 || $all) { |
| if ( $mstate =~ /l/ism ) { |
| if ($userthreadpage == 1 || $iamguest) { |
| if ($bypass_lock_perm) { $icanbypass = checkUserLockBypass(); } |
| $pagetxtindexst = qq~<span class="small" style="float: left; height: 21px; margin: 0px; margin-top: 2px;">~; |
| $enable_quickreply = 0; |
| if (!$iamguest) { $pagetxtindexst .= qq~<a href="$scripturl?num=$viewnum;start=~ . (!$ttsreverse ? $start : $mreplies - $start) . qq~;action=threadpagedrop"><img src="$imagesdir/index_togl.gif" border="0" alt="$display_txt{'19'}" style="vertical-align: middle;" /></a> $display_txt{'139'}: ~; } |
| } |
| else { $pagetxtindexst .= qq~<img src="$imagesdir/index_togl.gif" border="0" alt="" style="vertical-align: middle;" /> $display_txt{'139'}: ~; } |
| |
| if ($startpage > 0) { $pagetxtindex = qq~<a href="$scripturl?num=$viewnum/~ . (!$ttsreverse ? 0 : $mreplies) . qq~" style="font-weight: normal;">1</a> <a href="javascript:void(0);" onclick="ListPages($mnum);">...</a> ~; } |
| my $permdate = permtimer($mnum); |
| if ($startpage == $maxmessagedisplay) { $pagetxtindex = qq~<a href="$scripturl?num=$viewnum/~ . (!$ttsreverse ? 0 : $mreplies) . qq~" style="font-weight: normal;">1</a> ~; } |
| my $display_permalink = |
| for ($counter = $startpage; $counter < $endpage; $counter += $maxmessagedisplay) { |
| qq~<a href="http://$perm_domain/$symlink$permdate/$currentboard/$mnum">$display_txt{'10'}</a>~; |
| $pagetxtindex .= $start == $counter ? qq~<b>$tmpa</b> ~ : qq~<a href="$scripturl?num=$viewnum/~ . (!$ttsreverse ? $counter : ($mreplies - $counter)) . qq~" style="font-weight: normal;">$tmpa</a> ~; |
| |
| $tmpa++; |
| # Look for a poll file for this thread. |
| } |
| if ( AccessCheck( $currentboard, 3 ) eq 'granted' ) { |
| if ($endpage < $max - ($maxmessagedisplay)) { $pageindexadd = qq~<a href="javascript:void(0);" onclick="ListPages($mnum);">...</a> ~; } |
| $pollbutton = |
| if ($endpage != $max) { $pageindexadd .= qq~<a href="$scripturl?num=$viewnum/~ . (!$ttsreverse ? $lastptn : $mreplies - $lastptn) . qq~" style="font-weight: normal;">$lastpn</a>~; } |
| qq~$menusep<a href="$scripturl?action=post;num=$viewnum;virboard=$vircurrentboard;title=AddPoll">$img{'addpoll'}</a>~; |
| $pagetxtindex .= qq~$pageindexadd~; |
| } |
| $pageindex1 = qq~$pagetxtindexst$pagetxtindex</span>~; |
| if ( -e "$datadir/$viewnum.poll" ) { |
| $pageindex2 = $pageindex1; |
| $has_poll = 1; |
| |
| $pollbutton = q{}; |
| } else { |
| } |
| $pagedropindex1 = qq~<span style="float: left; width: 350px; margin: 0px; margin-top: 2px; border: 0px;">~; |
| else { |
| $pagedropindex1 .= qq~<span style="float: left; height: 21px; margin: 0; margin-right: 4px;"><a href="$scripturl?num=$viewnum;start=~ . (!$ttsreverse ? $start : $mreplies - $start) . qq~;action=threadpagetext"><img src="$imagesdir/index_togl.gif" border="0" alt="$display_txt{'19'}" title="$display_txt{'19'}" /></a></span>~; |
| $has_poll = 0; |
| $pagedropindex2 = $pagedropindex1; |
| if ( $useraddpoll == 0 ) { $pollbutton = q{}; } |
| $tstart = $start; |
| } |
| #if (substr($INFO{'start'}, 0, 3) eq "all") { ($tstart, $start) = split(/\-/, $INFO{'start'}); } |
| |
| $d_indexpages = $pagenumb / $dropdisplaynum; |
| # Get the class of this thread, based on lock status and number of replies. |
| $i_indexpages = int($pagenumb / $dropdisplaynum); |
| if ( ( !$iamguest || $enable_guestposting ) |
| if ($d_indexpages > $i_indexpages) { $indexpages = int($pagenumb / $dropdisplaynum) + 1; } |
| && AccessCheck( $currentboard, 2 ) eq 'granted' ) |
| else { $indexpages = int($pagenumb / $dropdisplaynum) } |
| { |
| $selectedindex = int(($start / $maxmessagedisplay) / $dropdisplaynum); |
| my $tmplink = ( |
| |
| $enable_quickreply && $enable_quickjump |
| if ($pagenumb > $dropdisplaynum) { |
| ? 'javascript:document.postmodify.message.focus();' |
| $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~; |
| : qq~$scripturl?action=post;num=$viewnum;virboard=$vircurrentboard;title=PostReply~ |
| $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~; |
| ); |
| } |
| $replybutton = qq~<a href="$tmplink">$img{'reply'}</a>~; |
| |
| $bypassReplyButton = qq~<a href="$tmplink" onclick="return confirm('$display_txt{'posttolocked'}');">$img{'reply'}</a>~; |
| for ($i = 0; $i < $indexpages; $i++) { |
| } |
| $indexpage = !$ttsreverse ? ($i * $dropdisplaynum * $maxmessagedisplay) : ($mreplies - ($i * $dropdisplaynum * $maxmessagedisplay)); |
| |
| $indexstart = ($i * $dropdisplaynum) + 1; |
| $threadclass = 'thread'; |
| $indexend = $indexstart + ($dropdisplaynum - 1); |
| ## hidden threads |
| if ($indexend > $pagenumb) { $indexend = $pagenumb; } |
| if ( $mstate =~ /h/ism ) { |
| if ($indexstart == $indexend) { $indxoption = qq~$indexstart~; } |
| $threadclass = 'hide'; |
| else { $indxoption = qq~$indexstart-$indexend~; } |
| if ( !$staff ) { fatal_error('no_access'); } |
| $selected = ""; |
| } |
| if ($i == $selectedindex) { |
| ## locked thread |
| $selected = qq~ selected="selected"~; |
| elsif ( $mstate =~ /l/ism ) { |
| $pagejsindex = qq~$indexstart|$indexend|$maxmessagedisplay|$indexpage~; |
| $threadclass = 'locked'; ## same icon regardless |
| } |
| $pollbutton = q{}; |
| if ($pagenumb > $dropdisplaynum) { |
| if ($icanbypass) { $replybutton = $bypassReplyButton; } |
| $pagedropindex1 .= qq~<option value="$indexstart|$indexend|$maxmessagedisplay|$indexpage"$selected>$indxoption</option>\n~; |
| else { $replybutton = q{}; } |
| $pagedropindex2 .= qq~<option value="$indexstart|$indexend|$maxmessagedisplay|$indexpage"$selected>$indxoption</option>\n~; |
| } |
| } |
| elsif ( $mreplies >= $VeryHotTopic ) { $threadclass = 'veryhotthread'; } |
| } |
| elsif ( $mreplies >= $HotTopic ) { $threadclass = 'hotthread'; } |
| |
| elsif ( $mstate eq q{} ) { $threadclass = 'thread'; } |
| if ($pagenumb > $dropdisplaynum) { |
| |
| $pagedropindex1 .= qq~</select>\n</span>~; |
| ## stickies |
| $pagedropindex2 .= qq~</select>\n</span>~; |
| if ( $mstate =~ /s/ism ) { |
| } |
| if ( $threadclass eq 'hide' ) { |
| $pagedropindex1 .= qq~<span id="ViewIndex1" class="droppageindex" style="height: 14px; visibility: hidden"> </span>~; |
| if ( $mstate =~ /l/ism ) { |
| $pagedropindex2 .= qq~<span id="ViewIndex2" class="droppageindex" style="height: 14px; visibility: hidden"> </span>~; |
| $threadclass = 'hidestickylock'; |
| $tmpmaxmessagedisplay = $maxmessagedisplay; |
| $pollbutton = q{}; |
| $prevpage = !$ttsreverse ? $start - $tmpmaxmessagedisplay : $mreplies - $start + $tmpmaxmessagedisplay; |
| if ($icanbypass) { $replybutton = $bypassReplyButton; } |
| $nextpage = !$ttsreverse ? $start + $maxmessagedisplay : $mreplies - $start - $maxmessagedisplay; |
| else { $replybutton = q{}; } |
| $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;" />~; |
| else { |
| if ((!$ttsreverse and $start < $maxmessagedisplay) or ($ttsreverse and $prevpage > $mreplies)) { $pagedropindexpv .= qq~<img src="$imagesdir/index_left0.gif" height="14" width="13" border="0" alt="" style="display: inline; vertical-align: middle;" />~; } |
| $threadclass = 'hidesticky'; |
| 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?num=$viewnum/$prevpage\\'" ondblclick="location.href=\\'$scripturl?num=$viewnum/~ . (!$ttsreverse ? 0 : $mreplies) . qq~\\'" />~; } |
| } |
| if ((!$ttsreverse and $nextpage > $lastptn) or ($ttsreverse and $nextpage < $mreplies - $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?num=$viewnum/$nextpage\\'" ondblclick="location.href=\\'$scripturl?num=$viewnum/~ . (!$ttsreverse ? $lastptn : $mreplies - $lastptn) . qq~\\'" />~; } |
| elsif ( $threadclass eq 'thread' ) { $threadclass = 'sticky'; } |
| $pageindex1 = qq~$pagedropindex1</span>~; |
| elsif ( $threadclass eq 'locked' ) { |
| $pageindex2 = qq~$pagedropindex2</span>~; |
| $threadclass = 'stickylock'; |
| |
| if ($icanbypass) { $replybutton = $bypassReplyButton; } |
| $pageindexjs = qq~ |
| else { $replybutton = q{}; } |
| function SelDec(decparam, visel) { |
| } |
| splitparam = decparam.split("|"); |
| } |
| var vistart = parseInt(splitparam[0]); |
| elsif ( $threadclass eq 'hide' && $mstate =~ /l/ism ) { |
| var viend = parseInt(splitparam[1]); |
| $threadclass = 'hidelock'; |
| var maxpag = parseInt(splitparam[2]); |
| $pollbutton = q{}; |
| var pagstart = parseInt(splitparam[3]); |
| if ($icanbypass) { $replybutton = $bypassReplyButton; } |
| //var allpagstart = parseInt(splitparam[3]); |
| else { $replybutton = q{}; } |
| if(visel == 'xx' && decparam == '$pagejsindex') visel = '$tstart'; |
| } |
| var pagedropindex = '<table border="0" cellpadding="0" cellspacing="0"><tr>'; |
| elsif ( ${$mnum}{'board'} eq $annboard ) { |
| for(i=vistart; i<=viend; i++) { |
| $threadclass = |
| 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>'; |
| $threadclass eq 'locked' ? 'announcementlock' : 'announcement'; |
| else pagedropindex += '<td height="14" class="droppages"><a href="$scripturl?num=$viewnum/' + pagstart + '">' + i + '</a></td>'; |
| } |
| pagstart ~ . (!$ttsreverse ? '+' : '-') . qq~= maxpag; |
| |
| } |
| if ( -e "$datadir/$mnum.mail" && !$iamguest ) { |
| ~; |
| require Sources::Notify; |
| if ($showpageall) { |
| ManageThreadNotify( 'update', $mnum, $username, q{}, q{}, '1' ); |
| $pageindexjs .= qq~ |
| } |
| 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 ( $showmodgroups ne q{} && $showmods ne q{} ) { $showmods .= q~ - ~; } |
| else pagedropindex += '<td height="14" class="droppages"><a href="$scripturl?num=$viewnum/all">$pidtxt{'01'}</a></td>'; |
| |
| } |
| # Build the page links list. |
| ~; |
| if ( !$iamguest ) { |
| } |
| ( undef, $userthreadpage, undef, undef ) = |
| $pageindexjs .= qq~ |
| split /\|/xsm, ${ $uid . $username }{'pageindex'}; |
| 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>'; |
| my ( $pagetxtindex, $pagedropindex1, $pagedropindex2, $all, $allselected ); |
| pagedropindex += '</tr></table>'; |
| $postdisplaynum = 3; # max number of pages to display |
| document.getElementById("ViewIndex1").innerHTML=pagedropindex; |
| $dropdisplaynum = 10; |
| document.getElementById("ViewIndex1").style.visibility = "visible"; |
| $startpage = 0; |
| document.getElementById("ViewIndex2").innerHTML=pagedropindex; |
| $max = $mreplies + 1; |
| document.getElementById("ViewIndex2").style.visibility = "visible"; |
| if ( substr( $INFO{'start'}, 0, 3 ) eq 'all' && $showpageall != 0 ) { |
| ~; |
| $maxmessagedisplay = $max; |
| if ($pagenumb > $dropdisplaynum) { |
| $all = 1; |
| $pageindexjs .= qq~ |
| $allselected = q~ selected="selected"~; |
| document.getElementById("decselector1").value = decparam; |
| $start = !$ttsreverse ? 0 : $mreplies; |
| document.getElementById("decselector2").value = decparam; |
| } |
| ~; |
| else { |
| } |
| $start = |
| $pageindexjs .= qq~ |
| $INFO{'start'} !~ /\d/xsm |
| } |
| ? ( !$ttsreverse ? 0 : $mreplies ) |
| SelDec('$pagejsindex', '~ . (!$ttsreverse ? $tstart : ($mreplies - $tstart)) . qq~'); |
| : $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~<span class="small pgindex"><img src="$index_togl{'index_togl'}" alt="$display_txt{'19'}" title="$display_txt{'19'}" /> $display_txt{'139'}: $pagenumb</span>~; |
| |
| $pageindex2 = $pageindex1; |
| |
| if ( $pagenumb > 1 || $all ) { |
| |
| if ( $userthreadpage == 1 || $iamguest ) { |
| |
| $pagetxtindexst = q~<span class="small pgindex">~; |
| |
| if ( !$iamguest ) { |
| |
| $pagetxtindexst .= |
| |
| qq~<a href="$scripturl?num=$viewnum;start=~ |
| |
| . ( !$ttsreverse ? $start : $mreplies - $start ) |
| |
| . qq~;action=threadpagedrop"><img src="$index_togl{'index_togl'}" alt="$display_txt{'19'}" title="$display_txt{'19'}" /></a> $display_txt{'139'}: ~; |
| |
| } |
| |
| else { |
| |
| $pagetxtindexst .= |
| |
| qq~<img src="$index_togl{'index_togl'}" alt="$display_txt{'19'}" title="$display_txt{'19'}" /> $display_txt{'139'}: ~; |
| |
| } |
| |
| if ( $startpage > 0 ) { |
| |
| $pagetxtindex = |
| |
| qq~<a href="$scripturl?num=$viewnum/~ |
| |
| . ( !$ttsreverse ? 0 : $mreplies ) |
| |
| . qq~"><span class="small">1</span></a> <a href="javascript:void(0);" onclick="ListPages($mnum);">...</a> ~; |
| |
| } |
| |
| if ( $startpage == $maxmessagedisplay ) { |
| |
| $pagetxtindex = |
| |
| qq~<a href="$scripturl?num=$viewnum/~ |
| |
| . ( !$ttsreverse ? 0 : $mreplies ) |
| |
| . q~"><span class="small">1</span></a> ~; |
| |
| } |
| |
| foreach my $counter ( $startpage .. ( $endpage - 1 ) ) { |
| |
| if ( $counter % $maxmessagedisplay == 0 ) { |
| |
| $pagetxtindex .= |
| |
| $start == $counter |
| |
| ? qq~<b>[$tmpa]</b> ~ |
| |
| : qq~<a href="$scripturl?num=$viewnum/~ |
| |
| . ( !$ttsreverse ? $counter : ( $mreplies - $counter ) ) |
| |
| . qq~"><span class="small">$tmpa</span></a> ~; |
| |
| $tmpa++; |
| |
| } |
| |
| } |
| |
| if ( $endpage < $max - ($maxmessagedisplay) ) { |
| |
| $pageindexadd = |
| |
| qq~<a href="javascript:void(0);" onclick="ListPages($mnum);">...</a> ~; |
| |
| } |
| |
| if ( $endpage != $max ) { |
| |
| $pageindexadd .= |
| |
| qq~<a href="$scripturl?num=$viewnum/~ |
| |
| . ( !$ttsreverse ? $lastptn : $mreplies - $lastptn ) |
| |
| . qq~"><span class="small">$lastpn</span></a>~; |
| |
| } |
| |
| $pagetxtindex .= qq~$pageindexadd~; |
| |
| $pageindex1 = qq~$pagetxtindexst$pagetxtindex</span>~; |
| |
| $pageindex2 = $pageindex1; |
| |
| |
| |
| } |
| |
| else { |
| |
| $pagedropindex1 = q~<span class="pagedropindex">~; |
| |
| $pagedropindex1 .= |
| |
| qq~<span class="pagedropindex_inner"><a href="$scripturl?num=$viewnum;start=~ |
| |
| . ( !$ttsreverse ? $start : $mreplies - $start ) |
| |
| . qq~;action=threadpagetext"><img src="$index_togl{'index_togl'}" alt="$display_txt{'19'}" title="$display_txt{'19'}" /></a></span>~; |
| |
| $pagedropindex2 = $pagedropindex1; |
| |
| $tstart = $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~<span class="decselector"><select size="1" name="decselector1" id="decselector1" class="decselector_sel" onchange="if(this.options[this.selectedIndex].value) SelDec(this.options[this.selectedIndex].value, 'xx')">\n~; |
| |
| $pagedropindex2 .= |
| |
| qq~<span class="decselector"><select size="1" name="decselector2" id="decselector2" class="decselector_sel" onchange="if(this.options[this.selectedIndex].value) SelDec(this.options[this.selectedIndex].value, 'xx')">\n~; |
| |
| } |
| |
| |
| |
| for my $i ( 0 .. ( $indexpages - 1 ) ) { |
| |
| $indexpage = |
| |
| !$ttsreverse |
| |
| ? ( $i * $dropdisplaynum * $maxmessagedisplay ) |
| |
| : ( |
| |
| $mreplies - ( $i * $dropdisplaynum * $maxmessagedisplay ) ); |
| |
| $indexstart = ( $i * $dropdisplaynum ) + 1; |
| |
| $indexend = $indexstart + ( $dropdisplaynum - 1 ); |
| |
| if ( $indexend > $pagenumb ) { $indexend = $pagenumb; } |
| |
| if ( $indexstart == $indexend ) { |
| |
| $indxoption = qq~$indexstart~; |
| |
| } |
| |
| else { $indxoption = qq~$indexstart-$indexend~; } |
| |
| $selected = q{}; |
| |
| if ( $i == $selectedindex ) { |
| |
| $selected = q~ selected="selected"~; |
| |
| $pagejsindex = |
| |
| qq~$indexstart|$indexend|$maxmessagedisplay|$indexpage~; |
| |
| } |
| |
| if ( $pagenumb > $dropdisplaynum ) { |
| |
| $pagedropindex1 .= |
| |
| qq~<option value="$indexstart|$indexend|$maxmessagedisplay|$indexpage"$selected>$indxoption</option>\n~; |
| |
| $pagedropindex2 .= |
| |
| qq~<option value="$indexstart|$indexend|$maxmessagedisplay|$indexpage"$selected>$indxoption</option>\n~; |
| |
| } |
| |
| } |
| |
| |
| |
| if ( $pagenumb > $dropdisplaynum ) { |
| |
| $pagedropindex1 .= qq~</select>\n</span>~; |
| |
| $pagedropindex2 .= qq~</select>\n</span>~; |
| |
| } |
| |
| $pagedropindex1 .= |
| |
| q~<span id="ViewIndex1" class="droppageindex viewindex_hid"> </span>~; |
| |
| $pagedropindex2 .= |
| |
| q~<span id="ViewIndex2" class="droppageindex viewindex_hid"> </span>~; |
| |
| $tmpmaxmessagedisplay = $maxmessagedisplay; |
| |
| $prevpage = |
| |
| !$ttsreverse |
| |
| ? $start - $tmpmaxmessagedisplay |
| |
| : $mreplies - $start + $tmpmaxmessagedisplay; |
| |
| $nextpage = |
| |
| !$ttsreverse |
| |
| ? $start + $maxmessagedisplay |
| |
| : $mreplies - $start - $maxmessagedisplay; |
| |
| $pagedropindexpvbl = |
| |
| qq~<img src="$index_togl{'index_left0'}" height="14" width="13" alt="" />~; |
| |
| $pagedropindexnxbl = |
| |
| qq~<img src="$index_togl{'index_right0'}" height="14" width="13" alt="" />~; |
| |
| |
| |
| if ( ( !$ttsreverse && $start < $maxmessagedisplay ) |
| |
| or ( $ttsreverse && $prevpage > $mreplies ) ) |
| |
| { |
| |
| $pagedropindexpv .= |
| |
| qq~<img src="$index_togl{'index_left0'}" height="14" width="13" alt="" />~; |
| |
| } |
| |
| else { |
| |
| $pagedropindexpv .= |
| |
| qq~<img src="$index_togl{'index_left'}" height="14" width="13" alt="$pidtxt{'02'}" title="$pidtxt{'02'}" class="cursor" onclick="location.href=\\'$scripturl?num=$viewnum/$prevpage\\'" ondblclick="location.href=\\'$scripturl?num=$viewnum/~ |
| |
| . ( !$ttsreverse ? 0 : $mreplies ) |
| |
| . q~\\'" />~; |
| |
| } |
| |
| if ( ( !$ttsreverse && $nextpage > $lastptn ) |
| |
| or ( $ttsreverse && $nextpage < $mreplies - $lastptn ) ) |
| |
| { |
| |
| $pagedropindexnx .= |
| |
| qq~<img src="$index_togl{'index_right0'}" height="14" width="13" alt="" />~; |
| |
| } |
| |
| else { |
| |
| $pagedropindexnx .= |
| |
| qq~<img src="$index_togl{'index_right'}" height="14" width="13" alt="$pidtxt{'03'}" title="$pidtxt{'03'}" class="cursor" onclick="location.href=\\'$scripturl?num=$viewnum/$nextpage\\'" ondblclick="location.href=\\'$scripturl?num=$viewnum/~ |
| |
| . ( !$ttsreverse ? $lastptn : $mreplies - $lastptn ) |
| |
| . q~\\'" />~; |
| |
| } |
| |
| $pageindex1 = qq~$pagedropindex1</span>~; |
| |
| $pageindex2 = qq~$pagedropindex2</span>~; |
| |
| |
| |
| $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 = '$visel_0'; |
| |
| for(i=vistart; i<=viend; i++) { |
| |
| if(visel == pagstart) pagedropindex += '$visel_1a<b>' + i + '</b>$visel_1b'; |
| |
| else pagedropindex += '$visel_2a<a href="$scripturl?num=$viewnum/' + pagstart + '">' + i + '</a>$visel_1b'; |
| |
| pagstart ~ . ( !$ttsreverse ? q{+} : q{-} ) . q~= maxpag; |
| |
| } |
| |
| ~; |
| |
| if ($showpageall) { |
| |
| $pageindexjs .= qq~ |
| |
| if (vistart != viend) { |
| |
| if(visel == 'all') pagedropindex += '$visel_1a<b>$pidtxt{'01'}</b>$visel_1b'; |
| |
| else pagedropindex += '$visel_2a<a href="$scripturl?num=$viewnum/all">$pidtxt{'01'}</a>$visel_1b'; |
| |
| } |
| |
| ~; |
| |
| } |
| |
| $pageindexjs .= qq~ |
| |
| if(visel != 'xx') pagedropindex += '$visel_3a$pagedropindexpv$pagedropindexnx$visel_1b'; |
| |
| else pagedropindex += '$visel_3a$pagedropindexpvbl$pagedropindexnxbl$visel_1b'; |
| |
| pagedropindex += '$visel_4'; |
| |
| document.getElementById("ViewIndex1").innerHTML=pagedropindex; |
| |
| document.getElementById("ViewIndex1").style.visibility = "visible"; |
| |
| document.getElementById("ViewIndex2").innerHTML=pagedropindex; |
| |
| document.getElementById("ViewIndex2").style.visibility = "visible"; |
| |
| ~; |
| |
| if ( $pagenumb > $dropdisplaynum ) { |
| |
| $pageindexjs .= q~ |
| |
| document.getElementById("decselector1").value = decparam; |
| |
| document.getElementById("decselector2").value = decparam; |
| |
| ~; |
| |
| } |
| |
| $pageindexjs .= qq~ |
| |
| } |
| |
| SelDec('$pagejsindex', '~ |
| |
| . ( !$ttsreverse ? $tstart : ( $mreplies - $tstart ) ) . q~'); |
| ~; |
| ~; |
| } |
| } |
| } |
| } |
| |
| |
| if (!$iamguest) { |
| if ( !$iamguest ) { |
| $yyjavascript .= qq~ |
| my $addnotlink = $img{'add_notify'}; |
| var addnotlink = '$img{'add_notify'}'; |
| my $remnotlink = $img{'del_notify'}; |
| var remnotlink = '$img{'del_notify'}'; |
| if ($useThreadtools) { |
| ~; |
| $addnotlink =~ s/\[tool=(.+?)\](.+?)\[\/tool\]/$2/gsm; |
| if (${$uid.$username}{'thread_notifications'} =~ /\b$viewnum\b/) { |
| $remnotlink =~ s/\[tool=(.+?)\](.+?)\[\/tool\]/$2/gsm; |
| $notify = qq~$menusep<a href="javascript:Notify('$scripturl?action=notify3;num=$viewnum/~ . (!$ttsreverse ? $start : $mreplies - $start) . qq~','$imagesdir')" name="notifylink">$img{'del_notify'}</a>~; |
| } |
| } else { |
| $yyjavascript .= qq~ |
| $notify = qq~$menusep<a href="javascript:Notify('$scripturl?action=notify2;num=$viewnum/~ . (!$ttsreverse ? $start : $mreplies - $start) . qq~','$imagesdir')" name="notifylink">$img{'add_notify'}</a>~; |
| var addnotlink = '$addnotlink'; |
| } |
| var remnotlink = '$remnotlink'; |
| } |
| ~; |
| |
| |
| $yymain .= qq~ |
| if ( |
| <script language="JavaScript1.2" src="$yyhtml_root/ajax.js" type="text/javascript"></script> |
| ${ $uid . $username }{'thread_notifications'} =~ /\b$viewnum\b/xsm ) |
| <script language="JavaScript1.2" src="$yyhtml_root/ubbc.js" type="text/javascript"></script> |
| { |
| ~; |
| $notify = |
| |
| qq~$menusep<a href="javascript:Notify('$scripturl?action=notify3;num=$viewnum/~ |
| # update the .ctb file START |
| . ( !$ttsreverse ? $start : $mreplies - $start ) |
| &MessageTotals("load", $viewnum); |
| . qq~','$imagesdir')" id="notifylink">$img{'del_notify'}</a>~; |
| if ($username ne "Guest") { |
| $notify2 = |
| my (%viewer,@tmprepliers,$isrep); |
| qq~$menusep<a href="javascript:Notify('$scripturl?action=notify3;num=$viewnum/~ |
| foreach (@logentries) { # @logentries already loaded in YaBB.pl => &WriteLog; |
| . ( !$ttsreverse ? $start : $mreplies - $start ) |
| $viewer{(split(/\|/, $_, 2))[0]} = 1; |
| . qq~','$imagesdir')" id="notifylink2">$img{'del_notify'}</a>~; |
| } |
| } |
| |
| else { |
| my $j = 0; |
| $notify = |
| foreach (@repliers) { |
| qq~$menusep<a href="javascript:Notify('$scripturl?action=notify2;num=$viewnum/~ |
| my ($reptime, $repuser, $isreplying) = split(/\|/, $_); |
| . ( !$ttsreverse ? $start : $mreplies - $start ) |
| next if $date - $reptime > 600 || !exists $viewer{$repuser}; |
| . qq~','$imagesdir')" id="notifylink">$img{'add_notify'}</a>~; |
| if ($repuser eq $username) { $tmprepliers[$j] = qq~$date|$repuser|0~; $isrep = 1; } |
| $notify2 = |
| else { $tmprepliers[$j] = qq~$reptime|$repuser|$isreplying~; } |
| qq~$menusep<a href="javascript:Notify('$scripturl?action=notify2;num=$viewnum/~ |
| $j++; |
| . ( !$ttsreverse ? $start : $mreplies - $start ) |
| } |
| . qq~','$imagesdir')" id="notifylink2">$img{'add_notify'}</a>~; |
| push(@tmprepliers, qq~$date|$username|0~) if !$isrep; |
| |
| @repliers = @tmprepliers; |
| } |
| |
| } |
| ${$viewnum}{'views'}++; # Add 1 to the number of views of this thread. |
| |
| &MessageTotals("update", $viewnum); |
| |
| } else { |
| # update the .ctb file START |
| &MessageTotals("incview", $viewnum); # Add 1 to the number of views of this thread. |
| MessageTotals( 'load', $viewnum ); |
| } |
| if ( $username ne 'Guest' ) { |
| # update the .ctb file END |
| my ( %viewer, @tmprepliers, $isrep ); |
| |
| foreach (@logentries) |
| # Mark current board as read if no other new threads are in |
| { # @logentries already loaded in YaBB.pl => &WriteLog; |
| &getlog; |
| $viewer{ ( split /\|/xsm, $_, 2 )[0] } = 1; |
| # &NextPrev => Insert Navigation Bit and get info about number of threads newer than last visit |
| } |
| if (&NextPrev($viewnum, $yyuserlog{$currentboard}) < 2) { $yyuserlog{$currentboard} = $date; } |
| |
| # Mark current thread as read. Save thread and board Mark. |
| my $j = 0; |
| delete $yyuserlog{"$mnum--unread"}; |
| foreach (@repliers) { |
| &dumplog($mnum); |
| my ( $reptime, $repuser, $isreplying ) = split /\|/xsm, $_; |
| |
| next if $date - $reptime > 600 || !exists $viewer{$repuser}; |
| $template_home = qq~<a href="$scripturl" class="nav">$mbname</a>~; |
| if ( $repuser eq $username ) { |
| $topviewers = 0; |
| $tmprepliers[$j] = qq~$date|$repuser|0~; |
| if (${$uid.$currentboard}{'ann'} == 1) { |
| $isrep = 1; |
| if ($vircurrentboard) { |
| } |
| $template_cat = qq~<a href="$scripturl?catselect=$vircurcat">$vircat</a>~; |
| else { $tmprepliers[$j] = qq~$reptime|$repuser|$isreplying~; } |
| $template_board = qq~<a href="$scripturl?board=$vircurrentboard">$virboardname</a>~; |
| $j++; |
| $navback = qq~<a href="$scripturl?board=$vircurrentboard">‹ $maintxt{'board'}</a>~; |
| } |
| $template_mods = qq~$showmods$showmodgroups~; |
| if ( !$isrep ) { push @tmprepliers, qq~$date|$username|0~; } |
| } elsif ($iamadmin || $iamgmod) { |
| @repliers = @tmprepliers; |
| $template_cat = qq~<a href="$scripturl?catselect=$curcat">$cat</a>~; |
| |
| $template_board = qq~<a href="$scripturl?board=$currentboard">$boardname</a>~; |
| ${$viewnum}{'views'}++; # Add 1 to the number of views of this thread. |
| $navback = qq~<a href="$scripturl?board=$currentboard">‹ $maintxt{'board'}</a>~; |
| MessageTotals( 'update', $viewnum ); |
| $template_mods = qq~$showmods$showmodgroups~; |
| } |
| } else { |
| else { |
| $template_cat = $maintxt{'418'}; |
| MessageTotals( 'incview', $viewnum ); |
| $template_board = $display_txt{'999'}; |
| |
| $template_mods = ''; |
| # Add 1 to the number of views of this thread. |
| } |
| } |
| } else { |
| |
| $template_cat = qq~<a href="$scripturl?catselect=$curcat">$cat</a>~; |
| # update the .ctb file END |
| $template_board = qq~<a href="$scripturl?board=$currentboard">$boardname</a>~; |
| |
| $navback = qq~<a href="$scripturl?board=$currentboard">‹ $maintxt{'board'}</a>~; |
| # Mark current board as read if no other new threads are in |
| $template_mods = qq~$showmods$showmodgroups~; |
| getlog(); |
| } |
| |
| if ($showtopicviewers && ($iamadmin || $iamgmod || $iammod) && $sessionvalid == 1) { |
| # &NextPrev => Insert Navigation Bit and get info about number of threads newer than last visit |
| my ($mrepuser, $misreplying, $replying); |
| if ( NextPrev( $viewnum, $yyuserlog{$currentboard} ) < 2 ) { |
| foreach (@repliers) { |
| $yyuserlog{$currentboard} = $date; |
| (undef, $mrepuser, $misreplying) = split(/\|/, $_); |
| } |
| &LoadUser($mrepuser); |
| |
| $replying = $misreplying ? qq~ <span class="small">($display_txt{'645'})</span>~ : ''; |
| # Mark current thread as read. Save thread and board Mark. |
| $template_viewers .= qq~$link{$mrepuser}$replying, ~; |
| delete $yyuserlog{"$mnum--unread"}; |
| $topviewers++; |
| dumplog($mnum); |
| } |
| |
| $template_viewers =~ s/\, \Z/\./; |
| $template_home = qq~<a href="$scripturl" class="nav">$mbname</a>~; |
| } |
| $topviewers = 0; |
| |
| if ( ${ $uid . $currentboard }{'ann'} == 1 ) { |
| $yyjavascript .= qq~ |
| if ($vircurrentboard) { |
| var addfavlang = '$display_txt{'526'}'; |
| $template_cat = |
| var remfavlang = '$display_txt{'527'}'; |
| qq~<a href="$scripturl?catselect=$vircurcat">$vircat</a>~; |
| var remnotelang = '$display_txt{'530'}'; |
| $template_board = |
| var addnotelang = '$display_txt{'529'}'; |
| qq~<a href="$scripturl?board=$vircurrentboard">$virboardname</a>~; |
| var markfinishedlang = '$display_txt{'528'}';~; |
| $navback = |
| |
| qq~<a href="$scripturl?board=$vircurrentboard">‹ $maintxt{'board'}</a>~; |
| if (!$iamguest && $currentboard ne $annboard) { |
| $template_mods = qq~$showmods$showmodgroups~; |
| require "$sourcedir/Favorites.pl"; |
| } |
| $template_favorite = &IsFav($viewnum, (!$ttsreverse ? $start : $mreplies - $start)); |
| elsif ( $iamadmin || $iamgmod || $iamfmod ) { |
| } |
| $template_cat = qq~<a href="$scripturl?catselect=$curcat">$cat</a>~; |
| $template_threadimage = qq~<a name="top"><img src="$imagesdir/$threadclass.gif" style="vertical-align: middle;" alt="" /></a>~; |
| $template_board = |
| $template_sendtopic = $sendtopicmail ? qq~$menusep<a href="javascript:sendtopicmail($sendtopicmail);">$img{'sendtopic'}</a>~ : ''; |
| qq~<a href="$scripturl?board=$currentboard">$boardname</a>~; |
| $template_print = qq~$menusep<a href="$scripturl?action=print;num=$viewnum" target="_blank">$img{'print'}</a>~; |
| $navback = |
| if ($has_poll) { require "$sourcedir/Poll.pl"; &display_poll($viewnum); $template_pollmain = qq~$pollmain<br />~; } |
| qq~<a href="$scripturl?board=$currentboard">‹ $maintxt{'board'}</a>~; |
| |
| $template_mods = qq~$showmods$showmodgroups~; |
| # Load background color list. |
| } |
| @cssvalues = ('windowbg', 'windowbg2'); |
| else { |
| $cssnum = @cssvalues; |
| $template_cat = $maintxt{'418'}; |
| |
| $template_board = $display_txt{'999'}; |
| if (!$UseMenuType) { $sm = 1; } |
| $template_mods = q{}; |
| |
| } |
| unless (ref($thread_arrayref{$viewnum})) { |
| } |
| fopen(MSGTXT, "$datadir/$viewnum.txt") || &fatal_error("cannot_open","$datadir/$viewnum.txt", 1); |
| else { |
| @{$thread_arrayref{$viewnum}} = <MSGTXT>; |
| $template_cat = qq~<a href="$scripturl?catselect=$curcat">$cat</a>~; |
| fclose(MSGTXT); |
| $template_board = |
| } |
| qq~<a href="$scripturl?board=$currentboard">$boardname</a>~; |
| $counter = 0; |
| $navback = |
| my @messages; |
| qq~<a href="$scripturl?board=$currentboard">‹ $maintxt{'board'}</a>~; |
| # Skip the posts in this thread until we reach $start. |
| $template_mods = qq~$showmods$showmodgroups~; |
| if (!$ttsreverse) { |
| } |
| foreach (@{$thread_arrayref{$viewnum}}) { |
| if ( $showtopicviewers |
| if ($counter >= $start and $counter < ($start + $maxmessagedisplay)) { push(@messages, $_); } |
| && ($staff) |
| $counter++; |
| && $sessionvalid == 1 ) |
| } |
| { |
| $counter = $start; |
| foreach (@repliers) { |
| |
| my ( undef, $mrepuser, $misreplying ) = split /\|/xsm, $_; |
| } else { |
| LoadUser($mrepuser); |
| foreach (@{$thread_arrayref{$viewnum}}) { |
| my $replying = |
| if ($counter > ($mreplies - $start - $maxmessagedisplay) and $counter <= ($mreplies - $start)) { push(@messages, $_); } |
| $misreplying |
| $counter++; |
| ? qq~ <span class="small">($display_txt{'645'})</span>~ |
| } |
| : q{}; |
| $counter = $mreplies - $start; |
| $template_viewers .= qq~$link{$mrepuser}$replying, ~; |
| @messages = reverse(@messages); |
| $topviewers++; |
| } |
| } |
| |
| $template_viewers =~ s/\, \Z/\./sm; |
| # For each post in this thread: |
| } |
| my (%attach_gif,%attach_count,$movedflag); |
| |
| foreach (@messages) { |
| $yyjavascript .= qq~ |
| my ($userlocation, $aimad, $yimad, $msnad, $gtalkad, $skypead, $myspacead, $facebookad, $icqad, $buddyad, $addbuddy, $isbuddy, $addbuddylink, $userOnline, $signature_hr, $lastmodified, $memberinfo, $template_postinfo, $template_ext_prof, $template_profile, $template_quote, $template_email, $template_www, $template_pm); |
| var addfavlang = '$display_txt{'526'}'; |
| |
| var remfavlang = '$display_txt{'527'}'; |
| $css = $cssvalues[($counter % $cssnum)]; |
| var remnotelang = '$display_txt{'530'}'; |
| ($msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $postmessage, $ns, $mlm, $mlmb, $mfn) = split(/[\|]/, $_); |
| var addnotelang = '$display_txt{'529'}'; |
| |
| var markfinishedlang = '$display_txt{'528'}';~; |
| # If the user isn't a guest, load their info. |
| |
| if ($musername ne 'Guest' && !$yyUDLoaded{$musername} && -e ("$memberdir/$musername.vars")) { |
| if ( !$iamguest && $currentboard ne $annboard ) { |
| my $tmpns = $ns; |
| require Sources::Favorites; |
| $ns = ""; |
| $template_favorite = |
| &LoadUserDisplay($musername); |
| IsFav( $viewnum, ( !$ttsreverse ? $start : $mreplies - $start ) ); |
| $ns = $tmpns; |
| $template_favorite2 = |
| } |
| IsFav1( $viewnum, ( !$ttsreverse ? $start : $mreplies - $start ) ); |
| $messagedate = $mdate; |
| } |
| if (${$uid.$musername}{'regtime'}) { |
| $template_threadimage = qq~$micon{$threadclass}~; |
| $registrationdate = ${$uid.$musername}{'regtime'}; |
| $template_sendtopic = |
| } else { |
| $sendtopicmail |
| $registrationdate = $date; |
| ? qq~$menusep<a href="javascript:sendtopicmail($sendtopicmail);">$img{'sendtopic'}</a>~ |
| } |
| : q{}; |
| |
| $template_print = |
| # Do we have an attachment file? |
| qq~$menusep<a href="javascript:void(window.open('$scripturl?action=print;num=$viewnum','printwindow'))">$img{'print'}</a>~; |
| chomp $mfn; |
| if ($has_poll) { |
| $attachment = ''; |
| require Sources::Poll; |
| $showattach = ''; |
| display_poll($viewnum); |
| $showattachhr = ''; |
| $template_pollmain = $pollmain; |
| if ($mfn ne '') { |
| } |
| # store all downloadcounts in variable |
| |
| if (!%attach_count) { |
| # Load background color list. |
| my ($atfile,$atcount); |
| @cssvalues = qw( windowbg windowbg2 ); |
| fopen(ATM, "$vardir/attachments.txt"); |
| $cssnum = @cssvalues; |
| while (<ATM>) { |
| |
| (undef, undef, undef, undef, undef, undef, undef, $atfile, $atcount) =split(/\|/, $_); |
| if ( !$UseMenuType ) { $sm = 1; } |
| $attach_count{$atfile} = $atcount; |
| |
| } |
| if ( !ref $thread_arrayref{$viewnum} ) { |
| fclose(ATM); |
| fopen( MSGTXT, "$datadir/$viewnum.txt" ) |
| $attach_count{'no_attachments'} = 1 if !%attach_count; |
| or fatal_error( 'cannot_open', "$datadir/$viewnum.txt", 1 ); |
| } |
| @{ $thread_arrayref{$viewnum} } = <MSGTXT>; |
| |
| fclose(MSGTXT); |
| foreach (split(/,/, $mfn)) { |
| } |
| $_ =~ /\.(.+?)$/; |
| $counter = 0; |
| my $ext = lc($1); |
| my @messages; |
| unless (exists $attach_gif{$ext}) { |
| |
| $attach_gif{$ext} = ($ext && -e "$forumstylesdir/$useimages/$ext.gif") ? "$ext.gif" : "paperclip.gif"; |
| # Skip the posts in this thread until we reach $start. |
| } |
| if ( !$ttsreverse ) { |
| my $filesize = -s "$uploaddir/$_"; |
| foreach ( @{ $thread_arrayref{$viewnum} } ) { |
| $urlname = $_; |
| if ( $counter >= $start |
| $urlname =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg; |
| and $counter < ( $start + $maxmessagedisplay ) ) |
| if ($filesize) { |
| { |
| if ($_ =~ /\.(bmp|jpe|jpg|jpeg|gif|png)$/i && $amdisplaypics == 1) { |
| push @messages, $_; |
| $showattach .= qq~<div class="small" style="float:left; margin:8px;"><a href="$scripturl?action=downloadfile;file=$urlname" target="_blank"><img src="$imagesdir/$attach_gif{$ext}" border="0" align="bottom" alt="" /> $_</a> (~ . int($filesize / 1024) . qq~ KB | <acronym title='$attach_count{$_} $fatxt{'41a'}' class="small">$attach_count{$_}</acronym> )<br />~ . ($img_greybox ? ($img_greybox == 2 ? qq~<a href="$scripturl?action=downloadfile;file=$urlname" rel="gb_imageset[nice_pics]" title="$_">~ : qq~<a href="$scripturl?action=downloadfile;file=$urlname" rel="gb_image[nice_pics]" title="$_">~) : qq~<a href="$scripturl?action=downloadfile;file=$urlname" target="_blank">~) . qq~<img src="$uploadurl/$_" name="attach_img_resize" alt="$_" title="$_" border="0" style="display:none" /></a></div>\n~; |
| } |
| } else { |
| $counter++; |
| $attachment .= qq~<div class="small"><a href="$scripturl?action=downloadfile;file=$urlname"><img src="$imagesdir/$attach_gif{$ext}" border="0" align="bottom" alt="" /> $_</a> (~ . int($filesize / 1024) . qq~ KB | <acronym title='$attach_count{$_} $fatxt{'41a'}' class="small">$attach_count{$_}</acronym> )</div>~; |
| } |
| } |
| $counter = $start; |
| } else { |
| |
| $attachment .= qq~<div class="small"><img src="$imagesdir/$attach_gif{$ext}" border="0" align="bottom" alt="" /> $_ ($fatxt{'1'}~ . (exists $attach_count{$_} ? qq~ | <acronym title='$attach_count{$_} $fatxt{'41a'}' class="small">$attach_count{$_}</acronym> ~ : '') . qq~)</div>~; |
| } |
| } |
| else { |
| } |
| foreach ( @{ $thread_arrayref{$viewnum} } ) { |
| $showattachhr = qq~<hr width="100%" size="1" class="hr" style="margin: 0; margin-top: 5px; margin-bottom: 5px; padding: 0;" />~; |
| if ( $counter > ( $mreplies - $start - $maxmessagedisplay ) |
| if ($showattach && $attachment) { |
| and $counter <= ( $mreplies - $start ) ) |
| $attachment =~ s/<div class="small">/<div class="small" style="margin:8px;">/g; |
| { |
| } |
| push @messages, $_; |
| } |
| } |
| |
| $counter++; |
| # Should we show "last modified by?" |
| } |
| if ($showmodify && $mlm ne '' && $mlmb ne '' && (!$tllastmodflag || ($mdate + ($tllastmodtime * 60)) < $mlm)) { |
| $counter = $mreplies - $start; |
| &LoadUser($mlmb); |
| @messages = reverse @messages; |
| $mlmb = ${$uid.$mlmb}{'realname'} || $display_txt{'470'}; |
| } |
| $lastmodified = qq~« <i>$display_txt{'211'}: ~ . &timeformat($mlm) . qq~ $display_txt{'525'} $mlmb</i> »~; |
| |
| } |
| if ( !$allowpics |
| |
| || !$showuserpic |
| $messdate = &timeformat($mdate); |
| || ( ${ $uid . $username }{'hide_avatars'} && $user_hide_avatars ) ) |
| if ($iamadmin || $iamgmod && $gmod_access2{'ipban2'} eq "on") { $mip = $mip } |
| { |
| else { $mip = $display_txt{'511'}; } |
| $hideavatar = 1; |
| |
| } |
| ## moderator alert button! |
| if ( !$showusertext |
| if ($PMenableAlertButton && $PM_level && !$iamadmin && !$iamgmod && !$iammod && (!$iamguest || ($iamguest && $PMAlertButtonGuests))) { |
| || ( ${ $uid . $username }{'hide_user_text'} && $user_hide_user_text ) ) |
| $PMAlertButton = qq~$menusep<a href="$scripturl?action=modalert;num=$viewnum;title=PostReply;quote=$counter" onclick="return confirm('$display_txt{'alertmod_confirm'}');">$img{'alertmod'}</a>~; |
| { |
| } |
| $hideusertext = 1; |
| ## is member a buddy of mine? |
| } |
| if ($buddyListEnabled && !$iamguest && $musername ne $username) { |
| if ( ${ $uid . $username }{'hide_attach_img'} && $user_hide_attach_img ) { |
| $isbuddy = qq~<br /><img src="$imagesdir/buddylist.gif" border="0" align="middle" alt="$display_txt{'isbuddy'}" title="$display_txt{'isbuddy'}" /> <br />$display_txt{'isbuddy'}~; |
| $hideattachimg = 1; |
| $addbuddylink = qq~$menusep<a href="$scripturl?num=$viewnum;action=addbuddy;name=$useraccount{$musername};vpost=$counter">$img{'addbuddy'}</a>~; |
| } |
| } |
| if ( ( ${ $uid . $username }{'hide_signat'} && $user_hide_signat ) |
| |
| || ( $hide_signat_for_guests && $iamguest ) ) |
| # user is current / admin / gmod |
| { |
| if ((${$uid.$musername}{'regdate'} && $messagedate > $registrationdate) || ${$uid.$musername}{'position'} eq 'Administrator' || ${$uid.$musername}{'position'} eq 'Global Moderator') { |
| $hidesignat = 1; |
| if (!$iamguest && $musername ne $username) { |
| } |
| ## check whether user is a buddy |
| |
| if ($mybuddie{$musername}) { $buddyad = $isbuddy; } |
| # For each post in this thread: |
| else { $addbuddy = $addbuddylink; } |
| my ( %attach_gif, %attach_count ); |
| # Allow instant message sending if current user is a member. |
| my $movedflag = q{}; |
| &CheckUserPM_Level($musername); |
| foreach (@messages) { |
| if ($PM_level == 1 || ($PM_level == 2 && $UserPM_Level{$musername} > 1 && ($iamadmin || $iamgmod || $iammod)) || ($PM_level == 3 && $UserPM_Level{$musername} == 3 && ($iamadmin || $iamgmod))) { |
| my ( |
| $template_pm = qq~$menusep<a href="$scripturl?action=imsend;to=$useraccount{$musername}">$img{'message_sm'}</a>~; |
| $userlocation, $aimad, $yimad, |
| } |
| $gtalkad, $skypead, $myspacead, |
| } |
| $facebookad, $twitterad, $youtubead, |
| |
| $icqad, $buddyad, $addbuddy, |
| $tmppostcount = &NumberFormat(${$uid.$musername}{'postcount'}); |
| $isbuddy, $addbuddylink, $userOnline, |
| $template_postinfo = qq~$display_txt{'21'}: $tmppostcount<br />~; |
| $signature_hr, $lastmodified, $memberinfo, |
| $template_profile = ($profilebutton && !$iamguest) ? qq~$menusep<a href="$scripturl?action=viewprofile;username=$useraccount{$musername}">$img{'viewprofile_sm'}</a>~ : ''; |
| $template_postinfo, $template_ext_prof, $template_profile, |
| $template_www = ${$uid.$musername}{'weburl'} ? qq~$menusep${$uid.$musername}{'weburl'}~ : ''; |
| $template_quote, $template_email, $template_www, |
| |
| $template_pm, $template_age, $template_regdate |
| $userOnline = &userOnLineStatus($musername) . "<br />"; |
| ); |
| $displayname = ${$uid.$musername}{'realname'}; |
| |
| if (${$uid.$musername}{'location'}) { |
| $css = $cssvalues[ ( $counter % $cssnum ) ]; |
| $userlocation = ${$uid.$musername}{'location'} . "<br />"; |
| ( |
| } |
| $msub, $mname, $memail, $mdate, $musername, |
| $signature_hr = qq~<hr width="100%" size="1" class="hr" style="margin: 0; margin-top: 5px; margin-bottom: 5px; padding: 0;" />~ if ${$uid.$musername}{'signature'}; |
| $micon, $mattach, $mip, $postmessage, $ns, |
| $memberinfo = "$memberinfo{$musername}$addmembergroup{$musername}"; |
| $mlm, $mlmb, $mfn |
| |
| ) = split /[\|]/xsm, $_; |
| $aimad = ${$uid.$musername}{'aim'} ? qq~$menusep${$uid.$musername}{'aim'}~ : ''; |
| |
| $memailad = ${ $uid . $musername }{'email'} ? qq~$menusep${$uid.$musername}{'email'}~ : q{}; |
| # If the user isn't a guest, load their info. |
| $icqad = ${$uid.$musername}{'icq'} ? qq~$menusep${$uid.$musername}{'icq'}~ : ''; |
| if ( $musername ne 'Guest' |
| $yimad = ${$uid.$musername}{'yim'} ? qq~$menusep${$uid.$musername}{'yim'}~ : ''; |
| && !$yyUDLoaded{$musername} |
| $msnad = ${$uid.$musername}{'msn'} ? qq~$menusep${$uid.$musername}{'msn'}~ : ''; |
| && -e ("$memberdir/$musername.vars") ) |
| $gtalkad = ${$uid.$musername}{'gtalk'} ? qq~$menusep${$uid.$musername}{'gtalk'}~ : ''; |
| { |
| $skypead = ${$uid.$musername}{'skype'} ? qq~$menusep${$uid.$musername}{'skype'}~ : ''; |
| my $tmpns = $ns; |
| $myspacead = ${$uid.$musername}{'myspace'} ? qq~$menusep${$uid.$musername}{'myspace'}~ : ''; |
| $ns = q{}; |
| $facebookad = ${$uid.$musername}{'facebook'} ? qq~$menusep${$uid.$musername}{'facebook'}~ : ''; |
| LoadUserDisplay($musername); |
| |
| $ns = $tmpns; |
| $usernamelink = &QuickLinks($musername); |
| } |
| if ($extendedprofiles) { |
| $messagedate = $mdate; |
| require "$sourcedir/ExtendedProfiles.pl"; |
| if ( ${ $uid . $musername }{'regtime'} ) { |
| $usernamelink = &ext_viewinposts_popup($musername,$usernamelink); |
| $registrationdate = ${ $uid . $musername }{'regtime'}; |
| } |
| } |
| } elsif ($musername !~ m~Guest~ && $messagedate < $registrationdate) { |
| else { |
| $exmem = 1; |
| $registrationdate = $date; |
| $memberinfo = $display_txt{'470a'}; |
| } |
| $usernamelink = qq~<b>$mname</b>~; |
| |
| $displayname = $display_txt{'470a'}; |
| # Do we have an attachment file? |
| } else { |
| chomp $mfn; |
| require "$sourcedir/Decoder.pl"; |
| $attachment = q{}; |
| $musername = 'Guest'; |
| $showattach = q{}; |
| $memberinfo = $display_txt{'28'}; |
| $showattachhr = q{}; |
| $usernamelink = qq~<b>$mname</b>~; |
| if ( $mfn ne q{} ) { |
| $displayname = $mname; |
| |
| $cryptmail = &scramble($memail, $musername); |
| # store all downloadcounts in variable |
| } |
| if ( !%attach_count ) { |
| $usernames_life_quote{$useraccount{$musername}} = $displayname; # for display names in Quotes in LivePreview |
| fopen( ATM, "$vardir/attachments.txt" ); |
| |
| while (<ATM>) { |
| # Insert 2 |
| chomp $_; |
| if ((!${$uid.$musername}{'hidemail'} || $iamadmin || $allow_hide_email != 1 || $musername eq 'Guest') && !$exmem) { |
| my ( |
| if ($musername ne 'Guest') {$template_email = $menusep . enc_eMail($img{'email_sm'},$memailad,q{},q{});} |
| undef, undef, undef, undef, undef, |
| else {$template_email = $menusep . enc_eMail($img{'email_sm'},$memail,q{},q{});} |
| undef, undef, $atfile, $atcount |
| if ( $iamadmin) { |
| ) = split /\|/xsm, $_; |
| if ($musername ne 'Guest') { $template_email =~ s~title=\\"$img_txt{'69'}\\"~title=\\"$memailad\\"~; } |
| $attach_count{$atfile} = $atcount; |
| else { $template_email =~ s~title=\\"$img_txt{'69'}\\"~title=\\"$memail\\"~;} |
| } |
| } |
| fclose(ATM); |
| } |
| if ( !%attach_count ) { $attach_count{'no_attachments'} = 1; } |
| if ($iamguest) { $template_email = ''; } |
| } |
| |
| |
| $counterwords = $counter != 0 ? "$display_txt{'146'} #$counter - " : ""; |
| foreach ( split /,/xsm, $mfn ) { |
| |
| if ( $_ =~ /\.(.+?)$/xsm ) { |
| # Print the post and user info for the poster. |
| $ext = lc $1; |
| my $outblock = $messageblock; |
| } |
| my $posthandelblock = $posthandellist; |
| if ( !exists $attach_gif{$ext} ) { |
| my $contactblock = $contactlist; |
| $attach_gif{$ext} = |
| |
| ( $att_img{$ext} |
| ($msub, undef) = &Split_Splice_Move($msub,0); |
| && -e "$htmldir/Templates/Forum/$useimages/$att_img{$ext}" |
| $msub ||= $display_txt{'24'}; |
| ) |
| &ToChars($msub); |
| ? "$imagesdir/$att_img{$ext}" |
| $msub = &Censor($msub); |
| : "$micon_bg{'paperclip'}"; |
| |
| } |
| $message = &Censor($postmessage); |
| my $filesize = -s "$uploaddir/$_"; |
| &wrap; |
| $urlname = $_; |
| ($message,$movedflag) = &Split_Splice_Move($message,$viewnum); |
| $urlname =~ s/([^A-Za-z0-9])/sprintf('%%%02X', ord($1))/egxsm; |
| if ($enable_ubbc) { |
| $download_txt = ( $attach_count{$_} == 1 ) ? $fatxt{'41b'} : isempty( $fatxt{'41c'}, $fatxt{'41a'} ); |
| if (!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } |
| if ($filesize) { |
| &DoUBBC; |
| if ( $_ =~ /\.(bmp|jpe|jpg|jpeg|gif|png)$/ixsm |
| } |
| && $amdisplaypics == 1 ) |
| &wrap2; |
| { |
| &ToChars($message); |
| $showattach .= |
| |
| qq~<div class="small attbox"><a href="$scripturl?action=downloadfile;file=$urlname" target="_blank"><img src="$attach_gif{$ext}" class="bottom" alt="" /> $_</a> ( ~ |
| if ($icanbypass) { $template_modify = qq~$menusep<a href="$scripturl?board=$currentboard;action=modify;message=$counter;thread=$viewnum" onclick="return confirm('$display_txt{'modifyinlocked'}');">$img{'modify'}</a> ~; } |
| . int( $filesize / 1024 ) |
| |
| . qq~ KB | $attach_count{$_} $download_txt )<br />~ |
| if ($mstate !~ /l/i) { |
| . ( |
| if ($replybutton) { |
| $img_greybox |
| my $quote_mname = $displayname; |
| ? ( |
| $quote_mname =~ s/'/\\'/g; |
| $img_greybox == 2 |
| $usernamelink = qq~<a href="javascript:void(AddText('[color=$quoteuser_color]@[/color] [b]$quote_mname\[/b]\\r\\n\\r\\n'))"><img src="$imagesdir/qquname.gif" border="0" alt="$display_txt{'146n'}" title="$display_txt{'146n'}" /></a> $usernamelink~ if $enable_quickreply && $enable_quoteuser && (!$iamguest || $enable_guestposting); |
| ? qq~<a href="$scripturl?action=downloadfile;file=$urlname" data-rel="gb_imageset[nice_pics]" title="$_">~ |
| |
| : qq~<a href="$scripturl?action=downloadfile;file=$urlname" data-rel="gb_image[nice_pics]" title="$_">~ |
| if (!$movedflag || $iamadmin || $iamgmod || $iammod) { |
| ) |
| if ($enable_quickreply) { |
| : qq~<a href="$scripturl?action=downloadfile;file=$urlname" target="_blank">~ |
| $quote_mname = $useraccount{$musername}; |
| ) |
| $quote_mname =~ s/'/\\'/g; |
| . qq~<img src="$uploadurl/$_" name="attach_img_resize" alt="$_" title="$_" style="display:none" /></a></div>\n~; |
| if ($enable_markquote) { |
| } |
| $outblock =~ s/(<div)( class="$messageclass" style="float: left; width: 99%; overflow: auto;">)/$1 onmouseup="get_selection($counter);"$2/i; |
| else { |
| $template_quote = qq~$menusep<a href="javascript:void(quoteSelection('$quote_mname',$viewnum,$counter,$mdate,''))">$img{'mquote'}</a>~; |
| $attachment .= |
| } else { |
| qq~<div class="small"><a href="$scripturl?action=downloadfile;file=$urlname"><img src="$attach_gif{$ext}" class="bottom" alt="" /> $_</a> ( ~ |
| $template_quote = ''; |
| . int( $filesize / 1024 ) |
| } |
| . qq~ KB | $attach_count{$_} $download_txt )</div>~; |
| if ($enable_quickjump) { |
| } |
| if (length($postmessage) <= $quick_quotelength) { |
| } |
| my $quickmessage = $postmessage; |
| else { |
| if (!$nestedquotes) { |
| $attachment .= |
| $quickmessage =~ s~(<(br|p).*?>){0,1}\[quote([^\]]*)\](.*?)\[/quote([^\]]*)\](<(br|p).*?>){0,1}~<br />~ig; |
| qq~<div class="small"><img src="$attach_gif{$ext}" class="bottom" alt="" /> $_ ($fatxt{'1'}~ |
| } |
| . ( |
| $quickmessage =~ s/<(br|p).*?>/\\r\\n/ig; |
| exists $attach_count{$_} |
| $quickmessage =~ s/'/\\'/g; |
| ? qq~ | $attach_count{$_} $download_txt ~ |
| $template_quote .= qq~$menusep<a href="javascript:void(quoteSelection('$quote_mname',$viewnum,$counter,$mdate,'$quickmessage'))">$img{'quote'}</a>~; |
| : q{} |
| } else { |
| ) . q~)</div>~; |
| $template_quote .= qq~$menusep<a href="javascript:void(quick_quote_confirm('$scripturl?action=post;num=$viewnum;virboard=$vircurrentboard;quote=$counter;title=PostReply'))">$img{'quote'}</a>~; |
| } |
| } |
| } |
| } else { |
| $showattachhr = q~<hr class="hr att_hr" />~; |
| $template_quote .= qq~$menusep<a href="$scripturl?action=post;num=$viewnum;virboard=$vircurrentboard;quote=$counter;title=PostReply">$img{'quote'}</a>~; |
| if ( $showattach && $attachment ) { |
| } |
| $attachment =~ |
| } else { |
| s/<div class="small">/<div class="small attbox_b">/gsm; |
| $template_quote = qq~$menusep<a href="$scripturl?action=post;num=$viewnum;virboard=$vircurrentboard;quote=$counter;title=PostReply">$img{'quote'}</a>~; |
| } |
| } |
| } |
| } |
| |
| } |
| # Should we show "last modified by?" |
| if ($sessionvalid == 1 && ($iamadmin || $iamgmod || $iammod || ($username eq $musername && (!$tlnomodflag || $date < $mdate + ($tlnomodtime * 3600 * 24))))) { |
| if ( |
| $template_modify = qq~$menusep<a href="$scripturl?board=$currentboard;action=modify;message=$counter;thread=$viewnum">$img{'modify'}</a>~; |
| $showmodify |
| } else { |
| && $mlm ne q{} |
| $template_modify = ''; |
| && $mlmb ne q{} |
| } |
| && ( !$tllastmodflag |
| if ($counter > 0 && ($iamadmin || $iamgmod || $iammod) && $sessionvalid == 1) { |
| || ( $mdate + ( $tllastmodtime * 60 ) ) < $mlm ) |
| $template_split = qq~$menusep<a href="$scripturl?action=split_splice;board=$currentboard;thread=$viewnum;oldposts=~ . join(',%20', ($counter .. $mreplies)) . qq~;leave=0;newcat=$curcat;newboard=$currentboard;newthread=new;ss_submit=1" onclick="return confirm('$display_txt{'split_confirm'}');">$img{'admin_split'}</a>~; |
| ) |
| } |
| { |
| if ($sessionvalid == 1 && ($iamadmin || $iamgmod || $iammod || ($username eq $musername && (!$tlnodelflag || $date < $mdate + ($tlnodeltime * 3600 * 24))))) { |
| if ($mlmb) { |
| $template_delete = qq~$menusep<span style="cursor: pointer; cursor: hand;" onclick="if(confirm('$display_txt{'rempost'}')) {uncheckAllBut($counter);}">$img{'delete'}</span>~; |
| LoadUser($mlmb); |
| if ((($iammod && $mdmod == 1) || ($iamadmin && $mdadmin == 1) || ($iamgmod && $mdglobal == 1)) && $sessionvalid == 1) { |
| if ( $iamguest ) { |
| $template_admin = qq~<input type="checkbox" class="$css" style="border: 0px;" name="del$counter" value="$counter" />~; |
| $mlmb = qq~$format_unbold{$mlmb}~; |
| } else { |
| } |
| # need to set visibility to hidden - used for regular users to delete their posts too, |
| else { |
| $template_admin = qq~ <input type="checkbox" class="$css" style="border: 0px; visibility: hidden; display: none;" name="del$counter" value="$counter" />~; |
| $mlmb = |
| } |
| qq~<a href="$scripturl?action=viewprofile;username=$useraccount{$mlmb}">$format_unbold{$mlmb}</a>~; |
| } else { |
| } |
| $template_delete = ''; |
| } |
| $template_admin = qq~ <input type="checkbox" class="$css" style="border: 0px; visibility: hidden; display: none;" name="del$counter" value="$counter" />~; |
| else { |
| } |
| $mlmb = $display_txt{'470'}; |
| } |
| } |
| |
| $lastmodified = |
| $msgimg = qq~<a href="$scripturl?num=$viewnum/$counter#$counter"><img src="$imagesdir/$micon.gif" alt="" border="0" style="vertical-align: middle;" /></a>~; |
| qq~&\x23171; <i>$display_txt{'211'}: ~ |
| $ipimg = qq~<img src="$imagesdir/ip.gif" alt="" border="0" style="vertical-align: middle;" />~; |
| . timeformat($mlm,0,0,0,1) |
| if ($extendedprofiles) { |
| . qq~ $display_txt{'525'} $mlmb</i> &\x23187;~; |
| require "$sourcedir/ExtendedProfiles.pl"; |
| } |
| $template_ext_prof = &ext_viewinposts($musername); |
| |
| } |
| if ($ipLookup) { |
| |
| ( $mip_one, $mip_two, $mip_three ) = split / /sm, $mip; |
| # Jump to the "NEW" Post. |
| if ($mip_one) { |
| $usernamelink = qq~<a name="new"></a>$usernamelink~ if $newestpost && $newestpost == $counter; |
| $lookupIP = |
| |
| qq~<a href="$scripturl?action=iplookup;ip=$mip_one"><span class="small">$mip_one</span></a>~; |
| $posthandelblock =~ s/({|<)yabb quote(}|>)/$template_quote/g; |
| } |
| $posthandelblock =~ s/({|<)yabb modify(}|>)/$template_modify/g; |
| if ($mip_two) { |
| $posthandelblock =~ s/({|<)yabb split(}|>)/$template_split/g; |
| $lookupIP .= |
| $posthandelblock =~ s/({|<)yabb delete(}|>)/$template_delete/g; |
| qq~ <a href="$scripturl?action=iplookup;ip=$mip_two"><span class="small">$mip_two</span></a>~; |
| $posthandelblock =~ s/({|<)yabb admin(}|>)/$template_admin/g; |
| } |
| $posthandelblock =~ s/({|<)yabb modalert(}|>)/$PMAlertButton/g; |
| if ($mip_three) { |
| $posthandelblock =~ s/\Q$menusep//i; |
| $lookupIP .= |
| |
| qq~ <a href="$scripturl?action=iplookup;ip=$mip_three"><span class="small">$mip_three</span></a>~; |
| $contactblock =~ s/({|<)yabb email(}|>)/$template_email/g; |
| } |
| $contactblock =~ s/({|<)yabb profile(}|>)/$template_profile/g; |
| } |
| $contactblock =~ s/({|<)yabb pm(}|>)/$template_pm/g; |
| else { |
| $contactblock =~ s/({|<)yabb www(}|>)/$template_www/g; |
| $lookupIP = $mip; |
| $contactblock =~ s/({|<)yabb aim(}|>)/$aimad/g; |
| } |
| $contactblock =~ s/({|<)yabb yim(}|>)/$yimad/g; |
| if ( $iamadmin |
| $contactblock =~ s/({|<)yabb icq(}|>)/$icqad/g; |
| || $iamfmod |
| $contactblock =~ s/({|<)yabb msn(}|>)/$msnad/g; |
| || $iamgmod && $gmod_access2{'ipban2'} eq 'on' ) |
| $contactblock =~ s/({|<)yabb gtalk(}|>)/$gtalkad/g; |
| { |
| $contactblock =~ s/({|<)yabb skype(}|>)/$skypead/g; |
| $mip = $lookupIP; |
| $contactblock =~ s/({|<)yabb myspace(}|>)/$myspacead/g; |
| } |
| $contactblock =~ s/({|<)yabb facebook(}|>)/$facebookad/g; |
| else { $mip = $display_txt{'511'}; } |
| $contactblock =~ s/({|<)yabb addbuddy(}|>)/$addbuddy/g; |
| |
| $contactblock =~ s/\Q$menusep//i; |
| ## moderator alert button! |
| |
| if ( $PMenableAlertButton |
| $outblock =~ s/({|<)yabb images(}|>)/$imagesdir/g; |
| && $PM_level |
| $outblock =~ s/({|<)yabb messageoptions(}|>)/$msgcontrol/g; |
| && !$staff |
| $outblock =~ s/({|<)yabb memberinfo(}|>)/$memberinfo/g; |
| && ( !$iamguest || ( $iamguest && $PMAlertButtonGuests ) ) ) |
| $outblock =~ s/({|<)yabb userlink(}|>)/$usernamelink/g; |
| { |
| $outblock =~ s/({|<)yabb location(}|>)/$userlocation/g; |
| $PMAlertButton = |
| $outblock =~ s/({|<)yabb stars(}|>)/$memberstar{$musername}/g; |
| qq~ $menusep<a href="$scripturl?action=modalert;num=$viewnum;title=PostReply;quote=$counter" onclick="return confirm('$display_txt{'alertmod_confirm'}');">$img{'alertmod'}</a>~; |
| $outblock =~ s/({|<)yabb subject(}|>)/$msub/g; |
| } |
| $outblock =~ s/({|<)yabb msgimg(}|>)/$msgimg/g; |
| |
| $outblock =~ s/({|<)yabb msgdate(}|>)/$messdate/g; |
| ## is member a buddy of mine? |
| $outblock =~ s/({|<)yabb replycount(}|>)/$counterwords/g; |
| if ( $buddyListEnabled && !$iamguest && $musername ne $username ) { |
| $outblock =~ s/({|<)yabb count(}|>)/$counter/g; |
| $isbuddy = |
| $outblock =~ s/({|<)yabb att(}|>)/$attachment/g; |
| qq~<br /><img src="$micon_bg{'buddylist'}" alt="$display_txt{'isbuddy'}" title="$display_txt{'isbuddy'}" /> <br />$display_txt{'isbuddy'}~; |
| $outblock =~ s/({|<)yabb css(}|>)/$css/g; |
| $addbuddylink = |
| $outblock =~ s/({|<)yabb gender(}|>)/${$uid.$musername}{'gender'}/g; |
| qq~$menusep<a href="$scripturl?num=$viewnum;action=addbuddy;name=$useraccount{$musername};vpost=$counter">$img{'addbuddy'}</a>~; |
| $outblock =~ s/({|<)yabb ext_prof(}|>)/$template_ext_prof/g; |
| } |
| $outblock =~ s/({|<)yabb postinfo(}|>)/$template_postinfo/g; |
| |
| $outblock =~ s/({|<)yabb usertext(}|>)/${$uid.$musername}{'usertext'}/g; |
| # user is current / admin / gmod |
| $outblock =~ s/({|<)yabb userpic(}|>)/${$uid.$musername}{'userpic'}/g; |
| if ( |
| $outblock =~ s/({|<)yabb message(}|>)/$message/g; |
| ( |
| $outblock =~ s/({|<)yabb showatt(}|>)/$showattach/g; |
| ${ $uid . $musername }{'regdate'} |
| $outblock =~ s/({|<)yabb showatthr(}|>)/$showattachhr/g; |
| && $messagedate > $registrationdate |
| $outblock =~ s/({|<)yabb modified(}|>)/$lastmodified/g; |
| ) |
| $outblock =~ s/({|<)yabb signature(}|>)/${$uid.$musername}{'signature'}/g; |
| || ${ $uid . $musername }{'position'} eq 'Administrator' |
| $outblock =~ s/({|<)yabb signaturehr(}|>)/$signature_hr/g; |
| || ${ $uid . $musername }{'position'} eq 'Global Moderator' |
| $outblock =~ s/({|<)yabb ipimg(}|>)/$ipimg/g; |
| ) |
| $outblock =~ s/({|<)yabb ip(}|>)/$mip/g; |
| { |
| $outblock =~ s/({|<)yabb posthandellist(}|>)/$posthandelblock/g; |
| if ( !$iamguest && $musername ne $username ) { |
| $outblock =~ s/({|<)yabb contactlist(}|>)/$contactblock/g; |
| ## check whether user is a buddy |
| if ($accept_permalink == 1){ |
| if ( $mybuddie{$musername} ) { $buddyad = $isbuddy; } |
| $outblock =~ s/({|<)yabb permalink(}|>)/$display_permalink/g; |
| else { $addbuddy = $addbuddylink; } |
| } else { |
| |
| $outblock =~ s/({|<)yabb permalink(}|>)//g; |
| # Allow instant message sending if current user is a member. |
| } |
| CheckUserPM_Level($musername); |
| $outblock =~ s/({|<)yabb useronline(}|>)/$userOnline/g; |
| if ( |
| $outblock =~ s/({|<)yabb isbuddy(}|>)/$buddyad/g; |
| $PM_level == 1 |
| |
| || ( $PM_level == 2 |
| $tmpoutblock .= $outblock; |
| && $UserPM_Level{$musername} > 1 |
| |
| && $staff ) |
| $counter += !$ttsreverse ? 1 : -1; |
| || ( $PM_level == 3 |
| } |
| && $UserPM_Level{$musername} == 3 |
| undef %UserPM_Level; |
| && ( $iamadmin || $iamgmod ) ) |
| # Insert 4 |
| || ( $PM_level == 3 |
| |
| && $UserPM_Level{$musername} == 4 |
| # Insert 5 |
| && ( $iamadmin || $iamgmod || $iamfmod ) ) |
| my ($template_remove, $template_splice, $template_lock, $template_hide, $template_sticky, $template_multidelete); |
| ) |
| if (($iammod || $iamadmin || $iamgmod) && $sessionvalid == 1) { |
| { |
| $template_remove = qq~$menusep<a href="javascript:document.removethread.submit();" onclick="return confirm('$display_txt{'162'}')"> $img{'admin_rem'}</a>~; |
| $template_pm = |
| |
| qq~$menusep<a href="$scripturl?action=imsend;to=$useraccount{$musername}">$img{'message_sm'}</a>~; |
| $template_splice = qq~$menusep<a href="javascript:void(window.open('$scripturl?action=split_splice;board=$currentboard;thread=$viewnum;oldposts=all;leave=0;newcat=$curcat;newboard=$currentboard;position=end','_blank','width=800,height=650,scrollbars=yes,resizable=yes,menubar=no,toolbar=no,top=150,left=150'))">$img{'admin_move_split_splice'}</a>~; |
| } |
| |
| } |
| $template_lock = qq~$menusep<a href="$scripturl?action=lock;thread=$viewnum">$img{'admin_lock'}</a>~; |
| |
| $template_hide = qq~$menusep<a href="$scripturl?action=hide;thread=$viewnum">$img{'hide'}</a>~; |
| $tmppostcount = NumberFormat( ${ $uid . $musername }{'postcount'} ); |
| $template_sticky = qq~$menusep<a href="$scripturl?action=sticky;thread=$viewnum">$img{'admin_sticky'}</a>~; |
| if ($iamguest) { |
| if (${$mnum}{'board'} eq $annboard) { $template_sticky = ''; } |
| $template_postinfo = |
| } |
| qq~$display_txt{'21'}: $tmppostcount<br />~; |
| if ((($iammod && $mdmod == 1) || ($iamadmin && $mdadmin == 1) || ($iamgmod && $mdglobal == 1)) && $sessionvalid == 1) { |
| } |
| if ($mstate !~ /l/i) { |
| else { |
| $template_multidelete = qq~$menusep<a href="javascript:document.multidel.submit();" onclick="return confirm('$display_txt{'739'}')">$img{'admin_del'}</a>~; |
| my $lastPostsTxt; |
| } |
| if ( $username eq $musername ) { |
| } |
| $lastPostsTxt = $display_txt{'mylastposts'}; |
| |
| } |
| if ($template_viewers) { |
| else { |
| $topic_viewers = qq~ |
| $lastPostsTxt = |
| <tr> |
| $display_txt{'lastposts'} |
| <td class="windowbg" valign="middle" align="left"> |
| . ${ $uid . $musername }{'realname'}; |
| $display_txt{'644'} ($topviewers): $template_viewers |
| } |
| </td> |
| $template_postinfo = |
| </tr> |
| qq~$display_txt{'21'}: <a href="$scripturl?action=usersrecentposts;username=$useraccount{$musername}" title="$lastPostsTxt"><span class="small">$tmppostcount</span></a><br />~; |
| ~; |
| } |
| } |
| if ( ${ $uid . $musername }{'bday'} |
| |
| && $showuserage |
| # Mark as read button has no use in global announcements or for guests |
| && ( !$showage || !${ $uid . $musername }{'hideage'} ) ) |
| if ($currentboard ne $annboard && !$iamguest) { |
| { |
| $mark_unread = qq~$menusep<a href="$scripturl?action=markunread;thread=$viewnum;board=$currentboard">$img{'markunread'}</a>~; |
| CalcAge( $musername, 'calc' ); |
| } |
| $template_age = qq~$display_txt{'age'}: $age<br />~; |
| |
| } |
| # Template it |
| if ( $showregdate && ${ $uid . $musername }{'regtime'} ) { |
| |
| $dr_regdate = timeformat( ${ $uid . $musername }{'regtime'},0,0,0,1 ); |
| $tabsep = qq~<img src="$imagesdir/tabsep211.png" border="0" alt="" style="vertical-align: middle;" />~; |
| $dr_regdate = dtonly($dr_regdate); |
| $yynavback = qq~$tabsep <a href="$scripturl">« $img_txt{'103'}</a> $tabsep $navback $tabsep~; |
| $dr_regdate =~ s/(.*)(, 1?[0-9]):[0-9][0-9].*/$1/xsm; |
| $yynavigation = qq~› $template_cat › $template_board › $msubthread~; |
| $template_regdate = |
| # Create link to modify displayed post order if allowed |
| qq~$display_txt{'regdate'} $dr_regdate<br />~; |
| my $curthreadurl = (!$iamguest and $ttsureverse) ? qq~<a title="$display_txt{'reverse'}" href="$scripturl?num=$viewnum;start=~ . (!$ttsreverse ? $mreplies : 0) . qq~;action=~ . ($userthreadpage == 1 ? 'threadpagetext' : 'threadpagedrop') . qq~;reversetopic=$ttsreverse"><img src="$imagesdir/arrow_~ . ($ttsreverse ? 'up' : 'down') . qq~.gif" border="0" alt="" style="vertical-align: middle;" /> $msubthread</a>~ : $msubthread; |
| } |
| |
| $template_profile = |
| $threadhandellist =~ s/({|<)yabb markunread(}|>)/$mark_unread/g; |
| ( $profilebutton && !$iamguest ) |
| $threadhandellist =~ s/({|<)yabb reply(}|>)/$replybutton/g; |
| ? qq~$menusep<a href="$scripturl?action=viewprofile;username=$useraccount{$musername}">$img{'viewprofile_sm'}</a>~ |
| $threadhandellist =~ s/({|<)yabb poll(}|>)/$pollbutton/g; |
| : q{}; |
| $threadhandellist =~ s/({|<)yabb notify(}|>)/$notify/g; |
| $template_www = |
| $threadhandellist =~ s/({|<)yabb favorite(}|>)/$template_favorite/g; |
| ${ $uid . $musername }{'weburl'} |
| $threadhandellist =~ s/({|<)yabb sendtopic(}|>)/$template_sendtopic/g; |
| ? qq~$menusep${$uid.$musername}{'weburl'}~ |
| $threadhandellist =~ s/({|<)yabb print(}|>)/$template_print/g; |
| : q{}; |
| $threadhandellist =~ s/\Q$menusep//i; |
| |
| |
| $userOnline = userOnLineStatus($musername) . q~<br />~; |
| $adminhandellist =~ s/({|<)yabb remove(}|>)/$template_remove/g; |
| $displayname = ${ $uid . $musername }{'realname'}; |
| $adminhandellist =~ s/({|<)yabb splice(}|>)/$template_splice/g; |
| if ( ${ $uid . $musername }{'location'} ) { |
| $adminhandellist =~ s/({|<)yabb lock(}|>)/$template_lock/g; |
| $userlocation = |
| $adminhandellist =~ s/({|<)yabb hide(}|>)/$template_hide/g; |
| qq~$display_txt{'location'}: ~ |
| $adminhandellist =~ s/({|<)yabb sticky(}|>)/$template_sticky/g; |
| . ${ $uid . $musername }{'location'} |
| $adminhandellist =~ s/({|<)yabb multidelete(}|>)/$template_multidelete/g; |
| . q~<br />~; |
| $adminhandellist =~ s/\Q$menusep//i; |
| } |
| |
| if ( ${ $uid . $musername }{'signature'} ) { |
| $display_template =~ s/({|<)yabb home(}|>)/$template_home/g; |
| $signature_hr = q~<hr class="hr att_hr" />~; |
| $display_template =~ s/({|<)yabb category(}|>)/$template_cat/g; |
| } |
| $display_template =~ s/({|<)yabb board(}|>)/$template_board/g; |
| $memberinfo = "$memberinfo{$musername}$addmembergroup{$musername}"; |
| $display_template =~ s/({|<)yabb moderators(}|>)/$template_mods/g; |
| |
| $display_template =~ s/({|<)yabb topicviewers(}|>)/$topic_viewers/g; |
| $aimad = |
| $display_template =~ s/({|<)yabb prev(}|>)/$prevlink/g; |
| ${ $uid . $musername }{'aim'} |
| $display_template =~ s/({|<)yabb next(}|>)/$nextlink/g; |
| ? qq~$menusep${$uid.$musername}{'aim'}~ |
| $display_template =~ s/({|<)yabb pageindex top(}|>)/$pageindex1/g; |
| : q{}; |
| $display_template =~ s/({|<)yabb pageindex bottom(}|>)/$pageindex2/g; |
| $memailad = |
| |
| ${ $uid . $musername }{'email'} |
| $display_template =~ s/({|<)yabb threadhandellist(}|>)/$threadhandellist/g; |
| ? qq~${$uid.$musername}{'email'}~ |
| $display_template =~ s/({|<)yabb threadimage(}|>)/$template_threadimage/g; |
| : q{}; |
| $display_template =~ s/({|<)yabb threadurl(}|>)/$curthreadurl/g; |
| $icqad = |
| $tmpviews = ${$viewnum}{'views'} - 1; |
| ${ $uid . $musername }{'icq'} |
| $tmpviews = &NumberFormat($tmpviews); |
| ? qq~$menusep${$uid.$musername}{'icq'}~ |
| $display_template =~ s/({|<)yabb views(}|>)/ $tmpviews /eg; |
| : q{}; |
| if (($iamadmin || $iamgmod || $iammod) && $sessionvalid == 1) { |
| $yimad = |
| # Board=$currentboard is necessary for multidel - DO NOT REMOVE!! |
| ${ $uid . $musername }{'yim'} |
| # This form is necessary to allow thread deletion in locked topics. |
| ? qq~$menusep${$uid.$musername}{'yim'}~ |
| $formstart .= qq~<form name="removethread" action="$scripturl?action=removethread" method="post" style="display: inline"> |
| : q{}; |
| <input type="hidden" name="thread" value="$viewnum" /> |
| $gtalkad = |
| </form>~; |
| ${ $uid . $musername }{'gtalk'} |
| |
| ? qq~$menusep${$uid.$musername}{'gtalk'}~ |
| } |
| : q{}; |
| $formstart .= qq~<form name="multidel" action="$scripturl?board=$currentboard;action=multidel;thread=$viewnum/~ . (!$ttsreverse ? $start : $mreplies - $start) . qq~" method="post" style="display: inline">~; |
| $skypead = |
| $formend = qq~</form>~; |
| ${ $uid . $musername }{'skype'} |
| |
| ? qq~$menusep${$uid.$musername}{'skype'}~ |
| $display_template =~ s/({|<)yabb multistart(}|>)/$formstart/g; |
| : q{}; |
| $display_template =~ s/({|<)yabb multiend(}|>)/$formend/g; |
| $myspacead = |
| |
| ${ $uid . $musername }{'myspace'} |
| $display_template =~ s/({|<)yabb pollmain(}|>)/$template_pollmain/g; |
| ? qq~$menusep${$uid.$musername}{'myspace'}~ |
| $display_template =~ s/({|<)yabb postsblock(}|>)/$tmpoutblock/g; |
| : q{}; |
| $display_template =~ s/({|<)yabb adminhandellist(}|>)/$adminhandellist/g; |
| $facebookad = |
| $display_template =~ s/({|<)yabb forumselect(}|>)/$selecthtml/g; |
| ${ $uid . $musername }{'facebook'} |
| |
| ? qq~$menusep${$uid.$musername}{'facebook'}~ |
| $yymain .= qq~ |
| : q{}; |
| $display_template |
| $twitterad = |
| <script language="JavaScript1.2" type="text/javascript"> |
| ${ $uid . $musername }{'twitter'} |
| <!-- // |
| ? qq~$menusep${$uid.$musername}{'twitter'}~ |
| function uncheckAllBut(counter) { |
| : q{}; |
| for (var i = 0; i < document.forms["multidel"].length; ++i) { |
| $youtubead = |
| if (document.forms["multidel"].elements[i].type == "checkbox") document.forms["multidel"].elements[i].checked = false; |
| ${ $uid . $musername }{'youtube'} |
| } |
| ? qq~$menusep${$uid.$musername}{'youtube'}~ |
| document.forms["multidel"].elements["del"+counter].checked = true; |
| : q{}; |
| document.multidel.submit(); |
| |
| }~; |
| $usernamelink = QuickLinks($musername); |
| |
| if ($extendedprofiles) { |
| |
| require Sources::ExtendedProfiles; |
| if ($sendtopicmail) { |
| $usernamelink = |
| my ($esubject,$emessage); |
| ext_viewinposts_popup( $musername, $usernamelink ); |
| if ($sendtopicmail > 1) { |
| } |
| &LoadLanguage('SendTopic'); |
| } |
| &LoadLanguage('Email'); |
| elsif ( $musername !~ m/Guest/sm && $messagedate < $registrationdate ) { |
| require "$sourcedir/Mailer.pl"; |
| $exmem = 1; |
| $esubject = &uri_escape("$sendtopic_txt{'118'}: $msubthread ($sendtopic_txt{'318'} ${$uid.$username}{'realname'})"); |
| $memberinfo = $display_txt{'470a'}; |
| $emessage = &uri_escape( &template_email($sendtopicemail, {'toname' => '?????', 'subject' => $msubthread, 'displayname' => ${$uid.$username}{'realname'}, 'num' => $viewnum}) ); |
| $usernamelink = qq~<b>$mname</b>~; |
| } |
| $displayname = $display_txt{'470a'}; |
| $yymain .= qq~ |
| } |
| |
| else { |
| function sendtopicmail(action) { |
| require Sources::Decoder; |
| var x = "mailto:?subject=$esubject&body=$emessage"; |
| $musername = 'Guest'; |
| if (action == 3) { |
| $memberinfo = $display_txt{'28'}; |
| Check = confirm('$display_txt{'sendtopicemail'}'); |
| $usernamelink = qq~<b>$mname</b>~; |
| if (Check != true) x = ''; |
| $displayname = $mname; |
| } |
| $cryptmail = scramble( $memail, $musername ); |
| if (action == 1 || x == '') x = "$scripturl?action=sendtopic;topic=$viewnum"; |
| } |
| window.location.href = x; |
| $usernames_life_quote{ $useraccount{$musername} } = |
| }~; |
| $displayname; # for display names in Quotes in LivePreview |
| } |
| |
| |
| # Insert 2 |
| $yymain .= qq~ |
| if ( |
| |
| ( |
| $pageindexjs |
| !${ $uid . $musername }{'hidemail'} |
| function ListPages(tid) { window.open('$scripturl?action=pages;num='+tid, '', 'menubar=no,toolbar=no,top=50,left=50,scrollbars=yes,resizable=no,width=400,height=300'); } |
| || $iamadmin |
| // --> |
| || $allow_hide_email != 1 |
| </script> |
| || $musername eq 'Guest' |
| ~; |
| ) |
| |
| && !$exmem |
| if ($img_greybox) { |
| ) |
| $yyinlinestyle .= qq~<link href="$yyhtml_root/greybox/gb_styles.css" rel="stylesheet" type="text/css" />\n~; |
| { |
| $yyjavascript .= qq~ |
| if ($iamguest) { $template_email = q{}; } |
| var GB_ROOT_DIR = "$yyhtml_root/greybox/"; |
| if ( $musername ne 'Guest' ) { |
| // --> |
| $template_email = |
| </script> |
| $menusep . enc_eMail( $img{'email_sm'}, $memailad, q{}, q{} ); |
| <script type="text/javascript" src="$yyhtml_root/AJS.js"></script> |
| } |
| <script type="text/javascript" src="$yyhtml_root/AJS_fx.js"></script> |
| else { |
| <script type="text/javascript" src="$yyhtml_root/greybox/gb_scripts.js"></script> |
| $template_email = |
| <script type="text/javascript"> |
| $menusep . enc_eMail( $img{'email_sm'}, $memail, q{}, q{} ); |
| <!--~; |
| } |
| } |
| if ($iamadmin) { |
| |
| if ( $musername ne 'Guest' ) { |
| $yytitle = $msubthread; |
| $template_email =~ |
| if ($replybutton and $enable_quickreply) { |
| s/title=\\"$img_txt{'69'}\\"/title=\\"$memailad\\"/xsm; |
| $yymain =~ s~(<!-- Threads Admin Button Bar start -->.*?</td>)~$1<td align="right">{yabb forumjump}</td>~s; |
| } |
| require "$sourcedir/Post.pl"; |
| else { |
| $action = 'post'; |
| $template_email =~ |
| $INFO{'title'} = 'PostReply'; |
| s/title=\\"$img_txt{'69'}\\"/title=\\"$memail\\"/xsm; |
| $Quick_Post = 1; |
| } |
| $message = ''; |
| } |
| &Post; |
| } |
| } |
| if ($iamguest) { $template_email = q{}; } |
| &template; |
| |
| |
| $counterwords = |
| |
| $counter != 0 ? "$display_txt{'146'} #$counter - " : q{}; |
| |
| |
| |
| $messdate = timeformat($mdate); |
| |
| if ( $counterwords ) { |
| |
| $messdate = timeformat($mdate,0,0,0,1); |
| |
| } |
| |
| |
| |
| # Print the post and user info for the poster. |
| |
| my $outblock = $messageblock; |
| |
| my $posthandelblock = $posthandellist; |
| |
| my $contactblock = $contactlist; |
| |
| |
| |
| ( $msub, undef ) = Split_Splice_Move( $msub, 0 ); |
| |
| $msub = isempty( $msub, $display_txt{'24'} ); |
| |
| ToChars($msub); |
| |
| my $reason; |
| |
| if ( $lastmodified |
| |
| && ( $staff_reason || $user_reason ) |
| |
| && $postmessage =~ s/\[reason\](.+?)\[\/reason\]//isgm ) |
| |
| { |
| |
| $reason = qq~<br /><i><b>$display_txt{'211a'}:</b> $1</i>~; |
| |
| $reason = Censor($reason); |
| |
| ToChars($reason); |
| |
| } |
| |
| $msub = Censor($msub); |
| |
| |
| |
| $message = Censor($postmessage); |
| |
| wrap(); |
| |
| ( $message, $movedflag ) = Split_Splice_Move( $message, $viewnum ); |
| |
| if ($enable_ubbc) { |
| |
| enable_yabbc(); |
| |
| DoUBBC(); |
| |
| } |
| |
| wrap2(); |
| |
| ToChars($message); |
| |
| |
| |
| if ($icanbypass) { |
| |
| $template_modify = |
| |
| qq~$menusep<a href="$scripturl?board=$currentboard;action=modify;message=$counter;thread=$viewnum" onclick="return confirm('$display_txt{'modifyinlocked'}');">$img{'modify'}</a>~; |
| |
| } |
| |
| |
| |
| if ( $mstate !~ /l/ism ) { |
| |
| if ($replybutton) { |
| |
| my $quote_mname = $displayname; |
| |
| $quote_mname =~ s/\x27/\\\x27/gxsm; |
| |
| if ( $enable_quickreply |
| |
| && $enable_quoteuser |
| |
| && ( !$iamguest || $enable_guestposting ) ) |
| |
| { |
| |
| $usernamelink = |
| |
| qq~<a href="javascript:void(AddText('[color=$quoteuser_color]@[/color] [b]$quote_mname\[/b]\\r\\n\\r\\n'))"><img src="$imagesdir/$disp_qquname" alt="$display_txt{'146n'}" title="$display_txt{'146n'}" /></a> $usernamelink~; |
| |
| } |
| |
| |
| |
| if ( !$movedflag |
| |
| || $staff ) |
| |
| { |
| |
| if ($enable_quickreply) { |
| |
| $quote_mname = $useraccount{$musername}; |
| |
| $quote_mname =~ s/\x27/\\\x27/gxsm; |
| |
| if ($enable_markquote) { |
| |
| my $quoteinfo; |
| |
| my $quotesmess = $postmessage; |
| |
| while ( $quotesmess =~ s/\[quote (.*?)\]//sm ) { |
| |
| my ( $tmpqauth, $tmpqlink, $tmpqdate ) = |
| |
| split / /sm, $1; |
| |
| my ( undef, $tmpqau ) = split /=/xsm, $tmpqauth; |
| |
| my ( undef, $tmpqli ) = split /=/xsm, $tmpqlink; |
| |
| my ( undef, $tmpqda ) = split /=/xsm, $tmpqdate; |
| |
| |
| |
| $quoteinfo .= qq~$tmpqau-$tmpqli-$tmpqda|~; |
| |
| } |
| |
| $outblock =~ s/(<div)( class="$messageclass" style="float: left; width: 99%; overflow: auto;">)/$1 id="mq$counter" onmouseup="get_selection($counter, '$quoteinfo');"$2/i; |
| |
| |
| |
| $template_quote = |
| |
| qq~$menusep<a href="javascript:void(quoteSelection('$quote_mname',$viewnum,$counter,$mdate,''))">$img{'mquote'}</a>~; |
| |
| } |
| |
| else { |
| |
| $template_quote = q{}; |
| |
| } |
| |
| if ($enable_quickjump) { |
| |
| if ( length($postmessage) <= $quick_quotelength ) { |
| |
| my $quickmessage = $postmessage; |
| |
| if ( !$nestedquotes ) { |
| |
| $quickmessage =~ |
| |
| s/(<(br|p).*?>){0,1}\[quote([^\]]*)\](.*?)\[\/quote([^\]]*)\](<(br|p).*?>){0,1}/<br \/>/igsm; |
| |
| } |
| |
| $quickmessage =~ s/<(br|p).*?>/\\r\\n/igxsm; |
| |
| $quickmessage =~ s/\x27/\\\x27/gxsm; |
| |
| $template_quote .= |
| |
| qq~$menusep<a href="javascript:void(quoteSelection('$quote_mname',$viewnum,$counter,$mdate,'$quickmessage'))">$img{'quote'}</a>~; |
| |
| } |
| |
| else { |
| |
| $template_quote .= |
| |
| qq~$menusep<a href="javascript:void(quick_quote_confirm('$scripturl?action=post;num=$viewnum;virboard=$vircurrentboard;quote=$counter;title=PostReply'))">$img{'quote'}</a>~; |
| |
| } |
| |
| } |
| |
| else { |
| |
| $template_quote .= |
| |
| qq~$menusep<a href="$scripturl?action=post;num=$viewnum;virboard=$vircurrentboard;quote=$counter;title=PostReply">$img{'quote'}</a>~; |
| |
| } |
| |
| } |
| |
| else { |
| |
| $template_quote = |
| |
| qq~$menusep<a href="$scripturl?action=post;num=$viewnum;virboard=$vircurrentboard;quote=$counter;title=PostReply">$img{'quote'}</a>~; |
| |
| } |
| |
| } |
| |
| } |
| |
| if ( |
| |
| $sessionvalid == 1 |
| |
| && ( |
| |
| $staff |
| |
| || ( |
| |
| $username eq $musername |
| |
| && ( !$tlnomodflag |
| |
| || $date < $mdate + ( $tlnomodtime * 3600 * 24 ) ) |
| |
| ) |
| |
| ) |
| |
| ) |
| |
| { |
| |
| $template_modify = |
| |
| qq~$menusep<a href="$scripturl?board=$currentboard;action=modify;message=$counter;thread=$viewnum">$img{'modify'}</a>~; |
| |
| } |
| |
| else { |
| |
| $template_modify = q{}; |
| |
| } |
| |
| $postnum = $counter + 1; |
| |
| $template_print_post = |
| |
| qq~$menusep<a href="javascript:void(window.open('$scripturl?action=print;num=$viewnum;post=$postnum','printwindow'))">$img{'printp'}</a>~; |
| |
| |
| |
| if ( $counter > 0 |
| |
| && ($staff) |
| |
| && $sessionvalid == 1 ) |
| |
| { |
| |
| $template_split = |
| |
| qq~$menusep<a href="$scripturl?action=split_splice;board=$currentboard;thread=$viewnum;oldposts=~ |
| |
| . join( ',%20', ( $counter .. $mreplies ) ) |
| |
| . qq~;leave=0;newcat=$curcat;newboard=$currentboard;newthread=new;ss_submit=1" onclick="return confirm('$display_txt{'split_confirm'}');">$img{'admin_split'}</a>~; |
| |
| } |
| |
| if ( |
| |
| $sessionvalid == 1 |
| |
| && ( |
| |
| $staff |
| |
| || ( |
| |
| $username eq $musername |
| |
| && ( !$tlnodelflag |
| |
| || $date < $mdate + ( $tlnodeltime * 3600 * 24 ) ) |
| |
| ) |
| |
| ) |
| |
| ) |
| |
| { |
| |
| $template_delete = |
| |
| qq~$menusep<a class="cursor" onclick="if(confirm('$display_txt{'rempost'}')) {uncheckAllBut($counter);}">$img{'delete'}</a>~; |
| |
| if ( |
| |
| ( |
| |
| ( $iammod && $mdmod == 1 ) |
| |
| || ( $iamadmin && $mdadmin == 1 ) |
| |
| || ( $iamfmod && $mdfmod == 1 ) |
| |
| || ( $iamgmod && $mdglobal == 1 ) |
| |
| ) |
| |
| && $sessionvalid == 1 |
| |
| ) |
| |
| { |
| |
| $template_admin = |
| |
| qq~<input type="checkbox" class="$css" name="del$counter" value="$counter" title="$display_txt{'739a'}" />~; |
| |
| } |
| |
| else { |
| |
| |
| |
| # need to set visibility to hidden - used for regular users to delete their posts too, |
| |
| $template_admin = |
| |
| qq~<input type="checkbox" class="$css" style="border: 0px; visibility: hidden; display: none;" name="del$counter" value="$counter" title="$display_txt{'739a'}" />~; |
| |
| } |
| |
| } |
| |
| else { |
| |
| $template_delete = q{}; |
| |
| $template_admin = |
| |
| qq~<input type="checkbox" class="$css" style="border: 0px; visibility: hidden; display: none;" name="del$counter" value="$counter" title="$display_txt{'739a'}" />~; |
| |
| } |
| |
| } |
| |
| |
| |
| $msgimg = |
| |
| qq~<a href="$scripturl?num=$viewnum/$counter#$counter">$micon{$micon}</a>~; |
| |
| $ipimg = qq~<img src="$micon_bg{'ip'}" alt="" />~; |
| |
| |
| |
| if ($extendedprofiles) { |
| |
| require Sources::ExtendedProfiles; |
| |
| $template_ext_prof = ext_viewinposts($musername); |
| |
| } |
| |
| |
| |
| # Jump to the "NEW" Post. |
| |
| if ( $newestpost && $newestpost == $counter ) { |
| |
| $usernamelink = qq~<a id="new"></a>$usernamelink~; |
| |
| } |
| |
| |
| |
| $tool_sep = $usePosttools ? '|||' : q{}; |
| |
| |
| |
| $posthandelblock =~ s/{yabb markquote}/$template_markquote$tool_sep/gsm; |
| |
| $posthandelblock =~ s/{yabb quote}/$template_quote$tool_sep/gsm; |
| |
| $posthandelblock =~ s/{yabb modify}/$template_modify$tool_sep/gsm; |
| |
| $posthandelblock =~ s/{yabb split}/$template_split$tool_sep/gsm; |
| |
| $posthandelblock =~ s/{yabb delete}/$template_delete$tool_sep/gsm; |
| |
| $posthandelblock =~ s/{yabb modalert}/$PMAlertButton$tool_sep/gsm; |
| |
| $posthandelblock =~ s/{yabb print_post}/$template_print_post$tool_sep/gsm; |
| |
| $posthandelblock =~ s/{yabb admin}/$template_admin/gsm; |
| |
| $posthandelblock =~ s/\Q$menusep//ism; |
| |
| |
| |
| @psetmenusep = ( "$template_markquote","$template_quote","$template_modify","$template_split","$template_delete","$PMAlertButton","$template_print_post",); |
| |
| @postout = (); |
| |
| my $psepcn = 0; |
| |
| for (@psetmenusep) { |
| |
| if ($_ ) { |
| |
| if ( !$usePosttools ) { $postout[$psepcn] = "$_$my_ttsep";} |
| |
| else { $postout[$psepcn] = "$my_ttsep$_"; } |
| |
| } |
| |
| else { $postout[$psepcn] = q{} } |
| |
| $psepcn++; |
| |
| } |
| |
| my $outside_posttools_tmp = $outside_posttools; |
| |
| $outside_posttools_tmp =~ s/{yabb markquote}/$postout[0]/gsm; |
| |
| $outside_posttools_tmp =~ s/{yabb quote}/$postout[1]/gsm; |
| |
| $outside_posttools_tmp =~ s/{yabb modify}/$postout[2]/gsm; |
| |
| $outside_posttools_tmp =~ s/{yabb split}/$postout[3]/gsm; |
| |
| $outside_posttools_tmp =~ s/{yabb delete}/$postout[4]/gsm; |
| |
| $outside_posttools_tmp =~ s/{yabb modalert}/$postout[5]/gsm; |
| |
| $outside_posttools_tmp =~ s/{yabb print_post}/$postout[6]/gsm; |
| |
| $outside_posttools_tmp =~ s/\Q$my_ttsep//ixsm; |
| |
| |
| |
| if ( !$usePosttools ) { |
| |
| $posthandelblock = $outside_posttools_tmp . $posthandelblock; |
| |
| $outside_posttools_tmp = q{}; |
| |
| } |
| |
| else { |
| |
| $outside_posttools_tmp =~ s/\Q$menusep//ixsm; |
| |
| $outside_posttools_tmp =~ |
| |
| s/\[tool=(.+?)\](.+?)\[\/tool\]/$tmpimg{$1}/gxsm; |
| |
| $posthandelblock =~ s/\[tool=(.+?)\](.+?)\[\/tool\]/$2/gxsm; |
| |
| } |
| |
| |
| |
| # Post and Thread Tools |
| |
| if ($usePosttools) { |
| |
| $posthandelblock = |
| |
| MakeTools( $counter, $maintxt{'63'}, $posthandelblock ); |
| |
| } |
| |
| $contactblock =~ s/{yabb email}/$template_email/gsm; |
| |
| $contactblock =~ s/{yabb profile}/$template_profile/gsm; |
| |
| $contactblock =~ s/{yabb pm}/$template_pm/gsm; |
| |
| $contactblock =~ s/{yabb www}/$template_www/gsm; |
| |
| $contactblock =~ s/{yabb aim}/$aimad/gsm; |
| |
| $contactblock =~ s/{yabb yim}/$yimad/gsm; |
| |
| $contactblock =~ s/{yabb icq}/$icqad/gsm; |
| |
| $contactblock =~ s/{yabb gtalk}/$gtalkad/gsm; |
| |
| $contactblock =~ s/{yabb skype}/$skypead/gsm; |
| |
| $contactblock =~ s/{yabb myspace}/$myspacead/gsm; |
| |
| $contactblock =~ s/{yabb facebook}/$facebookad/gsm; |
| |
| $contactblock =~ s/{yabb twitter}/$twitterad/gsm; |
| |
| $contactblock =~ s/{yabb youtube}/$youtubead/gsm; |
| |
| $contactblock =~ s/{yabb addbuddy}/$addbuddy/gsm; |
| |
| ## Mod Hook Contactblock ## |
| |
| $contactblock =~ s/\Q$menusep//ixsm; |
| |
| |
| |
| $outblock =~ s/{yabb images}/$imagesdir/gsm; |
| |
| $outblock =~ s/{yabb messageoptions}/$msgcontrol/gsm; |
| |
| $outblock =~ s/{yabb memberinfo}/$memberinfo/gsm; |
| |
| $outblock =~ s/{yabb userlink}/$usernamelink/gsm; |
| |
| $outblock =~ s/{yabb location}/$userlocation/gsm; |
| |
| $outblock =~ s/{yabb stars}/$memberstar{$musername}/gsm; |
| |
| $outblock =~ s/{yabb subject}/$msub/gsm; |
| |
| $outblock =~ s/{yabb msgimg}/$msgimg/gsm; |
| |
| $outblock =~ s/{yabb msgdate}/$messdate/gsm; |
| |
| $outblock =~ s/{yabb replycount}/$counterwords/gsm; |
| |
| $outblock =~ s/{yabb count}/$counter/gsm; |
| |
| if ( $showattach || $attachment ) { |
| |
| $outblock =~ s/{yabb showatthr}/$showattachhr/gsm; |
| |
| $outblock =~ s/{yabb att}/$attachment/gsm; |
| |
| $outblock =~ s/{yabb showatt}/$showattach/gsm; |
| |
| } |
| |
| else { |
| |
| $outblock =~ s/{yabb hideatt}/ display: none;/gsm; |
| |
| } |
| |
| $outblock =~ s/{yabb css}/$css/gsm; |
| |
| $outblock =~ s/{yabb gender}/${$uid.$musername}{'gender'}/gsm; |
| |
| $outblock =~ s/{yabb zodiac}/${$uid.$musername}{'zodiac'}/gsm; |
| |
| $outblock =~ s/{yabb age}/$template_age/gsm; |
| |
| $outblock =~ s/{yabb regdate}/$template_regdate/gsm; |
| |
| $outblock =~ s/{yabb ext_prof}/$template_ext_prof/gsm; |
| |
| $outblock =~ s/{yabb postinfo}/$template_postinfo/gsm; |
| |
| ## Mod Hook Outbox ## |
| |
| if ( !$hideusertext ) { |
| |
| $outblock =~ |
| |
| s/{yabb usertext}/${$uid.$musername}{'usertext'}/gsm; |
| |
| } |
| |
| if ( !$hideavatar ) { |
| |
| $outblock =~ |
| |
| s/{yabb userpic}/${$uid.$musername}{'userpic'}/gsm; |
| |
| } |
| |
| $outblock =~ s/{yabb message}/$message/gsm; |
| |
| $outblock =~ s/{yabb modified}/$lastmodified/gsm; |
| |
| $outblock =~ s/{yabb reason}/$reason/gsm; |
| |
| if ( !$hidesignat && ${ $uid . $musername }{'signature'} ) { |
| |
| $outblock =~ |
| |
| s/{yabb signature}/${$uid.$musername}{'signature'}/gsm; |
| |
| $outblock =~ s/{yabb signaturehr}/$signature_hr/gsm; |
| |
| } |
| |
| else { |
| |
| $outblock =~ s/{yabb hidesignat}/ display: none;/gsm; |
| |
| } |
| |
| $outblock =~ s/{yabb ipimg}/$ipimg/gsm; |
| |
| $outblock =~ s/{yabb ip}/$mip/gsm; |
| |
| $outblock =~ |
| |
| s/{yabb outsideposttools}/$outside_posttools_tmp/gsm; |
| |
| $outblock =~ s/{yabb posthandellist}/$posthandelblock/gsm; |
| |
| $outblock =~ s/{yabb admin}/$template_admin/gsm; |
| |
| $outblock =~ s/{yabb contactlist}/$contactblock/gsm; |
| |
| |
| |
| if ( $accept_permalink == 1 ) { |
| |
| $outblock =~ s/{yabb permalink}/$display_permalink/gsm; |
| |
| } |
| |
| else { |
| |
| $outblock =~ s/{yabb permalink}//gsm; |
| |
| } |
| |
| $outblock =~ s/{yabb useronline}/$userOnline/gsm; |
| |
| $outblock =~ s/{yabb isbuddy}/$buddyad/gsm; |
| |
| |
| |
| $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<a href="javascript:document.removethread.submit();" onclick="return confirm('$display_txt{'162'}')">$img{'admin_rem'}</a>~; |
| |
| |
| |
| $template_splice = |
| |
| qq~$menusep<a href="javascript:void(window.open('$scripturl?action=split_splice;board=$currentboard;thread=$viewnum;oldposts=all;leave=0;newcat=$curcat;newboard=$currentboard;position=end','_blank','width=800,height=650,scrollbars=yes,resizable=yes,menubar=no,toolbar=no,top=150,left=150'))">$img{'admin_move_split_splice'}</a>~; |
| |
| |
| |
| $template_lock = |
| |
| qq~$menusep<a href="$scripturl?action=lock;thread=$viewnum">$img{'admin_lock'}</a>~; |
| |
| $template_hide = |
| |
| qq~$menusep<a href="$scripturl?action=hide;thread=$viewnum">$img{'hide'}</a>~; |
| |
| $template_sticky = |
| |
| qq~$menusep<a href="$scripturl?action=sticky;thread=$viewnum">$img{'admin_sticky'}</a>~; |
| |
| if ( ${$mnum}{'board'} eq $annboard ) { $template_sticky = q{}; } |
| |
| } |
| |
| if ( |
| |
| ( |
| |
| ( $iammod && $mdmod == 1 ) |
| |
| || ( $iamadmin && $mdadmin == 1 ) |
| |
| || ( $iamfmod && $mdfmod == 1 ) |
| |
| || ( $iamgmod && $mdglobal == 1 ) |
| |
| ) |
| |
| && $sessionvalid == 1 |
| |
| ) |
| |
| { |
| |
| if ( $mstate !~ /l/ism ) { |
| |
| $template_multidelete = |
| |
| qq~$menusep<a href="javascript:document.multidel.submit();" onclick="return confirm('$display_txt{'739'}')">$img{'admin_del'}</a>~; |
| |
| } |
| |
| } |
| |
| |
| |
| if ($template_viewers) { |
| |
| $topic_viewers = $mydisp_topicview; |
| |
| $topic_viewers =~ s/{yabb topviewers}/$topviewers/sm; |
| |
| $topic_viewers =~ s/{yabb template_viewers}/$template_viewers/sm; |
| |
| } |
| |
| |
| |
| # Social Bookmarks Start |
| |
| if ( $en_bookmarks && $bm_boards ) { |
| |
| $board_bookmarks = 0; |
| |
| foreach ( split /\, /sm, $bm_boards ) { |
| |
| if ( $_ eq $currentboard ) { $board_bookmarks = 1; } |
| |
| } |
| |
| } |
| |
| else { |
| |
| $board_bookmarks = 1; |
| |
| } |
| |
| if ( $en_bookmarks && $board_bookmarks ) { |
| |
| fopen( BMARKS, "<$vardir/Bookmarks.txt" ) |
| |
| or fatal_error( 'cannot_open', "$vardir/Bookmarks.txt", 1 ); |
| |
| @bookmarks = <BMARKS>; |
| |
| fclose(BMARKS); |
| |
| foreach my $bookmark ( sort { $a <=> $b } @bookmarks ) { |
| |
| chomp $bookmark; |
| |
| ( undef, $bm_title, $bm_image, $bm_url, undef ) = split /\|/xsm, |
| |
| $bookmark; |
| |
| $bm_subject = $msubthread; |
| |
| $convertstr = $bm_subject; |
| |
| $convertcut = $bm_subcut; |
| |
| CountChars(); |
| |
| $bm_subject = $convertstr; |
| |
| if ($cliped) { $bm_subject .= '...'; } |
| |
| $bm_subject =~ s/([^A-Za-z0-9])/sprintf('%%%02X', ord($1))/segm; |
| |
| $bm_url =~ s/{url}/$scripturl?num=$mnum/gxsm; |
| |
| $bm_url =~ s/{title}/$bm_subject/gxsm; |
| |
| $bm_url =~ s/&/&/gxsm; |
| |
| $show_bookmarks .= |
| |
| qq~<a href="$bm_url" rel="nofollow" target="_blank"><img src="$yyhtml_root/Bookmarks/$bm_image" alt="$bm_title" title="$bm_title" /></a>\n~; |
| |
| } |
| |
| $bookmarks = $my_bookmarks; |
| |
| $bookmarks =~ s/{yabb bookmarks}/$show_bookmarks/sm; |
| |
| } |
| |
| |
| |
| # Social Bookmarks End |
| |
| |
| |
| # Mark as read button has no use in global announcements or for guests |
| |
| if ( $currentboard ne $annboard && !$iamguest ) { |
| |
| $mark_unread = |
| |
| qq~$menusep<a href="$scripturl?action=markunread;thread=$viewnum;board=$currentboard">$img{'markunread'}</a>~; |
| |
| } |
| |
| |
| |
| # Template it |
| |
| |
| |
| $yynavback = |
| |
| qq~$tabsep <a href="$scripturl">&\x23171; $img_txt{'103'}</a> $tabsep $navback $tabsep~; |
| |
| |
| |
| $boardtree = q{}; |
| |
| $parentboard = $currentboard; |
| |
| while ($parentboard) { |
| |
| my ( $pboardname, undef, undef ) = split /\|/xsm, |
| |
| $board{$parentboard}; |
| |
| ToChars($pboardname); |
| |
| $pboardlink = $pboardname; |
| |
| if ( $parentboard eq 'announcements' && !$iamadmin && !$iamgmod && !$iamfmod ) { |
| |
| $pboardlink = qq~<b>$pboardname</b>~; |
| |
| } |
| |
| elsif ( ${ $uid . $parentboard }{'canpost'} || !$subboard{$parentboard} ) { |
| |
| $pboardlink = |
| |
| qq~<a href="$scripturl?board=$parentboard" class="a"><b>$pboardname</b></a>~; |
| |
| } |
| |
| else { |
| |
| $pboardlink = |
| |
| qq~<a href="$scripturl?boardselect=$parentboard;subboards=1" class="a"><b>$pboardname</b></a>~; |
| |
| } |
| |
| $boardtree = qq~ › $pboardlink$boardtree~; |
| |
| $parentboard = ${ $uid . $parentboard }{'parent'}; |
| |
| } |
| |
| |
| |
| $yynavigation = qq~› $template_cat$boardtree › $msubthread~; |
| |
| |
| |
| # Create link to modify displayed post order if allowed |
| |
| my $curthreadurl = |
| |
| ( !$iamguest && $ttsureverse ) |
| |
| ? qq~<a title="$display_txt{'reverse'}" href="$scripturl?num=$viewnum;start=~ |
| |
| . ( !$ttsreverse ? $mreplies : 0 ) |
| |
| . q~;action=~ |
| |
| . ( $userthreadpage == 1 ? 'threadpagetext' : 'threadpagedrop' ) |
| |
| . qq~;reversetopic=$ttsreverse"><img src="$imagesdir/~ |
| |
| . ( $ttsreverse ? "$disp_arrow_up" : "$disp_arrow_dn" ) |
| |
| . qq~" alt="" /> $msubthread</a>~ |
| |
| : $msubthread; |
| |
| |
| |
| $tool_sep = $useThreadtools ? '|||' : q{}; |
| |
| |
| |
| $threadhandellist =~ s/{yabb markunread}/$mark_unread$tool_sep/gsm; |
| |
| $threadhandellist =~ s/{yabb reply}/$replybutton$tool_sep/gsm; |
| |
| $threadhandellist =~ s/{yabb poll}/$pollbutton$tool_sep/gsm; |
| |
| $threadhandellist =~ s/{yabb notify}/$notify$tool_sep/gsm; |
| |
| $threadhandellist =~ |
| |
| s/{yabb favorite}/$template_favorite$tool_sep/gsm; |
| |
| $threadhandellist =~ |
| |
| s/{yabb sendtopic}/$template_sendtopic$tool_sep/gsm; |
| |
| $threadhandellist =~ s/{yabb print}/$template_print$tool_sep/gsm; |
| |
| $threadhandellist =~ s/\Q$menusep//ixsm; |
| |
| |
| |
| $threadhandellist2 =~ s/{yabb markunread}/$mark_unread$tool_sep/gsm; |
| |
| $threadhandellist2 =~ s/{yabb reply}/$replybutton$tool_sep/gsm; |
| |
| $threadhandellist2 =~ s/{yabb poll}/$pollbutton$tool_sep/gsm; |
| |
| $threadhandellist2 =~ s/{yabb notify2}/$notify2$tool_sep/gsm; |
| |
| $threadhandellist2 =~ |
| |
| s/{yabb favorite2}/$template_favorite2$tool_sep/gsm; |
| |
| $threadhandellist2 =~ |
| |
| s/{yabb sendtopic}/$template_sendtopic$tool_sep/gsm; |
| |
| $threadhandellist2 =~ s/{yabb print}/$template_print$tool_sep/gsm; |
| |
| $threadhandellist2 =~ s/\Q$menusep//ixsm; |
| |
| |
| |
| @threadin = ( "$mark_unread","$replybutton","$pollbutton","$notify","$template_favorite","$template_sendtopic","$template_print",); |
| |
| @threadout = (); |
| |
| my $sepcn = 0; |
| |
| for (@threadin) { |
| |
| if ($_ ) { |
| |
| if ( !$useThreadtools ) { $threadout[$sepcn] = "$_$menusep";} |
| |
| else { $threadout[$sepcn] = "$menusep$_"; } |
| |
| } |
| |
| else { $threadout[$sepcn] = q{}; } |
| |
| $sepcn++; |
| |
| } |
| |
| |
| |
| $outside_threadtools =~ s/{yabb markunread}/$threadout[0]/gsm; |
| |
| $outside_threadtools =~ s/{yabb reply}/$threadout[1]/gsm; |
| |
| $outside_threadtools =~ s/{yabb poll}/$threadout[2]/gsm; |
| |
| $outside_threadtools =~ s/{yabb notify}/$threadout[3]/gsm; |
| |
| $outside_threadtools =~ s/{yabb favorite}/$threadout[4]/gsm; |
| |
| $outside_threadtools =~ s/{yabb sendtopic}/$threadout[5]/gsm; |
| |
| $outside_threadtools =~ s/{yabb print}/$threadout[6]/gsm; |
| |
| if ( $menusep ne q{ } ) { |
| |
| $outside_threadtools =~ s/\Q$menusep//ixsm; |
| |
| } |
| |
| |
| |
| if ( !$useThreadtools ) { |
| |
| $threadhandellist = $outside_threadtools . $threadhandellist; |
| |
| $threadhandellist2 = $outside_threadtools . $threadhandellist2; |
| |
| $outside_threadtools = q{}; |
| |
| } |
| |
| else { |
| |
| $outside_threadtools =~ |
| |
| s/\[tool=(.+?)\](.+?)\[\/tool\]/$tmpimg{$1}/gxsm; |
| |
| $threadhandellist =~ s/\[tool=(.+?)\](.+?)\[\/tool\]/$2/gxsm; |
| |
| $threadhandellist2 =~ s/\[tool=(.+?)\](.+?)\[\/tool\]/$2/gsm; |
| |
| } |
| |
| |
| |
| # Thread Tools # |
| |
| if ($useThreadtools) { |
| |
| $threadhandellist2 = |
| |
| MakeTools( 'bottom', $maintxt{'62'}, $threadhandellist2 ); |
| |
| $threadhandellist = |
| |
| MakeTools( 'top', $maintxt{'62'}, $threadhandellist ); |
| |
| } |
| |
| |
| |
| $adminhandellist =~ s/{yabb remove}/$template_remove/gsm; |
| |
| $adminhandellist =~ s/{yabb splice}/$template_splice/gsm; |
| |
| $adminhandellist =~ s/{yabb lock}/$template_lock/gsm; |
| |
| $adminhandellist =~ s/{yabb hide}/$template_hide/gsm; |
| |
| $adminhandellist =~ s/{yabb sticky}/$template_sticky/gsm; |
| |
| $adminhandellist =~ s/{yabb multidelete}/$template_multidelete/gsm; |
| |
| $adminhandellist =~ s/\Q$menusep//ixsm; |
| |
| |
| |
| $display_template =~ s/{yabb guestview}/$guest_view_limit_warn/gsm; |
| |
| $display_template =~ s/{yabb home}/$template_home/gsm; |
| |
| $display_template =~ s/{yabb category}/$template_cat/gsm; |
| |
| $display_template =~ s/{yabb board}/$template_board/gsm; |
| |
| $display_template =~ s/{yabb moderators}/$template_mods/gsm; |
| |
| $display_template =~ s/{yabb topicviewers}/$topic_viewers/gsm; |
| |
| $display_template =~ s/{yabb prev}/$prevlink/gsm; |
| |
| $display_template =~ s/{yabb next}/$nextlink/gsm; |
| |
| $display_template =~ s/{yabb pageindex top}/$pageindex1/gsm; |
| |
| $display_template =~ s/{yabb pageindex bottom}/$pageindex2/gsm; |
| |
| $display_template =~ s/{yabb bookmarks}/$bookmarks/gsm; |
| |
| |
| |
| $display_template =~ |
| |
| s/{yabb outsidethreadtools}/$outside_threadtools/gsm; |
| |
| $display_template =~ |
| |
| s/{yabb threadhandellist}/$threadhandellist/gsm; |
| |
| $display_template =~ |
| |
| s/{yabb threadhandellist2}/$threadhandellist2/gsm; |
| |
| $display_template =~ |
| |
| s/{yabb threadhandellist1}/$threadhandellist1/gsm; |
| |
| $display_template =~ s/{yabb threadimage}/$template_threadimage/gsm; |
| |
| $display_template =~ s/{yabb threadurl}/$curthreadurl/gsm; |
| |
| $tmpviews = ${$viewnum}{'views'} - 1; |
| |
| $tmpviews = NumberFormat($tmpviews); |
| |
| $display_template =~ s/{yabb views}/ $tmpviews /egsm; |
| |
| |
| |
| if ( ($staff) |
| |
| && $sessionvalid == 1 ) |
| |
| { |
| |
| |
| |
| # Board=$currentboard is necessary for multidel - DO NOT REMOVE!! |
| |
| # This form is necessary to allow thread deletion in locked topics. |
| |
| $formstart = qq~ |
| |
| <form name="removethread" action="$scripturl?action=removethread" method="post" style="display: inline"> |
| |
| <input type="hidden" name="thread" value="$viewnum" /> |
| |
| </form>~; |
| |
| } |
| |
| $formstart .= |
| |
| qq~<form name="multidel" action="$scripturl?board=$currentboard;action=multidel;thread=$viewnum/~ |
| |
| . ( !$ttsreverse ? $start : $mreplies - $start ) |
| |
| . q~" method="post" style="display: inline">~; |
| |
| $formend = q~</form>~; |
| |
| |
| |
| $display_template =~ s/{yabb multistart}/$formstart/gsm; |
| |
| $display_template =~ s/{yabb multiend}/$formend/gsm; |
| |
| |
| |
| $display_template =~ s/{yabb pollmain}/$template_pollmain/gsm; |
| |
| $display_template =~ s/{yabb postsblock}/$tmpoutblock/gsm; |
| |
| $display_template =~ s/{yabb adminhandellist}/$adminhandellist/gsm; |
| |
| $display_template =~ s/{yabb forumselect}/$selecthtml/gsm; |
| |
| |
| |
| $yymain .= qq~ |
| |
| $display_template |
| |
| <script type="text/javascript">//<![CDATA[ |
| |
| function uncheckAllBut(counter) { |
| |
| for (var i = 0; i < document.forms["multidel"].length; ++i) { |
| |
| if (document.forms["multidel"].elements[i].type == "checkbox") document.forms["multidel"].elements[i].checked = false; |
| |
| } |
| |
| document.forms["multidel"].elements["del"+counter].checked = true; |
| |
| document.multidel.submit(); |
| |
| }~; |
| |
| |
| |
| if ($sendtopicmail) { |
| |
| my ( $esubject, $emessage ); |
| |
| if ( $sendtopicmail > 1 ) { |
| |
| LoadLanguage('SendTopic'); |
| |
| LoadLanguage('Email'); |
| |
| require Sources::Mailer; |
| |
| $esubject = uri_escape( |
| |
| "$sendtopic_txt{'118'}: $msubthread ($sendtopic_txt{'318'} ${$uid.$username}{'realname'})" |
| |
| ); |
| |
| $emessage = uri_escape( |
| |
| template_email( |
| |
| $sendtopicemail, |
| |
| { |
| |
| 'toname' => '?????', |
| |
| 'subject' => $msubthread, |
| |
| 'displayname' => ${ $uid . $username }{'realname'}, |
| |
| 'num' => $viewnum |
| |
| } |
| |
| ) |
| |
| ); |
| |
| } |
| |
| $yymain .= qq~ |
| |
| |
| |
| function sendtopicmail(action) { |
| |
| var x = "mailto:?subject=$esubject&body=$emessage"; |
| |
| if (action == 3) { |
| |
| Check = confirm('$display_txt{'sendtopicemail'}'); |
| |
| if (Check !== true) x = ''; |
| |
| } |
| |
| if (action == 1 || x === '') x = "$scripturl?action=sendtopic;topic=$viewnum"; |
| |
| window.location.href = x; |
| |
| }~; |
| |
| } |
| |
| |
| |
| $yymain .= qq~ |
| |
| $pageindexjs |
| |
| function ListPages(tid) { window.open('$scripturl?action=pages;num='+tid, '', 'menubar=no,toolbar=no,top=50,left=50,scrollbars=yes,resizable=no,width=400,height=300'); } |
| |
| //]]></script> |
| |
| ~; |
| |
| |
| |
| ## gb_css spot |
| |
| |
| |
| $yytitle = $msubthread; |
| |
| if ( $replybutton and $enable_quickreply ) { |
| |
| $yymain =~ |
| |
| s/(<!-- Threads Admin Button Bar start -->.*?<\/td>)/$1<td class="right">{yabb forumjump}<\/td>/sm; |
| |
| require Sources::Post; |
| |
| $action = 'post'; |
| |
| $INFO{'title'} = 'PostReply'; |
| |
| $Quick_Post = 1; |
| |
| $message = q{}; |
| |
| Post(); |
| |
| } |
| |
| template(); |
| |
| return; |
| } |
| } |
| |
| |
| sub NextPrev { |
| sub NextPrev { |
| fopen(MSGTXT, "$boardsdir/$currentboard.txt") || &fatal_error("cannot_open","$boardsdir/$currentboard.txt", 1); |
| my ( $name, $lastvisit ) = @_; |
| my @threadlist = <MSGTXT>; |
| fopen( MSGTXT, "$boardsdir/$currentboard.txt" ) |
| fclose(MSGTXT); |
| or fatal_error( 'cannot_open', "$boardsdir/$currentboard.txt", 1 ); |
| |
| my @threadlist = <MSGTXT>; |
| $thevirboard = qq~num=~; |
| fclose(MSGTXT); |
| if ($vircurrentboard) { |
| |
| fopen(MSGTXT, "$boardsdir/$vircurrentboard.txt") || &fatal_error("cannot_open","$boardsdir/$vircurrentboard.txt", 1); |
| $thevirboard = q~num=~; |
| my @virthreadlist = <MSGTXT>; |
| if ($vircurrentboard) { |
| fclose(MSGTXT); |
| fopen( MSGTXT, "$boardsdir/$vircurrentboard.txt" ) |
| push(@threadlist, @virthreadlist); |
| or fatal_error( 'cannot_open', "$boardsdir/$vircurrentboard.txt", 1 ); |
| undef @virthreadlist; |
| my @virthreadlist = <MSGTXT>; |
| $thevirboard = qq~virboard=$vircurrentboard;num=~; |
| fclose(MSGTXT); |
| } |
| push @threadlist, @virthreadlist; |
| |
| undef @virthreadlist; |
| my ($countsticky,$countnosticky) = (0,0); |
| $thevirboard = qq~virboard=$vircurrentboard;num=~; |
| my (@stickythreadlist,@nostickythreadlist); |
| } |
| for ($i = 0; $i < @threadlist; $i++) { |
| |
| my $threadstatus = (split /\|/, $threadlist[$i])[8]; |
| my ( $countsticky, $countnosticky ) = ( 0, 0 ); |
| if ($threadstatus =~ /h/i && !$iamadmin && !$iamgmod && !$iammod) { next; } |
| my ( @stickythreadlist, @nostickythreadlist ); |
| if ($threadstatus =~ /s/i || $threadstatus =~ /a/i) { |
| for my $i ( 0 .. $#threadlist ) { |
| $stickythreadlist[$countsticky] = $threadlist[$i]; |
| my $threadstatus = ( split /\|/xsm, $threadlist[$i] )[8]; |
| $countsticky++; |
| if ( $threadstatus =~ /h/ism |
| } else { |
| && !$staff ) |
| $nostickythreadlist[$countnosticky] = $threadlist[$i]; |
| { |
| $countnosticky++; |
| next; |
| } |
| } |
| } |
| if ( $threadstatus =~ /s/ism || $threadstatus =~ /a/ism ) { |
| |
| $stickythreadlist[$countsticky] = $threadlist[$i]; |
| @threadlist = (); |
| $countsticky++; |
| if ($countsticky) { push(@threadlist, @stickythreadlist); } |
| } |
| if ($countnosticky) { push(@threadlist, @nostickythreadlist); } |
| else { |
| |
| $nostickythreadlist[$countnosticky] = $threadlist[$i]; |
| my $name = $_[0]; |
| $countnosticky++; |
| my $lastvisit = int($_[1]); |
| } |
| my $is = 0; |
| } |
| my ($mnum,$mdate,$datecount); |
| |
| for ($i = 0; $i < @threadlist; $i++) { |
| @threadlist = (); |
| ($mnum, undef, undef, undef, $mdate, undef) = split(/\|/, $threadlist[$i], 6); |
| if ($countsticky) { push @threadlist, @stickythreadlist; } |
| if ($mnum == $name) { |
| if ($countnosticky) { push @threadlist, @nostickythreadlist; } |
| if ($i > 0) { |
| |
| ($prev, undef) = split(/\|/, $threadlist[$i - 1], 2); |
| my $is = 0; |
| $prevlink = qq~<a href="$scripturl?$thevirboard$prev">$display_txt{'768'}</a>~; |
| my ( $mnum, $mdate, $datecount ); |
| } else { |
| for my $i ( 0 .. $#threadlist ) { |
| $prevlink = $display_txt{'766'}; |
| ( $mnum, undef, undef, undef, $mdate, undef ) = |
| } |
| split /\|/xsm, $threadlist[$i], 6; |
| if ($i < $#threadlist) { |
| if ( $mnum == $name ) { |
| ($next, undef) = split(/\|/, $threadlist[$i + 1], 2); |
| if ( $i > 0 ) { |
| $nextlink = qq~<a href="$scripturl?$thevirboard$next">$display_txt{'767'}</a>~; |
| ( $prev, undef ) = split /\|/xsm, $threadlist[ $i - 1 ], 2; |
| } else { |
| $prevlink = |
| $nextlink = $display_txt{'766'}; |
| qq~<a href="$scripturl?$thevirboard$prev">$display_txt{'768'}</a>~; |
| } |
| } |
| $is = 1; |
| else { |
| } |
| $prevlink = $display_txt{'766'}; |
| $datecount++ if $mdate > $lastvisit; |
| } |
| last if $is && $datecount > 1; |
| if ( $i < $#threadlist ) { |
| } |
| ( $next, undef ) = split /\|/xsm, $threadlist[ $i + 1 ], 2; |
| |
| $nextlink = |
| if (!$is) { undef $INFO{'num'}; &redirectinternal; } # if topic not found |
| qq~<a href="$scripturl?$thevirboard$next">$display_txt{'767'}</a>~; |
| $datecount; |
| } |
| } |
| else { |
| |
| $nextlink = $display_txt{'766'}; |
| sub SetMsn { |
| } |
| $msnstyle = qq~<link rel="stylesheet" href="$forumstylesurl/$usestyle.css" type="text/css" />~; |
| $is = 1; |
| $msnstyle =~ s~$usestyle\/~~g; |
| } |
| my $msnname = $INFO{'msnname'}; |
| if ( $mdate > $lastvisit ) { $datecount++; } |
| if (!${$uid.$msnname}{'password'}) { &LoadUser($msnname); } |
| last if $is && $datecount > 1; |
| $msnuser = ${$uid.$msnname}{'msn'}; |
| } |
| |
| |
| print qq~Content-type: text/html\n\n~; |
| |
| print qq~<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| |
| <head> |
| |
| <title>$msntxt{'5'}</title> |
| |
| $msnstyle |
| |
| </head> |
| |
| <body class="windowbg2" style="margin: 0px; padding: 0px;"> |
| |
| <table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor"> |
| |
| <tr> |
| |
| <td class="titlebg" align="left" height="22"> |
| |
| <img src="$defaultimagesdir/msn.gif" width="16" height="14" alt="" title="" border="0" /> $msntxt{'5'} |
| |
| </td> |
| |
| </tr> |
| |
| <tr> |
| |
| <td class="windowbg" align="left" height="58"> |
| |
| <img src="$defaultimagesdir/msn.gif" width="16" height="16" style="vertical-align: middle;" alt="${$uid.$msnname}{'realname'}" title="${$uid.$msnname}{'realname'}" border="0" /> $msnuser<br /><br /> |
| |
| </td> |
| |
| </tr> |
| |
| </table> |
| |
| |
| |
| <script language="JavaScript1.2" type="text/javascript"> |
| |
| <!-- |
| |
| function sendmsn(msnto) { |
| |
| var msnControl = new ActiveXObject('Messenger.UIAutomation.1'); |
| |
| if(!msnControl.MyContacts.Count) { |
| |
| alert("$msntxt{'3'}"); |
| |
| return false; |
| |
| } |
| |
| msnControl.AutoSignin(); |
| |
| msnControl.InstantMessage(msnto); |
| |
| window.close(); |
| |
| } |
| |
| |
| |
| function addtomsn(msnto) { |
| |
| var msnControl = new ActiveXObject('Messenger.UIAutomation.1'); |
| |
| msnControl.AutoSignin(); |
| |
| msnControl.AddContact(0, msnto); |
| |
| window.close(); |
| |
| } |
| |
| |
| |
| function notOnline() { |
| |
| alert("$msntxt{'3'}"); |
| |
| return true; |
| |
| } |
| |
| |
| |
| if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.slice(0,4) >= 4 && navigator.userAgent.indexOf("Opera") < 0) { |
| |
| var msnControl = new ActiveXObject('Messenger.UIAutomation.1'); |
| |
| document.write("<input type='button' value='$msntxt{'1'}' style='font-size: 10px' onclick=sendmsn('$msnuser') />"); |
| |
| document.write("<input type='button' value='$msntxt{'2'}' style='font-size: 10px' onclick=addtomsn('$msnuser') />"); |
| |
| } else { |
| |
| document.write("$msntxt{'4'}<br /><br />"); |
| |
| } |
| |
| |
| |
| window.onerror = notOnline; |
| |
| //--> |
| |
| </script> |
| |
| |
| |
| </body> |
| |
| </html> |
| |
| ~; |
| |
| |
| |
| |
| if ( !$is ) { undef $INFO{'num'}; redirectinternal(); } # if topic not found |
| |
| return $datecount; |
| } |
| } |
| |
| |
| sub SetGtalk { |
| sub SetGtalk { |
| $gtalkstyle = qq~<link rel="stylesheet" href="$forumstylesurl/$usestyle.css" type="text/css" />~; |
| my $gtalkname = $INFO{'gtalkname'}; |
| $gtalkstyle =~ s~$usestyle\/~~g; |
| my $gtalkstyle = qq~<link rel="stylesheet" href="$yyhtml_root/Templates/Forum/$usestyle.css" type="text/css" />\n~; |
| my $gtalkname = $INFO{'gtalkname'}; |
| if ( !${ $uid . $gtalkname }{'password'} ) { LoadUser($gtalkname); } |
| if (!${$uid.$gtalkname}{'password'}) { &LoadUser($gtalkname); } |
| $gtalkuser = ${ $uid . $gtalkname }{'gtalk'}; |
| $gtalkuser = ${$uid.$gtalkname}{'gtalk'}; |
| |
| |
| print qq~Content-type: text/html\n\n~ |
| print qq~Content-type: text/html\n\n~; |
| or croak "$croak{'print'} page content"; |
| print qq~<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| $setgtalk = $gtalk; |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| $setgtalk =~ s/{yabb xml_lang}/$abbr_lang/sm; |
| <head> |
| $setgtalk =~ s/{yabb mycharset}/$yymycharset/sm; |
| <title>Google Talk</title> |
| $setgtalk =~ s/{yabb style}/$gtalkstyle/sm; |
| $gtalkstyle |
| $setgtalk =~ s/{yabb gname}/${ $uid . $gtalkname }{'realname'}/gsm; |
| </head> |
| $setgtalk =~ s/{yabb gtalkuser}/$gtalkuser/gsm; |
| <body class="windowbg2" style="margin: 0px; padding: 0px;"> |
| |
| <table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor"> |
| print $setgtalk or croak "$croak{'print'} page"; |
| <tr> |
| return; |
| <td class="titlebg" align="left" height="22"> |
| |
| <img src="$defaultimagesdir/gtalk2.gif" width="16" height="14" alt="" title="" border="0" /> |
| |
| Google Talk |
| |
| </td> |
| |
| </tr> |
| |
| <tr> |
| |
| <td class="windowbg" align="left" height="58"> |
| |
| <img src="$defaultimagesdir/gtalk2.gif" width="16" height="14" style="vertical-align: middle;" alt="${$uid.$gtalkname}{'realname'}" title="${$uid.$gtalkname}{'realname'}" border='0' /> $gtalkuser<br /><br /> |
| |
| </td> |
| |
| </tr> |
| |
| </table> |
| |
| </body> |
| |
| </html> |
| |
| ~; |
| |
| } |
| } |
| |
| |
| sub ThreadPageindex { |
| sub ThreadPageindex { |
| #my ($msindx, $trindx, $mbindx); |
| |
| my ($msindx, $trindx, $mbindx,$pmindx) = split(/\|/, ${$uid.$username}{'pageindex'}); |
| my ( $msindx, $trindx, $mbindx, $pmindx ) = |
| if ($INFO{'action'} eq "threadpagedrop") { |
| split /\|/xsm, ${ $uid . $username }{'pageindex'}; |
| ${$uid.$username}{'pageindex'} = qq~$msindx|0|$mbindx|$pmindx~; |
| if ( $INFO{'action'} eq 'threadpagedrop' ) { |
| } |
| ${ $uid . $username }{'pageindex'} = qq~$msindx|0|$mbindx|$pmindx~; |
| if ($INFO{'action'} eq "threadpagetext") { |
| } |
| ${$uid.$username}{'pageindex'} = qq~$msindx|1|$mbindx|$pmindx~; |
| if ( $INFO{'action'} eq 'threadpagetext' ) { |
| } |
| ${ $uid . $username }{'pageindex'} = qq~$msindx|1|$mbindx|$pmindx~; |
| if (exists($INFO{'reversetopic'})) { |
| } |
| ${$uid.$username}{'reversetopic'} = $INFO{'reversetopic'} ? 0 : 1; |
| if ( exists $INFO{'reversetopic'} ) { |
| } |
| ${ $uid . $username }{'reversetopic'} = $INFO{'reversetopic'} ? 0 : 1; |
| &UserAccount($username, "update"); |
| } |
| $yySetLocation = qq~$scripturl?num=$INFO{'num'}/$INFO{'start'}~; |
| UserAccount( $username, 'update' ); |
| &redirectexit; |
| $yySetLocation = qq~$scripturl?num=$INFO{'num'}/$INFO{'start'}~; |
| |
| redirectexit(); |
| |
| return; |
| } |
| } |
| |
| |
| sub undumplog { # Used to mark a thread as unread |
| sub undumplog { # Used to mark a thread as unread |
| # Load the log file |
| # Load the log file |
| &getlog; |
| getlog(); |
| |
| |
| &dumplog("$INFO{'thread'}--unread") if $yyuserlog{$INFO{'thread'}}; |
| if ( $yyuserlog{ $INFO{'thread'} } ) { dumplog("$INFO{'thread'}--unread"); } |
| |
| |
| &redirectinternal; |
| redirectinternal(); |
| |
| return; |
| } |
| } |
| |
| |
| 1; |
| 1; |
| |
| |