picture tinyint(1) default NULL,
url varchar(255) default NULL,
description text,
+ mailformat tinyint(1) unsigned NOT NULL default '1',
timemodified int(10) unsigned NOT NULL default '0',
PRIMARY KEY (id),
UNIQUE KEY username (username),
$javascript = "onChange=\"$script\"";
}
echo "<SELECT NAME=$name $javascript>\n";
- echo " <OPTION VALUE=\"$nothingvalue\"\n";
- if ($nothingvalue == $selected) {
- echo " SELECTED";
+ if ($nothing) {
+ echo " <OPTION VALUE=\"$nothingvalue\"\n";
+ if ($nothingvalue == $selected) {
+ echo " SELECTED";
+ }
+ echo ">$nothing</OPTION>\n";
}
- echo ">$nothing</OPTION>\n";
foreach ($options as $value => $label) {
echo " <OPTION VALUE=\"$value\"";
if ($value == $selected) {
-<P ALIGN=center>Items marked <B>private</B> will not be made visible to other students</P>
-
<FORM METHOD="post" ENCTYPE="multipart/form-data" action="edit.php">
<table cellpadding=9 cellspacing=0 >
<tr valign=top>
<td><P>New picture:</td>
<td>
<INPUT type="hidden" name="MAX_FILE_SIZE" value="4000000">
- <input type="file" name="imagefile"> ( .jpg or .png ) <? helpbutton("picture") ?>
+ <input type="file" name="imagefile" size=40> ( .jpg or .png ) <? helpbutton("picture") ?>
<? formerr($err["imagefile"]) ?>
</td>
</tr>
<tr valign=top>
- <td><P>Email:</td>
- <td><input type="text" name="email" size=25 value="<?=$user->email ?>">
+ <td><P>Description:</td>
+ <td><TEXTAREA NAME=description COLS=50 ROWS=10 WRAP=virtual><?=$user->description ?></TEXTAREA>
+ <? helpbutton("text") ?>
+ </td>
+</tr>
+<tr valign=top>
+ <td><P>Email address:</td>
+ <td><input type="text" name="email" size=30 value="<?=$user->email ?>">
<? formerr($err["email"]) ?>
</td>
</tr>
<tr valign=top>
- <td><P>ICQ Number:</td>
+ <td><P>Email format:</td>
+ <td><?
+ $choices["0"] = "Plain text format";
+ $choices["1"] = "Pretty HTML format";
+ choose_from_menu ($choices, "mailformat", $user->mailformat, "") ?>
+ </td>
+</tr>
+<tr valign=top>
+ <td><P>Web address (URL):</td>
+ <td><input type="text" name="url" size=30 value="<?=$user->url ?>">
+ <? formerr($err["url"]) ?>
+ </td>
+</tr>
+<tr valign=top>
+ <td><P>ICQ number:</td>
<td><input type="text" name="icq" size=25 value="<?=$user->icq ?>">
<? formerr($err["icq"]) ?>
</td>
</tr>
<tr valign=top>
- <td><P>Phone Number 1:</td>
- <td><input type="text" name="phone1" size=25 value="<?=$user->phone1 ?>"> (private)
+ <td><P>ID Number:</td>
+ <td><input type="text" name="idnumber" size=25 value="<?=$user->idnumber ?>"> (for the <?=$teacher ?> only)
+ <? formerr($err["idnumber"]) ?>
+ </td>
+</tr>
+<tr valign=top>
+ <td><P>Phone number 1:</td>
+ <td><input type="text" name="phone1" size=25 value="<?=$user->phone1 ?>"> (for the <?=$teacher ?> only)
<? formerr($err["phone1"]) ?>
</td>
</tr>
<tr valign=top>
- <td><P>Phone Number 2:</td>
- <td><input type="text" name="phone2" size=25 value="<?=$user->phone2 ?>"> (private)
+ <td><P>Phone number 2:</td>
+ <td><input type="text" name="phone2" size=25 value="<?=$user->phone2 ?>"> (for the <?=$teacher ?> only)
<? formerr($err["phone2"]) ?>
</td>
</tr>
<tr valign=top>
- <td><P>Address:</td>
- <td><input type="text" name="address" size=25 value="<?=$user->address ?>"> (private)
+ <td><P>Street Address:</td>
+ <td><input type="text" name="address" size=25 value="<?=$user->address ?>"> (for the <?=$teacher ?> only)
<? formerr($err["address"]) ?>
</td>
</tr>
<tr valign=top>
- <td><P>Web Address:</td>
- <td><input type="text" name="url" size=25 value="<?=$user->url ?>">
- <? formerr($err["url"]) ?>
+ <td><P>City/town:</td>
+ <td><input type="text" name="city" size=25 value="<?=$user->city ?>">
+ <? formerr($err["city"]) ?>
</td>
</tr>
<tr valign=top>
- <td><P>Description:</td>
- <td><TEXTAREA NAME=description COLS=50 ROWS=10 WRAP=virtual><?=$user->description ?></TEXTAREA>
+ <td><P>Country:</td>
+ <td><? choose_from_menu ($COUNTRIES, "country", $user->country, "Select a country...", "", "") ?>
+ <? formerr($err["country"]) ?>
</td>
</tr>
<tr valign=top>
<?PHP // $Id$
require("../config.php");
+ require("../lib/countries.php");
require("lib.php");
require_variable($id); // user id
-> Edit profile", "");
}
+ $teacher = strtolower($course->teacher);
+
print_simple_box_start("center", "", "$THEME->cellheading");
echo "<H2>User profile for $user->firstname $user->lastname</H2>";
include("edit.html");
if (empty($usernew->email))
$err["email"] = "Missing email address";
+ if (empty($usernew->city))
+ $err["city"] = "Missing city or town";
+
+ if (empty($usernew->country))
+ $err["country"] = "Missing country";
+
else if (! validate_email($usernew->email))
$err["email"] = "Invalid email address, check carefully";
// Lists all the users within a given course
require("../config.php");
+ require("../lib/countries.php");
require("lib.php");
require_variable($id); //course
/// FUNCTIONS //////////////////
function print_user($user, $course, $teacherlinks) {
+
+ global $COUNTRIES;
echo "<TABLE WIDTH=80% ALIGN=CENTER BORDER=0 CELLPADDING=1 CELLSPACING=1><TR><TD BGCOLOR=#888888>";
echo "<TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR>";
echo "<FONT SIZE=-1>";
echo "<FONT SIZE=3><B>$user->firstname $user->lastname</B></FONT>";
echo "<P>Email: <A HREF=\"mailto:$user->email\">$user->email</A><BR>";
- echo "Location: $user->city, $user->country<BR>";
+ echo "Location: $user->city, ".$COUNTRIES["$user->country"]."<BR>";
echo "Last access: ".userdate($user->lastaccess);
echo "  (".format_time(time() - $user->lastaccess).")";
echo "</TD><TD VALIGN=bottom BGCOLOR=#FFFFFF NOWRAP>";
// Display profile for a particular user
require("../config.php");
+ require("../lib/countries.php");
require("lib.php");
require_variable($id);
echo "<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=2";
- print_row("Location:", "$user->city, $user->country");
+ print_row("Location:", "$user->city, ".$COUNTRIES["$user->country"]);
if (isteacher($course->id)) {
if ($user->address) {