当前位置: 首页>>代码示例>>PHP>>正文


PHP serendipity_plugin_api::count_plugins方法代码示例

本文整理汇总了PHP中serendipity_plugin_api::count_plugins方法的典型用法代码示例。如果您正苦于以下问题:PHP serendipity_plugin_api::count_plugins方法的具体用法?PHP serendipity_plugin_api::count_plugins怎么用?PHP serendipity_plugin_api::count_plugins使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在serendipity_plugin_api的用法示例。


在下文中一共展示了serendipity_plugin_api::count_plugins方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: die

    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';
开发者ID:vonnordmann,项目名称:Serendipity,代码行数:31,代码来源:genpage.inc.php

示例2: foreach

    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)) {
开发者ID:jimjag,项目名称:Serendipity,代码行数:31,代码来源:config.inc.php


注:本文中的serendipity_plugin_api::count_plugins方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。