Update of /cvsroot/php-blog/serendipity/plugins/serendipity_plugin_shoutbox
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8132
Modified Files:
serendipity_plugin_shoutbox.php
Log Message:
Moved table creation to a more reasonable place
Index: serendipity_plugin_shoutbox.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_plugin_shoutbox/serendipity_plugin_shoutbox.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- serendipity_plugin_shoutbox.php 16 Mar 2004 08:59:37 -0000 1.1
+++ serendipity_plugin_shoutbox.php 16 Mar 2004 09:06:55 -0000 1.2
@@ -44,17 +44,6 @@
'max_entries',
'language',
'dateformat'));
-
- if ($this->get_config('version') != '1.0') {
- $q = "CREATE TABLE {$serendipity['dbPrefix']}shoutbox (
- id {AUTOINCREMENT} {PRIMARY},
- timestamp int(10) {UNSIGNED} NULL,
- ip varchar(15) default NULL,
- body text
- )";
- $sql = serendipity_db_schema_import($q);
- $this->set_config('version', '1.0');
- }
}
function introspect_config_item($name, &$propbag)
@@ -109,6 +98,19 @@
//Put new shout into the database if necessary
if ($_REQUEST['action'] == 'fillshoutbox' && $_REQUEST['serendipity']['shouttext'] != '') {
+
+ // Create table, if not yet existant
+ if ($this->get_config('version') != '1.0') {
+ $q = "CREATE TABLE {$serendipity['dbPrefix']}shoutbox (
+ id {AUTOINCREMENT} {PRIMARY},
+ timestamp int(10) {UNSIGNED} NULL,
+ ip varchar(15) default NULL,
+ body text
+ )";
+ $sql = serendipity_db_schema_import($q);
+ $this->set_config('version', '1.0');
+ }
+
$sql = sprintf(
"INSERT INTO %sshoutbox (
timestamp,
|