#####################################################
#  LEO SuperCool BBS / LeoBBS X / 雷傲極酷超級論壇  #
#####################################################
# 基於山鷹(糊)、花無缺製作的 LB5000 XP 2.30 免費版  #
#   新版程式製作 & 版權所有: 雷傲科技 (C)(R)2004    #
#####################################################
#      主頁地址： http://www.LeoBBS.com/            #
#      論壇地址： http://bbs.LeoBBS.com/            #
#####################################################

(my $membername1, my $topictitle1, my $postipaddresstemp1, my $showemoticons1, my $showsignature1, my $postdate1, my $post1, my $posticon1) = split(/\t/, $threads[0]);

    if ($jfmark eq "yes") {
	if ($post1 =~m/\[jf=(.+?)\](.+?)\[\/jf\]/isg){ 
	    $jfpost=$1;
	    if (($jfpost <= $jifen)||($mymembercode eq "ad")||($mymembercode eq "smo")||($myinmembmod eq "yes")||(lc($membername) eq lc($inmembername))){ 
	    } else { 
	        $noviewthis = "yes" if ($noviewjf eq "yes");
   	    }
   	}
    }

if ($noviewthis ne "yes") {
    my @sortedthreads = reverse(@threads);
    my $threadsize=@sortedthreads;
    $listmy=0 if ($listmy eq "");
    if ($listmy==0){
	$listmy=qq~[<a href=$thisprog?action=$action&forum=$inforum&topic=$intopic&postno=$inpostno&listmy=1>列出所有回覆</a>]~;
	$listme=",最多列出 $maxlistpost 個";
	$threadsize=$maxlistpost if ($threadsize>$maxlistpost);
    } else {
	$listmy=qq~[<a href=$thisprog?action=$action&forum=$inforum&topic=$intopic&postno=$inpostno&listmy=0>列出前 $maxlistpost 個回覆</a>]~;
	$listme="";
    }
    $output .= qq~<p><script language="javascript">function addquote(no){var membername = eval("membername" + no);var postdate = eval("postdate" + no);var post = eval("post" + no);var text = "[quote][b]下面引用由[u]" + membername.innerText + "[/u]在 [i]" + postdate.innerText + "[/i] 發表的內容：[/b]\\n" + post.innerText.substring(0, 200) + "\\n[/quote]\\n";if (document.FORM.inpost.createTextRange && document.FORM.inpost.caretPos){var caretPos = document.FORM.inpost.caretPos;caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;}else{document.FORM.inpost.value += text;}document.FORM.inpost.focus();}</script>
<SCRIPT>valigntop()</SCRIPT><table cellpadding=0 cellspacing=0 width=$tablewidth bgcolor=$tablebordercolor align=center>
<tr><td><table cellpadding=6 cellspacing=1 width=100% >
<tr><td bgcolor=$titlecolor colspan=2 $catbackpic><font color=$titlefontcolor><b>文章$div_one覽：$topictitle (新回覆在最前$listme)</b>　 $listmy</td>
~;

    $postbackcolor = $miscbackone;
    for (my $i=0;$i<$threadsize;$i++){
        ($membername, $topictitle, $postipaddress ,$showemoticons ,$showsignature ,$postdate ,$post, $posticon) = split(/\t/, $sortedthreads[$i]);
	&getmember($membername,"no");
	$post = "此會員的發言已經被屏蔽！" if ($membercode eq "masked");

        $postdate = $postdate + ($timedifferencevalue + $timezone)*3600;
        $postdate = &dateformat("$postdate");
	$post =~ s/\[hide\](.*)\[\/hide\]/<font color=red>隱藏內容不能預覽<\/font>/isg; 
	$post="<font color=red>加密文章不能預覽<\/font>" if (($post=~/LBHIDDEN\[(.*?)\]LBHIDDEN/sg)||($post=~/LBSALE\[(.*?)\]LBSALE/sg));
	$post =~ s/\[curl=\s*(http|https|ftp):\/\/(.*?)\s*\]/\[加密連結\]/isg if ($usecurl ne "no");
	$post =~ s/\[USECHGFONTE\]//sg;
	$post =~ s/\[post=(.+?)\](.+?)\[\/post\]/<blockquote><font face=$font>文章內容 : <hr noshade size=1><font color=red>本內容已被隱藏 , 總發言數須有$1$div_then能查看<\/font><hr noshade size=1><\/font><\/blockquote>/isg; 
	$post =~ s/\[jf=(.+?)\](.+?)\[\/jf\]/<blockquote><font face=$font>文章內容 : <hr noshade size=1><font color=red>本內容已被隱藏 , 積分必須達到$1$div_then能查看<\/font><hr noshade size=1><\/font><\/blockquote>/isg; 

	if ($post =~ /\[POSTISDELETE=(.+?)\]/) {
    	    $postdelete = 1;
    	    if ($1 ne " ") { $presult = "<BR>屏蔽理由：$1<BR>"; } else { $presult = "<BR>"; }
	    $post = "此文章內容已經被單獨屏蔽！$presult";
	}

        if ($idmbcodestate eq 'on') {
	    &lbcode(\$post);
            if ($post =~/<blockquote><font face=$font>控制碼/isg){
                $post =~ s/\&amp\;/\&/ig ;
                $post =~ s/\&lt\;br\&gt\;/<br>/ig;
	    }
        } else { &lbnocode(\$inpost); $post =~ s/\[DISABLELBCODE\]//isg; }
        if (($emoticons eq 'on') && ($showemoticons eq 'yes')) {
            &doemoticons(\$post);
 	    &smilecode(\$post);
	}

	$output .= qq~<table style="TABLE-LAYOUT:fixed" cellpadding=8 cellspacing=1 width=100%>
<tr><td bgcolor=$miscbackone rowspan=2 valign="top" width=20%><font color=$fontcolormisc><b><span id=membername$i>$membername</span></b></font></td>
<td bgcolor=$miscbackone><font color=$fontcolormisc><input type=button onClick="addquote($i)" value="引用"> <b>發表於： <span id=postdate$i>$postdate</span></b></td></tr>
<tr><td bgcolor="$miscbackone" style="LEFT:0px;WIDTH:100%;WORD-WRAP:break-word"><font color=$fontcolormisc><span id=post$i>$post</span></td></tr>
<tr><td colspan=2 bgcolor=$miscbacktwo>&nbsp;</td></tr></table>
        ~;
    }
}
    $output .= qq~<SCRIPT>valignend()</SCRIPT></table></td></tr></table>~;
1;
