Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1:/tmp/cvs-serv19447
Modified Files:
db.sql db_update-0.2-0.3.sql
serendipity_admin_installer.inc.php
serendipity_db_mysql.inc.php serendipity_db_postgres.inc.php
serendipity_functions.inc.php serendipity_lang_de.inc.php
serendipity_lang_en.inc.php serendipity_sidebar_items.php
Log Message:
db.sql, db_update-*: Modified the trackback stuff so that it works with postgresql. Added comments in the update on how to create the changes.
serendipity_admin_installer.inc.php: Made the installer more verbose, i.e. warning that a query error is normal.
serendipity_db_mysql.inc.php: Change for the db update. enum() is unsupported under postgres, but boolean is.
serendipity_db_postgres.inc.php: ditto
serendipity_funcitons.inc.php: fixed b0rk3n SQL query and return an error if entries can't be saved for any reason.
serendipity_lang_en/de.inc.php: added constants for the more verbose installer. Please translate to German!
serendipity_sidebar_items.php: fix error when no categories are defined.
Index: db.sql
===================================================================
RCS file: /cvsroot/php-blog/serendipity/db.sql,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- db.sql 31 Aug 2003 21:41:49 -0000 1.22
+++ db.sql 20 Sep 2003 03:43:56 -0000 1.23
@@ -26,7 +26,7 @@
ip varchar(15) default null,
body text,
type varchar(100) default 'regular',
- subscribed enum('true', 'false') not null default 'false'
+ subscribed {BOOLEAN}
);
CREATE {FULLTEXT} INDEX body on {PREFIX}comments (body);
@@ -47,7 +47,7 @@
author varchar(20) default null,
authorid int(11) default null,
categoryid int(11) default null,
- isdraft enum('true', 'false') not null default 'false'
+ isdraft {BOOLEAN}
);
CREATE {FULLTEXT} INDEX entry on {PREFIX}entries (title,body,extended);
Index: db_update-0.2-0.3.sql
===================================================================
RCS file: /cvsroot/php-blog/serendipity/db_update-0.2-0.3.sql,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- db_update-0.2-0.3.sql 8 Sep 2003 21:29:27 -0000 1.2
+++ db_update-0.2-0.3.sql 20 Sep 2003 03:43:56 -0000 1.3
@@ -1,8 +1,12 @@
ALTER TABLE serendipity_entries ADD COLUMN trackbacks INT(4) DEFAULT 0 AFTER 'comments';
ALTER TABLE serendipity_entries ADD COLUMN isdraft ENUM('true', 'false') NOT NULL DEFAULT 'false' AFTER 'categoryid';
+/* ENUM('true', 'false') NOT NULL DEFAULT 'false'
+ should be replaced by BOOLEAN NOT NULL for postgresql */
ALTER TABLE serendipity_comments ADD COLUMN subscribed ENUM('true', 'false') NOT NULL DEFAULT 'false' AFTER 'type';
+/* ENUM('true', 'false') NOT NULL DEFAULT 'false'
+ should be replaced by BOOLEAN NOT NULL for postgresql */
INSERT INTO serendipity_config (name, value) VALUES ('allowSubscriptions', 'false');
Index: serendipity_admin_installer.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_installer.inc.php,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- serendipity_admin_installer.inc.php 18 Sep 2003 16:35:26 -0000 1.41
+++ serendipity_admin_installer.inc.php 20 Sep 2003 03:43:56 -0000 1.42
@@ -293,12 +293,14 @@
/* Try and check if the database/tables are already installed,
if they are... exit the function */
+ echo CHECK_DATABASE_EXISTS;
$t = serendipity_db_query("SELECT * FROM {$_POST['dbPrefix']}authors");
+ echo ' ' . DONE . '<br />';
if (is_array($t)) {
return false;
}
-
+ echo CREATE_DATABASE;
// Create tables
$queries = serendipity_parse_sql_tables('./db.sql');
$queries = str_replace('{PREFIX}', $_POST['dbPrefix'], $queries);
@@ -312,6 +314,7 @@
} else {
$mail_comments = 0;
}
+ echo ' ' . DONE . '<br />';
/*
------------- Install main author ------------
@@ -430,10 +433,10 @@
echo '<br />';
/* We are good to go, lets install databases etc. */
- echo ATTEMPT_SETUP_DATABASE;
+ echo ATTEMPT_SETUP_DATABASE . "<br />";
$res = serendipity_installDatabase();
if ( $res !== false ) {
- echo ' ' . DONE . '<br />';
+ echo ' ' . DATABASE_DONE . '<br />';
} else {
echo '<span style="color: #FF0000">- ' . DATABASE_ALREADY_INSTALLED . '</span><br />';
}
Index: serendipity_db_mysql.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_db_mysql.inc.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- serendipity_db_mysql.inc.php 18 Sep 2003 12:58:14 -0000 1.14
+++ serendipity_db_mysql.inc.php 20 Sep 2003 03:43:56 -0000 1.15
@@ -97,10 +97,10 @@
function serendipity_db_schema_import($query)
{
- static $search = array('{AUTOINCREMENT}', '{PRIMARY}',
- '{UNSIGNED}', '{FULLTEXT}');
+ static $search = array('{AUTOINCREMENT}', '{PRIMARY}',
+ '{UNSIGNED}', '{FULLTEXT}', '{BOOLEAN}');
static $replace = array('int(11) not null auto_increment', 'primary key',
- 'unsigned' , 'FULLTEXT');
+ 'unsigned' , 'FULLTEXT', 'enum (\'true\', \'false\') NOT NULL default \'true\'');
return serendipity_db_query(str_replace($search, $replace, $query));
}
Index: serendipity_db_postgres.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_db_postgres.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- serendipity_db_postgres.inc.php 25 Jul 2003 01:03:18 -0000 1.7
+++ serendipity_db_postgres.inc.php 20 Sep 2003 03:43:56 -0000 1.8
@@ -92,8 +92,8 @@
function serendipity_db_schema_import($query)
{
static $search = array('{AUTOINCREMENT}', '{PRIMARY}', '{UNSIGNED}',
- '{FULLTEXT}', 'int(1)', 'int(10)', 'int(11)', 'int(4)');
- static $replace = array('SERIAL', 'primary key', '', '', 'int2',
+ '{FULLTEXT}', '{BOOLEAN}', 'int(1)', 'int(10)', 'int(11)', 'int(4)');
+ static $replace = array('SERIAL', 'primary key', '', '', 'BOOLEAN NOT NULL', 'int2',
'int4', 'int4', 'int4');
return serendipity_db_query(str_replace($search, $replace, $query));
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.153
retrieving revision 1.154
diff -u -d -r1.153 -r1.154
--- serendipity_functions.inc.php 18 Sep 2003 14:20:57 -0000 1.153
+++ serendipity_functions.inc.php 20 Sep 2003 03:43:56 -0000 1.154
@@ -424,7 +424,7 @@
}
if ($fetchDrafts == 'false') {
- $drafts = 'isdraft LIKE "false"';
+ $drafts = "isdraft = 'false'";
}
if (is_numeric($range)) {
@@ -1673,7 +1673,12 @@
$res = serendipity_db_insert('entries', $entry);
- $entry['id'] = serendipity_db_insert_id();
+ if ($res)
+ $entry['id'] = serendipity_db_insert_id();
+ else {
+ //Some error message here
+ return ENTRIES_NOT_SUCCESSFULLY_INSERTED;
+ }
$newEntry = 1;
} else {
/* we need to update */
Index: serendipity_lang_de.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_lang_de.inc.php,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- serendipity_lang_de.inc.php 18 Sep 2003 12:58:26 -0000 1.30
+++ serendipity_lang_de.inc.php 20 Sep 2003 03:43:56 -0000 1.31
@@ -20,6 +20,7 @@
$serendipity['weekDayAbb'] = array('Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa', 'So');
}
+
@define('SERENDIPITY_ADMIN_SUITE', 'Serendipity Verwaltungsoberfläche');
@define('HAVE_TO_BE_LOGGED_ON', 'Sie müssen angemeldet sein, um diese Seite zu sehen:');
@define('APPEARANCE', 'Aussehen');
@@ -221,6 +222,9 @@
@define('INCLUDE_ERROR', 'serendipity Fehler: Kann Datei %s nicht einbinden - wird beendet.');
@define('DATABASE_ERROR', 'serendipity Fehler: Kann keine Verbindung zur Datenbank herstellen - wird beendet.');
@define('ATTEMPT_SETUP_DATABASE', 'Probiere Datenbank einzurichten...');
+@define('CHECK_DATABASE_EXISTS', 'Checking to see if the database is already in place. If you see a database query error here, ignore it...');
+@define('CREATE_DATABASE', 'Creating default database setup...');
+@define('DATABASE_DONE', 'Done creating database');
@define('ATTEMPT_WRITE_FILE', 'Probiere die Datei %s zu erstellen...');
@define('SERENDIPITY_INSTALLED', '%sSerendipity wurde erfolgreich aufh Ihrem System eingerichtet.%s Bitte merken Sie sich Ihr Passwort: "%s", Ihr Benutzername ist "%s".%sSie können Ihr neues PHP blog <a href="%s">genau hier</a> finden');
@define('WRITTEN_N_SAVED', 'Konfiguration geschrieben und gesichert');
Index: serendipity_lang_en.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_lang_en.inc.php,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- serendipity_lang_en.inc.php 18 Sep 2003 12:58:26 -0000 1.39
+++ serendipity_lang_en.inc.php 20 Sep 2003 03:43:56 -0000 1.40
@@ -222,6 +222,9 @@
@define('INCLUDE_ERROR', 'serendipity error: could not include %s - exiting.');
@define('DATABASE_ERROR', 'serendipity error: unable to connect to database - exiting.');
@define('ATTEMPT_SETUP_DATABASE', 'Attemping to setup database...');
+@define('CHECK_DATABASE_EXISTS', 'Checking to see if the database is already in place. If you see a database query error here, ignore it...');
+@define('CREATE_DATABASE', 'Creating default database setup...');
+@define('DATABASE_DONE', 'Done creating database');
@define('ATTEMPT_WRITE_FILE', 'Attemping to write %s file...');
@define('SERENDIPITY_INSTALLED', '%sSerendipity was successfully installed on your system.%s Please remember your password: "%s", your username is "%s".%sYou can find your new PHP blog <a href="%s">right here</a>');
@define('WRITTEN_N_SAVED', 'Configuration written & saved');
Index: serendipity_sidebar_items.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_sidebar_items.php,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- serendipity_sidebar_items.php 18 Sep 2003 12:58:52 -0000 1.29
+++ serendipity_sidebar_items.php 20 Sep 2003 03:43:56 -0000 1.30
@@ -361,7 +361,7 @@
$title = CATEGORIES;
$html = '';
- if (is_array($categories)) {
+ if (is_array($categories) && count($categories)) {
foreach ($categories as $category) {
$category_id = serendipity_makeFilename($category['category_name']);
|