Skip to content

Commit

Permalink
theme is set with one line in config instead of two
Browse files Browse the repository at this point in the history
  • Loading branch information
btanaka committed May 24, 2009
1 parent 52089bc commit 7e7af8a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
8 changes: 6 additions & 2 deletions html/lib/mpebble.class.php
Expand Up @@ -34,15 +34,18 @@ function printfooter() {
function render_template() {
// consult config constants for particulars
// print the template, substituting along the way
if ($handle = fopen(MPEBBLETEMPLATE, "r")) {
$themepath = "./themes/" . MPEBBLETHEME . "/";
$themetemplate = "$themepath" . MPEBBLETHEME . ".html";
$themecss = "$themepath" . MPEBBLETHEME . ".css";
if ($handle = fopen($themetemplate, "r")) {
$content = "";
while (!feof($handle)) {
$buffer = fgets($handle, 4096);
// substitute here
$patterns[0] = '/<%SITETITLE%>/';
$replacements[0] = SITETITLE;
$patterns[1] = '/<%CSS%>/';
$replacements[1] = CSS;
$replacements[1] = $themecss;
$patterns[2] = '/<%TAGLINE%>/';
$replacements[2] = TAGLINE;
$patterns[3] = '/<%FOOTER%>/';
Expand Down Expand Up @@ -74,3 +77,4 @@ function render_template() {
}

} #class

10 changes: 6 additions & 4 deletions html/mpebble.conf.php
@@ -1,17 +1,19 @@
<?php

#
# Opw Template Engine Config
# MoonpebbleCMS Config
#

define('SITETITLE', 'MoonpebbleCMS');
define('TAGLINE', 'A tiny, lightweight, super cool CMS...');
define('FOOTER', 'Footers are good eating!');
define('BASEPATH', '/Users/btanaka/stuffs/stuff.1/m/moonpebblecms.d/html');
#define('CSS', './templates/default/default.css');
define('CSS', './templates/superplain/superplain.css');
define('MPEBBLETEMPLATE', './templates/default/default.html');
define('MPEBBLETHEME', 'superplain'); // set to theme's name
define('MPEBBLECONTENT', './user_files/mpebble.content.mdwn');

#define('CSS', './templates/default/default.css');
#define('CSS', './templates/superplain/superplain.css');
#define('MPEBBLETEMPLATE', './templates/default/default.html');

?>

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 7e7af8a

Please sign in to comment.