Skip to content

Commit

Permalink
- If your default (and only!) template folder isn't there, well, can'…
Browse files Browse the repository at this point in the history
…t do anything for you! (Subs-Template.php, Errors.english.php)

- Removed a remaining backslash transform. Feels so good, eh! (Subs-Cache.php)

- Removed path settings page. $boardurl is now set through the basic settings page. (Admin.php, ManageSettings.php, Admin.english.php)

- Removed remaining images_url, theme_url and theme_dir vars. (QueryString.php, ManageSettings.english.php)
  • Loading branch information
Nao committed Mar 20, 2014
1 parent 3969e46 commit fde20c5
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 79 deletions.
3 changes: 0 additions & 3 deletions core/app/Admin.php
Expand Up @@ -68,8 +68,6 @@ function Admin()
'subsections' => array(
'basic' => array($txt['mods_cat_features']),
'',
'paths' => array($txt['path_settings']),
'',
'pretty' => array($txt['pretty_urls']),
),
),
Expand Down Expand Up @@ -885,7 +883,6 @@ function AdminSearchInternal()
$search = array(
'settings' => array(
array('ModifyBasicSettings', 'area=featuresettings;sa=basic'),
array('ModifyPathSettings', 'area=featuresettings;sa=paths'),
array('ModifyPrettyURLs', 'area=featuresettings;sa=pretty'),
array('ModifySignatureSettings', 'area=memberoptions;sa=sig'),
array('ModifyWhosOnline', 'area=memberoptions;sa=whosonline'),
Expand Down
35 changes: 1 addition & 34 deletions core/app/ManageSettings.php
Expand Up @@ -66,7 +66,6 @@ function ModifyFeatureSettings()

$subActions = array(
'basic' => 'ModifyBasicSettings',
'paths' => 'ModifyPathSettings',
'pretty' => 'ModifyPrettyURLs',
);

Expand All @@ -80,8 +79,6 @@ function ModifyFeatureSettings()
'tabs' => array(
'basic' => array(
),
'paths' => array(
),
'pretty' => array(
'description' => $txt['pretty_urls_desc'],
),
Expand All @@ -98,6 +95,7 @@ function ModifyBasicSettings($return_config = false)

$config_vars = array(
array('text', 'mbname', 30, 'file' => true),
array('text', 'boardurl', 40, 'file' => true),
array('text', 'home_url', 40, 'subtext' => $txt['home_url_subtext']),
array('check', 'home_link', 'subtext' => $txt['home_link_subtext']),
'',
Expand Down Expand Up @@ -164,37 +162,6 @@ function ModifyBasicSettings($return_config = false)
prepareDBSettingContext($config_vars);
}

// Basic path settings - absolute locations for main folders.
function ModifyPathSettings($return_config = false)
{
global $context, $txt;

$config_vars = array(
array('text', 'boardurl', 36, 'file' => true),
'',
array('text', 'theme_url', 36),
array('text', 'theme_dir', 36),
array('text', 'images_url', 36),
);

if ($return_config)
return $config_vars;

// Setup the template stuff.
$context['post_url'] = '<URL>?action=admin;area=featuresettings;sa=paths;save';
$context['settings_title'] = $txt['path_settings'];

// Saving settings?
if (isset($_REQUEST['save']))
{
saveSettings($config_vars);
redirectexit('action=admin;area=featuresettings;sa=paths;' . $context['session_query']);
}

// Fill the config array.
prepareDBSettingContext($config_vars);
}

// Let's try keep the spam to a minimum ah Thantos?
function ModifySpamSettings($return_config = false)
{
Expand Down
3 changes: 0 additions & 3 deletions core/app/QueryString.php
Expand Up @@ -70,9 +70,6 @@ function loadPaths()
$boardurl = $detected_url;
$scripturl = strtr($scripturl, array($oldurl => $boardurl));
$_SERVER['REQUEST_URL'] = strtr($_SERVER['REQUEST_URL'], array($oldurl => $boardurl));

// Fix the theme urls...
$settings['theme_url'] = strtr($settings['theme_url'], array($oldurl => $boardurl));
}
}

Expand Down
2 changes: 1 addition & 1 deletion core/app/Subs-Cache.php
Expand Up @@ -671,7 +671,7 @@ function wedge_cache_css_files($folder, $ids, $latest_date, $css, $gzip = false,

// Load all CSS files in order, and replace $here with the current folder while we're at it.
foreach ((array) $css as $file)
$final .= str_replace('$here', $relative_root . str_replace('\\', '/', str_replace(ROOT_DIR, '', dirname($file))), file_get_contents($file));
$final .= str_replace('$here', $relative_root . str_replace(ROOT_DIR, '', dirname($file)), file_get_contents($file));

if (empty($final)) // Nothing loaded...?
{
Expand Down
17 changes: 0 additions & 17 deletions core/app/Subs-Template.php
Expand Up @@ -1304,23 +1304,6 @@ function loadTemplate($template_name, $fatal = true)
if (function_exists('template_' . $template_name . '_init'))
call_user_func('template_' . $template_name . '_init');
}
// Hmmm... doesn't exist?! I don't suppose the directory is wrong, is it?
// !! @todo: remove this..?
elseif (!file_exists(TEMPLATES_DIR) && file_exists(ROOT_DIR . '/core/html'))
{
$context['template_folders'][] = $settings['theme_dir'] = ROOT_DIR . '/core/html';

if (we::$is_admin)
{
loadLanguage('Errors');
echo '
<div class="alert errorbox">
<a href="', SCRIPT, '?action=admin;area=featuresettings;sa=paths;', $context['session_query'], '" class="alert">', $txt['theme_dir_wrong'], '</a>
</div>';
}

loadTemplate($template_name);
}
// Cause an error otherwise.
elseif ($fatal)
{
Expand Down
1 change: 0 additions & 1 deletion core/languages/Admin.english.php
Expand Up @@ -461,7 +461,6 @@

$txt['general_settings'] = 'General';
$txt['database_settings'] = 'Database';
$txt['path_settings'] = 'Paths';
$txt['cookies_sessions_settings'] = 'Cookies and Sessions';
$txt['caching_settings'] = 'Caching';
$txt['load_balancing_settings'] = 'Load Balancing';
Expand Down
1 change: 0 additions & 1 deletion core/languages/Errors.english.php
Expand Up @@ -132,7 +132,6 @@
$txt['cannot_who_view'] = 'Sorry - you don\'t have the proper permissions to view the Who\'s Online list.';
$txt['stats_not_available'] = 'The forum statistics are not available.';

$txt['theme_dir_wrong'] = 'The default theme\'s directory is wrong, please correct it by clicking this text.';
$txt['registration_disabled'] = 'Sorry, registration is currently disabled.';
$txt['registration_no_secret_question'] = 'Sorry, there is no secret question set for this member.';
$txt['poll_range_error'] = 'Sorry, the poll must run for more than 0 days.';
Expand Down
3 changes: 0 additions & 3 deletions core/languages/ManageSettings.english.php
Expand Up @@ -116,9 +116,6 @@
$txt['likes_own_posts'] = 'Users can like their own posts';

$txt['boardurl'] = 'Forum URL';
$txt['theme_dir'] = 'Path to HTML templates';
$txt['theme_url'] = 'URL to HTML templates';
$txt['images_url'] = 'URL to assets folder';

$txt['caching_information'] = '<div class="center" style="font-weight: bold; text-decoration: underline">Important! Read this first before enabling these features.</div><br>
Wedge supports caching through the use of accelerators. The currently supported accelerators include:<br>
Expand Down
19 changes: 6 additions & 13 deletions install/install.php
Expand Up @@ -1872,20 +1872,13 @@ function init_variables()
$boardurl = 'http' . (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off' ? 's' : '') . '://' . $host;
$boardurl .= substr($_SERVER['REQUEST_URI'], 0, strrpos($_SERVER['REQUEST_URI'], '/'));

$settings['theme_dir'] = $boarddir . '/core/html';
$settings['theme_url'] = $boardurl . '/core/html';

// Define our constants. (cf. QueryString.php)
define('SCRIPT', $boarddir . '/index.php');
define('ROOT', $boardurl);
define('TEMPLATES', $settings['theme_url']);
define('TEMPLATES_DIR', $settings['theme_dir']);
define('SKINS', ROOT . '/core/skins');
define('SKINS_DIR', ROOT_DIR . '/core/skins');
define('LANGUAGES', ROOT . '/core/languages');
define('LANGUAGES_DIR', ROOT_DIR . '/core/languages');
define('ASSETS', ROOT . '/assets');
define('ASSETS_DIR', ROOT_DIR . '/assets');
define('ROOT', $boardurl);
define('SCRIPT', $boarddir . '/index.php');
define('TEMPLATES', $boardurl . '/core/html'); define('TEMPLATES_DIR', $boarddir . '/core/html');
define('SKINS', ROOT . '/core/skins'); define('SKINS_DIR', ROOT_DIR . '/core/skins');
define('LANGUAGES', ROOT . '/core/languages'); define('LANGUAGES_DIR', ROOT_DIR . '/core/languages');
define('ASSETS', ROOT . '/assets'); define('ASSETS_DIR', ROOT_DIR . '/assets');

westr::getInstance();
we::getInstance(false);
Expand Down
3 changes: 0 additions & 3 deletions install/install.sql
Expand Up @@ -2102,9 +2102,6 @@ INSERT INTO {$db_prefix}settings
(variable, value)
VALUES
('language', '{$language}'),
('theme_dir', '{$boarddir}/core/html'),
('theme_url', '{$boardurl}/core/html'),
('images_url', '{$boardurl}/assets'),
('news', 'e{$default_news}'),
('todayMod', '2'),
('enablePreviousNext', '1'),
Expand Down

0 comments on commit fde20c5

Please sign in to comment.