Update of /cvsroot/php-blog/serendipity/plugins/serendipity_plugin_shoutbox
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3231/plugins/serendipity_plugin_shoutbox
Modified Files:
serendipity_plugin_shoutbox.php
Log Message:
* fix bad LIMIT operator
* check for table in right spot
Index: serendipity_plugin_shoutbox.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_plugin_shoutbox/serendipity_plugin_shoutbox.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- serendipity_plugin_shoutbox.php 6 Dec 2004 12:45:49 -0000 1.17
+++ serendipity_plugin_shoutbox.php 2 Jan 2005 16:09:49 -0000 1.18
@@ -100,21 +100,21 @@
$wordwrap = $this->get_config('wordwrap');
$dateformat = $this->get_config('dateformat');
+ // 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');
+ }
+
//Put new shout into the database if necessary
if (!empty($_REQUEST['action']) && $_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,
@@ -135,8 +135,7 @@
if (!empty($serendipity['GET']['action']) && $serendipity['GET']['action'] == 'shoutboxdelete'
&& $_SESSION['serendipityAuthedUser'] === true) {
$sql = sprintf("DELETE from %sshoutbox
- WHERE id = %d
- LIMIT 1",
+ WHERE id = %d",
$serendipity['dbPrefix'],
(int)$serendipity['GET']['comment_id']);
serendipity_db_query($sql);
|