X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=index.php;h=08f24af60f49238d43a7d30832767dd939feea2b;hb=b69d82e64c8a0622823b99d0b8754a213a989dd1;hp=7b41403351610a8f8d899ee622c071ea120e8ead;hpb=c772edc313945ea02168108e3f8941b1789430d0;p=friendica.git diff --git a/index.php b/index.php index 7b41403351..08f24af60f 100644 --- a/index.php +++ b/index.php @@ -99,6 +99,10 @@ if (!$a->is_backend()) { $stamp1 = microtime(true); session_start(); $a->save_timestamp($stamp1, "parser"); +} else { + require_once "include/poller.php"; + + call_worker_if_idle(); } /** @@ -489,7 +493,8 @@ if (isset($_GET["mode"]) AND ($_GET["mode"] == "raw")) { echo substr($target->saveHTML(), 6, -8); - session_write_close(); + if (!$a->is_backend()) + session_write_close(); exit; } @@ -500,21 +505,20 @@ $profile = $a->profile; header("X-Friendica-Version: ".FRIENDICA_VERSION); header("Content-type: text/html; charset=utf-8"); +// We use $_GET["mode"] for special page templates. So we will check if we have +// to load another page template than the default one +// The page templates are located in /view/php/ or in the theme directory +if (isset($_GET["mode"])) { + $template = theme_include($_GET["mode"].'.php'); +} -if (isset($_GET["mode"]) AND ($_GET["mode"] == "minimal")) { - //$page['content'] = substr($target->saveHTML(), 6, -8)."\n\n". - // '
'."\n\n"; - - require "view/minimal.php"; -} else { - $template = 'view/theme/' . current_theme() . '/' - . ((x($a->page,'template')) ? $a->page['template'] : 'default' ) . '.php'; - - if(file_exists($template)) - require_once($template); - else - require_once(str_replace('theme/' . current_theme() . '/', '', $template)); +// If there is no page template use the default page template +if(!$template) { + $template = theme_include("default.php"); } -session_write_close(); +require_once($template); + +if (!$a->is_backend()) + session_write_close(); exit;