Exemplo n.º 1
0
    die("Don't hack!");
}
include_once 'serendipity_config.inc.php';
include_once S9Y_INCLUDE_PATH . 'include/plugin_api.inc.php';
$uri = $_SERVER['REQUEST_URI'];
// need to define this again here, as index.php no longer includes this file
$uri_addData = array('startpage' => false, 'uriargs' => implode('/', serendipity_getUriArguments($uri, true)), 'view' => $serendipity['view'], 'viewtype' => isset($serendipity['viewtype']) ? $serendipity['viewtype'] : '');
if ((empty($uri_addData['uriargs']) || trim($uri_addData['uriargs']) == $serendipity['indexFile']) && empty($serendipity['GET']['subpage'])) {
    $uri_addData['startpage'] = true;
}
$serendipity['plugindata']['smartyvars'] = $uri_addData;
// Plugins can change this global variable
serendipity_plugin_api::hook_event('genpage', $uri, $uri_addData);
serendipity_smarty_init($serendipity['plugindata']['smartyvars']);
$leftSidebarElements = serendipity_plugin_api::count_plugins('left');
$rightSidebarElements = serendipity_plugin_api::count_plugins('right');
$serendipity['smarty']->assignByRef('leftSidebarElements', $leftSidebarElements);
$serendipity['smarty']->assignByRef('rightSidebarElements', $rightSidebarElements);
switch ($serendipity['GET']['action']) {
    // User wants to read the diary
    case 'read':
        if (isset($serendipity['GET']['id'])) {
            $entry = array(serendipity_fetchEntry('id', $serendipity['GET']['id']));
            if (!is_array($entry) || count($entry) < 1 || !is_array($entry[0])) {
                unset($serendipity['GET']['id']);
                $entry = array(array());
                $serendipity['head_title'] = serendipity_specialchars($serendipity['blogTitle']);
                $serendipity['head_subtitle'] = '';
                $serendipity['smarty']->assign('head_title', $serendipity['head_title']);
                $serendipity['smarty']->assign('head_subtitle', $serendipity['head_subtitle']);
                $serendipity['view'] = '404';
Exemplo n.º 2
0
    foreach ($array as $idx => $searchval) {
        if (strpos($string, $searchval) === 0) {
            return true;
        }
    }
    return false;
}
$serendipity['smarty']->registerPlugin('modifier', 'is_in_string', 'is_in_string');
if (class_exists('serendipity_event_entryproperties')) {
    $ep_msg = THEME_EP_YES;
} else {
    $ep_msg = THEME_EP_NO;
}
$template_config = array(array('var' => 'sidebars', 'type' => 'hidden', 'value' => 'right,footer,hide'), array('var' => 'theme_instructions', 'type' => 'content', 'default' => '<p>' . THEME_DEMO_AVAILABLE . '</p>' . $ep_msg . THEME_INSTRUCTIONS . '<p>' . CATEGORIES_ON_ARCHIVE_DESC . '</p><p>' . TAGS_ON_ARCHIVE_DESC . '</p>'), array('var' => 'use_corenav', 'name' => USE_CORENAV, 'type' => 'boolean', 'default' => true), array('var' => 'colorset', 'name' => THEME_COLORSET, 'type' => 'select', 'default' => 'green', 'select_values' => $colorsets), array('var' => 'skinset', 'name' => THEME_SKINSET, 'type' => 'select', 'default' => 'light', 'select_values' => $skinsets), array('var' => 'header_img', 'name' => HEADER_IMG, 'description' => HEADER_IMG_DESC, 'type' => 'media', 'default' => serendipity_getTemplateFile('header.jpg', 'serendipityHTTPPath', true)), array('var' => 'subheader_img', 'name' => SUBHEADER_IMG, 'description' => SUBHEADER_IMG_DESC, 'type' => 'media', 'default' => serendipity_getTemplateFile('subheader.jpg', 'serendipityHTTPPath', true)), array('var' => 'date_format', 'name' => ENTRY_DATE_FORMAT . ' (http://php.net/strftime)', 'type' => 'string', 'default' => DATE_FORMAT_ENTRY), array('var' => 'comment_time_format', 'name' => COMMENT_TIME_FORMAT, 'type' => 'select', 'default' => 'words', 'select_values' => array('words' => WORDS, 'time' => TIMESTAMP)), array('var' => 'display_as_timeline', 'name' => DISPLAY_AS_TIMELINE, 'description' => DISPLAY_AS_TIMELINE_DESC, 'type' => 'boolean', 'default' => true), array('var' => 'months_on_timeline', 'name' => MONTHS_ON_TIMELINE, 'description' => MONTHS_ON_TIMELINE_DESC, 'type' => 'boolean', 'default' => true), array('var' => 'months_on_timeline_format', 'name' => MONTHS_ON_TIMELINE_FORMAT . ' (http://php.net/strftime)', 'type' => 'string', 'default' => '%B, %Y'), array('var' => 'categories_on_archive', 'name' => CATEGORIES_ON_ARCHIVE, 'description' => CATEGORIES_ON_ARCHIVE_DESC, 'type' => 'boolean', 'default' => true), array('var' => 'category_rss_archive', 'name' => CATEGORY_RSS_ON_ARCHIVE, 'type' => 'boolean', 'default' => true), array('var' => 'tags_on_archive', 'name' => TAGS_ON_ARCHIVE, 'description' => TAGS_ON_ARCHIVE_DESC, 'type' => 'boolean', 'default' => true), array('var' => 'copyright', 'name' => COPYRIGHT, 'type' => 'string', 'default' => 'Copyright &copy; ' . $serendipity['blogTitle'] . ' ' . date(Y) . '.  <a href="#">Link 1</a> | <a href="#">Link 2</a> | <a href="' . $serendipity['baseURL'] . 'serendipity_admin.php">Login</a>'), array('var' => 'social_icons_amount', 'name' => SOCIAL_ICONS_AMOUNT, 'type' => 'string', 'default' => '2'));
// register footer sidebar with smarty
$FooterSidebarElements = serendipity_plugin_api::count_plugins('footer');
$serendipity['smarty']->assign_by_ref('FooterSidebarElements', $FooterSidebarElements);
//$template_global_config = array('navigation' => true);
//$template_loaded_config = serendipity_loadThemeOptions($template_config, $serendipity['smarty_vars']['template_option'], true);
//$serendipity['template_loaded_config'][$serendipity['template']] = $template_loaded_config; // copy into global scope for extended plugin API usage
//serendipity_loadGlobalThemeOptions($template_config, $template_loaded_config, $template_global_config);
$template_global_config = array('navigation' => true);
$serendipity['template_loaded_config'] = $template_loaded_config = serendipity_loadThemeOptions($template_config, $serendipity['smarty_vars']['template_option'], true);
serendipity_loadGlobalThemeOptions($template_config, $template_loaded_config, $template_global_config);
// $template_global_config = array('navigation' => true);
// $template_loaded_config = serendipity_loadThemeOptions($template_config, $serendipity['smarty_vars']['template_option'], true);
// serendipity_loadGlobalThemeOptions($template_config, $template_loaded_config, $template_global_config);
// if number of icons has changed, show new count
if (isset($_POST['serendipity']['template']['social_icons_amount']) && serendipity_userLoggedIn() && serendipity_checkPermission('adminTemplates')) {
    $temp_post = $_POST['serendipity']['template']['social_icons_amount'];
    if (is_numeric($temp_post)) {