Exemplo n.º 1
0
 /**
  * 添加关系
  */
 public static final function append()
 {
     $error = array();
     $online = front::online();
     $get = array('s_type' => isset($_GET['s_type']) ? $_GET['s_type'] : '', 't_type' => isset($_GET['t_type']) ? $_GET['t_type'] : '', 's_id' => isset($_GET['s_id']) ? (int) $_GET['s_id'] : '0', 't_id' => isset($_GET['t_id']) ? (int) $_GET['t_id'] : '0');
     $s_list = null;
     if ($get['s_type'] == 'channel') {
         $s_list = channel::get_channel_select(0, 0, $get['s_id'], null, null);
     } elseif ($get['s_type'] == 'address') {
         $s_lists = address::selects('address_id as id,name', null, array('user_id' => $online->user_id), array('ORDER BY address_id DESC'), array('id', 'column|table=address' => 'name'));
         if ($s_lists) {
             $s_list = make_option($s_lists, $get['s_id']);
         }
     } elseif ($get['s_type'] == 'book') {
         $s_lists = book::selects('book_id as id,concat_ws(\',\',create_date,item_txt,remark,ccy,amount,otype) as name', null, array('user_id' => $online->user_id), array('ORDER BY create_date DESC,book_id DESC'), array('id', 'column|table=book' => 'name'));
         if ($s_lists) {
             $s_list = make_option($s_lists, $get['s_id']);
         }
     } elseif ($get['s_type'] == 'diary') {
         $s_lists = diary::selects('diary_id as id,title as name', null, array('user_id' => $online->user_id), array('ORDER BY diary_id DESC'), array('id', 'column|table=diary' => 'name'));
         if ($s_lists) {
             $s_list = make_option($s_lists, $get['s_id']);
         }
     } elseif ($get['s_type'] == 'doc') {
         $s_lists = doc::selects('doc_id as id,title as name', null, array('user_id' => $online->user_id), array('ORDER BY doc_id DESC'), array('id', 'column|table=doc' => 'name'));
         if ($s_lists) {
             $s_list = make_option($s_lists, $get['s_id']);
         }
     } elseif ($get['s_type'] == 'site') {
         $s_lists = site::selects('site_id as id,title as name', null, array('user_id' => $online->user_id), array('ORDER BY site_id DESC'), array('id', 'column|table=site' => 'name'));
         if ($s_lists) {
             $s_list = make_option($s_lists, $get['s_id']);
         }
     } elseif ($get['s_type'] == 'user') {
         $s_lists = user::selects('user_id as id,username as name', null, array('user_id' => $online->user_id), array('ORDER BY user_id DESC'), array('id', 'column|table=user' => 'name'));
         if ($s_lists) {
             $s_list = make_option($s_lists, $get['s_id']);
         }
     } else {
     }
     $t_list = null;
     if ($get['t_type'] == 'channel') {
         $t_list = channel::get_channel_select(0, 0, $get['t_id'], null, null);
     } elseif ($get['t_type'] == 'address') {
         $t_lists = address::selects('address_id as id,name', null, array('user_id' => $online->user_id), array('ORDER BY address_id DESC'), array('id', 'column|table=address' => 'name'));
         if ($t_lists) {
             $t_list = make_option($t_lists, $get['t_id']);
         }
     } elseif ($get['t_type'] == 'book') {
         $t_lists = book::selects('book_id as id,concat_ws(\',\',create_date,item_txt,remark,ccy,amount,otype) as name', null, array('user_id' => $online->user_id), array('ORDER BY create_date DESC,book_id DESC'), array('id', 'column|table=book' => 'name'));
         if ($t_lists) {
             $t_list = make_option($t_lists, $get['t_id']);
         }
     } elseif ($get['t_type'] == 'diary') {
         $t_lists = diary::selects('diary_id as id,title as name', null, array('user_id' => $online->user_id), array('ORDER BY diary_id DESC'), array('id', 'column|table=diary' => 'name'));
         if ($t_lists) {
             $t_list = make_option($t_lists, $get['t_id']);
         }
     } elseif ($get['t_type'] == 'doc') {
         $t_lists = doc::selects('doc_id as id,title as name', null, array('user_id' => $online->user_id), array('ORDER BY doc_id DESC'), array('id', 'column|table=doc' => 'name'));
         if ($t_lists) {
             $t_list = make_option($t_lists, $get['t_id']);
         }
     } elseif ($get['t_type'] == 'site') {
         $t_lists = site::selects('site_id as id,title as name', null, array('user_id' => $online->user_id), array('ORDER BY site_id DESC'), array('id', 'column|table=site' => 'name'));
         if ($t_lists) {
             $t_list = make_option($t_lists, $get['t_id']);
         }
     } elseif ($get['t_type'] == 'user') {
         $t_lists = user::selects('user_id as id,username as name', null, array('user_id' => $online->user_id), array('ORDER BY user_id DESC'), array('id', 'column|table=user' => 'name'));
         if ($t_lists) {
             $t_list = make_option($t_lists, $get['t_id']);
         }
     } else {
     }
     // 表单处理
     while (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'POST') {
         // 数据消毒
         $post = array('s_type' => isset($_POST['s_type']) ? $_POST['s_type'] : '', 't_type' => isset($_POST['t_type']) ? $_POST['t_type'] : '', 's_id' => isset($_POST['s_id']) ? (int) $_POST['s_id'] : '0', 't_id' => isset($_POST['t_id']) ? (int) $_POST['t_id'] : '0', 'user_id' => $online->user_id);
         if (!$post['s_type']) {
             $error['s_type'] = '请选择源类型';
         }
         if (!$post['t_type']) {
             $error['t_type'] = '请选择目标类型';
         }
         if (!$post['s_id']) {
             $error['s_id'] = '请选择源内容';
         }
         if (!$post['t_id']) {
             $error['t_id'] = '请选目标内容';
         }
         if (!$error['t_id']) {
             if ($post['s_type'] == $post['t_type'] && $post['s_id'] == $post['t_id']) {
                 $error['t_id'] = '不能和自己关联';
             }
         }
         if (!$error['t_id']) {
             $related_id = self::selects('related_id', null, array('user_id' => $online->user_id, 's_id' => $post['s_id'], 's_type' => $post['s_type'], 't_id' => $post['t_id'], 't_type' => $post['t_type']), null, array('column' => 'related_id'));
             if (!$related_id) {
                 $related_id = self::selects('related_id', null, array('user_id' => $online->user_id, 's_id' => $post['t_id'], 's_type' => $post['t_type'], 't_id' => $post['s_id'], 't_type' => $post['s_type']), null, array('column' => 'related_id'));
             }
             if ($related_id) {
                 $error['t_id'] = '目标内容已经关联,请重新选择';
             }
         }
         if (!empty($error)) {
             break;
         }
         // 数据入库
         $related = new self();
         $related->related_id = null;
         $related->struct($post);
         $related->insert();
         $error = '添加成功';
         front::view2('error.tpl', compact('error'));
         return;
     }
     $types = array('address' => '地址', 'book' => '账本', 'channel' => '分类', 'diary' => '日志', 'doc' => '文章', 'site' => '网址', 'user' => '用户');
     front::view2(__CLASS__ . '.' . 'form.tpl', compact('post', 'get', 'error', 'types', 's_list', 't_list'));
 }
Exemplo n.º 2
0
/**
 * Fourth installation step.
 *
 * @return tempcode		Progress report / UI
 */
function step_4()
{
    global $LANG;
    if (count($_POST) == 0) {
        exit(do_lang('INST_POST_ERROR'));
    }
    require_code('database/' . post_param('db_type'));
    $GLOBALS['DB_STATIC_OBJECT'] = object_factory('Database_Static_' . post_param('db_type'));
    $domain = ocp_srv('HTTP_HOST');
    if (substr($domain, 0, 4) == 'www.') {
        $domain = substr($domain, 4);
    }
    $colon_pos = strpos($domain, ':');
    if ($colon_pos !== false) {
        $domain = substr($domain, 0, $colon_pos);
    }
    $pos = strpos(ocp_srv('PHP_SELF'), 'install.php');
    if ($pos === false) {
        $pos = strlen(ocp_srv('PHP_SELF'));
    } else {
        $pos--;
    }
    $port = ocp_srv('SERVER_PORT');
    if ($port == '' || $port == '80' || $port == '443') {
        $port = '';
    } else {
        $port = ':' . $port;
    }
    $base_url = post_param('base_url', 'http://' . $domain . $port . substr(ocp_srv('PHP_SELF'), 0, $pos));
    if (substr($base_url, -1) == '/') {
        $base_url = substr($base_url, 0, strlen($base_url) - 1);
    }
    // Our forum is
    $forum_type = post_param('forum_type');
    require_code('forum/' . $forum_type);
    $GLOBALS['FORUM_DRIVER'] = object_factory('forum_driver_' . filter_naughty_harsh($forum_type));
    $GLOBALS['FORUM_DRIVER']->MEMBER_ROWS_CACHED = array();
    // Try and grab ourselves forum details
    global $INFO;
    $INFO['sql_database'] = '';
    $INFO['sql_user'] = '';
    $INFO['sql_pass'] = '';
    $board_path = post_param('board_path');
    find_forum_path($board_path);
    if (!array_key_exists('board_url', $INFO) || !(strlen($INFO['board_url']) > 0)) {
        $file_base = get_file_base();
        for ($i = 0; $i < strlen($board_path); $i++) {
            if ($i >= strlen($file_base)) {
                break;
            }
            if ($board_path[$i] != $file_base[$i]) {
                break;
            }
        }
        $append = str_replace('\\', '/', substr($board_path, $i));
        $INFO['board_url'] = strlen($append) < 15 ? substr($base_url, 0, strlen($base_url) - ($i - strlen($board_path))) . (strlen($append) > 0 && $append[0] == '/' ? '' : '/') . $append : $base_url . '/forums';
    }
    if (!array_key_exists('cookie_member_id', $INFO)) {
        $INFO['cookie_member_id'] = 'ocp_member_id';
    }
    if (!array_key_exists('cookie_member_hash', $INFO)) {
        $INFO['cookie_member_hash'] = 'ocp_member_hash';
    }
    $cookie_domain = '';
    //(($domain=='localhost') || (strpos($domain,'.')===false))?'':('.'.$domain);
    $cookie_path = '/';
    $cookie_days = '120';
    $use_persistent = false;
    require_code('version');
    $table_prefix = $domain == 'test.ocportal.com' ? $forum_type . '_ocp_' : 'ocp_';
    if (strpos(strtoupper(PHP_OS), 'WIN') !== false) {
        $db_site_host = '127.0.0.1';
    } else {
        $db_site_host = 'localhost';
    }
    $db_site_user = $INFO['sql_user'];
    $db_site_password = $INFO['sql_pass'];
    $db_site = $INFO['sql_database'];
    $db_forums_host = $db_site_host;
    $db_forums_user = $db_site_user;
    $db_forums_password = $db_site_password;
    $db_forums = $db_site;
    $board_prefix = $INFO['board_url'];
    $member_cookie = $INFO['cookie_member_id'];
    $pass_cookie = $INFO['cookie_member_hash'];
    if (function_exists('posix_getpwuid') && strpos(@ini_get('disable_functions'), 'posix_getpwuid') === false) {
        $u_info = posix_getpwuid(fileowner(get_file_base() . '/install.php'));
        if ($u_info !== false) {
            $ftp_username = $u_info['name'];
        } else {
            $ftp_username = '';
        }
    } else {
        $ftp_username = '';
    }
    if (is_null($ftp_username)) {
        $ftp_username = '';
    }
    $dr = array_key_exists('DOCUMENT_ROOT', $_SERVER) ? $_SERVER['DOCUMENT_ROOT'] : (array_key_exists('DOCUMENT_ROOT', $_ENV) ? $_ENV['DOCUMENT_ROOT'] : '');
    if (strpos($dr, '/') !== false) {
        $dr_parts = explode('/', $dr);
    } else {
        $dr_parts = explode('\\', $dr);
    }
    $webdir_stub = $dr_parts[count($dr_parts) - 1];
    // If we have a host where the FTP is two+ levels down (often when we have one FTP covering multiple virtual hosts), then this "last component" rule would be insufficient; do a search through for critical strings to try and make a better guess
    $special_root_dirs = array('public_html', 'www', 'webroot', 'httpdocs', 'wwwroot');
    $webdir_stub = $dr_parts[count($dr_parts) - 1];
    foreach ($dr_parts as $i => $part) {
        if (in_array($part, $special_root_dirs)) {
            $webdir_stub = implode('/', array_slice($dr_parts, $i));
        }
    }
    $ftp_folder = '/' . $webdir_stub . substr(ocp_srv('PHP_SELF'), 0, $pos);
    $ftp_domain = $domain;
    $specifics = $GLOBALS['FORUM_DRIVER']->install_specifics();
    // Now we've gone through all the work of detecting it, lets grab from info.php to see what we had last time we installed
    global $SITE_INFO;
    if (file_exists(get_file_base() . '/info.php') && filesize(get_file_base() . '/info.php') != 0) {
        require_once get_file_base() . '/info.php';
        if ($INFO['sql_database'] != '') {
            if (!array_key_exists('forum_type', $SITE_INFO) || $SITE_INFO['forum_type'] != $forum_type) {
                unset($SITE_INFO['user_cookie']);
                unset($SITE_INFO['pass_cookie']);
            }
            foreach ($specifics as $specific) {
                if (array_key_exists($specific['name'], $SITE_INFO)) {
                    unset($SITE_INFO[$specific['name']]);
                }
            }
            unset($SITE_INFO['db_forums_host']);
            unset($SITE_INFO['db_forums_user']);
            unset($SITE_INFO['db_forums_password']);
            unset($SITE_INFO['db_forums']);
            unset($SITE_INFO['db_site_host']);
            unset($SITE_INFO['db_site_user']);
            unset($SITE_INFO['db_site_password']);
            unset($SITE_INFO['db_site']);
        }
        unset($SITE_INFO['base_url']);
    }
    $sections = new ocp_tempcode();
    // Is this autoinstaller?
    global $FILE_ARRAY;
    if (@is_array($FILE_ARRAY) && !is_suexec_like()) {
        $title = protect_from_escaping(escape_html('FTP'));
        $text = do_lang_tempcode('AUTO_INSTALL');
        $hidden = new ocp_tempcode();
        $options = new ocp_tempcode();
        $options->attach(make_option(do_lang_tempcode('FTP_DOMAIN'), new ocp_tempcode(), 'ftp_domain', post_param('ftp_domain', $ftp_domain), false, true));
        $options->attach(make_option(do_lang_tempcode('FTP_USERNAME'), new ocp_tempcode(), 'ftp_username', post_param('ftp_username', $ftp_username), false, true));
        $options->attach(make_option(do_lang_tempcode('FTP_PASSWORD'), new ocp_tempcode(), 'ftp_password', post_param('ftp_password', ''), true));
        $options->attach(make_option(do_lang_tempcode('FTP_DIRECTORY'), do_lang_tempcode('FTP_FOLDER'), 'ftp_folder', post_param('ftp_folder', $ftp_folder)));
        $options->attach(make_option(do_lang_tempcode('FTP_FILES_PER_GO'), do_lang_tempcode('DESCRIPTION_FTP_FILES_PER_GO'), 'max', post_param('max', '1000')));
        $sections->attach(do_template('INSTALLER_STEP_4_SECTION', array('_GUID' => '50fcb00f4d1da1813e94d86529ea0862', 'HIDDEN' => $hidden, 'TITLE' => $title, 'TEXT' => $text, 'OPTIONS' => $options)));
    }
    $title = do_lang_tempcode('GENERAL_SETTINGS');
    $text = new ocp_tempcode();
    $options = new ocp_tempcode();
    $hidden = new ocp_tempcode();
    $options->attach(make_option(do_lang_tempcode('DOMAIN'), example('DOMAIN_EXAMPLE', 'DOMAIN_TEXT'), 'domain', $domain, false, true));
    $options->attach(make_option(do_lang_tempcode('BASE_URL'), example('BASE_URL_EXAMPLE', 'BASE_URL_TEXT'), 'base_url', $base_url, false, true));
    if (post_param('db_type') != 'xml') {
        $options->attach(make_option(do_lang_tempcode('TABLE_PREFIX'), example('TABLE_PREFIX_EXAMPLE', 'TABLE_PREFIX_TEXT'), 'table_prefix', $table_prefix));
    } else {
        $hidden->attach(form_input_hidden('table_prefix', $table_prefix));
    }
    $admin_password = '';
    $options->attach(make_option(do_lang_tempcode('MASTER_PASSWORD'), example('', 'CHOOSE_ADMIN_PASSWORD'), 'admin_password', $admin_password, true));
    $options->attach(make_tick(do_lang_tempcode('USE_PERSISTENT'), example('', 'USE_PERSISTENT_TEXT'), 'use_persistent', $use_persistent ? 1 : 0));
    //	$options->attach(make_tick(do_lang_tempcode('MULTI_LANG'),example('','MULTI_LANG_TEXT'),'multi_lang',true));
    require_lang('config');
    $options->attach(make_tick(do_lang_tempcode('SEND_ERROR_EMAILS_OCPRODUCTS'), example('', 'CONFIG_OPTION_send_error_emails_ocproducts'), 'allow_reports_default', 1));
    $sections->attach(do_template('INSTALLER_STEP_4_SECTION', array('_GUID' => 'f051465e86a7a53ec078e0d9de773993', 'HIDDEN' => $hidden, 'TITLE' => $title, 'TEXT' => $text, 'OPTIONS' => $options)));
    $hidden = new ocp_tempcode();
    $forum_text = new ocp_tempcode();
    if ($forum_type == 'ocf' || $forum_type == 'none') {
        $forum_title = do_lang_tempcode('FORUM_SETTINGS');
    } else {
        $_forum_type = do_lang('FORUM_CLASS_' . preg_replace('#\\d+$#', '', $forum_type), NULL, NULL, NULL, NULL, false);
        if (is_null($_forum_type)) {
            $_forum_type = ucwords($forum_type);
        }
        $forum_title = do_lang_tempcode('_FORUM_SETTINGS', escape_html($_forum_type));
    }
    $forum_options = new ocp_tempcode();
    $use_msn = post_param_integer('use_msn', 0);
    if ($use_msn == 0) {
        $use_msn = post_param_integer('use_multi_db', 0);
    }
    $forum_type = post_param('forum_type');
    if ($forum_type != 'none') {
        if ($use_msn == 1) {
            if ($forum_type != 'ocf') {
                $forum_text = do_lang_tempcode('AUTODETECT');
            }
            $forum_options->attach(make_option(do_lang_tempcode('DATABASE_NAME'), new ocp_tempcode(), 'db_forums', $db_forums, false, true));
            if (!$GLOBALS['DB_STATIC_OBJECT']->db_is_flat_file_simple()) {
                $forum_options->attach(make_option(do_lang_tempcode('DATABASE_HOST'), example('', 'DATABASE_HOST_TEXT'), 'db_forums_host', $db_forums_host, false, true));
                $forum_options->attach(make_option(do_lang_tempcode('DATABASE_USERNAME'), new ocp_tempcode(), 'db_forums_user', $db_forums_user, false, true));
                $forum_options->attach(make_option(do_lang_tempcode('DATABASE_PASSWORD'), new ocp_tempcode(), 'db_forums_password', $db_forums_password, true));
            } else {
                $hidden->attach(form_input_hidden('db_forums_host', 'localhost'));
                $hidden->attach(form_input_hidden('db_forums_user', ''));
                $hidden->attach(form_input_hidden('db_forums_password', ''));
            }
            $hidden->attach(form_input_hidden('use_msn', strval($use_msn)));
        }
        if ($forum_type != 'ocf' || $use_msn == 1) {
            $forum_options->attach(make_option(do_lang_tempcode('BASE_URL'), example('FORUM_BASE_URL_EXAMPLE', 'BASE_URL_TEXT_FORUM'), 'board_prefix', $board_prefix, false, true));
        }
    }
    foreach ($specifics as $specific) {
        if ($specific['name'] == 'clear_existing_forums_on_install') {
            $hidden->attach(form_input_hidden('clear_existing_forums_on_install', 'yes'));
        } elseif ($specific['name'] == 'ocf_table_prefix' && $use_msn == 0) {
            // Nothing
        } else {
            $forum_options->attach(make_option(is_object($specific['title']) ? $specific['title'] : make_string_tempcode($specific['title']), is_object($specific['description']) ? $specific['description'] : make_string_tempcode($specific['description']), $specific['name'], array_key_exists($specific['name'], $SITE_INFO) ? $SITE_INFO[$specific['name']] : $specific['default'], strpos($specific['name'], 'password') !== false));
        }
    }
    $text = $use_msn == 1 ? do_lang_tempcode($forum_type == 'ocf' ? 'DUPLICATE_OCF' : 'DUPLICATE') : new ocp_tempcode();
    $options = make_option(do_lang_tempcode('DATABASE_NAME'), new ocp_tempcode(), 'db_site', $db_site, false, true);
    if (!$GLOBALS['DB_STATIC_OBJECT']->db_is_flat_file_simple()) {
        $options->attach(make_option(do_lang_tempcode('DATABASE_HOST'), example('', 'DATABASE_HOST_TEXT'), 'db_site_host', $db_site_host, false, true));
        $options->attach(make_option(do_lang_tempcode('DATABASE_USERNAME'), new ocp_tempcode(), 'db_site_user', $db_site_user, false, true));
        $options->attach(make_option(do_lang_tempcode('DATABASE_PASSWORD'), new ocp_tempcode(), 'db_site_password', $db_site_password, true));
    } else {
        $hidden->attach(form_input_hidden('db_site_host', 'localhost'));
        $hidden->attach(form_input_hidden('db_site_user', ''));
        $hidden->attach(form_input_hidden('db_site_password', ''));
    }
    if ($use_msn == 0 && $forum_type != 'ocf') {
        $forum_options->attach($options);
        $sections->attach(do_template('INSTALLER_STEP_4_SECTION', array('HIDDEN' => $hidden, 'TITLE' => $forum_title, 'TEXT' => $forum_text, 'OPTIONS' => $forum_options)));
    } else {
        $title = do_lang_tempcode('OCPORTAL_SETTINGS');
        if (!$forum_options->is_empty()) {
            $sections->attach(do_template('INSTALLER_STEP_4_SECTION', array('_GUID' => '232b69a995f384275c1cd9269a42c3b8', 'HIDDEN' => '', 'TITLE' => $forum_title, 'TEXT' => $forum_text, 'OPTIONS' => $forum_options)));
        }
        $sections->attach(do_template('INSTALLER_STEP_4_SECTION', array('_GUID' => '15e0f275f78414b6c4fe7775a1cacb23', 'HIDDEN' => $hidden, 'TITLE' => $title, 'TEXT' => $text, 'OPTIONS' => $options)));
    }
    $title = do_lang_tempcode('COOKIE_SETTINGS');
    $text = new ocp_tempcode();
    $options = new ocp_tempcode();
    $hidden = new ocp_tempcode();
    $options->attach(make_option(do_lang_tempcode('COOKIE'), example('COOKIE_EXAMPLE', 'COOKIE_TEXT'), 'user_cookie', $member_cookie, false, true));
    $options->attach(make_option(do_lang_tempcode('COOKIE_PASSWORD'), example('COOKIE_PASSWORD_EXAMPLE', 'COOKIE_PASSWORD_TEXT'), 'pass_cookie', $pass_cookie, false, true));
    $options->attach(make_option(do_lang_tempcode('COOKIE_DOMAIN'), example('COOKIE_DOMAIN_EXAMPLE', 'COOKIE_DOMAIN_TEXT'), 'cookie_domain', $cookie_domain));
    $options->attach(make_option(do_lang_tempcode('COOKIE_PATH'), example('COOKIE_PATH_EXAMPLE', 'COOKIE_PATH_TEXT'), 'cookie_path', $cookie_path));
    $options->attach(make_option(do_lang_tempcode('COOKIE_DAYS'), example('COOKIE_DAYS_EXAMPLE', 'COOKIE_DAYS_TEXT'), 'cookie_days', $cookie_days, false, true));
    $temp = do_template('INSTALLER_STEP_4_SECTION', array('_GUID' => '3b9ea022164801f4b60780a4a966006f', 'HIDDEN' => $hidden, 'TITLE' => $title, 'TEXT' => $text, 'OPTIONS' => $options));
    $sections->attach(do_template('INSTALLER_STEP_4_SECTION_HIDE', array('_GUID' => '42eb3d44bcf8ef99987b6daa9e6530aa', 'TITLE' => $title, 'CONTENT' => $temp)));
    $js = do_template('JAVASCRIPT');
    $js->attach(chr(10));
    $js->attach(do_template('JAVASCRIPT_AJAX'));
    $message = paragraph(do_lang_tempcode('BASIC_CONFIG'));
    if ($forum_type != 'none' && $forum_type != 'ocf') {
        $message->attach(paragraph(do_lang_tempcode('FORUM_DRIVER_NATIVE_LOGIN')));
    }
    return do_template('INSTALLER_STEP_4', array('_GUID' => '73c3ac0a7108709b74b2e89cae30be12', 'JS' => $js, 'MESSAGE' => $message, 'LANG' => $LANG, 'DB_TYPE' => post_param('db_type'), 'FORUM_TYPE' => $forum_type, 'BOARD_PATH' => $board_path, 'SECTIONS' => $sections, 'MAX' => strval(post_param_integer('max', 1000))));
}
Exemplo n.º 3
0
/**
 * Erstellt Formular für DateTime "tt.mm.yy hh:mm:ss"
 */
function makeDateTimeForm($formName, $datetime, $umbruch = true, $class = "")
{
    $datetime = str_replace(".", " ", $datetime);
    $datetime = str_replace(":", " ", $datetime);
    // var_dump($datetime); $datetime = explode(" ", $datetime); var_dump($datetime);
    list($dd, $mm, $yy, $hh, $ii, $ss) = explode(" ", $datetime);
    // echo "tt,mm,yy,hh,ii,ss = $tt,$mm,$yy,$hh,$ii,$ss";
    $selectStr = '<select ';
    if ($class) {
        $selectStr .= 'class="' . $class . '" ';
    }
    $return = $selectStr . 'title="Datum" name="' . $formName . '_d">' . make_option(make_array(1, 31), $dd) . '</select>.';
    $return .= $selectStr . 'title="Datum" name="' . $formName . '_m">' . make_option(make_array(1, 12), $mm) . '</select>.';
    $return .= $selectStr . 'title="Datum" name="' . $formName . '_y">' . make_option(make_array(3, 10), $yy) . '</select>';
    if ($umbruch) {
        $return .= '<br>';
    } else {
        $return .= '&nbsp;';
    }
    $return .= $selectStr . 'title="Uhrzeit" name="' . $formName . '_h">' . make_option(make_array(0, 23), $hh) . '</select>:';
    $return .= $selectStr . 'title="Uhrzeit" name="' . $formName . '_i">' . make_option(make_array(0, 59), $ii) . '</select>:';
    $return .= $selectStr . 'title="Uhrzeit" name="' . $formName . '_s">' . make_option(make_array(0, 59), $ss) . '</select>';
    return $return;
}