calendario/index.php :
Código PHP:
//-- calendar use example --//
include("calendario/calendar.php");
$calendar = new WingedCalendar();
$calendar->show_calendar(1, 0);
//-- check document root setting --//
print dirname($_SERVER['PHP_SELF'])==$calendar->htpath? '<p>Document Root is set correctly.</p>' : '<p>Error: Wrong document root. Ask your host about it.</p>';
Código PHP:
$cal_cfg = array('path' => str_replace('\\', '/', dirname(__FILE__)));
include($cal_cfg['path'] . '/config.php');
function WingedCalendar() {
global $cal_cfg;
$this->templates = $cal_cfg['template'];
$this->password = $cal_cfg['password'];
$this->sunday_endweek = $cal_cfg['sunday_endweek'];
$this->months = $cal_cfg['month'];
$this->timezone = $cal_cfg['timezone'];
$this->charset = $cal_cfg['charset'];
$this->html = $cal_cfg['html'];
$this->hour12 = $cal_cfg['12_hour'];
$this->datapath = $cal_cfg['path'] . '/data.txt';
$docroot = $cal_cfg['document_root']? $cal_cfg['document_root'] : $_SERVER['DOCUMENT_ROOT'];
$this->htpath = str_replace($docroot, '', $cal_cfg['path']);
for ($i=0, $n=count($cal_cfg['day']); $i<$n; $i++) {
$this->days[]['day'] = $cal_cfg['day'][$i];
}
}
Código PHP:
//-- document root --//
$cal_cfg['document_root'] = '/home/natacion/public_html/';
GRACIAS desde ya!-)