Created
December 24, 2010 17:34
-
-
Save tarnfeld/754415 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include 'config.php'; | |
// This should go in your config.php ^^ | |
define('BASEPATH', dirname(__FILE__)); | |
// Also, convention is capitals for constants | |
define('NAME', "Tom"); | |
function tint($tinty){ | |
$tint_content = file_get_contents(BASEPATH . "pages/" . $tinty . ".txt"); | |
$tint_content = str_replace('<tint:content("', '<?php echo tint_content("', $tint_content); | |
$tint_content = str_replace('") />', '"); ?>', $tint_content); | |
echo str_replace("<tint:name />", NAME, $tint_content); | |
} | |
function tint_content($tint){ | |
$tint_content = file_get_contents(BASEPATH . "content/".$tint.".txt"); | |
return str_replace("<tint:name />", NAME, $tint_content); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment