diff options
| author | root | 2014-10-19 03:54:53 +0200 |
|---|---|---|
| committer | root | 2014-10-19 03:54:53 +0200 |
| commit | 2330bb06ececee220d854883a2870a3adf17c277 (patch) | |
| tree | e49f6b561faf5b39a81d57d54fa57a1550074c0f /class/moar.php | |
| parent | a3009bf57d50fbc25a707b32fb3c5c170d011680 (diff) | |
| download | jungegemeinde-2330bb06ececee220d854883a2870a3adf17c277.tar.gz | |
Version 4.1. Support for photo galleries and advanced caching.
Diffstat (limited to 'class/moar.php')
| -rw-r--r-- | class/moar.php | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/class/moar.php b/class/moar.php new file mode 100644 index 0000000..822640f --- /dev/null +++ b/class/moar.php @@ -0,0 +1,58 @@ +<?php + +class Moar { + + private $header = array(); + private $footer = array(); + + public function __construct(){ + return true; + } + + public function addHeader($string){ + $this->header[] = $string; + } + + public function addFooter($string){ + $this->footer[] = $string; + } + + public function playHeader(){ + if ( ! empty( $this->header ) ){ + foreach( $this->header as $value ){ + echo $value; + } + } + $this->deleteHeader(); + } + + public function playFooter(){ + if ( ! empty( $this->footer ) ){ + foreach( $this->footer as $value ){ + echo $value; + } + } + $this->deleteFooter(); + } + + public function deleteHeader(){ + unset( $this->header ); + } + + public function deleteFooter(){ + unset( $this->footer ); + + } + + public function magicHeader($html){ + ob_start(); + $this->playHeader(); + $header = ob_get_contents(); + ob_end_clean(); + return preg_replace("/\<\!\-\-%%placeholder\-head%%\-\-\>/", $header, $html); + } + + public function __destruct(){ + return true; + } +} |
