示例#1
0
        $template = $template_request->response['payload'];
    }
    // with a real user but no template we redirect to the admin
    if ($template) {
        $element_embeds = false;
        // i know we don't technically need this, but the immaculate variable in preg_match_all freaks me out
        $found_elements = preg_match_all('/{{{element_(.*?)}}}/', $template, $element_embeds, PREG_PATTERN_ORDER);
        if ($found_elements) {
            foreach ($element_embeds[1] as $element_id) {
                ob_start();
                CASHSystem::embedElement($element_id);
                $page_vars['element_' . $element_id] = ob_get_contents();
                ob_end_clean();
            }
        }
        // render out the page itself
        echo CASHSystem::renderMustache($template, $page_vars);
        exit;
    } else {
        // redirect to the admin
        header('Location: ./admin/');
    }
}
/***************************************
 *
 *  NOT A USER. DISPLAY MAIN SITE.
 *
 ***************************************/
$cache_request = new CASHRequest();
$cache_request->primeCache();
echo $cache_request->getCachedURL('org.cashmusic.prime', 'pagecache', 'http://prime.cashmusic.org/', 'raw', false);