Title: U2U Avatar v1.0

Author: WormHole

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

Copyright:  2009 XMB Garage. All rights reserved.

Compatability: XMB 1.9.8 SP3

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: include/u2u.inc.php
======================
==========
Find Code:
==========

function u2u_view($u2uid, $folders) {
    global $db, $dateformat, $timecode, $timeoffset, $addtime, $lang, $self, $oToken, $xmbuser;
    global $altbg1, $altbg2, $bordercolor, $THEME, $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 ".X_PREFIX."u2u WHERE u2uid='$u2uid' AND owner='$xmbuser'");
    $u2u = $db->fetch_array($query);
    if ($u2u) {
        if ($u2u['type'] == 'incoming') {
            $db->query("UPDATE ".X_PREFIX."u2u SET readstatus='yes' WHERE u2uid=$u2u[u2uid] OR (u2uid=$u2u[u2uid]+1 AND type='outgoing' AND msgto='$xmbuser')");
        } else if ($u2u['type'] == 'draft') {
            $db->query("UPDATE ".X_PREFIX."u2u SET readstatus='yes' WHERE u2uid=$u2u[u2uid]");
        }

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

function u2u_view($u2uid, $folders) {
    global $db, $dateformat, $timecode, $timeoffset, $addtime, $lang, $self, $oToken, $xmbuser, $SETTINGS;
    global $altbg1, $altbg2, $bordercolor, $THEME, $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 ".X_PREFIX."u2u AS u LEFT JOIN ".X_PREFIX."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 ".X_PREFIX."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 ".X_PREFIX."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'].'" />';
            }
        }

=======================================================================================================================================
==========================
Go To Admin Panel --> Templates
==========================
===================
Edit Template: u2u_view
===================
==========
Find Code:
==========

$lang[textmessage]

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

$lang[textmessage]$u2uavatar

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