[첫화면으로]UseModWiki소스수정/MySign매크로

마지막으로 [b]

<mysign(name,time)> 매크로 도입

sub MacroSubst {
    ...
    # 원래 소스 코드에는 &lt; 와 &gt; 로 적혀 있는 것을, {{{ }}} 태그 사용을 위하여 
    # &__LT__; 와 &__GT__; 로 수정했다. 자세한 내용은 {{{ }}} 태그 도입 항목을 참조
    $txt =~ s/\&__LT__;goto\((.*)\)\&__GT__;/&MacroGoto($1)/gei;
    $txt =~ s/\&__LT__;history\((.*)\)\&__GT__;/&MacroHistory($1)/gei;
### 다음 라인을 추가
    $txt =~ s/\&__LT__;mysign\(([^,]+),(\d+-\d+-\d+ \d+:\d+.*)\)\&__GT__;/&MacroMySign($1, $2)/gei;
###
    return $txt;
}
적당한 위치에 MacroMySign 함수 전체를 삽입한다
sub MacroMySign {
    my ($author, $timestamp) = @_;
    return "\n<div align=\"right\">-- $author <small>$timestamp</small></div>\n";
}


위키위키분류

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