Not signed in ( Sign In)

Categories

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    •  
      CommentAuthorStanley
    • CommentTimeAug 20th 2009 edited
     permalink
    I'm using footnotes in a document which I've got spread over a number of pages, and I'd prefer to have the numbers continue from [1] to [however many I end up with] rather than have each page start at [1] again.

    Is it possible to insert a bit of code to get the plugin to recognise what the first number used on a page is, and have the footnotes at the bottom start from that number? I can put any numbers in, and it'll work, but (as I found after doing about 20 pages) the notes at the bottom all start at [1] (even though they link ok with whatever numbers I've used).
    •  
      CommentAuthorStanley
    • CommentTimeAug 21st 2009
     permalink
    I've been trying to do it but I can't seem to get the number to appear where I want it. I'm sure this will work if I can put the same number (the one which goes in the hyperlinks between the note and the reference) where it says "START= ".

    The following DOESN'T work...

    function footnotes($matches) {

    $str = '<div class="footnotes"><h4>Footnotes</h4><ol START= {$n}>';
    •  
      CommentAuthorStanley
    • CommentTimeAug 21st 2009
     permalink
    It's ok - I did it an easier way by changing it to an unordered list, jettisoning the bullets and re-writing the return link to just show the "^" plus the reference number (there's a picture here of what it looks like)

    function note($n,$s) {
    $id=$this->id;
    $this->refs = true;

    return
    '<li>'.
    "<a id=\"$id-fn-{$n}\" href=\"#$id-rel-{$n}\" ".
    "title=\"go back up to {$n}\">^{$n}</a> ".trim($s).
    '</li>';
    }

    function footnotes($matches) {

    $str = '<div class="footnotes"><h4>Footnotes</h4><ul style="list-style-type: none;">';


    $lines = preg_split('|\[([0-9]+)\]|', $matches[1], -1, PREG_SPLIT_DELIM_CAPTURE);

    array_shift($lines);

    while ((list (,$n) = each($lines)) && (list (,$s) = each($lines)))
    $str .=$this->note($n, $s);


    $str .= '</ul></div>';

    return $str;

    }