Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- | Tema Manager Sederhana
- | Koding by Yaya Laressa
- */
- class Tema {
- public $namafile;
- public function __construct($namafile) {
- $this->namafile = $namafile;
- }
- public function terapkan() {
- $file = sprintf('./tema/%s.html', $this->namafile);
- $fh_skin = fopen($file, 'r');
- $tema = @fread($fh_skin, filesize($file));
- fclose($fh_skin);
- return $this->jalankan($tema);
- }
- private function jalankan($tema) {
- $tema = preg_replace_callback('/{\$th->(.+?)}/i', create_function('$matches', 'global $TH; return $TH[$matches[1]];'), $tema);
- return $tema;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement