예제 #1
0
# -- END LICENSE BLOCK -----------------------------------------
if (!defined('DC_CONTEXT_ADMIN')) {
    return;
}
$version = $core->plugins->moduleInfo('antispam', 'version');
if (version_compare($core->getVersion('antispam'), $version, '>=')) {
    return;
}
/* Database schema
-------------------------------------------------------- */
$s = new dbStruct($core->con, $core->prefix);
$s->spamrule->rule_id('bigint', 0, false)->blog_id('varchar', 32, true)->rule_type('varchar', 16, false, "'word'")->rule_content('varchar', 128, false)->primary('pk_spamrule', 'rule_id');
$s->spamrule->index('idx_spamrule_blog_id', 'btree', 'blog_id');
$s->spamrule->reference('fk_spamrule_blog', 'blog_id', 'blog', 'blog_id', 'cascade', 'cascade');
if ($s->driver() == 'pgsql') {
    $s->spamrule->index('idx_spamrule_blog_id_null', 'btree', '(blog_id IS NULL)');
}
# Schema installation
$si = new dbStruct($core->con, $core->prefix);
$changes = $si->synchronize($s);
# Creating default wordslist
if ($core->getVersion('antispam') === null) {
    $_o = new dcFilterWords($core);
    $_o->defaultWordsList();
    unset($_o);
}
$settings = new dcSettings($core, null);
$settings->addNamespace('antispam');
$settings->antispam->put('antispam_moderation_ttl', 0, 'integer', 'Antispam Moderation TTL (days)', false);
$core->setVersion('antispam', $version);
return true;
예제 #2
0
<?php

# -- BEGIN LICENSE BLOCK ---------------------------------------
#
# This file is part of blowupConfig, a plugin for Dotclear 2.
#
# Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear
# Licensed under the GPL version 2.0 license.
# See LICENSE file or
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK -----------------------------------------
if (!defined('DC_CONTEXT_ADMIN')) {
    return;
}
$version = $core->plugins->moduleInfo('blowupConfig', 'version');
if (version_compare($core->getVersion('blowupConfig'), $version, '>=')) {
    return;
}
$settings = new dcSettings($core, null);
$settings->addNamespace('themes');
$settings->themes->put('blowup_style', '', 'string', 'Blow Up  custom style', false);
$core->setVersion('blowupConfig', $version);
return true;
예제 #3
0
파일: index.php 프로젝트: nikrou/dotclear
 $cur->user_creadt = date('Y-m-d H:i:s');
 $cur->user_upddt = date('Y-m-d H:i:s');
 $cur->user_options = serialize($core->userDefaults());
 $cur->insert();
 $core->auth->checkUser($u_login);
 $admin_url = preg_replace('%install/index.php$%', '', $_SERVER['REQUEST_URI']);
 $root_url = preg_replace('%/admin/install/index.php$%', '', $_SERVER['REQUEST_URI']);
 # Create blog
 $cur = $core->con->openCursor($core->prefix . 'blog');
 $cur->blog_id = 'default';
 $cur->blog_url = http::getHost() . $root_url . '/index.php?';
 $cur->blog_name = __('My first blog');
 $core->addBlog($cur);
 $core->blogDefaults($cur->blog_id);
 $blog_settings = new dcSettings($core, 'default');
 $blog_settings->addNamespace('system');
 $blog_settings->system->put('blog_timezone', $default_tz);
 $blog_settings->system->put('lang', $dlang);
 $blog_settings->system->put('public_url', $root_url . '/public');
 $blog_settings->system->put('themes_url', $root_url . '/themes');
 # date and time formats
 $formatDate = __('%A, %B %e %Y');
 $date_formats = array('%Y-%m-%d', '%m/%d/%Y', '%d/%m/%Y', '%Y/%m/%d', '%d.%m.%Y', '%b %e %Y', '%e %b %Y', '%Y %b %e', '%a, %Y-%m-%d', '%a, %m/%d/%Y', '%a, %d/%m/%Y', '%a, %Y/%m/%d', '%B %e, %Y', '%e %B, %Y', '%Y, %B %e', '%e. %B %Y', '%A, %B %e, %Y', '%A, %e %B, %Y', '%A, %Y, %B %e', '%A, %Y, %B %e', '%A, %e. %B %Y');
 $time_formats = array('%H:%M', '%I:%M', '%l:%M', '%Hh%M', '%Ih%M', '%lh%M');
 if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
     $formatDate = preg_replace('#(?<!%)((?:%%)*)%e#', '\\1%#d', $formatDate);
     $date_formats = array_map(create_function('$f', 'return str_replace(\'%e\',\'%#d\',$f);'), $date_formats);
 }
 $blog_settings->system->put('date_format', $formatDate);
 $blog_settings->system->put('date_formats', serialize($date_formats), 'string', 'Date formats examples', true, true);
 $blog_settings->system->put('time_formats', serialize($time_formats), 'string', 'Time formats examples', true, true);
예제 #4
0
 /**
 Creates default settings for active blog. Optionnal parameter
 <var>defaults</var> replaces default params while needed.
 
 @param	defaults		<b>array</b>	Default parameters
 */
 public function blogDefaults($defaults = null)
 {
     if (!is_array($defaults)) {
         $defaults = array(array('allow_comments', 'boolean', true, 'Allow comments on blog'), array('allow_trackbacks', 'boolean', true, 'Allow trackbacks on blog'), array('blog_timezone', 'string', 'Europe/London', 'Blog timezone'), array('comments_nofollow', 'boolean', true, 'Add rel="nofollow" to comments URLs'), array('comments_pub', 'boolean', true, 'Publish comments immediately'), array('comments_ttl', 'integer', 0, 'Number of days to keep comments open (0 means no ttl)'), array('copyright_notice', 'string', '', 'Copyright notice (simple text)'), array('date_format', 'string', '%A, %B %e %Y', 'Date format. See PHP strftime function for patterns'), array('editor', 'string', '', 'Person responsible of the content'), array('enable_html_filter', 'boolean', 0, 'Enable HTML filter'), array('enable_xmlrpc', 'boolean', 0, 'Enable XML/RPC interface'), array('lang', 'string', 'en', 'Default blog language'), array('media_exclusion', 'string', '/\\.(phps?|pht(ml)?|phl)[0-9]*$/i', 'File name exclusion pattern in media manager. (PCRE value)'), array('media_img_m_size', 'integer', 448, 'Image medium size in media manager'), array('media_img_s_size', 'integer', 240, 'Image small size in media manager'), array('media_img_t_size', 'integer', 100, 'Image thumbnail size in media manager'), array('media_img_title_pattern', 'string', 'Title ;; Date(%b %Y) ;; separator(, )', 'Pattern to set image title when you insert it in a post'), array('media_video_width', 'integer', 400, 'Video width in media manager'), array('media_video_height', 'integer', 300, 'Video height in media manager'), array('media_flash_fallback', 'boolean', true, 'Flash player fallback for audio and video media'), array('nb_post_for_home', 'integer', 20, 'Number of entries on first home page'), array('nb_post_per_page', 'integer', 20, 'Number of entries on home pages and category pages'), array('nb_post_per_feed', 'integer', 20, 'Number of entries on feeds'), array('nb_comment_per_feed', 'integer', 20, 'Number of comments on feeds'), array('post_url_format', 'string', '{y}/{m}/{d}/{t}', 'Post URL format. {y}: year, {m}: month, {d}: day, {id}: post id, {t}: entry title'), array('public_path', 'string', 'public', 'Path to public directory, begins with a / for a full system path'), array('public_url', 'string', '/public', 'URL to public directory'), array('robots_policy', 'string', 'INDEX,FOLLOW', 'Search engines robots policy'), array('short_feed_items', 'boolean', false, 'Display short feed items'), array('theme', 'string', 'berlin', 'Blog theme'), array('themes_path', 'string', 'themes', 'Themes root path'), array('themes_url', 'string', '/themes', 'Themes root URL'), array('time_format', 'string', '%H:%M', 'Time format. See PHP strftime function for patterns'), array('tpl_allow_php', 'boolean', false, 'Allow PHP code in templates'), array('tpl_use_cache', 'boolean', true, 'Use template caching'), array('trackbacks_pub', 'boolean', true, 'Publish trackbacks immediately'), array('trackbacks_ttl', 'integer', 0, 'Number of days to keep trackbacks open (0 means no ttl)'), array('url_scan', 'string', 'query_string', 'URL handle mode (path_info or query_string)'), array('use_smilies', 'boolean', false, 'Show smilies on entries and comments'), array('no_search', 'boolean', false, 'Disable search'), array('inc_subcats', 'boolean', false, 'Include sub-categories in category page and category posts feed'), array('wiki_comments', 'boolean', false, 'Allow commenters to use a subset of wiki syntax'));
     }
     $settings = new dcSettings($this, null);
     $settings->addNamespace('system');
     foreach ($defaults as $v) {
         $settings->system->put($v[0], $v[2], $v[1], $v[3], false, true);
     }
 }