MemoTek
Un article de OUIes Ki.
(Différences entre les versions)
Version du 28 août 2007 à 11:06 (modifier) Cdriko (Discuter | contributions) ← Différence précédente |
Version du 28 août 2007 à 17:06 (modifier) Cdriko (Discuter | contributions) Différence suivante → |
||
Ligne 1: | Ligne 1: | ||
- | == flash == | + | '''Flash Extension''' is just another '''Flash''' extension (obviously ;-) ) for MediaWiki. See also [[Extension:Flash|Flash]] and [[Extension:Flashow|Flashow]]. |
- | Base Syntax | + | It's based in [[Extension:Flash swf|Flash swf]] extension, but this revision allows to use local swf files located in your webserver (Modifications made by Daniel Mustieles <daniel.mustieles[NO-SPAM]@ie.edu). |
- | <nowiki><flash>file=filename.swf|attribute=value|...</flash></nowiki> | + | == Syntax == |
- | [edit] Attribute Reference | + | The Flash extension uses <swf></swf> tags. |
+ | == Sample == | ||
- | * width=px or % (Modify the width of the object) | + | Give the URL of the swf-file as the content of the swf-tag, specify width and hight as attributes. (default to width=550, height=400) |
- | * height=px or a% (Modify the height of the object) | + | |
- | * play=true/false (Start playing the file or wait at first frame, default:true) | + | |
- | * loop=true/false (Loop the animation, default:true) | + | |
- | * quality=low/autolow/medium/high/autohigh/best (Predefine the quality) | + | |
- | * devicefont=true/false (Change the look of the text used in flash file) | + | |
- | * bgcolor=#?????? (? -> Hexadecimal integer: 1-9, A-F) | + | |
- | * scale=showall/noborder/exactfit (Automatically adjust content to width and height) | + | |
- | * menu=true/false (Show or hide the menu on right-click) | + | |
- | * align | + | |
- | * salign | + | |
- | * base | + | |
- | * wmode | + | |
- | * SeamlessTabbing | + | |
- | * flashvars=?var1=value1&var2=value2 (communicate two variables var1 and var2 to the movie) | + | |
- | * name (object-specific) | + | |
- | * id (embed-specific) | + | |
- | * movie (object-specific) | + | |
- | * src (embed-specific) | + | |
+ | <swf width="50" height="50">https://multimediaart.at/mmawiki/images/b/bb/Mini.swf</swf> | ||
- | [edit] Examples | + | If you have a local swf file you can use this syntax: |
+ | <swf width="50" height="50">/wiki/images/Mini.swf</swf> | ||
- | <flash>file=happy.swf|width=10%|height=30|quality=best</flash> | + | Note that you don't have to write DocumentRoot's path inside <swf> tags |
- | Shows the movie with the best quality with a width of 10% and a height of 30 pixels. | + | == Installation == |
+ | You need to drop '''flash.php''' into your extensions folder (usually /wiki/extensions/), and place <code>require_once("extensions/flash.php");</code> inside LocalSettings.php. | ||
+ | Would not work unless the require was placed at the end of the Localsettings.php file. | ||
- | <flash>file=cool.swf|width=200|height=300|bgcolor=#FDE742|scale=exactfit</flash> | ||
+ | '''Important:''' Before '''EOM''' must not be any whitespace. '''E''' must be first character in that line. | ||
- | ---- | + | The Code in flash.php: |
+ | |||
+ | <nowiki><?php | ||
+ | // MediaWiki Swf Extension Ver 0.1 | ||
+ | // Set up MediaWiki to react to the "<swf>" tag | ||
+ | // Original file by Brigitte Jellinek | ||
+ | // Modified by Daniel Mustieles <daniel.mustieles@ie.edu> to allow local swf files | ||
+ | |||
+ | $wgExtensionFunctions[] = "wfSwf"; | ||
+ | function wfSwf() { | ||
+ | global $wgParser; | ||
+ | $wgParser->setHook( "swf", "RenderSwf" ); | ||
+ | } | ||
+ | function RenderSwf( $input, $argv ) { | ||
+ | global $wgScriptPath; | ||
+ | $output = ""; | ||
+ | // external URL | ||
+ | if ( strpos($input , "http") === 0 && strpos($input, ".swf") == strlen($input)-4 ) { | ||
+ | $url = $input; | ||
+ | } | ||
+ | // internal Media: | ||
+ | else { | ||
+ | $url = $input; | ||
+ | } | ||
+ | $width = isset($argv['width']) ? $argv['width'] : 550; | ||
+ | $height = isset($argv['height'])? $argv['height'] : 400; | ||
+ | $id = basename($input, ".swf"); | ||
+ | $output .=<<<EOM | ||
+ | <object width="$width" height="$height"><param name="movie" value="$url"> | ||
+ | </param><embed src="$url" type="application/x-shockwave-flash" width="$width" height="$height"></embed></object> | ||
+ | EOM; | ||
+ | $output = str_replace("\n", "", $output); | ||
+ | return $output; | ||
+ | } | ||
+ | |||
+ | ?></nowiki> | ||
+ | |||
+ | == Alternatives == | ||
+ | * [[Extension:Flash|Flash]] | ||
+ | * [[Extension:Flashow|Flashow]] | ||
+ | * [[Extension:LinkSwf|LinkSwf]] | ||
+ | |||
+ | [[Category:Media handling extensions|{{PAGENAME}}]] |
Version du 28 août 2007 à 17:06
Flash Extension is just another Flash extension (obviously ;-) ) for MediaWiki. See also Flash and Flashow. It's based in Flash swf extension, but this revision allows to use local swf files located in your webserver (Modifications made by Daniel Mustieles <daniel.mustieles[NO-SPAM]@ie.edu).
Syntax
The Flash extension uses tags.Sample
Give the URL of the swf-file as the content of the swf-tag, specify width and hight as attributes. (default to width=550, height=400)
If you have a local swf file you can use this syntax:
Note that you don't have to write DocumentRoot's path inside EOM; $output = str_replace("\n", "", $output); return $output;}?>== Alternatives ==* [[Extension:Flash|Flash]]* [[Extension:Flashow|Flashow]]* [[Extension:LinkSwf|LinkSwf]][[Category:Media handling extensions|{{PAGENAME}}]]">