Commit 525ae78d authored by Dries's avatar Dries
Browse files

* Small changes to the layout of the diary and theme 'Dries'.

parent 35df71f3
......@@ -3,6 +3,32 @@
include "theme.inc";
function diary_overview($num = 20) {
global $theme, $user;
$result = db_query("SELECT d.*, u.userid FROM diaries d LEFT JOIN users u ON d.author = u.id ORDER BY d.timestamp DESC LIMIT $num");
$output .= "<P>This part of the website is dedicated to providing easy to write and easy to read online diaries or journals filled with daily thoughts, poetry, boneless blather, spiritual theories, intimate details, valuable experiences, cynical rants, semi-coherent comments, writing experiments, artistic babblings, critics on actuality, fresh insights, diverse dreams, chronicles and general madness available for general human consumption.</P>";
while ($diary = db_fetch_object($result)) {
if ($time != date("F jS", $diary->timestamp)) {
$output .= "<B>". date("l, F jS", $diary->timestamp) ."</B>\n";
$time = date("F jS", $diary->timestamp);
}
$output .= "<DL>\n";
$output .= " <DD><P><B>$diary->userid wrote:</B></P></DD>\n";
$output .= " <DL>\n";
$output .= " <DD><P>$diary->text</P><P>[ <A HREF=\"diary.php?op=view&name=$diary->userid\">more</A> ]</P></DD>\n";
$output .= " </DL>\n";
$output .= "</DL>\n";
}
$theme->header();
$theme->box("Online diary", $output);
$theme->footer();
}
function diary_entry($timestamp, $text, $id = 0) {
if ($id) {
$output .= "<DL>\n";
......@@ -29,6 +55,7 @@ function diary_display($username) {
while ($diary = db_fetch_object($result)) $output .= diary_entry($diary->timestamp, $diary->text, $diary->id);
}
else {
$output .= "<P>". format_username($username) ."'s diary:</P>\n";
while ($diary = db_fetch_object($result)) $output .= diary_entry($diary->timestamp, $diary->text);
}
......@@ -148,7 +175,7 @@ function diary_submit($text, $id = 0) {
else diary_submit($text);
break;
default:
diary_display($user->userid);
diary_overview();
}
?>
\ No newline at end of file
......@@ -48,7 +48,7 @@ function displayOldHeadlines($theme, $num = 10) {
while ($story = db_fetch_object($result)) {
if ($time != date("F jS", $story->timestamp)) {
$content .= "<P><B>". date("l, F jS", $story->timestamp) ."</B></P>\n";
$content .= "<P><B>". date("l, M jS", $story->timestamp) ."</B></P>\n";
$time = date("F jS", $story->timestamp);
}
$content .= "<LI>". format_story_link($story) ."</LI>\n";
......@@ -59,10 +59,16 @@ function displayOldHeadlines($theme, $num = 10) {
}
function displayNewDiaries($theme, $num = 20) {
$result = db_query("SELECT u.userid FROM diaries d LEFT JOIN users u ON d.author = u.id GROUP BY u.userid ORDER BY timestamp DESC LIMIT $num");
$result = db_query("SELECT u.userid, d.timestamp FROM diaries d LEFT JOIN users u ON d.author = u.id ORDER BY timestamp DESC LIMIT $num");
while ($diary = db_fetch_object($result)) {
if ($time != date("F jS", $diary->timestamp)) {
$content .= "<P><B>". date("l, M jS", $diary->timestamp) ."</B></P>\n";
$time = date("F jS", $diary->timestamp);
}
$content .= "<LI><A HREF=\"diary.php?op=view&name=$diary->userid\">$diary->userid</A></LI>\n";
}
$content .= "<P ALIGN=\"right\">[ <A HREF=\"diary.php\"><FONT COLOR=\"$theme->hlcolor2\">more</FONT></A> ]</P>";
$theme->box("Recent diary entries", $content);
}
......@@ -132,7 +138,7 @@ function submission_number() {
$content .= "<LI><A HREF=\"account.php?op=page\">customize your page</A></LI>";
$content .= "<LI><A HREF=\"account.php?op=discussion\">track your comments</A></LI>";
$content .= "<LI><A HREF=\"submission.php\">moderate submissions</A> (<FONT COLOR=\"red\">". submission_number() ."</FONT>)</LI>";
$content .= "<LI><A HREF=\"diary.php\">update your diary</A></LI>";
$content .= "<LI><A HREF=\"diary.php?op=view&name=$user->userid\">update your diary</A></LI>";
$content .= "<LI><A HREF=\"account.php?op=logout\">logout</A></LI>";
$theme->box("$user->userid's account", "$content");
......
Markdown is supported
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