Title: BB Code: Flash Movie Player v1.0

Author: Ahmad

Description:
This modification will add a button to the BB buttons to insert Flash movies into the posts.

Compatability: 1.9.8 SP3

Install Note: Before adding this modification to your forum you should back up all files related to this modification.

License Note: This modificaiton is released under the GPL License. A copy is provided with this software package.

=======================================================================================================================================
=======
Step 1:
=======

=====================
Edit File: \js\bbcodefns-ie.js
=====================

==========
Find Code:
==========

function storeCaret(textEl) {

===============
Add Code Above:
===============

// BB Code: Flash Movie Player Mod Begin
function swf() {
    if (helpmode) {
        alert(bbcode_help_swf);
    }else if (advmode) {
        AddText('', '', "[flash=500x400] [/flash]", messageElement);
    }else {
        txt=prompt(bbcode_prompt_swf,"Text");
        if (txt!=null) {
            AddText('', '', "[flash=500x400]"+txt+"[/flash]", messageElement);
        }
    }
}
// BB Code: Flash Movie Player Mod End

=======================================================================================================================================

=======================================================================================================================================
=======
Step 2:
=======

========================
Edit File: \js\bbcodefns-opera.js
========================

==========
Find Code:
==========

function storeCaret(textEl) {

===============
Add Code Below:
===============

// BB Code: Flash Movie Player Mod Begin
function swf() {
    if (helpmode) {
        alert(bbcode_help_swf);
    }else if (advmode) {
        AddText('', '', "[Flash=500x400] [/Flash]", messageElement);
    }else {
        txt=prompt(bbcode_prompt_swf,"Text");
        if (txt!=null) {
            AddText('', '', "[Flash=500x400]"+txt+"[/Flash]", messageElement);
        }
    }
}
// BB Code: Flash Movie Player Mod End

=======================================================================================================================================
=======
Step 3:
=======

=========================
Edit File: \js\bbcodefns-mozilla.js
=========================

==========
Find Code:
==========

function storeCaret() {

===============
Add Code Below:
===============

// BB Code: Flash Movie Player Mod Begin
function swf() {
    if(helpmode) {
        alert(bbcode_help_swf);

    } else if(advmode) {
        if(hasSelection(messageElement)) {
            wrapText('[Flash=500x400]', '[/Flash]', messageElement);
        } else {
            AddText('[Flash=500x400]', '[/Flash]', ' ', messageElement);
        }

    } else {
        if(hasSelection(messageElement)) {
            text = prompt(bbcode_prompt_swf, fetchSelection(messageElement));
            if(text == fetchSelection(messageElement)) {
                wrapText('[Flash=500x400]', '[/Flash]', messageElement);
            } else {
                AddText('[Flash=500x400]', '[/Flash]', text, messageElement);
            }
        } else {
            text = prompt(bbcode_prompt_swf, 'Text');
            AddText('[Flash=500x400]', '[/Flash=500x400]', text, messageElement);
        }
    }
}
// BB Code: Flash Movie Player Mod End

=======================================================================================================================================
=======
Step 4:
=======

=======================
Edit File: lang\English.lang.php
=======================

=======================
Add To End Of File Above ?>
=======================

// BB Code: Flash Movie Player Mod Begin
$lang['bbcode_help_swf'] = "Flash Tag\\nInsert flash movie.\\nUsage: [b]This is the path for the flash file[/b]";
$lang['bbcode_prompt_swf'] = "Please enter the path to the swf file";
$lang['cb_insert_swf'] = "Insert Flash Movie";
// BB Code: Flash Movie Player Mod End

=======================================================================================================================================
=======
Step 5:
=======

===========================================
Go to administration panel -> templates -> functions_bbcode
===========================================

==========
Find Code:
==========

var messageElement;

===============
Add Code Above:
===============

var bbcode_help_swf = "$lang[bbcode_help_swf]";
var bbcode_prompt_swf = "$lang[bbcode_prompt_swf]";

=======================================================================================================================================
=======
Step 6:
=======

===============================================
Go to administration panel -> templates -> functions_bbcodeinsert
===============================================

==========
Find Code:
==========

<a href="javascript:list()"><img src="$imgdir/bb_list.gif" border="0" width="23" height="22" alt="$lang[cb_insert_list]" /></a></td>

================
Replace Code With:
================

<a href="javascript:list()"><img src="$imgdir/bb_list.gif" border="0" width="23" height="22" alt="$lang[cb_insert_list]" /></a>
<a href="javascript:swf()" accesskey="m"><img src="$THEME[imgdir]/bb_flash.gif" border="0" width="23" height="22" alt="$lang[cb_insert_swf]" /></a></td>

=======================================================================================================================================
=======
Step 7:
=======

===============================
Upload the "bb_flash.gif" to your theme directory
===============================

=======================================================================================================================================