<?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 activate MAXIMUS directly...');
defined('MAXIMUS') OR header("Location: index.php");

    if ($ya_config['expiring']!=0) {
        $past = time()-$ya_config['expiring'];
        $GLOBALS['db']->sql_query("DELETE FROM `".TABLE_USERS_TEMP."` WHERE `time` < '$past'");
        $GLOBALS['db']->sql_query("OPTIMIZE TABLE `".TABLE_USERS_TEMP."`");
    }
    $result = $GLOBALS['db']->sql_query("SELECT * FROM `".TABLE_USERS_TEMP."` WHERE `username`='$username' AND `check_num`='$check_num'");
    if ($GLOBALS['db']->sql_numrows($result) == 1) {
        $row = $GLOBALS['db']->sql_fetchrow($result);
        $lv = time();
        incoh();
        title(_PERSONALINFO);
        Max_OpenTable();
        echo "<table class='forumline' cellpadding=\"3\" cellspacing=\"3\" border=\"0\" width='100%'>\n";
        echo "<tr><td align=\"center\" bgcolor='$bgcolor2' colspan=\"2\"><b>"._FORACTIVATION."</b>:</td></tr>\n";
        echo "<form name=\"Register\" action=\"modules.php?name=$module_name\" method=\"post\">\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._USRNICKNAME.":</td><td bgcolor='$bgcolor1'>$row[username]</td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._UREALNAME.":<br />"._REQUIRED."</td><td bgcolor='$bgcolor1'>";
        echo "<input type=\"text\" name=\"realname\" value=\"$row[username]\" size=\"50\" maxlength=\"60\"></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._UREALEMAIL.":</td>";
        echo "<td bgcolor='$bgcolor1'>$row[user_email]</td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._UFAKEMAIL.":<br />"._OPTIONAL."</td>";
        echo "<td bgcolor='$bgcolor1'><input type=\"text\" name=\"femail\" value=\"\" size=\"50\" maxlength=\"255\"><br />"._EMAILPUBLIC."</td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._YOURHOMEPAGE.":<br />"._OPTIONAL."</td>";
        echo "<td bgcolor='$bgcolor1'><input type=\"text\" name=\"user_website\" value=\"\" size=\"50\" maxlength=\"255\"></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._YICQ.":<br />"._OPTIONAL."</td>";
        echo "<td bgcolor='$bgcolor1'><input type=\"text\" name=\"user_icq\" value=\"\" size=\"30\" maxlength=\"100\"></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._YAIM.":<br />"._OPTIONAL."</td>";
        echo "<td bgcolor='$bgcolor1'><input type=\"text\" name=\"user_aim\" value=\"\" size=\"30\" maxlength=\"100\"></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._YYIM.":<br />"._OPTIONAL."</td>";
        echo "<td bgcolor='$bgcolor1'><input type=\"text\" name=\"user_yim\" value=\"\" size=\"30\" maxlength=\"100\"></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._YMSNM.":<br />"._OPTIONAL."</td>";
        echo "<td bgcolor='$bgcolor1'><input type=\"text\" name=\"user_msnm\" value=\"\" size=\"30\" maxlength=\"100\"></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._YLOCATION.":<br />"._OPTIONAL."</td>";
        echo "<td bgcolor='$bgcolor1'><input type=\"text\" name=\"user_from\" value=\"\" size=\"30\" maxlength=\"100\"></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._YOCCUPATION.":<br />"._OPTIONAL."</td>";
        echo "<td bgcolor='$bgcolor1'><input type=\"text\" name=\"user_occ\" value=\"\" size=\"30\" maxlength=\"100\"></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._YINTERESTS.":<br />"._OPTIONAL."</td>";
        echo "<td bgcolor='$bgcolor1'><input type=\"text\" name=\"user_interests\" value=\"\" size=\"30\" maxlength=\"100\"></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._RECEIVENEWSLETTER."</td><td bgcolor='$bgcolor1'><select name='newsletter'>";
        echo "<option value=\"1\">"._YES."</option><option value=\"0\" selected>"._NO."</option></select></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._ALWAYSSHOWEMAIL.":</td><td bgcolor='$bgcolor1'><select name='user_viewemail'>";
        echo "<option value=\"1\">"._YES."</option><option value=\"0\" selected>"._NO."</option></select></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._HIDEONLINE.":</td><td bgcolor='$bgcolor1'><select name='user_allow_viewonline'>";
        echo "<option value=\"1\">"._YES."</option><option value=\"0\" selected>"._NO."</option></select></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._FORUMSTIME."</td><td bgcolor='$bgcolor1'><select name='user_timezone'>";
        $utz = date("Z");
        $utz = round($utz/3600);
        for ($i=-12; $i<13; $i++) {
            if ($i == 0) {
                $dummy = "GMT";
            } else {
                if (!ereg("-", $i)) { $i = "+$i"; }
                $dummy = "GMT $i "._HOURS."";
            }
            if ($utz == $i) {
                echo "<option name=\"user_timezone\" value=\"$i\" selected>$dummy</option>";
            } else {
                echo "<option name=\"user_timezone\" value=\"$i\">$dummy</option>";
            }
        }
        echo "</select></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._FORUMSDATE.":<br />"._FORUMSDATEMSG."</td><td bgcolor='$bgcolor1'>";
        echo "<input type=\"text\" name=\"user_dateformat\" value=\"Y-m-d, H:i:s\" size='15' maxlength='14' /></td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._SIGNATURE.":<br />"._OPTIONAL."<br />"._NOHTML."</td>";
        echo "<td bgcolor='$bgcolor1'><textarea wrap=\"virtual\" cols=\"50\" rows=\"5\" name=\"user_sig\">$userinfo[user_sig]</textarea><br />"._255CHARMAX."</td></tr>\n";
        echo "<tr><td bgcolor='$bgcolor2'>"._EXTRAINFO.":<br />"._OPTIONAL."<br />"._NOHTML."</td>";
        echo "<td bgcolor='$bgcolor1'><textarea wrap=\"virtual\" cols=\"50\" rows=\"5\" name=\"bio\">$userinfo[bio]</textarea><br />"._CANKNOWABOUT."</td></tr>\n";
        echo "<input type=\"hidden\" name=\"username\" value=\"$row[username]\" />";
        echo "<input type=\"hidden\" name=\"check_num\" value=\"$check_num\" />\n";
        echo "<input type=\"hidden\" name=\"time\" value=\"$row[time]\" />\n";
        echo "<input type=\"hidden\" name=\"op\" value=\"saveactivate\" />";
        echo "<tr><td bgcolor='$bgcolor1' colspan='2' align='center'><input type=\"submit\" value=\""._SAVECHANGES."\" onclick=\"this.form.submit();this.disabled=true;this.value='"._WAITING."'\" /></td></tr>\n";
        echo "</form>\n";
        echo "</table>\n";
        Max_CloseTable();
        incof();
        die();
    } else {
        incoh();
        title(""._ACTIVATIONERROR."");
        Max_OpenTable();
        echo "<center>"._ACTERROR."</center>";
        Max_CloseTable();
        incof();
        die();
    }