[첫화면으로]UseModWiki소스수정/PDA용클립

마지막으로 [b]

PDA 에서 보기 좋은 형태의 클립 페이지 출력

wiki.pl 수정

IsPDA 변수 추가
...
### 패치를 위해 추가된 내부 전역 변수
use vars qw(%RevisionTs $FS_lt $FS_gt $StartTime $Sec_Revision $Sec_Ts
    $ViewCount $AnchoredFreeLinkPattern %UserInterest %HiddenPage
    $pageid $IsPDA);
###
...

아래의 소스들은 예전에 다른 패치 때문에 수정되었던 부분들을 다시 수정하는 부분이 많으니 주의.
sub DoBrowseRequest {
    ...
    $id = &GetParam('keywords', '');
###############
### pda clip by gypark
    $IsPDA = &GetParam("pda", "");
    $EmbedWiki = 1 if ($IsPDA);
###
###############
    if ($id) {                    # Just script?PageName
    ...
    } elsif ($action eq 'rc') {
###############
### pda clip by gypark
#       &BrowsePage(T($RCName));
        if ($IsPDA) {
            my $temp_id = T("$RCName");
            print &GetHeader($temp_id, &QuoteHtml($temp_id), "");
            &DoRc();
            print $q->end_html;
        } else {
            &BrowsePage(T($RCName));
        }
###
###############
        return 1;
    } elsif ($action eq 'random') {
    ...
}

sub DoRc {
    ...
    my $showbar = 0;

###############
### pda clip by gypark
    if ($IsPDA) {
        $daysago = &GetParam("days", 0);
        $daysago = 7 if ($daysago == 0);
        $starttime = $Now - ((24*60*60)*$daysago);
        print "<h2>$SiteName : " .
            Ts('Updates in the last %s day' . (($daysago != 1)?"s":""), $daysago) . "</h2>\n";
    } else {
###
###############
    if (&GetParam("sincelastvisit", 0)) {
    ...
        # Translation of above line is identical to previous version
    }
###############
### pda clip by gypark
    }
###
###############

    # Read rclog data (and oldrclog data if needed)
    ($status, $fileData) = &ReadFile($RcFile);
    ...
        print '<b>(' . Ts('for %s only', &ScriptLink($idOnly, $idOnly))
                    . ')</b><br>';
    }
###############
### pda clip by gypark
    if (!($IsPDA)) {
###
###############
    foreach $i (@RcDays) {
        print " | "  if $showbar;
    ...
            Ts('currently set to %s', &TimeToText($bookmark)).
            ")<br>\n";
    }
###
###############
###############
### pda clip by gypark
    }
###
###############

    # Later consider a binary search?
    $i = 0;
    ...
}

sub GetRcHtml {
    ...
    $inlist = 0;
###############
### replaced by gypark
### 최근 변경 내역을 테이블로 출력
### from Jof4002's patch
### pda clip 기능 추가
#   $html = "";
    if ($IsPDA) {
        $html = "";
    } else {
        $html = "<TABLE class='rc'>";
    }
###
###############
    $all = &GetParam("rcall", 0);
    ...
            if ($inlist) {
###############
### commented by gypark
### 최근 변경 내역을 테이블로 출력
### from Jof4002's patch
### pda clip 기능 추가
#               $html .= "</UL>\n";
                $html .= "</UL>\n" if ($IsPDA);
###
###############
                $inlist = 0;
    ...
###############
### replaced by gypark
### 최근변경내역에 북마크 기능 도입
### 최근 변경 내역을 테이블로 출력 패치도 같이 적용
### pda clip 기능 추가
#           $html .= "<p><strong>" . $date . "</strong><p>\n";
            if ($IsPDA) {
                $html .= "<p><strong>" . $date . "</strong><p>\n";
            } else {
                $html .= "<TR class='rc'><TD colspan='6' class='rcblank'>&nbsp;</TD></TR>".
                    "<TR class='rc'>".
                    "<TD colspan=6 class='rcdate'><b>" . $date . "</b>";
                if ($bookmarkuser eq "") {
                    $html .= "</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
### pda clip 기능 추가
#           $html .= "<UL>\n";
            $html .= "<UL>\n" if ($IsPDA);
###
###############
            $inlist = 1;
        }
        $host = &QuoteHtml($host);
        if (defined($extra{'name'}) && defined($extra{'id'})) {
###############
### pda clip by gypark
#           $author = &GetAuthorLink($host, $extra{'name'}, $extra{'id'});
            if ($IsPDA) {
                $author = &GetPageLink($extra{'name'});
            } else {
                $author = &GetAuthorLink($host, $extra{'name'}, $extra{'id'});
            }
###
###############
        } else {
            $author = &GetAuthorLink($host, "", 0);
        }
    ...
        }
###############
### replaced by gypark
### 최근 변경 내역을 테이블로 출력
### from Jof4002's patch
### pda clip 기능 추가
#       $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);
        if (!($IsPDA)) {
            $html .= "<TR class='rc'>"
                . "<TD class='rc'>"
### 관심 페이지
                . ((defined ($UserInterest{$pagename}))?"$rcinterest":"&nbsp;&nbsp;")
                . "</TD>"
                . "<TD class='rc'>$link </TD>"
                . "<TD class='rcpage'>" . &GetPageOrEditLink($pagename) . "</TD>"
                . "<TD class='rctime'>" . &CalcTime($ts) . "</TD>"
                . "<TD class='rccount'>$count$edit</TD>"
                . "<TD class='rcauthor'>$author</TD></TR>\n";
            if ($sum ne "") {
                $html .= "<TR class='rc'><TD colspan=2 class='rc'></TD>"
                    . "<TD colspan=4 class='rcsummary'>&nbsp;&nbsp;$sum</TD></TR>\n";
            }
        } else {
            $link = &GetPageLink($pagename);
            $html .= "<li>$link ... ";
            # Later do new-RC looping here.
            $html .=  &CalcTime($ts) . " - $author $sum\n";
        }
    }
    if ($IsPDA) {
        $html .= "</UL>\n";
    } else {
        $html .= "</table>";
    }

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

sub GetPageLink {
    my ($id) = @_;
    ...
        $name =~ s/_/ /g;
    }
###############
### pda clip by gypark
    if ($IsPDA) {
        return  &ScriptLink("action=browse&pda=1&id=$id", $name);
    }
###
###############
    return &ScriptLink($id, $name);
}

sub GetPageLinkText {
    my ($id, $name) = @_;
    ...
    }
###############
### pda clip by gypark
    if ($IsPDA) {
        return  &ScriptLink("action=browse&pda=1&id=$id", $name);
    }
###
###############
    return &ScriptLink($id, $name);
}

sub GetHeader {
    ...
    $result .= &GetHtmlHeader("$SiteName: $title", $title);
###############
### pda clip by gypark
    if ($IsPDA) {
        $result .= "<h1>$title</h1>\n<hr>";
    }
###
###############

    return $result  if ($embed);
    ...
}

Notes

ext1.50a - URL 에 days 인자를 주어 변경내역에서 출력할 날의 범위를 지정할 수 있게 함
-- Raymundo 2003-9-22 9:28 pm


위키위키분류

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