Ejemplo n.º 1
0
/**
Activate Plugin
*/
function rpgsuite_activate()
{
    global $db;
    reverse_template_edits();
    apply_template_edits();
    // Add any tables for upgrading
    if (!$db->table_exists("otms")) {
        $db->write_query("CREATE TABLE " . TABLE_PREFIX . "otms (id int(11) NOT NULL AUTO_INCREMENT, name VARCHAR(500), type VARCHAR(100), value VARCHAR(2000), PRIMARY KEY(id))");
    }
    // If we have new settings, add them!
    $settinggroup = $db->simple_select('settinggroups', 'gid', 'name = \'rpgsuite\'');
    $group = $db->fetch_array($settinggroup);
    $settings = build_settings($group['gid']);
    foreach ($settings as $setting) {
        $settingquery = $db->simple_select('settings', 'sid', 'name = \'' . $setting['name'] . '\'');
        if (!$settingquery->num_rows) {
            $db->insert_query('settings', $setting);
        }
    }
    rebuild_settings();
    // If we have new templates, add them, but only if they exist!
    // Lonely Thread Templates
    require_once MYBB_ROOT . "/inc/plugins/rpg_suite/templatesets/class_LonelyThreadSet.php";
    $templateset = new LonelyThreadSet($db);
    $templateset->create();
    // OTM Templates
    require_once MYBB_ROOT . "/inc/plugins/rpg_suite/templatesets/class_OtmSet.php";
    $templateset = new OtmSet($db);
    $templateset->create();
}
Ejemplo n.º 2
0
            continue;
        }
        $tpl->set_var(array('HEADING_' . $key => $value));
    }
    // other text
    foreach ($TEXT as $key => &$value) {
        if (is_array($value)) {
            continue;
        }
        $tpl->set_var(array('TEXT_' . $key => $value));
    }
    // there are some that do not have the expected prefix or need some tweaking...
    $tpl->set_var(array('HEADING_ADVANCE_SETTINGS' => $TEXT['VISIBILITY'], 'HELP_LEPTOKEN_LIFETIME' => $TEXT['HELP_LEPTOKEN_LIFETIME'], 'HELP_MAX_ATTEMPTS' => $TEXT['HELP_MAX_ATTEMPTS'], 'TEXT_RENAME_FILES_ON_UPLOAD' => $TEXT['ALLOWED_FILETYPES_ON_UPLOAD'], 'TEXT_MANAGE_SECTIONS' => $HEADING['MANAGE_SECTIONS'], 'TEXT_FILES' => strtoupper(substr($TEXT['FILES'], 0, 1)) . substr($TEXT['FILES'], 1), 'TEXT_WBMAILER_SENDTESTMAIL' => $TEXT['WBMAILER_SEND_TESTMAIL'], 'MODE_SWITCH_WARNING' => $MESSAGE['SETTINGS_MODE_SWITCH_WARNING'], 'WORLD_WRITEABLE_WARNING' => $MESSAGE['SETTINGS_WORLD_WRITEABLE_WARNING']));
}
// end function admins_settings_fill_static_text()
// test $_GET querystring can only be 1 or 2 (leptoken and may be advanced)
if (isset($_GET) && sizeof($_GET) > 2) {
    die('Acess denied');
}
// test if valid $admin-object already exists (bit complicated about PHP4 Compatibility)
if (!(isset($admin) && is_object($admin) && get_class($admin) == 'admin')) {
    require_once LEPTON_PATH . '/framework/class.admin.php';
}
//
if (isset($_GET['advanced']) && $_GET['advanced'] == 'no' || !isset($_GET['advanced'])) {
    $admin = new admin('Settings', 'settings_basic');
} elseif (isset($_GET['advanced']) && $_GET['advanced'] == 'yes') {
    $admin = new admin('Settings', 'settings_advanced');
}
print build_settings($admin, $database);
$admin->print_footer();