' . $l_str_ReferencesLabel . '

'; /* contains the footnote template */ $l_str_FootnoteTemplate = file_get_contents( FOOTNOTES_TEMPLATES_DIR . "container.html" ); /* loop through all footnotes found in the page */ for ( $l_str_Index = 0; $l_str_Index < count( $g_arr_Footnotes ); $l_str_Index++ ) { /* get footnote text */ $l_str_FootnoteText = $g_arr_Footnotes[ $l_str_Index ]; /* if fottnote is empty, get to the next one */ if ( empty( $l_str_FootnoteText ) ) { continue; } /* get footnote index */ $l_str_FirstFootnoteIndex = ( $l_str_Index + 1 ); $l_str_FootnoteIndex = ( $l_str_Index + 1 ); /* check if it isn't the last footnote in the array */ if ( $l_str_FirstFootnoteIndex < count( $g_arr_Footnotes ) && $l_bool_CombineIdentical ) { /* get all footnotes that I haven't passed yet */ for ( $l_str_CheckIndex = $l_str_FirstFootnoteIndex; $l_str_CheckIndex < count( $g_arr_Footnotes ); $l_str_CheckIndex++ ) { /* check if a further footnote is the same as the actual one */ if ( $l_str_FootnoteText == $g_arr_Footnotes[ $l_str_CheckIndex ] ) { /* set the further footnote as empty so it won't be displayed later */ $g_arr_Footnotes[ $l_str_CheckIndex ] = ""; /* add the footnote index to the actual index */ $l_str_FootnoteIndex .= ", " . ( $l_str_CheckIndex + 1 ); } } } /* add the footnote to the output box */ $l_str_ReplaceText = str_replace( "[[FOOTNOTE INDEX SHORT]]", $l_str_FirstFootnoteIndex, $l_str_FootnoteTemplate ); $l_str_ReplaceText = str_replace( "[[FOOTNOTE INDEX]]", $l_str_FootnoteIndex, $l_str_ReplaceText ); $l_str_ReplaceText = str_replace( "[[FOOTNOTE TEXT]]", $l_str_FootnoteText, $l_str_ReplaceText ); /* add the footnote container to the output */ $l_str_Output = $l_str_Output . $l_str_ReplaceText; } /* return the output string */ return $l_str_Output; }