Documentations et Dossiers [Extras] Youtube dans votre PHPBoost V3
Coucou Swan !
C'est le lourdingue qui revient à la charge sur ce post
Je ne pense pas que tu aies eu le temps de t'en occuper, mais j'espère que les vacances d'été seront propices à rédaction de ce tuto
@++
patrice
C'est le lourdingue qui revient à la charge sur ce post
Je ne pense pas que tu aies eu le temps de t'en occuper, mais j'espère que les vacances d'été seront propices à rédaction de ce tuto
@++
patrice
Bonjour,
Et voilà comme promis de longue date, je vous ai fait le tuto : Youtube dans votre PHPBoost V3
J'ai retenté la procédure en locale sur la 3.0.11 et c'est fonctionnel ! Amusez vous bien
Swan
Et voilà comme promis de longue date, je vous ai fait le tuto : Youtube dans votre PHPBoost V3
J'ai retenté la procédure en locale sur la 3.0.11 et c'est fonctionnel ! Amusez vous bien
Swan
Aïe, aïe, aïe...
une fois le cache généré j'ai ce message et je ne comprends pas ce qui ne va pas....
"Parse error: syntax error, unexpected T_STRING in /home/adalaero/www/kernel/framework/content/parser/content_second_parser.class.php on line 283"
une fois le cache généré j'ai ce message et je ne comprends pas ce qui ne va pas....
"Parse error: syntax error, unexpected T_STRING in /home/adalaero/www/kernel/framework/content/parser/content_second_parser.class.php on line 283"
oui, le voilà:
s*`isU', '', $html_content); return Url::html_convert_root_relative2absolute($html_content); } ## Private ## /** * @static * @desc Highlights a content in a supported language using the appropriate syntax highlighter. * The highlighted languages are numerous: actionscript, asm, asp, bash, c, cpp, csharp, css, d, delphi, fortran, html, * java, javascript, latex, lua, matlab, mysql, pascal, perl, php, python, rails, ruby, sql, text, vb, xml, * PHPBoost templates and PHPBoost BBCode. * @param string $contents Content to highlight * @param string $language Language name * @param bool $line_number Indicate whether or not the line number must be added to the code. * @param bool $inline_code Indicate if the code is multi line. */ function _highlight_code($contents, $language, $line_number, $inline_code) { $contents = htmlspecialchars_decode($contents); //BBCode PHPBoost if (strtolower($language) == 'bbcode') { import('content/parser/bbcode_highlighter'); $bbcode_highlighter = new BBCodeHighlighter(); $bbcode_highlighter->set_content($contents, PARSER_DO_NOT_STRIP_SLASHES); $bbcode_highlighter->parse($inline_code); $contents = $bbcode_highlighter->get_content(DO_NOT_ADD_SLASHES); } //Templates PHPBoost elseif (strtolower($language) == 'tpl' || strtolower($language) == 'template') { import('content/parser/template_highlighter'); require_once(PATH_TO_ROOT . '/kernel/framework/content/geshi/geshi.php'); $template_highlighter = new TemplateHighlighter(); $template_highlighter->set_content($contents, PARSER_DO_NOT_STRIP_SLASHES); $template_highlighter->parse($line_number ? GESHI_NORMAL_LINE_NUMBERS : GESHI_NO_LINE_NUMBERS, $inline_code); $contents = $template_highlighter->get_content(DO_NOT_ADD_SLASHES); } elseif ($language != '') { require_once(PATH_TO_ROOT . '/kernel/framework/content/geshi/geshi.php'); $Geshi = new GeSHi($contents, $language); if ($line_number) //Affichage des numéros de lignes. $Geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS); //No container if we are in an inline tag if ($inline_code) $Geshi->set_header_type(GESHI_HEADER_NONE); $contents = '
', '', $matches[1]); $matches = mathfilter(html_entity_decode($matches[1], ENT_COMPAT, 'ISO-8859-1'), 12); return $matches; } /** * Processes the media insertion it replaces the [[MEDIA]]tag[[/MEDIA]] by the Javascript API correspondig calls. */ function _process_media_insertion() { //Swf $this->content=preg_replace_callback('`[[MEDIA]]insertSwfPlayer('([^']+)', ([0-9]+), ([0-9]+));[[/MEDIA]]`isU',array('ContentSecondParser','_process_swf_tag'),$this->content); //Movie $this->content=preg_replace_callback('`[[MEDIA]]insertMoviePlayer('([^']+)', ([0-9]+), ([0-9]+));[[/MEDIA]]`isU',array('ContentSecondParser','_process_movie_tag'),$this->content); //Sound $this->content=preg_replace_callback('`[[MEDIA]]insertSoundPlayer('([^']+)');[[/MEDIA]]`isU',array('ContentSecondParser','_process_sound_tag'),$this->content); //Youtube $this->content = preg_replace_callback('`[[MEDIA]]insertYoutubePlayer('([^']+)', ([0-9]+), ([0-9]+));[[/MEDIA]]`isU', array('ContentSecondParser', '_process_youtube_tag'), $this->content); } /** * Inserts the javascript calls for the swf tag. * @param $matches The matched elements * @return The movie insertion code containing javascrpt calls */ function _process_swf_tag($matches) { return ""; } /** * Inserts the javascript calls for the movie tag. * @param $matches The matched elements * @return The movie insertion code containing javascrpt calls */ function _process_movie_tag($matches) { $id = 'movie_' . get_uid(); return '
' . ''; } /** * Inserts the javascript calls for the sound tag. * @param $matches The matched elements * @return The movie insertion code containing javascrpt calls */ function _process_sound_tag($matches) { //Balise son return ''; } function _process_youtube_tag($matches) { //Balise youtube $matches[1] = str_replace(array('/watch?v=', '/embed/'), '/v/', $matches[1]); return ""; } } ?>[[/CODE]]
Code PHP :
`sU', array(&$this, '_callback_highlight_code'), $this->content);
}
//Media
if (strpos($this->content, '[[MEDIA]]') !== false)
{
$this->_process_media_insertion();
}
//Balise latex.
if (strpos($this->content, '`sU', array(&$this, '_math_code'), $this->content);
}
import('util/url');
$this->content = Url::html_convert_root_relative2absolute($this->content, $this->path_to_root, $this->page_path);
}
/**
* @desc Transforms a PHPBoost HTML content to make it exportable and usable every where in the web.
* @param string $html Content to transform
* @return string The exportable content
*/
function export_html_text($html_content)
{
import('util/url');
//Balise vidéo
$html_content = preg_replace('`<?php /*################################################## * content_second_parser.class.php * ------------------- * begin : August 10, 2008 * copyright : (C) 2008 Benoit Sautel * email : [[email protected]][email protected][/mail] * * ################################################### * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ###################################################*/ import('content/parser/parser'); /** * @package content * @subpackage parser * @desc This class ensures the real time processing of the content. The major part of the processing is saved in the database to minimize as much as possible the treatment * when the content is displayed. However, some tags cannot be cached, because we cannot have return to the original code. It's for instance the case of the code tag * which replaces the code by a lot of html code which formats the code. * This kind of tag is treated in real time by this class. * The content you put in that parser must come from a ContentParser class (BBCodeParser or TinyMCEParser) (it can have been saved in a database between the first parsing and the real time parsing). * @author Benoît Sautel <[email protected]> */ class ContentSecondParser extends Parser { ######## Public ####### /** * @desc Builds a ContentSecondParser object */ function ContentSecondParser() { parent::Parser(); } /** * @desc Parses the content of the parser. The result will be ready to be displayed. */ function parse() { global $LANG; //Balise code if (strpos($this->content, '[[CODE') !== false) { $this->content = preg_replace_callback('`[[CODE(?:=([A-Za-z0-9#+-]+))?(?:,(0|1)(?:,(0|1))?)?]](.+)
s*`isU', '', $html_content); return Url::html_convert_root_relative2absolute($html_content); } ## Private ## /** * @static * @desc Highlights a content in a supported language using the appropriate syntax highlighter. * The highlighted languages are numerous: actionscript, asm, asp, bash, c, cpp, csharp, css, d, delphi, fortran, html, * java, javascript, latex, lua, matlab, mysql, pascal, perl, php, python, rails, ruby, sql, text, vb, xml, * PHPBoost templates and PHPBoost BBCode. * @param string $contents Content to highlight * @param string $language Language name * @param bool $line_number Indicate whether or not the line number must be added to the code. * @param bool $inline_code Indicate if the code is multi line. */ function _highlight_code($contents, $language, $line_number, $inline_code) { $contents = htmlspecialchars_decode($contents); //BBCode PHPBoost if (strtolower($language) == 'bbcode') { import('content/parser/bbcode_highlighter'); $bbcode_highlighter = new BBCodeHighlighter(); $bbcode_highlighter->set_content($contents, PARSER_DO_NOT_STRIP_SLASHES); $bbcode_highlighter->parse($inline_code); $contents = $bbcode_highlighter->get_content(DO_NOT_ADD_SLASHES); } //Templates PHPBoost elseif (strtolower($language) == 'tpl' || strtolower($language) == 'template') { import('content/parser/template_highlighter'); require_once(PATH_TO_ROOT . '/kernel/framework/content/geshi/geshi.php'); $template_highlighter = new TemplateHighlighter(); $template_highlighter->set_content($contents, PARSER_DO_NOT_STRIP_SLASHES); $template_highlighter->parse($line_number ? GESHI_NORMAL_LINE_NUMBERS : GESHI_NO_LINE_NUMBERS, $inline_code); $contents = $template_highlighter->get_content(DO_NOT_ADD_SLASHES); } elseif ($language != '') { require_once(PATH_TO_ROOT . '/kernel/framework/content/geshi/geshi.php'); $Geshi = new GeSHi($contents, $language); if ($line_number) //Affichage des numéros de lignes. $Geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS); //No container if we are in an inline tag if ($inline_code) $Geshi->set_header_type(GESHI_HEADER_NONE); $contents = '
' . $Geshi->parse_code() . ''; } else { $highlight = highlight_string($contents, true); $font_replace = str_replace(array(''), array(''), $highlight); $contents = preg_replace('`color="(.*?)"`', 'style="color:$1"', $font_replace); } return $contents; } /** * @static * @desc Handler which highlights a string matched by the preg_replace_callback function. * @param string[] $matches The matched contents: 0 => the whole string, 1 => the language, 2 => number count?, * 3 => multi line?, 4 => the code to highlight. * @return string the colored content */ function _callback_highlight_code($matches) { global $LANG; $line_number = !empty($matches[2]); $inline_code = !empty($matches[3]); $contents = $this->_highlight_code($matches[4], $matches[1], $line_number, $inline_code); if (!$inline_code && !empty($matches[1])) { $contents = '' . sprintf($LANG['code_langage'], strtoupper($matches[1])) . '
' . $contents .'
';
}
else if (!$inline_code && empty($matches[1]))
{
$contents = '' . $LANG['code_tag'] . '' . $contents . '
';
}
return $contents;
}
/**
* @static
* @desc Parses the latex code and replaces it by an image containing the mathematic formula.
* @param string[] $matches 0 => the whole tag, 1 => the latex code to parse.
* @return string The code of the image containing the formula.
*/
function _math_code($matches)
{
$matches[1] = str_replace('', '', $matches[1]); $matches = mathfilter(html_entity_decode($matches[1], ENT_COMPAT, 'ISO-8859-1'), 12); return $matches; } /** * Processes the media insertion it replaces the [[MEDIA]]tag[[/MEDIA]] by the Javascript API correspondig calls. */ function _process_media_insertion() { //Swf $this->content=preg_replace_callback('`[[MEDIA]]insertSwfPlayer('([^']+)', ([0-9]+), ([0-9]+));[[/MEDIA]]`isU',array('ContentSecondParser','_process_swf_tag'),$this->content); //Movie $this->content=preg_replace_callback('`[[MEDIA]]insertMoviePlayer('([^']+)', ([0-9]+), ([0-9]+));[[/MEDIA]]`isU',array('ContentSecondParser','_process_movie_tag'),$this->content); //Sound $this->content=preg_replace_callback('`[[MEDIA]]insertSoundPlayer('([^']+)');[[/MEDIA]]`isU',array('ContentSecondParser','_process_sound_tag'),$this->content); //Youtube $this->content = preg_replace_callback('`[[MEDIA]]insertYoutubePlayer('([^']+)', ([0-9]+), ([0-9]+));[[/MEDIA]]`isU', array('ContentSecondParser', '_process_youtube_tag'), $this->content); } /** * Inserts the javascript calls for the swf tag. * @param $matches The matched elements * @return The movie insertion code containing javascrpt calls */ function _process_swf_tag($matches) { return ""; } /** * Inserts the javascript calls for the movie tag. * @param $matches The matched elements * @return The movie insertion code containing javascrpt calls */ function _process_movie_tag($matches) { $id = 'movie_' . get_uid(); return '
' . ''; } /** * Inserts the javascript calls for the sound tag. * @param $matches The matched elements * @return The movie insertion code containing javascrpt calls */ function _process_sound_tag($matches) { //Balise son return ''; } function _process_youtube_tag($matches) { //Balise youtube $matches[1] = str_replace(array('/watch?v=', '/embed/'), '/v/', $matches[1]); return ""; } } ?>[[/CODE]]
Bonjour,
essaye ceci :
s*`isU', '', $html_content); return Url::html_convert_root_relative2absolute($html_content); } ## Private ## /** * @static * @desc Highlights a content in a supported language using the appropriate syntax highlighter. * The highlighted languages are numerous: actionscript, asm, asp, bash, c, cpp, csharp, css, d, delphi, fortran, html, * java, javascript, latex, lua, matlab, mysql, pascal, perl, php, python, rails, ruby, sql, text, vb, xml, * PHPBoost templates and PHPBoost BBCode. * @param string $contents Content to highlight * @param string $language Language name * @param bool $line_number Indicate whether or not the line number must be added to the code. * @param bool $inline_code Indicate if the code is multi line. */ function _highlight_code($contents, $language, $line_number, $inline_code) { $contents = htmlspecialchars_decode($contents); //BBCode PHPBoost if (strtolower($language) == 'bbcode') { import('content/parser/bbcode_highlighter'); $bbcode_highlighter = new BBCodeHighlighter(); $bbcode_highlighter->set_content($contents, PARSER_DO_NOT_STRIP_SLASHES); $bbcode_highlighter->parse($inline_code); $contents = $bbcode_highlighter->get_content(DO_NOT_ADD_SLASHES); } //Templates PHPBoost elseif (strtolower($language) == 'tpl' || strtolower($language) == 'template') { import('content/parser/template_highlighter'); require_once(PATH_TO_ROOT . '/kernel/framework/content/geshi/geshi.php'); $template_highlighter = new TemplateHighlighter(); $template_highlighter->set_content($contents, PARSER_DO_NOT_STRIP_SLASHES); $template_highlighter->parse($line_number ? GESHI_NORMAL_LINE_NUMBERS : GESHI_NO_LINE_NUMBERS, $inline_code); $contents = $template_highlighter->get_content(DO_NOT_ADD_SLASHES); } elseif ($language != '') { require_once(PATH_TO_ROOT . '/kernel/framework/content/geshi/geshi.php'); $Geshi = new GeSHi($contents, $language); if ($line_number) //Affichage des numéros de lignes. $Geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS); //No container if we are in an inline tag if ($inline_code) $Geshi->set_header_type(GESHI_HEADER_NONE); $contents = '
', '', $matches[1]); $matches = mathfilter(html_entity_decode($matches[1], ENT_COMPAT, 'ISO-8859-1'), 12); return $matches; } /** * Processes the media insertion it replaces the [[MEDIA]]tag[[/MEDIA]] by the Javascript API correspondig calls. */ function _process_media_insertion() { //Swf $this->content=preg_replace_callback('`[[MEDIA]]insertSwfPlayer('([^']+)', ([0-9]+), ([0-9]+));[[/MEDIA]]`isU',array('ContentSecondParser','_process_swf_tag'),$this->content); //Movie $this->content=preg_replace_callback('`[[MEDIA]]insertMoviePlayer('([^']+)', ([0-9]+), ([0-9]+));[[/MEDIA]]`isU',array('ContentSecondParser','_process_movie_tag'),$this->content); //Sound $this->content=preg_replace_callback('`[[MEDIA]]insertSoundPlayer('([^']+)');[[/MEDIA]]`isU',array('ContentSecondParser','_process_sound_tag'),$this->content); //Youtube $this->content = preg_replace_callback('`[[MEDIA]]insertYoutubePlayer('([^']+)', ([0-9]+), ([0-9]+));[[/MEDIA]]`isU', array('ContentSecondParser', '_process_youtube_tag'), $this->content); } /** * Inserts the javascript calls for the swf tag. * @param $matches The matched elements * @return The movie insertion code containing javascrpt calls */ function _process_swf_tag($matches) { return ""; } /** * Inserts the javascript calls for the movie tag. * @param $matches The matched elements * @return The movie insertion code containing javascrpt calls */ function _process_movie_tag($matches) { $id = 'movie_' . get_uid(); return '
' . ''; } /** * Inserts the javascript calls for the sound tag. * @param $matches The matched elements * @return The movie insertion code containing javascrpt calls */ function _process_sound_tag($matches) { //Balise son return ''; } function _process_youtube_tag($matches) { //Balise youtube $matches[1] = str_replace(array('/watch?v=', '/embed/'), '/v/', $matches[1]); return ''; } } ?> [[/CODE]]
Cordialement, janus57
essaye ceci :
Code PHP :
`sU', array(&$this, '_callback_highlight_code'), $this->content);
}
//Media
if (strpos($this->content, '[[MEDIA]]') !== false)
{
$this->_process_media_insertion();
}
//Balise latex.
if (strpos($this->content, '`sU', array(&$this, '_math_code'), $this->content);
}
import('util/url');
$this->content = Url::html_convert_root_relative2absolute($this->content, $this->path_to_root, $this->page_path);
}
/**
* @desc Transforms a PHPBoost HTML content to make it exportable and usable every where in the web.
* @param string $html Content to transform
* @return string The exportable content
*/
function export_html_text($html_content)
{
import('util/url');
//Balise vidéo
$html_content = preg_replace('`<?php /*################################################## * content_second_parser.class.php * ------------------- * begin : August 10, 2008 * copyright : (C) 2008 Benoit Sautel * email : [[email protected]][email protected][/mail] * * ################################################### * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ###################################################*/ import('content/parser/parser'); /** * @package content * @subpackage parser * @desc This class ensures the real time processing of the content. The major part of the processing is saved in the database to minimize as much as possible the treatment * when the content is displayed. However, some tags cannot be cached, because we cannot have return to the original code. It's for instance the case of the code tag * which replaces the code by a lot of html code which formats the code. * This kind of tag is treated in real time by this class. * The content you put in that parser must come from a ContentParser class (BBCodeParser or TinyMCEParser) (it can have been saved in a database between the first parsing and the real time parsing). * @author Benoît Sautel <[email protected]> */ class ContentSecondParser extends Parser { ######## Public ####### /** * @desc Builds a ContentSecondParser object */ function ContentSecondParser() { parent::Parser(); } /** * @desc Parses the content of the parser. The result will be ready to be displayed. */ function parse() { global $LANG; //Balise code if (strpos($this->content, '[[CODE') !== false) { $this->content = preg_replace_callback('`[[CODE(?:=([A-Za-z0-9#+-]+))?(?:,(0|1)(?:,(0|1))?)?]](.+)
s*`isU', '', $html_content); return Url::html_convert_root_relative2absolute($html_content); } ## Private ## /** * @static * @desc Highlights a content in a supported language using the appropriate syntax highlighter. * The highlighted languages are numerous: actionscript, asm, asp, bash, c, cpp, csharp, css, d, delphi, fortran, html, * java, javascript, latex, lua, matlab, mysql, pascal, perl, php, python, rails, ruby, sql, text, vb, xml, * PHPBoost templates and PHPBoost BBCode. * @param string $contents Content to highlight * @param string $language Language name * @param bool $line_number Indicate whether or not the line number must be added to the code. * @param bool $inline_code Indicate if the code is multi line. */ function _highlight_code($contents, $language, $line_number, $inline_code) { $contents = htmlspecialchars_decode($contents); //BBCode PHPBoost if (strtolower($language) == 'bbcode') { import('content/parser/bbcode_highlighter'); $bbcode_highlighter = new BBCodeHighlighter(); $bbcode_highlighter->set_content($contents, PARSER_DO_NOT_STRIP_SLASHES); $bbcode_highlighter->parse($inline_code); $contents = $bbcode_highlighter->get_content(DO_NOT_ADD_SLASHES); } //Templates PHPBoost elseif (strtolower($language) == 'tpl' || strtolower($language) == 'template') { import('content/parser/template_highlighter'); require_once(PATH_TO_ROOT . '/kernel/framework/content/geshi/geshi.php'); $template_highlighter = new TemplateHighlighter(); $template_highlighter->set_content($contents, PARSER_DO_NOT_STRIP_SLASHES); $template_highlighter->parse($line_number ? GESHI_NORMAL_LINE_NUMBERS : GESHI_NO_LINE_NUMBERS, $inline_code); $contents = $template_highlighter->get_content(DO_NOT_ADD_SLASHES); } elseif ($language != '') { require_once(PATH_TO_ROOT . '/kernel/framework/content/geshi/geshi.php'); $Geshi = new GeSHi($contents, $language); if ($line_number) //Affichage des numéros de lignes. $Geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS); //No container if we are in an inline tag if ($inline_code) $Geshi->set_header_type(GESHI_HEADER_NONE); $contents = '
' . $Geshi->parse_code() . ''; } else { $highlight = highlight_string($contents, true); $font_replace = str_replace(array(''), array(''), $highlight); $contents = preg_replace('`color="(.*?)"`', 'style="color:$1"', $font_replace); } return $contents; } /** * @static * @desc Handler which highlights a string matched by the preg_replace_callback function. * @param string[] $matches The matched contents: 0 => the whole string, 1 => the language, 2 => number count?, * 3 => multi line?, 4 => the code to highlight. * @return string the colored content */ function _callback_highlight_code($matches) { global $LANG; $line_number = !empty($matches[2]); $inline_code = !empty($matches[3]); $contents = $this->_highlight_code($matches[4], $matches[1], $line_number, $inline_code); if (!$inline_code && !empty($matches[1])) { $contents = '' . sprintf($LANG['code_langage'], strtoupper($matches[1])) . '
' . $contents .'
';
}
else if (!$inline_code && empty($matches[1]))
{
$contents = '' . $LANG['code_tag'] . '' . $contents . '
';
}
return $contents;
}
/**
* @static
* @desc Parses the latex code and replaces it by an image containing the mathematic formula.
* @param string[] $matches 0 => the whole tag, 1 => the latex code to parse.
* @return string The code of the image containing the formula.
*/
function _math_code($matches)
{
$matches[1] = str_replace('', '', $matches[1]); $matches = mathfilter(html_entity_decode($matches[1], ENT_COMPAT, 'ISO-8859-1'), 12); return $matches; } /** * Processes the media insertion it replaces the [[MEDIA]]tag[[/MEDIA]] by the Javascript API correspondig calls. */ function _process_media_insertion() { //Swf $this->content=preg_replace_callback('`[[MEDIA]]insertSwfPlayer('([^']+)', ([0-9]+), ([0-9]+));[[/MEDIA]]`isU',array('ContentSecondParser','_process_swf_tag'),$this->content); //Movie $this->content=preg_replace_callback('`[[MEDIA]]insertMoviePlayer('([^']+)', ([0-9]+), ([0-9]+));[[/MEDIA]]`isU',array('ContentSecondParser','_process_movie_tag'),$this->content); //Sound $this->content=preg_replace_callback('`[[MEDIA]]insertSoundPlayer('([^']+)');[[/MEDIA]]`isU',array('ContentSecondParser','_process_sound_tag'),$this->content); //Youtube $this->content = preg_replace_callback('`[[MEDIA]]insertYoutubePlayer('([^']+)', ([0-9]+), ([0-9]+));[[/MEDIA]]`isU', array('ContentSecondParser', '_process_youtube_tag'), $this->content); } /** * Inserts the javascript calls for the swf tag. * @param $matches The matched elements * @return The movie insertion code containing javascrpt calls */ function _process_swf_tag($matches) { return ""; } /** * Inserts the javascript calls for the movie tag. * @param $matches The matched elements * @return The movie insertion code containing javascrpt calls */ function _process_movie_tag($matches) { $id = 'movie_' . get_uid(); return '
' . ''; } /** * Inserts the javascript calls for the sound tag. * @param $matches The matched elements * @return The movie insertion code containing javascrpt calls */ function _process_sound_tag($matches) { //Balise son return ''; } function _process_youtube_tag($matches) { //Balise youtube $matches[1] = str_replace(array('/watch?v=', '/embed/'), '/v/', $matches[1]); return ''; } } ?> [[/CODE]]
Cordialement, janus57
Répondre
Vous n'êtes pas autorisé à écrire dans cette catégorie