summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2000-09-15 08:39:46 +0000
committerDries Buytaert <dries@buytaert.net>2000-09-15 08:39:46 +0000
commit525ae78d8682f12769a33305ae51761581749b5d (patch)
tree183878c1476f17bd22ae08e4a6f87d312a1f2453
parent35df71f3640f0b7e65afa8738517a92f5b35944f (diff)
downloadbrdo-525ae78d8682f12769a33305ae51761581749b5d.tar.gz
brdo-525ae78d8682f12769a33305ae51761581749b5d.tar.bz2
* Small changes to the layout of the diary and theme 'Dries'.
-rw-r--r--diary.php29
-rw-r--r--template.inc12
2 files changed, 37 insertions, 4 deletions
diff --git a/diary.php b/diary.php
index e11826a95..a17356143 100644
--- a/diary.php
+++ b/diary.php
@@ -3,6 +3,32 @@ include "function.inc";
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 @@ switch($op) {
else diary_submit($text);
break;
default:
- diary_display($user->userid);
+ diary_overview();
}
?> \ No newline at end of file
diff --git a/template.inc b/template.inc
index d4148b84c..75197fda9 100644
--- a/template.inc
+++ b/template.inc
@@ -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 displayAccount($theme) {
$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");