Modification Name: BB Code: Rollover Tips v2.1

Modification Author: GuldantheWarlock (GuldantheWarlock@xmbgarage.com)

Original Author: John Clawson

Last Updated: May 1, 2009

Modification Description:
This modification will add a message box below the bbcode buttons that displays bb code tips when moused over.
This modification has been modified to work if the Member Control Panel BB Code hack is installed.
This modification will require further modifications if other bb code buttons are installed.

Supported Version: XMB 1.9.8 SP3

Updated for 1.9.8 SP3 by WormHole

Notes:
This modification is released under the GPL. You should have recieved a copy of it with this software package.

Please backup your files before installing this modification. Neither XMBGarage nor the author can be held responsible if your board stops functioning properly due to you installing this modification.

=======================================================================================================
=======
Step 1:
=======
=======================
Edit File: lang/English.lang.php
=======================
=======================
Add To End Of File Above ?>
=======================

// BB Code: Rollover Tips Mod Begin
$lang['bbcode_tips'] = "<strong>BBCode Tips</strong>: ";
$lang['default_tip'] = "Roll your mouse cursor over any of the BB Code above!";
$lang['bold_tip'] = "Bold Text: [b]Text[/b]";
$lang['italic_tip'] = "Italicized Text: [i]Text[/i]";
$lang['underline_tip'] = "Underlined Text: [u]Text[/u]";
$lang['center_tip'] = "Centered Text: [align=center]Text[/align]";
$lang['quote_tip'] = "Quoted Text: [quote]Text[/quote]";
$lang['code_tip'] = "Code Formatted Text: [code]Text[/code]";
$lang['list_tip'] = "List Text: [list][*]Text[*]Text[/list]";
$lang['image_tip'] = "Insert Image: [img]http://url[/img]";
$lang['url_tip'] = "Insert URL: [url]http://url[/url] or [url=http://url]Text[/url]";
$lang['email_tip'] = "Insert Email: [email]name@domain.com[/email] or [email=name@domain.com]Text[/url]";
$lang['font_tip'] = "Font: [font=arial]Text[/font]";
$lang['color_tip'] = "Font Color: [color=red]Text[/color]";
$lang['size_tip'] = "Font Size: [size=1]Text[/size]";
// BB Code: Rollover Tips Mod End

=======================================================================================================
=======
Step 2:
=======
==============================
Go to Administration Panel -> Templates
==============================
=========================
Edit Template: functions_bbcode
=========================
======
Find:
======

var messageElement;

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

var bold_tip = "$lang[bold_tip]";
var italic_tip = "$lang[italic_tip]";
var underline_tip = "$lang[underline_tip]";
var center_tip = "$lang[center_tip]";
var quote_tip = "$lang[quote_tip]";
var code_tip = "$lang[code_tip]";
var list_tip = "$lang[list_tip]";
var image_tip = "$lang[image_tip]";
var url_tip = "$lang[url_tip]";
var email_tip = "$lang[email_tip]";
var font_tip = "$lang[font_tip]";
var color_tip = "$lang[color_tip]";
var size_tip = "$lang[size_tip]";

function tipline(tip) {
    document.getElementById('tipline').innerHTML = eval(tip+'_tip');
}

=======================================================================================================
=======
Step 3:
=======
==============================
Go to Administration Panel -> Templates
==============================
============================
Edit Template: functions_bbcodeinsert
============================
======
Find:
======

<select name="font" onChange="chfont(this.options[this.selectedIndex].value)" size="1">

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

<select name="font" onChange="chfont(this.options[this.selectedIndex].value)" size="1" onMouseOver="tipline('font')">

======
Find:
======

<select name="size" onChange="chsize(this.options[this.selectedIndex].value)" size="1">

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

<select name="size" onChange="chsize(this.options[this.selectedIndex].value)" size="1" onMouseOver="tipline('size')">

======
Find:
======

<select name="color" onChange="chcolor(this.options[this.selectedIndex].value)" size="1">

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

<select name="color" onChange="chcolor(this.options[this.selectedIndex].value)" size="1" onMouseOver="tipline('color')">

======
Find:
======

<a href="javascript:bold()" accesskey="b"><img src="$imgdir/bb_bold.gif" border="0" width="23" height="22" alt="$lang[cb_insert_bold]" /></a>
<a href="javascript:italicize()" accesskey="i"><img src="$imgdir/bb_italicize.gif" border="0" width="23" height="22" alt="$lang[cb_insert_italics]" /></a>
<a href="javascript:underline()" accesskey="u"><img src="$imgdir/bb_underline.gif" border="0" width="23" height="22" alt="$lang[cb_insert_underlined]" /></a>
<a href="javascript:center()"><img src="$imgdir/bb_center.gif" border="0" width="23" height="22" alt="$lang[cb_insert_centered]" /></a>
<a href="javascript:hyperlink()"><img src="$imgdir/bb_url.gif" border="0" width="23" height="22" alt="$lang[cb_insert_hyperlink]" /></a>
<a href="javascript:email()"><img src="$imgdir/bb_email.gif" border="0" width="23" height="22" alt="$lang[cb_insert_email]" /></a>
<a href="javascript:image()"><img src="$imgdir/bb_image.gif" border="0" width="23" height="22" alt="$lang[cb_insert_image]" /></a>
<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:quote()"><img src="$imgdir/bb_quote.gif" border="0" width="23" height="22" alt="$lang[cb_insert_quote]" /></a>
<a href="javascript:list()"><img src="$imgdir/bb_list.gif" border="0" width="23" height="22" alt="$lang[cb_insert_list]" /></a></td>

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

<a href="javascript:bold()" onMouseOver="tipline('bold')" accesskey="b"><img src="$THEME[imgdir]/bb_bold.gif" border="0" width="23" height="22" alt="$lang[cb_insert_bold]" /></a>
<a href="javascript:italicize()" onMouseOver="tipline('italic')" accesskey="i"><img src="$THEME[imgdir]/bb_italicize.gif" border="0" width="23" height="22" alt="$lang[cb_insert_italics]" /></a>
<a href="javascript:underline()" onMouseOver="tipline('underline')" accesskey="u"><img src="$THEME[imgdir]/bb_underline.gif" border="0" width="23" height="22" alt="$lang[cb_insert_underlined]" /></a>
<a href="javascript:center()" onMouseOver="tipline('center')"><img src="$THEME[imgdir]/bb_center.gif" border="0" width="23" height="22" alt="$lang[cb_insert_centered]" /></a>
<a href="javascript:hyperlink()" onMouseOver="tipline('url')"><img src="$THEME[imgdir]/bb_url.gif" border="0" width="23" height="22" alt="$lang[cb_insert_hyperlink]" /></a>
<a href="javascript:email()" onMouseOver="tipline('email')"><img src="$THEME[imgdir]/bb_email.gif" border="0" width="23" height="22" alt="$lang[cb_insert_email]" /></a>
<a href="javascript:image()" onMouseOver="tipline('image')"><img src="$THEME[imgdir]/bb_image.gif" border="0" width="23" height="22" alt="$lang[cb_insert_image]" /></a>
<a href="javascript:code()" onMouseOver="tipline('code')"><img src="$THEME[imgdir]/bb_code.gif" border="0" width="23" height="22" alt="$lang[cb_insert_code]" /></a>
<a href="javascript:quote()" onMouseOver="tipline('quote')"><img src="$THEME[imgdir]/bb_quote.gif" border="0" width="23" height="22" alt="$lang[cb_insert_quote]" /></a>
<a href="javascript:list()" onMouseOver="tipline('list')"><img src="$THEME[imgdir]/bb_list.gif" border="0" width="23" height="22" alt="$lang[cb_insert_list]" /></a>

<br /><br />

<font class="smalltxt">$lang[bbcode_tips]</font>
<span id="tipline">$lang[default_tip]</span></td>

=======================================================================================================
=======
Step 4:
=======
==============================
Go to Administration Panel -> Templates
==============================
===============
Edit Template: css
===============
======
Find:
======

/*]]>*/
</style>

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

.tipline {
    border-style: none;
    background-color: $altbg2;
}

=======================================================================================================
=======
Step 5:
=======
===============
Edit File: post.php
===============
======
Find:
======

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

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

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

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