Code Duplication    Length = 3-26 lines in 2 locations

include/oninstall.php 1 location

@@ 170-172 (lines=3) @@
167
            }
168
        }
169
170
        if (!$GLOBALS['xoopsDB']->queryF("INSERT INTO {$GLOBALS['xoopsDB']->prefix('apcal_'.$tablename)}($fields) VALUES ({$values})")) {
171
            $errors .= '&nbsp;&nbsp;' . $row['id'] . ' => ' . $GLOBALS['xoopsDB']->error() . '<br>';
172
        }
173
    }
174
175
    return $errors;

include/onupdate.inc.php 1 location

@@ 43-68 (lines=26) @@
40
41
    // 0.76 to 0.8
42
    $result = $GLOBALS['xoopsDB']->query('SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix("apcal{$mydirnumber}_plugins") . ' LIMIT 1');
43
    if (!$result) {
44
        $GLOBALS['xoopsDB']->queryF('ALTER TABLE '
45
                                    . $GLOBALS['xoopsDB']->prefix("apcal{$mydirnumber}_cat")
46
                                    . " CHANGE cat_extkey1 cat_depth TINYINT UNSIGNED NOT NULL DEFAULT 0, ADD cat_style VARCHAR(255) NOT NULL DEFAULT '', ADD KEY (pid), ADD KEY (weight), ADD KEY (cat_depth)");
47
48
        $GLOBALS['xoopsDB']->queryF('CREATE TABLE ' . $GLOBALS['xoopsDB']->prefix("apcal{$mydirnumber}_plugins") . " (
49
          pi_id SMALLINT(5) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT,
50
          pi_title VARCHAR(255) NOT NULL DEFAULT '',
51
          pi_type VARCHAR(8) NOT NULL DEFAULT '',
52
          pi_dirname VARCHAR(50) NOT NULL DEFAULT '',
53
          pi_file VARCHAR(50) NOT NULL DEFAULT '',
54
          pi_dotgif VARCHAR(255) NOT NULL DEFAULT '',
55
          pi_options VARCHAR(255) NOT NULL DEFAULT '',
56
          pi_enabled TINYINT NOT NULL DEFAULT 0,
57
          pi_weight SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0,
58
          last_modified TIMESTAMP ,
59
60
          KEY (pi_weight),
61
          KEY (pi_type),
62
          KEY (pi_dirname),
63
          KEY (pi_file),
64
          KEY (pi_options),
65
          KEY (pi_enabled),
66
          PRIMARY KEY (pi_id)
67
        ) ENGINE=MyISAM ");
68
    }
69
    // DROP TABLE xoops_apcal_plugins ;
70
71
    // 0.8RC to 0.8RC2