Title: Insert Flash Movie

Author: Ahmad

Description:
This mod will add a button to the BB buttons to insert Flash movie into the posts

Compatability: 1.9.5 Final

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

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

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

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

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

function image() {
    if (helpmode) {
        alert(bbcode_help_image);
    }else if (advmode) {
        AddText('', '', "[img] [/img]", messageElement);

    }else {
        txt=prompt(bbcode_prompt_image,"http://");
        if(txt!=null) {
            AddText('', '', "\r[img]"+txt+"[/img]", messageElement);
        }
    }
}

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

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);
        }
    }
}

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

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

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

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

function image() {
    if (helpmode) {
        alert(bbcode_help_image);
    }else if (advmode) {
        AddText('', '', "[img] [/img]", messageElement);

    }else {
        txt=prompt(bbcode_prompt_image,"http://");
        if(txt!=null) {
            AddText('', '', "\r[img]"+txt+"[/img]", messageElement);
        }
    }
}

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

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);
        }
    }
}
=======================================================================================================================================
=======
Step 3:
=======

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

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

function italicize() {
	if(helpmode) {
		alert(bbcode_help_italic);

	} else if(advmode) {
		if(hasSelection(messageElement)) {
			wrapText('[i]', '[/i]', messageElement);
		} else {
			AddText('[i]', '[/i]', ' ', messageElement);
		}

	} else {
		if(hasSelection(messageElement)) {
			text = prompt(bbcode_prompt_italic, fetchSelection(messageElement));
			if(text == fetchSelection(messageElement)) {
				wrapText('[i]', '[/i]', messageElement);
			} else {
				AddText('[i]', '[/i]', text, messageElement);
			}
		} else {
			text = prompt(bbcode_prompt_italic, 'Text');
			AddText('[i]', '[/i]', text, messageElement);
		}
	}
}


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

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);
		}
	}
}

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

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

===============
Add this at the buttom
===============

$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 enther the path to the swf file";
$lang['cb_insert_swf'] = "Insert Flash Movie";
=======================================================================================================================================
=======
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:image()"><img src="$imgdir/bb_image.gif" border="0" width="23" height="22" alt="$lang[cb_insert_image]" /></a>

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

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

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

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

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