[(#REM) /********************************************************************************** * @copyright copyright (c) 2012 Matt Chesstale * @license GNU General Public License version 3 * @Usage * If is the document of number 1 associated to the downloaded .pgn file, * use in the article the syntax: * * @Example In a SPIP article: * Example 1: * Example 2: * Example 3: * with md = movesDisplay and p = puzzle * @Caution the options eo = extendedoptions and pd = pgnData are not allowed * @Return HTML code of the iframe to run board.html with the indicated .pgn document **********************************************************************************/ ] 1) && ($UrlPgn[0] == '.')) $UrlPgn = substr($UrlPgn, 1); // Remove relative dot if ($UrlPgn[0] != '/') $UrlPgn = '/' . $UrlPgn; $option = '[(#ENV{option})]'; // Get the options after "|" in the template $lenOpt = strlen($option); if ($lenOpt > LenQuote * 2) { if (substr($option, 0, LenQuote) == QUOTE_HTML) $option = substr($option, LenQuote); // Remove first double quote coded in HTML $lenOpt = $lenOpt - LenQuote; if (($lenOpt > LenQuote) && (substr($option, $lenOpt- LenQuote, LenQuote) == QUOTE_HTML)) { $lenOpt = $lenOpt - LenQuote; $option = substr($option, 0, $lenOpt); // Remove last double quote } } if ($lenOpt > 0) $option .= ' '; // Separator with the two last options $option .= 'eo=true'; // eo = extendedoptions $pgndata = file_get_contents([(#FICHIER|_q)]); include_spip('inc/charsets'); $pgndata = importer_charset($pgndata, is_utf8($pgndata) ? 'utf-8' : 'iso-8859-1'); echo pgn4spip_prepropre('[pgn ' . $option . ']' . $pgndata . '[/pgn]'); ?>