What text editor did you use to write this extension?
-- Jim
On 2/23/07, Ken McDonald <ken(a)pixologic.com> wrote:
Copying from the nice gflash extension, I came up with the following for
(hopefully) embedding quicktime movies;
------
<?php
# Example WikiMedia extension
# with WikiMedia's extension mechanism it is possible to define
# new tags of the form
# <TAGNAME> some text </TAGNAME>
# the function registered by the extension gets the text between the
# tags as input and can transform it into arbitrary HTML code.
# Note: The output is not interpreted as WikiText but directly
# included in the HTML output. So Wiki markup is not supported.
# To activate the extension, include it from your LocalSettings.php
# with: include("extensions/qtmov.php");
$wgExtensionFunctions[] = "wfQTMovExtension";
function wfQTMovExtension() {
global $wgParser;
# register the extension with the WikiText parser
# the first parameter is the name of the new tag.
# the second parameter is the callback function for processing the text
between the tags
$wgParser->setHook( "qtmov", "renderQTMov" );
}
# The callback function for converting the input text to HTML output
function renderQTMov( $input ) {
$exploin = explode(" ",$input);
$output = "<embed width='" . $exploin[0] . "'
height='" . $exploin[1] .
"' align='middle' src='" . $exploin[2] . "'
quality='high'>";
return $output;
}
?>
-------------
Unfortunately, I seem to have introduced an error somewhere; I get the
following errors showing up on the web page when I attempt to 'include'
the extension;
Warning: Cannot modify header information - headers already sent by
(output started at /home/www/data/beta_wiki/extensions/qtmov.php:34)
in /home/www/data/beta_wiki/includes/OutputPage.php on line 575
Warning: Cannot modify header information - headers already sent by
(output started at /home/www/data/beta_wiki/extensions/qtmov.php:34) in
/home/www/data/beta_wiki/includes/OutputPage.php on line 576
gflash, however, is installed and working fine. The only place I made a
significant change to the script is in the construction of the output
string, and from what I can infer from the original gflash script, what
I did should at the least be valid PHP, even if it doesn't produce the
output I'm trying for.
Anyone see a quick fix?
Thanks,
Ken
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l(a)lists.wikimedia.org
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l