[첫화면으로]UseModWiki소스수정/최근변경내역테이블출력

마지막으로 [b]

최근변경내역 화면을 표 형식으로 출력함

# 함수 전체
sub GetRcHtml {
    my @outrc = @_;
    my ($rcline, $html, $date, $sum, $edit, $count, $newtop, $author);
    my ($showedit, $inlist, $link, $all, $idOnly);
    my ($ts, $oldts, $pagename, $summary, $isEdit, $host, $kind, $extraTemp);
    my ($tEdit, $tChanges, $tDiff);
    my %extra = ();
    my %changetime = ();
    my %pagecount = ();

    $tEdit    = T('(edit)');    # Optimize translations out of main loop
    $tDiff    = T('(diff)');
    $tChanges = T('changes');
    $showedit = &GetParam("rcshowedit", $ShowEdits);
    $showedit = &GetParam("showedit", $showedit);

###############
### added by gypark
### 최근변경내역에 북마크 기능 도입
    my $bookmark;
    my $bookmarkuser = &GetParam('username', "");
    my ($rcnew, $rcupdated, $rcdiff, $rcdeleted) = (
            "<img style='border:0' src='icons/rc-new.gif'>",
            "<img style='border:0' src='icons/rc-updated.gif'>",
            "<img style='border:0' src='icons/rc-diff.gif'>",
            "<img style='border:0' src='icons/rc-deleted.gif'>"
    );
    $bookmark = &GetParam('bookmark',-1);
###
###############


    if ($showedit != 1) {
        my @temprc = ();
        foreach $rcline (@outrc) {
            ($ts, $pagename, $summary, $isEdit, $host) = split(/$FS3/, $rcline);
            if ($showedit == 0) {  # 0 = No edits
                push(@temprc, $rcline)  if (!$isEdit);
            } else {               # 2 = Only edits
                push(@temprc, $rcline)  if ($isEdit);
            }
        }
        @outrc = @temprc;
    }

    # Later consider folding into loop above?
    # Later add lines to assoc. pagename array (for new RC display)
    foreach $rcline (@outrc) {
        ($ts, $pagename) = split(/$FS3/, $rcline);
###############
### replaced by gypark
### 최근변경내역에 북마크 기능 도입
#       $pagecount{$pagename}++;
        $pagecount{$pagename}++ if ($ts > $bookmark);
###
###############
        $changetime{$pagename} = $ts;
    }
    $date = "";
    $inlist = 0;
###############
### replaced by gypark
### 최근 변경 내역을 테이블로 출력
### from Jof4002's patch
#   $html = "";
    $html = "<table style='border:0'>";
###
###############
    $all = &GetParam("rcall", 0);
    $all = &GetParam("all", $all);
    $newtop = &GetParam("rcnewtop", $RecentTop);
    $newtop = &GetParam("newtop", $newtop);
    $idOnly = &GetParam("rcidonly", "");

    @outrc = reverse @outrc if ($newtop);
    ($oldts, $pagename, $summary, $isEdit, $host, $kind, $extraTemp)
        = split(/$FS3/, $outrc[0]);
    $oldts += 1;
    foreach $rcline (@outrc) {
        ($ts, $pagename, $summary, $isEdit, $host, $kind, $extraTemp)
            = split(/$FS3/, $rcline);
        # Later: need to change $all for new-RC?
        next  if ((!$all) && ($ts < $changetime{$pagename}));
        next  if (($idOnly ne "") && ($idOnly ne $pagename));
        next  if ($ts >= $oldts);
        $oldts = $ts;
        # print $ts . " " . $pagename . "<br>\n";
        %extra = split(/$FS2/, $extraTemp, -1);
        if ($date ne &CalcDay($ts)) {
            $date = &CalcDay($ts);
            if ($inlist) {
###############
### commented by gypark
### 최근 변경 내역을 테이블로 출력
### from Jof4002's patch
#               $html .= "</UL>\n";
###
###############
                $inlist = 0;
            }
###############
### replaced by gypark
### 최근변경내역에 북마크 기능 도입
### 최근 변경 내역을 테이블로 출력 패치도 같이 적용
#           $html .= "<p><strong>" . $date . "</strong><p>\n";
            $html .= "<tr><td colspan=6 style='border:0;'><br><b>" . $date . "</b>";
            if ($bookmarkuser eq "") {
                $html .= "<br>&nbsp;</td></tr>\n";
            } else {
                $html .= "  [" .&ScriptLink("action=bookmark&time=$ts",T('set bookmark')) ."]"
                    . "</td></tr>\n";
            }
###
###############
        }
        if (!$inlist) {
###############
### commented by gypark
### 최근 변경 내역을 테이블로 출력
### from Jof4002's patch
#           $html .= "<UL>\n";
###
###############
            $inlist = 1;
        }
        $host = &QuoteHtml($host);
        if (defined($extra{'name'}) && defined($extra{'id'})) {
            $author = &GetAuthorLink($host, $extra{'name'}, $extra{'id'});
        } else {
            $author = &GetAuthorLink($host, "", 0);
        }
        $sum = "";
        if (($summary ne "") && ($summary ne "*")) {
            $summary = &QuoteHtml($summary);
###############
### replaced by gypark
### 최근 변경 내역을 테이블로 출력
#           $sum = "<strong>[$summary]</strong> ";
            $sum = "<span style='color:green'>[$summary]</span> ";
###
###############
        }
        $edit = "";
        $edit = "<em>$tEdit</em> "  if ($isEdit);
        $count = "";
        if ((!$all) && ($pagecount{$pagename} > 1)) {
            $count = "($pagecount{$pagename} ";
            if (&GetParam("rcchangehist", 1)) {
                $count .= &GetHistoryLink($pagename, $tChanges);
            } else {
                $count .= $tChanges;
            }
            $count .= ") ";
        }
        $link = "";
        if ($UseDiff && &GetParam("diffrclink", 1)) {
###############
### replaced by gypark
### 최근변경내역에 북마크 기능 도입
#           $link .= &ScriptLinkDiff(4, $pagename, $tDiff, "") . "  ";
            if (!(-f &GetPageFile($pagename))) {
                $link .= &GetHistoryLink($pagename, $rcdeleted);
            } elsif (($bookmarkuser eq "") || ($ts <= $bookmark)) {
                $link .= &ScriptLinkDiff(4, $pagename, $rcdiff, "") . "  ";
            } elsif ($extra{'tscreate'} > $bookmark) {
                $link .= $rcnew . "  ";
            } else {
                $link .= &ScriptLinkDiffRevision(5, $pagename, "", $rcupdated) . "  ";
            }
###
###############
        }
###############
### replaced by gypark
### 최근 변경 내역을 테이블로 출력
### from Jof4002's patch
#       $link .= &GetPageLink($pagename);
#       $html .= "<li>$link ";
#       # Later do new-RC looping here.
#       $html .=  &CalcTime($ts) . " $count$edit" . " $sum";
#       $html .= ". . . . . $author\n";  # Make dots optional?
#   }
#   $html .= "</UL>\n" if ($inlist);
        $html .= "<tr><td style='border:0'>&nbsp;&nbsp;&nbsp;</td>"
            . "<td style='border:0'>$link </td>"
            . "<td style='border:0'>" . &GetPageOrEditLink($pagename) . "</td>"
            . "<td style='border:0'>" . &CalcTime($ts) . "</td>"
            . "<td style='border:0'>$count$edit</td>"
            . "<td style='border:0'>$author</td></tr>\n";
        if ($sum ne "") {
            $html .= "<tr><td systems='border:0' colspan=2></td>"
                . "<td colspan=4 style='border:0'>&nbsp;&nbsp;$sum</td></tr>\n";
        }
    }
    $html .= "</table>";

###
###############
    return $html;
}

Notes

날짜 출력하는 부분에서 tr 태그가 빠져있네요. 닫는건 나옵니다.
-- 조프 2003-2-25 4:07 pm

그렇군요. 수정했습니다.
#           $html .= "<td colspan=6 style='border:0;'><br><b>" . $date . "</b>";
            $html .= "<tr><td colspan=6 style='border:0;'><br><b>" . $date . "</b>";  # <tr> 을 추가
-- Raymundo 2003-2-25 10:44 pm


위키위키분류

마지막 편집일: 2007-1-8 12:19 pm (변경사항 [d])
1207 hits | Permalink | 변경내역 보기 [h] | 페이지 소스 보기