[Home]WikiPatches/Footnote

UseModWiki | WikiPatches | RecentChanges | Preferences

An implementation for Usemod with patch from [http://gypark.pe.kr/wiki/UseModWiki소스수정/Footnote매크로] thanks to GyPark.

The new markup was inspired in http://www.oddmuse.org/cgi-bin/wiki/Footnotes_Extension

Patch

65c65,66
<   $ConfigError $UploadPattern );
---
>   $ConfigError $UploadPattern
>   $MyFootNoteCounter $MyFootNotes @MyFootnotes %SaveNumFootnote);
1577a1579
>   $MyFootNoteCounter = 0;
1598a1601,1606
>   if ($MyFootNoteCounter > 0) {
>       map { s/_MARK_// } @MyFootnotes;
>       $pageText .= "<DIV class='footnote'>" . "\n" .
>       "<strong>" . T('Footnote:') . "</strong><br>\n" .
>       (join (('', @MyFootnotes))) . "</DIV>";
>     }
1609a1618,1632
> sub FootNote {
> my ($note) = @_;
>
> $MyFootNoteCounter++;
>
> my $number = "<A class='footnote' name='fn_$MyFootNoteCounter'
>              href='#fnr_$MyFootNoteCounter'>$MyFootNoteCounter</A> ";
> if (defined $SaveNumFootnote{$note}) {
>   $MyFootnotes[$SaveNumFootnote{$note}] =~ s/_MARK_/$number _MARK_/;
> } else { push @MyFootnotes, $number . " _MARK_$note" . "<br>\n";
>   $SaveNumFootnote{$note} = $#MyFootnotes;
> }
> return "<A class='footnote' name='fnr_$MyFootNoteCounter' href='#fn_MyFootNote
Counter'>[$MyFootNoteCounter]</A>";
> }
>
1619a1643
>     s/(\[\[\[([^\n]+?)\]\]\])/&FootNote($2)/ige;
--JuanmaMP

UseModWiki | WikiPatches | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited May 20, 2012 12:28 pm by JuanmaMP (diff)
Search: