summaryrefslogtreecommitdiff
path: root/modules/blog
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-07-14 14:19:45 +0000
committerDries Buytaert <dries@buytaert.net>2001-07-14 14:19:45 +0000
commit501353f297a7dd829ddbb6b9916dd92607653b63 (patch)
tree68f233c843b0a6ddbed9616e1f73321f23cd1bdf /modules/blog
parent18ec47d71b8a0b4e5f6f7bf1e0af2877c2abcc9c (diff)
downloadbrdo-501353f297a7dd829ddbb6b9916dd92607653b63.tar.gz
brdo-501353f297a7dd829ddbb6b9916dd92607653b63.tar.bz2
- blog.module:
+ oops, fix small bug
Diffstat (limited to 'modules/blog')
-rw-r--r--modules/blog/blog.module18
1 files changed, 9 insertions, 9 deletions
diff --git a/modules/blog/blog.module b/modules/blog/blog.module
index b73601973..a568f4aa0 100644
--- a/modules/blog/blog.module
+++ b/modules/blog/blog.module
@@ -67,7 +67,7 @@ function blog_page_user($name = 0, $date = 0) {
$name = check_input($name ? $name : $user->userid);
$date = check_input($date ? $date : time());
- $result = db_query("SELECT n.nid, n.timestamp, b.body FROM blog b LEFT JOIN node n ON b.nid = n.nid LEFT JOIN users u ON n.author = u.id WHERE u.userid = '$name' AND n.timestamp > '". ($date - 2592000) ."' ORDER BY b.lid DESC LIMIT 30");
+ $result = db_query("SELECT n.nid, n.timestamp, b.body FROM blog b LEFT JOIN node n ON b.nid = n.nid LEFT JOIN users u ON n.author = u.id WHERE u.userid = '$name' AND n.timestamp > '". ($date - 2592000) ."' ORDER BY b.lid DESC LIMIT 20");
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\">";
while ($blog = db_fetch_object($result)) {
@@ -86,15 +86,13 @@ function blog_page_user($name = 0, $date = 0) {
$output .= "</table>";
$output .= "<a href=\"module.php?mod=blog&op=feed&name=". urlencode($name) ."\"><img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" /></a>\n";
- $theme->header();
$theme->box(strtr(t("%a's blog"), array("%a" => $name)), $output, "main");
- $theme->footer();
}
-function blog_page_last($num = 20) {
+function blog_page_last() {
global $theme;
- $result = db_query("SELECT n.nid, n.title, n.timestamp, b.body, u.userid FROM blog b LEFT JOIN node n ON b.nid = n.nid LEFT JOIN users u ON n.author = u.id ORDER BY b.lid DESC LIMIT $num");
+ $result = db_query("SELECT n.nid, n.title, n.timestamp, b.body, u.userid FROM blog b LEFT JOIN node n ON b.nid = n.nid LEFT JOIN users u ON n.author = u.id ORDER BY b.lid DESC LIMIT 20");
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\">";
while ($blog = db_fetch_object($result)) {
@@ -109,9 +107,7 @@ function blog_page_last($num = 20) {
$output .= "</table>";
$output .= "<a href=\"module.php?mod=blog&op=feed\"><img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" /></a>\n";
- $theme->header();
$theme->box(t("User blogs"), $output, "main");
- $theme->footer();
}
function blog_remove($nid) {
@@ -210,7 +206,9 @@ function blog_edit_history($nid) {
}
function blog_page() {
- global $op, $name, $date;
+ global $theme, $op, $name, $date;
+
+ $theme->header();
if (user_access("access blogs")) {
switch ($op) {
@@ -232,8 +230,10 @@ function blog_page() {
}
}
else {
- print message_access();
+ $theme->box(t("Access denied"), message_access());
}
+
+ $theme->footer();
}
function blog_user() {