Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8899
Modified Files:
Tag: branch-smarty
serendipity_config.inc.php serendipity_functions.inc.php
serendipity_functions_config.inc.php
Log Message:
- Beautify
Index: serendipity_config.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_config.inc.php,v
retrieving revision 1.93.2.14
retrieving revision 1.93.2.15
diff -u -d -r1.93.2.14 -r1.93.2.15
--- serendipity_config.inc.php 9 Oct 2004 23:20:35 -0000 1.93.2.14
+++ serendipity_config.inc.php 10 Oct 2004 00:39:07 -0000 1.93.2.15
@@ -122,6 +122,8 @@
include_once(S9Y_INCLUDE_PATH . '/serendipity_config_local.inc.php');
}
+define('IS_up2date', version_compare(serendipity_version($serendipity['version']), serendipity_version($serendipity['versionInstalled']), '<='));
+
/*
* Include main functions
*/
@@ -148,6 +150,7 @@
/*
* If a user is logged in, fetch his preferences. He possibly wants to have a different language
*/
+
if (isset($_SESSION['serendipityAuthorid'])) {
serendipity_load_configuration($_SESSION['serendipityAuthorid']);
}
@@ -155,7 +158,6 @@
/*
* Load main language file again, because now we have the preferred language
*/
-define('IS_up2date', version_compare(serendipity_version($serendipity['version']), serendipity_version($serendipity['versionInstalled']), '<='));
include(S9Y_INCLUDE_PATH .'serendipity_lang.inc.php');
@@ -183,7 +185,7 @@
}
/*
- * Check if the installed version is highter than the version of the config
+ * Check if the installed version is higher than the version of the config
*/
if (IS_up2date === false && $serendipity['production'] && !defined('IN_upgrader')) {
@@ -224,12 +226,14 @@
serendipity_plugin_api::hook_event('frontend_configure', $serendipity);
+
+
define('SMARTY_DIR', $serendipity['serendipityPath'] . 'bundled-libs/Smarty/libs/');
require_once SMARTY_DIR . 'Smarty.class.php';
$serendipity['smarty'] = new Smarty;
if ( !$serendipity['production'] ) {
- $serendipity['smarty']->force_compile = true;
- $serendipity['smarty']->debugging = true;
+ $serendipity['smarty']->force_compile = true;
+ $serendipity['smarty']->debugging = true;
}
$serendipity['smarty']->template_dir = $serendipity['serendipityPath'] . $serendipity['templatePath'] . $serendipity['template'];
$serendipity['smarty']->compile_dir = $serendipity['serendipityPath'] . PATH_SMARTY_COMPILE;
Index: serendipity_functions_config.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions_config.inc.php,v
retrieving revision 1.10.2.1
retrieving revision 1.10.2.2
diff -u -d -r1.10.2.1 -r1.10.2.2
--- serendipity_functions_config.inc.php 14 Sep 2004 13:11:17 -0000 1.10.2.1
+++ serendipity_functions_config.inc.php 10 Oct 2004 00:39:11 -0000 1.10.2.2
@@ -3,25 +3,25 @@
function serendipity_set_config_var($name, $val, $authorid = 0) {
global $serendipity;
- serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}config where name='" . serendipity_db_escape_string($name) . "' AND authorid = " . (int)$authorid);
- $r = serendipity_db_insert('config', array('name' => $name, 'value' => $val, 'authorid' => $authorid));
- $serendipity[$name] = $val;
- if (is_string($r)) {
- echo $r;
- }
+ serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}config where name='" . serendipity_db_escape_string($name) . "' AND authorid = " . (int)$authorid);
+ $r = serendipity_db_insert('config', array('name' => $name, 'value' => $val, 'authorid' => $authorid));
+ $serendipity[$name] = $val;
+ if (is_string($r)) {
+ echo $r;
+ }
}
function serendipity_get_config_var($name, $defval = false, $empty = false) {
global $serendipity;
- if (isset($serendipity[$name])) {
- if ($empty && gettype($serendipity[$name]) == 'string' && $serendipity[$name] === '') {
- return $defval;
- } else {
- return $serendipity[$name];
- }
- } else {
+ if (isset($serendipity[$name])) {
+ if ($empty && gettype($serendipity[$name]) == 'string' && $serendipity[$name] === '') {
return $defval;
+ } else {
+ return $serendipity[$name];
}
+ } else {
+ return $defval;
+ }
}
function serendipity_get_user_var($name, $authorid, $default) {
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.419.2.45
retrieving revision 1.419.2.46
diff -u -d -r1.419.2.45 -r1.419.2.46
--- serendipity_functions.inc.php 9 Oct 2004 23:20:35 -0000 1.419.2.45
+++ serendipity_functions.inc.php 10 Oct 2004 00:39:08 -0000 1.419.2.46
@@ -1113,8 +1113,7 @@
}
}
-function serendipity_fetchComments($id, $limit = null, $order = '', $showAll = false)
-{
+function serendipity_fetchComments($id, $limit = null, $order = '', $showAll = false) {
global $serendipity;
$and = '';
@@ -1170,8 +1169,7 @@
return $comments;
}
-function serendipity_fetchTrackbacks($id, $limit = null, $showAll = false)
-{
+function serendipity_fetchTrackbacks($id, $limit = null, $showAll = false) {
global $serendipity;
if (!$showAll) {
@@ -1217,9 +1215,10 @@
global $serendipity;
static $_smartyComments;
- /* $_smarty_comment sholds the ending smarty array
- $level is the current depth of the recurrence
- $i is the position in the current depth */
+ /* - $_smartyComments holds the ending smarty array.
+ - $depth is the current depth of the recurrence.
+ - $i is the position in the current depth. */
+
if ($parentid === VIEWMODE_THREADED) {
$parentid = 0;
}
@@ -1505,8 +1504,7 @@
return mail($to, $subject, $text . $serendipity['signature'], "From: {$serendipity['blogTitle']} - $fromName <$to>". (!empty($fromEmail) ? "\r\nReply-To: $fromEmail" : ''). "\r\n". $serendipity['mailheaders']);
}
-function serendipity_fetchReferences($id)
-{
+function serendipity_fetchReferences($id) {
global $serendipity;
$query = "SELECT name,link FROM {$serendipity['dbPrefix']}references WHERE entry_id = '" . (int)$id . "'";
@@ -1733,8 +1731,7 @@
/**
* purge a statically pregenerated entry
*/
-function serendipity_purgeEntry($id, $timestamp = null)
-{
+function serendipity_purgeEntry($id, $timestamp = null) {
global $serendipity;
// If pregenerate is not set, short circuit all this logic
@@ -1762,8 +1759,7 @@
/**
* validate trackback response
*/
-function serendipity_trackback_is_success($resp)
-{
+function serendipity_trackback_is_success($resp) {
if (preg_match('@<error>(\d+)</error>@', $resp, $matches)) {
if ((int) $matches[1] === 0) {
return true;
@@ -1847,8 +1843,7 @@
return $res;
}
-function serendipity_trackback_autodiscover($res, $loc, $url, $author, $title, $text)
-{
+function serendipity_trackback_autodiscover($res, $loc, $url, $author, $title, $text) {
if (!preg_match('@trackback:ping(\s*rdf:resource)?\s*=\s*"(http:[^"]+)"@i', $res, $matches)) {
echo '<div>• ' . sprintf(TRACKBACK_FAILED, TRACKBACK_NOT_FOUND) . '</div>';
return false;
@@ -1942,8 +1937,7 @@
/**
*
*/
-function add_trackback ($id, $title, $url, $name, $excerpt)
-{
+function add_trackback ($id, $title, $url, $name, $excerpt) {
global $serendipity;
// We can't accept a trackback if we don't get any URL
@@ -1967,8 +1961,7 @@
return 1;
}
-function add_pingback ($id, $postdata)
-{
+function add_pingback ($id, $postdata) {
global $serendipity;
if(preg_match('@<methodcall>\s*<methodName>\s*pingback.ping\s*</methodName>\s*<params>\s*<param>\s*<value>\s*<string>([^<])*</string>\s*</value>\s*</param>\s*<param>\s*<value>\s*<string>([^<])*</string>\s*</value>\s*</param>\s*</params>\s*</methodCall>@i', $postdata, $matches)) {
@@ -1988,13 +1981,11 @@
/**
* Cut text
*/
-function serendipity_trackback_excerpt($text)
-{
+function serendipity_trackback_excerpt($text) {
return substr(strip_tags($text), 0, 255);
}
-function report_trackback_success ()
-{
+function report_trackback_success () {
print '<?xml version="1.0" encoding="iso-8859-1"?>' . "\n";
print <<<SUCCESS
<response>
@@ -2003,8 +1994,7 @@
SUCCESS;
}
-function report_trackback_failure ()
-{
+function report_trackback_failure () {
print '<?xml version="1.0" encoding="iso-8859-1"?>' . "\n";
print <<<FAILURE
<response>
@@ -2014,8 +2004,7 @@
FAILURE;
}
-function report_pingback_success ()
-{
+function report_pingback_success () {
print '<?xml version="1.0"?>' . "\n";
print <<<SUCCESS
<methodResponse>
@@ -2028,8 +2017,7 @@
SUCCESS;
}
-function report_pingback_failure ()
-{
+function report_pingback_failure () {
print '<?xml version="1.0"?>' . "\n";
print <<<FAILURE
<methodResponse>
@@ -2061,8 +2049,7 @@
/**
* search through link body, and automatically send a trackback ping.
*/
-function serendipity_handle_references($id, $author, $title, $text)
-{
+function serendipity_handle_references($id, $author, $title, $text) {
global $serendipity;
if (!preg_match_all('@<a[^>]+?href\s*=\s*["\']?([^\'" >]+?)[ \'"][^>]*>([^<]*)</a>@i', $text, $matches)) {
@@ -2943,8 +2930,7 @@
echo "</span>";
}
-function serendipity_emit_htmlarea_code($item, $jsname)
-{
+function serendipity_emit_htmlarea_code($item, $jsname) {
static $init = false;
global $serendipity;
@@ -3096,8 +3082,7 @@
serendipity_smarty_fetch('ARCHIVES', 'entries_archives.tpl', true);
}
-function serendipity_xhtml_target($target)
-{
+function serendipity_xhtml_target($target) {
global $serendipity;
if ($serendipity['enablePopup'] != true)
|