- fixed bug in diary module

3-00
Dries Buytaert 2001-04-03 15:43:54 +00:00
parent 15a6bef484
commit 97dd9e1cb4
2 changed files with 1 additions and 16 deletions

View File

@ -21,6 +21,7 @@ drupal x.xx, xx/xx/xxxx
+ made it possible to permanently delete stories
* improved themes:
+ W3C validation on a best effort basis
+ removed $theme->control() from themes
+ added theme "goofy"
- revised documentation

View File

@ -4,7 +4,6 @@ $module = array("find" => "diary_find",
"help" => "diary_help",
"menu" => "diary_menu",
"page" => "diary_page",
"account" => "diary_account",
"admin" => "diary_admin",
"block" => "diary_block",
"export" => "diary_export");
@ -220,21 +219,6 @@ function diary_help() {
<?php
}
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>". format_date($diary->timestamp, "large") .":</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"] = strtr(t("%a has posted %b recently"), array("%a" => $username, "%b" => format_plural($diaries, "diary entry", "diary entries")));
$block["content"] = $content;
return $block;
}
}
function diary_menu() {
return array("<A HREF=\"module.php?mod=diary&op=add\">". t("edit your diary") ."</A>", "<A HREF=\"module.php?mod=diary&op=view\">". t("view your diary") ."</A>");
}