habe mal eine frage ich habe mir den download mod installiert und will ihn nun wider deinstallieren wie bekomme ich die db einträge wider weg
hir mal die install.php dort soll alles drinne stehen kann aber leider damit nix anfangen wie ich diese zum deinstallieren verwenden kann
Code: Alles auswählen
<?php
/**
*
* @author oxpus (Karsten Ude) webmaster@oxpus.net
* @package download mod installation package based on umil (c) 2008 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
if (!defined('DL_CONFIG_TABLE') || !@file_exists($phpbb_root_path . 'dl_mod/classes/class_dlmod.' . $phpEx))
{
trigger_error('Please install at first the MOD itself before you run the database installer!<br /><br />Bitte zunächst die MOD selber installieren, bevor der Datenbank Installer gestartet wird!', E_USER_WARNING);
}
$user->add_lang('mods/dl_install');
if (!file_exists($phpbb_root_path . 'umil/umil.' . $phpEx))
{
trigger_error('Please download the latest UMIL (Unified MOD Install Library) from: <a href="http://www.phpbb.com/mods/umil/">phpBB.com/mods/umil</a>', E_USER_ERROR);
}
// We only allow a founder install this MOD
if ($user->data['user_type'] != USER_FOUNDER)
{
login_box('', 'LOGIN');
}
if (!class_exists('umil'))
{
include($phpbb_root_path . 'umil/umil.' . $phpEx);
}
// If you want a completely stand alone version (able to use UMIL without messing with any of the language stuff) send true, otherwise send false
$umil = new umil(true);
$download_version = dl_config_exists('dl_mod_version', true);
$new_version = '6.2.19';
if (confirm_box(true))
{
if (isset($download_version) && $download_version != '')
{
switch ($download_version)
{
case '5.0.0':
case '5.0.1':
case '5.0.2':
case '5.0.3':
case '5.0.4':
case '5.0.5':
dl_config_update('show_footer_legend', '1');
dl_config_update('show_footer_stat', '1');
dl_config_update('limit_desc_on_index', '0');
case '5.0.6':
case '5.0.7':
case '5.0.8':
case '5.0.9':
dl_config_update('use_ext_blacklist', '1');
$umil->table_add(DL_EXT_BLACKLIST, array(
'COLUMNS' => array(
'extention' => array('CHAR:10', ''),
)));
$sql = array();
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'asp'));
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'cgi'));
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'dhtm'));
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'dhtml'));
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'exe'));
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'htm'));
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'html'));
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'jar'));
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'js'));
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'php'));
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'php3'));
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'pl'));
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'sh'));
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'shtm'));
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'shtml'));
$db->return_on_error = true;
for ($i = 0; $i < sizeof($sql); $i++)
{
$db->sql_query($sql[$i]);
}
$db->return_on_error = false;
unset($sql);
case '5.0.10':
case '5.0.11':
dl_config_update('disable_popup_notify', '0');
case '5.0.12':
dl_config_update('show_real_filetime', '1');
case '5.0.13':
case '5.0.14':
$umil->table_add(DL_BANLIST_TABLE, array(
'COLUMNS' => array(
'ban_id' => array('UINT:11', NULL, 'auto_increment'),
'user_id' => array('UINT', 0),
'user_ip' => array('VCHAR:40', ''),
'user_agent' => array('VCHAR:50', ''),
'username' => array('VCHAR:25', ''),
'guests' => array('BOOL', 0),
),
'PRIMARY_KEY' => 'ban_id'
));
$umil->table_add(DL_FAVORITES_TABLE, array(
'COLUMNS' => array(
'fav_id' => array('UINT:11', NULL, 'auto_increment'),
'fav_dl_id' => array('INT:11', 0),
'fav_dl_cat' => array('INT:11', 0),
'fav_user_id' => array('UINT', 0),
),
'PRIMARY_KEY' => 'fav_id'
));
$umil->table_column_add(DOWNLOADS_TABLE, 'broken', array('BOOL', 0));
dl_config_update('guest_report_broken', '1');
$sql = 'INSERT INTO ' . DL_BANLIST_TABLE . ' ' . $db->sql_build_array('INSERT', array('user_agent' => 'n/a'));
$db->sql_query($sql);
case '5.0.15':
$umil->table_add(DL_NOTRAF_TABLE, array(
'COLUMNS' => array(
'user_id' => array('UINT', 0),
'dl_id' => array('INT:11', 0),
)));
dl_config_update('user_traffic_once', '0');
case '5.0.16':
$umil->table_add(DL_HOTLINK_TABLE, array(
'COLUMNS' => array(
'user_id' => array('UINT', 0),
'session_id' => array('VCHAR:32', ''),
'hotlink_id' => array('VCHAR:32', ''),
'code' => array('CHAR:5', ''),
)));
$umil->table_column_add(USERS_TABLE, 'user_allow_fav_download_email', array('BOOL', 1));
$umil->table_column_add(USERS_TABLE, 'user_allow_fav_download_popup', array('BOOL', 1));
dl_config_update('prevent_hotlink', '1');
dl_config_update('hotlink_action', '1');
case '5.0.17':
$umil->table_column_update(DOWNLOADS_TABLE, 'todo', array('MTEXT_UNI', ''));
$umil->table_column_add(DL_CAT_TABLE, 'rules', array('MTEXT_UNI', ''));
$sql = 'UPDATE ' . DL_CONFIG_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array(
'config_name' => 'report_broken')) . " WHERE config_name = 'guest_report_broken'";
$db->sql_query($sql);
dl_config_update('report_broken_lock', '1');
dl_config_update('report_broken_message', '1');
dl_config_update('report_broken_vc', '1');
dl_config_update('download_vc', '1');
dl_config_update('edit_own_downloads', '1');
dl_config_update('shorten_extern_links', '10');
case '5.1.0':
dl_config_update('icon_free_for_reg', '0');
case '5.1.1':
case '5.1.2':
dl_config_update('latest_comments', '1');
case '5.1.3':
$umil->table_column_add(USERS_TABLE, 'user_dl_note_type', array('BOOL', 1));
$umil->table_column_add(USERS_TABLE, 'user_dl_sort_fix', array('BOOL', 0));
$umil->table_column_add(USERS_TABLE, 'user_dl_sort_opt', array('BOOL', 0));
$umil->table_column_add(USERS_TABLE, 'user_dl_sort_dir', array('BOOL', 0));
dl_config_update('sort_preform', '0');
case '5.1.4':
case '5.1.5':
$umil->table_column_add(DL_CAT_TABLE, 'bug_tracker', array('BOOL', 0));
$umil->table_add(DL_BUGS_TABLE, array(
'COLUMNS' => array(
'report_id' => array('UINT:11', NULL, 'auto_increment'),
'df_id' => array('INT:11', 0),
'report_title' => array('VCHAR', ''),
'report_text' => array('MTEXT_UNI', ''),
'report_file_ver' => array('VCHAR:50', ''),
'report_date' => array('TIMESTAMP', 0),
'report_author_id' => array('UINT', 0),
'report_assign_id' => array('UINT', 0),
'report_assign_date' => array('TIMESTAMP', 0),
'report_status' => array('BOOL', 0),
'report_status_date' => array('TIMESTAMP', 0),
'report_php' => array('VCHAR:50', ''),
'report_db' => array('VCHAR:50', ''),
'report_forum' => array('VCHAR:50', ''),
'bug_uid' => array('CHAR:8', ''),
'bug_bitfield' => array('VCHAR', ''),
'bug_flags' => array('UINT:11', 0),
),
'PRIMARY_KEY' => 'report_id'
));
$umil->table_add(DL_BUG_HISTORY_TABLE, array(
'COLUMNS' => array(
'report_his_id' => array('UINT:11', NULL, 'auto_increment'),
'df_id' => array('INT:11', 0),
'report_id' => array('INT:11', 0),
'report_his_type' => array('CHAR:10', ''),
'report_his_date' => array('TIMESTAMP', 0),
'report_his_value' => array('VCHAR', ''),
),
'PRIMARY_KEY' => 'report_his_id'
));
case '5.2.0':
case '5.2.1':
case '5.2.2':
case '5.3.0':
case '5.3.1':
$umil->table_column_add(USERS_TABLE, 'user_dl_sub_on_index', array('BOOL', 1));
dl_config_update('drop_traffic_postdel', '0');
$old_update = true;
case '5.3.2':
case '6.0.0 RC1':
case '6.0.0 RC2':
case '6.0.0 RC3':
case '6.0.0 RC4':
case '6.0.0':
case '6.0.1':
case '6.0.2':
case '6.0.3':
case '6.0.4':
case '6.0.5':
case '6.0.6':
case '6.0.7':
case '6.0.8':
case '6.0.9':
case '6.0.10':
case '6.0.11':
case '6.0.12':
case '6.0.13':
case '6.0.14':
dl_config_update('enable_dl_topic', '0');
dl_config_update('dl_topic_forum', '');
dl_config_update('dl_topic_text', '');
$umil->table_column_add(DOWNLOADS_TABLE, 'dl_topic', array('UINT:11', 0));
case '6.1.0':
case '6.1.1':
case '6.1.2':
dl_config_update('overall_guest_traffic', '0');
dl_config_update('remain_guest_traffic', '0');
$umil->table_column_update(DL_STATS_TABLE, 'user_ip', array('VCHAR:40', ''));
if (!$umil->module_exists('acp', false, 'ACP_CAT_DOT_MODS'))
{
$umil->module_add('acp', 0, 'ACP_CAT_DOT_MODS');
}
else
{
$sql_m = "UPDATE " . MODULES_TABLE . " SET " . $db->sql_build_array('UPDATE', array(
'module_enabled' => 1,
'module_display' => 1)) . " WHERE module_langname = 'ACP_CAT_DOT_MODS'
AND module_class = 'acp'";
$db->sql_query($sql_m);
}
$umil->module_add('acp', 'ACP_CAT_DOT_MODS', 'DOWNLOADS');
$umil->module_add('acp', 'DOWNLOADS', array(
'module_basename' => 'downloads',
'module_langname'=> 'ACP_USER_OVERVIEW',
'module_mode' => 'overview',
'module_auth' => 'acl_a_dl_overview'));
$umil->module_add('acp', 'DOWNLOADS', array(
'module_basename' => 'downloads',
'module_langname'=> 'DL_ACP_CONFIG_MANAGEMENT',
'module_mode' => 'config',
'module_auth' => 'acl_a_dl_config'));
$umil->module_add('acp', 'DOWNLOADS', array(
'module_basename' => 'downloads',
'module_langname'=> 'DL_ACP_TRAFFIC_MANAGEMENT',
'module_mode' => 'traffic',
'module_auth' => 'acl_a_dl_traffic'));
$umil->module_add('acp', 'DOWNLOADS', array(
'module_basename' => 'downloads',
'module_langname'=> 'DL_ACP_CATEGORIES_MANAGEMENT',
'module_mode' => 'categories',
'module_auth' => 'acl_a_dl_categories'));
$umil->module_add('acp', 'DOWNLOADS', array(
'module_basename' => 'downloads',
'module_langname'=> 'DL_ACP_FILES_MANAGEMENT',
'module_mode' => 'files',
'module_auth' => 'acl_a_dl_files'));
$umil->module_add('acp', 'DOWNLOADS', array(
'module_basename' => 'downloads',
'module_langname'=> 'DL_ACP_PERMISSIONS',
'module_mode' => 'permissions',
'module_auth' => 'acl_a_dl_permissions'));
$umil->module_add('acp', 'DOWNLOADS', array(
'module_basename' => 'downloads',
'module_langname'=> 'DL_ACP_STATS_MANAGEMENT',
'module_mode' => 'stats',
'module_auth' => 'acl_a_dl_stats'));
$umil->module_add('acp', 'DOWNLOADS', array(
'module_basename' => 'downloads',
'module_langname'=> 'DL_ACP_BANLIST',
'module_mode' => 'banlist',
'module_auth' => 'acl_a_dl_banlist'));
$umil->module_add('acp', 'DOWNLOADS', array(
'module_basename' => 'downloads',
'module_langname'=> 'DL_EXT_BLACKLIST',
'module_mode' => 'ext_blacklist',
'module_auth' => 'acl_a_dl_blacklist'));
$umil->module_add('acp', 'DOWNLOADS', array(
'module_basename' => 'downloads',
'module_langname'=> 'DL_MANAGE',
'module_mode' => 'toolbox',
'module_auth' => 'acl_a_dl_toolbox'));
$umil->permission_add('a_dl_overview', true);
$umil->permission_add('a_dl_config', true);
$umil->permission_add('a_dl_traffic', true);
$umil->permission_add('a_dl_categories', true);
$umil->permission_add('a_dl_files', true);
$umil->permission_add('a_dl_permissions', true);
$umil->permission_add('a_dl_stats', true);
$umil->permission_add('a_dl_banlist', true);
$umil->permission_add('a_dl_blacklist', true);
$umil->permission_add('a_dl_toolbox', true);
$umil->permission_set('ADMINISTRATORS', 'a_dl_overview', 'group');
$umil->permission_set('ADMINISTRATORS', 'a_dl_config', 'group');
$umil->permission_set('ADMINISTRATORS', 'a_dl_traffic', 'group');
$umil->permission_set('ADMINISTRATORS', 'a_dl_categories', 'group');
$umil->permission_set('ADMINISTRATORS', 'a_dl_files', 'group');
$umil->permission_set('ADMINISTRATORS', 'a_dl_permissions', 'group');
$umil->permission_set('ADMINISTRATORS', 'a_dl_stats', 'group');
$umil->permission_set('ADMINISTRATORS', 'a_dl_banlist', 'group');
$umil->permission_set('ADMINISTRATORS', 'a_dl_blacklist', 'group');
$umil->permission_set('ADMINISTRATORS', 'a_dl_toolbox', 'group');
function decode_ip($int_ip)
{
$hexipbang = explode('.', chunk_split($int_ip, 2, '.'));
return hexdec($hexipbang[0]). '.' . hexdec($hexipbang[1]) . '.' . hexdec($hexipbang[2]) . '.' . hexdec($hexipbang[3]);
}
$sql = 'SELECT user_ip FROM ' . DL_STATS_TABLE . '
GROUP BY user_ip';
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
$raw_ip = $row['user_ip'];
$user_ip = decode_ip($raw_ip);
$sql = 'UPDATE ' . DL_STATS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array(
'user_ip' => $user_ip)) . " WHERE user_ip = '$raw_ip'";
$db->sql_query($sql);
}
$db->sql_freeresult($result);
case '6.2.0':
case '6.2.1':
case '6.2.2':
case '6.2.3':
case '6.2.4':
$umil->module_add('ucp', false, 'DOWNLOADS');
$umil->module_add('ucp', 'DOWNLOADS', array(
'module_basename' => 'downloads',
'module_langname' => 'DL_CONFIG',
'module_mode' => 'config'));
$umil->module_add('ucp', 'DOWNLOADS', array(
'module_basename' => 'downloads',
'module_langname' => 'DL_FAVORITE',
'module_mode' => 'favorite'));
case '6.2.5':
case '6.2.6':
$umil->table_column_update(DL_BANLIST_TABLE, 'user_ip', array('VCHAR:40', ''));
dl_config_update('ext_new_window', '0');
case '6.2.7':
$umil->table_column_add(DOWNLOADS_TABLE, 'real_file', array('VCHAR', ''));
$sql = 'UPDATE ' . DOWNLOADS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array(
'real_file' => 'file_name')) . ' WHERE extern = 0';
$db->sql_query($sql);
case '6.2.8':
case '6.2.9':
case '6.2.10':
case '6.2.11':
case '6.2.12':
dl_config_update('dl_cap_char_trans', '0');
dl_config_update('dl_cap_back_color', '969696');
dl_config_update('dl_cap_chess', '1');
dl_config_update('dl_cap_lines', '1');
dl_config_update('dl_cap_carree_x', '20');
dl_config_update('dl_cap_carree_y', '20');
dl_config_update('dl_cap_carree_color', 'FFFFFF');
dl_config_update('dl_cap_contrast', '0.8');
dl_config_update('dl_cap_type', 'j');
dl_config_update('dl_cap_jpeg_qual', '75');
case '6.2.13':
case '6.2.14':
case '6.2.15 RC1':
case '6.2.15':
case '6.2.16':
case '6.2.17':
case '6.2.18':
case '6.2.19':
break;
}
if (isset($sql) && sizeof($sql))
{
$db->return_on_error = true;
for ($i = 0; $i < sizeof($sql); $i++)
{
$db->sql_query($sql[$i]);
}
$db->return_on_error = false;
unset($sql);
}
dl_config_update('dl_mod_version', $new_version);
$finish_text = 'DL_UPDATE_FINISHED';
}
else
{
$umil->table_add(DOWNLOADS_TABLE, array(
'COLUMNS' => array(
'id' => array('UINT:11', NULL, 'auto_increment'),
'description' => array('MTEXT_UNI', ''),
'file_name' => array('VCHAR', ''),
'real_file' => array('VCHAR', ''),
'klicks' => array('INT:11', 0),
'free' => array('BOOL', 0),
'extern' => array('BOOL', 0),
'long_desc' => array('MTEXT_UNI', ''),
'sort' => array('INT:11', 0),
'cat' => array('INT:11', 0),
'hacklist' => array('BOOL', 0),
'hack_author' => array('VCHAR', ''),
'hack_author_email' => array('VCHAR', ''),
'hack_author_website' => array('TEXT_UNI', ''),
'hack_version' => array('VCHAR:32', ''),
'hack_dl_url' => array('TEXT_UNI', ''),
'test' => array('VCHAR:50', ''),
'req' => array('MTEXT_UNI', ''),
'todo' => array('MTEXT_UNI', ''),
'warning' => array('MTEXT_UNI', ''),
'mod_desc' => array('MTEXT_UNI', ''),
'mod_list' => array('BOOL', 0),
'file_size' => array('BINT', 0),
'change_time' => array('TIMESTAMP', 0),
'add_time' => array('TIMESTAMP', 0),
'rating' => array('INT:5', 0),
'file_traffic' => array('BINT', 0),
'overall_klicks' => array('INT:11', 0),
'approve' => array('BOOL', 0),
'add_user' => array('UINT', 0),
'change_user' => array('UINT', 0),
'last_time' => array('TIMESTAMP', 0),
'down_user' => array('UINT', 0),
'thumbnail' => array('VCHAR', ''),
'broken' => array('BOOL', 0),
'mod_desc_uid' => array('CHAR:8', ''),
'mod_desc_bitfield' => array('VCHAR', ''),
'mod_desc_flags' => array('UINT:11', 0),
'long_desc_uid' => array('CHAR:8', ''),
'long_desc_bitfield' => array('VCHAR', ''),
'long_desc_flags' => array('UINT:11', 0),
'desc_uid' => array('CHAR:8', ''),
'desc_bitfield' => array('VCHAR', ''),
'desc_flags' => array('UINT:11', 0),
'warn_uid' => array('CHAR:8', ''),
'warn_bitfield' => array('VCHAR', ''),
'warn_flags' => array('UINT:11', 0),
'dl_topic' => array('INT:11', 0),
),
'PRIMARY_KEY' => 'id'
));
$umil->table_add(DL_CAT_TABLE, array(
'COLUMNS' => array(
'id' => array('UINT:11', NULL, 'auto_increment'),
'parent' => array('INT:11', 0),
'path' => array('VCHAR', ''),
'cat_name' => array('VCHAR', ''),
'sort' => array('INT:11', 0),
'description' => array('MTEXT_UNI', ''),
'rules' => array('MTEXT_UNI', ''),
'auth_view' => array('BOOL', 1),
'auth_dl' => array('BOOL', 1),
'auth_up' => array('BOOL', 0),
'auth_mod' => array('BOOL', 0),
'must_approve' => array('BOOL', 0),
'allow_mod_desc' => array('BOOL', 0),
'statistics' => array('BOOL', 1),
'stats_prune' => array('UINT', 0),
'comments' => array('BOOL', 1),
'cat_traffic' => array('BINT', 0),
'cat_traffic_use' => array('BINT', 0),
'allow_thumbs' => array('BOOL', 0),
'auth_cread' => array('BOOL', 0),
'auth_cpost' => array('BOOL', 1),
'approve_comments' => array('BOOL', 1),
'bug_tracker' => array('BOOL', 0),
'desc_uid' => array('CHAR:8', ''),
'desc_bitfield' => array('VCHAR', ''),
'desc_flags' => array('UINT:11', 0),
'rules_uid' => array('CHAR:8', ''),
'rules_bitfield' => array('VCHAR', ''),
'rules_flags' => array('UINT:11', 0),
),
'PRIMARY_KEY' => 'id'
));
$umil->table_add(DL_AUTH_TABLE, array(
'COLUMNS' => array(
'cat_id' => array('INT:11', 0),
'group_id' => array('INT:11', 0),
'auth_view' => array('BOOL', 1),
'auth_dl' => array('BOOL', 1),
'auth_up' => array('BOOL', 1),
'auth_mod' => array('BOOL', 0),
)));
$umil->table_add(DL_COMMENTS_TABLE, array(
'COLUMNS' => array(
'dl_id' => array('BINT', NULL, 'auto_increment'),
'id' => array('INT:11', 0),
'cat_id' => array('INT:11', 0),
'user_id' => array('UINT', 0),
'username' => array('VCHAR:32', ''),
'comment_time' => array('TIMESTAMP', 0),
'comment_edit_time' => array('TIMESTAMP', 0),
'comment_text' => array('MTEXT_UNI', ''),
'approve' => array('BOOL', 0),
'com_uid' => array('CHAR:8', ''),
'com_bitfield' => array('VCHAR', ''),
'com_flags' => array('UINT:11', 0),
),
'PRIMARY_KEY' => 'dl_id'
));
$umil->table_add(DL_RATING_TABLE, array(
'COLUMNS' => array(
'dl_id' => array('INT:11', 0),
'user_id' => array('UINT', 0),
'rate_point' => array('CHAR:10', ''),
)));
$umil->table_add(DL_STATS_TABLE, array(
'COLUMNS' => array(
'dl_id' => array('BINT', NULL, 'auto_increment'),
'id' => array('INT:11', 0),
'cat_id' => array('INT:11', 0),
'user_id' => array('UINT', 0),
'username' => array('VCHAR:32', ''),
'traffic' => array('BINT', 0),
'direction' => array('BOOL', 0),
'user_ip' => array('VCHAR:40', ''),
'browser' => array('VCHAR:20', ''),
'time_stamp' => array('INT:11', 0),
),
'PRIMARY_KEY' => 'dl_id'
));
$umil->table_add(DL_CONFIG_TABLE, array(
'COLUMNS' => array(
'config_name' => array('VCHAR', ''),
'config_value' => array('VCHAR', ''),
),
'PRIMARY_KEY' => 'config_name'
));
$umil->table_add(DL_EXT_BLACKLIST, array(
'COLUMNS' => array(
'extention' => array('CHAR:10', ''),
)));
$umil->table_add(DL_BANLIST_TABLE, array(
'COLUMNS' => array(
'ban_id' => array('UINT:11', NULL, 'auto_increment'),
'user_id' => array('UINT', 0),
'user_ip' => array('VCHAR:40', ''),
'user_agent' => array('VCHAR:50', ''),
'username' => array('VCHAR:25', ''),
'guests' => array('BOOL', 0),
),
'PRIMARY_KEY' => 'ban_id'
));
$umil->table_add(DL_FAVORITES_TABLE, array(
'COLUMNS' => array(
'fav_id' => array('UINT:11', NULL, 'auto_increment'),
'fav_dl_id' => array('INT:11', 0),
'fav_dl_cat' => array('INT:11', 0),
'fav_user_id' => array('UINT', 0),
),
'PRIMARY_KEY' => 'fav_id'
));
$umil->table_add(DL_NOTRAF_TABLE, array(
'COLUMNS' => array(
'user_id' => array('UINT', 0),
'dl_id' => array('INT:11', 0),
)));
$umil->table_add(DL_HOTLINK_TABLE, array(
'COLUMNS' => array(
'user_id' => array('UINT', 0),
'session_id' => array('VCHAR:32', ''),
'hotlink_id' => array('VCHAR:32', ''),
'code' => array('CHAR:5', ''),
)));
$umil->table_add(DL_BUGS_TABLE, array(
'COLUMNS' => array(
'report_id' => array('UINT:11', NULL, 'auto_increment'),
'df_id' => array('INT:11', 0),
'report_title' => array('VCHAR', ''),
'report_text' => array('MTEXT_UNI', ''),
'report_file_ver' => array('VCHAR:50', ''),
'report_date' => array('TIMESTAMP', 0),
'report_author_id' => array('UINT', 0),
'report_assign_id' => array('UINT', 0),
'report_assign_date' => array('TIMESTAMP', 0),
'report_status' => array('BOOL', 0),
'report_status_date' => array('TIMESTAMP', 0),
'report_php' => array('VCHAR:50', ''),
'report_db' => array('VCHAR:50', ''),
'report_forum' => array('VCHAR:50', ''),
'bug_uid' => array('CHAR:8', ''),
'bug_bitfield' => array('VCHAR', ''),
'bug_flags' => array('UINT:11', 0),
),
'PRIMARY_KEY' => 'report_id'
));
$umil->table_add(DL_BUG_HISTORY_TABLE, array(
'COLUMNS' => array(
'report_his_id' => array('UINT:11', NULL, 'auto_increment'),
'df_id' => array('INT:11', 0),
'report_id' => array('INT:11', 0),
'report_his_type' => array('CHAR:10', ''),
'report_his_date' => array('TIMESTAMP', 0),
'report_his_value' => array('VCHAR', ''),
),
'PRIMARY_KEY' => 'report_his_id'
));
dl_config_update('delay_auto_traffic', '30');
dl_config_update('delay_post_traffic', '30');
dl_config_update('disable_email', '1');
dl_config_update('disable_popup', '0');
dl_config_update('disable_popup_notify', '0');
dl_config_update('dl_cap_back_color', '969696');
dl_config_update('dl_cap_carree_color', 'FFFFFF');
dl_config_update('dl_cap_carree_x', '20');
dl_config_update('dl_cap_carree_y', '20');
dl_config_update('dl_cap_char_trans', '0');
dl_config_update('dl_cap_chess', '1');
dl_config_update('dl_cap_contrast', '0.8');
dl_config_update('dl_cap_jpeg_qual', '75');
dl_config_update('dl_cap_lines', '1');
dl_config_update('dl_cap_type', 'j');
dl_config_update('dl_click_reset_time', '0');
dl_config_update('dl_edit_time', '3');
dl_config_update('dl_links_per_page', '10');
dl_config_update('dl_method', '2');
dl_config_update('dl_method_quota', '2097152');
dl_config_update('dl_new_time', '3');
dl_config_update('dl_posts', '25');
dl_config_update('dl_stats_perm', '0');
dl_config_update('dl_topic_forum', '');
dl_config_update('dl_topic_text', '');
dl_config_update('download_dir', 'dl_mod/downloads/');
dl_config_update('download_vc', '1');
dl_config_update('drop_traffic_postdel', '0');
dl_config_update('edit_own_downloads', '1');
dl_config_update('enable_dl_topic', '0');
dl_config_update('enable_post_dl_traffic', '1');
dl_config_update('ext_new_window', '0');
dl_config_update('guest_stats_show', '1');
dl_config_update('hotlink_action', '1');
dl_config_update('icon_free_for_reg', '0');
dl_config_update('latest_comments', '1');
dl_config_update('limit_desc_on_index', '0');
dl_config_update('newtopic_traffic', '524288');
dl_config_update('overall_guest_traffic', '0');
dl_config_update('overall_traffic', '104857600');
dl_config_update('physical_quota', '524288000');
dl_config_update('prevent_hotlink', '1');
dl_config_update('recent_downloads', '10');
dl_config_update('remain_guest_traffic', '0');
dl_config_update('remain_traffic', '0');
dl_config_update('reply_traffic', '262144');
dl_config_update('report_broken', '1');
dl_config_update('report_broken_lock', '1');
dl_config_update('report_broken_message', '1');
dl_config_update('report_broken_vc', '1');
dl_config_update('shorten_extern_links', '10');
dl_config_update('show_footer_legend', '1');
dl_config_update('show_footer_stat', '1');
dl_config_update('show_real_filetime', '1');
dl_config_update('sort_preform', '0');
dl_config_update('stop_uploads', '0');
dl_config_update('thumb_fsize', '0');
dl_config_update('thumb_xsize', '200');
dl_config_update('thumb_ysize', '150');
dl_config_update('traffic_retime', '0');
dl_config_update('upload_traffic_count', '1');
dl_config_update('use_ext_blacklist', '1');
dl_config_update('use_hacklist', '1');
dl_config_update('user_dl_auto_traffic', '0');
dl_config_update('user_traffic_once', '0');
$umil->table_column_add(GROUPS_TABLE, 'group_dl_auto_traffic', array('BINT', 0));
$umil->table_column_add(USERS_TABLE, 'user_allow_new_download_email', array('BOOL', 0));
$umil->table_column_add(USERS_TABLE, 'user_allow_fav_download_email', array('BOOL', 1));
$umil->table_column_add(USERS_TABLE, 'user_allow_new_download_popup', array('BOOL', 1));
$umil->table_column_add(USERS_TABLE, 'user_allow_fav_download_popup', array('BOOL', 1));
$umil->table_column_add(USERS_TABLE, 'user_dl_update_time', array('TIMESTAMP', 0));
$umil->table_column_add(USERS_TABLE, 'user_new_download', array('BOOL', 0));
$umil->table_column_add(USERS_TABLE, 'user_traffic', array('BINT', 0));
$umil->table_column_add(USERS_TABLE, 'user_dl_note_type', array('BOOL', 1));
$umil->table_column_add(USERS_TABLE, 'user_dl_sort_fix', array('BOOL', 0));
$umil->table_column_add(USERS_TABLE, 'user_dl_sort_opt', array('BOOL', 0));
$umil->table_column_add(USERS_TABLE, 'user_dl_sort_dir', array('BOOL', 0));
$umil->table_column_add(USERS_TABLE, 'user_dl_sub_on_index', array('BOOL', 1));
$sql = array();
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'asp'));
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'cgi'));
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'dhtm'));
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'dhtml'));
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'exe'));
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'htm'));
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'html'));
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'jar'));
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'js'));
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'php'));
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'php3'));
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'pl'));
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'sh'));
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'shtm'));
$sql[] = 'INSERT INTO ' . DL_EXT_BLACKLIST . ' ' . $db->sql_build_array('INSERT', array('extention' => 'shtml'));
$sql[] = 'INSERT INTO ' . DL_BANLIST_TABLE . ' ' . $db->sql_build_array('INSERT', array('user_agent' => 'n/a'));
$db->return_on_error = true;
for ($i = 0; $i < sizeof($sql); $i++)
{
$db->sql_query($sql[$i]);
}
$db->return_on_error = false;
unset($sql);
if (!$umil->module_exists('acp', false, 'ACP_CAT_DOT_MODS'))
{
$umil->module_add('acp', 0, 'ACP_CAT_DOT_MODS');
}
else
{
$sql = "UPDATE " . MODULES_TABLE . " SET " . $db->sql_build_array('UPDATE', array(
'module_enabled' => 1,
'module_display' => 1)) . " WHERE module_langname = 'ACP_CAT_DOT_MODS'
AND module_class = 'acp'";
$db->sql_query($sql);
}
$umil->module_add('acp', 'ACP_CAT_DOT_MODS', 'DOWNLOADS');
$umil->module_add('acp', 'DOWNLOADS', array(
'module_basename' => 'downloads',
'module_langname' => 'ACP_USER_OVERVIEW',
'module_mode' => 'overview',
'module_auth' => 'acl_a_dl_overview'));
$umil->module_add('acp', 'DOWNLOADS', array(
'module_basename' => 'downloads',
'module_langname' => 'DL_ACP_CONFIG_MANAGEMENT',
'module_mode' => 'config',
'module_auth' => 'acl_a_dl_config'));
$umil->module_add('acp', 'DOWNLOADS', array(
'module_basename' => 'downloads',
'module_langname' => 'DL_ACP_TRAFFIC_MANAGEMENT',
'module_mode' => 'traffic',
'module_auth' => 'acl_a_dl_traffic'));
$umil->module_add('acp', 'DOWNLOADS', array(
'module_basename' => 'downloads',
'module_langname'=> 'DL_ACP_CATEGORIES_MANAGEMENT',
'module_mode' => 'categories',
'module_auth' => 'acl_a_dl_categories'));
$umil->module_add('acp', 'DOWNLOADS', array(
'module_basename' => 'downloads',
'module_langname' => 'DL_ACP_FILES_MANAGEMENT',
'module_mode' => 'files',
'module_auth' => 'acl_a_dl_files'));
$umil->module_add('acp', 'DOWNLOADS', array(
'module_basename' => 'downloads',
'module_langname' => 'DL_ACP_PERMISSIONS',
'module_mode' => 'permissions',
'module_auth' => 'acl_a_dl_permissions'));
$umil->module_add('acp', 'DOWNLOADS', array(
'module_basename' => 'downloads',
'module_langname' => 'DL_ACP_STATS_MANAGEMENT',
'module_mode' => 'stats',
'module_auth' => 'acl_a_dl_stats'));
$umil->module_add('acp', 'DOWNLOADS', array(
'module_basename' => 'downloads',
'module_langname' => 'DL_ACP_BANLIST',
'module_mode' => 'banlist',
'module_auth' => 'acl_a_dl_banlist'));
$umil->module_add('acp', 'DOWNLOADS', array(
'module_basename' => 'downloads',
'module_langname' => 'DL_EXT_BLACKLIST',
'module_mode' => 'ext_blacklist',
'module_auth' => 'acl_a_dl_blacklist'));
$umil->module_add('acp', 'DOWNLOADS', array(
'module_basename' => 'downloads',
'module_langname' => 'DL_MANAGE',
'module_mode' => 'toolbox',
'module_auth' => 'acl_a_dl_toolbox'));
$umil->module_add('ucp', false, 'DOWNLOADS');
$umil->module_add('ucp', 'DOWNLOADS', array(
'module_basename' => 'downloads',
'module_langname' => 'DL_CONFIG',
'module_mode' => 'config'));
$umil->module_add('ucp', 'DOWNLOADS', array(
'module_basename' => 'downloads',
'module_langname' => 'DL_FAVORITE',
'module_mode' => 'favorite'));
$umil->permission_add('a_dl_overview', true);
$umil->permission_add('a_dl_config', true);
$umil->permission_add('a_dl_traffic', true);
$umil->permission_add('a_dl_categories', true);
$umil->permission_add('a_dl_files', true);
$umil->permission_add('a_dl_permissions', true);
$umil->permission_add('a_dl_stats', true);
$umil->permission_add('a_dl_banlist', true);
$umil->permission_add('a_dl_blacklist', true);
$umil->permission_add('a_dl_toolbox', true);
$umil->permission_set('ADMINISTRATORS', 'a_dl_overview', 'group');
$umil->permission_set('ADMINISTRATORS', 'a_dl_config', 'group');
$umil->permission_set('ADMINISTRATORS', 'a_dl_traffic', 'group');
$umil->permission_set('ADMINISTRATORS', 'a_dl_categories', 'group');
$umil->permission_set('ADMINISTRATORS', 'a_dl_files', 'group');
$umil->permission_set('ADMINISTRATORS', 'a_dl_permissions', 'group');
$umil->permission_set('ADMINISTRATORS', 'a_dl_stats', 'group');
$umil->permission_set('ADMINISTRATORS', 'a_dl_banlist', 'group');
$umil->permission_set('ADMINISTRATORS', 'a_dl_blacklist', 'group');
$umil->permission_set('ADMINISTRATORS', 'a_dl_toolbox', 'group');
dl_config_update('dl_mod__version', $new_version, true);
$finish_text = 'DL_INSTALL_FINISHED';
}
$umil->cache_purge();
// We are done
trigger_error($finish_text);
}
else
{
if (isset($download_version) && $download_version != '')
{
$start_text = $user->lang['DL_UPDATE_INTRO'];
}
else
{
$start_text = $user->lang['DL_INSTALL_INTRO'];
}
confirm_box(false, $start_text);
}
// Shouldn't get here.
redirect($phpbb_root_path . $user->page['page_name']);
function dl_config_exists($config_name, $return_result = false)
{
global $db, $umil;
if ($umil->table_exists(DL_CONFIG_TABLE))
{
$sql = 'SELECT config_value FROM ' . DL_CONFIG_TABLE . "
WHERE config_name = '" . $db->sql_escape($config_name) . "'";
$result = $db->sql_query($sql);
$value = $db->sql_fetchfield('config_value');
$db->sql_freeresult($result);
if ($value)
{
return ($return_result) ? $value : true;
}
}
return false;
}
function dl_config_update($config_name, $config_value = '', $delete = false)
{
global $db;
$config_exists = (dl_config_exists($config_name));
if ($delete)
{
if ($config_exists)
{
$sql = 'DELETE FROM ' . DL_CONFIG_TABLE . "
WHERE config_name = '" . $db->sql_escape($config_name) . "'";
$db->sql_query($sql);
}
}
else
{
if ($config_exists)
{
$sql = 'UPDATE ' . DL_CONFIG_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array(
'config_value' => $config_value)) . " WHERE config_name = '$config_name'";
}
else
{
$sql = 'INSERT INTO ' . DL_CONFIG_TABLE . ' ' . $db->sql_build_array('INSERT', array(
'config_name' => $config_name,
'config_value' => $config_value));
}
$db->sql_query($sql);
}
return;
}
?>