Flash: Difference between revisions

From Meta, a Wikimedia project coordination wiki
Content deleted Content added
No edit summary
No edit summary
Line 3: Line 3:
== Syntax ==
== Syntax ==


Minimum Syntax:
=== Base Syntax ===
<code><nowiki><flash></nowiki>file='''filename.swf'''<nowiki></flash></nowiki></code>
<code><nowiki><flash></nowiki>file='''filename.swf'''|attribute='''value'''|...<nowiki></flash></nowiki></code>


Attribute Reference:
=== Attribute Reference ===
* '''width'''=px/% ''(Modify the width of the object)''
* '''width'''=px or % ''(Modify the width of the object)''
* '''height'''=px/% ''(Modify the height of the object)''
* '''height'''=px or a% ''(Modify the height of the object)''
* '''play'''='''true'''/false ''(Start playing the file or wait at first frame)''
* '''play'''=true/false ''(Start playing the file or wait at first frame, default:true)''
* '''loop'''='''true'''/false ''(Loop the animation)''
* '''loop'''=true/false ''(Loop the animation, default:true)''
* '''quality'''=low/autolow/medium/high/autohigh/best ''(Predefine the quality)''
* '''quality'''=low/autolow/medium/high/autohigh/best ''(Predefine the quality)''
* '''devicefont'''=true/false ''(Change the look of the text used in flash file)''
* '''devicefont'''=true/false ''(Change the look of the text used in flash file)''
Line 16: Line 16:
* '''scale'''=showall/noborder/exactfit ''(Automatically adjust content to width and height)''
* '''scale'''=showall/noborder/exactfit ''(Automatically adjust content to width and height)''
* '''menu'''=true/false ''(Show or hide the menu on right-click)''
* '''menu'''=true/false ''(Show or hide the menu on right-click)''
''More (but untested) attributes [[Flash#Untested Attributes|here]].


=== Examples ===
<code><nowiki><flash></nowiki>file=happy.swf|width=10%|height=30|quality=best<nowiki></flash></nowiki></code>
<br/>Shows the movie with the best quality with a width of 10% and a height of 30 pixels.


<code><nowiki><flash></nowiki>file=cool.swf|width=200|height=300|bgcolor=#FDE742|scale=exactfit<nowiki></flash></nowiki></code>
== Code ==
<br/>Shows the movie with a width of 200 and a height of 300. The background color is light-yellow (#FDE742). The content of the movie is stretched to the size of 200x300.


This is my first php code, so please be lenient with my beginner's mistakes. This code is not yet ready to be used in practice. I have only tested it really quickly and it worked. I have no clue what kind of security holes it has and what consequences it might bring. I suppose that with this code, scripts and java should be disabled but I'm not sure for I am not a Flash expert. Please use with caution.


== Code / Downloads ==
* [[/Flash v0.01|Flash v0.01]]
* [[/Flash v0.01|Flash v0.01]]
* '''[[/Flash v0.02|Flash v0.02]]'''
* '''[[/Flash v0.02|Flash v0.02 (latest)]]'''


== Installation ==
# Click on one of the versions above
# Copy the code into a file (e.g. Flash.php)
# Save the file in the ''extensions'' directory of your mediawiki folder
# Add the line <code>include('extensions/Flash.php');</code> to the LocalSettings.php file
Now you can use the extension with ''<flash>...</flash>'' in the wiki


== Frequently Asked Questions ==
=== I can't upload Flash (*.swf) files! ===
If you cannot upload anything, then first enable uploads. Find the line <code>#$wgDisableUploads = false;</code> in ''LocalSettings.php'' and uncomment it.
But by default, mediawiki still blocks many files from being uploaded for security reasons. Add this line your ''LocalSettings.php'' file: <code>$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'swf' );</code>. This allows the upload of the most common image formats and flash files. Note that the extensions you don't list here cannot be uploaded.


[[Category:Mediawiki Extensions]]


== Known Bugs ==
== Known Bugs ==
*Possible security issues with Javascript that are not tested yet
''There are too many problems to list them in the bug system, so please list them here:''
*Possible security issues with Javascript
*Commands that are not tested
**align
**salign
**base
**wmode
**SeamlessTabbing
**flashvars
**name (object-specific)
**id (embed-specific)
**movie (object-specific)
**src (embed-specific)



== Working Commands ==
== Untested Attributes ==
**width
*align
**height
*salign
*base
*wmode
*SeamlessTabbing
*flashvars
*name (object-specific)
*id (embed-specific)
*movie (object-specific)
*src (embed-specific)


[[Category:Mediawiki Extensions]]
[[Category:Flash]]

Revision as of 10:30, 1 September 2005

The flash extension allows the display of flash movies within a wiki.

Syntax

Base Syntax

<flash>file=filename.swf|attribute=value|...</flash>

Attribute Reference

  • width=px or % (Modify the width of the object)
  • 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)

More (but untested) attributes here.

Examples

<flash>file=happy.swf|width=10%|height=30|quality=best</flash>
Shows the movie with the best quality with a width of 10% and a height of 30 pixels.

<flash>file=cool.swf|width=200|height=300|bgcolor=#FDE742|scale=exactfit</flash>
Shows the movie with a width of 200 and a height of 300. The background color is light-yellow (#FDE742). The content of the movie is stretched to the size of 200x300.


Code / Downloads


Installation

  1. Click on one of the versions above
  2. Copy the code into a file (e.g. Flash.php)
  3. Save the file in the extensions directory of your mediawiki folder
  4. Add the line include('extensions/Flash.php'); to the LocalSettings.php file

Now you can use the extension with <flash>...</flash> in the wiki


Frequently Asked Questions

I can't upload Flash (*.swf) files!

If you cannot upload anything, then first enable uploads. Find the line #$wgDisableUploads = false; in LocalSettings.php and uncomment it. But by default, mediawiki still blocks many files from being uploaded for security reasons. Add this line your LocalSettings.php file: $wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'swf' );. This allows the upload of the most common image formats and flash files. Note that the extensions you don't list here cannot be uploaded.


Known Bugs

  • Possible security issues with Javascript that are not tested yet


Untested Attributes

  • align
  • salign
  • base
  • wmode
  • SeamlessTabbing
  • flashvars
  • name (object-specific)
  • id (embed-specific)
  • movie (object-specific)
  • src (embed-specific)