*/
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;
require $phpbb_root_path . 'ads/constants.' . $phpEx;
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('mods/info_acp_ads');
// Display a login box if they are not logged in
if (!$user->data['is_registered']) {
    login_box();
}
if (!file_exists($phpbb_root_path . 'umil/umil_frontend.' . $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);
}
include $phpbb_root_path . 'umil/umil_frontend.' . $phpEx;
$umil = new umil_frontend('ACP_ADVERTISEMENT_MANAGEMENT', true);
// Check after initiating UMIL.
if ($user->data['user_type'] != USER_FOUNDER) {
    trigger_error('FOUNDERS_ONLY');
}
if ($umil->confirm_box(true)) {
    include $phpbb_root_path . 'ads/versions.' . $phpEx;
    $umil->run_actions('uninstall', $versions, 'ads_version');
} else {
    $umil->display_stages(array('CONFIRM', 'UNINSTALL'));
    $umil->confirm_box(false, 'UNINSTALL');
}
$umil->done();
Beispiel #2
0
$current_version = '0.0.0';
foreach ($versions as $version => $actions) {
    $current_version = $version;
}
$template->assign_var('L_TITLE_EXPLAIN', (isset($user->lang[$mod_name . '_EXPLAIN']) ? $user->lang[$mod_name . '_EXPLAIN'] . '<br /><br />' : '') . sprintf($user->lang['VERSIONS'], $current_version, isset($config[$version_config_name]) ? $config[$version_config_name] : $user->lang['NONE']));
$submit = isset($_POST['submit']) ? true : false;
$action = request_var('action', '');
$version_select = request_var('version_select', '');
$current_page = strpos($user->page['page'], '?') !== false ? substr($user->page['page'], 0, strpos($user->page['page'], '?')) : $user->page['page'];
$stages = array('CONFIGURE' => array('url' => append_sid($phpbb_root_path . $current_page)), 'CONFIRM', 'ACTION');
if (!isset($options) || !is_array($options)) {
    $options = array();
}
$options = array('legend1' => 'OPTIONS', 'action' => array('lang' => 'ACTION', 'type' => 'custom', 'function' => 'umil_install_update_uninstall_select', 'explain' => false), 'version_select' => array('lang' => 'VERSION_SELECT', 'type' => 'custom', 'function' => 'umil_version_select', 'explain' => true), 'display_results' => array('lang' => 'DISPLAY_RESULTS', 'type' => 'radio:yes_no', 'explain' => true, 'default' => $force_display_results)) + $options;
if (!$submit && !$umil->confirm_box(true)) {
    $umil->display_stages($stages);
    $umil->display_options($options);
    $umil->done();
} else {
    if (!$umil->confirm_box(true)) {
        $umil->display_stages($stages, 2);
        $hidden = array();
        foreach ($options as $key => $data) {
            $hidden[$key] = request_var($key, '', true);
        }
        switch ($action) {
            case 'install':
                if (!isset($user->lang['INSTALL_' . $mod_name])) {
                    $user->lang['INSTALL_' . $mod_name] = sprintf($user->lang['INSTALL_MOD'], $user->lang[$mod_name]);
                    $user->lang['INSTALL_' . $mod_name . '_CONFIRM'] = sprintf($user->lang['INSTALL_MOD_CONFIRM'], $user->lang[$mod_name]);
                }