Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: index.php 5092 2010-07-17 11:09:40Z Huji $
| * $Id: index.php 5816 2012-04-23 15:42:18Z Tomm $
|
*/
if(function_exists("unicode_decode"))
| */
if(function_exists("unicode_decode"))
|
Zeile 1385 | Zeile 1385 |
---|
if(strstr($mybb->input['dbengine'], "sqlite") !== false) {
|
if(strstr($mybb->input['dbengine'], "sqlite") !== false) {
|
if(strstr($config['dbname'], "./") !== false || strstr($config['dbname'], "../") !== false)
| if(strstr($config['dbname'], "./") !== false || strstr($config['dbname'], "../") !== false || empty($config['dbname']))
|
{ $errors[] = $lang->db_step_error_sqlite_invalid_dbname; database_info();
| { $errors[] = $lang->db_step_error_sqlite_invalid_dbname; database_info();
|
Zeile 1464 | Zeile 1464 |
---|
* * Please see the MyBB Wiki for advanced * database configuration for larger installations
|
* * Please see the MyBB Wiki for advanced * database configuration for larger installations
|
* http://wiki.mybboard.net/
| * http://wiki.mybb.com/
|
*/
\$config['database']['type'] = '{$mybb->input['dbengine']}';
| */
\$config['database']['type'] = '{$mybb->input['dbengine']}';
|
Zeile 1625 | Zeile 1625 |
---|
$db->query($val); }
|
$db->query($val); }
|
// Update the fid sequence for PgSQL
| // Update the sequences for PgSQL
|
if($config['database']['type'] == "pgsql") {
|
if($config['database']['type'] == "pgsql") {
|
$db->query("ALTER SEQUENCE ".$config['database']['table_prefix']."forums_fid_seq RESTART WITH 3");
| $db->query("SELECT setval('{$config['database']['table_prefix']}attachtypes_atid_seq', (SELECT max(atid) FROM {$config['database']['table_prefix']}attachtypes));"); $db->query("SELECT setval('{$config['database']['table_prefix']}forums_fid_seq', (SELECT max(fid) FROM {$config['database']['table_prefix']}forums));"); $db->query("SELECT setval('{$config['database']['table_prefix']}helpdocs_hid_seq', (SELECT max(hid) FROM {$config['database']['table_prefix']}helpdocs));"); $db->query("SELECT setval('{$config['database']['table_prefix']}helpsections_sid_seq', (SELECT max(sid) FROM {$config['database']['table_prefix']}helpsections));"); $db->query("SELECT setval('{$config['database']['table_prefix']}icons_iid_seq', (SELECT max(iid) FROM {$config['database']['table_prefix']}icons));"); $db->query("SELECT setval('{$config['database']['table_prefix']}profilefields_fid_seq', (SELECT max(fid) FROM {$config['database']['table_prefix']}profilefields));"); $db->query("SELECT setval('{$config['database']['table_prefix']}smilies_sid_seq', (SELECT max(sid) FROM {$config['database']['table_prefix']}smilies));"); $db->query("SELECT setval('{$config['database']['table_prefix']}spiders_sid_seq', (SELECT max(sid) FROM {$config['database']['table_prefix']}spiders));"); $db->query("SELECT setval('{$config['database']['table_prefix']}templategroups_gid_seq', (SELECT max(gid) FROM {$config['database']['table_prefix']}templategroups));");
|
}
echo $lang->populate_step_inserted;
| }
echo $lang->populate_step_inserted;
|
Zeile 1715 | Zeile 1723 |
---|
$websiteurl = $hostname.'/'; $websitename = 'Your Website'; $contactemail = '';
|
$websiteurl = $hostname.'/'; $websitename = 'Your Website'; $contactemail = '';
|
| $protocol = "http://"; if((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != "off") || substr($bburl, 0, 5) == "https") { $protocol = "https://"; }
|
// Attempt auto-detection if($_SERVER['HTTP_HOST']) {
|
// Attempt auto-detection if($_SERVER['HTTP_HOST']) {
|
$hostname = 'http://'.$_SERVER['HTTP_HOST'];
| $hostname = $protocol.$_SERVER['HTTP_HOST'];
|
$cookiedomain = '.'.$_SERVER['HTTP_HOST']; } elseif($_SERVER['SERVER_NAME']) {
|
$cookiedomain = '.'.$_SERVER['HTTP_HOST']; } elseif($_SERVER['SERVER_NAME']) {
|
$hostname = 'http://'.$_SERVER['SERVER_NAME'];
| $hostname = $protocol.$_SERVER['SERVER_NAME'];
|
$cookiedomain = '.'.$_SERVER['SERVER_NAME']; }
| $cookiedomain = '.'.$_SERVER['SERVER_NAME']; }
|
Zeile 1732 | Zeile 1747 |
---|
$cookiedomain = my_substr($cookiedomain, 4); }
|
$cookiedomain = my_substr($cookiedomain, 4); }
|
if($_SERVER['HTTP_HOST'] == 'localhost' || $_SERVER['SERVER_NAME'] == 'localhost')
| if($_SERVER['HTTP_HOST'] == 'localhost' || $_SERVER['SERVER_NAME'] == 'localhost' || ip2long($_SERVER['SERVER_NAME']) != false)
|
{ $cookiedomain = ''; }
| { $cookiedomain = ''; }
|
Zeile 1837 | Zeile 1852 |
---|
'optionscode' => $db->escape_string($setting['optionscode'][0]['value']), 'value' => $db->escape_string($setting['settingvalue'][0]['value']), 'disporder' => intval($setting['disporder'][0]['value']),
|
'optionscode' => $db->escape_string($setting['optionscode'][0]['value']), 'value' => $db->escape_string($setting['settingvalue'][0]['value']), 'disporder' => intval($setting['disporder'][0]['value']),
|
'gid' => $gid
| 'gid' => $gid, 'isdefault' => 1
|
);
$db->insert_query('settings', $settingdata);
| );
$db->insert_query('settings', $settingdata);
|
Zeile 1906 | Zeile 1922 |
---|
{ $fields[] = $field['attributes']['name']; }
|
{ $fields[] = $field['attributes']['name']; }
|
|
|
$conditions = array();
|
$conditions = array();
|
| |
if(is_array($view['conditions'][0]['condition'])) { foreach($view['conditions'][0]['condition'] as $condition)
| if(is_array($view['conditions'][0]['condition'])) { foreach($view['conditions'][0]['condition'] as $condition)
|
Zeile 1918 | Zeile 1934 |
---|
$condition['value'] = unserialize($condition['value']); } $conditions[$condition['attributes']['name']] = $condition['value'];
|
$condition['value'] = unserialize($condition['value']); } $conditions[$condition['attributes']['name']] = $condition['value'];
|
| } }
$custom_profile_fields = array(); if(is_array($view['custom_profile_fields'][0]['field'])) { foreach($view['custom_profile_fields'][0]['field'] as $field) { $custom_profile_fields[] = $field['attributes']['name'];
|
} }
| } }
|
Zeile 1928 | Zeile 1953 |
---|
"title" => $db->escape_string($view['title'][0]['value']), "fields" => $db->escape_string(serialize($fields)), "conditions" => $db->escape_string(serialize($conditions)),
|
"title" => $db->escape_string($view['title'][0]['value']), "fields" => $db->escape_string(serialize($fields)), "conditions" => $db->escape_string(serialize($conditions)),
|
| "custom_profile_fields" => $db->escape_string(serialize($custom_profile_fields)),
|
"sortby" => $db->escape_string($view['sortby'][0]['value']), "sortorder" => $db->escape_string($view['sortorder'][0]['value']), "perpage" => intval($view['perpage'][0]['value']),
| "sortby" => $db->escape_string($view['sortby'][0]['value']), "sortorder" => $db->escape_string($view['sortorder'][0]['value']), "perpage" => intval($view['perpage'][0]['value']),
|
Zeile 1936 | Zeile 1962 |
---|
$db->insert_query("adminviews", $new_view); $view_count++; }
|
$db->insert_query("adminviews", $new_view); $view_count++; }
|
|
|
echo $lang->sprintf($lang->admin_step_insertedviews, $view_count);
echo $lang->admin_step_createadmin;
| echo $lang->sprintf($lang->admin_step_insertedviews, $view_count);
echo $lang->admin_step_createadmin;
|
Zeile 1983 | Zeile 2009 |
---|
echo $lang->done_step_usergroupsinserted; // Insert all of our user groups from the XML file
|
echo $lang->done_step_usergroupsinserted; // Insert all of our user groups from the XML file
|
$settings = file_get_contents(INSTALL_ROOT.'resources/usergroups.xml'); $parser = new XMLParser($settings); $parser->collapse_dups = 0;
| $usergroup_settings = file_get_contents(INSTALL_ROOT.'resources/usergroups.xml'); $parser = new XMLParser($usergroup_settings); $parser->collapse_dups = 0;
|
$tree = $parser->get_tree();
$admin_gid = '';
| $tree = $parser->get_tree();
$admin_gid = '';
|
Zeile 1995 | Zeile 2021 |
---|
// usergroup[cancp][0][value] $new_group = array(); foreach($usergroup as $key => $value)
|
// usergroup[cancp][0][value] $new_group = array(); foreach($usergroup as $key => $value)
|
{
| {
|
if(!is_array($value)) { continue; } $new_group[$key] = $db->escape_string($value[0]['value']);
|
if(!is_array($value)) { continue; } $new_group[$key] = $db->escape_string($value[0]['value']);
|
}
| }
|
$db->insert_query("usergroups", $new_group, false); // If this group can access the admin CP and we haven't established the admin group - set it (just in case we ever change IDs)
| $db->insert_query("usergroups", $new_group, false); // If this group can access the admin CP and we haven't established the admin group - set it (just in case we ever change IDs)
|
Zeile 2012 | Zeile 2038 |
---|
} $group_count++; }
|
} $group_count++; }
|
| // Restart usergroup sequence with correct # of groups if($config['database']['type'] == "pgsql") { $db->query("SELECT setval('{$config['database']['table_prefix']}usergroups_gid_seq', (SELECT max(gid) FROM {$config['database']['table_prefix']}usergroups));"); }
|
echo $lang->done . '</p>'; echo $lang->done_step_admincreated;
| echo $lang->done . '</p>'; echo $lang->done_step_admincreated;
|
Zeile 2126 | Zeile 2159 |
---|
{ $db->create_fulltext_index('posts', 'message'); }
|
{ $db->create_fulltext_index('posts', 'message'); }
|
// Register a shutdown function which actually tests if this functionality is working add_shutdown('test_shutdown_function');
| |
echo $lang->done_step_cachebuilding; require_once MYBB_ROOT.'inc/class_datacache.php';
| echo $lang->done_step_cachebuilding; require_once MYBB_ROOT.'inc/class_datacache.php';
|
Zeile 2151 | Zeile 2181 |
---|
$cache->update_spiders(); $cache->update_bannedips(); $cache->update_banned();
|
$cache->update_spiders(); $cache->update_bannedips(); $cache->update_banned();
|
| $cache->update_bannedemails();
|
$cache->update_birthdays(); $cache->update_groupleaders();
|
$cache->update_birthdays(); $cache->update_groupleaders();
|
| $cache->update_threadprefixes(); $cache->update_forumsdisplay();
|
$cache->update("plugins", array()); $cache->update("internal_settings", array('encryption_key' => random_str(32)));
| $cache->update("plugins", array()); $cache->update("internal_settings", array('encryption_key' => random_str(32)));
|
Zeile 2247 | Zeile 2280 |
---|
fwrite($file, $settings); fclose($file); }
|
fwrite($file, $settings); fclose($file); }
|
}
function test_shutdown_function() { global $db; $db->update_query("settings", array('value' => 1), "name='useshutdownfunc'"); write_settings();
| |
} ?>
| } ?>
|