mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-12 01:50:48 +01:00
renamed "homepage" directory to "themes"
This commit is contained in:
parent
eef4993794
commit
e6d7e71175
@ -246,10 +246,10 @@
|
||||
//$config['dir']['static'] = $config['root'] . 'static/';
|
||||
// Where to store the .html templates. This folder and templates must exist or fatal errors will be thrown.
|
||||
$config['dir']['template'] = getcwd() . '/templates';
|
||||
// For the homepage generation files (themes, etc.)
|
||||
$config['dir']['homepage'] = getcwd() . '/templates/homepage';
|
||||
// For the themes (homepages, etc.)
|
||||
$config['dir']['themes'] = getcwd() . '/templates/themes';
|
||||
// Same as above, but a URI (accessable by web interface, not locally)
|
||||
$config['dir']['homepage_uri'] = 'templates/homepage';
|
||||
$config['dir']['themes_uri'] = 'templates/themes';
|
||||
// Homepage directory
|
||||
$config['dir']['home'] = '';
|
||||
|
||||
|
@ -143,11 +143,11 @@
|
||||
function loadThemeConfig($_theme) {
|
||||
global $config;
|
||||
|
||||
if(!file_exists($config['dir']['homepage'] . '/' . $_theme . '/info.php'))
|
||||
if(!file_exists($config['dir']['themes'] . '/' . $_theme . '/info.php'))
|
||||
return false;
|
||||
|
||||
// Load theme information into $theme
|
||||
include $config['dir']['homepage'] . '/' . $_theme . '/info.php';
|
||||
include $config['dir']['themes'] . '/' . $_theme . '/info.php';
|
||||
return $theme;
|
||||
}
|
||||
|
||||
@ -162,8 +162,8 @@
|
||||
|
||||
$theme = loadThemeConfig($_theme);
|
||||
|
||||
if(file_exists($config['dir']['homepage'] . '/' . $_theme . '/theme.php')) {
|
||||
require_once $config['dir']['homepage'] . '/' . $_theme . '/theme.php';
|
||||
if(file_exists($config['dir']['themes'] . '/' . $_theme . '/theme.php')) {
|
||||
require_once $config['dir']['themes'] . '/' . $_theme . '/theme.php';
|
||||
$theme['build_function']($action, themeSettings());
|
||||
}
|
||||
|
||||
|
14
mod.php
14
mod.php
@ -317,17 +317,17 @@
|
||||
echo Element('page.html', Array(
|
||||
'config'=>$config,
|
||||
'title'=>'No theme',
|
||||
'body'=>'<p style="text-align:center">Successfully stopped using any themes. You\'ll have to create a homepage manually if you want one.</p>',
|
||||
'body'=>'<p style="text-align:center">Successfully stopped using all themes.</p>',
|
||||
'mod'=>true
|
||||
)
|
||||
);
|
||||
} elseif(preg_match('/^\/themes(\/(\w+))?$/', $query, $match)) {
|
||||
if($mod['type'] < $config['mod']['themes']) error($config['error']['noaccess']);
|
||||
|
||||
if(!is_dir($config['dir']['homepage']))
|
||||
error('Homepage directory doesn\'t exist!');
|
||||
if(!$dir = opendir($config['dir']['homepage']))
|
||||
error('Cannot open homepage directory; check permissions.');
|
||||
if(!is_dir($config['dir']['themes']))
|
||||
error('Themes directory doesn\'t exist!');
|
||||
if(!$dir = opendir($config['dir']['themes']))
|
||||
error('Cannot open themes directory; check permissions.');
|
||||
|
||||
if(isset($match[2])) {
|
||||
$_theme = &$match[2];
|
||||
@ -406,7 +406,7 @@
|
||||
// Scan directory for themes
|
||||
$themes = Array();
|
||||
while($file = readdir($dir)) {
|
||||
if($file[0] != '.' && is_dir($config['dir']['homepage'] . '/' . $file)) {
|
||||
if($file[0] != '.' && is_dir($config['dir']['themes'] . '/' . $file)) {
|
||||
$themes[] = $file;
|
||||
}
|
||||
}
|
||||
@ -436,7 +436,7 @@
|
||||
'</tr>' .
|
||||
'<tr>' .
|
||||
'<th class="minimal">Thumbnail</th>' .
|
||||
'<td><img style="float:none;margin:4px" src="' . $config['dir']['homepage_uri'] . '/' . $_theme . '/thumb.png" /></td>' .
|
||||
'<td><img style="float:none;margin:4px" src="' . $config['dir']['themes_uri'] . '/' . $_theme . '/thumb.png" /></td>' .
|
||||
'</tr>' .
|
||||
'<tr>' .
|
||||
'<th class="minimal">Actions</th>' .
|
||||
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.1 KiB |
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Loading…
Reference in New Issue
Block a user