summaryrefslogtreecommitdiffstats
path: root/templates/bbcode.inc.php
blob: e04d57595cd4e355e2ecc6f2f94410145a92ef7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?PHP
  require_once('code/message.inc.php');
  require_once('code/modules.inc.php');
  
  require_mod('code/bbcode.inc.php');
  
  class bbcode_template {
    function Get($data) {
      if($data['title'])
        $title = strtr($data['title'], array('<' => '&lt;', '>' => '&gt;', '&' => '&amp;', '"' => '&quot;'));
      else
        $title = strtr($data['_page'], array(':' => ' - '));
      $content = '<h2>' . $title . '</h2>' . $GLOBALS['bbcode']->Parse($data['code']);
      
      return array('title' => $title, 'content' => $content);
    }
  }
  
  $GLOBALS['templates']['bbcode'] = new bbcode_template;
?>