Commit 73ff627d authored by Dries's avatar Dries

- Small updates: see mailing-list for details.
parent 896b4dc7
......@@ -506,7 +506,7 @@ function import_page_last() {
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
while ($item = db_fetch_object($result)) {
$links[] = "<a href=\"submit.php?mod=blog&type=import&id=$item->iid\">". t("blog") ."</a>";
$links[] = "<a href=\"submit.php?mod=blog&type=import&id=$item->iid\">". t("blog it") ."</a>";
$links[] = "<a href=\"module.php?mod=import&op=feed&id=$item->fid\">". t("feed") ."</a>";
if ($item->link) {
......@@ -539,7 +539,7 @@ function import_page_feed($fid) {
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
while ($item = db_fetch_object($result)) {
$links[] = "<a href=\"submit.php?mod=blog&type=import&id=$item->iid\">". t("blog") ."</a>";
$links[] = "<a href=\"submit.php?mod=blog&type=import&id=$item->iid\">". t("blog it") ."</a>";
$links[] = "<a href=\"$item->link\">". t("visit") ."</a>";
if ($item->link) {
......@@ -573,7 +573,7 @@ function import_page_bundle($bid) {
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
while ($item = db_fetch_object($result)) {
$links[] = "<a href=\"submit.php?mod=blog&type=import&id=$item->iid\">". t("blog") ."</a>";
$links[] = "<a href=\"submit.php?mod=blog&type=import&id=$item->iid\">". t("blog it") ."</a>";
$links[] = "<a href=\"module.php?mod=import&op=feed&id=$item->fid\">". t("feed") ."</a>";
$links[] = "<a href=\"$item->link\">". t("visit") ."</a>";
......
......@@ -506,7 +506,7 @@ function import_page_last() {
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
while ($item = db_fetch_object($result)) {
$links[] = "<a href=\"submit.php?mod=blog&type=import&id=$item->iid\">". t("blog") ."</a>";
$links[] = "<a href=\"submit.php?mod=blog&type=import&id=$item->iid\">". t("blog it") ."</a>";
$links[] = "<a href=\"module.php?mod=import&op=feed&id=$item->fid\">". t("feed") ."</a>";
if ($item->link) {
......@@ -539,7 +539,7 @@ function import_page_feed($fid) {
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
while ($item = db_fetch_object($result)) {
$links[] = "<a href=\"submit.php?mod=blog&type=import&id=$item->iid\">". t("blog") ."</a>";
$links[] = "<a href=\"submit.php?mod=blog&type=import&id=$item->iid\">". t("blog it") ."</a>";
$links[] = "<a href=\"$item->link\">". t("visit") ."</a>";
if ($item->link) {
......@@ -573,7 +573,7 @@ function import_page_bundle($bid) {
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
while ($item = db_fetch_object($result)) {
$links[] = "<a href=\"submit.php?mod=blog&type=import&id=$item->iid\">". t("blog") ."</a>";
$links[] = "<a href=\"submit.php?mod=blog&type=import&id=$item->iid\">". t("blog it") ."</a>";
$links[] = "<a href=\"module.php?mod=import&op=feed&id=$item->fid\">". t("feed") ."</a>";
$links[] = "<a href=\"$item->link\">". t("visit") ."</a>";
......
......@@ -71,12 +71,14 @@ 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.title, n.comment, 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' AND n.timestamp > '". ($date - 2592000) ."' ORDER BY b.lid DESC LIMIT 20");
$result = db_query("SELECT n.nid, n.title, n.comment, COUNT(c.cid) AS comments, 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 LEFT JOIN comments c ON n.nid = c.lid WHERE u.userid = '$name' AND n.timestamp < '$date' AND n.timestamp > '". ($date - 2592000) ."' GROUP BY n.nid ORDER BY n.nid DESC LIMIT 20");
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\">";
while ($blog = db_fetch_object($result)) {
$links = array();
if ($date != date("dny", $blog->timestamp)) {
$date = date("dny", $blog->timestamp);
$output .= "<tr><td colspan=\"2\"><b><a href=\"module.php?mod=blog&name=$name&date=". mktime(23, 59, 59, date("n", $blog->timestamp), date("d", $blog->timestamp), date("Y", $blog->timestamp)) ."\">". format_date($blog->timestamp, custom, "d M Y") .":</a></b></td></tr>";
......@@ -87,18 +89,16 @@ function blog_page_user($name = 0, $date = 0) {
}
if ($user->id && user_access("post blogs")) {
$links[] = "<a href=\"submit.php?mod=blog&type=blog&id=$blog->nid\">". t("blog") ."</a>";
$links[] = "<a href=\"submit.php?mod=blog&type=blog&id=$blog->nid\">". t("blog it") ."</a>";
}
if ($blog->comment) {
$links[] = "<a href=\"node.php?id=$blog->nid\">". t("discuss") ."</a>";
$links[] = "<a href=\"node.php?id=$blog->nid\">". format_plural($blog->comments, t("comment"), t("comments")) ."</a>";
}
$output .= "<tr><td><div style=\"margin-left: 20px;\"><b>". check_output($blog->title) ."</b></div></td><td align=\"right\">". $theme->links($links) ."</td></tr>";
$output .= "<tr><td colspan=\"2\"><div style=\"margin-left: 40px;\">". check_output($blog->body, 1) ."</div><br /></td></tr>";
unset($links);
}
$output .= "</table>";
......@@ -110,12 +110,14 @@ function blog_page_user($name = 0, $date = 0) {
function blog_page_last() {
global $theme, $user;
$result = db_query("SELECT n.author, n.nid, n.title, n.comment, 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");
$result = db_query("SELECT n.author, n.nid, n.title, n.comment, COUNT(c.cid) AS comments, 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 LEFT JOIN comments c ON n.nid = c.lid GROUP BY n.nid ORDER BY n.nid DESC LIMIT 20");
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\">";
while ($blog = db_fetch_object($result)) {
$links = array();
$links[] = "<a href=\"module.php?mod=blog&op=view&name=". urlencode($blog->userid) ."\">". strtr(t("%a's blog"), array("%a" => $blog->userid)) ."</a>";
if ($blog->author == $user->id) {
......@@ -123,17 +125,16 @@ function blog_page_last() {
}
if ($user->id && user_access("post blogs")) {
$links[] = "<a href=\"submit.php?mod=blog&type=blog&id=$blog->nid\">". t("blog") ."</a>";
$links[] = "<a href=\"submit.php?mod=blog&type=blog&id=$blog->nid\">". t("blog it") ."</a>";
}
if ($blog->comment) {
$links[] = "<a href=\"node.php?id=$blog->nid\">". t("discuss") ."</a>";
$links[] = "<a href=\"node.php?id=$blog->nid\">". format_plural($blog->comments, t("comment"), t("comments")) ."</a>";
}
$output .= "<tr><td><b>". check_output($blog->title) ."</b></td><td align=\"right\">". $theme->links($links) ."</td></tr>";
$output .= "<tr><td colspan=\"2\"><div style=\"margin-left: 20px;\">". check_output($blog->body, 1) ."</div><br /></td></tr>";
unset($links);
}
$output .= "</table>";
......
......@@ -71,12 +71,14 @@ 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.title, n.comment, 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' AND n.timestamp > '". ($date - 2592000) ."' ORDER BY b.lid DESC LIMIT 20");
$result = db_query("SELECT n.nid, n.title, n.comment, COUNT(c.cid) AS comments, 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 LEFT JOIN comments c ON n.nid = c.lid WHERE u.userid = '$name' AND n.timestamp < '$date' AND n.timestamp > '". ($date - 2592000) ."' GROUP BY n.nid ORDER BY n.nid DESC LIMIT 20");
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\">";
while ($blog = db_fetch_object($result)) {
$links = array();
if ($date != date("dny", $blog->timestamp)) {
$date = date("dny", $blog->timestamp);
$output .= "<tr><td colspan=\"2\"><b><a href=\"module.php?mod=blog&name=$name&date=". mktime(23, 59, 59, date("n", $blog->timestamp), date("d", $blog->timestamp), date("Y", $blog->timestamp)) ."\">". format_date($blog->timestamp, custom, "d M Y") .":</a></b></td></tr>";
......@@ -87,18 +89,16 @@ function blog_page_user($name = 0, $date = 0) {
}
if ($user->id && user_access("post blogs")) {
$links[] = "<a href=\"submit.php?mod=blog&type=blog&id=$blog->nid\">". t("blog") ."</a>";
$links[] = "<a href=\"submit.php?mod=blog&type=blog&id=$blog->nid\">". t("blog it") ."</a>";
}
if ($blog->comment) {
$links[] = "<a href=\"node.php?id=$blog->nid\">". t("discuss") ."</a>";
$links[] = "<a href=\"node.php?id=$blog->nid\">". format_plural($blog->comments, t("comment"), t("comments")) ."</a>";
}
$output .= "<tr><td><div style=\"margin-left: 20px;\"><b>". check_output($blog->title) ."</b></div></td><td align=\"right\">". $theme->links($links) ."</td></tr>";
$output .= "<tr><td colspan=\"2\"><div style=\"margin-left: 40px;\">". check_output($blog->body, 1) ."</div><br /></td></tr>";
unset($links);
}
$output .= "</table>";
......@@ -110,12 +110,14 @@ function blog_page_user($name = 0, $date = 0) {
function blog_page_last() {
global $theme, $user;
$result = db_query("SELECT n.author, n.nid, n.title, n.comment, 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");
$result = db_query("SELECT n.author, n.nid, n.title, n.comment, COUNT(c.cid) AS comments, 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 LEFT JOIN comments c ON n.nid = c.lid GROUP BY n.nid ORDER BY n.nid DESC LIMIT 20");
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\">";
while ($blog = db_fetch_object($result)) {
$links = array();
$links[] = "<a href=\"module.php?mod=blog&op=view&name=". urlencode($blog->userid) ."\">". strtr(t("%a's blog"), array("%a" => $blog->userid)) ."</a>";
if ($blog->author == $user->id) {
......@@ -123,17 +125,16 @@ function blog_page_last() {
}
if ($user->id && user_access("post blogs")) {
$links[] = "<a href=\"submit.php?mod=blog&type=blog&id=$blog->nid\">". t("blog") ."</a>";
$links[] = "<a href=\"submit.php?mod=blog&type=blog&id=$blog->nid\">". t("blog it") ."</a>";
}
if ($blog->comment) {
$links[] = "<a href=\"node.php?id=$blog->nid\">". t("discuss") ."</a>";
$links[] = "<a href=\"node.php?id=$blog->nid\">". format_plural($blog->comments, t("comment"), t("comments")) ."</a>";
}
$output .= "<tr><td><b>". check_output($blog->title) ."</b></td><td align=\"right\">". $theme->links($links) ."</td></tr>";
$output .= "<tr><td colspan=\"2\"><div style=\"margin-left: 20px;\">". check_output($blog->body, 1) ."</div><br /></td></tr>";
unset($links);
}
$output .= "</table>";
......
......@@ -506,7 +506,7 @@ function import_page_last() {
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
while ($item = db_fetch_object($result)) {
$links[] = "<a href=\"submit.php?mod=blog&type=import&id=$item->iid\">". t("blog") ."</a>";
$links[] = "<a href=\"submit.php?mod=blog&type=import&id=$item->iid\">". t("blog it") ."</a>";
$links[] = "<a href=\"module.php?mod=import&op=feed&id=$item->fid\">". t("feed") ."</a>";
if ($item->link) {
......@@ -539,7 +539,7 @@ function import_page_feed($fid) {
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
while ($item = db_fetch_object($result)) {
$links[] = "<a href=\"submit.php?mod=blog&type=import&id=$item->iid\">". t("blog") ."</a>";
$links[] = "<a href=\"submit.php?mod=blog&type=import&id=$item->iid\">". t("blog it") ."</a>";
$links[] = "<a href=\"$item->link\">". t("visit") ."</a>";
if ($item->link) {
......@@ -573,7 +573,7 @@ function import_page_bundle($bid) {
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
while ($item = db_fetch_object($result)) {
$links[] = "<a href=\"submit.php?mod=blog&type=import&id=$item->iid\">". t("blog") ."</a>";
$links[] = "<a href=\"submit.php?mod=blog&type=import&id=$item->iid\">". t("blog it") ."</a>";
$links[] = "<a href=\"module.php?mod=import&op=feed&id=$item->fid\">". t("feed") ."</a>";
$links[] = "<a href=\"$item->link\">". t("visit") ."</a>";
......
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