Location: PHPKode > scripts > Noostr > style/default/user.php
<?php defined('SYSPATH') OR die('No direct access to this file is allowed.');
show_header();

show_content();
//print_r($ns);
$uri = explode('-', $ns->template['page']);
$owned = false;
$user = get_user();
if ($user == null) {
	echo '<p>That user does not exist.</p>';
} else {
	if (isset($uri[1]) && $uri[1] == $ns->user['uid'] && $ns->site['allowprofile']) {
		// Is the current owner viewing his own user page?
		$owned = true;
	}
	if ($owned) {
		$avg = 0;
		if ($ns->user['submissions'] != 0) {
			$avg = sprintf("%01.2f", $ns->user['karma'] / $ns->user['submissions']);
		}
?>
<!-- User Update Form -->
<form name="userform" id="userform" action="/<?php echo $ns->template['page']; ?>" method="post">
<?php	} ?>
	<dl>
		<dt>User:</dt>
		<dd><?php echo $user['nick']; ?></dd>
		<dt>Created:</dt>
		<dd><?php echo $user['created']; ?></dd>
		<dt>Karma:</dt>
		<dd><?php echo $user['karma']; ?></dd>
<?php	if ($owned) { ?>
		<dt>Average:</dt>
		<dd><?php echo $avg; ?></dd>
		<fieldset>
			<legend>General Information</legend>
			<dt><label for="firstName">First:</label></dt>
			<dd><input name="firstName" id="firstName" type="text" value="<?php echo $ns->user['firstName']; ?>" /></dd>
			<dt><label for="lastName">Last:</label></dt>
			<dd><input name="lastName" id="lastName" type="text" value="<?php echo $ns->user['lastName']; ?>" /></dd>
			<dt><label for="about">About:</label></dt>
			<dd><textarea name="about" id="about"><?php echo $ns->user['about']; ?></textarea></dd>
			<dt><label for="email">Email:</label></dt>
			<dd><input name="email" id="email" type="text" value="<?php echo $ns->user['email']; ?>" /></dd>
		</fieldset>
		<fieldset>
			<legend>New Password</legend>
			<dt><label for="password1">New:</label></dt>
			<dd><input name="password1" id="password1" type="password" /></dd>
			<dt><label for="password2">Again:</label></dt>
			<dd><input name="password2" id="password2" type="password" /></dd>
		</fieldset>
<!--		<dt>&nbsp;</dt>
		<dd><a href="#">Saved Articles</a></dd>-->
<?php	} ?>
<!--		<dt>&nbsp;</dt>
		<dd><a href="#">Submissions</a></dd>
		<dt>&nbsp;</dt>
		<dd><a href="#">Comments</a></dd>-->
	</dl>
<?php
	if ($owned) {
?>
	<input name="type" id="type" type="hidden" value="user" />
	<input name="action" id="action" type="hidden" value="edit" />
	<input name="node" id="node" type="hidden" value="<?php echo $ns->user['uid']; ?>" />
	<input name="next" id="next" type="hidden" value="<?php echo $ns->template['page']; ?>" />
	<input type="submit" name="submit" value="Update!">
</form>
<!-- // User Update Form -->
<?php
	}
}

show_footer();
Return current item: Noostr