Define framework constants.
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
-include_once('serendipity_config.inc.php');
-include_once S9Y_INCLUDE_PATH . 'include/functions_entries_admin.inc.php';
+include('serendipity_config.inc.php');
+include S9Y_INCLUDE_PATH . 'include/functions_entries_admin.inc.php';
header('Content-Type: text/html; charset=' . LANG_CHARSET);
Version 1.1-alpha1()
------------------------------------------------------------------------
+ * Create a new index on the plugin DB table, optimize fetching config
+ values for plugins. Load language file when permissions could not
+ allow reading the config file. (garvinhicking)
+
* Fix blocking site during file requests by writing session data to
disk. Thanks to jgoerzen! (garvinhicking)
- * Make categories sidebar plugin able to only show categories
+ * Make categories sidebar plugin able to only show categories
readable for logged in user (garvinhicking)
* Fix getting multiple images for directories that were put into
* Fix UTF-8 encoding of $i18n_filename_* variables for building
permalinks (Bug #1461754, Thanks to Kim Sullivan) (garvinhicking)
-
+
* Fix messing up comment count when deleting a trackback from admin
panel (garvinhicking)
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
-include_once 'serendipity_config.inc.php';
+include 'serendipity_config.inc.php';
$url = $serendipity['baseURL'];
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
+if (defined('S9Y_FRAMEWORK_COMPAT')) {
+ return;
+}
+@define('S9Y_FRAMEWORK_COMPAT', true);
+
$serendipity = array();
@ini_set('magic_quotes_runtime', 'off');
$preferred_language = strtolower(preg_replace('@^([^\-_;]*)_?.*$@', '\1', $lang));
if (in_array($preferred_language, $supported_languages)) {
if ($use_include) {
- @include_once(S9Y_INCLUDE_PATH . 'lang/' . $charset . 'serendipity_lang_' . $preferred_language . '.inc.php');
+ @include(S9Y_INCLUDE_PATH . 'lang/' . $charset . 'serendipity_lang_' . $preferred_language . '.inc.php');
$serendipity['autolang'] = $preferred_language;
}
return $preferred_language;
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
-if (@include_once(S9Y_INCLUDE_PATH . "include/db/{$serendipity['dbType']}.inc.php")) {
+if (defined('S9Y_FRAMEWORK_DB')) {
+ return;
+}
+@define('S9Y_FRAMEWORK_DB', true);
+
+if (@include(S9Y_INCLUDE_PATH . "include/db/{$serendipity['dbType']}.inc.php")) {
@define('S9Y_DB_INCLUDED', TRUE);
}
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
-$serendipity['imageList'] = array();
-include_once(S9Y_INCLUDE_PATH . "include/db/db.inc.php");
-include_once(S9Y_INCLUDE_PATH . "include/compat.inc.php");
-include_once(S9Y_INCLUDE_PATH . "include/functions_config.inc.php");
-include_once(S9Y_INCLUDE_PATH . "include/plugin_api.inc.php");
-include_once(S9Y_INCLUDE_PATH . "include/functions_images.inc.php");
-include_once(S9Y_INCLUDE_PATH . "include/functions_installer.inc.php");
-include_once(S9Y_INCLUDE_PATH . "include/functions_entries.inc.php");
-include_once(S9Y_INCLUDE_PATH . "include/functions_comments.inc.php");
-include_once(S9Y_INCLUDE_PATH . "include/functions_permalinks.inc.php");
-include_once(S9Y_INCLUDE_PATH . "include/functions_smarty.inc.php");
+if (defined('S9Y_FRAMEWORK_FUNCTIONS')) {
+ return;
+}
+@define('S9Y_FRAMEWORK_FUNCTIONS', true);
+$serendipity['imageList'] = array();
+if (!defined('S9Y_FRAMEWORK_DB')) {
+ include(S9Y_INCLUDE_PATH . "include/db/db.inc.php");
+}
+if (!defined('S9Y_FRAMEWORK_COMPAT')) {
+ include(S9Y_INCLUDE_PATH . "include/compat.inc.php");
+}
+if (!defined('S9Y_FRAMEWORK_CONFIG')) {
+ include(S9Y_INCLUDE_PATH . "include/functions_config.inc.php");
+}
+if (!defined('S9Y_FRAMEWORK_PLUGIN_API')) {
+ include(S9Y_INCLUDE_PATH . "include/plugin_api.inc.php");
+}
+if (!defined('S9Y_FRAMEWORK_IMAGES')) {
+ include(S9Y_INCLUDE_PATH . "include/functions_images.inc.php");
+}
+if (!defined('S9Y_FRAMEWORK_INSTALLER')) {
+ include(S9Y_INCLUDE_PATH . "include/functions_installer.inc.php");
+}
+if (!defined('S9Y_FRAMEWORK_ENTRIES')) {
+ include(S9Y_INCLUDE_PATH . "include/functions_entries.inc.php");
+}
+if (!defined('S9Y_FRAMEWORK_COMMENTS')) {
+ include(S9Y_INCLUDE_PATH . "include/functions_comments.inc.php");
+}
+if (!defined('S9Y_FRAMEWORK_PERMALINKS')) {
+ include(S9Y_INCLUDE_PATH . "include/functions_permalinks.inc.php");
+}
+if (!defined('S9Y_FRAMEWORK_SMARTY')) {
+ include(S9Y_INCLUDE_PATH . "include/functions_smarty.inc.php");
+}
/**
* Truncate a string to a specific length, multibyte aware. Appends '...' if successfully truncated
*
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
+if (defined('S9Y_FRAMEWORK_CALENDARS')) {
+ return;
+}
+@define('S9Y_FRAMEWORK_CALENDARS', true);
+
/**
* Gregorian to Persian Convertor
*
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
+if (defined('S9Y_FRAMEWORK_COMMENTS')) {
+ return;
+}
+@define('S9Y_FRAMEWORK_COMMENTS', true);
+
/**
* Store the personal details of a commenting user in a cookie (or delete that cookie)
*
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
+if (defined('S9Y_FRAMEWORK_ENTRIES')) {
+ return;
+}
+@define('S9Y_FRAMEWORK_ENTRIES', true);
+
/**
* Delete a category or range of categories
*
function serendipity_updertEntry($entry) {
global $serendipity;
- include_once S9Y_INCLUDE_PATH . 'include/functions_entries_admin.inc.php';
+ include S9Y_INCLUDE_PATH . 'include/functions_entries_admin.inc.php';
$errors = array();
serendipity_plugin_api::hook_event('backend_entry_updertEntry', $errors, $entry);
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
-include_once(S9Y_INCLUDE_PATH . "include/functions_trackbacks.inc.php");
+if (defined('S9Y_FRAMEWORK_ENTRIES_ADMIN')) {
+ return;
+}
+@define('S9Y_FRAMEWORK_ENTRIES_ADMIN', true);
+
+if (!defined('S9Y_FRAMEWORK_TRACKBACKS')) {
+ include(S9Y_INCLUDE_PATH . "include/functions_trackbacks.inc.php");
+}
/**
* Prints the form for editing/creating new blog entries
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
+if (defined('S9Y_FRAMEWORK_IMAGES')) {
+ return;
+}
+@define('S9Y_FRAMEWORK_IMAGES', true);
+
/**
* Check if an uploaded file is "evil"
*
# All rights reserved. See LICENSE file for licensing details
+if (defined('S9Y_FRAMEWORK_INSTALLER')) {
+ return;
+}
+@define('S9Y_FRAMEWORK_INSTALLER', true);
+
/**
* Convert a PHP Ini setting to a boolean flag
*
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
+if (defined('S9Y_FRAMEWORK_PERMALINKS')) {
+ return;
+}
+@define('S9Y_FRAMEWORK_PERMALINKS', true);
+
/**
* Converts a string into a filename that can be used safely in HTTP URLs
*
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)\r
# All rights reserved. See LICENSE file for licensing details\r
\r
+if (defined('S9Y_FRAMEWORK_PLUGINS_ADMIN')) {\r
+ return;\r
+}\r
+@define('S9Y_FRAMEWORK_PLUGINS_ADMIN', true);\r
+\r
/**\r
* Returns the name of a usergroup.\r
*\r
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
+if (defined('S9Y_FRAMEWORK_RSS')) {
+ return;
+}
+@define('S9Y_FRAMEWORK_RSS', true);
+
/**
* Parses entries to display them for RSS/Atom feeds to be passed on to generic Smarty templates
*
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
+if (defined('S9Y_FRAMEWORK_TRACKBACKS')) {
+ return;
+}
+@define('S9Y_FRAMEWORK_TRACKBACKS', true);
+
/**
* Check a HTTP response if it is a valid XML trackback response
*
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
+if (defined('S9Y_FRAMEWORK_UPGRADER')) {
+ return;
+}
+@define('S9Y_FRAMEWORK_UPGRADER', true);
+
/**
* This is a list of functions that are used by the upgrader. Define functions here that
* are not used within usual Serendipity control flow
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
-include_once('serendipity_config.inc.php');
-include_once(S9Y_INCLUDE_PATH . 'include/plugin_api.inc.php');
-include_once(S9Y_INCLUDE_PATH . 'include/plugin_internal.inc.php');
+if (!defined('S9Y_FRAMEWORK')) {
+ include('serendipity_config.inc.php');
+}
+
+if (!defined('S9Y_FRAMEWORK_PLUGIN_API')) {
+ include(S9Y_INCLUDE_PATH . 'include/plugin_api.inc.php');
+}
+
+if (!defined('S9Y_FRAMEWORK_PLUGIN_INTERNAL')) {
+ include(S9Y_INCLUDE_PATH . 'include/plugin_internal.inc.php');
+}
$uri_addData = array(
'startpage' => false,
if ($serendipity['smarty_raw_mode']) {
/* For BC reasons, we have to ask for layout.php */
- @include_once(serendipity_getTemplateFile('layout.php', 'serendipityPath'));
+ @include(serendipity_getTemplateFile('layout.php', 'serendipityPath'));
} else {
switch ($serendipity['GET']['action']) {
// User wants to read the diary
// Do fallback to english
if (IS_installed === false || (defined('IS_up2date') && IS_up2date === false)) {
- @include_once(S9Y_INCLUDE_PATH . 'lang/' . $charset . 'serendipity_lang_en.inc.php');
+ @include(S9Y_INCLUDE_PATH . 'lang/' . $charset . 'serendipity_lang_en.inc.php');
}
}
die ('Don\'t hack!');
}
-include_once S9Y_INCLUDE_PATH . 'include/functions.inc.php';
+if (defined('S9Y_FRAMEWORK_PLUGIN_API')) {
+ return;
+}
+@define('S9Y_FRAMEWORK_PLUGIN_API', true);
+
+if (!defined('S9Y_FRAMEWORK_FUNCTIONS')) {
+ include S9Y_INCLUDE_PATH . 'include/functions.inc.php';
+}
/* This file defines the plugin API for serendipity.
* By extending these classes, you can add your own code
if (!class_exists($class_name) && !empty($pluginFile)) {
// $serendipity['debug']['pluginload'][] = "Classname does not exist. Including $pluginFile.";
- include_once($pluginFile);
+ include($pluginFile);
}
if (!class_exists($class_name)) {
}
}
-include_once S9Y_INCLUDE_PATH . 'include/plugin_internal.inc.php';
+if (!defined('S9Y_FRAMEWORK_PLUGIN_INTERNAL')) {
+ include S9Y_INCLUDE_PATH . 'include/plugin_internal.inc.php';
+}
/* vim: set sts=4 ts=4 expandtab : */
// Session are needed to also remember an autologin user on the frontend
ob_start();
-include_once('serendipity_config.inc.php');
+include('serendipity_config.inc.php');
header('Content-Type: text/html; charset='. LANG_CHARSET);
$track_referer = true;
$uri = $_SERVER['REQUEST_URI'];
}
ob_start();
- include_once(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
+ include(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
$data = ob_get_contents();
ob_end_clean();
}
ob_start();
- include_once(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
+ include(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
$data = ob_get_contents();
ob_end_clean();
}
ob_start();
- include_once(S9Y_INCLUDE_PATH . 'rss.php');
+ include(S9Y_INCLUDE_PATH . 'rss.php');
$data = ob_get_contents();
ob_end_clean();
}
}
- include_once(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
+ include(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
} else if (preg_match(PAT_PLUGIN, $uri, $matches)) {
serendipity_plugin_api::hook_event('external_plugin', $matches[2]);
if (!defined('NO_EXIT')) {
$serendipity['head_title'] = $cInfo['category_name'];
$serendipity['head_subtitle'] = $serendipity['blogTitle'];
- include_once(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
+ include(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
} else if ($is_multiauth || preg_match(PAT_PERMALINK_AUTHORS, $uri, $matches)) {
if ($is_multiauth) {
$serendipity['GET']['viewAuthor'] = implode(';', $serendipity['POST']['multiAuth']);
$serendipity['head_title'] = sprintf(ENTRIES_BY, $uInfo[0]['realname']);
$serendipity['head_subtitle'] = $serendipity['blogTitle'];
- include_once(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
+ include(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
} else if (preg_match(PAT_SEARCH, $uri, $matches)) {
$_args = $serendipity['uriArguments'];
$serendipity['GET']['action'] = 'search';
$serendipity['GET']['searchTerm'] = urldecode(htmlspecialchars(strip_tags(implode(' ', $search))));
- include_once(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
+ include(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
} elseif (preg_match(PAT_CSS, $uri, $matches)) {
$css_mode = $matches[1];
- include_once(S9Y_INCLUDE_PATH . 'serendipity.css.php');
+ include(S9Y_INCLUDE_PATH . 'serendipity.css.php');
exit;
} else if (preg_match('@/(index(\.php|\.html)?)|'. preg_quote($serendipity['indexFile']) .'@', $uri) ||
preg_match('@^/' . preg_quote(trim($serendipity['serendipityHTTPPath'], '/')) . '/?(\?.*)?$@', $uri)) {
$serendipity['uriArguments'][] = PATH_ARCHIVES;
}
- include_once(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
+ include(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
} else {
header('HTTP/1.0 404 Not found');
- include_once(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
+ include(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
// printf('<div class="serendipity_msg_important">' . DOCUMENT_NOT_FOUND . '</div>', $uri);
}
header('Content-Type: text/xml; charset=utf-8');
session_cache_limiter('public');
-include_once('serendipity_config.inc.php');
-include_once(S9Y_INCLUDE_PATH . 'include/functions_rss.inc.php');
+include('serendipity_config.inc.php');
+include(S9Y_INCLUDE_PATH . 'include/functions_rss.inc.php');
$version = $_GET['version'];
$description = $serendipity['blogDescription'];
'version' => $version
);
-include_once(S9Y_INCLUDE_PATH . 'include/plugin_api.inc.php');
+if (!defined('S9Y_FRAMEWORK_PLUGIN_API')) {
+ include(S9Y_INCLUDE_PATH . 'include/plugin_api.inc.php');
+}
$plugins = serendipity_plugin_api::enum_plugins();
if (is_array($plugins)) {
define('IN_CSS', true);
session_cache_limiter('public');
-include_once('serendipity_config.inc.php');
+if (!defined('S9Y_FRAMEWORK')) {
+ include('serendipity_config.inc.php');
+}
if (!isset($css_mode)) {
if (!empty($serendipity['GET']['css_mode'])) {
header('Content-Type: text/html; charset=' . LANG_CHARSET);
if (IS_installed === false) {
- require_once(S9Y_INCLUDE_PATH . 'include/functions_permalinks.inc.php');
- require_once(S9Y_INCLUDE_PATH . 'include/functions_installer.inc.php');
- require_once S9Y_INCLUDE_PATH . 'include/functions_config.inc.php';
+ require(S9Y_INCLUDE_PATH . 'include/functions_permalinks.inc.php');
+ require(S9Y_INCLUDE_PATH . 'include/functions_installer.inc.php');
+ require(S9Y_INCLUDE_PATH . 'include/functions_config.inc.php');
$css_file = 'serendipity.css.php?serendipity[css_mode]=serendipity_admin.css';
} else {
$css_file = serendipity_rewriteURL('serendipity_admin.css');
}
?>
<td class="serendipityAdminContent" colspan="2">
- <?php require_once(S9Y_INCLUDE_PATH . $file); ?>
+ <?php require(S9Y_INCLUDE_PATH . $file); ?>
<?php
/* vim: set sts=4 ts=4 expandtab : */
header('Content-type: application/x-javascript');
-include_once('serendipity_config.inc.php');
+include('serendipity_config.inc.php');
?>
<!-- // Hide from older browsers
// This page serves to carry through any variables without having to parse a complete .js file as .php
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
-require_once 'serendipity_config.inc.php';
+if (!defined('S9Y_FRAMEWORK')) {
+ require 'serendipity_config.inc.php';
+}
$data = array();
serendipity_plugin_api::hook_event('frontend_xmlrpc', $data);
CREATE INDEX pluginauthorid_idx ON {PREFIX}plugins (authorid);
CREATE INDEX pluginplace_idx ON {PREFIX}plugins (placement);
+CREATE INDEX pluginretr_idx ON {PREFIX}plugins (placement, sort_order);
CREATE TABLE {PREFIX}category (
categoryid {AUTOINCREMENT} {PRIMARY},
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
-include_once('serendipity_config.inc.php');
+include('serendipity_config.inc.php');
if ($_REQUEST['cid'] != '' && $HTTP_RAW_POST_DATA != '') {
$comment = array();