![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
11/04/2009, 08:53
|
| | Fecha de Ingreso: abril-2009
Mensajes: 29
Antigüedad: 15 años, 10 meses Puntos: 0 | |
Respuesta: Configurar Smarty guestbook_setup.php :
<?php
/**
* Project: Guestbook Sample Smarty Application
* Author: Monte Ohrt <monte [AT] ohrt [DOT] com>
* Date: March 14th, 2005
* File: guestbook_setup.php
* Version: 1.0
*/
require(GUESTBOOK_DIR . 'libs/sql.lib.php');
require(GUESTBOOK_DIR . 'libs/guestbook.lib.php');
//require(SMARTY_DIR . 'Smarty.class.php');
require('Smarty.class.php');
require('DB.php'); // PEAR DB
// database configuration
class GuestBook_SQL extends SQL {
function GuestBook_SQL() {
// dbtype://user:pass@host/dbname
$dsn = "mysql://guestbook:foobar@localhost/GUESTBOOK";
$this->connect($dsn) || die('could not connect to database');
}
}
// smarty configuration
class Guestbook_Smarty extends Smarty {
function Guestbook_Smarty() {
$this->template_dir = GUESTBOOK_DIR . 'templates';
$this->compile_dir = GUESTBOOK_DIR . 'templates_c';
$this->config_dir = GUESTBOOK_DIR . 'configs';
$this->cache_dir = GUESTBOOK_DIR . 'cache';
}
}
?> |