Added constant definition, and other small edits...

git-svn-id: file:///Users/jimeh/Desktop/dlist/trunk@5 a5845835-ea0f-0410-a762-dd0bfe9bfde8
This commit is contained in:
jim
2006-03-29 11:44:07 +00:00
parent 15f66fb6a1
commit 3830a5312e
7 changed files with 53 additions and 18 deletions

View File

@@ -1,10 +1,10 @@
<?php die();
//
// core
// Exec: core
//
// Created on 21-Mar-2006.
// Copyright © Jim Myhrberg. All rights reserved.
// Copyright © 2006 Jim Myhrberg. All rights reserved.
// zynode@gmail.com
//
//_HEAD;
@@ -19,6 +19,17 @@ Author: Jim Myhrberg
//>STAGE> init
//==========================
//>Section> define_constants
define('DIR_URL', $dir_url);
define('DIR_PATH', $dir_path);
define('QUERY_STRING', $query_string);
define('DLIST_URL', $config['url']);
define('TEMPLATE', $config['template']);
define('TPL_URL', DLIST_URL.'templates/'.TEMPLATE.'/');
//>Section> port_correction
if ( stristr($_SERVER['HTTP_HOST'], ':') !== false ) {
$http_host = explode(':', $_SERVER['HTTP_HOST'], 2);
@@ -28,25 +39,30 @@ if ( stristr($_SERVER['HTTP_HOST'], ':') !== false ) {
preg_match("/(.*)Port [0-9]{2,8}(.*)/", $_SERVER['SERVER_SIGNATURE'], $serverinfo);
$_SERVER['SERVER_SIGNATURE'] = $serverinfo[1].'Port '.$_SERVER['SERVER_PORT'].$serverinfo[2];
//>Section> set_vars
$do_readdir = true;
$do_render = true;
//==========================
//>STAGE> main
//==========================
//>Section> init_dList
if ( $do_readdir ) {
$dlist = new dirlist();
// $dlist->show_hidden = true;
$dlist->read($dir_path);
if ($config['show_hidden']) $dlist->show_hidden = true;
$dlist->read(DIR_PATH);
}
//==========================
//>STAGE> render
//==========================
//>Section> echo
print_r($dlist->list);