Commit 3ebd8b90 authored by Dries's avatar Dries
Browse files

Some ienie-wienie-tiny layout changes I made last night (in presence of Jeroen).

parent 99dce2a3
...@@ -34,13 +34,12 @@ function showUser($uname) { ...@@ -34,13 +34,12 @@ function showUser($uname) {
if ($user && $uname && $user->userid == $uname) { if ($user && $uname && $user->userid == $uname) {
$output .= "<P>Welcome $user->userid! This is <B>your</B> user info page. There are many more, but this one is yours. You are probably most interested in editing something, but if you need to kill some time, this place is as good as any other place.</P>\n"; $output .= "<P>Welcome $user->userid! This is <B>your</B> user info page. There are many more, but this one is yours. You are probably most interested in editing something, but if you need to kill some time, this place is as good as any other place.</P>\n";
$output .= "<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=2>\n"; $output .= "<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=2>\n";
$output .= " <TR><TD><B>User ID:</B></TD><TD>$user->userid</TD></TR>\n"; $output .= " <TR><TD ALIGN=\"right\"><B>User ID:</B></TD><TD>$user->userid</TD></TR>\n";
$output .= " <TR><TD><B>Name:</B></TD><TD>$user->name</TD></TR>\n"; $output .= " <TR><TD ALIGN=\"right\"><B>Name:</B></TD><TD>". format_data($user->name) ."</TD></TR>\n";
$output .= " <TR><TD><B>E-mail:</B></TD><TD><A HREF=\"mailto:$user->femail\">$user->femail</A></TD></TR>\n"; $output .= " <TR><TD ALIGN=\"right\"><B>E-mail:</B></TD><TD>". format_email_address($user->femail) ."</A></TD></TR>\n";
$output .= " <TR><TD><B>URL:</B></TD><TD><A HREF=\"$user->url\" TARGET=\"_new\">$user->url</A></TD></TR>\n"; $output .= " <TR><TD ALIGN=\"right\"><B>URL:</B></TD><TD>". format_url($user->url) ."</TD></TR>\n";
if ($user->access > 0) $output .= "<TR><TD VALIGN=top><B>Access:</B></TD><TD>". showAccess() ."</TD></TR>\n"; $output .= " <TR><TD ALIGN=\"right\" VALIGN=\"top\"><B>Bio:</B></TD><TD>". format_data($user->bio) ."</TD></TR>\n";
$output .= " <TR><TD><B>Bio:</B></TD><TD>$user->bio</TD></TR>\n"; $output .= " <TR><TD ALIGN=\"right\" VALIGN=\"top\"><B>Signature:</B></TD><TD>". format_data($user->signature) ."</TD></TR>\n";
$output .= " <TR><TD><B>Signature:</B></TD><TD>$user->signature</TD></TR>\n";
$output .= "</TABLE>\n"; $output .= "</TABLE>\n";
### Display account information: ### Display account information:
...@@ -51,9 +50,9 @@ function showUser($uname) { ...@@ -51,9 +50,9 @@ function showUser($uname) {
elseif ($uname && $account = account_getUser($uname)) { elseif ($uname && $account = account_getUser($uname)) {
$box1 .= "<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=2>\n"; $box1 .= "<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=2>\n";
$box1 .= " <TR><TD ALIGN=\"right\"><B>Username:</B></TD><TD>$account->userid</TD></TR>\n"; $box1 .= " <TR><TD ALIGN=\"right\"><B>Username:</B></TD><TD>$account->userid</TD></TR>\n";
$box1 .= " <TR><TD ALIGN=\"right\"><B>E-mail:</B></TD><TD><A HREF=\"mailto:$account->femail\">$account->femail</A></TD></TR>\n"; $box1 .= " <TR><TD ALIGN=\"right\"><B>E-mail:</B></TD><TD>". format_email_address($account->femail) ."</TD></TR>\n";
$box1 .= " <TR><TD ALIGN=\"right\"><B>URL:</B></TD><TD><A HREF=\"$account->url\">$account->url</A></TD></TR>\n"; $box1 .= " <TR><TD ALIGN=\"right\"><B>URL:</B></TD><TD>". format_url($account->url) ."</TD></TR>\n";
$box1 .= " <TR><TD ALIGN=\"right\"><B>Bio:</B></TD><TD>$account->bio</TD></TR>\n"; $box1 .= " <TR><TD ALIGN=\"right\"><B>Bio:</B></TD><TD>". format_data($account->bio) ."</TD></TR>\n";
$box1 .= "</TABLE>\n"; $box1 .= "</TABLE>\n";
$result = db_query("SELECT c.cid, c.pid, c.sid, c.subject, c.timestamp, s.subject AS story FROM comments c LEFT JOIN users u ON u.id = c.author LEFT JOIN stories s ON s.id = c.sid WHERE u.userid = '$uname' AND c.timestamp > ". (time() - 1209600) ." ORDER BY cid DESC LIMIT 10"); $result = db_query("SELECT c.cid, c.pid, c.sid, c.subject, c.timestamp, s.subject AS story FROM comments c LEFT JOIN users u ON u.id = c.author LEFT JOIN stories s ON s.id = c.sid WHERE u.userid = '$uname' AND c.timestamp > ". (time() - 1209600) ." ORDER BY cid DESC LIMIT 10");
......
...@@ -59,7 +59,7 @@ function account_display($order = "username") { ...@@ -59,7 +59,7 @@ function account_display($order = "username") {
$output .= " <TD>". format_username($account[$value], 1) ."</TD>\n"; $output .= " <TD>". format_username($account[$value], 1) ."</TD>\n";
break; break;
default: default:
$output .= " <TD>". format_availability($account[$value]) ."</TD>\n"; $output .= " <TD>". format_data($account[$value]) ."</TD>\n";
} }
} }
$output .= " <TD ALIGN=\"center\"><A HREF=\"admin.php?section=accounts&op=view&name=$account[userid]\">view</A></TD>\n"; $output .= " <TD ALIGN=\"center\"><A HREF=\"admin.php?section=accounts&op=view&name=$account[userid]\">view</A></TD>\n";
...@@ -95,16 +95,16 @@ function account_view($name) { ...@@ -95,16 +95,16 @@ function account_view($name) {
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"3\" CELLSPACING=\"0\">\n"; $output .= "<TABLE BORDER=\"1\" CELLPADDING=\"3\" CELLSPACING=\"0\">\n";
$output .= " <TR><TD ALIGN=\"right\"><B>ID:</B></TD><TD>$account->id</TD></TR>\n"; $output .= " <TR><TD ALIGN=\"right\"><B>ID:</B></TD><TD>$account->id</TD></TR>\n";
$output .= " <TR><TD ALIGN=\"right\"><B>Username:</B></TD><TD>$account->userid</TD></TR>\n"; $output .= " <TR><TD ALIGN=\"right\"><B>Username:</B></TD><TD>$account->userid</TD></TR>\n";
$output .= " <TR><TD ALIGN=\"right\"><B>Real name:</B></TD><TD>". format_availability($account->name) ."</TD></TR>\n"; $output .= " <TR><TD ALIGN=\"right\"><B>Real name:</B></TD><TD>". format_data($account->name) ."</TD></TR>\n";
$output .= " <TR><TD ALIGN=\"right\"><B>Real e-mail address:</B></TD><TD>". format_email_address($account->email) ."</TD></TR>\n"; $output .= " <TR><TD ALIGN=\"right\"><B>Real e-mail address:</B></TD><TD>". format_email_address($account->email) ."</TD></TR>\n";
$output .= " <TR><TD ALIGN=\"right\"><B>Fake e-mail address:</B></TD><TD>". format_availability($account->femail) ."</TD></TR>\n"; $output .= " <TR><TD ALIGN=\"right\"><B>Fake e-mail address:</B></TD><TD>". format_data($account->femail) ."</TD></TR>\n";
$output .= " <TR><TD ALIGN=\"right\"><B>URL of homepage:</B></TD><TD>". format_url($account->url) ."</TD></TR>\n"; $output .= " <TR><TD ALIGN=\"right\"><B>URL of homepage:</B></TD><TD>". format_url($account->url) ."</TD></TR>\n";
$output .= " <TR><TD ALIGN=\"right\"><B>Last access:</B></TD><TD>". format_date($account->last_access) ." from $account->last_host</TD></TR>\n"; $output .= " <TR><TD ALIGN=\"right\"><B>Last access:</B></TD><TD>". format_date($account->last_access) ." from $account->last_host</TD></TR>\n";
$output .= " <TR><TD ALIGN=\"right\"><B>Bio information:</B></TD><TD>". format_availability($account->bio) ."</TD></TR>\n"; $output .= " <TR><TD ALIGN=\"right\"><B>Bio information:</B></TD><TD>". format_data($account->bio) ."</TD></TR>\n";
$output .= " <TR><TD ALIGN=\"right\"><B>Signature:</B></TD><TD>". format_availability($account->signature) ."</TD></TR>\n"; $output .= " <TR><TD ALIGN=\"right\"><B>Signature:</B></TD><TD>". format_data($account->signature) ."</TD></TR>\n";
$output .= " <TR><TD ALIGN=\"right\"><B>Theme:</B></TD><TD>". format_availability($account->theme) ."</TD></TR>\n"; $output .= " <TR><TD ALIGN=\"right\"><B>Theme:</B></TD><TD>". format_data($account->theme) ."</TD></TR>\n";
$output .= " <TR><TD ALIGN=\"right\" VALIGN=\"top\"><B>Submitted stories:</B></TD><TD>". format_availability(account_stories($account->id)) ."</TD></TR>\n"; $output .= " <TR><TD ALIGN=\"right\" VALIGN=\"top\"><B>Submitted stories:</B></TD><TD>". format_data(account_stories($account->id)) ."</TD></TR>\n";
$output .= " <TR><TD ALIGN=\"right\" VALIGN=\"top\"><B>Submitted comments:</B></TD><TD>". format_availability(account_comments($account->id)) ."</TD></TR>\n"; $output .= " <TR><TD ALIGN=\"right\" VALIGN=\"top\"><B>Submitted comments:</B></TD><TD>". format_data(account_comments($account->id)) ."</TD></TR>\n";
$output .= "</TABLE>\n"; $output .= "</TABLE>\n";
print "$output"; print "$output";
} }
......
...@@ -63,7 +63,7 @@ function format_date($timestamp, $type = "medium") { ...@@ -63,7 +63,7 @@ function format_date($timestamp, $type = "medium") {
return $date; return $date;
} }
function format_availability($field, $replacement = "<I>n/a</I>") { function format_data($field, $replacement = "<I>n/a</I>") {
return ($field) ? $field : $replacement; return ($field) ? $field : $replacement;
} }
...@@ -73,7 +73,7 @@ function format_username($username, $admin = 0) { ...@@ -73,7 +73,7 @@ function format_username($username, $admin = 0) {
} }
function format_email_address($address) { function format_email_address($address) {
return ($address) ? "<A HREF=\"mailto:$address\">$address</A>" : format_availability($address); return ($address) ? "<A HREF=\"mailto:$address\">$address</A>" : format_data($address);
} }
function format_url($address, $description = "") { function format_url($address, $description = "") {
...@@ -82,7 +82,7 @@ function format_url($address, $description = "") { ...@@ -82,7 +82,7 @@ function format_url($address, $description = "") {
// 2. add a trailing `/' in case it's missing. // 2. add a trailing `/' in case it's missing.
// 3. remove any parameters in the URI. // 3. remove any parameters in the URI.
$description = ($description) ? $description : $address; $description = ($description) ? $description : $address;
return ($address) ? "<A HREF=\"$address\">$description</A>" : format_availability($address); return ($address) ? "<A HREF=\"$address\">$description</A>" : format_data($address);
} }
function format_story_link($story, $subject = "") { function format_story_link($story, $subject = "") {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment