Example #1
0
function add_extra_head()
{
    $cache = new \cache\main();
    if ($show_from_cache = $cache->check('admin_head')) {
        return $show_from_cache;
    } else {
        $head = '';
        foreach (\query\others::while_head_lines(array_merge(array('max' => 0, 'show' => 'admin', 'orderby' => 'date desc'))) as $line) {
            $head .= \site\plugin::replace_constant($line->text) . "\n";
        }
        $cache->add('admin_head', $head);
        return $head;
    }
}
Example #2
0
function add_extra_head()
{
    $cache = new \cache\main();
    if ($show_from_cache = $cache->check('theme_head')) {
        return $show_from_cache;
    } else {
        $head = '';
        foreach (\query\others::while_head_lines(array_merge(array('max' => 0, 'show' => 'theme', 'orderby' => 'date desc'))) as $line) {
            $head .= \site\plugin::replace_constant($line->text) . "\n";
        }
        if (file_exists(COMMON_LOCATION . '/head.html')) {
            $head .= @file_get_contents(COMMON_LOCATION . '/head.html');
            $head .= "\n";
        }
        $cache->add('theme_head', $head);
        return $head;
    }
}