Esempio n. 1
0
function create_guild($cid, $name)
{
    $cid = (int) $cid;
    $name = sanitize($name);
    $time = time();
    // Create the guild
    mysql_insert("INSERT INTO `guilds` (`name`, `ownerid`, `creationdata`, `motd`) VALUES ('{$name}', '{$cid}', '{$time}', '');");
    // Get guild id
    $gid = get_guild_id($name);
    // Get rank id for guild leader
    $data = mysql_select_single("SELECT `id` FROM `guild_ranks` WHERE `guild_id`='{$gid}' AND `level`='3' LIMIT 1;");
    $rid = $data !== false ? $data['id'] : false;
    // Give player rank id for leader of his guild
    if (config('TFSVersion') !== 'TFS_10') {
        mysql_update("UPDATE `players` SET `rank_id`='{$rid}' WHERE `id`='{$cid}' LIMIT 1;");
    } else {
        mysql_insert("INSERT INTO `guild_membership` (`player_id`, `guild_id`, `rank_id`, `nick`) VALUES ('{$cid}', '{$gid}', '{$rid}', '');");
    }
}
Esempio n. 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':
        case 'update':
Esempio n. 3
0
             // Insert data
             mysql_insert("INSERT INTO `znote_forum` (`name`, `access`, `closed`, `hidden`, `guild_id`) \n\t\t\t\t\t\tVALUES ('Guild', \n\t\t\t\t\t\t\t'1', \n\t\t\t\t\t\t\t'0', \n\t\t\t\t\t\t\t'0', \n\t\t\t\t\t\t\t'{$gid}');");
             echo '<h1>Guild board has been created.</h1>';
         } else {
             echo '<h1>Guild board already exist.</h1>';
         }
     } else {
         echo '<h1>Error: Guild board system is disabled.</h1>';
     }
 }
 if ($config['TFSVersion'] == 'TFS_02' || $config['TFSVersion'] == 'TFS_10' && $config['guildwar_enabled'] === true) {
     if (!empty($_POST['warinvite'])) {
         if (get_guild_id($_POST['warinvite'])) {
             $status = false;
             $war_invite = mysql_select_single("SELECT `id` FROM `guilds` WHERE `id` = '{$gid}';");
             $targetGuild = get_guild_id($_POST['warinvite']);
             if ($war_invite !== false) {
                 foreach ($war_invite as $inv) {
                     if ($inv['id'] == $targetGuild) {
                         $status = true;
                     }
                 }
             }
             $check_guild = get_guild_name($gid);
             foreach ($check_guild as $guild) {
                 if ($guild['name'] == $_POST['warinvite']) {
                     $status = true;
                 }
             }
             $wars = mysql_select_multi("SELECT `id`, `guild1`, `guild2`, `status` FROM `guild_wars` WHERE (`guild1` = '{$gid}' OR `guild1` = '{$targetGuild}') AND (`guild2` = '{$gid}' OR `guild2` = '{$targetGuild}') AND `status` IN (0, 1);");
             if ($status == false && $wars == false) {