<script language="javascript" type="text/javascript" src="[% webpath %]/js/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
    mode : "textareas",
    theme : "advanced",
    plugins : "preview,searchreplace",
    theme_advanced_buttons1 : "bold,italic,underline,strikethrough,sub,sup,formatselect,hr,|,justifyleft,justifycenter,justifyright,justifyfull",
    theme_advanced_buttons2 : "bullist,numlist,|,link,unlink,anchor,|,undo,redo,search,replace",
    theme_advanced_buttons3 : "",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_path_location : "bottom",
    extended_valid_elements : "hr[class|width|size|noshade]",
    force_br_newlines : true,
    force_p_newlines : false,
    convert_urls : false
});
</script>


<h2>User Details</h2>

[% IF data %]
<p>Fields marked '*' are mandatory fields and must be completed.</p>

<form method="post" action="[% cgipath %]/pages.cgi" enctype="multipart/form-data">
<input type="hidden" name='userid' value='[% data.userid %]' />
<input type="hidden" name='act' value='user-save' />

<div class="boxer">
<table class="blocker">
        <tr><td valign="top" width="100">Nickname</td>
            <td valign="top" width="10"></td>
            <td valign="top"><input type="text" name="nickname" value='[% data.nickname %]' size="20" /></td>
        </tr>
        <tr><td valign="top">Real Name *</td>
            <td valign="top">[% data.realname_err %]</td>
            <td valign="top"><input type="text" name="realname" value='[% data.realname %]' size="60" /></td>
        </tr>
        <tr><td valign="top">Email *</td>
            <td valign="top">[% data.email_err %]</td>
            <td valign="top"><input type="text" name="email" value='[% data.email %]' size="60" />
<br />Your email address will NOT be publically visible or passed to any third party. It is required, as this will be your login and will be used to send you a site password.</td>
        </tr>
        <tr><td valign="top">Occupation</td>
            <td valign="top">[% data.job_err %]</td>
            <td valign="top"><input type="text" name="job" value='[% data.job %]' size="60" /></td>
        </tr>
        <tr><td valign="top">About Me</td>
            <td valign="top">[% data.aboutme_err %]</td>
            <td valign="top">
                Note: To add a line break hold down shift key and press the return key.<br />
                <textarea name="aboutme" rows="10" cols="50">[% data.aboutme %]</textarea></td>
        </tr>
        <tr><td valign="top">CPANID</td>
            <td valign="top">[% data.cpanid_err %]</td>
            <td valign="top"><input type="text" name="cpanid" value='[% data.cpanid %]' size="20" /></td>
        </tr>
        <tr><td valign="top">Links</td>
            <td valign="top">[% data.links_err %]</td>
            <td valign="top"><textarea name="links" rows="8" cols="50">[% data.links %]</textarea></td>
        </tr>

        <tr><td valign="top">Image</td>
            <td valign="top">[% data.image_err %]</td>
            <td valign="top">
                <input type="file" name="image" />
                <input type="hidden" name='imageid' value='[% data.imageid %]' /></td>
        </tr>
        <tr><td valign="top"></td>
            <td valign="top"></td>
            <td valign="top">
                <img src="[% webpath %]/[% data.link %]" border="0" alt="[% data.tag %]" /></td>
        </tr>
</table>
</div>

<p align="center"><input type="submit" name="submit" value='UPDATE' /></p>
</form>

<h2>Preview</h2>

[% item = preview %]
[% INCLUDE "users/user-item.html" %]

[% ELSE %]

<p>User not found.</p>

[% END %]
