Browse Source

renamed "homepage" directory to "themes"

pull/40/head
Savetheinternet 13 years ago
parent
commit
e6d7e71175
  1. 6
      inc/config.php
  2. 8
      inc/functions.php
  3. 14
      mod.php
  4. 0
      templates/themes/basic/info.php
  5. 0
      templates/themes/basic/theme.php
  6. 0
      templates/themes/basic/thumb.png
  7. 0
      templates/themes/frameset/info.php
  8. 0
      templates/themes/frameset/theme.php
  9. 0
      templates/themes/frameset/thumb.png
  10. 0
      templates/themes/recent/info.php
  11. 0
      templates/themes/recent/recent.css
  12. 0
      templates/themes/recent/theme.php
  13. 0
      templates/themes/recent/thumb.png

6
inc/config.php

@ -246,10 +246,10 @@
//$config['dir']['static'] = $config['root'] . 'static/'; //$config['dir']['static'] = $config['root'] . 'static/';
// Where to store the .html templates. This folder and templates must exist or fatal errors will be thrown. // Where to store the .html templates. This folder and templates must exist or fatal errors will be thrown.
$config['dir']['template'] = getcwd() . '/templates'; $config['dir']['template'] = getcwd() . '/templates';
// For the homepage generation files (themes, etc.) // For the themes (homepages, etc.)
$config['dir']['homepage'] = getcwd() . '/templates/homepage'; $config['dir']['themes'] = getcwd() . '/templates/themes';
// Same as above, but a URI (accessable by web interface, not locally) // 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 // Homepage directory
$config['dir']['home'] = ''; $config['dir']['home'] = '';

8
inc/functions.php

@ -143,11 +143,11 @@
function loadThemeConfig($_theme) { function loadThemeConfig($_theme) {
global $config; global $config;
if(!file_exists($config['dir']['homepage'] . '/' . $_theme . '/info.php')) if(!file_exists($config['dir']['themes'] . '/' . $_theme . '/info.php'))
return false; return false;
// Load theme information into $theme // Load theme information into $theme
include $config['dir']['homepage'] . '/' . $_theme . '/info.php'; include $config['dir']['themes'] . '/' . $_theme . '/info.php';
return $theme; return $theme;
} }
@ -162,8 +162,8 @@
$theme = loadThemeConfig($_theme); $theme = loadThemeConfig($_theme);
if(file_exists($config['dir']['homepage'] . '/' . $_theme . '/theme.php')) { if(file_exists($config['dir']['themes'] . '/' . $_theme . '/theme.php')) {
require_once $config['dir']['homepage'] . '/' . $_theme . '/theme.php'; require_once $config['dir']['themes'] . '/' . $_theme . '/theme.php';
$theme['build_function']($action, themeSettings()); $theme['build_function']($action, themeSettings());
} }

14
mod.php

@ -317,17 +317,17 @@
echo Element('page.html', Array( echo Element('page.html', Array(
'config'=>$config, 'config'=>$config,
'title'=>'No theme', '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 'mod'=>true
) )
); );
} elseif(preg_match('/^\/themes(\/(\w+))?$/', $query, $match)) { } elseif(preg_match('/^\/themes(\/(\w+))?$/', $query, $match)) {
if($mod['type'] < $config['mod']['themes']) error($config['error']['noaccess']); if($mod['type'] < $config['mod']['themes']) error($config['error']['noaccess']);
if(!is_dir($config['dir']['homepage'])) if(!is_dir($config['dir']['themes']))
error('Homepage directory doesn\'t exist!'); error('Themes directory doesn\'t exist!');
if(!$dir = opendir($config['dir']['homepage'])) if(!$dir = opendir($config['dir']['themes']))
error('Cannot open homepage directory; check permissions.'); error('Cannot open themes directory; check permissions.');
if(isset($match[2])) { if(isset($match[2])) {
$_theme = &$match[2]; $_theme = &$match[2];
@ -406,7 +406,7 @@
// Scan directory for themes // Scan directory for themes
$themes = Array(); $themes = Array();
while($file = readdir($dir)) { while($file = readdir($dir)) {
if($file[0] != '.' && is_dir($config['dir']['homepage'] . '/' . $file)) { if($file[0] != '.' && is_dir($config['dir']['themes'] . '/' . $file)) {
$themes[] = $file; $themes[] = $file;
} }
} }
@ -436,7 +436,7 @@
'</tr>' . '</tr>' .
'<tr>' . '<tr>' .
'<th class="minimal">Thumbnail</th>' . '<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>' .
'<tr>' . '<tr>' .
'<th class="minimal">Actions</th>' . '<th class="minimal">Actions</th>' .

0
templates/homepage/basic/info.php → templates/themes/basic/info.php

0
templates/homepage/basic/theme.php → templates/themes/basic/theme.php

0
templates/homepage/basic/thumb.png → templates/themes/basic/thumb.png

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

0
templates/homepage/frameset/info.php → templates/themes/frameset/info.php

0
templates/homepage/frameset/theme.php → templates/themes/frameset/theme.php

0
templates/homepage/frameset/thumb.png → templates/themes/frameset/thumb.png

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

0
templates/homepage/recent/info.php → templates/themes/recent/info.php

0
templates/homepage/recent/recent.css → templates/themes/recent/recent.css

0
templates/homepage/recent/theme.php → templates/themes/recent/theme.php

0
templates/homepage/recent/thumb.png → templates/themes/recent/thumb.png

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Loading…
Cancel
Save