WordPress.org

Ready to get started?Download WordPress

Forums

FD Footnotes Plugin
PHP Notices on Footnotes Configuration page (2 posts)

  1. Philip Arthur Moore
    Volunteer Moderator
    Posted 2 years ago #

    Hi FD. This is a great plugin. Thank you for creating it. I want to give you a heads up about a PHP notice that is triggered after activation of the plugin for the first time, before a user saves his options on the fd-footnotes/fdfootnotes.php page. The notice is as follows:

    Notice: Undefined index: fdfootnote_single in ...\wp-content\plugins\fd-footnotes\fdfootnotes.php on line 94

    On line 59 of this file there is the following code:

    if (!isset($options['fdfootnote_collapse'])) $options['fdfootnote_collapse'] = 0;

    I changed the code to this:

    if (!isset($options['fdfootnote_collapse'])) $options['fdfootnote_collapse'] = 0;
    if (!isset($options['fdfootnote_single'])) $options['fdfootnote_single'] = 0;

    This seems to fix the problem. Again, thanks for your great plugin. Cheers.

    http://wordpress.org/extend/plugins/fd-footnotes/

  2. Philip Arthur Moore
    Volunteer Moderator
    Posted 2 years ago #

    Hi FD. There's one more problem. On lines 129-131 you have the following code:

    if ($linksingle) $singleurl = get_permalink();
    
    $content = str_replace($fn, "<sup class='footnote'><a href='$singleurl#fn-$post_id-$n' id='fnref-$post_id-$n' onclick='return fdfootnote_show($post_id)'>$n</a></sup>", $content);

    This causes an Undefined variable: singleurl when $linksingle evaluates to false. The following code fixes this issue for me:

    if ( isset ( $singleurl ) )
    	$content = str_replace($fn, "<sup class='footnote'><a href='$singleurl#fn-$post_id-$n' id='fnref-$post_id-$n' onclick='return fdfootnote_show($post_id)'>$n</a></sup>", $content);
    else
    	$content = str_replace($fn, "<sup class='footnote'><a href='#fn-$post_id-$n' id='fnref-$post_id-$n' onclick='return fdfootnote_show($post_id)'>$n</a></sup>", $content);

    There may be a better way to do this (like checking if $singleurl is set before this part of the code, but this works well for me. Thanks again for the nice plugin.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic