<vote(count[,scale])> 매크로 추가
-  WikiX 에 있는 매크로를 흉내내다. (왜 창작은 못할까... -.-;)
 -  사용법 - <vote(count[,scale])>
-  count * scale 의 길이(픽셀 단위)의 막대가 그려진다
 -  scale 을 생략하면 기본값은 10이다.
 -  Vote매크로 참조
 
 
- 
 
sub MacroSubst {
    ...
    $txt =~ s/\&__LT__;vote\((\d+)(,(\d+))?\)&__GT__;/&MacroVote($1,$3)/gei;
    return $txt;
}
- 
 
sub MacroVote {
    my ($count, $scale) = @_;
    my $maximum = 1000;
    $scale = 10 if ($scale eq '');
    my $width = $count * $scale;
    $width = $maximum if ($width > $maximum);
    return "<table ".(($width)?"bgcolor=\"lightgrey\" ":"")
        ."width=\"$width\" style=\"border:1 solid gray;\">"
        ."<tr><td style=\"padding:0; border:none; font-size:8pt;\">$count"
        ."</td></tr></table>";
}
위키위키분류