============================================================================================================================
Modification Title: U2U BB Code

Version: 1.0

Author: John Briggs, Steven Waters

Description:
This modification will add the ability to use BB Code when sending a u2u.

Copyright:  2010 John Briggs. All Rights Reserved.

Compatability: XMB 1.9.5 SP1

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.

Author Note:
You downloaded this modification from XMBGarage.com, the #1 source for XMB related downloads.
Please visit http://www.xmbgarage.com/ for support.
============================================================================================================================
=======
Step 1:
=======
==============
Edit File: u2u.php
==============
==========
Find Code:
==========

loadtemplates(

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

loadtemplates(
'functions_bbcode',
'functions_bbcodeinsert',

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

eval('$css = "'.template('css').'";');

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

// U2U BB Code Mod Begin
eval('$bbcodescript = "'.template('functions_bbcode').'";');
// U2U BB Code Mod End

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

eval('echo stripslashes("'.template($tu2u).'");');

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

eval('echo "'.template($tu2u).'";');

============================================================================================================================
=======
Step 2:
=======
=================
Edit File: u2u.inc.php
=================
==========
Find Code:
==========

function u2u_msg($msg, $redirect) {

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

// U2U BB Code Mod Begin
function bbcodeinsert() {
    global $imgdir, $bbinsert, $altbg1, $altbg2, $lang, $SETTINGS, $spelling_lang;

    $bbcode = '';
    if ($bbinsert == 'on') {
        eval('$bbcode = "'.template('functions_bbcodeinsert').'";');
    }
    return $bbcode;
}
// U2U BB Code Mod End

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

    eval('$leftpane = "'.template('u2u_send').'";');

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

    // U2U BB Code Mod Begin
    $bbcodeinsert = bbcodeinsert();
    // U2U BB Code Mod End

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

        $u2umessage = checkOutput(postify($u2u['message'], "no", "", "yes", "no"));

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

        // U2U BB Code Mod Begin
        $u2usubject = stripslashes($u2usubject);
        $u2umessage = stripslashes($u2umessage);
        // U2U BB Code Mod End

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

        $u2usubject = checkOutput(censor($u2u['subject']));
        if ($u2u['type'] == 'incoming') {

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

        $u2usubject = checkOutput(censor($u2u['subject']));
        $u2u['subject'] = stripslashes($u2u['subject']);
        if ($u2u['type'] == 'incoming') {

============================================================================================================================
=======
Step 3:
=======
===============================
Go To Administration Panel --> Templates
===============================
=====================
Edit Template: u2u_header
=====================
==========
Find Code:
==========

<body text="$text">

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

$bbcodescript

============================================================================================================================
=======
Step 4:
=======
===============================
Go To Administration Panel --> Templates
===============================
===================
Edit Template: u2u_send
===================
==========
Find Code:
==========

<form method="post" action="u2u.php?action=send">

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

<form method="post" name="input" action="u2u.php?action=send">

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

<tr>
<td class="tablerow" bgcolor="$altbg1">$lang[textsubject]</td>
<td class="tablerow" bgcolor="$altbg2"><input type="text" name="subject" size="35" value="$subject" /></td>
</tr>

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

$bbcodeinsert

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