Zeile 354 | Zeile 354 |
---|
{ global $db;
|
{ global $db;
|
// Create our entries table
| // Create our table collation
|
$collation = $db->build_create_table_collation();
|
$collation = $db->build_create_table_collation();
|
// create table if it doesn't exist already
| // Create table if it doesn't exist already
|
if(!$db->table_exists('hello_messages')) {
|
if(!$db->table_exists('hello_messages')) {
|
$db->write_query("CREATE TABLE `".TABLE_PREFIX."hello_messages` ( `mid` int(10) UNSIGNED NOT NULL auto_increment, `message` varchar(100) NOT NULL default '', PRIMARY KEY (`mid`) ) ENGINE=MyISAM{$collation}");
| switch($db->type) { case "pgsql": $db->write_query("CREATE TABLE ".TABLE_PREFIX."hello_messages ( mid serial, message varchar(100) NOT NULL default '', PRIMARY KEY (mid) );"); break; case "sqlite": $db->write_query("CREATE TABLE ".TABLE_PREFIX."hello_messages ( mid INTEGER PRIMARY KEY, message varchar(100) NOT NULL default '' );"); break; default: $db->write_query("CREATE TABLE ".TABLE_PREFIX."hello_messages ( mid int unsigned NOT NULL auto_increment, message varchar(100) NOT NULL default '', PRIMARY KEY (mid) ) ENGINE=MyISAM{$collation};"); break; }
|
} }
| } }
|
Zeile 399 | Zeile 417 |
---|
$page->output_confirm_action('index.php?module=config-plugins&action=deactivate&uninstall=1&plugin=hello', $lang->hello_uninstall_message, $lang->hello_uninstall); }
|
$page->output_confirm_action('index.php?module=config-plugins&action=deactivate&uninstall=1&plugin=hello', $lang->hello_uninstall_message, $lang->hello_uninstall); }
|
// remove our templates group // Query the template groups $query = $db->simple_select('templategroups', 'prefix', "prefix='hello'");
| // Delete template groups. $db->delete_query('templategroups', "prefix='hello'");
|
|
|
// Build where string for templates $sqlwhere = array();
| // Delete templates belonging to template groups. $db->delete_query('templates', "title='hello' OR title LIKE 'hello_%'");
|
|
|
while($prefix = $db->fetch_field($query, 'prefix')) { $tprefix = $db->escape_string($prefix); $sqlwhere[] = "title='{$tprefix}' OR title LIKE '{$tprefix}=_%' ESCAPE '='"; }
if($sqlwhere) // else there are no groups to delete { // Delete template groups. $db->delete_query('templategroups', "prefix='hello'");
// Delete templates belonging to template groups. $db->delete_query('templates', implode(' OR ', $sqlwhere)); }
// delete settings group
| // Delete settings group
|
$db->delete_query('settinggroups', "name='hello'");
|
$db->delete_query('settinggroups', "name='hello'");
|
// remove settings
| // Remove the settings
|
$db->delete_query('settings', "name IN ('hello_display1','hello_display2')");
// This is required so it updates the settings.php file as well and not only the database - they must be synchronized! rebuild_settings();
|
$db->delete_query('settings', "name IN ('hello_display1','hello_display2')");
// This is required so it updates the settings.php file as well and not only the database - they must be synchronized! rebuild_settings();
|
// drop tables if desired
| // Drop tables if desired
|
if(!isset($mybb->input['no'])) { $db->drop_table('hello_messages');
| if(!isset($mybb->input['no'])) { $db->drop_table('hello_messages');
|