Title: BB Code: Striking Text v1.0

Author: Ahmad

Description: This modification will add a button to the BB Code buttons to insert striked text into your post.

Compatability: 1.9.8 SP3

Bonus: White button theme

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

License Note: This modification 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: Striking Text Mod Begin
function strike() {
    if (helpmode) {
        alert(bbcode_help_strike);
    }else if (advmode) {
        AddText('', '', "[strike] [/strike]", messageElement);
    }else {
        txt=prompt(bbcode_prompt_strike,"Text");
        if (txt!=null) {
            AddText('', '', "[strike]"+txt+"[/strike]", messageElement);
        }
    }
}
// BB Code: Striking Text Mod End

=======================================================================================================================================
=======
Step 2:
=======
========================
Edit File: js/bbcodefns-opera.js
========================
==========
Find Code:
==========

function storeCaret(textEl) {

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

// BB Code: Striking Text Mod Begin
function strike() {
    if (helpmode) {
        alert(bbcode_help_strike);
    }else if (advmode) {
        AddText('', '', "[strike] [/strike]", messageElement);
    }else {
        txt=prompt(bbcode_prompt_strike,"Text");
        if (txt!=null) {
            AddText('', '', "[strike]"+txt+"[/strike]", messageElement);
        }
    }
}
// BB Code: Striking Text Mod End

=======================================================================================================================================
=======
Step 3:
=======
========================
Edit File: js/bbcodefns-mozilla.js
========================
==========
Find Code:
==========

function storeCaret() {

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

// BB Code: Striking Text Mod Begin
function strike() {
    if(helpmode) {
        alert(bbcode_help_strike);

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

    } else {
        if(hasSelection(messageElement)) {
            text = prompt(bbcode_prompt_strike, fetchSelection(messageElement));
            if(text == fetchSelection(messageElement)) {
                wrapText('[strike]', '[/strike]', messageElement);
            } else {
                AddText('[strike]', '[/strike]', text, messageElement);
            }
        } else {
            text = prompt(bbcode_prompt_strike, 'Text');
            AddText('[strike]', '[/strike]', text, messageElement);
        }
    }
}
// BB Code: Striking Text Mod End

=======================================================================================================================================
=======
Step 4:
=======
=======================
Edit File: lang/English.lang.php
=======================

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

// BB Code Striking Text Mod Begin
$lang['bbcode_help_strike'] = "strike Tag\\nInsert strike text.\\nUsage: [b]This is some strike text[/b]";
$lang['bbcode_prompt_strike'] = "Enter the text to strike ";
$lang['cb_insert_strike'] = "Insert text to strike";
// BB Code Striking Text Mod End

=======================================================================================================================================
=======
Step 5:
=======
==============================
Go to administration panel -> Templates
==============================
=========================
Edit Template: functions_bbcode
=========================
==========
Find Code:
==========

var messageElement;

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

var bbcode_help_strike = "$lang[bbcode_help_strike]";
var bbcode_prompt_strike = "$lang[bbcode_prompt_strike]";

=======================================================================================================================================
=======
Step 6:
=======
==============================
Go to administration panel -> Templates
==============================
============================
Edit Template: functions_bbcodeinsert
============================
==========
Find Code:
==========

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

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

<a href="javascript:code()"><img src="$imgdir/bb_code.gif" border="0" width="23" height="22" alt="$lang[cb_insert_code]" /></a>
<a href="javascript:strike()"><img src="$THEME[imgdir]/bb_strike.gif" border="0" width="23" height="22" alt="$lang[cb_insert_strike]" /></a></td>

=======================================================================================================================================
=======
Step 7:
=======
===============
Edit File: post.php
===============
==========
Find Code:
==========

    global $imgdir, $bbinsert, $altbg1, $altbg2, $lang, $SETTINGS, $spelling_lang;

=======================================
Replace Code With (Only If $THEME is not present):
=======================================

    global $imgdir, $bbinsert, $altbg1, $altbg2, $lang, $SETTINGS, $spelling_lang, $THEME;

=======================================================================================================================================
=======
Step 8:
=======

Upload the "bb_strike.gif" to your theme directory

=======================================================================================================================================
Enjoy!