$template = fread($connect, 262144); fclose($connect); //includes official loudblog-tags include "loudblog/inc/loudblogtags.php"; //includes plugins from plugins-folder $folder = opendir('loudblog/custom/plugins'); while ($file = readdir($folder)) { if (substr($file, -4, 4) == ".php") { include_once "loudblog/custom/plugins/" . $file; } } //this is special: at first we pretend that no "next page" is possible global $nextpage; $nextpage = false; //start parsing!!! echo fullparse(firstparse(hrefmagic($template))); //-------------------------------------------------------- function firstparse($string) { //very first, we do the loop_postings, because we need some global data for other functions, aight? $postparsed = parsepostings($string); //now we put the posting-parsing-results into the original string if (isset($postparsed[0]) and $postparsed[0] != false) { foreach ($postparsed as $replace) { $string = str_replace($replace['origin'], $replace['parsed'], $string); } } return $string; } //-------------------------------------------------------- function fullparse($string)
<?php // This is the second slowliest and second ugliest parsing method ever. Please do not take a closer look. Loudblog will be rewritten soon with an elegant and fast parsing method. Until then, you will have to use this one. I'm sorry. //start parsing! $parsedpage = fullparse(firstparse(hrefmagic($template))); //do we have php code within our template? switch between echo and eval! if ($php_use) { $templatepieces = explode($phpseparator, $parsedpage); for ($i = 0; $i <= count($templatepieces); $i += 2) { echo $templatepieces[$i]; if (isset($templatepieces[$i + 1])) { eval($templatepieces[$i + 1]); } } //no php code, no eval! } else { echo $parsedpage; } //-------------------------------------------------------- function firstparse($string) { //very first, we do the loop_postings, because we need some global data for other functions, aight? $postparsed = parsepostings($string); //now we put the posting-parsing-results into the original string if (isset($postparsed[0]) and $postparsed[0] != false) { foreach ($postparsed as $replace) { $string = str_replace($replace['origin'], $replace['parsed'], $string); } } return $string; }