Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix by @ophian.

  • Loading branch information...
commit 5533f4fb6570e3d8265febbd3b060ddccbee2e27 1 parent a4571d4
@yellowled authored
Showing with 60 additions and 57 deletions.
  1. +60 −57 config.inc.php
View
117 config.inc.php
@@ -6,40 +6,43 @@
$serendipity['smarty']->assign(array('currpage' => "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'],
'currpage2' => $_SERVER['REQUEST_URI']));
-function serendipity_smarty_html5time($timestamp) { return date("c", $timestamp); }
-if( defined('Smarty::SMARTY_VERSION') ) {
- $serendipity['smarty']->registerPlugin('modifier', 'serendipity_html5time', 'serendipity_smarty_html5time');
-} else {
- // old Smarty 2 syntax
- $serendipity['smarty']->register_modifier('serendipity_html5time', 'serendipity_smarty_html5time');
-}
+if (!function_exists('serendipity_smarty_html5time')) {
+ function serendipity_smarty_html5time($timestamp) { return date("c", $timestamp); }
-// function serendipity_smarty_html5time($timestamp) { return date("c", $timestamp); }
-// $serendipity['smarty']->register_modifier('serendipity_smarty_html5time', 'serendipity_smarty_html5time');
+ if( defined('Smarty::SMARTY_VERSION') ) {
+ $serendipity['smarty']->registerPlugin('modifier', 'serendipity_html5time', 'serendipity_smarty_html5time');
+ } else {
+ // old Smarty 2 syntax
+ $serendipity['smarty']->register_modifier('serendipity_html5time', 'serendipity_smarty_html5time');
+ }
+}
if (class_exists('serendipity_event_spamblock')) {
- $required_fieldlist = serendipity_db_query("SELECT value FROM {$serendipity['dbPrefix']}config WHERE name LIKE '%spamblock%required_fields'", true, 'assoc');
+ $required_fieldlist = serendipity_db_query("SELECT value FROM {$serendipity['dbPrefix']}config WHERE name LIKE '%spamblock%required_fields'", true, 'assoc');
} elseif (class_exists('serendipity_event_commentspice')) {
- $required_fieldlist = serendipity_db_query("SELECT value FROM {$serendipity['dbPrefix']}config WHERE name LIKE '%commentspice%required_fields'", true, 'assoc');
+ $required_fieldlist = serendipity_db_query("SELECT value FROM {$serendipity['dbPrefix']}config WHERE name LIKE '%commentspice%required_fields'", true, 'assoc');
}
if (is_array($required_fieldlist)) {
- $required_fields = explode(',', $required_fieldlist['value']);
- $smarty_required_fields = array();
- foreach($required_fields AS $required_field) {
- $required_field = trim($required_field);
- if (empty($required_field)) continue;
- $smarty_required_fields[$required_field] = $required_field;
- }
- $serendipity['smarty']->assign('required_fields', $smarty_required_fields);
+ $required_fields = explode(',', $required_fieldlist['value']);
+ $smarty_required_fields = array();
+
+ foreach($required_fields AS $required_field) {
+ $required_field = trim($required_field);
+
+ if (empty($required_field)) continue;
+ $smarty_required_fields[$required_field] = $required_field;
+ }
+
+ $serendipity['smarty']->assign('required_fields', $smarty_required_fields);
}
$template_config = array(
- array(
- 'var' => 'date_format',
- 'name' => GENERAL_PLUGIN_DATEFORMAT . " (http://php.net/strftime)",
- 'type' => 'select',
- 'default' => DATE_FORMAT_ENTRY,
- 'select_values' => array(DATE_FORMAT_ENTRY => DATE_FORMAT_ENTRY,
+ array(
+ 'var' => 'date_format',
+ 'name' => GENERAL_PLUGIN_DATEFORMAT . " (http://php.net/strftime)",
+ 'type' => 'select',
+ 'default' => DATE_FORMAT_ENTRY,
+ 'select_values' => array(DATE_FORMAT_ENTRY => DATE_FORMAT_ENTRY,
'%A, %e. %B %Y' => '%A, %e. %B %Y',
'%a, %e. %B %Y' => '%a, %e. %B %Y',
'%e. %B %Y' => '%e. %B %Y',
@@ -50,44 +53,44 @@ function serendipity_smarty_html5time($timestamp) { return date("c", $timestamp)
'%m/%d/%y' => '%m/%d/%y',
'%m/%d/%Y' => '%m/%d/%Y',
'%Y-%m-%d' => '%Y-%m-%d')
- ),
- array(
- 'var' => 'header_img',
- 'name' => TWOK11_HEADER_IMG,
- 'type' => 'media',
- 'default' => serendipity_getTemplateFile('header.jpg')
- ),
- array(
- 'var' => 'webfonts',
- 'name' => TWOK11_WEBFONTS,
- 'type' => 'select',
- 'default' => 'none',
- 'select_values' => array('none' => TWOK11_NOWEBFONT,
+ ),
+ array(
+ 'var' => 'header_img',
+ 'name' => TWOK11_HEADER_IMG,
+ 'type' => 'media',
+ 'default' => serendipity_getTemplateFile('header.jpg')
+ ),
+ array(
+ 'var' => 'webfonts',
+ 'name' => TWOK11_WEBFONTS,
+ 'type' => 'select',
+ 'default' => 'none',
+ 'select_values' => array('none' => TWOK11_NOWEBFONT,
'droid' => 'Droid Sans',
'ptsans' => 'PT Sans',
'osans' => 'Open Sans',
'cabin' => 'Cabin',
'ubuntu' => 'Ubuntu',
'dserif' => 'Droid Serif')
- ),
- array(
- 'var' => 'userstyles',
- 'name' => TWOK11_USERSTYLES,
- 'type' => 'boolean',
- 'default' => false
- ),
- array(
- 'var' => 'refcomments',
- 'name' => TWOK11_REFCOMMENTS,
- 'type' => 'boolean',
- 'default' => false
- ),
- array(
- 'var' => 'use_corenav',
- 'name' => TWOK11_USE_CORENAV,
- 'type' => 'boolean',
- 'default' => true
- )
+ ),
+ array(
+ 'var' => 'userstyles',
+ 'name' => TWOK11_USERSTYLES,
+ 'type' => 'boolean',
+ 'default' => false
+ ),
+ array(
+ 'var' => 'refcomments',
+ 'name' => TWOK11_REFCOMMENTS,
+ 'type' => 'boolean',
+ 'default' => false
+ ),
+ array(
+ 'var' => 'use_corenav',
+ 'name' => TWOK11_USE_CORENAV,
+ 'type' => 'boolean',
+ 'default' => true
+ )
);
$template_global_config = array('navigation' => true);
Please sign in to comment.
Something went wrong with that request. Please try again.