// along with this program; see the file COPYING.txt.  If not, see
// <http://www.gnu.org/licenses/>
// -----------------------------------------------------------------------
?>

<?php 
$fields = "";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    reset($_POST);
    foreach ($_POST as $key => $value) {
        $fields .= input_($key, $value, "hidden");
    }
} else {
    reset($_GET);
    foreach ($_GET as $key => $value) {
        $fields .= input_($key, $value, "hidden");
    }
}
if (isset($trust)) {
    $trust_string = _("You are about to login to <a href='{1}'>{1}</a>. You have done this {2} times before. Last login datetime: {3}");
    $trust_string = str_replace('{1}', '<a href="' . htmlspecialchars($trust['trust_url']) . '">' . htmlspecialchars($trust['trust_url']) . '</a>', $trust_string);
    $trust_string = str_replace('{2}', $trust['trust_total'], $trust_string);
    $trust_string = str_replace('{3}', $trust['trust_last_visit'], $trust_string);
    ?>
	<p><?php 
    echo $trust_string;
    ?>
</p>
<?php 
} elseif (isset($trust_url)) {
    $trust_string = _("You are about to login to <a href='{1}'>{1}</a>. This is the first time you login to that site.");
// along with this program; see the file COPYING.txt.  If not, see
// <http://www.gnu.org/licenses/>
// -----------------------------------------------------------------------
if (isset($webspace['webspace_css'])) {
    ?>
<style type="text/css">
	<!--
	<?php 
    echo $webspace['webspace_css'];
    ?>
	-->
	</style>
<?php 
}
$emailForm = labelinput_("contact_email", _("Email address"));
$emailForm .= note_(_("Your email address will be sent to me to allow me to reply. It is not kept."));
$emailForm .= labelinput_("contact_subject", _("Subject"));
$emailForm .= labeltextarea_("contact_message", _("Message"));
$emailForm .= p_(_("Please solve the following mathematical problem so that we know you are a human."));
$emailForm .= labelinput_("maptcha_text", $maptcha, "", "id_p_captcha", "id_captcha") . "<br>";
$emailForm .= note_(_("Example: 2 * 2 = 4 or 0 - 9 = -9"));
$emailForm .= p_(input_("submit_contact_form", _("send"), "submit"), "buttons");
if (!empty($webspace['webspace_html'])) {
    $bodyText = theme_article_wrapper($webspace['webspace_html']);
} else {
    $freetext = _("OpenID for {1}.");
    $freetext = str_replace("{1}", htmlspecialchars(WEBSPACE_OPENID), $freetext);
    $bodyText = theme_article_wrapper($freetext);
}
echo theme_profile_body($emailForm, $bodyText);
echo theme_profile_sidebar("/get_file.php?avatar=" . (int) $webspace['user_id'] . "&amp;width=200", htmlspecialchars($webspace['user_name']), htmlspecialchars($webspace['user_location']));