X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=run.php;h=24072029821ecc46929272b9cf8a7dce902e9435;hb=73490300ca9dea6fc3c6d3a474ab49796fd58438;hp=f77e7d026c710aa061551bbc60ee73dd8bb856d0;hpb=d98d81886649a863d0e902f7c4e63b1257217e1f;p=wfpl.git diff --git a/run.php b/run.php index f77e7d0..2407202 100644 --- a/run.php +++ b/run.php @@ -79,7 +79,13 @@ function run_php($basename = false) { $html_exists = file_exists($html_file); $php_exists = file_exists($php_file); - if(!$php_exists && !$html_exists) { + if(function_exists('cms_get')) { + $cms_content = cms_get($basename); + } else { + $cms_content = false; + } + + if(!$php_exists && !$html_exists && !$cms_content) { header('HTTP/1.0 404 File Not Found'); if(file_exists('404.php') || file_exists('404.html')) { run_php('404'); @@ -125,9 +131,12 @@ function run_php($basename = false) { if(file_exists('template.html')) { $tem = new tem(); $tem->load("template.html"); + if($cms_content) foreach($cms_content as $name => $val) { + $tem->append($name, $val); + } $sections = tem_top_subs(); if($sections) foreach($sections as $name => $val) { - $tem->set($name, $val); + $tem->append($name, $val); } if(file_exists("$basename.css")) {