============================================================================================================================
Modification Title: U2U Avatar

Version: 1.0

Author: WormHole

Description: This modification will display avatars from the u2u sender.

Copyright:  2010 XMB Garage. 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 v3. 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: include/u2u.inc.php
======================
==========
Find Code:
==========

function u2u_view($u2uid, $folders) {
    global $db, $dateformat, $timecode, $timeoffset, $addtime, $lang;
    global $table_u2u, $self;
    global $altbg1, $altbg2, $bordercolor, $borderwidth, $tablespace, $cattext, $thewidth;
    global $sendoptions, $u2uheader, $u2ufooter;

    $delchecked = $leftpane = '';

    $u2uid = (int) $u2uid;

    if (!($u2uid > 0)) {
        error($lang['textnonechosen'], false, $u2uheader, $u2ufooter, "u2u.php", true, false, false);
        return;
    }

    $query = $db->query("SELECT * FROM $table_u2u WHERE u2uid='$u2uid' AND owner='$self[username]'");
    $u2u = $db->fetch_array($query);
    if ($u2u) {
        if ($u2u['type'] == 'incoming') {
            $db->query("UPDATE $table_u2u SET readstatus='yes' WHERE u2uid=$u2u[u2uid] OR (u2uid=$u2u[u2uid]+1 AND type='outgoing' AND msgto='$self[username]')");
        } elseif ($u2u['type'] == 'draft') {
            $db->query("UPDATE $table_u2u SET readstatus='yes' WHERE u2uid=$u2u[u2uid]");
        }

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

// U2U Avatar Mod Begin
function u2u_view($u2uid, $folders) {
    global $db, $dateformat, $timecode, $timeoffset, $addtime, $lang, $SETTINGS;
    global $table_members, $table_u2u, $self;
    global $altbg1, $altbg2, $bordercolor, $borderwidth, $tablespace, $cattext, $thewidth;
    global $sendoptions, $u2uheader, $u2ufooter;

    $delchecked = '';
    $leftpane = '';
    
    $u2uid = (int) $u2uid;

    if (!($u2uid > 0)) {
        error( $lang['textnonechosen'], false, $u2uheader, $u2ufooter, "u2u.php", true, false, false );
        return;
    }

    $query = $db->query("SELECT u.*, m.avatar FROM $table_u2u AS u LEFT JOIN $table_members AS m ON u.msgfrom=m.username WHERE u2uid='$u2uid' AND owner='$self[username]'");
    $u2u = $db->fetch_array($query);
    if ($u2u) {
        $u2uavatar = '';
        if ($u2u['type'] == 'incoming') {
            $db->query("UPDATE $table_u2u SET readstatus='yes' WHERE u2uid=$u2u[u2uid] OR (u2uid=$u2u[u2uid]+1 AND type='outgoing' AND msgto='$self[username]')");
            if ($SETTINGS['avastatus'] != 'off' And $u2u['avatar'] != '') {
                $u2uavatar = '<br /><img src="'.$u2u['avatar'].'" alt="'.$u2u['msgfrom'].'" />';
            }
        } else if ($u2u['type'] == 'draft') {
            $db->query("UPDATE $table_u2u SET readstatus='yes' WHERE u2uid=$u2u[u2uid]");
            if ($SETTINGS['avastatus'] != 'off' And $u2u['avatar'] != '') {
                $u2uavatar = '<br /><img src="'.$u2u['avatar'].'" alt="'.$u2u['msgfrom'].'" />';
            }
        } else {
            if ($SETTINGS['avastatus'] != 'off' And $u2u['avatar'] != '') {
                $u2uavatar = '<br /><img src="'.$u2u['avatar'].'" alt="'.$u2u['msgfrom'].'" />';
            }
        }
        // U2U Avatar Mod End

============================================================================================================================
=======
Step 2:
=======
===============================
Go To Administration Panel --> Templates
i==================================================
Edit Templates -> u2u_view AND u2u_view_admin (Not in 1.9.5 SP1)
==================================================
==========
Find Code:
==========

$lang[textmessage]

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

$lang[textmessage]$u2uavatar

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