summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-05-17 13:56:53 +0000
committerDries Buytaert <dries@buytaert.net>2003-05-17 13:56:53 +0000
commitbadf1ca458f7a7a12ff8fe0af6701ff8f8e94fd9 (patch)
treeb0ba0e931d7f8b78450ad52d5287bf2304e645aa
parentd90c5a3a4200d1531bb3b9a238e92acd0d29c042 (diff)
downloadbrdo-badf1ca458f7a7a12ff8fe0af6701ff8f8e94fd9.tar.gz
brdo-badf1ca458f7a7a12ff8fe0af6701ff8f8e94fd9.tar.bz2
- Fixed bug #1665 : teaser is not trimmed when creating static pages.
Patch by Marco.
-rw-r--r--modules/page.module27
-rw-r--r--modules/page/page.module27
2 files changed, 18 insertions, 36 deletions
diff --git a/modules/page.module b/modules/page.module
index 87f70d744..3ea8403b9 100644
--- a/modules/page.module
+++ b/modules/page.module
@@ -88,34 +88,25 @@ function page_link($type) {
return $links;
}
-function page_body($node) {
- $op = $_POST["op"];
+function page_view($node, $main = 0) {
+ /*
+ ** Extract the page body. If body is dynamic (using PHP code), the body
+ ** will be generated.
+ */
if ($node->format == 0) {
// HTML type
- $output = check_output($node->body);
+ $node->teaser = check_output($node->teaser);
+ $node->body = check_output($node->body);
}
else {
// PHP type
ob_start();
eval($node->body);
- $output = ob_get_contents();
+ $node->teaser = $node->body = ob_get_contents();
ob_end_clean();
}
- return $output;
-}
-
-function page_view($node, $main = 0) {
-
-
- /*
- ** Extract the page body. If body is dynamic (using PHP code), the body
- ** will be generated.
- */
-
- $node->teaser = $node->body = page_body($node);
-
if ($main) {
theme("node", $node, $main);
}
@@ -149,7 +140,7 @@ function page_validate(&$node) {
else {
$node->format = 0;
$node->body = filter($node->body);
- $node->teaser = filter($node->body);
+ $node->teaser = filter($node->teaser);
}
}
diff --git a/modules/page/page.module b/modules/page/page.module
index 87f70d744..3ea8403b9 100644
--- a/modules/page/page.module
+++ b/modules/page/page.module
@@ -88,34 +88,25 @@ function page_link($type) {
return $links;
}
-function page_body($node) {
- $op = $_POST["op"];
+function page_view($node, $main = 0) {
+ /*
+ ** Extract the page body. If body is dynamic (using PHP code), the body
+ ** will be generated.
+ */
if ($node->format == 0) {
// HTML type
- $output = check_output($node->body);
+ $node->teaser = check_output($node->teaser);
+ $node->body = check_output($node->body);
}
else {
// PHP type
ob_start();
eval($node->body);
- $output = ob_get_contents();
+ $node->teaser = $node->body = ob_get_contents();
ob_end_clean();
}
- return $output;
-}
-
-function page_view($node, $main = 0) {
-
-
- /*
- ** Extract the page body. If body is dynamic (using PHP code), the body
- ** will be generated.
- */
-
- $node->teaser = $node->body = page_body($node);
-
if ($main) {
theme("node", $node, $main);
}
@@ -149,7 +140,7 @@ function page_validate(&$node) {
else {
$node->format = 0;
$node->body = filter($node->body);
- $node->teaser = filter($node->body);
+ $node->teaser = filter($node->teaser);
}
}