From 796ea918866c15f0d59ce178d095022edfaf096d Mon Sep 17 00:00:00 2001
From: Thomas Lange =excerpt($PAGE['BODY']['HTML'])?> =excerpt($PAGE['BODY']['HTML']())?> =excerpt($POST['BODY']['HTML'])?> =excerpt($POST['BODY']['HTML']())?> =excerpt($USER['BODY']['HTML'])?> =excerpt($USER['BODY']['HTML']())?> =excerpt($PAGE['BODY']['HTML'], 600)?> =excerpt($PAGE['BODY']['HTML'](), 600)?>
Date: Fri, 5 May 2017 02:38:39 +0200
Subject: A significant increase in the response time has been achieved, since
the template parameters "$ITEM['BODY']['TEXT']" and "$ITEM['BODY']['HTML']"
are now no longer strings but closures (anonymous functions). This means that
the underlying logic, which parses the content or converts it into Markdown,
is not executed until one of these parameters is really needed and called in
the template (which maybe significantly increases the response time on a long
list of items which not use one of those two parameters).
This means that within templates you now have to call these parameters in the following way (note the brackets at the end, which represent a function call):
=$ITEM['BODY']['TEXT']()?>
=$ITEM['BODY']['HTML']()?>
In the background, the anonymous functions are called and executes $Item->getBody() and $Item->getHTML() only when needed. Previously, $Item->getBody() and $Item->getHTML() were basically executed and the parsed content was passed to the template, regardless of whether these parameters are required in the template or not!
---
template/admin/html/page/item.php | 2 +-
template/admin/html/post/item.php | 2 +-
template/admin/html/user/item.php | 2 +-
template/standard/html/feed/item_page.php | 4 ++--
template/standard/html/feed/item_post.php | 4 ++--
template/standard/html/home.php | 2 +-
template/standard/html/page/item.php | 2 +-
template/standard/html/page/main.php | 2 +-
template/standard/html/post/item.php | 2 +-
template/standard/html/post/main.php | 2 +-
template/standard/html/user/item.php | 2 +-
template/standard/html/user/main.php | 2 +-
12 files changed, 14 insertions(+), 14 deletions(-)
(limited to 'template')
diff --git a/template/admin/html/page/item.php b/template/admin/html/page/item.php
index a19afa9..599e942 100644
--- a/template/admin/html/page/item.php
+++ b/template/admin/html/page/item.php
@@ -7,7 +7,7 @@
-
diff --git a/template/admin/html/post/item.php b/template/admin/html/post/item.php
index 750b03d..abc2b0f 100644
--- a/template/admin/html/post/item.php
+++ b/template/admin/html/post/item.php
@@ -7,7 +7,7 @@
-
diff --git a/template/admin/html/user/item.php b/template/admin/html/user/item.php
index 439916e..731f6b5 100644
--- a/template/admin/html/user/item.php
+++ b/template/admin/html/user/item.php
@@ -6,7 +6,7 @@
-
diff --git a/template/standard/html/feed/item_page.php b/template/standard/html/feed/item_page.php
index f1a7a4d..25d7d30 100644
--- a/template/standard/html/feed/item_page.php
+++ b/template/standard/html/feed/item_page.php
@@ -13,10 +13,10 @@
-
\ No newline at end of file
diff --git a/template/standard/html/page/main.php b/template/standard/html/page/main.php
index 621b939..3b62571 100644
--- a/template/standard/html/page/main.php
+++ b/template/standard/html/page/main.php
@@ -14,7 +14,7 @@ $time = "