From bf401a5afaca8f96606b22e219bd595646ac9dab Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 2 Mar 2014 00:24:29 -0800 Subject: allow templates to have multiple styles - this would be a bit like having a schema for a template file. At first you'll think this is insane and overly complicated, you'll just have to wait and see what I'm up to. Then it will start to make sense. --- include/comanche.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include/comanche.php') diff --git a/include/comanche.php b/include/comanche.php index 3cf5e72a5..4af081740 100644 --- a/include/comanche.php +++ b/include/comanche.php @@ -57,10 +57,16 @@ function comanche_parser(&$a,$s) { if($cnt) $a->page['template'] = trim($matches[1]); + $cnt = preg_match("/\[template=(.*?)\](.*?)\[\/template\]/ism", $s, $matches); + if($cnt) { + $a->page['template'] = trim($matches[2]); + $a->page['template_style'] = trim($matches[2]) . '_' . $matches[1]; + } + $cnt = preg_match("/\[template\](.*?)\[\/template\]/ism", $s, $matches); - if($cnt) + if($cnt) { $a->page['template'] = trim($matches[1]); - + } $cnt = preg_match("/\[theme=(.*?)\](.*?)\[\/theme\]/ism", $s, $matches); if($cnt) { -- cgit v1.2.3