Support » Plugin: FD Footnotes Plugin » [Plugin: FD Footnotes Plugin] PHP Notices on Footnotes Configuration page

  • Philip Arthur Moore

    (@philiparthurmoore)


    Volunteer Moderator

    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/

Viewing 1 replies (of 1 total)
  • Philip Arthur Moore

    (@philiparthurmoore)

    Volunteer Moderator

    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.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: FD Footnotes Plugin] PHP Notices on Footnotes Configuration page’ is closed to new replies.