diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-01-03 21:23:58 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-01-03 21:23:58 +0000 |
commit | 4572760eb3bd2a9454660bf187d17c7258e04bfd (patch) | |
tree | 6c73bb27ddb2c8afb5cf4dfd5ab8038ab75356da /modules/diary.module | |
parent | c85a0ee005d67a3104954ad7b637b7d22f9109b4 (diff) | |
download | brdo-4572760eb3bd2a9454660bf187d17c7258e04bfd.tar.gz brdo-4572760eb3bd2a9454660bf187d17c7258e04bfd.tar.bz2 |
A batch of preparations for release candidate 2:
- expanded documentation
(written by Jeroen)
- fixed bug in includes/module.inc
- fixed bug in modules/backend.class
- renamed some of the SQL tables (!)
- started making the diary.module truly modular (not finished yet)
- renamed "admin_blocks" to "boxes"
- added new functionality to "boxes": apart from PHP boxes, you
can now create ASCII boxes as well as HTML boxes for those who
are not confident with PHP.
(requested by stalor)
- added drupal-site module to keep track of known drupal sites
- added small Perl script to generate encrypted CVS passwords
Diffstat (limited to 'modules/diary.module')
-rw-r--r-- | modules/diary.module | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/diary.module b/modules/diary.module index 63ebb8583..6a9f902e5 100644 --- a/modules/diary.module +++ b/modules/diary.module @@ -3,6 +3,7 @@ $module = array("page" => "diary_page", "block" => "diary_block", "help" => "diary_help", + "user" => "diary_user", "admin" => "diary_admin", "export" => "diary_export"); @@ -199,6 +200,21 @@ function diary_help() { <? } +function diary_user($username, $section, $operation) { + if ($section == "user" && $operation == "view") { + $result = db_query("SELECT d.* FROM diaries d LEFT JOIN users u ON u.id = d.author WHERE u.userid = '$username' AND d.timestamp > ". (time() - 1209600) ." ORDER BY id DESC LIMIT 2"); + while ($diary = db_fetch_object($result)) { + $content .= "<DL><DT><B>". date("l, F jS", $diary->timestamp) .":</B></DT><DD><P>". check_output($diary->text) ."</P><P>[ <A HREF=\"module.php?mod=diary&op=view&name=$username\">more</A> ]</P></DD></DL>\n"; + $diaries++; + } + + $block["subject"] = "$username has posted ". format_plural($diaries, "diary entry", "diary entries") ." recently"; + $block["content"] = $content; + + return $block; + } +} + function diary_block() { $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 20"); |