<?php
/********************************************************/
/* NSN Your Account                                     */
/* By: NukeScripts Network (webmaster@nukescripts.net)  */
/* http://www.nukescripts.fr                            */
/* Original Script www.nukescripst.net                  */
/* Copyright  2000-2005 by NukeScripts Network         */
/* ==================================================== */
/* Based from:                                          */
/* PHP-NUKE: Web Portal System                          */
/********************************************************/
defined('IN_YA') OR die ('Access denied avatarsave MAXIMUS directly...');
defined('MAXIMUS') OR header("Location: index.php");

if (defined('USER_ALLOW')) {
    getusrinfo($user);
    cookiedecode($user);
    incoh();
    title(_YA_AVATARSUCCESS);
    Max_OpenTable();
    nav();
    Max_CloseTable();
    br('1');
    Max_OpenTable();
    $newavatar=$category."/".$avatar;
    $db->sql_query("UPDATE `".TABLE_USERS."` SET `user_avatar`='$newavatar', `user_avatar_type`='3' WHERE `username`='$cookie[1]'");
    echo "<center><font class=\"content\">"._YA_AVATARFOR." ".$cookie[1]." "._YA_SAVED."</font></center><br />";
    if (ereg("(http)", $newavatar)) {
        echo "<center>"._YA_NEWAVATAR.":<br /><img alt=\"\" src=\"$newavatar\" /><br />";
        echo "[ <a href=\"modules.php?name=$module_name&amp;op=edituser\">"._YA_BACKPROFILE."</a> | <a href=\"modules.php?name=$module_name\">"._YA_DONE."</a> ]</center>";
    } elseif ($newavatar) {
        echo "<center>"._YA_NEWAVATAR.":<br /><img alt=\"\" src=\"modules/Forums/images/avatars/$newavatar\" /><br />";
        echo "[ <a href=\"modules.php?name=$module_name&amp;op=edituser\">"._YA_BACKPROFILE."</a> | <a href=\"modules.php?name=$module_name\">"._YA_DONE."</a> ]</center>";
    }
    Max_CloseTable();
    incof();
} else { notuser(); }