function __construct() { parent::__construct(); $this->template_dir = config::servroot() . "/protected/smarty/templates"; $this->compile_dir = config::servroot() . "/protected/smarty/templates_c"; $this->cache_dir = config::servroot() . "/protected/smarty/cache"; $this->config_dir = config::servroot() . "/protected/smarty/config"; //$this->default_modifiers = array('escape:"htmlall":"UTF-8"','nl2br'); $this->assign('webroot', config::webroot()); }
<?php require_once '../protected/config.php'; require_once config::servroot() . "/protected/smarty/template.php"; $template = new template(); /* require_once ('../protected/db/dbview.php'); $dbh = new dbview(); */ /* $template->assign('name', 'World'); */ $template->display('index.tpl');
<?php require_once '../../../protected/config.php'; require_once config::servroot() . "/protected/smarty/template.php"; $template = new template(); require_once config::servroot() . "/protected/db/dbview.php"; $dbh = new dbview(); // Find the tournament specified by the URL $sres = $dbh->get('select count(*) as many from tournaments where id = :id and year = :year and aka = :aka', array(':id' => $_GET['id'], ':aka' => $_GET['aka'], ':year' => $_GET['year'])); if (0 == $sres[0]['many']) { error_log("Can't find series: aka: {$_GET['aka']}, id: {$_GET['id']}, year: {$_GET['year']}"); // Find all tournaments with a given aka $akaAll = 'select tournaments.name as name, tournaments.year, tournaments.id, start, host, schools.name as sname from tournaments left join schools on host = schools.id and tournaments.year = schools.year where tournaments.aka = :aka order by start desc, tournaments.name'; // All tournaments witht eh aka given by the URL $akaGrp = $dbh->get($akaAll, array(':aka' => $_GET['aka']));