function srkRender($targetFile, $cusRenderArgs) { global $srkEnv, $srkContent, $renderArgs; if (isset($srkEnv->sent)) { return; } elseif ($targetFile != 'error') { require_once $srkEnv->appPath . '/modules/db.php'; srkVisitCountUpdate("shiruku_site_total"); } $renderArgs = $cusRenderArgs; if (is_file($srkEnv->viewsPath . '/' . $targetFile . '_config.php')) { require_once $srkEnv->viewsPath . '/' . $targetFile . '_config.php'; } foreach ($srkEnv->dependViews as $req) { if (is_file($srkEnv->viewsPath . '/' . $req . '_config.php')) { require_once $srkEnv->viewsPath . '/' . $req . '_config.php'; } } require_once $srkEnv->viewsPath . '/htmlhead.php'; if (!$renderArgs['noPageHead']) { require_once $srkEnv->viewsPath . '/pagehead.php'; } foreach ($srkEnv->dependViews as $req) { if (is_file($srkEnv->viewsPath . '/' . $req . '.php')) { require_once $srkEnv->viewsPath . '/' . $req . '.php'; } } if (is_file($srkEnv->viewsPath . '/' . $targetFile . '.php')) { require_once $srkEnv->viewsPath . '/' . $targetFile . '.php'; } else { $renderArgs['error'] = array('error' => array('status' => '404', 'stack' => 'Render error: no ui file avaliable')); require_once $srkEnv->viewsPath . '/error.php'; } require_once $srkEnv->viewsPath . '/pagefoot.php'; $srkEnv->sent = true; }
<?php if (!defined('srkVersion')) { exit(403); } if ($srkEnv->reqURLLength == 2) { $penId = $srkEnv->reqURL[2]; $srkEnv->pageTitle .= '.view ' . $penId; require_once $srkEnv->appPath . '/modules/render.php'; srkRender('view', array('penid' => $penId)); if (is_file($srkEnv->penPath . '/' . $penId . '/content.md')) { require_once $srkEnv->appPath . '/modules/db.php'; srkVisitCountUpdate($penId); } }