aboutsummaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorChad Little <clittle@users.sourceforge.net>2004-08-18 00:08:33 +0000
committerChad Little <clittle@users.sourceforge.net>2004-08-18 00:08:33 +0000
commit20b4da0690a7e8744e8d6c65173436c222c01a2d (patch)
tree3a0b5b27fa9f62c95f78386514c1a77d63850220 /functions
parent889ae6ccf3e62002ca6b161800a0a73121fcbe21 (diff)
downloadphpicalendar-20b4da0690a7e8744e8d6c65173436c222c01a2d.tar.gz
phpicalendar-20b4da0690a7e8744e8d6c65173436c222c01a2d.tar.bz2
phpicalendar-20b4da0690a7e8744e8d6c65173436c222c01a2d.zip
Modified for speed and stat errors.
Diffstat (limited to 'functions')
-rw-r--r--functions/template.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/functions/template.php b/functions/template.php
index d2f5a36..008cdec 100644
--- a/functions/template.php
+++ b/functions/template.php
@@ -903,9 +903,6 @@ class Page {
if (sizeof($tags) > 0)
foreach ($tags as $tag => $data) {
- // This opens up another template and parses it as well.
- $data = (file_exists($data)) ? $this->parse($data) : $data;
-
// This removes any unfilled tags
if (!$data) {
$this->page = preg_replace('!<\!-- switch ' . $tag . ' on -->(.*)<\!-- switch ' . $tag . ' off -->!is', '', $this->page);
@@ -914,9 +911,14 @@ class Page {
// This replaces any tags
$this->page = str_replace('{' . strtoupper($tag) . '}', $data, $this->page);
}
-
- else
- die('No tags designated for replacement.');
+ }
+
+ function replace_files($tags = array()) {
+ if (sizeof($tags) > 0)
+ foreach ($tags as $tag => $data) {
+ // This opens up another template and parses it as well.
+ $data = (file_exists($data)) ? $this->parse($data) : $data;
+ }
}
function output() {

© 2014-2024 Faster IT GmbH | imprint | privacy policy