<?php
/**
 * $Source: /home/cvs/nukescripts/modules/Your_Account/public/edituser.php,v $
 * $Revision: 3.3.1-1 $
 * $Author: cyril $
 * $Date: 2006/07/01 12:15:04 $
 * Fix champs perso ( Bug 127 )
 */
/************************************************************************/
/* Maximus CMS: Web Portal System                                       */
/* ==============================                                       */
/*                                                                      */
/* Copyright (c) 2002 - 2006                                            */
/* http://www.php-maximus.fr                                            */
/* dev@php-maximus.org                                                  */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
/* Based on PHP-NUKE: Web Portal System                                 */
/************************************************************************/
/********************************************************/
/* 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 edituser MAXIMUS directly...');
defined('MAXIMUS') OR header("Location: index.php");

    getusrinfo($user);
    if (($userinfo['username'] == $cookie[1]) AND ($userinfo['user_password'] == $cookie[2])) {
    include_once("includes/nbbcode.php");
        incoh();
        title(_PERSONALINFO);
        Max_OpenTable();
        nav();
        Max_CloseTable();
        br('1');
        if (!eregi("http://", $userinfo['user_website']) && $userinfo['user_website'] != "http://") {
            $userinfo['user_website'] = "http://".$userinfo['user_website'];
        }
        Max_OpenTable();
        echo "<table class='forumline' cellpadding='3' cellspacing='3' border='0' width='100%'>";
        echo "<form action='modules.php?name=$module_name' method='post' name='youraccount'>";
        echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._USRNICKNAME."</b>:</td><td bgcolor='$bgcolor3'><b>$userinfo[username]</b></td></tr>";
        echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._UREALNAME."</b>:<br />"._REQUIRED."</td><td bgcolor='$bgcolor3'>";
        echo "<input type='text' name='realname' value=\"$userinfo[name]\" size='50' maxlength='60' /></td></tr>";
        if ($ya_config['allowmailchange'] < 1) {
            echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._UREALEMAIL.":</b><br />"._REQUIRED."</td>";
            echo "<td bgcolor='$bgcolor3'><input type='text' name='user_email' value=\"$userinfo[user_email]\" size='50' maxlength='255' /><br />"._EMAILNOTPUBLIC."</td></tr>";
        } else {
            echo "<input type=\"hidden\" name='user_email' value=\"$userinfo[user_email]\" />\n";
        }
        echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._UFAKEMAIL.":</b><br />"._OPTIONAL."</td>";
        echo "<td bgcolor='$bgcolor3'><input type='text' name='femail' value=\"$userinfo[femail]\" size='50' maxlength='255' /><br />"._EMAILPUBLIC."</td></tr>";
        echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._YOURHOMEPAGE.":</b><br />"._OPTIONAL."</td>";
        echo "<td bgcolor='$bgcolor3'><input type='text' name='user_website' value=\"$userinfo[user_website]\" size='50' maxlength='255' /></td></tr>";


	// CHAMPS PARAMETRABLES

if (ya_get_field(1) != "") {
$u = $db->sql_fetchrow($db->sql_query("select `field1` from `".TABLE_NSNYA_USERSFIELDS."`  where `user_id`='$userinfo[user_id]' "));
$field1 = stripslashes(check_html($u['field1'], "nohtml"));
echo "<tr><td bgcolor=\"$bgcolor2\"><b>".ya_get_field(1).":</b></td>";
echo "<td bgcolor='$bgcolor3'><input type='text' name='xfield1' value='$field1' size='50' maxlength='255' /></td></tr>";
	}
if (ya_get_field(2) != "") {
$u = $db->sql_fetchrow($db->sql_query("select `field2` from `".TABLE_NSNYA_USERSFIELDS."`  where `user_id`='$userinfo[user_id]' "));
$field2 = stripslashes(check_html($u['field2'], "nohtml"));
echo "<tr><td bgcolor=\"$bgcolor2\"><b>".ya_get_field(2).":</b></td>";
echo "<td bgcolor='$bgcolor3'><input type='text' name='xfield2' value='$field2' size='50' maxlength='255' /></td></tr>";
	}
if (ya_get_field(3) != "") {
$u = $db->sql_fetchrow($db->sql_query("select `field3` from `".TABLE_NSNYA_USERSFIELDS."`  where `user_id`='$userinfo[user_id]' "));
$field3 = stripslashes(check_html($u['field3'], "nohtml"));
echo "<tr><td bgcolor=\"$bgcolor2\"><b>".ya_get_field(3).":</b></td>";
echo "<td bgcolor='$bgcolor3'><input type='text' name='xfield3' value='$field3' size='50' maxlength='255' /></td></tr>";
	}
if (ya_get_field(4) != "") {
$u = $db->sql_fetchrow($db->sql_query("select `field4` from `".TABLE_NSNYA_USERSFIELDS."`  where `user_id`='$userinfo[user_id]' "));
$field4 = stripslashes(check_html($u['field4'], "nohtml"));
echo "<tr><td bgcolor=\"$bgcolor2\"><b>".ya_get_field(4).":</b></td>";
echo "<td bgcolor='$bgcolor3'><input type='text' name='xfield4' value='$field4' size='50' maxlength='255' /></td></tr>";
	}
if (ya_get_field(5) != "") {
$u = $db->sql_fetchrow($db->sql_query("select `field5` from `".TABLE_NSNYA_USERSFIELDS."`  where `user_id`='$userinfo[user_id]' "));
$field5 = stripslashes(check_html($u['field5'], "nohtml"));
echo "<tr><td bgcolor=\"$bgcolor2\"><b>".ya_get_field(5).":</b></td>";
echo "<td bgcolor='$bgcolor3'><input type='text' name='xfield5' value='$field5' size='50' maxlength='255' /></td></tr>";
	}
if (ya_get_field(6) != "") {
$u = $db->sql_fetchrow($db->sql_query("select `field6` from `".TABLE_NSNYA_USERSFIELDS."`  where `user_id`='$userinfo[user_id]' "));
$field6 = stripslashes(check_html($u['field6'], "nohtml"));
echo "<tr><td bgcolor=\"$bgcolor2\"><b>".ya_get_field(6).":</b></td>";
echo "<td bgcolor='$bgcolor3'><input type='text' name='xfield6' value='$field6' size='50' maxlength='255' /></td></tr>";
	}
if (ya_get_field(7) != "") {
$u = $db->sql_fetchrow($db->sql_query("select `field7` from `".TABLE_NSNYA_USERSFIELDS."`  where `user_id`='$userinfo[user_id]' "));
$field7 = stripslashes(check_html($u['field7'], "nohtml"));
echo "<tr><td bgcolor=\"$bgcolor2\"><b>".ya_get_field(7).":</b></td>";
echo "<td bgcolor='$bgcolor3'><input type='text' name='xfield7' value='$field7' size='50' maxlength='255' /></td></tr>";
	}
if (ya_get_field(8) != "") {
$u = $db->sql_fetchrow($db->sql_query("select `field8` from `".TABLE_NSNYA_USERSFIELDS."`  where `user_id`='$userinfo[user_id]' "));
$field8 = stripslashes(check_html($u['field8'], "nohtml"));
echo "<tr><td bgcolor=\"$bgcolor2\"><b>".ya_get_field(8).":</b></td>";
echo "<td bgcolor='$bgcolor3'><input type='text' name='xfield8' value='$field8' size='50' maxlength='255' /></td></tr>";
	}
if (ya_get_field(9) != "") {
$u = $db->sql_fetchrow($db->sql_query("select `field9` from `".TABLE_NSNYA_USERSFIELDS."`  where `user_id`='$userinfo[user_id]' "));
$field9 = stripslashes(check_html($u['field9'], "nohtml"));
echo "<tr><td bgcolor=\"$bgcolor2\"><b>".ya_get_field(9).":</b></td>";
echo "<td bgcolor='$bgcolor3'><input type='text' name='xfield9' value='$field9' size='50' maxlength='255' /></td></tr>";
	}
if (ya_get_field(10) != "") {
$u = $db->sql_fetchrow($db->sql_query("select `field10` from `".TABLE_NSNYA_USERSFIELDS."`  where `user_id`='$userinfo[user_id]' "));
$field10 = stripslashes(check_html($u['field10'], "nohtml"));
echo "<tr><td bgcolor=\"$bgcolor2\"><b>".ya_get_field(10).":</b></td>";
echo "<td bgcolor='$bgcolor3'><input type='text' name='xfield10' value='$field10' size='50' maxlength='255' /></td></tr>";
	}

        echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._YICQ.":</b><br />"._OPTIONAL."</td>";
        echo "<td bgcolor='$bgcolor3'><input type='text' name='user_icq' value=\"$userinfo[user_icq]\" size='30' maxlength='100' /></td></tr>";
        echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._YAIM.":</b><br />"._OPTIONAL."</td>";
        echo "<td bgcolor='$bgcolor3'><input type='text' name='user_aim' value=\"$userinfo[user_aim]\" size='30' maxlength='100' /></td></tr>";
        echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._YYIM.":</b><br />"._OPTIONAL."</td>";
        echo "<td bgcolor='$bgcolor3'><input type='text' name='user_yim' value=\"$userinfo[user_yim]\" size='30' maxlength='100' /></td></tr>";
        echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._YMSNM.":</b><br />"._OPTIONAL."</td>";
        echo "<td bgcolor='$bgcolor3'><input type='text' name='user_msnm' value=\"$userinfo[user_msnm]\" size='30' maxlength='100' /></td></tr>";
        echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._YLOCATION.":</b><br />"._OPTIONAL."</td>";
        echo "<td bgcolor='$bgcolor3'><input type='text' name='user_from2' value=\"$userinfo[user_from2]\" size='30' maxlength='100' /></td></tr>";

	echo "<tr bgcolor=\"$bgcolor2\"><td width='20%'><b>"._LOCATION.":</b></td>";
echo "<td bgcolor='$bgcolor3' colspan=\"2\"><select name='user_from'>";
        $result = $db->sql_query("SELECT `c2code`, `country` FROM `".TABLE_USERS."_countries` ORDER BY `country`");
        while( $row = $db->sql_fetchrow($result)) {
	$c2code  = stripslashes($row['c2code']);
	$country = stripslashes($row['country']);
            echo "<option value='$c2code'";
            if ($userinfo['user_from'] == $c2code) { echo " selected"; }
            echo ">$country</option>\n";
        }
        echo "</select></td></tr>\n";

        echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._YOCCUPATION.":</b><br />"._OPTIONAL."</td>";
        echo "<td bgcolor='$bgcolor3'><input type='text' name='user_occ' value=\"$userinfo[user_occ]\" size='30' maxlength='100' /></td></tr>";
        echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._YINTERESTS.":</b><br />"._OPTIONAL."</td>";
        echo "<td bgcolor='$bgcolor3'><input type='text' name='user_interests' value=\"$userinfo[user_interests]\" size='30' maxlength='100' /></td></tr>";
        echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._RECEIVENEWSLETTER."</b></td><td bgcolor='$bgcolor3'>";
        if ($userinfo['newsletter'] == 1) { $ck1 = " selected"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " selected"; }
        echo "<select name='newsletter'><option value='1'$ck1>"._YES."</option>";
        echo "<option value='0'$ck2>"._NO."</option></select></td></tr>";
        echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._ALWAYSSHOWEMAIL.":</b></td><td bgcolor='$bgcolor3'>";
        if ($userinfo['user_viewemail'] == 1) { $ck1 = " selected"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " selected"; }
        echo "<select name='user_viewemail'><option value='1'$ck1>"._YES."</option>";
        echo "<option value='0'$ck2>"._NO."</option></select></td></tr>";
        echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._HIDEONLINE.":</b></td><td bgcolor='$bgcolor3'>";
        if ($userinfo['user_allow_viewonline'] == 1) { $ck1 = " selected"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " selected"; }
        echo "<select name='user_allow_viewonline'><option value='1'$ck1>"._YES."</option>";
        echo "<option value='0'$ck2>"._NO."</option></select></td></tr>";
        echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._REPLYNOTIFY.":</b><br />"._REPLYNOTIFYMSG."</td><td bgcolor='$bgcolor3'>";
        if ($userinfo['user_notify'] == 1) { $ck1 = " selected"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " selected"; }
        echo "<select name='user_notify'><option value='1'$ck1>"._YES."</option>";
        echo "<option value='0'$ck2>"._NO."</option></select></td></tr>";
        echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._PMNOTIFY.":</b></td><td bgcolor='$bgcolor3'>";
        if ($userinfo['user_notify_pm'] == 1) { $ck1 = " selected"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " selected"; }
        echo "<select name='user_notify_pm'><option value='1'$ck1>"._YES."</option>";
        echo "<option value='0'$ck2>"._NO."</option></select></td></tr>";
        echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._POPPM.":</b><br />"._POPPMMSG."</td><td bgcolor='$bgcolor3'>";
        if ($userinfo['user_popup_pm'] == 1) { $ck1 = " selected"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " selected"; }
        echo "<select name='user_popup_pm'><option value='1'$ck1>"._YES."</option>";
        echo "<option value='0'$ck2>"._NO."</option></select></td></tr>";
        echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._ATTACHSIG.":</b></td><td bgcolor='$bgcolor3'>";
        if ($userinfo['user_attachsig'] == 1) { $ck1 = " selected"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " selected"; }
        echo "<select name='user_attachsig'><option value='1'$ck1>"._YES."</option>";
        echo "<option value='0'$ck2>"._NO."</option></select></td></tr>";
        echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._ALLOWBBCODE."</b></td><td bgcolor='$bgcolor3'>";
        if ($userinfo['user_allowbbcode'] == 1) { $ck1 = " selected"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " selected"; }
        echo "<select name='user_allowbbcode'><option value='1'$ck1>"._YES."</option>";
        echo "<option value='0'$ck2>"._NO."</option></select></td></tr>";
        echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._ALLOWHTMLCODE."</b></td><td bgcolor='$bgcolor3'>";
        if ($userinfo['user_allowhtml'] == 1) { $ck1 = " selected"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " selected"; }
        echo "<select name='user_allowhtml'><option value='1'$ck1>"._YES."</option>";
        echo "<option value='0'$ck2>"._NO."</option></select></td></tr>";
        echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._ALLOWSMILIES."</b></td><td bgcolor='$bgcolor3'>";
        if ($userinfo['user_allowsmile'] == 1) { $ck1 = " selected"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " selected"; }
        echo "<select name='user_allowsmile'><option value='1'$ck1>"._YES."</option>";
        echo "<option value='0'$ck2>"._NO."</option></select></td></tr>";
        echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._FORUMSTIME."</b></td><td bgcolor='$bgcolor3'>";
        echo "<select name='user_timezone'>";
        for ($i=-12; $i<13; $i++) {
            if ($i == 0) {
                $dummy = "GMT";
            } else {
                if (!ereg("-", $i)) { $i = "+$i"; }
                $dummy = "GMT $i "._HOURS."";
            }
            if ($userinfo['user_timezone'] == $i) {
                echo "<option name='user_timezone' value=\"$i\" selected>$dummy</option>";
            } else {
                echo "<option name='user_timezone' value=\"$i\">$dummy</option>";
            }
        }
        echo "</select>";
        echo "</td></tr>";
        echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._FORUMSDATE.":</b><br />"._FORUMSDATEMSG."</b></td><td bgcolor='$bgcolor3'>";
        echo "<input size='15' maxlength='14' type='text' name='user_dateformat' value=\"$userinfo[user_dateformat]\" />";
        echo "</td></tr>";

        echo "<tr><td bgcolor=\"$bgcolor2\" valign='top'><b>"._SIGNATURE.":</b><br />"._OPTIONAL."<br />"._NOHTML."</td>";

        echo "<td bgcolor='$bgcolor3'>";
 $user_sig = stripslashes($userinfo['user_sig']);
        echo bbcode_table('user_sig', 'youraccount', 1);
	echo "<textarea wrap='virtual' cols='70' rows='10' name='user_sig'>$user_sig</textarea><br />"._255CHARMAX."</td></tr>";


        echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._EXTRAINFO.":</b><br />"._OPTIONAL."<br />"._NOHTML."</td>";
        echo "<td bgcolor='$bgcolor3'><textarea wrap='virtual' cols='70' rows='5' name='bio'>$userinfo[bio]</textarea><br />"._CANKNOWABOUT."</td></tr>";
        echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._PASSWORD."</b>:</td><br />";
        echo "<td bgcolor='$bgcolor3'><input type='password' name='user_password' size='22' maxlength='".$ya_config['pass_max']."' />&nbsp;&nbsp;&nbsp;<input type='password' name='vpass' size='22' maxlength='".$ya_config['pass_max']."' /><br />"._TYPENEWPASSWORD."</td></tr>";
        echo "<tr><td bgcolor='$bgcolor3' colspan='2' align='center'>";
        echo "<input type=\"hidden\" name='username' value=\"$userinfo[username]\" />";
        echo "<input type=\"hidden\" name='user_id' value=\"$userinfo[user_id]\" />";
        echo "<input type=\"hidden\" name='op' value='saveuser' />";
        echo "<input type='submit' value='"._SAVECHANGES."' />";
        echo "</form></td></tr>";
        $avatar_category = ( !empty($HTTP_POST_VARS['avatarcategory']) ) ? $HTTP_POST_VARS['avatarcategory'] : '';
        $direktori = "modules/Forums/images/avatars";
        $dir = @opendir($direktori);
        $avatar_images = array();
        while( $file = @readdir($dir) ) {
            if( $file != '.' && $file != '..' && !is_file($direktori . '/' . $file) && !is_link($direktori . '/' . $file) ) {
                $sub_dir = @opendir($direktori . '/' . $file);
                $avatar_row_count = 0;
                $avatar_col_count = 0;
                while( $sub_file = @readdir($sub_dir) ) {
                    if( preg_match('/(\.gif$|\.png$|\.jpg|\.jpeg)$/is', $sub_file) ) {
                        $avatar_images[$file][$avatar_row_count][$avatar_col_count] = $file . '/' . $sub_file;
                        $avatar_name[$file][$avatar_row_count][$avatar_col_count] = ucfirst(str_replace("_", " ", preg_replace('/^(.*)\..*$/', '\1', $sub_file)));
                        $avatar_col_count++;
                        if( $avatar_col_count == 5 ) {
                            $avatar_row_count++;
                            $avatar_col_count = 0;
                        }
                    }
                }
            }
        }
        @closedir($dir);
        @ksort($avatar_images);
        @reset($avatar_images);
        if( empty($category) ) {
            list($category, ) = each($avatar_images);
        }
        @reset($avatar_images);
        $s_categories = '<select name="avatarcategory">';
        while( list($key) = each($avatar_images) ) {
            $selected = ( $key == $category ) ? ' selected="selected"' : '';
            if( count($avatar_images[$key]) ) {
                $s_categories .= '<option value="' . $key . '"' . $selected . '>' . ucfirst($key) . '</option>';
            }
        }
        $s_categories .= '</select>';
        $sql = "SELECT * FROM `".$prefix."_bbconfig` ";
        $result = $db->sql_query($sql);
        while ( $row = $db->sql_fetchrow($result) ) {
            $board_config[$row['config_name']] = $row['config_value'];
        }
        if ($userinfo['user_avatar_type'] == 1) {
            $user_avatar = $board_config['avatar_path']."/".$userinfo['user_avatar'];
        } elseif ($userinfo['user_avatar_type'] == 2) {
            $user_avatar = $userinfo['user_avatar'];
        } else {
            $user_avatar = $board_config['avatar_gallery_path']."/".$userinfo['user_avatar'];
        }
        echo "<tr><td bgcolor='$bgcolor3' colspan='2' align='center'>";
        echo "<font class='title'>"._YA_AVCP."</font></b><br />";
        echo "<tr><td bgcolor=\"$bgcolor2\">"._YA_AVINF1." ".$board_config['avatar_max_width']." "._YA_AVINF2." ".$board_config['avatar_max_height']." "._YA_AVINF3." ".YA_CoolSize($board_config['avatar_filesize']).".</td>";
        if (ereg("(http)", $userinfo['user_avatar'])) {
            echo "<td bgcolor='$bgcolor3' align=center>"._YA_CURRAV."<br /><img alt='' src=\"$userinfo[user_avatar]\" width=\"40\" height='50' /></td></tr>";
        } elseif ($userinfo['user_avatar']) {
            echo "<td bgcolor='$bgcolor3' align=center>"._YA_CURRAV."<br /><img alt='' src=\"modules/Forums/images/avatars/$userinfo[user_avatar]\" width=\"40\" height='50' /></td></tr>";
        }
        br('1');
        if ($board_config['allow_avatar_local']) {
            echo "<form action=\"modules.php?name=Your_Account&op=avatarlist\" method=\"post\">";
            echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._YA_SELAVGALL.":</b></td>";
            echo "<td bgcolor='$bgcolor3'>".$s_categories."&nbsp;<img src=\"images/right.gif\" align='middle' />&nbsp;<input class='button' type='submit' value=\""._YA_SHOWGALL."\" /></td></tr>";
            echo "</form>";
        } else {
            echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._YA_SELAVGALL.":</b></td>";
            echo "<td bgcolor='$bgcolor3'><b>"._YA_DISABLED."</b></td></tr>";
        }
        if ($board_config['allow_avatar_upload']) {
            echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._YA_UPLOADAV.":</b></td>";
            echo "<td bgcolor='$bgcolor3'><a href=\"modules.php?name=Forums&file=profile&mode=editprofile\"><b>"._YA_UPLOADFORUM."</b></a></td></tr>";
            echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._YA_UPLOADURL.":</b><br /><SPAN class=gensmall>"._YA_AVCOPIED."</SPAN></td>";
            echo "<td bgcolor='$bgcolor3'><a href=\"modules.php?name=Forums&file=profile&mode=editprofile\"><b>"._YA_UPLOADFORUM."</b></a></td></tr>";
        } else {
            echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._YA_UPLOADURL.":</b></td>";
            echo "<td bgcolor='$bgcolor3'><b>"._YA_DISABLED."</b></td></tr>";
            echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._YA_UPLOADAV.":</b></td>";
            echo "<td bgcolor='$bgcolor3'><b>"._YA_DISABLED."</b></td></tr>";
        }
        echo "<form action=\"modules.php?name=Your_Account&op=avatarlinksave\" method=\"post\">";
        if ($board_config['allow_avatar_remote']) {
            echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._YA_OFFSITE.":</b><br /><span class='gensmall'>"._YA_SUBMITBUTTON."</span></td>";
            echo "<td bgcolor='$bgcolor3'><input class='post' style=\"WIDTH: 200px\" size='40' name='avatar' value=\"".$userinfo['user_avatar']."\" /></td></tr>";
        } else {
            echo "<tr><td bgcolor=\"$bgcolor2\"><b>"._YA_OFFSITE.":</b></td>";
            echo "<td bgcolor='$bgcolor3'><b>"._YA_DISABLED."</b></td></tr>";
        }
        echo "<tr><td bgcolor='$bgcolor3' colspan='2' align='center'>";
        echo "<input class='mainoption' type='submit' value="._SAVECHANGES." />";
        echo "</form></td></tr></table>";
        Max_CloseTable();
        incof();
    } else {
        mmain($user);
    }