Example #1
0
/*
* The name of the config variable which will hold the currently installed version
* You do not need to set this yourself, UMIL will handle setting and updating the version itself.
*/
$version_config_name = 'bbdkp_raidplanner';
/*
* The language file which will be included when installing
*/
$language_file = 'mods/raidplanner';
/*
* Optionally we may specify our own logo image to show in the upper corner instead of the default logo.
* $phpbb_root_path will get prepended to the path specified
* Image height should be 50px to prraidplan cut-off or stretching.
*/
$logo_img = 'install/logo.png';
$announce = encode_announcement($user->lang['RP_WELCOME_DEFAULT']);
/*
* Run Options
*/
$options = array();
/*
* The array of versions and actions within each.
* You do not need to order it a specific way (it will be sorted automatically), however, you must enter every version, even if no actions are done for it.
*
* You must use correct version numbering.  Unless you know exactly what you can use, only use X.X.X (replacing X with an integer).
* The version numbering must otherwise be compatible with the version_compare function - http://php.net/manual/en/function.version-compare.php
*/
$versions = array('1.0.4' => array('table_add' => array(array($table_prefix . 'rp_raids', array('COLUMNS' => array('raidplan_id' => array('INT:8', NULL, 'auto_increment'), 'etype_id' => array('INT:8', 0), 'sort_timestamp' => array('BINT', 0), 'raidplan_invite_time' => array('BINT', 0), 'raidplan_start_time' => array('BINT', 0), 'raidplan_end_time' => array('BINT', 0), 'raidplan_all_day' => array('UINT', 0), 'raidplan_day' => array('VCHAR:10', ''), 'raidplan_subject' => array('VCHAR_UNI:255', ''), 'raidplan_body' => array('MTEXT', ''), 'poster_id' => array('UINT', 0), 'raidplan_access_level' => array('BOOL', 0), 'group_id' => array('UINT', 0), 'group_id_list' => array('VCHAR_UNI:255', ''), 'enable_bbcode' => array('BOOL', 1), 'enable_smilies' => array('BOOL', 1), 'enable_magic_url' => array('BOOL', 1), 'bbcode_bitfield' => array('VCHAR:255', ''), 'bbcode_uid' => array('VCHAR:8', ''), 'bbcode_options' => array('UINT', 7), 'track_signups' => array('BOOL', 0), 'signup_yes' => array('UINT', 0), 'signup_no' => array('UINT', 0), 'signup_maybe' => array('UINT', 0), 'signup_confirmed' => array('UINT', 0), 'recurr_id' => array('UINT', 0), 'raidteam' => array('INT:8', 0), 'raid_id' => array('INT:8', 0)), 'PRIMARY_KEY' => array('raidplan_id'))), array($table_prefix . 'rp_signups', array('COLUMNS' => array('signup_id' => array('INT:8', NULL, 'auto_increment'), 'raidplan_id' => array('INT:8', 0), 'poster_id' => array('INT:8', 0), 'poster_name' => array('VCHAR:255', ''), 'poster_colour' => array('VCHAR:6', ''), 'poster_ip' => array('VCHAR:40', ''), 'post_time' => array('TIMESTAMP', 0), 'signup_val' => array('BOOL', 0), 'signup_count' => array('USINT', 0), 'signup_detail' => array('MTEXT', ''), 'bbcode_bitfield' => array('VCHAR:255', ''), 'bbcode_uid' => array('VCHAR:8', ''), 'bbcode_options' => array('UINT', 7), 'dkpmember_id' => array('INT:8', 0), 'role_id' => array('INT:8', 0), 'role_confirm' => array('BOOL', 0)), 'PRIMARY_KEY' => array('signup_id'), 'KEYS' => array('raidplan_id' => array('INDEX', 'raidplan_id'), 'poster_id' => array('INDEX', 'poster_id'), 'eid_post_time' => array('INDEX', array('raidplan_id', 'post_time'))))), array($table_prefix . 'rp_raidplanroles', array('COLUMNS' => array('raidplandet_id' => array('INT:8', NULL, 'auto_increment'), 'raidplan_id' => array('INT:8', 0), 'role_id' => array('INT:8', 0), 'role_needed' => array('INT:8', 0), 'role_signedup' => array('INT:8', 0), 'role_confirmed' => array('INT:8', 0)), 'PRIMARY_KEY' => array('raidplandet_id'))), array($table_prefix . 'rp_announcement', array('COLUMNS' => array('announcement_id' => array('INT:8', NULL, 'auto_increment'), 'announcement_title' => array('VCHAR_UNI', ''), 'announcement_msg' => array('TEXT_UNI', ''), 'announcement_timestamp' => array('TIMESTAMP', 0), 'bbcode_bitfield' => array('VCHAR:255', ''), 'bbcode_uid' => array('VCHAR:8', ''), 'user_id' => array('INT:8', 0), 'bbcode_options' => array('UINT', 7)), 'PRIMARY_KEY' => 'announcement_id')), array($table_prefix . 'rp_teams', array('COLUMNS' => array('teams_id' => array('INT:8', NULL, 'auto_increment'), 'team_name' => array('VCHAR_UNI', ''), 'guild_id' => array('USINT', 0), 'game_id' => array('VCHAR:10', 0), 'team_size' => array('INT:8', 0)), 'PRIMARY_KEY' => 'teams_id')), array($table_prefix . 'rp_teamsizes', array('COLUMNS' => array('role_id' => array('INT:8', 0), 'teams_id' => array('INT:8', 0), 'role_needed' => array('INT:8', 0), 'game_id' => array('VCHAR:10', 0))))), 'table_row_insert' => array(array($table_prefix . 'rp_announcement', array(array('announcement_title' => 'Raid sign-up tool', 'announcement_timestamp' => (int) time(), 'announcement_msg' => $announce['text'], 'bbcode_uid' => $announce['uid'], 'bbcode_bitfield' => $announce['bitfield'], 'user_id' => $user->data['user_id'])), array($table_prefix . 'rp_teams', array(array('team_name' => 'Team 1', 'team_needed' => 10), array('team_name' => 'Team 2', 'team_needed' => 15))), array($table_prefix . 'rp_teamsizes', array(array('role_id' => 1, 'teams_id' => 1, 'team_needed' => 1), array('role_id' => 2, 'teams_id' => 1, 'team_needed' => 1), array('role_id' => 3, 'teams_id' => 1, 'team_needed' => 1), array('role_id' => 4, 'teams_id' => 1, 'team_needed' => 1), array('role_id' => 5, 'teams_id' => 1, 'team_needed' => 2), array('role_id' => 6, 'teams_id' => 1, 'team_needed' => 2), array('role_id' => 1, 'teams_id' => 2, 'team_needed' => 3), array('role_id' => 2, 'teams_id' => 2, 'team_needed' => 2), array('role_id' => 3, 'teams_id' => 2, 'team_needed' => 2), array('role_id' => 4, 'teams_id' => 2, 'team_needed' => 2), array('role_id' => 5, 'teams_id' => 2, 'team_needed' => 3), array('role_id' => 6, 'teams_id' => 2, 'team_needed' => 3))))), 'permission_add' => array(array('u_raidplanner_push', true), array('a_raid_config', true), array('m_raidplanner_edit_other_users_raidplans', true), array('m_raidplanner_delete_other_users_raidplans', true), array('m_raidplanner_edit_other_users_signups', true), array('u_raidplanner_view_raidplans', true), array('u_raidplanner_view_headcount', true), array('u_raidplanner_signup_raidplans', true), array('u_raidplanner_create_raidplans', true), array('u_raidplanner_create_public_raidplans', true), array('u_raidplanner_create_group_raidplans', true), array('u_raidplanner_create_private_raidplans', true), array('u_raidplanner_create_recurring_raidplans', true), array('u_raidplanner_edit_raidplans', true), array('u_raidplanner_delete_raidplans', true)), 'permission_set' => array(array('ADMINISTRATORS', 'u_raidplanner_push', 'group', true), array('GLOBAL_MODERATORS', 'u_raidplanner_push', 'group', true), array('ADMINISTRATORS', 'a_raid_config', 'group', true), array('ADMINISTRATORS', 'm_raidplanner_edit_other_users_raidplans', 'group', true), array('GLOBAL_MODERATORS', 'm_raidplanner_edit_other_users_raidplans', 'group', true), array('ADMINISTRATORS', 'm_raidplanner_delete_other_users_raidplans', 'group', true), array('GLOBAL_MODERATORS', 'm_raidplanner_edit_other_users_raidplans', 'group', true), array('ADMINISTRATORS', 'm_raidplanner_edit_other_users_signups', 'group', true), array('GLOBAL_MODERATORS', 'm_raidplanner_edit_other_users_signups', 'group', true), array('ADMINISTRATORS', 'u_raidplanner_view_raidplans', 'group', true), array('GLOBAL_MODERATORS', 'u_raidplanner_view_raidplans', 'group', true), array('REGISTERED', 'u_raidplanner_view_raidplans', 'group', true), array('NEWLY_REGISTERED', 'u_raidplanner_view_raidplans', 'group', true), array('GUESTS', 'u_raidplanner_view_raidplans', 'group', true), array('ADMINISTRATORS', 'u_raidplanner_view_headcount', 'group', true), array('GLOBAL_MODERATORS', 'u_raidplanner_view_headcount', 'group', true), array('REGISTERED', 'u_raidplanner_view_headcount', 'group', true), array('ADMINISTRATORS', 'u_raidplanner_signup_raidplans', 'group', true), array('GLOBAL_MODERATORS', 'u_raidplanner_signup_raidplans', 'group', true), array('REGISTERED', 'u_raidplanner_signup_raidplans', 'group', true), array('NEWLY_REGISTERED', 'u_raidplanner_signup_raidplans', 'group', true), array('GUESTS', 'u_raidplanner_signup_raidplans', 'group', true), array('ADMINISTRATORS', 'u_raidplanner_create_raidplans', 'group', true), array('GLOBAL_MODERATORS', 'u_raidplanner_create_raidplans', 'group', true), array('REGISTERED', 'u_raidplanner_create_raidplans', 'group', true), array('ADMINISTRATORS', 'u_raidplanner_create_public_raidplans', 'group', true), array('GLOBAL_MODERATORS', 'u_raidplanner_create_public_raidplans', 'group', true), array('REGISTERED', 'u_raidplanner_create_public_raidplans', 'group', true), array('ADMINISTRATORS', 'u_raidplanner_create_group_raidplans', 'group', true), array('GLOBAL_MODERATORS', 'u_raidplanner_create_group_raidplans', 'group', true), array('REGISTERED', 'u_raidplanner_create_group_raidplans', 'group', true), array('ADMINISTRATORS', 'u_raidplanner_create_private_raidplans', 'group', true), array('GLOBAL_MODERATORS', 'u_raidplanner_create_private_raidplans', 'group', true), array('REGISTERED', 'u_raidplanner_create_private_raidplans', 'group', true), array('ADMINISTRATORS', 'u_raidplanner_create_recurring_raidplans', 'group', true), array('GLOBAL_MODERATORS', 'u_raidplanner_create_recurring_raidplans', 'group', true), array('REGISTERED', 'u_raidplanner_create_recurring_raidplans', 'group', true), array('ADMINISTRATORS', 'u_raidplanner_edit_raidplans', 'group', true), array('GLOBAL_MODERATORS', 'u_raidplanner_edit_raidplans', 'group', true), array('REGISTERED', 'u_raidplanner_edit_raidplans', 'group', true), array('ADMINISTRATORS', 'u_raidplanner_delete_raidplans', 'group', true), array('GLOBAL_MODERATORS', 'u_raidplanner_delete_raidplans', 'group', true), array('REGISTERED', 'u_raidplanner_delete_raidplans', 'group', true)), 'module_add' => array(array('ucp', 'UCP_DKP', array('module_basename' => 'planner', 'module_mode' => array('raidplanner_registration'))), array('acp', 'ACP_DKP_RAIDS', array('module_basename' => 'raidplanner', 'modes' => array('rp_settings', 'rp_cal_settings', 'rp_teams', 'rp_teams_edit')))), 'config_add' => array(array('rp_pm_rpchange', 0, false), array('rp_email_rpchange', 0, false), array('rp_pm_signup', 0, false), array('rp_email_signup', 0, false), array('rp_rppushmode', 1, false), array('rp_enable_past_raids', false), array('rp_show_portal', 1, false), array('rp_first_day_of_week', 0, false), array('rp_index_display_week', 0, false), array('rp_display_next_raidplans', 5), array('rp_hour_mode', 24), array('rp_display_truncated_name', 0, false), array('rp_prune_frequency', 0, false), array('rp_last_prune', 0, false), array('rp_prune_limit', 31536000, false), array('rp_display_hidden_groups', 0, false), array('rp_time_format', 'H:i', false), array('rp_date_format', 'M d, Y', false), array('rp_date_time_format', 'M d, Y H:i', false), array('rp_disp_raidplans_only_on_start', 0, false), array('rp_populate_frequency', 86400, false), array('rp_last_populate', 0, false), array('rp_populate_limit', 94608000, false), array('rp_default_invite_time', 1200, false), array('rp_default_start_time', 1230, false), array('rp_default_end_time', 0, false), array('rp_default_freezetime', 60, false), array('rp_default_expiretime', 60, false), array('rp_show_raidplanner', 60, false), array('rp_show_welcomemsg', 1, false), array('rp_welcomemessage', '', false), array('rp_show_name', 0, false)), 'custom' => array('purgecaches', 'versionupdater')));
// Include the UMIF Auto file and everything else will be handled automatically.
include $phpbb_root_path . 'umil/umil_auto.' . $phpEx;
/**
Example #2
0
);
*/
/*
* Optionally we may specify our own logo image to show in the upper corner instead of the default logo.
* $phpbb_root_path will get prepended to the path specified
* Image height should be 50px to prevent cut-off or stretching.
*/
//$logo_img = 'styles/prosilver/imageset/site_logo.gif';
/*
* The array of versions and actions within each.
* You do not need to order it a specific way (it will be sorted automatically), however, you must enter every version, even if no actions are done for it.
*
* You must use correct version numbering.  Unless you know exactly what you can use, only use X.X.X (replacing X with an integer).
* The version numbering must otherwise be compatible with the version_compare function - http://php.net/manual/en/function.version-compare.php
*/
$announce = encode_announcement($user->lang['APPLY_INFO']);
$versions = array('1.3.3' => array('config_add' => array(array('bbdkp_apply_realm', 'Realmname', true), array('bbdkp_apply_region', 'us'), array('bbdkp_apply_guests', 'True', true), array('bbdkp_apply_simplerecruit', 'True', true), array('bbdkp_apply_forum_id_private', '2', true), array('bbdkp_apply_forum_id_public', '2', true), array('bbdkp_apply_visibilitypref', '1', true), array('bbdkp_apply_pqcolor', '#FF0000', true), array('bbdkp_apply_pacolor', '#FFFFFF', true), array('bbdkp_apply_fqcolor', '#FF0000', true), array('bbdkp_apply_forumchoice', '1', true), array('bbdkp_apply_gchoice', '0', true)), 'module_add' => array(array('acp', 'ACP_DKP_MEMBER', array('module_basename' => 'dkp_apply', 'modes' => array('apply_settings')))), 'table_add' => array(array($table_prefix . 'bbdkp_apphdr', array('COLUMNS' => array('announcement_id' => array('INT:8', NULL, 'auto_increment'), 'announcement_title' => array('VCHAR_UNI:255', ''), 'announcement_msg' => array('TEXT_UNI', ''), 'announcement_timestamp' => array('TIMESTAMP', 0), 'bbcode_bitfield' => array('VCHAR:255', ''), 'bbcode_uid' => array('VCHAR:8', ''), 'user_id' => array('INT:8', 0), 'bbcode_options' => array('UINT', 7)), 'PRIMARY_KEY' => 'announcement_id')), array($table_prefix . 'bbdkp_apptemplate', array('COLUMNS' => array('id' => array('INT:8', NULL, 'auto_increment'), 'qorder' => array('UINT', 0), 'header' => array('VCHAR:255', ''), 'question' => array('VCHAR:255', ''), 'type' => array('VCHAR:255', ''), 'mandatory' => array('VCHAR:255', ''), 'options' => array('MTEXT_UNI', '')), 'PRIMARY_KEY' => 'id'))), 'table_row_insert' => array(array($table_prefix . 'bbdkp_apphdr', array(array('announcement_title' => $user->lang['APPLY'], 'announcement_timestamp' => (int) time(), 'announcement_msg' => $announce['text'], 'bbcode_uid' => $announce['uid'], 'bbcode_bitfield' => $announce['bitfield'], 'user_id' => $user->data['user_id']))), array($table_prefix . 'bbdkp_apptemplate', array(array('qorder' => 1, 'header' => $user->lang['APPLY_CHAR_OVERVIEW'], 'question' => ' ', 'type' => 'title', 'mandatory' => 'True', 'options' => ' '), array('qorder' => 2, 'header' => $user->lang['APPLY_NAME'], 'question' => ' ', 'type' => 'charname', 'mandatory' => 'True', 'options' => ' '), array('qorder' => 3, 'header' => $user->lang['APPLY_ACP_REALM'], 'question' => ' ', 'type' => 'regionrealm', 'mandatory' => 'True', 'options' => ' '), array('qorder' => 4, 'header' => $user->lang['APPLY_GAME'], 'question' => ' ', 'type' => 'gameraceclass', 'mandatory' => 'True', 'options' => ' '), array('qorder' => 5, 'header' => $user->lang['APPLY_LEVEL'], 'question' => ' ', 'type' => 'level', 'mandatory' => 'True', 'options' => ' '), array('qorder' => 6, 'header' => $user->lang['APPLY_CHAR_MOTIVATION'], 'question' => ' ', 'type' => 'title', 'mandatory' => 'False', 'options' => ' '), array('qorder' => 7, 'header' => $user->lang['DEFAULT_H1'], 'question' => $user->lang['DEFAULT_Q1'], 'type' => 'Textboxbbcode', 'mandatory' => 'False', 'options' => ' '), array('qorder' => 8, 'header' => $user->lang['DEFAULT_H2'], 'question' => $user->lang['DEFAULT_Q2'], 'type' => 'Inputbox', 'mandatory' => 'False', 'options' => ' '), array('qorder' => 9, 'header' => $user->lang['DEFAULT_H3'], 'question' => $user->lang['DEFAULT_Q3'], 'type' => 'Textboxbbcode', 'mandatory' => 'False', 'options' => ' '), array('qorder' => 10, 'header' => $user->lang['DEFAULT_H4'], 'question' => $user->lang['DEFAULT_Q4'], 'type' => 'Textboxbbcode', 'mandatory' => 'False', 'options' => ' '), array('qorder' => 11, 'header' => $user->lang['DEFAULT_H5'], 'question' => $user->lang['DEFAULT_Q5'], 'type' => 'Textbox', 'mandatory' => 'False', 'options' => ' '), array('qorder' => 12, 'header' => $user->lang['DEFAULT_H6'], 'question' => $user->lang['DEFAULT_Q6'], 'type' => 'Textboxbbcode', 'mandatory' => 'False', 'options' => ' '), array('qorder' => 13, 'header' => $user->lang['DEFAULT_H7'], 'question' => $user->lang['DEFAULT_Q7'], 'type' => 'Textbox', 'mandatory' => 'False', 'options' => ' '), array('qorder' => 14, 'header' => $user->lang['DEFAULT_H8'], 'question' => $user->lang['DEFAULT_Q8'], 'type' => 'Checkboxes', 'mandatory' => 'False', 'options' => $user->lang['DEFAULT_O8']), array('qorder' => 15, 'header' => $user->lang['DEFAULT_H9'], 'question' => $user->lang['DEFAULT_Q9'], 'type' => 'Textbox', 'mandatory' => 'False', 'options' => ' '), array('qorder' => 16, 'header' => $user->lang['DEFAULT_H10'], 'question' => $user->lang['DEFAULT_Q10'], 'type' => 'Textbox', 'mandatory' => 'False', 'options' => ' '), array('qorder' => 17, 'header' => $user->lang['DEFAULT_H11'], 'question' => $user->lang['DEFAULT_Q11'], 'type' => 'Radiobuttons', 'mandatory' => 'False', 'options' => $user->lang['DEFAULT_O11']))))), '1.3.4' => array(), '1.3.5' => array(), '1.3.6' => array('table_add' => array(array($table_prefix . 'bbdkp_apptemplatelist', array('COLUMNS' => array('template_id' => array('INT:8', NULL, 'auto_increment'), 'template_name' => array('VCHAR_UNI:255', ''), 'forum_id' => array('INT:8', 0), 'guild_id' => array('INT:8', 1), 'status' => array('BOOL', 0)), 'PRIMARY_KEY' => 'template_id'))), 'table_row_insert' => array(array($table_prefix . 'bbdkp_apptemplatelist', array(array('template_id' => 1, 'template_name' => 'Default', 'forum_id' => '2', 'guild_id' => get_guild_id(), 'status' => 1)))), 'table_column_add' => array(array($table_prefix . 'bbdkp_apptemplate', 'template_id', array('UINT', 0)), array($table_prefix . 'bbdkp_apptemplate', 'lineid', array('UINT', 0))), 'config_remove' => array(array('bbdkp_apply_visibilitypref'), array('bbdkp_apply_simplerecruit'), array('bbdkp_apply_forum_id_private'), array('bbdkp_apply_forum_id_public'), array('bbdkp_apply_forumchoice')), 'custom' => array('tableupd')), '1.3.7' => array('config_remove' => array(array('bbdkp_apply_gchoice'))), '1.4' => array('module_add' => array(array('acp', 'ACP_DKP_MEMBER', array('module_basename' => 'dkp_apply', 'modes' => array('apply_edittemplate')))), 'table_column_add' => array(array($table_prefix . 'bbdkp_apphdr', 'template_id', array('UINT', 0)), array($table_prefix . 'bbdkp_apptemplatelist', 'question_color', array('VCHAR:8', '')), array($table_prefix . 'bbdkp_apptemplatelist', 'answer_color', array('VCHAR:8', '')), array($table_prefix . 'bbdkp_apptemplatelist', 'gchoice', array('BOOL', 0)), array($table_prefix . 'bbdkp_apptemplate', 'showquestion', array('BOOL', 1))), 'config_remove' => array(array('bbdkp_apply_pacolor'), array('bbdkp_apply_pqcolor'), array('bbdkp_apply_fqcolor'), array('bbdkp_apply_region')), 'custom' => array('tableupd')), '1.4.1' => array(), '1.5.0' => array(), '1.5.1' => array(), '1.5.2' => array(), '1.5.3' => array('table_column_add' => array(array($table_prefix . 'bbdkp_apptemplatelist', 'statpos', array('VCHAR:8', '')))), '1.5.4' => array('table_column_remove' => array(array($table_prefix . 'bbdkp_apptemplatelist', 'statpos')), 'table_column_add' => array(array($table_prefix . 'bbdkp_apptemplatelist', 'statpos', array('VCHAR:255', '')))), '1.5.5' => array(), '1.5.6' => array(), '1.5.7' => array(), '1.5.8' => array('custom' => array('applyupdater', 'clearcaches')));
// We include the UMIF Auto file and everything else will be handled automatically.
include $phpbb_root_path . 'umil/umil_auto.' . $phpEx;
/**
 * this function fills the plugin table.
 *
 * @param string $action
 * @param string $version
 * @return string
 */
function applyupdater($action, $version)
{
    global $table_prefix, $user, $umil;
    switch ($action) {
        case 'install':