summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-07-26 13:18:49 +0000
committerDries Buytaert <dries@buytaert.net>2003-07-26 13:18:49 +0000
commite278e46f4945d443d4cfb7a58c656fe5afda34f3 (patch)
tree5aa2539e03414622b4bf4a29f43ddb34167b4534
parentcbbc3e80c062caa4d9a74776733c79d1399cab2c (diff)
downloadbrdo-e278e46f4945d443d4cfb7a58c656fe5afda34f3.tar.gz
brdo-e278e46f4945d443d4cfb7a58c656fe5afda34f3.tar.bz2
- Applied Moshe's 007 patch: "read more" and author optimizations.
-rw-r--r--modules/node.module8
-rw-r--r--modules/node/node.module8
2 files changed, 10 insertions, 6 deletions
diff --git a/modules/node.module b/modules/node.module
index 329f6c3f6..f399cda71 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -530,8 +530,10 @@ function node_link($type, $node = 0, $main = 0) {
$links = $node->links;
}
- if ($main == 1 && $node->teaser && $node->teaser != $node->body) {
- $links[] = l(t("read more"), node_url($node), array("title" => t("Read the rest of this posting.")));
+ if ($main == 1 && $node->teaser && strlen($node->teaser) != strlen($node->body))
+ {
+ $links[] = l(t("read more"), "node/view/$node->nid", array("title" => t("Read
+the rest of this posting."), "class" => "read-more"));
}
if (user_access("administer nodes")) {
@@ -980,7 +982,7 @@ function node_validate($node, &$error) {
** Validate the "authored by"-field:
*/
- if (empty($node->name)) {
+ if (empty($node->name) || empty($node->uid)){
/*
** The use of empty() is mandatory in the context of usernames
** as the empty string denotes the anonymous user. In case we
diff --git a/modules/node/node.module b/modules/node/node.module
index 329f6c3f6..f399cda71 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -530,8 +530,10 @@ function node_link($type, $node = 0, $main = 0) {
$links = $node->links;
}
- if ($main == 1 && $node->teaser && $node->teaser != $node->body) {
- $links[] = l(t("read more"), node_url($node), array("title" => t("Read the rest of this posting.")));
+ if ($main == 1 && $node->teaser && strlen($node->teaser) != strlen($node->body))
+ {
+ $links[] = l(t("read more"), "node/view/$node->nid", array("title" => t("Read
+the rest of this posting."), "class" => "read-more"));
}
if (user_access("administer nodes")) {
@@ -980,7 +982,7 @@ function node_validate($node, &$error) {
** Validate the "authored by"-field:
*/
- if (empty($node->name)) {
+ if (empty($node->name) || empty($node->uid)){
/*
** The use of empty() is mandatory in the context of usernames
** as the empty string denotes the anonymous user. In case we